[antlr-interest] Tweaking Java target

Sam Barnett-Cormack s.barnett-cormack at lancaster.ac.uk
Mon Mar 23 06:12:49 PDT 2009


Sam Barnett-Cormack wrote:
> Hey all,
> 
> Say I wanted to tweak the Java target - say, create a new DoccedJava
> target that's identical apart from doing some generated doc-comments in
> the output. I know that it'd break with new versions and so on, but I'm
> happy to maintain it privately for my own use. I'm not saying add it to
> the product.
> 
> What files need editing? Where are they? Do I need to unroll the jar and
> reroll it, or can I have "local" target templates in my project build path?

To answer my own question, it appears that I can use my own targets as
long as they're in the build classpath in the right place
(org.antlr.codegen.templates.TARGET), and in this case I rename Java.stg
to match the new name, and edit it. There seems to be a separate issue
with ANTLR-IDE, but I'll post that to their Sourceforge forum.

This is quite sweet, really...

Sam


More information about the antlr-interest mailing list