search
Log In
3 votes
657 views

Consider the following grammar G:

                                                       

The number of states in SLR parser for G is _______.

My question is since this grammar can't generate any string the number of states should be zero right as we will remove useless symbols before constructing canonical collection of LR(0) items

in Compiler Design
edited by
657 views
0

See here

I think you are true.

2 Answers

1 vote

7 states in SLR

0

why didn't you add the production F->.y in the state I ?? 

adding it will lead to one more state. 

0 votes
7 states..the grammer is LR(0)..that is another thing it cant accept any srting
0
i think ur wrong vit ur ans bcz  a parse tree should generate any string. if it fails to generate i think it may violates CFG rules

Related questions

0 votes
1 answer
2
212 views
Which of the Statements are True : S1: LR(1) grammar can be LR(0) but not LL(1). S2 : Every regular language is LL(1) S3 : Three address code is linear representation of Syntax Tree.
asked Jan 16, 2019 in Compiler Design Na462 212 views
2 votes
2 answers
3
1 vote
0 answers
4
...