Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compiler Tools Pccts > ANTLR infinite ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 45 of 134
Post > Topic >>

ANTLR infinite recursion --HELP

by dav <dav@[EMAIL PROTECTED] > Apr 21, 2004 at 06:13 PM

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
 




 1 Posts in Topic:
ANTLR infinite recursion --HELP
dav <dav@[EMAIL PROTEC  2004-04-21 18:13:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 2:54:10 CDT 2008.