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

Discussion

Error productions in an LR grammar allow the author to

  • A.have the parser repair the source program automatically
  • B.suppress reporting of the error to the user entirely
  • C.emit instructions for the faulty construct as though it were sound
  • D.attach a specific diagnostic to an anticipated mistake

Answer: D

Correct answer: attach a specific diagnostic to an anticipated mistake

An error production admits a construct the language does not contain, so that the parser recognises the mistake rather than merely failing, and its action can report a message written for that case. It does not correct the program, and the parser will not proceed to generate code for the faulty construct.

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

Post your comment

Please log in or register to post a comment.