Hi all,
I've been getting to grips with ANTLR over the last week or so but have
one question that i can't seem to get an answer for, so hope someone
here can help. Basically i have the following grammar:
T --> ta | o | J
J --> TcT | TjTb | J
I have made some changes to remove the left recursion in J and the
grammar now looks like:
X --> cT | jTb | "empty string"
T --> taX | oX
sorry had to use empty string, not sure on how to add symbols in this
prog. Ok now i don't know what to do with the J --> J bit i need to be
able to call the X rule again i guess but when i add in X --> X i keep
getting an infinite recursion error, does anyone have the slightest idea
on how to remove this?
also tried the following grammar:
X --> cTX | jTbX | "empty string"
T --> taX | oX
but this time got non-determinism errors.
Can anyone help me?
cheers
Dav