Package org.antlr.v4.runtime.tree
Interface ParseTreeVisitor<T>
- Type Parameters:
T
- The return type of the visit operation. UseVoid
for 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 the
XVisitor
interface for
grammar X
.-
Method Summary
Modifier and TypeMethodDescriptionVisit a parse tree, and return a user-defined result of the operation.visitChildren
(RuleNode node) Visit the children of a node, and return a user-defined result of the operation.visitErrorNode
(ErrorNode node) Visit an error node, and return a user-defined result of the operation.visitTerminal
(TerminalNode node) Visit a terminal node, and return a user-defined result of the operation.
-
Method Details
-
visit
Visit a parse tree, and return a user-defined result of the operation.- Parameters:
tree
- TheParseTree
to visit.- Returns:
- The result of visiting the parse tree.
-
visitChildren
Visit the children of a node, and return a user-defined result of the operation.- Parameters:
node
- TheRuleNode
whose children should be visited.- Returns:
- The result of visiting the children of the node.
-
visitTerminal
Visit a terminal node, and return a user-defined result of the operation.- Parameters:
node
- TheTerminalNode
to visit.- Returns:
- The result of visiting the node.
-
visitErrorNode
Visit an error node, and return a user-defined result of the operation.- Parameters:
node
- TheErrorNode
to visit.- Returns:
- The result of visiting the node.
-