edited by
5,979 views
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?

edited by

1 Answer

Best answer
5 votes
5 votes

parser_21

  •  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.

selected by

Related questions

1 votes
1 votes
4 answers
2
Rahul_Rathod_ asked Jan 21, 2019
3,627 views
grammar is CLR(1) or not?if yes then how?
2 votes
2 votes
0 answers
3
Na462 asked Jan 19, 2019
923 views
Which one of the following is true about LALR(1) Parser ?It can resolve SR Conflict in favor of reducedIt can resolve SR Conflict in favor of ShiftIt can resolve RR Confl...
1 votes
1 votes
1 answer
4
baghel263 asked Jan 17, 2019
1,021 views
does augmented production causes conflicts