user3562135
user3562135

Reputation: 159

Why is this not LL(1) grammar?

S -> 1S2 | S0 | epsilon

I thought it would be LL(1) because it is possible to determine.

For example if the next input symbol was 0 i'd know it was S -> S0

Does the epsilon mean that it cannot be LL(1)?

Upvotes: 1

Views: 1008

Answers (1)

g_tec
g_tec

Reputation: 641

This grammar is not LL(1) just because it has a left recursion on it. When you will try to build the parser table, you will came up with a conflict.

http://en.wikipedia.org/wiki/LL_parser

Upvotes: 1

Related Questions