3,197 views
1 votes
1 votes
The power of parsers is as follows:

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

Can we say that if a language is not parsed by powerful parser then less powerful parsers can't parse that language?

Likewise, if a language can be parsed by less powerful parser, can it be parsed by all powerful parsers than that?

Is there a formal proof for the above two questions?

How to compare SLR and LALR parser formally?

1 Answer

1 votes
1 votes
First of all LL(1) can't be compared like wise as you mentioned because it parse through TOP DOWN APPROACH without back tracking where as Left recursion and Non determinism is not allowed.

But a grammar could be LR(0),SLR(1),CLR(1), LALR(1)

But when a grammar is Ambiguous no parser be possible.

Q.Can we say that if a language is not parsed by powerful parser then less powerful parsers can't parse that language?

Ans. May or May not, except LALR(1) parser.

        Suppose CLR(1) can't parse a grammar, it means there exist a Conflicts(SR or RR), but it does not mean that the grammar can't be parsed by LR(0), SLR(1), but LALR(1) can't be parsed absolutely correct.

Related questions

2 votes
2 votes
2 answers
2
gate19 asked May 26, 2018
1,153 views
What is the difference between $SLR(1)$ and $LALR(1)$ parser ? Both parser have same parsing table then how $SLR$ is subset of $LALR$ ?
0 votes
0 votes
1 answer
3
Utsav09 asked Jan 31, 2018
369 views
Consider the grammar given$S\rightarrow AA$$A\rightarrow aA / b$How many entries will be blank in the GOTO table for SR(0) items?
0 votes
0 votes
0 answers
4
Parshu gate asked Dec 5, 2017
2,381 views