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

Discussion

Compared with a table driven parser, a hand written recursive descent parser usually offers

  • A.guaranteed linear time even on ambiguous grammars
  • B.automatic detection of conflicts in the grammar
  • C.better error messages and easier integration of semantic actions
  • D.the ability to parse a strictly larger class of grammars than before

Answer: C

Diagnostics can be written for each construct at exactly the point of failure. The cost is that no tool reports conflicts, so the author must verify the grammar properties by hand. A thorough test suite is the usual substitute for that missing static check.

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

Post your comment

Please log in or register to post a comment.