1,017 views

1 Answer

Best answer
3 votes
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
selected by

Related questions

10 votes
10 votes
2 answers
1
ShiveshRoy asked May 8, 2016
9,214 views
$\textbf{Eliminating indirect left-recursion}$Indirect left-recursion$S\rightarrow Aa|b$$A\rightarrow Ac| Sd |\in$
2 votes
2 votes
1 answer
2
shekhar chauhan asked Jun 4, 2016
674 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
1 votes
1 votes
1 answer
4