The error message:
bison -vdy tjc.y
conflicts: 2 shift/reduce
tjc.y:72.26-29: warning: rule useless in parser due to conflicts: return_type: type
EDIT 2: Further reduced the grammar to only the following rules. Same error due to same conflict. If I remove field_decl in the rules then the conflict goes away.
member_decl: field_decl | method_decl;
field_decl: STATIC type IDENT EQ SEMI;
method_decl: STATIC return_type IDENT LPAR RPAR;
type: INT | FLOAT;
return_type: type | VOID;
Here's the section with the shift/reduce conflict in y.output:
state 18
7 field_decl: STATIC type . IDENT EQ SEMI
14 return_type: type .
IDENT shift, and go to state 23
IDENT [reduce using rule 14 (return_type)]
Please help me see what's going wrong here.