A simple tool to visualize the AST generated by Javac.
Assuming that you are in the src directory of this repo.
javac -cp <path-to-jdk8>/lib/tools.jar *.java
java -cp .:<path-to-jdk8>/lib/tools.jar JavacASTViewer <path-to-java-file>
javac *.java
java -cp . JavacASTViewer <path-to-java-file>
This image shows the output when providing as input a Hello World program. The left panel shows the tree. When a node is selected, the center panel highlights the corresponding section of the source code. The right panel display additional data.