437 views
0 votes
0 votes
Grammar :
E->T+E/T
T->id/id*T/(E)
Is grammar LL(2)?

1 Answer

Best answer
1 votes
1 votes

Yes this grammar is not LL(1) but it's LL(2).

T->id | id*T 

this grammar is not LL(1) because if we show one look ahead to parser, it can not decide which production to choose, but if the length of look ahead is 2, there is no problem.

selected by

Related questions

2 votes
2 votes
1 answer
1
Kaifi7 asked Oct 7, 2017
568 views
How to check in the grammar that which parsing method works more efficient for it?For eg in the following grammar -S- Aa/bS->aOptions -a) Top - Downb) Bottom - upc) Bothd...