Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is hierarchy for these grammars: LL1,SLR1,LR0,LR1 and LALR1?

How are these grammars related to each other? e.g. SLR is a subset of LALR1. Is there any set methods for working out the relationships between the others?

like image 557
TechHelp Avatar asked Jan 19 '11 13:01

TechHelp


1 Answers

There are three types of Context Free Grammers(CFG'S).

1)Floyd-Evans Parsable 2)Unambiguous CFGs 3)Operator Precedence

All the ones u have mentioned above are Unambiguous CFG'S.

LL(0) < LL(1) < LL(k). LR(0) < SLR(1) < LALR(1) < LR(1) < LR(k). Also, LL(k) < LR(k)

Every LR(0) grammer id SLR(1) and every SLR(1) is LALR(1) which in turn is LR(1).

like image 131
ayush Avatar answered Sep 28 '22 00:09

ayush