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

Discussion

Many production compilers use hand written recursive descent parsers because

  • A.generated parsers cannot be compiled on modern machines
  • B.the technique requires no grammar to be written at all
  • C.error messages and recovery can be tailored precisely
  • D.recursive descent parses a larger class of grammars than LR

Answer: C

Correct answer: error messages and recovery can be tailored precisely

A hand written parser knows where it is in the grammar in terms a person can understand, so it can say what was expected and recover in a way suited to the construct. It also gives control over performance and over constructs that fit the LR model awkwardly. The cost is that the grammar and the code must be kept in step by hand.

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

Post your comment

Please log in or register to post a comment.