Search code examples
antlrantlrworks

ANTLRWorks standard tree


When debugging grammar in ANTLRWorks, ANTLRWorks builds a nice tree without any "^", "!" operators inside rules. Is it possible to access this tree whithout adding "^", "!" operators to grammar source?


Solution

  • Since you didn't define ^ and ! operators (or rewrite rules), you must mean the parse tree (not the AST). But, the answer is: no, that's not possible. They are created internally in ANTLRWorks, there's no (public) API to access this structure.