fixed shift reduce conflicts in typecast

This commit is contained in:
Ur Mom 2024-05-15 15:50:26 +02:00
parent 9eba9d1437
commit 7da3c9151d
1 changed files with 13 additions and 6 deletions

View File

@ -58,11 +58,18 @@
/* Operator associativity */ /* Operator associativity */
%right '=' %right '='
%left '+' '-' '*' '/' %left OpOr
%left OpEquals OpNot '<' '>' %left OpXor
%left OpAnd OpOr OpXor %left OpAnd
%left OpBitand OpBitor OpBitxor OpBitnot %left OpBitor
%nonassoc KeyAs '(' ')' %left OpBitxor
%left OpBitand
%left OpEquals '<' '>'
%left '+' '-'
%left '*' '/'
%left OpNot OpBitnot
%left KeyAs
%left '(' ')'
%% %%
program: program programbody program: program programbody
@ -109,7 +116,7 @@ IOqualifyier: KeyIn
| KeyOut KeyIn | KeyOut KeyIn
| ; | ;
typecast: expr KeyAs type { DEBUG("Type-Cast"); }; typecast: expr KeyAs type %prec KeyAs { DEBUG("Type-Cast"); };
reinterpretcast: '(' type ')' expr { DEBUG("Reinterpret-Cast"); }; reinterpretcast: '(' type ')' expr { DEBUG("Reinterpret-Cast"); };