Hi, I have a rule defined as follow:
comando : IF '(' exp ')' comando parte_else
| WHILE '(' exp ')' comando
| FOR '(' exp '=' exp ';' exp ';' exp ')' comando
;
parte_else : ELSE comando
| /* empty */
;
It's a more then famous shift/reduce problem, but the weird thing is that in my output is says the reduce is the default action, when I want to shift. I was told that bison would make shift default. How do I fix it?
grammar.output:
state 213
63 comando: IF '(' exp ')' comando .
64 | IF '(' exp ')' comando . ELSE comando
ELSE shift, and go to state 216
ELSE [reduce using rule 63 (comando)]
$default reduce using rule 63 (comando)
Start Free Trial