in Compiler Design retagged by
7,244 views
6 votes
6 votes
Consider the grammar given below

S⟶ SS | a | ∈

The number of inadequate states in the DFA of LR(1) items is

(a) 1       (b) 2     (c) 3     (d) 4
in Compiler Design retagged by
by
7.2k views

3 Comments

What would be the answer for LR(o) items in same question ?
1
1
see my Answer Below .
0
0
state having conflict...draw its dfa..there will be 3 such states
1
1

7 Answers

7 votes
7 votes
Best answer

Ans 3

selected by

4 Comments

both are different state how will u merge.rt?
0
0
@Manoj @Vamsi

check my one

where is the 3rd conflict? :o
0
0
what is meant by inadequate states given in question.

and how the answer is 3. didn't get the explanation.

help please.
0
0
8 votes
8 votes

In state 1 : 1 -SR conflict

In state 2 : 1 -SR conflict

In state 3 : 1 -SR conflict  +  1 RR conflict

reshown by
3 votes
3 votes

Number of inadequate states is nothing but states which has S/R or R/R conflicts

Ref:http://www.cs.nuim.ie/~jpower/Courses/Previous/parsing/node64.html

2 Comments

How to draw the dfa?
0
0

After getting LR(0) items what you do is DFA diagram(something looks below(not for this grammar))

0
0
1 vote
1 vote

finding no of conflict

edited by

4 Comments

ok means any one state I1 can go in input S, (either I1 or I3) rt?
0
0
yes
0
0
In i1 state the first production is S’ → S. , $

which will not be genrated again by [i1,S] , So how its self loop can be correct ??
0
0

Related questions

0 votes
0 votes
3 answers
2