1.

Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states.(a) n1 is necessarily less than n2(b) n1 is necessarily equal to n2(c) n1 is necessarily greater than n2(d) none of the mentionedI got this question in unit test.The origin of the question is Top-Down Parsing topic in division Topdown Parsing of Compiler

Answer»

Right choice is (b) n1 is necessarily EQUAL to n2

Best EXPLANATION: SLR PARSER has less range of context free languages than LALR but still both n1 & n2 are same for SLR & LALR respectively.



Discussion

No Comment Found

Related InterviewSolutions