retagged by
6,014 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,888 views
is it correct?
1 votes
1 votes
1 answer
2
learner_geek asked Jul 31, 2017
1,910 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
958 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
1 answer
4
Sajal Mallick asked Oct 13, 2023
155 views
Does Follow and First operation always apply on non left recursive grammar?