I'm resolving indirect left recursion for these production rules:
S -> Aa / a eq1
A -> Sb / b. eq2
Where S is the starting symbol.
Now I can do this in two ways:
Putting
Ain eq1So I'll get the solution (sol1):
S -> Sba /a /baand then
S -> aS' / baS' S' -> baS' / epsilonReplacing
Sin eq2:So I'll get the solution (sol2):
S -> Aa / a A -> abA' / bA' A' -> abA' / epsilon
Both seem to be correct. Which is the correct answer?