retagged by
201 views
0 votes
0 votes

Which of the following statement(s) is/are true about $LALR$$\left ( 1 \right )$parsers ?

S1: LALR$\left ( 1 \right )$parsers have same number of states as $SLR$$\left ( 1 \right )$ parsers (core $LR$$\left ( 0 \right )$tems are the same).

S2: LALR$\left ( 1 \right )$ derived from LR$\left ( 1 \right )$ with no shift-reduce conflict will also have no shift-reduce conflict.

S3: LALR$\left ( 1 \right )$may create reduce-reduce conflict which was not in LR$\left ( 1 \right )$ from which LALR$\left ( 1 \right )$ is derived.

  1.      S1 and S2
  2.      S1 and S3
  3.      S2 and S3
  4.      S1, S2 and S3
retagged by

1 Answer

Best answer
1 votes
1 votes

S1 is True , LALR(1) parsers have same number of states as SLR(1) parsers, but with more power due to lookahead in states.

S2 is True,  Any shift-reduce conflict which can be removed by LR (1) can also be removed by LALR(1) . 

S3 is True , LALR(1)  gains reduce-reduce conflict whereas the corresponding LR (1) counterpart does not have it. This is a proof enough that LALR(1)  is less potent than LR (1).

Reference:

[1] www.facweb.iitkgp.ernet.in/~niloy/Compiler/notes/LALRP.doc

hence all S1, S2, S3 are true. Option D is correct .

Answer:

Related questions

0 votes
0 votes
1 answer
1
Bikram asked Feb 9, 2017
219 views
The grammar having no Epsilon$\left ( \epsilon \right )$ transition or two adjacent nonterminals in the right side of any production is ?$LL$$\left ( 1 \right )$ grammarO...
3 votes
3 votes
3 answers
3
Bikram asked Feb 9, 2017
723 views
A radio is available at $\text{₹} 27780/-$ cash price, or three equal annual installments at $15\%$ per annum under $CI$ compounding annually. Each installment amount, ...