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

Discussion

The parse is accepted when the parser

  • A.finds that no further reduction at all is possible in that state
  • B.reduces the augmented start production with the input exhausted
  • C.empties its stack completely of all grammar symbols
  • D.reaches the last token of the input without any error

Answer: B

Correct answer: reduces the augmented start production with the input exhausted

The grammar is augmented with a production from a new start symbol to the original one precisely so that acceptance has a definite marker: reducing that production with the end-of-input marker as lookahead is the accept action. An empty stack or a merely exhausted input is not the test.

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

Post your comment

Please log in or register to post a comment.