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

Discussion

The following are all reasons to prefer a parser generator over a hand written parser EXCEPT

  • A.changing the language means changing only the specification
  • B.the generated parser always produces better error messages
  • C.the grammar serves as documentation of the language syntax
  • D.conflicts in the grammar are reported automatically

Answer: B

Correct answer: the generated parser always produces better error messages

Error messages are generally the generated parser’s weakness rather than its strength, since the tool knows only that no action was available and not what the programmer probably meant. That is exactly why many production compilers use hand written recursive descent. The other three are genuine advantages of generation.

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

Post your comment

Please log in or register to post a comment.