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

Discussion

Consider the following statements about predictive parsing.
1. It runs in time linear in the length of the input.
2. It requires the grammar to be free of left recursion.
3. It can parse any unambiguous context free grammar.

  • A.All of them
  • B.1 and 2 only
  • C.3 only
  • D.1 only

Answer: B

Linear time and freedom from left recursion both hold. The third overstates the power of the method, since many unambiguous grammars need more lookahead or a bottom up approach. Unambiguity is a property of the language description, not of parsing difficulty.

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

Post your comment

Please log in or register to post a comment.