Generate code in lanaguages other than Java
Although ANTLR Studio is basically meant for generating Java code, you can still
use to to generate code with other languages.
The following features will not be available if you generate code in other
languages-
- Fluid Debugger
- Automatic grammar builds
Other than that the rest of ANTLR Studio will work normally without any
problems.
So you can just create a new grammar file and start typing out your grammar :)
Make sure you do this-
- DO NOT right click on the project and select 'Enable ANTLR
Studio'.
Doing so will turn on the automatic code generator which will generate the code
in Java.
You will need to put in an ant script which calls ANTLR to generate the code.
Sample ANT build script
Click here to download a sample ant build.xml file.
To use it-
- Place it in the same directory as your grammar file.
- Place the antlr jar in that directory too.
-
Open the build.xml file and and set the 'grammar' property to the name of your
grammar file.
E.g.- if the name of your grammar file is 'MyGrammar.g', it would look like this-
<property name="grammar" value="MyGrammar.g"/>