[antlr-interest] How to specify target language from the command line?

Ranco Marcus ranco.marcus at epirion.nl
Mon Feb 1 01:46:51 PST 2010


When no language is specified in the options section, ANTLR defaults to Java. Is it possible to specify the default language when calling org.antlr.tool?

Many of my grammars (lexer, parser, and tree) have no language specific code and specifying the language (CSharp2 in my case) unnecessarily constrains the use of these grammars. To generate recognizers, I have written a (basic) custom tool for Visual Studio that calls ANTLR when changes are made to a .g file. I would like to specify the target language in the command line arguments. This way, the grammar could remain language independent and there would be no need to remove the language option each time the grammar is being debugged in ANTLRWorks.

Btw, Terence, congratulations on the new Language Implementation Patterns book. I read (most of) it last week and really enjoyed it!

Best regards,

Ranco Marcus




More information about the antlr-interest mailing list