The Gateway to Computer Science Excellence
+3 votes

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

See here

I think you are true.

2 Answers

+1 vote

7 states in SLR

by Active (4.8k points)

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)
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
105,007 users