The Gateway to Computer Science Excellence
+3 votes
475 views
Consider the following grammar

$S\rightarrow Aa\mid B $

$B\rightarrow a\mid BC$

$C \rightarrow a\mid \in$

the no of productions in simplified cfg is
in Compiler Design by Boss (31.2k points)
edited by | 475 views

1 Answer

+4 votes
Best answer
1.Removal of null production

S->Aa|B
B->a|B|BC
C->a

2.Removal of Unit production
S->Aa|a|BC
B->a|BC
C->a

3.Removal of useless production

S->a|BC
B->a|BC
C->a
so total 5 production in simplified CFG.
by Boss (16.3k points)
selected by
0
Why you have removed S -> Aa

 A is variable here??
0
But you can't reachA from S therefore we removed it
0
Do we remove, A because its definition is not present in the grammar??
0
plz give me proper explanation why A is not removed in that grammer

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,650 questions
56,193 answers
193,988 comments
94,863 users