Question 6
Which of the following productions eliminate left recursion in the productions given below:
S -> Aa | b
A -> Ac | Sd | $\epsilon$
Step-by-Step Solution
Detailed Explanation:
Substitute S -> Aa | b into A -> Sd: A -> Ac | Aad | bd | $\epsilon$.
Eliminating immediate left recursion from A gives A -> bdA' | A', where A' -> cA' | adA' | $\epsilon$.