I'm reading about LR(0) parser from this book: Modern Compiler Implementation in Java. Below is how the parsing table looked like based on the book. http://postimg.org/image/hyowddu1h/
Start symbol: S --> E$
Productions:
(1) E --> T + E
(2) E --> T
(3) T --> x
I tried making a parsing table based on the productions given but I didn't get the same parsing table as the one in the book. I think I shifted the symbol correctly. It's just that I have different parsing table than the one in the book. (Note: I started with state 0 instead of state 1 like in the book)
So is the parsing table unique or is there any rule of thumbs on deciding which symbol to shift to the stack first or how to label the parsing state correctly? I always shift the terminal symbols first then nonterminal symbols as shown below: http://postimg.org/image/76vbu2vu3/
Thanks in advance!