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

Discussion

Panic mode recovery in a predictive parser typically

  • A.puts in the token the table was hoping for and carries on
  • B.stops work entirely the instant a single fault has been announced
  • C.drops tokens until it reaches one that lets parsing resume safely
  • D.pops the entire stack and restarts the parse from the beginning

Answer: C

Synchronising sets are usually built from the FOLLOW sets of the nonterminals on the stack. Skipping to such a token lets the parser resume at a well defined point. The technique is crude but it never loops and it is trivial to implement.

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

Post your comment

Please log in or register to post a comment.