[antlr-interest] Trying to compile ANTLR 3.0b5

Ochoa, Jayne Jayne.Ochoa at absg.com
Thu Nov 30 14:18:16 PST 2006


Hello.
 
To be upfront, I do not have experience in Java, so I already have a
disadvantage there. :( I actually come from a C#/.Net 2.0 background. I
am having issues working with 3.0b5 and I don't know what it is I am
doing wrong. I am working on a Windows 2003 computer with the Java JDK
1.5. My intent is to generate C# code with ANTLR.
 
A couple of things. I am reading the read me for v3 at:
http://www.antlr.org/v3/README.txt I am not using the ANTLRWorks GUI.
 
My CLASSPATH reads: 
 
D:\Code\ANTLR\antlr-3.0b5\src>echo %CLASSPATH%
D:\Code\ANTLR\antlr-3.0b5\lib\antlr2.7.7.jar;D:\Code\ANTLR\antlr-3.0b5\l
ib\antlr
-3.0b5.jar;D:\Code\ANTLR\antlr-3.0b5\lib\stringtemplate-3.0.jar
 
At one point, my CLASSPATH only had:
 
D:\Code\ANTLR\antlr-3.0b5\lib
 
I was using the example in the readme.txt file at antlr.org, and I
figured out that the example command to type in to compile ANTLR did
*not* work. The command I am referring to is:
 
javac -d . org/antlr/Tool.java org/antlr/*/*.java org/antlr/*/*/*.java
 
That did not work on my system. So I came up with the following command:
 
javac -verbose -d . -classpath org\antlr\*.java
org\antlr\analysis\*.java org\antlr\codegen\*.java org\antlr\misc\*.java
org\antlr\runtime\debug\*.java  org\antlr\runtime\misc\*.java
org\antlr\runtime\tree\*.java org\antlr\test\*.java
org\antlr\tool\*.java

I did that trying to include all the java files. I am now getting 100
errors. Many of which look like:
 
org\antlr\tool\Grammar.java:494: package antlr does not exist
                throws antlr.RecognitionException,
antlr.TokenStreamException
                            ^
org\antlr\tool\Grammar.java:494: package antlr does not exist
                throws antlr.RecognitionException,
antlr.TokenStreamException
                                                        ^
org\antlr\tool\ANTLRParser.java:35: package antlr does not exist
import antlr.*;
^
org\antlr\tool\ANTLRParser.java:37: package antlr does not exist
import antlr.TokenBuffer;
             ^
I have installed Eclipse. I was not able to compile ANTLR. I have
installed JCreator. I was not able to compile it. The further I have
gotten was when I loaded up Visual Studio 2005 and attempted J#. I
_still_ got errors as described above. I don't know how to fix this. Is
there something in the ANTLR code I need to do to get it to compile? How
do I get this to compile?
 
Secondly.
I am reading the readme.txt file and found where the .jar files are in
antlr-3.0b5\lib. I tried to run: java org/antlr/tool.java but kept
getting the exception no "main" found error. I realize that it's not
finding the org.antlr.tool file.
 
I even tried running that java command from the src/ directory. Still no
go.
 
I am frustrated with this. We have a system I need to rewrite and I have
been tasked with using ANTLR. I am trying to use the new version of
ANTLR but have gotten no where with it. I've played a little bit with
version 2.7.6 and was able to get something. I may go back to that
version, or version 2.7.7. I don't know. I want to use the latest
version, however.
 
I have looked into other language translators but they're not doing what
ANTLR can do. Like I said, I don't have a java background so I have no
idea how to get these files to compile. I have, to the best of my
ability, my environment set up. I know I can atleast run .jar files and
I am able to run the antlrworks .jar program.
 
How do I get ANTLR 3.0b5 to compile under Java? Are there any
executables/jar files already ready to go that I don't even have to
worry about compiling and I can get to just working with the grammar
files already? I've spent on a week on this already and don't have
anything. Thank you for whatever help you can give.
 
Jayne Ochoa
Software Developer
AmerisourceBergen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20061130/181ef53f/attachment.html 


More information about the antlr-interest mailing list