[antlr-interest] Yang's Java.g - tree construction rules

Stephen Tuttlebee themightystephen at googlemail.com
Sat Mar 5 16:47:57 PST 2011


Hello

Does anyone know of a version of the Java.g written by Yang Jiang (see: 
http://openjdk.java.net/projects/compiler-grammar/ and 
http://www.antlr.org/grammar/1152141644268/Java.g) that performs tree 
construction using ANTLR's AST rewrite rules/construction operators 
(plus a tree grammar would be a bonus)?

I found a version of the Java.g parser that does tree construction of 
javac-style trees (required by the javac backend) using actions that 
created custom tree node objects (as opposed to using ANTLR's AST 
rewrite rules/construction operators (see: 
http://hg.openjdk.java.net/compiler-grammar/compiler-grammar/langtools/file/e37d7d5df672/src/share/classes/com/sun/tools/javac/antlr/Java.g). 
I have started going through that grammar and used it to help me work 
out how to build the AST -- however, the code is quite long and I 
thought I'd check if anyone knew of a version of Java.g that contained 
ANTLR-style tree construction before I go any further -- I don't want to 
try to reproduce something that someone else might have already done and 
also likely done a better job at too.

Thanks,
Stephen


More information about the antlr-interest mailing list