fixed shift-reduce conflict

This commit is contained in:
Ur Mom 2024-05-13 13:45:22 +02:00
parent 76558e89ed
commit 9eba9d1437
1 changed files with 5 additions and 7 deletions

View File

@ -62,6 +62,7 @@
%left OpEquals OpNot '<' '>' %left OpEquals OpNot '<' '>'
%left OpAnd OpOr OpXor %left OpAnd OpOr OpXor
%left OpBitand OpBitor OpBitxor OpBitnot %left OpBitand OpBitor OpBitxor OpBitnot
%nonassoc KeyAs '(' ')'
%% %%
program: program programbody program: program programbody
@ -74,8 +75,6 @@ programbody: moduleimport
| decl | decl
| typedef; | typedef;
expr: ValFloat expr: ValFloat
| ValInt | ValInt
| ValMultistr | ValMultistr
@ -83,7 +82,9 @@ expr: ValFloat
| Ident | Ident
| operation | operation
| boxaccess | boxaccess
| boxselfaccess; | boxselfaccess
| typecast
| reinterpretcast;
exprlist: expr ',' exprlist exprlist: expr ',' exprlist
| expr; | expr;
@ -166,10 +167,7 @@ identlist: Ident ',' identlist
decl: type ':' identlist decl: type ':' identlist
| storagequalifier type ':' identlist | storagequalifier type ':' identlist
definition: decl '=' expr { DEBUG("Definition"); };
definition: decl '=' expr { DEBUG("Definition"); }
| decl '=' typecast { DEBUG("Definition"); };
| decl '=' reinterpretcast { DEBUG("Definition"); };
storagequalifier: KeyGlobal storagequalifier: KeyGlobal
| KeyStatic | KeyStatic