5 questions to test your understanding
In the dangling-else problem, a parser generator defaults to preferring shift over reduce when it encounters the conflict on the 'else' token. What parse tree does this default produce for `if a then if b then s1 else s2`?
A grammar has a reduce-reduce conflict. The developer adds '%left' declarations to suppress it and all parser tests pass. What risk has been introduced?
Any conflict in an LALR grammar is evidence of a design error and should be eliminated by rewriting the grammar.
A reduce-reduce conflict is generally more dangerous than a shift-reduce conflict and should rarely be suppressed with precedence declarations.
Why is a reduce-reduce conflict generally more concerning than a shift-reduce conflict, and what should a grammar designer do when they encounter one?