[antlr-interest] Adding antlr to Visual Studio C#

Arto Viitanen arto.viitanen at pp4.inet.fi
Fri Sep 14 07:24:57 PDT 2007


How can I add Antlr (I use the binary tool from
http://www.antlr.org/download/Antlr.Tool.zip) to Visual Studio C#?
I have defined it as external tool:

Title: [Antlr]
Command: C:\antlr\Antlr\Antlr3.Tool.exe
Arguments: ${ItemPath}
Initial directory: ${ItemDir}

+ Use output Window

This works fine, but I have to select [Antlr] from tool menu each time I
like to run antlr to a .g file. Since I have
one file for parser/lexer and another for tree walker (most likely I
will get yet another to generate code), I'd like
to make the Visual Studio realize that when an .g file is changed, it
should run the [Antlr] tool for the file.

I have found some examples on adding antlr to Visual Studio, but they
add antlr tool to the "run before build" .
Catch is, I'd like to run antlr only when the file is changed.

--
Arto Viitanen


More information about the antlr-interest mailing list