retagged by
496 views

1 Answer

2 votes
2 votes

After some googling, I found this grammar to be LL(1) but not LALR

S -> (X | E] | F)
X -> E) | F]
E -> A
F -> A
A -> ε

LALR fails because there is reduce reduce conflicts in E and F productions.

With LL(1), decision is made based on the FIRST set of alternatives where ')' and ']' falls in different set of alternatives.

Credits: stackoverflow

Related questions

0 votes
0 votes
1 answer
1
GateAspirant999 asked Dec 10, 2016
602 views
$S\rightarrow (x$$\text{ }| E]$$\text{ }| F)$$X\rightarrow E)$$\text{ }| F]$$E\rightarrow A$$F\rightarrow A$$A\rightarrow \lambda$
1 votes
1 votes
1 answer
2
learner_geek asked Aug 2, 2017
344 views
is this given diagram correct or incorrect if incorrect then please correct it .
2 votes
2 votes
1 answer
3
sripo asked Nov 10, 2018
3,240 views
Can you give an example which is not LL(1) but is CLR(1)
0 votes
0 votes
3 answers
4