edited by
718 views
0 votes
0 votes
Is the given grammar SLR(1)?

$\text{E}\rightarrow \text{T+E | T}$

$\text{T}\rightarrow i$
edited by

1 Answer

Best answer
0 votes
0 votes
Yes this is SLR(1).

The only conflict will be :

$E \rightarrow T. + E $ and

$E \rightarrow T.$

This is a Shift - Reduce conflict.

We can see that $Follow(E)= \{\$\}$

So, we reduce when we are at the end, and shift when we see a $+$. Conflict resolved and hence it is SLR(1).
selected by

Related questions

4 votes
4 votes
0 answers
1
2 votes
2 votes
1 answer
2
0 votes
0 votes
1 answer
3
Shyam Singh 1 asked Dec 10, 2016
1,469 views
Every SLR grammar is unambiguous. True or False? Why?
3 votes
3 votes
3 answers
4
thor asked Nov 15, 2016
2,224 views