I am new to the subject of compilation and have just started an exercise for Bottom -up parsing.
I have stuck on the following problem.
build a LR(0) parsing table for following grammar:
1) E –> E + T
2) E –> T
3) T –> (E)
4) T –> id
I0 :
E' –> .E
E –> .E + T
E –> .T
T –> .(E)
T –> .id
on E the next state in the DFA would be :
I1:
E' -> E.
E -> E. + T
from what I have learned so far isn't this a S-R conflict? because the parser would not know whether to reduce or shift as it has no look-ahead variable? so this should not be LR(0) grammar?
but the PDF which I am reading have built the LR(0) table. So is there a mistake in the PDF or have I gone wrong some where understanding the concept?