Machine-translated by Google. Questions are authored in English.
Top

Discussion

Consider the following statements about LALR parsing.
1. It has the same number of states as the SLR parser.
2. Merging states can introduce reduce-reduce conflicts.
3. It can introduce shift-reduce conflicts not present in canonical LR.

  • A.1 and 2 only
  • B.3 only
  • C.1 only
  • D.All of them

Answer: A

LALR has the SLR state count with better lookaheads. Merging may create a reduce-reduce conflict but provably never a shift-reduce one, so the third statement is false. That asymmetry is a standard result quoted in every treatment of the method.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.