Multiple choice

Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?

  1. Removing left recursion alone

  2. Factoring the grammar alone

  3. Removing left recursion and factoring the grammar

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

If a grammar has left recursion & left factoring then it is ambiguous. So to convert a CFG to LL(1) grammar both removal of left recursion & left factoring need to be done.