问题描述:

I was able to get an object of class org.antlr.v4.runtime.tree.ParseTree from my Parser class. Now I'd like to visit every node and generate custom output based on the tree node type. How is it could be done in ANTLR4? There are no methods like getTreeNodeType().

网友答案:

Java provides a getClass() method you can use. Beyond that you'll need to be more specific about what information you need.

相关阅读:
Top