532 views
0 votes
0 votes

For given production for a LR(1) grammar

B->b.C ,$|c



 here C is non terminal



C->c. ,$|c



   and here c is terminal. $|c are lookup symbols



Will there be a shift reduce conflict if a non terminal is visited.Please explain how shift reduce conflict works

1 Answer

0 votes
0 votes
Upon seeing a look ahead, if a production has a two different moves for same terminal then its a conflict.

If a state, after seeing a look ahead, points to another non final state, then its Shift move. If it points to final state, then its a reduce move. And if both takes place, then it's a SR conflict.

Now, in given question,

no such condition occurs, hence it's conflict free grammer, neither SR nor RR.

Related questions

0 votes
0 votes
2 answers
1
sripo asked Nov 1, 2018
2,292 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 ),]
0 votes
0 votes
1 answer
3
worst_engineer asked Jan 9, 2016
1,367 views
Will not there be 3 SR conflicts in CLR(1) reduction ?In fact their ans also says this :In the state I1 , will it not be SR conflict ?