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

Discussion

Placing the FOLLOW set of a nonterminal in its error cells as synchronising tokens allows the parser to

  • A.insert the missing nonterminal and then carry on parsing as before
  • B.collapse the whole input down to the start symbol at once
  • C.detect that the grammar itself is not LL(1)
  • D.pop the nonterminal and continue when such a token appears

Answer: D

If the lookahead can follow A, then A has evidently been completed or omitted, so popping it is a reasonable repair. The technique costs nothing and improves recovery markedly. Filling the error cells this way is standard practice in generated parsers.

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

Post your comment

Please log in or register to post a comment.