2 votes 2 votes $S\rightarrow AaB$ $A\rightarrow ab|a$ $B\rightarrow b$ Above grammar is a)Not LR(0) b)Not LR(0) but SLR(1),CLR(1) Compiler Design compiler-design + – srestha asked Jan 17, 2018 srestha 465 views answer comment Share Follow See all 8 Comments See all 8 8 Comments reply Abhinav Gupta commented Jan 18, 2018 reply Follow Share i am getting SLR(1) but not CLR(1) and LR(0) so option a) i guess. 0 votes 0 votes Abhinav Gupta commented Jan 18, 2018 reply Follow Share what is the answer? 0 votes 0 votes joshi_nitish commented Jan 18, 2018 reply Follow Share @Abhinav Gupta i am getting SLR(1) but not CLR(1) and LR(0) is it possibe that grammar is SLR(1) but not CLR(1)? @srestha, option B) is correct, it is not LR(0)(due to SR conflict), but it is SLR(1) and so also CLR(1), and option B) implies option A). so both option A) and B) are correct. 1 votes 1 votes Anu007 commented Jan 18, 2018 reply Follow Share Yes both are correct but B is more accurate. 1 votes 1 votes hs_yadav commented Jan 18, 2018 reply Follow Share there is SR conflict...in second state...of A->ab/a not LR(0)....but SLR(1) and then definite LR(1) 0 votes 0 votes srestha commented Jan 18, 2018 reply Follow Share guys there is SR conflict right? if there is SR conflict for SLR, then there is SR conflict for LALR So, how, it could be SLR(1), ,LR(1) Only this point I was missing, and that is why I answered A) Plz tell me where I was wrong? 0 votes 0 votes joshi_nitish commented Jan 18, 2018 reply Follow Share @srestha, for SLR(1), there is no SR conflict the state in which you are thinking there is SR conflict, actually there is no SR conflict. the shift is happening on 'b' and reduce is happening on follow(A)='a', since both shift and reduce are happening on a different symbol, it is not an SR conflict in SLR(1) 0 votes 0 votes hs_yadav commented Jan 18, 2018 reply Follow Share sresta for LALR we reduce the production corresponding to look_ahead 0 votes 0 votes Please log in or register to add a comment.