in Compiler Design edited by
670 views
2 votes
2 votes

I'm getting 4, can someone verify

in Compiler Design edited by
by
670 views

4 Comments

@vishal chugh yes I guess you are correct. Then it should be 5 right?
0
0
@vishal chugh , isn't A also useless, as it is not generating a terminal symbol?
1
1
@charul oh yes.. totally overlooked it!!

S->a/bC/b

C->a

Then 4 right? I hope it's the final one.. :P

You were right ;)
1
1

1 Answer

0 votes
0 votes
Elimination of useless symbol

using bottom up then top down approach we get

S->B

B->a | bC

C-> a | $\epsilon$

Now we remove unit production  we get

S->a | bC

C->a | $\epsilon$

Now we remove null production we get

S-> a | b | bC

C-> a

Total production 4

2 Comments

tesla...remove C-> a too:-

it is also useless..
1
1
How it is useless @hs_yadav
0
0