aboutsummaryrefslogtreecommitdiff
path: root/src/tpc.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/tpc.y')
-rw-r--r--src/tpc.y20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/tpc.y b/src/tpc.y
index 4acc009..d8fd1f1 100644
--- a/src/tpc.y
+++ b/src/tpc.y
@@ -55,32 +55,32 @@ static char fname[64];
55%precedence ELSE 55%precedence ELSE
56 56
57%% 57%%
58Prog: { gen_prologue(); } 58Prog: { gen_prologue(); }
59 DeclConsts DeclVars DeclFoncts { gen_const_declaration(); } 59 DeclConsts DeclVars DeclFoncts { gen_const_declaration(); }
60; 60;
61DeclConsts: 61DeclConsts:
62 DeclConsts CONST ListConst ';' 62 DeclConsts CONST ListConst ';'
63| 63|
64; 64;
65ListConst: 65ListConst:
66 ListConst ',' IDENT '=' Litteral 66 ListConst ',' IDENT '=' Litteral { gen_const($<ident>1, $<num>3, scope); }
67| IDENT '=' Litteral 67| IDENT '=' Litteral { gen_const($<ident>1, $<num>3, scope); }
68; 68;
69Litteral: 69Litteral:
70 NombreSigne 70 NombreSigne { $<num>$ = $<num>1; }
71| CARACTERE 71| CARACTERE { $<num>$ = $<num>1; }
72; 72;
73NombreSigne: 73NombreSigne:
74 NUM 74 NUM { $<num>$ = $<num>1; }
75| ADDSUB NUM 75| ADDSUB NUM { $<num>$ = $<addsub>1 == '-' ? - $<num>2 : $<num>2; }
76; 76;
77DeclVars: 77DeclVars:
78 DeclVars TYPE Declarateurs ';' 78 DeclVars TYPE Declarateurs ';'
79| 79|
80; 80;
81Declarateurs: 81Declarateurs:
82 Declarateurs ',' Declarateur { gen_declaration($<ident>3, $<type>0, scope); } 82 Declarateurs ',' Declarateur { gen_declaration($<ident>3, $<type>0, scope); }
83| Declarateur { gen_declaration($<ident>1, $<type>0, scope); } 83| Declarateur { gen_declaration($<ident>1, $<type>0, scope); }
84; 84;
85Declarateur: 85Declarateur:
86 IDENT 86 IDENT