Alex Rivera | Logout

How to determine whether a language is LL(1) LR(0) SLR(1)

Asked 2009-01-24T12:19:49.623
24

Is there a simple way to determine whether a grammar is LL(1), LR(0), SLR(1)... just from looking on the grammar without doing any complex analysis?

For instance: To decide whether a BNF Grammar is LL(1) you have to calculate First and Follow sets - which can be time consuming in some cases.

Has anybody got an idea how to do this faster? Any help would really be appreciated!

Edit
Report

1 Answer

0

ya there are shortcuts for ll(1) grammar

1) if A->B1|B2|.......|Bn then first(B1)intersection first(B2)intersection .first(Bn)=empty set then it is ll(1) grammar

2) if A->B1|epsilon then B1 intersection follow(A)is empty set

3) if G is any grammar such that every non terminal derives only one production then the grammar is LL(1)

answered 2011-12-17T12:38:26.380

Your Answer