please explain me why n1 is necessarily equal to n2 and why not n1 is necessarily less than n2.

19 votes

Assume that the SLR parser for a grammar G has $n_1$ states and the LALR parser for G has $n_2$ states. The relationship between $n_1$ and $n_2$ is

- $n_1$ is necessarily less than $n_2$
- $n_1$ is necessarily equal to $n_2$
- $n_1$ is necessarily greater than $n_2$
- None of the above