The Gateway to Computer Science Excellence
+3 votes
514 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 by Active (2.7k points)
edited by | 514 views
0

See here

I think you are true.

2 Answers

+1 vote

7 states in SLR

by Active (4.8k points)
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
by (335 points)
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
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,737 questions
57,302 answers
198,306 comments
105,007 users