aboutsummaryrefslogtreecommitdiff
path: root/src/tpc.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/tpc.y')
-rw-r--r--src/tpc.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tpc.y b/src/tpc.y
index 16dc5ad..1e6b6e2 100644
--- a/src/tpc.y
+++ b/src/tpc.y
@@ -135,9 +135,9 @@ Instr:
135| IF '(' Exp IfHandling')' Instr { gen_if_label($<num>4); } 135| IF '(' Exp IfHandling')' Instr { gen_if_label($<num>4); }
136| IF '(' Exp IfHandling')' Instr 136| IF '(' Exp IfHandling')' Instr
137 ELSE IfEndHandling Instr IfElseEndHandling 137 ELSE IfEndHandling Instr IfElseEndHandling
138| WHILE { fprintf(output,".upwhile%d:\n", num_while); } 138| WHILE { gen_while_start(num_while); }
139 '(' Exp { fprintf(output,"pop rax\ncmp rax,0\njz .downwhile%d\n", num_while); } 139 '(' Exp { gen_while_cond(num_while); }
140 ')' Instr { fprintf(output,"jmp .upwhile%d\n.downwhile%d:\n", num_while, num_while); num_while++; } 140 ')' Instr { gen_while_end(num_while++); }
141| '{' SuiteInstr '}' 141| '{' SuiteInstr '}'
142; 142;
143IfHandling: { gen_if_start($<num>$ = num_if++); }; 143IfHandling: { gen_if_start($<num>$ = num_if++); };