in Compiler Design edited by
389 views
2 votes
2 votes

Is the following question even valid? Shouldn't there be a production for all variables?

in Compiler Design edited by
by
389 views

1 comment

As from X we can never end a parse tree as there's no production for S... so just remove that production.
Actually here the question is asking us to remove unneccessary productions .
So correct answer will be c only i.e Z --> 0 [reduced cfg] as Z--> X never ends due to S variable missing production.
0
0

1 Answer

0 votes
0 votes
Best answer
option C seems correct,

please read reduction of CFG

1. removing null , use productions

2. use less symbols ( S in this case )

3. unit productions
selected by