Consider a context-free grammar G. Left recursion can be removed using…

Consider a context-free grammar G. Left recursion can be removed using standard transformations.
Regarding the effect of left recursion removal on FIRST and FOLLOW sets, examine the following statements:

  1. A.

    After removing left recursion from G, the FIRST sets must change, the FOLLOW sets may change.

  2. B.

    If the grammar also has ε-productions, then both FIRST and FOLLOW sets may change after removing left recursion.

  3. C.

    For indirect left recursion (e.g., A→Bα,  B→Aβ), removing left recursion may alter the FOLLOW set of some non-terminals.

  4. D.

    If left recursion removal is followed by left factoring, then both FIRST and FOLLOW sets are likely to change.

Attempted by 20 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…