I am trying to build a LL(1) parse table for the following grammar:
S -> L
L -> L : L
L -> id R
R -> ( L )
R -> ( )
R -> Epsilon
There are two problems here. First, the L
rules are a left recursion and the R
rules have (
as the same prefix.
So I modified the Grammar to this one:
S -> L
L -> id R X
X -> : L X
X -> Epsilon
R -> ( P
R -> Epsilon
P -> L )
P -> )
I then checked the grammar with the JFLAP Tool and it says that my grammar is not LL(1). But I just don't see the problem.
Can somebody help me out here?