Removing shift/reduce conflict on optional else block
问题 I'm in the process of defining a grammar with Bison and I stumbled upon a shift/reduce conflict I'd like to eliminate. The conflict is caused by a rule that aims to match if/else statements: state 17 13 Stmt: IfBlock . OptionalElseBlock ELSE shift, and go to state 42 ELSE [reduce using rule 16 (OptionalElseBlock)] $default reduce using rule 16 (OptionalElseBlock) OptionalElseBlock go to state 43 The OptionalElseBlock was defined as follows: 16 OptionalElseBlock: /* empty */ 17 | ELSE Stmt