[antlr-interest] ANTLR-based Java grammar for javac compiler

Andy Tripp antlr at jazillian.com
Thu Nov 13 14:30:26 PST 2008


This seems like a good goal for the new ANTLR tree rewrite mechanism.
Given the problem of converting a "whatever the java.g author thought
was reasonable" AST to a "exactly what javac needs" AST, if the
rewrite mechanism can make this easier than just "doing it by hand", then
it will be a "good" mechanism, and not just a toy.

Having said that, it looks to me like none of the tree rewrite software
(e.g. TXL) out there are "good". In other words, they don't look to me like they
are saving anybody any work, even for this typical use case.

I'm sure Terence could use ANTLR treewalkers to do this pretty quickly,
but I wonder if Jiang could, too.

Yang Jiang wrote:
> Yeah, that is the reason.
> The javac tree is more than just nodes, it also has info like position, 
> javadoc and line maps etc..
> It would be pretty easy to simply use the Antlr tree rewrite to build a 
> tree, but not that easy if
> the tree structure/specification has already been defined.

When is the tree structure that you need to produce NOT already defined?

> 
> Yang


More information about the antlr-interest mailing list