3 votes 3 votes Is E --> E+T / T , T --> i is LR(0) grammar ? Compiler Design compiler-design grammar lr-parser + – Raveen Sharma asked Jul 23, 2016 Raveen Sharma 2.4k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 5 votes 5 votes 1. E'->.E E->.E+T / .T T-> .i 2. on shift E : E'->E. , E->E.+T - There is no conflict because E'->E. is like as E'->E.$, it is not recuding, it shows it is the end. And there is no other conflict So, It is LR(0) target2017 answered Aug 10, 2016 • selected Aug 31, 2016 by ManojK target2017 comment Share Follow See all 3 Comments See all 3 3 Comments reply brijmohan commented Aug 14, 2016 reply Follow Share This is correct answ 0 votes 0 votes chandankannaujia commented Aug 28, 2016 reply Follow Share u r correct 0 votes 0 votes jatinmittal199510 commented Aug 31, 2016 reply Follow Share correct 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes It is SLR grammar. Shift reduce conflict there but reduce reduce conflict will not be there if we derive it. S'-->E. , E--> E. + T contains SR conflict.So, it is SLR. srestha answered Jul 23, 2016 • edited Jul 24, 2016 by srestha srestha comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments jatinmittal199510 commented Aug 31, 2016 reply Follow Share it is both 0 votes 0 votes Siddhi Viradiya commented Jan 17, 2017 reply Follow Share in LR(0) we are writing a reduced term in all non-terminal while in a case of SLR(1) we are writing in the follow of nonterminal .is it a reason why you are telling not LR(0) but SLR(1).but as per my information due to augmented grammar we will write "accept" in just $ column so, in that case, it is both LR(0) and SLR(1) as well. 0 votes 0 votes LeenSharma commented Apr 23, 2017 reply Follow Share srestha It's both LR(0) and SLR(1). 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes I think it is LR(0). d3 answered Aug 2, 2016 d3 comment Share Follow See all 0 reply Please log in or register to add a comment.