|
|
@@ -138,6 +138,7 @@ void print_tac(TLIST* tac_list) {
|
|
138
|
138
|
if (op == AUTO) printf("param %s\n", stok(ptr->elem->dst));
|
|
139
|
139
|
if (op == APPLY) printf("call %s, %s\n", stok(ptr->elem->dst), stok(ptr->elem->tgt));
|
|
140
|
140
|
if (op == 278) printf("arg %s\n", stok(ptr->elem->dst));
|
|
|
141
|
+ if (op == 279) printf("end %s\n", stok(ptr->elem->dst));
|
|
141
|
142
|
ptr = ptr->next;
|
|
142
|
143
|
}
|
|
143
|
144
|
}
|
|
|
@@ -262,6 +263,7 @@ TOKEN* build_tac(NODE *tree, TACS* tac) {
|
|
262
|
263
|
}
|
|
263
|
264
|
}
|
|
264
|
265
|
build_tac(tree->right, tac);
|
|
|
266
|
+ new_tac(tac, (TOKEN*) tree->left->right->left->left, NULL, NULL, 279);
|
|
265
|
267
|
} else if (type == APPLY) {
|
|
266
|
268
|
TOKEN* ret_val = gen_tmp();
|
|
267
|
269
|
if (tree->right != NULL) {
|