aboutsummaryrefslogtreecommitdiff
path: root/src/tpc.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/tpc.y')
-rw-r--r--src/tpc.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tpc.y b/src/tpc.y
index d8fd1f1..f84c0a6 100644
--- a/src/tpc.y
+++ b/src/tpc.y
@@ -126,7 +126,7 @@ Instr:
126| PRINT '(' Exp ')' ';' { gen_print($<type>3);} 126| PRINT '(' Exp ')' ';' { gen_print($<type>3);}
127| IF '(' Exp IfHandling')' Instr { gen_if_label($<num>4); } 127| IF '(' Exp IfHandling')' Instr { gen_if_label($<num>4); }
128| IF '(' Exp IfHandling')' Instr ELSE IfEndHandling Instr IfElseEndHandling 128| IF '(' Exp IfHandling')' Instr ELSE IfEndHandling Instr IfElseEndHandling
129| WHILE '(' Exp ')' Instr 129| WHILE {fprintf(output,".upwhile%d:\n",num_while);}'(' Exp {fprintf(output,"pop rax\ncmp rax,0\njz .downwhile%d\n",num_while);}')' Instr {fprintf(output,"jmp .upwhile%d\n.downwhile%d:\n",num_while,num_while);num_while++;}
130| '{' SuiteInstr '}' 130| '{' SuiteInstr '}'
131; 131;
132IfHandling: { gen_if_start($<num>$ = num_if++); }; 132IfHandling: { gen_if_start($<num>$ = num_if++); };