I changed these files to make it happen:

tool/src/main/resources/org/antlr/codegen/templates/Java/ST.stg
runtime/Java/src/main/java/org/antlr/runtime/tree/DOTTreeGenerator.java

You can ignore the following files that I had to change because they are part of my test suite:

tool/src/test/java/org/antlr/test/BaseTest.java
tool/src/test/java/org/antlr/test/TestRewriteTemplates.java
tool/src/test/java/org/antlr/test/TestTemplates.java
tool/src/test/java/org/antlr/test/TestTreeParsing.java

In general, these are the changes I had to make:

So, in a nutshell, there are a few changes in one runtime support file for generating DOT from trees. All of the magic happens in the ST.stg file, if your target supports output=template option. Here is a play-by-play:

If you look at an ST.stg difference, there's not much to do. (smile)