Skip to main content
improved formatting, removed unnecessary capitalization and conversational signature
Source Link

Whats Wrong What's wrong with this LL(1) Grammargrammar?

I am trying to build a LL(1) parse table for the following Grammargrammar:

S -> L
L -> L : L
L -> id R
R -> ( L )
R -> ( )
R -> Epsilon

S -> L
L -> L : L
L -> id R
R -> ( L )
R -> ( )
R -> Epsilon

There are two Problemsproblems here. First, the LL rules are a left recursion and the RR rules have (( as the same prefix. So

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 -> )

S -> L
L -> id R X
X -> : L X
X -> Epsilon
R -> ( P
R -> Epsilon
P -> L )
P -> )

I then checked the Grammargrammar with the JFLAP Tool and it says that my grammar is not LL(1). But I just don't see the Problemproblem.

Can somebody help me out here?

regards Alex

Whats Wrong with this LL(1) Grammar?

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?

regards Alex

What's wrong with this LL(1) grammar?

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?

Source Link

Whats Wrong with this LL(1) Grammar?

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?

regards Alex