[antlr-interest] Re: failing to automate .g files building with visualc under windows 2000

Thomas Dudziak tomdz at cs.tu-berlin.de
Mon Feb 4 10:20:42 PST 2002

Hmm, I wasn't able to re-produce an "invalid command" error. Perhaps I can
help you by giving the steps that I use to include grammar files in the
build process:

I add the grammar files to the project (e.g. lexer, parser, tree grammar).
They should show up in the top-level in the project with an icon with a
down-arrow in it.

For each grammar file, I add the custom build settings to the project
settings. Typically this only consists of a call to the antlr tool :

java.exe -classpath %CLASSPATH% antlr.Tool -o $(InputDir) $(InputPath)

The variable InputPath contains the (relative) path to the grammar file
complete with filename and extension. As Andy Carpenter pointed out, you
could also use InputName, but this does not include the path nor the
extension (hence the additional ".g").
If I want to put the generated files elsewhere, I change the -o argument
A simple test as to whether this call works, can be done with a plain
command prompt in the directory where the project file (.dsp) resides, and
using the actual input path (which can be copied from the build output frame
after building a grammar).

I insert the names of the output files in the output files box later on, and
provide some dummy text now (VisualC++ requires some text here). The main
reason for this is that I'm usually too lazy to look into the grammer for
the type names.

I perform the build step on the grammars (only). This generates several
source and header files whose names I now add to the output files box. I
also add the generated files to the project.

Hope this helps,
Ciao, Tom


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

More information about the antlr-interest mailing list