aboutsummaryrefslogtreecommitdiff
path: root/tree.c
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-08-18 22:27:52 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-08-18 22:27:52 -0400
commitdd07055aca1c45d147d773350e0c21930822a74f (patch)
tree8d19ee459aabb4fb1a849049299fb06a106508ee /tree.c
parentf9ff4c818cee8c8b83e9a3d5161d4de2b8443146 (diff)
Add for loop parsing
Also fixes tree printing
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/tree.c b/tree.c
index 1874712..fd40781 100644
--- a/tree.c
+++ b/tree.c
@@ -164,15 +164,24 @@ int spaces;
case IF:
fprintf(stderr, "[IF]");
break;
+ case THEN:
+ fprintf(stderr, "[THEN]");
+ break;
case WHILE:
fprintf(stderr, "[WHILE]");
break;
- case THEN:
- fprintf(stderr, "[THEN]");
+ case FOR:
+ fprintf(stderr, "[FOR]");
+ break;
+ case TO:
+ fprintf(stderr, "[TO]");
+ break;
+ case DT:
+ fprintf(stderr, "[DOWN-TO]");
break;
- default:
- fprintf(stderr, "\t%d", t->type);
- yyerror("Error in tree_print");
+ default:
+ fprintf(stderr, "\t%d", t->type);
+ yyerror("Error in tree_print");
}
fprintf(stderr," %d\n", t->ret_type);
aux_tree_print(t->l, spaces + 2);