retagged by
308 views
2 votes
2 votes

S --> aA | CB

A --> BaA | ϵ

B --> bB | Abc | ϵ

C --> B

What will be first(B)?

retagged by

1 Answer

0 votes
0 votes

S --> aA | CB       First(S) ={ a,FIrst(C) }= {a,b,ϵ}

A --> BaA | ϵ        First(A) = {First(B),ϵ} = {a,b,ϵ}

B --> bB | Abc | ϵ  First(B) = {b,first(A),ϵ} = {a,b,ϵ}

C --> B                  First(C) = {First(B)}  = {a,b,ϵ}

Related questions

1 votes
1 votes
2 answers
2
LavTheRawkstar asked Jun 27, 2016
6,815 views
Consider the following grammarE → E+T/TT → T*F/FF → id/(E)Calculate Lead and Last for every Non terminal.
1 votes
1 votes
3 answers
3
Rahhul A asked Nov 10, 2023
511 views
$\text{ Find $\textbf{First(A)}$ and $\textbf{Follow(B)}$ }?$