TechHelp
TechHelp

Reputation: 217

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?

Upvotes: 6

Views: 2719

Answers (1)

ayush
ayush

Reputation: 14578

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).

Upvotes: 7

Related Questions