8.6k views

Which of the following is the most powerful parsing method?

1. LL (1)
2. Canonical LR
3. SLR
4. LALR
| 8.6k views
0
Though it's not included in the question, where would operator precedence parser fit in the terms of power ?

Canonical LR is most powerful method

LR > LALR > SLR

so ans is B

by Boss
edited by
0
nice mam

power of PArser is derived on the basis of NO. of language parsed....

CLR could parsed all the language which could parsed by other.....

by Loyal
+2
Power of parser is in terms of number of GRAMMARS they can parse NOT the number Of LANGUAGES.
+1
Your diagram is wrong,every LL(1) grammar is not necessarily an LALR(1)
0
every LL(1) is LALR (1) also
0
@Divyanshum29

No. Check this grammar

S --> aX | Eb | Fc

X --> Ec | Fb

E --> A

F --> A

A --> epsilon.

Its LL(1) but not LALR(1).
0
@reena

" Power of parser is in terms of number of GRAMMARS they can parse NOT the number Of LANGUAGES. "

Can u explain a bit more?
+1

@srestha LR(1) parsers can parse every language in DCFL  set because DCFL are not inherently unambiguos i.e they are gaurenteed to exist atleast one unambiguous grammar that derives them . there is one to one correspondence between the number of DCFL languages and the LR(1)( cannonical LR) parsers  but  the pther parsers SLR LALR LR(0) donot gaurentee to parse even the unambiguous versions of the grammers corresponding to the DCFL hence the power increases as SHOWN ABOVE

0
ok :)

and what is difference in terms of grammar and in terms of language?
0
What she meant was Parser always corresponds to a grammer...for every grammer u will have a corresponding language  a language can have many grammars  but for every DCFL there is gaurenteed to exist one unambiguos one ..  we should not relate a language to the parser as it will be designed based on the grammer rules  and its not EXACTLY correct
Among the all parsing techniques Canonical LR i.e. CLR is MOST powerful method. We can also show the order of method in increasing power as below. LL(1) < SLR < LALR < CLR
by
ans b)
by Active
CLR is more powerful.
CLR  is most powerful parsing method .

clr>>lalr>>slr>>ll
Ans: B Canonical LR
by Loyal
–1 vote
by Loyal