# ISRO2015-29

3.3k views

Which statement is true?

1. LALR parser is more powerful and costly as compare to other parsers
2. All CFG's are LP and not all grammars are uniquely defined
3. Every SLR grammar is unambiguous but not every unambiguous grammar is SLR
4. LR(K) is the most general back tracking shift reduce parsing method

edited

A . Most powerful and costly order is

LR(0) < SLR(1) < LALR(1) < CLR(1)

B . The grammar generated by LP are CFG but not implying All CFG are LP.

C . Every SLR grammar is unambiguous but not every unambiguous grammar is SLR

D . LR(k) is the most general non back tracking shift reduce parsing method

selected by
0
what kind of mistake in C option ?
0
I have seen the official paper of isro in which option c is

Every SLR grammar is unambiguous but not every unambiguous grammar is SLR
0
Ok that's fines then how you come to conclusion that option B is correct.
0
I did not understand the meaning of LP that why i left the option without exploring .because all others are wrong .
1
Ya LP here is  Linear precedence rule.

The grammar generated by LP are CFG but not implying All CFG are LP.
0
so it makes all the option B also wrong .then there must be a correction in option c and the answer would be C
0
yes
0
what is LP?
Option C will be right option.

According to more error capability along with cost order of different types of parser is given.

CLR(1)>LALR(1)>SLR(1)>LR(0)

But according to number of state .

n4>=n3=n2=n1

There is no property of non back tracking shift reduce in any parser.

So only option C will be right option bcz only operator precedence grammar will act with amgiguos grammar and all grammar act with unambiguos grammar along not all unambiguos grammar will be SLR(1).

So option C will be right.
0
what do you mean by  n4,n3,n2,n1  clearly specify naaa

## Related questions

1
2.3k views
Which one of the following is a top-down parser? Recursive descent parser Shift left associative parser SLR(k) parser LR(k) parser
Which grammar rules violate the requirement of the operator grammar? A, B, C are variables and a, b, c are terminals $A \rightarrow BC$ $A \rightarrow CcBb$ $A \rightarrow BaC$ $A \rightarrow \epsilon$ (a) 1 only (b) 1 and 2 (c) 1 and 3 (d) 1 and 4