3 votes 3 votes consider the following statements: S1:SLR parsing table have more number of state then LALR parsing table S2:it is economical to construct SLR and LALR table than CLR parsing table . Which one is true? Compiler Design compiler-design parsing + – set2018 asked Nov 3, 2017 • edited Nov 3, 2017 by set2018 set2018 6.0k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Rishabh Gupta 2 commented Nov 3, 2017 reply Follow Share Instead of attaching an image, it would be good if you can type the question. Anyone later can search. 0 votes 0 votes set2018 commented Nov 3, 2017 reply Follow Share Rishabh Gupta 2 done 1 votes 1 votes AnilGoudar commented Nov 3, 2017 reply Follow Share SLR and LALR have same number of states. And it is more simple to construct SLR and LALR than CLR because CLR has more states than other two and also it involves look ahead. Hence statement 2 is True. 1 votes 1 votes Please log in or register to add a comment.
Best answer 5 votes 5 votes SLR parsing table have same number of states than LALR parsing table If number of states LR(0) = n1, number of states SLR = n2, number of states LALR = n3, number of states CLR = n4 then, n1 = n2 = n3 <= n4 For a comparison of parser size , the SLR and LALR tables for a grammar always have the same number of states , and this number is typically several hundred states for a language like C. The CLR table would typically have several thousand states for the same size language. Thus , it is much easier and more economical to construct SLR and LALR tables than CLR tables. So S2 is true. Shubham Sharma 2 answered Nov 3, 2017 • selected Nov 3, 2017 by set2018 Shubham Sharma 2 comment Share Follow See all 0 reply Please log in or register to add a comment.