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

Discussion

A significant risk of writing a recursive descent parser by hand is

  • A.the parser running in exponential time on all inputs
  • B.a complete inability to parse any recursive construct of the language
  • C.the requirement to compute FIRST and FOLLOW at runtime
  • D.silently accepting a language different from the intended grammar

Answer: D

Correct answer: silently accepting a language different from the intended grammar

Nothing checks a hand-written parser against the grammar it was meant to implement, so a mistake in one procedure quietly changes the language accepted. A generated parser at least reports conflicts and is derived from the grammar mechanically - this is the strongest argument for using a tool.

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

Post your comment

Please log in or register to post a comment.