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

Discussion

When a terminal sits on top of the parser stack, the parser

  • A.consults the parsing table to decide which production applies
  • B.pushes the FIRST set of that terminal onto the stack
  • C.reports an error
  • D.matches it against the lookahead and pops both on success

Answer: D

Matching consumes one input token and one stack symbol. A mismatch is a syntax error, and the recovery routine decides whether to skip input or to pop the stack symbol. Choosing well between those two options is what makes recovery feel intelligent.

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

Post your comment

Please log in or register to post a comment.