retagged by
300 views
2 votes
2 votes

Which one of the following statements is TRUE?

  1. SLR parser has more states than LALR parser.
  2. LALR parser has more states than Canonical LR.
  3. Canonical LR has fewer states than SLR parser.
  4. Both SLR and LALR parsers have the same number of states.
retagged by

1 Answer

Best answer
2 votes
2 votes
D. Both SLR and LALR parsers have the same number of states.

If number of states LR(0) = $n_1$,
  number of states SLR(1) = $n_2$,
  number of states LALR(1) = $n_3$,
  number of states CLR(1) = $n_4$ then,
  $n_1 = n_2 = n_3 <= n_4$
selected by
Answer:

Related questions

2 votes
2 votes
0 answers
1
Bikram asked Nov 25, 2016
444 views
$\textbf{goto}$ function of LR class of grammar is represented as:Deterministic Finite Automata transitionsNon-deterministic Finite Automata transitionsPDA transitionsPar...
3 votes
3 votes
1 answer
2
Bikram asked Nov 25, 2016
443 views
Consider the following grammar:$E \rightarrow E + T \mid T$$T \rightarrow T ^* F \mid F$$F \rightarrow (E) \mid id$What are the productions for E, T and F after convertin...
3 votes
3 votes
1 answer
3
Bikram asked Nov 25, 2016
977 views
Which one of the following can be handled by predictive parsers?Left recursionLeft factorsAmbiguityNon-determinism