aboutsummaryrefslogtreecommitdiff
path: root/src/tpc.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/tpc.y')
-rw-r--r--src/tpc.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tpc.y b/src/tpc.y
index 9878ce7..4acc009 100644
--- a/src/tpc.y
+++ b/src/tpc.y
@@ -23,6 +23,7 @@ static Type return_type = VOID_T;
23static int bss_done = 0; 23static int bss_done = 0;
24static int num_label = 0; 24static int num_label = 0;
25static int num_if = 0; 25static int num_if = 0;
26static int num_while = 0;
26static int nb_param[255]; 27static int nb_param[255];
27static int num_scope = -1; 28static int num_scope = -1;
28static char fname[64]; 29static char fname[64];
@@ -125,7 +126,7 @@ Instr:
125| PRINT '(' Exp ')' ';' { gen_print($<type>3);} 126| PRINT '(' Exp ')' ';' { gen_print($<type>3);}
126| IF '(' Exp IfHandling')' Instr { gen_if_label($<num>4); } 127| IF '(' Exp IfHandling')' Instr { gen_if_label($<num>4); }
127| IF '(' Exp IfHandling')' Instr ELSE IfEndHandling Instr IfElseEndHandling 128| IF '(' Exp IfHandling')' Instr ELSE IfEndHandling Instr IfElseEndHandling
128| WHILE '(' Exp ')' Instr 129| WHILE '(' Exp ')' Instr
129| '{' SuiteInstr '}' 130| '{' SuiteInstr '}'
130; 131;
131IfHandling: { gen_if_start($<num>$ = num_if++); }; 132IfHandling: { gen_if_start($<num>$ = num_if++); };