How can I build an AST using ANTLR4? [duplicate]
问题 This question already has answers here : How to create AST with ANTLR4? (2 answers) Closed last year . I have an ANTLR3 grammar that builds an abstract syntax tree. I'm looking into upgrading to ANTLR4. However, it appears that ANTLR4 only builds parse trees and not abstract syntax trees. For example, the output=AST option is no longer recognized. Furthermore neither "AST" nor "abstract syntax" appears in the text of "The Definitive ANTLR4 reference" . I'm wondering if I'm missing something.