[antlr-interest] How to call self-build ANTLR correctly?

Micheal J open.zone at virgin.net
Tue Jul 3 14:29:43 PDT 2007


Oops!

See comment inline...

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org 
> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Micheal J
> Sent: 03 July 2007 22:18
> To: 'ANTLR Interest'
> Subject: Re: [antlr-interest] How to call self-build ANTLR correctly?
> 
> 
> Hi,
> 
> > Terence Parr wrote:
> > > you need the bin not bin\org\antlr in your path.  Also add
> > the runtime
> > > dir.
> > 
> > I do the following:
> > 
> > D:\>java -cp "D:\Install
> > Files\ANTLR\antlr-source\bin\org\antlr\runtime"
> > "D:\Install Files\ANTLR\antlr-source\bin"\org.antlr.Tool
> > 
> > The output:
> > 
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > D:\Install Files\ANTLR\antlr-source\bin\org/antlr/Tool
> 
> Try:
> 
> java -cp "D:\Install Files\ANTLR\antlr-source\bin" org.antlr.Tool
> 
> I am assuming the bin directory has (at least) the following 
> structure:
> 
> bin
>  +-org
>     +-antlr
>        +-analysis
>        +-codegen
>        +-misc
>        +-runtime
>        +-test  (optional?)
>        +-tool
> 

I forgot to mention that you are going to need the ANTLR 2.7.7 and the
StringTemplate 3.0.1 jars in your classpath too.

Example:

java -classpath "D:\Install
Files\ANTLR\antlr-source\bin";"D:\path\to\antlr-2.7.7.jar";"D:\path\to\strin
gtemplate-3.0.jar"  org.antlr.Tool


Your ANTLR3 bin directory will also need the resources such as the .sti,
.stg files etc. If it doesn't have to files, add the toplevel source
directory to your class path *after* the 'bin'. It would find the files that
way.

Example:

java -classpath "D:\Install
Files\ANTLR\antlr-source\bin";"D:\path\to\antlr-2.7.7.jar";"D:\path\to\strin
gtemplate-3.0.jar";"D:\Install Files\ANTLR\antlr-source\src"  org.antlr.Tool

> > > 
> > > Does build.xml help?
> > 
> > I have never used ANT, so I have no idea what you could mean
> > with that sentence.
> 
> No harm in trying ANT btw. If it eases the task of 
> (re-)building ANTLR for you. 
> 
> Micheal
> 
> PS	Perhaps someone Nant/MSBuild user might create a Nant 
> (or MSBuild)
> build file based on the build.xml file?
> 
> -----------------------
> The best way to contact me is via the list/forum. My time is 
> very limited.
> 



More information about the antlr-interest mailing list