Home » Compiler Design » Compiler design miscellaneous » Question

Compiler design miscellaneous

  1. The grammar A → AA | (A) | ∈ is not suitable for predictive parsing because the grammar is
    1. ambiguous
    2. left-recursive
    3. right-recursive
    4. an operator grammar
Correct Option: B

Grammar is left recursive, hence the predictive parser may fall into a infinite loop. Answer A is not correct because ambiguity can occur from both left and right recursion.



Your comments will be displayed only after manual approval.