0 votes 0 votes Consider the grammar- $S \rightarrow BB$ $B \rightarrow aB/bB/a/b$ How many shift-reduce conflicts will occur when we try to make SLR parsing table for the above grammar? A. 0 B. 1 C. 2 D. None Compiler Design parsing compiler-design + – Samujjal Das asked Jan 29, 2017 • edited Jan 29, 2017 by Samujjal Das Samujjal Das 1.9k views answer comment Share Follow See all 7 Comments See all 7 7 Comments reply Sushant Gokhale commented Jan 30, 2017 reply Follow Share is it 2? 0 votes 0 votes Samujjal Das commented Jan 30, 2017 reply Follow Share Answer is 2. I am getting 4. 0 votes 0 votes Sushant Gokhale commented Jan 30, 2017 reply Follow Share I0: S->.BB B->.aB B->.bB B->.b B->.a I0 on B (i.e shift B) I1: S->B.B B->.aB B->.bB B->.b B->.a shift a on I1 I2: Here you get shift reduce conflicts for 'a' shift b on I1 I2: Here you get shift reduce conflicts for 'b' Now, no more SR conflicts arise 1 votes 1 votes Samujjal Das commented Feb 2, 2017 reply Follow Share @Sushant See this once. Where is my mistake? 0 votes 0 votes Samujjal Das commented Feb 3, 2017 reply Follow Share @Sushant 0 votes 0 votes Vishal Goyal commented May 20, 2017 reply Follow Share follow of b is $ only na then in slr why did u write reduce on all the columns i think u have done lr and answered this question 0 votes 0 votes LeenSharma commented May 21, 2017 reply Follow Share only 2 conflict. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes It is SLR paring not LR(0) so ans is 0(option A) Ankit001 answered Jul 17, 2017 Ankit001 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes There will be only two SR conflicts in two states one conflict is with B->b.(R), B->.bB(S) {b comes in follow of B} and the other one is with B->a.(R) , B->.aB(S) {a comes in Follow of B so conflict} Anurag Parothia 1 answered Aug 31, 2018 Anurag Parothia 1 comment Share Follow See all 0 reply Please log in or register to add a comment.