0 votes 0 votes Hello, I just want to ask about the conflicts in parsers Does all parsers (CLR(1),LALR(1),SLR(1),LR(0)) show RR and SR conflicts I think CLR(1) parser does not have RR conflicts manas asked Jun 16, 2018 manas 1.3k views answer comment Share Follow See all 11 Comments See all 11 11 Comments reply Deepak Poonia commented Jun 16, 2018 reply Follow Share Does all parsers (CLR(1),LALR(1),SLR(1),LR(0)) show RR and SR conflicts Yes. All may show both RR and SR conflicts. 0 votes 0 votes srestha commented Jun 16, 2018 reply Follow Share SLR remove SR conflict and CLR remove RR conflict then how all show both conflicts? 0 votes 0 votes manas commented Jun 16, 2018 reply Follow Share Yes thats what my doubt is I saw in geeksforgeeks and there it is mentioned that CLR(1) does not shows RR conflict 0 votes 0 votes Prateek Raghuvanshi commented Jun 16, 2018 i edited by Prateek Raghuvanshi Dec 7, 2018 reply Follow Share yeah all parser can have RR,SR conflicts ,even CLR(1) which is most powerful can have RR,SR conflict.lets take an example of one state,state has $\boldsymbol {A->•aA,a/b,B->b.,a/b}$.now From this state at input $\boldsymbol a$ it will go some other state and in table at $\boldsymbol{a}$ shift entry will be placed ,and $\boldsymbol {B->b.,a/b}$ which is completed at same state so reduce entry will be also placed on $\boldsymbol{a,b}$ so one SR conflict there. 1 votes 1 votes srestha commented Jun 17, 2018 reply Follow Share In ur example, if we apply for LALR parser , there will be only 1 conflict right? 0 votes 0 votes srestha commented Jun 17, 2018 reply Follow Share I cannot understand Can u elaborate ur example more? where 2 SR conflict in LALR? 0 votes 0 votes Prateek Raghuvanshi commented Jun 17, 2018 reply Follow Share ma'am ,from CLR we get LALR, if CLR has SR conflict then LALR also have SR conflict, because LALR is obtained by merging states of CLR , if CLR already has conflict then LALR also has.CLR is also most powerful parser.in my example there is only one state ,this is CLR as well as LALR .there is no other state to merge , if there is any other state available CLR which can be merge in LALR , still LALR have at least these two SR conflict ,merging states in LALR can also generate RR conflict which was not in CLR ,that's why CLR parser is more power than LALR. i hope you are getting my point what i m trying to say. let me know. 0 votes 0 votes srestha commented Jun 17, 2018 reply Follow Share @ Prateek Raghuvanshi A−>∙aA,m/n,B−>b.,m/n Actually in ur grammar there is no SR conflict right? In SR conflict , it should be operated on same symbol. like, if we modify ur grammar like this $A−>∙bA,m/n$ $B−>.b,m/n$ here will shift reduce conflict on $b$ , even if there is different look ahead, then also there will be SR conflict See this link https://www.geeksforgeeks.org/gate-gate-cs-2008-question-55/ Correct me, if anything wrong in my statement 0 votes 0 votes srestha commented Jun 17, 2018 reply Follow Share But another point getting me confused that conflict happens due to ambiguity in grammar or lower order parser But, CLR is most powerful parser, still how there is any conflict exists? 0 votes 0 votes srestha commented Jun 17, 2018 reply Follow Share https://www.cse.iitk.ac.in/users/karkare/cs335/lectures/07BottomUpParsing.pdf 0 votes 0 votes Mitali gupta commented Aug 25, 2020 reply Follow Share this pdf is not available 0 votes 0 votes Please log in or register to add a comment.