|
|
@ -637,32 +637,38 @@ oop new_C_parameter(oop paramSpecifiers, oop declarator) { |
|
|
|
|
|
|
|
OopStack listOfLists= BUFFER_INITIALISER; |
|
|
|
oop currentList= 0; |
|
|
|
int isEmpty = 0; |
|
|
|
|
|
|
|
void listBegin(void) |
|
|
|
{ |
|
|
|
OopStack_push(&listOfLists, currentList); |
|
|
|
currentList= makeMap(); |
|
|
|
isEmpty = 1; |
|
|
|
} |
|
|
|
|
|
|
|
void listAppend(oop obj) |
|
|
|
{ |
|
|
|
assert(currentList); |
|
|
|
map_append(currentList, obj); |
|
|
|
isEmpty = 0; |
|
|
|
} |
|
|
|
|
|
|
|
void listAppend2(oop obj1, oop obj2) { |
|
|
|
assert(currentList); |
|
|
|
map_append(currentList, obj1); |
|
|
|
map_append(currentList, obj2); |
|
|
|
isEmpty = 0; |
|
|
|
} |
|
|
|
|
|
|
|
void listWith(oop obj) { |
|
|
|
listBegin(); |
|
|
|
listAppend(obj); |
|
|
|
isEmpty = 0; |
|
|
|
} |
|
|
|
|
|
|
|
oop listEnd(void) |
|
|
|
{ |
|
|
|
if(isEmpty) return null; |
|
|
|
assert(currentList); |
|
|
|
oop list= currentList; |
|
|
|
currentList= OopStack_pop(&listOfLists); |
|
|
@ -3871,7 +3877,6 @@ void outputTree(oop node, int depth) |
|
|
|
printf("<null>\n"); |
|
|
|
return; |
|
|
|
} |
|
|
|
printSpace(depth); |
|
|
|
switch (getType(node)) { |
|
|
|
case Undefined: |
|
|
|
return; |
|
|
@ -3905,9 +3910,10 @@ void outputTree(oop node, int depth) |
|
|
|
} |
|
|
|
// proto_number is the enum version of the proto symbol |
|
|
|
proto_t proto_number= get(map_get(proto, __name___symbol), Symbol, prototype); |
|
|
|
printSpace(depth); |
|
|
|
switch (proto_number) { |
|
|
|
#define CASE(NAME) case t_##NAME:printf("%s:\n", #NAME); |
|
|
|
#define OUT(NAME) outputTree(map_get(node, text_symbol), depth+DELTA); |
|
|
|
#define OUT(NAME) printSpace(depth+DELTA) ; outputTree(map_get(node, text_symbol), 0); |
|
|
|
CASE(Comment) |
|
|
|
OUT(Comment); |
|
|
|
break; |
|
|
@ -3920,7 +3926,7 @@ void outputTree(oop node, int depth) |
|
|
|
/** C terminal nodes */ |
|
|
|
|
|
|
|
#define CASE(NAME) case t_C_##NAME:printf("%s:\n", #NAME); |
|
|
|
#define OUT(NAME) outputTree(map_get(node, NAME##_symbol), depth+DELTA); |
|
|
|
#define OUT(NAME) printSpace(depth+DELTA) ; outputTree(map_get(node, NAME##_symbol), 0); |
|
|
|
CASE(int) |
|
|
|
OUT(text); |
|
|
|
break; |
|
|
@ -3959,7 +3965,7 @@ void outputTree(oop node, int depth) |
|
|
|
/** C nodes */ |
|
|
|
|
|
|
|
#define CASE(NAME) case t_C_##NAME:printf("%s:\n", #NAME); |
|
|
|
#define OUT(NAME) printSpace(depth+DELTA); printf("(%s)\n", #NAME); outputTree(map_get(node, NAME##_symbol), depth+2*DELTA); |
|
|
|
#define OUT(NAME) printSpace(depth+DELTA) ; printf("(%s)\n", #NAME); outputTree(map_get(node, NAME##_symbol), depth+2*DELTA); |
|
|
|
CASE(if) |
|
|
|
OUT(ifTok); |
|
|
|
OUT(lparen); |
|
|
|