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

Discussion

An error entry in an LR action table means

  • A.the lookahead cannot legally follow the current viable prefix
  • B.the grammar itself contains a mistake that must be corrected
  • C.the parser has exhausted the space available for its stack
  • D.the whole input has been accepted and the parse has finished

Answer: A

Correct answer: the lookahead cannot legally follow the current viable prefix

An empty entry means there is no continuation: nothing in the grammar allows this token after what has been read so far. This is the viable prefix property, and it is valuable because it means the parser detects the error at the earliest point at which the input has become impossible.

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

Post your comment

Please log in or register to post a comment.