prosseek prosseek - 3 months ago 23
C# Question

Add Build Action for ANTLR in Visual Studio

One needs to run ANTLR to make ANTLR grammar file into source file.

How can I use Build Action in Visual Studio for this? How can I make an Action something like "Build Antlr" to run antlr to generate source code?

enter image description here

Answer

This page has an answer - http://www.antlr.org/wiki/display/ANTLR3/Integration+with+Development+Environments

You need to add this line in your project file. <Project DefaultTargets="Build" InitialTargets="GenerateAntlrCode" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">