in Compiler Design
3,164 views
5 votes
5 votes

Which of the following statements is FALSE?

  1. Any DCFL has an equivalent grammar that can be parsed by a SLR(1) parser with end string delimiter
  2. Languages of grammars parsed by LR(2) parsers is a strict super set of the languages of grammars parsed by LR(1) parsers
  3. Languages of grammars parsed by LL(2) parsers is a strict super set of the languages of grammars parsed by LL(1) parsers
  4. There is no DCFL which is not having a grammar that can be parsed by a LR(1) parser
in Compiler Design
by
3.2k views

4 Comments

Reffering from the diagram in... https://gateoverflow.in/1470/gate1999-1-17#16773

Iam confused how B is false.  @Arjun sir please help. which one of them is true.

0
0
edited by

@suraj20041995 diagram is referring to parsers…..In question languages of grammar is mentioned….

refer this  -https://gatecse.in/lr-parsing-part-2-language-of-ll-and-lr-grammars/

 

important points

 

0
0
dcfl ?
0
0

3 Answers

0 votes
0 votes
B is false because LR(k) is equivalent to LR(k+1) grammar not any superset relationship
0 votes
0 votes
Answer is B

LR(0) ⊂ LR(1) = LR(2) ........LR(k) = LR(k+1)  ; for k >= 1 : LR(k)=LR(k+1)

so, Languages of grammars parsed by LR(2) parsers is not a strict super set of the languages of grammars parsed by LR(1) parsers

although they both are same ;

if you compare their grammars :

LR(0) ⊂ LR(1) ⊂ LR(2) ........LR(k) ⊂ LR(k+1)

2 Comments

Why you have mentioned LR(2) as a superset of LR(1)
0
0
edited by

1 . LR(2) Grammar is super-set of LR(1) grammar .

2 . Languages of grammars parsed by LR(2) parsers is same as Languages of grammars parsed by LR(1) parsers

please make sure , 1 statement is talking about grammar , 2 is talking about Language

1
1
0 votes
0 votes
A,C,D are correct options. B is false.
Answer:

Related questions