Reputation: 546
my code is the following:
%%
%token blablabla
%%
expresion: operand
operand '-' expresion
|operand '+' expresion
| '(' expresion ')' /*Conflict line*/
;
/*terminal symbols */operand: IDENTIFIER { printf (" %s ", $1) ; }
| NUMBER { printf (" %s ", $1) ; }
;
I get 3 reduce/reduce warnings when compiling (even though the code runs correctly). How can I get rid of these warnings?
Upvotes: 0
Views: 128
Reputation: 21617
Methinks you want
%left '-' '+'
expression : operand
| expression '-' expression
| expression '+' expression
| '(' expression ')'
Upvotes: 1