shekhar chauhan
1,135 views

1 Answer

Best answer
3 3 votes
Here we have indirect left recursion.

J -> Lx K -> Ly L -> J | K | f

We can write it as,

L - > Lx | Ly | f.

Now to eliminate this left recursion, the general idea is to replace the productions.

L - > fL'

L' - > xL' | yL' | ∈

 

For more example you can see this.

http://www.csd.uwo.ca/~moreno//CS447/Lectures/Syntax.html/node9.html
vijaycs selected by

Related questions

10 10 votes
2 answers 2 answers
10.0k
10.0k views
ShiveshRoy asked May 8, 2016
9,995 views
$\textbf{Eliminating indirect left-recursion}$Indirect left-recursion$S\rightarrow Aa|b$A\rightarrow Ac| Sd |\in$
2 2 votes
1 1 answer
760
760 views
shekhar chauhan asked Jun 4, 2016
760 views
A-->AA+/AA*/ais it eligible to be used by SR parse.If we apply SR parse on this grammar then what will be the order of activation Record in Stack
3 3 votes
1 1 answer
1.9k
1.9k views
AskHerOut asked Oct 1, 2017
1,932 views
lets consider a grammar as:$A\rightarrow Ab | Ac | a$while checking whether it belongs to LL(1) grammar, we would point out that it has a left ... the production rule to be applied.any further insights about the same will be very helpful.
1 1 vote
1 1 answer
1.2k
1.2k views
susgir2 asked Jan 2, 2019
1,228 views
Grammar. S → Aa | B A → Ac | Aad | bd | epsilon . .