retagged by
248 views

1 Answer

0 votes
0 votes

I think to give a grammar which is LL(1) equivalent to the one given you need to remove the left recursion. 

S  -> BS'
S' -> $\epsilon$ / cBS'
B  -> e / efg / efCg
C  -> cdC / S

Now to remove left factoring :

B   -> eB'
B'  -> $\epsilon$ / f / fCg (further broken down)

B'  -> $\epsilon$ / fB''
B'' -> $\epsilon$ / Cg


You can have a look at this : http://www.csd.uwo.ca/~moreno/CS447/Lectures/Syntax.html/node8.html
Also there is a good video lecture : https://www.youtube.com/watch?v=3_VCoBfrt9c

Related questions

8 votes
8 votes
2 answers
1
0 votes
0 votes
3 answers
2
0 votes
0 votes
2 answers
3
atul_21 asked Nov 28, 2017
648 views
I think that the given grammar is LL(1) . please explain me if I'm wrong.
1 votes
1 votes
1 answer
4
thor asked Nov 17, 2016
329 views