retagged by
478 views

2 Answers

0 votes
0 votes
First(S) = {a , b , d}
edited by
0 votes
0 votes

FIRST(S) 

Let the set be k={}

FIRST(S) = see first what A is deriving

A -> BD

now see what B is deriving

case 1  : B->b

so A->bD

so k ={b}

case 2 : B-> ɛ

so A->D

now see what D is deriving

case 2.1 : D->d

so A->d

so k ={b,d}

case 2.2 : D-> ɛ

so A-> ɛ

putting A-> ɛ in S

so S->a

so k = {b,d,a}

so FIRST(S)  = {b,d,a}

Related questions

0 votes
0 votes
0 answers
1
Ana_101 asked 4 hours ago
5 views
S - A BA - f S fA - b b B dB - ƐB - cFirst(S) =First(A) =First(B) =Follow(S) =Follow(A) =Follow(B) =
0 votes
0 votes
1 answer
2
Subhrangsu asked Apr 15, 2022
2,213 views
Compute FIRST and FOLLOW sets:S→ aAC | bBA→ Abc| Abd | eB→ f | gC→ h | i
0 votes
0 votes
1 answer
3
0 votes
0 votes
1 answer
4
saumya mishra asked Jun 3, 2018
3,265 views
Find first and follow of the given grammar?S->ABA->BS/a/€B->AS/b