-
Consider the grammar S → (S) | a
Let the number of states in SLR (1), LR(1) and LALR (1) parsers for the grammar be n1, n2 and n3 respectively. Which of the following relationships holds good?
-
- n1 < n2 < n3
- n1 = n3 < n2
- n1 = n2 = n3
- n1 ≥ n3 ≥ n2
- n1 < n2 < n3
Correct Option: B
The no. of states for SLR(1) &LALR(1) are equal so n 1 = n3, but CLR(1) or LR(1) will have no. of states greater than LALR &LR(0) both.