Package org.antlr.v4.runtime.tree
Interface ParseTreeVisitor<T>
-
- Type Parameters:
T- The return type of the visit operation. UseVoidfor operations with no return type.
- All Known Implementing Classes:
AbstractParseTreeVisitor
public interface ParseTreeVisitor<T>This interface defines the basic notion of a parse tree visitor. Generated visitors implement this interface and theXVisitorinterface for grammarX.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tvisit(ParseTree tree)Visit a parse tree, and return a user-defined result of the operation.TvisitChildren(RuleNode node)Visit the children of a node, and return a user-defined result of the operation.TvisitErrorNode(ErrorNode node)Visit an error node, and return a user-defined result of the operation.TvisitTerminal(TerminalNode node)Visit a terminal node, and return a user-defined result of the operation.
-
-
-
Method Detail
-
visit
T visit(ParseTree tree)
Visit a parse tree, and return a user-defined result of the operation.- Parameters:
tree- TheParseTreeto visit.- Returns:
- The result of visiting the parse tree.
-
visitChildren
T visitChildren(RuleNode node)
Visit the children of a node, and return a user-defined result of the operation.- Parameters:
node- TheRuleNodewhose children should be visited.- Returns:
- The result of visiting the children of the node.
-
visitTerminal
T visitTerminal(TerminalNode node)
Visit a terminal node, and return a user-defined result of the operation.- Parameters:
node- TheTerminalNodeto visit.- Returns:
- The result of visiting the node.
-
-