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

Discussion

An entry M[A, a] in a predictive parsing table contains

  • A.a list of every terminal permitted to come after A in a sentence
  • B.whichever rule fits when A heads the stack and a is in hand
  • C.the state that the parser should move to on reading the token a
  • D.whichever action is to be run when A has been recognised

Answer: B

Correct answer: whichever rule fits when A heads the stack and a is in hand

The cell holds the production to apply when the nonterminal A is on top of the stack and the lookahead is the terminal a. An empty cell means no production applies and the parser reports an error. A cell with two entries means the grammar is not LL(1).

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

Post your comment

Please log in or register to post a comment.