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

Discussion

A good parser error message should

  • A.name the position and describe what was expected there
  • B.list every production of the grammar that failed to apply
  • C.print the entire parser stack at the moment of the error
  • D.suggest a complete rewriting of the offending statement

Answer: A

Position and expectation are what a programmer needs. Dumping internal state helps nobody outside the compiler team, and confident rewriting suggestions are often wrong. The best messages name the construct in the terms the programmer used.

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

Post your comment

Please log in or register to post a comment.