Mark Evenson writes:
It would be better to have a tool that can grok the Abstract Syntax Tree for Java, transforming that. [Jackpot][1] should be the kind of tool that would help with this sort of thing,
By the way, Java6 contains an API to the Java AST:
http://java.sun.com/javase/6/docs/api/javax/tools/JavaCompiler.html
At the moment, that's read-only access, but I wouldn't be surprised if that restriction will be lifted at some point in future. And we all know what this will mean: Java gets macros in disguise. :-)
Combined with invokedynamic, Java6 becomes an even more so interesting platform. Perhaps interesting enough to throw out backwards compatibility...
-T.