aboutsummaryrefslogtreecommitdiff
path: root/src/tpc.y
diff options
context:
space:
mode:
authorpacien2018-06-05 23:05:46 +0200
committerpacien2018-06-05 23:05:46 +0200
commit12c6e05e4c341e3db89e4551299b3f10e7623542 (patch)
tree73051e24d0c4e0ca8ee47b56cb83453177bedbb8 /src/tpc.y
parent9a661bc8e79398cb842a64fcd3169c3895d48a54 (diff)
parenta037a641ca537f012865b2655917207af683ea1f (diff)
downloadtpc-compiler-12c6e05e4c341e3db89e4551299b3f10e7623542.tar.gz
Merge branch 'master' of https://github.com/pacien/upem-compil-tpc
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 64652d9..7321780 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++); };