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

Discussion

Panic mode recovery in a parser discards input tokens until

  • A.the stack has been emptied of all grammar symbols
  • B.the same token appears twice in succession in the input
  • C.a synchronising token from a chosen set is encountered
  • D.the end of the input file has finally been reached

Answer: C

Synchronising tokens are typically statement terminators or closing brackets. The parser pops stack symbols until a state accepting the found token is reached, then continues. The method never loops and is simple to implement, which is why it is ubiquitous.

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

Post your comment

Please log in or register to post a comment.