I come with a question while doing one of the exercises for my parsing course in the university. The question specifically goes to constructing a parsing table using canonical LR items.
The given grammar production rules go as follow:
S -> NP VP
NP -> NP PP
NP -> a n
VP -> v
VP -> VP NP
VP -> VP PP
PP -> p NP
Now the problem is, when I try to construct the table by figuring out the states, I end up with this problem:
at I_0
S'-> .S
S->.NP VP
NP->.NP PP/.a n
In this above case, I have to perform go-to action on both S->.NP VP and NP->.NP PP. This would indicate that when I create the parsing table, I would have two states in which NP could bring the parsing to. Am I missing something here?
Please do note that while I can see this question not being a problem with a lookahead, this question was specifically for LR(0) exercise.