diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-08-18 22:27:52 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-08-18 22:27:52 -0400 |
commit | dd07055aca1c45d147d773350e0c21930822a74f (patch) | |
tree | 8d19ee459aabb4fb1a849049299fb06a106508ee /tree.c | |
parent | f9ff4c818cee8c8b83e9a3d5161d4de2b8443146 (diff) |
Add for loop parsing
Also fixes tree printing
Diffstat (limited to 'tree.c')
-rw-r--r-- | tree.c | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -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); |