0

It's really important to me, so please help me.
Is this grammar LL(1)?

S -> LAB
L -> d | ε
A -> dA | Ba
B -> Bb | ε

can anyone help me with LL(1) parsing table?
Am I right about this?

first(S) = {a,b,d}
first(L) = {d}
first(A) = {b,d}
first(B) = {b}

follow(S) = {$}
follow(L) = {a,b,d}
follow(A) = {b,$}
follow(B) = {$}
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
mrp59
  • 9
  • 1

1 Answers1

0

I used the JFLAP tool on your grammar. JFLAP does not think your grammar is LL(1), but can try and build a parse table for it.

You could experiment with the grammar in JFLAP to make it LL(1) conformant.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129