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

Discussion

In the SLR construction, a reduction by A goes to alpha is entered for lookahead a when

  • A.a is the end of input marker and nothing else
  • B.a belongs to FOLLOW(A)
  • C.a belongs to FIRST(alpha) for that production
  • D.a is any terminal at all appearing in the grammar

Answer: B

SLR uses FOLLOW as its lookahead approximation. It is easy to compute but coarse, since not every terminal that can follow A in some context can follow it in this one. Canonical LR carries a lookahead specific to the state and avoids the problem.

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

Post your comment

Please log in or register to post a comment.