[antlr-interest] Proposal to make writing language targets a bit easier
rmann at latencyzero.com
Mon Jan 19 17:50:58 PST 2009
I have grander plans, but this suggestion I think is easy to implement.
First, re-org the source directories so that the runtime, Java
and .stg files for a given language are kept under a combined
directory structure. The Maven build would probably need to be
modified to allow it to find the Java files in an arbitrary location
(this way, I can work on my language target and check it into my own
version control until it's ready for submission).
Second, modify the 'language' option to accept an absolute path. The
ANTLR tool can look for a path separator in the value, and it would
use this directory (or some directory under it) on disk, rather than
relative to the classpath, for loading the .stg files. The actual
language string would come from the last component of the path. This
allows me to skip recompiling for changes in .stg files alone, and
dramatically speeds up development.
I hard-coded the path in ANTLR to point to my templates directory, so
it's working for me, but this should be a pretty easy change to make.
I'd happily code it up and submit a patch, if you like (although I may
miss some places where it's used).
More information about the antlr-interest