diff options
Diffstat (limited to 'src/tpc.y')
-rw-r--r-- | src/tpc.y | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 | ; |
132 | IfHandling: { gen_if_start($<num>$ = num_if++); }; | 132 | IfHandling: { gen_if_start($<num>$ = num_if++); }; |