Before my Visual Studio custom tool calls the ANTLR tool, it adds language=XXX
just after options\s*{. Not the nicest way, but it gets the job done. Now I can
use my language independent lexer, parser and tree grammars in ANTLRWorks for
debugging and use the same file in the target environment.
Some options really concern the recognizer, such as tokenVocab, output,
ASTLabelType, filter, etc. and I can't see a reason why you would like to
change those independent of the contents of the file. Some options however,
like language or superclass, could be independent of the target. Would it be an
idea to be able to specify extra options from the command line?
Ciao, Ranco
From: Ranco Marcus
Sent: maandag 1 februari 2010 10:47
To: [email protected]
Subject: How to specify target language from the command line?
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
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.