retagged by
6,090 views
4 votes
4 votes

is it correct ?

retagged by

1 Answer

Best answer
4 votes
4 votes
First remove left recursion from the grammer

S -> AB
A -> Ca | $\epsilon$
B -> cB'
B' -> aACB' | $\epsilon$
C -> b | $\epsilon$

first ( S ) = { b, c, a }
first (A ) = {b, a, $\epsilon$ }
first (B) = {c}
first (C) = {b, $\epsilon$ }

follow (S) = { dollar }
follow (A) = {c, b , dollar, a}
follow (B) = { dollar , a} [a because first of B' is subset of follow of B]
follow (C) = {dollar , a}

Yes all are correct.
selected by

Related questions

3 votes
3 votes
3 answers
1
Pranav Madhani asked Aug 19, 2017
1,965 views
is it correct?
1 votes
1 votes
1 answer
2
learner_geek asked Jul 31, 2017
1,972 views
How to solve recursive first or follow problems as example in second question (First of A) please give detailed explanation.
1 votes
1 votes
1 answer
3
rahuljai asked Dec 13, 2018
1,006 views
Consider the following grammarS Ka|bKc|dc|bdaK - dThe grammar is notLALR(1)SLR(1)LR(1)none of the above
0 votes
0 votes
0 answers
4
Ana_101 asked 4 hours ago
3 views
S - A BA - f S fA - b b B dB - ƐB - cFirst(S) =First(A) =First(B) =Follow(S) =Follow(A) =Follow(B) =