aboutsummaryrefslogtreecommitdiff
path: root/gen_code.c
diff options
context:
space:
mode:
Diffstat (limited to 'gen_code.c')
-rw-r--r--gen_code.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gen_code.c b/gen_code.c
index 30975f0..0faa068 100644
--- a/gen_code.c
+++ b/gen_code.c
@@ -71,12 +71,24 @@ ptree *t;
}
}
+gen_statement_order(t)
+ptree *t;
+{
+ if (t->type != LIST){
+ gen_statement(t);
+ return;
+ }
+
+ gen_statement_order(t->l);
+ gen_statement_order(t->r);
+
+}
+
void gen_code(t, name)
ptree *t;
char *name;
{
printf("\n.globl %s\n.type %s, @function\n%s:\n", name, name, name);
- /*TODO call gen_statement on all statements in LIST t*/
- /*Look at set_type for list traverseal code*/
+ gen_statement_order(t);
}