| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected Result | Returns: The updated aggregate result.The previous aggregate value. In the default
implementation, the aggregate value is initialized to
aggregate, Result defaultResult, which is passed as the aggregate argument
to this method after the first child node is visited.The result of the immediately preceeding call to visit
a child node. nextResult)Aggregates the results of visiting multiple children of a node. |
| protected Result | Returns: The default value returned by visitor methods.Gets the default value returned by visitor methods. |
| protected boolean | Returns: true to continue visiting children. Otherwise return
false to stop visiting children and immediately return the
current aggregate result from visitChildren.The node, Result RuleNode whose children are currently being
visited.The current aggregate result of the children visited
to the current point. currentResult)This method is called after visiting each child in
|
| public Result | visit(ParseTree
The tree)ParseTree to visit.Implements org. |
| public Result | visitChildren(RuleNode
The node)RuleNode whose children should be visited.Implements org. |
| public Result | visitErrorNode(ErrorNode
The node)ErrorNode to visit.Implements org. |
| public Result | visitTerminal(TerminalNode
The node)TerminalNode to visit.Implements org. |
| AbstractParseTreeVisitor | back to summary |
|---|---|
| public AbstractParseTreeVisitor() | |
| aggregateResult | back to summary |
|---|---|
| protected Result aggregateResult(Result aggregate, Result nextResult) Aggregates the results of visiting multiple children of a node. After
either all children are visited or The default implementation returns
| |
| defaultResult | back to summary |
|---|---|
| protected Result defaultResult() Gets the default value returned by visitor methods. This value is
returned by the default implementations of
The base implementation returns
| |
| shouldVisitNextChild | back to summary |
|---|---|
| protected boolean shouldVisitNextChild(RuleNode node, Result currentResult) This method is called after visiting each child in
The default implementation always returns
| |
| visit | back to summary |
|---|---|
| public Result visit(ParseTree tree) Implements org. Doc from org. Visit a parse tree, and return a user-defined result of the operation. The default implementation calls | |
| visitChildren | back to summary |
|---|---|
| public Result visitChildren(RuleNode node) Implements org. Doc from org. Visit the children of a node, and return a user-defined result of the operation. The default implementation initializes the aggregate result to
The default implementation is not safe for use in visitors that modify the tree structure. Visitors that modify the tree should override this method to behave properly in respect to the specific algorithm in use. | |
| visitErrorNode | back to summary |
|---|---|
| public Result visitErrorNode(ErrorNode node) Implements org. Doc from org. Visit an error node, and return a user-defined result of the operation. The default implementation returns the result of
| |
| visitTerminal | back to summary |
|---|---|
| public Result visitTerminal(TerminalNode node) Implements org. Doc from org. Visit a terminal node, and return a user-defined result of the operation. The default implementation returns the result of
| |