1,852 views

• $S \to A \mid B$
• $A \to a \mid \epsilon$
• $B \to b \mid \epsilon$

Now if I want to generate empty string ($\epsilon$) from above grammar, I have more than one option to generate it. Obviously grammar is ambiguous. No parser will work.

So, just for answer : Grammar is NOT LL(1).

### 1 comment

Yes right I was also thinking the same but  for the grammars in which there is difficulty to direct see the ambiguity we have to follow the Parsing table strategy or First and follow method. Isn't it??
First(S)^First(A) !=0 so it is not LR(1)

Answer is right i.e. it is not even LR(1) but pairwise disjointness is property of LL parser not LR parser.
I was asking for LL(1) now i got answer. I think it should be calculated as First(A) intersection First(B) = {epsilon} != null. Hence Not LL(1).

1
2,446 views