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

Discussion

A viable prefix is

  • A.a prefix of the input that contains no syntax errors at all
  • B.a prefix of a right sentential form that can appear on the stack
  • C.any prefix of the input that the scanner has already tokenised
  • D.the shortest right side among all the productions of the grammar

Answer: B

Viable prefixes are exactly the stack contents reachable during a correct parse. The LR(0) automaton is precisely a machine recognising the viable prefixes of the grammar. That the set is regular is what allows a finite table to drive the parse.

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

Post your comment

Please log in or register to post a comment.