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

Discussion

A shift-reduce conflict in an LR table means the cell contains

  • A.no action at all for the lookahead token in that state
  • B.a goto entry where an action entry was expected
  • C.both a shift action and a reduce action for the same lookahead
  • D.two entirely different reduce actions for the same lookahead token

Answer: C

The parser cannot tell whether to extend the current construct or to complete it. The dangling else is the classic instance, and generators usually resolve it by preferring the shift. The report should still be read, since a genuine grammar fault looks identical.

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

Post your comment

Please log in or register to post a comment.