I am trying to construct an AST using the latest version of ANTLR (v4), i found a couple of links here in stack-overflow and also on the net, that shows you how to do it for a simple grammars. However, i wanted an AST for the Java.g4 grammar (Java language). Currently , i was following the approached recommended here (https://codevomit.wordpress.com/2015/04/25/antlr4-project-with-maven-tutorial-episode-3/). However based on this approach, i needed to label all the production rules that have alternatives.
Hence, i would greatly appreciate it if someone informed me if there is a different alternative for building an AST using ANTLR4 or if there is an already labeled java.g4 grammar.