0

I have an Antlr grammar. It is helpfully generating some files -- for example the one below.

bin/Debug/CalculatorExpressionParserBaseListener.cs

The only problem is that what I would really like to do is to put it into another directory, say

antlrGenerated/CalculatorExpressionParserBaseListener.cs

Can I tell Antlr to do that?

I understand that I could just move the files. But that's an annoying extra step to have to do every time they are regenerated.

William Jockusch
  • 26,513
  • 49
  • 182
  • 323

1 Answers1

-1

The ANTLR MSBuild was developed in that way, and there is no option to change the file path.

For what purpose you want to keep that temp file? The generated file is never useful at all (except for debugging), and should be excluded from source control.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • Other IDEs don't build ANTLR (Xamarin Studio). So I need it when developingfrom my mac. – William Jockusch Jan 24 '15 at 16:42
  • On non-Windows platforms, you should test latest xbuild as many issues I once reported about ANTLR targets have been fixed. Meanwhile, it is pretty easy to use conditions to call ANTLR On Mono. I have a sample here, https://github.com/lextm/sharpsnmplib/blob/master/archived/ast_gen2/SharpSnmpLib.AST.csproj – Lex Li Jan 24 '15 at 22:27