I have the grammar:
$\qquad \begin{align} S &\to S = P \mid S \neq P \mid P \\ P &\to NUM \end{align}$
This grammar suffers from left recursion. To eliminate left recursion, I got:
$\qquad \begin{align} S &\to PS' \\ S' &\to\, = PS' \mid\, \neq PS' \mid \varepsilon \\ P &\to NUM \end{align}$
However when constructing the LL(1) parsing table, it turns out the grammar is ambiguous. Is there a way to disambiguate the grammar without changing the generated language, or did I make a mistake somewhere?
This is my work so far:
Non-terminal Nullable First Follow
S False NUM $
S' True !=, ==, epsilon $
P False NUM $, ==, !=
Parse Table
!= == NUM $
S ->PS'
S' ->!=PS' ->==PS' ->epsilon
P ->NUM