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

Discussion

The augmented grammar used in LR parsing adds

  • A.a new start production so acceptance has a unique reduction
  • B.an extra production for every terminal in the grammar
  • C.epsilon productions for each nonterminal that lacks one
  • D.a production removing left recursion from the start symbol

Answer: A

Adding S prime going to S means the parser accepts by reducing that one production. Without it, acceptance would be harder to detect unambiguously. The augmentation costs one extra state and removes an awkward special case.

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

Post your comment

Please log in or register to post a comment.