Which of the following option is correct regarding bottom – up parsing?
(A) Every LR(0) grammar is SLR(1) and and converse is also true
(B) Every LALR(1) grammar is CLR(1) but every CLR(1) grammar may not be LALR(1)
(C) Number of states in SLR(1) < number of states in LALR(1) < number of states in CLR(1)
(D) None of these


Answer: (B)

Explanation:

  1. Every LR(0) is SLR(1) but Every SLR(1) may not be LR(0).
  2. Every LALR(1) grammar is CLR(1) but every CLR(1) grammar may not be LALR(1).
  3. Number of states in SLR(1) = number of states in LALR(1) ≤ number of states in CLR(1).

Refer – SLR, CLR and LALR Parsers

So, option (D) is correct.

Quiz of this Question


  • Last Updated : 09 Nov, 2018

Share your thoughts in the comments