2 2 votes GATE 2010 Question The grammar S→aSa∣bS∣c is LL(1) but not LR(1) LR(1) but not LL(1) Both LL(1) and LR(1) Neither LL(1) nor LR(1) I have 2 small doubt First Doubt:-If a grammer is LL(1) then it is always LR(0) ? Is there any grammer which is LL(1) and cannot be parsed by LR(0) ? Second doubt :- Can any one tell me the above question is write or wrong because they have given LR(1) parser and i haven't heard about LR(1).I have heard about Brute force ,recursive descent,operator presedence,LL(1) LR(0) SLR(1) LALR(1) CLR(1).So what is the difference between LR(0) AND LR(1) and which one is more powerfull ? Compiler Design compiler-design parsing + – Himanshu Goyal 3.5k views answer comment Share Follow Print See 1 comment 1 1 comment reply Himanshu Goyal commented Jan 24, 2017 reply Follow flag Thanks :) 0 0 replyShare Please log in or register to add a comment.
Best answer 8 8 votes First Doubt : A grammar parsed by LL(1) must also be parsed by LR(1) Parser but may not by LR(0) For e.g S. ---> AaAb S ---> BbBa A ---> € B ---> € Second doubt : LR(1) also known as canonical LR(1) So LR(1) and CLR(1) same. G.K.T answered Jan 30, 2017 • selected Jan 30, 2017 by Himanshu Goyal G.K.T comment Share Follow See all 3 Comments 3 3 Comments reply Himanshu Goyal commented Jan 30, 2017 reply Follow flag thanks:) 0 0 replyShare Brij Mohan Gupta commented Jul 18, 2017 i edited by Brij Mohan Gupta Jul 19, 2017 reply Follow flag @Himanshu LL(1) is subset of LR(1) Also LR(1) are DCFL. 3 3 replyShare learner_geek commented Aug 2, 2017 reply Follow flag In diagram where will be LL(0)?? 0 0 replyShare Please log in or register to add a comment.
2 2 votes CLR(1) is also called as LR(1) Ankit001 answered Jul 17, 2017 Ankit001 comment Share Follow See 1 comment 1 1 comment reply learner_geek commented Aug 2, 2017 i edited by learner_geek Aug 3, 2017 reply Follow flag Thanks 0 0 replyShare Please log in or register to add a comment.
0 0 votes please check this i am correct or not Swami patil answered Dec 23, 2017 Swami patil comment Share Follow 0 reply Please log in or register to add a comment.