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

Discussion

The closure of a set of LR items adds

  • A.the FOLLOW sets of each nonterminal appearing in the set
  • B.the terminals that may be shifted from the current state
  • C.items for the productions of any nonterminal following a dot
  • D.items for every production of the grammar without exception

Answer: C

If the parser expects a nonterminal, it may be about to begin any of that nonterminal's productions. Closure records all those possibilities in the same state. Without closure the automaton would have no way to begin a nested construct.

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

Post your comment

Please log in or register to post a comment.