first (S) = {a,b}
first(A) ={a,b,ϵ}
first(B) ={a,b}
follow(S) ={$,a,b}
follow(A)={a,b}
follow (B)= {$,a,b}
Check this
thanks @ Deepakk Poonia (Dee) sir, I understood your point. For this question first and follow for given productions came similar after removing left recursion so i got confused but now it is clear that first and follow for the grammar of other examples will be different before and after removing left recursion. So, i should answer according to question shouldn't try to modify it. thanks for pointing out :)
64.3k questions
77.9k answers
244k comments
80.0k users