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

Discussion

The stack of an LR parser holds

  • A.nothing but the computed values of the expressions seen so far
  • B.grammar symbols paired with the states they lead to
  • C.the input tokens in the reverse of the order they arrived
  • D.the productions applied so far in the order they were used

Answer: B

Implementations often store only the states, since the symbols can be recovered from them. The semantic values live on a parallel stack of their own. Keeping the two stacks in step is the responsibility of the generated driver.

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

Post your comment

Please log in or register to post a comment.