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 theXVisitor
interface for grammarX
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
visit(ParseTree tree)
Visit a parse tree, and return a user-defined result of the operation.T
visitChildren(RuleNode node)
Visit the children of a node, and return a user-defined result of the operation.T
visitErrorNode(ErrorNode node)
Visit an error node, and return a user-defined result of the operation.T
visitTerminal(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
- TheParseTree
to 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
- TheRuleNode
whose 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
- TheTerminalNode
to visit.- Returns:
- The result of visiting the node.
-
-