edited by
2,273 views
1 votes
1 votes

S -> BB

B -> aB | bB | a | b

How many SLR conflicts will occur when we try make parsing table for it.

a) 0    b) 1   c) 2    d) None of these

----------------------------------------------------------------

Doubt: Do we count 2 SR conflicts for the same state as 2 separate conflicts. I mean to say that 'SR conflicts in parse table and SR conflicts in states can vary?' i.e, Suppose, as in one cell of parse table if we have 3 productions [ B -> a.  ;  B -> .a  ;   B -> .aB ] Then as you can see there are 2 SR conflicts in 1 state. So, do we count it as 1 conflict or 2 conflicts. 

So, in the above parse table for given grammer (in Qstn). As you can see, there is such a situation in I3 (left-bottom) and in I4 (right-bottom). So, how many SR conflicts are there 2 or 4 ??

edited by

1 Answer

Best answer
0 votes
0 votes
My Answer is

We have 2 SR conflicts
i.e at I3 we have both final and non final items
 such as B->a. and all other productions
 so we get both shift and reduce under a (since follow of B is a,b)--its 1 conflict
and (same as I3 we have conflict at I4 ) -- 2nd conflict
selected by

Related questions

0 votes
0 votes
1 answer
2
sripo asked Nov 1, 2018
540 views
For given production for a LR(1) grammarB->b.C ,$|c here C is non terminalC->c. ,$|c and here c is terminal. $|c are lookup symbolsWill there be a shift reduce conflict...
0 votes
0 votes
2 answers
4
sripo asked Nov 1, 2018
2,379 views
S→(XS→E]S→E)X→E)X→E]E→ϵIs this grammar CLR(1)? The answer says it is but I find a shift reduce conflict for E- epsilon with lookup symbols ),]