0 0 votes Consider the following grammar: S --> aPbSQ/a Q --> tS/ ε P --> r Is the above grammar SLR(1) ? Compiler Design compiler-design parsing lr-parser made-easy-test-series + – User007 936 views answer comment Share Follow Print See all 2 Comments 2 2 Comments reply sudsho commented Oct 6, 2016 reply Follow flag again i cant see ur image file...please write down the grammar 0 0 replyShare User007 commented Oct 6, 2016 reply Follow flag Done :) 0 0 replyShare Please log in or register to add a comment.
1 1 vote no it is not SLR(1) u will get confused only in one state where we get S->aPbS.Q Q->.tS/. here there is reduce move also and shift move on t also....but we will keep this is\n follow of Q which is $ and t(follow of Q=follow of S which is t and $)... sudsho answered Oct 6, 2016 • edited Oct 6, 2016 by sudsho sudsho comment Share Follow See all 2 Comments 2 2 Comments reply User007 commented Oct 6, 2016 reply Follow flag Isn't follow of Q = Follow of S due to this production [S --> aPbSQ] ??? 1 1 replyShare sudsho commented Oct 6, 2016 reply Follow flag oh sorry i mislooked it...u r right..it is not SLR(1)..we have reduce move in 1 and also a shift move in t..so shift reduce conflict i there..thanks for pointing it out...let me update the answer 0 0 replyShare Please log in or register to add a comment.