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

Discussion

The principal disadvantage of backtracking in a top down parser is

  • A.the need for an explicit stack of grammar symbols
  • B.exponential worst case time and the need to undo semantic actions
  • C.the inability to detect any syntax errors in the input
  • D.the demand that the grammar hold no recursion whatsoever within it

Answer: B

Retrying alternatives repeatedly rescans the same input and any action already executed must be reversed. Predictive parsing avoids both at the price of requiring an LL(1) grammar. That price is normally paid gladly, since the transformations are mechanical.

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

Post your comment

Please log in or register to post a comment.