I have been taking a compiler course of Stanford on coursera. I have a slight misunderstanding on the parsing table of the following grammar:
S -> Sa | b
According to the professor parsing table looks like this:
If the leftmost nonterminal is S and the input is 'a', the production is nothing.
If the leftmost nonterminal is S and the input is 'b', the production is both
Sa
andb
.
So if input is just b
, then it is correct, it will go directly to production b
.
But how will it go to production Sa
for input b
?