[antlr-interest] Problems with Examples

Hugo Leeney hugo.leeney at gmail.com
Mon May 29 15:06:23 PDT 2006


I am trying to use ANTLR on an ubuntu system. Installation went fine
and I have got some examples running. Other examples are proving
problematic.

http://www.cs.usfca.edu/~parrt/course/652/lectures/antlr.html
The first part of this example compiles fine and runs without error.
The problem is that when I run it from the console it behaves
strangely. Here is an example session:

~&java Main
(3+4)



0
 ( + 3 4 ) 7
~$

(The final output varies depening how far along in the tutorial one is.

As you can see when I enter the expression it has no effect. Pressing
enter numerous times has no effect either. When I enter another
expression such as '0', however the program then responds and outputs
correctly. This is confusing.

http://www.jguru.com/faq/view.jsp?EID=78
I have not been able to finish the example on this page as I cannot
get past the first part. First of all I can point out an error in the
first listed main routine. The instantiation of IntAndIDexer should be
an IntAndIDLexer. Even with this correction the example crashes for me
no matter what input I give it with an error similar to:
'exception: line 1:2: unexpected char: 0xA'

I would like to get these examples working as they seem like they
should illustrate the basics of ANTLR well to me and that I can build
from them. I would be very appreciative of any help. Thanks in
advance.

PS Anyone know why jGuru is sooo sloooow (Like 5 minutes per page) ?? ;)


More information about the antlr-interest mailing list