- java.lang.Object
- 
- com.sun.source.util.TreeScanner<R,P>
 
- 
- Type Parameters:
- R- the return type of this visitor's methods. Use- Voidfor visitors that do not need to return results.
- P- the type of the additional parameter to this visitor's methods. Use- Voidfor visitors that do not need an additional parameter.
 - All Implemented Interfaces:
- TreeVisitor<R,P>
 - Direct Known Subclasses:
- TreePathScanner
 
 public class TreeScanner<R,P> extends Object implements TreeVisitor<R,P> A TreeVisitor that visits all the child tree nodes. To visit nodes of a particular type, just override the corresponding visitXYZ method. Inside your method, call super.visitXYZ to visit descendant nodes.The default implementation of the visitXYZ methods will determine a result as follows: - If the node being visited has no children, the result will be null.
- If the node being visited has one child, the result will be the
 result of calling scanon that child. The child may be a simple node or itself a list of nodes.
-  If the node being visited has more than one child, the result will
 be determined by calling scaneach child in turn, and then combining the result of each scan after the first with the cumulative result so far, as determined by thereduce(R, R)method. Each child may be either a simple node of a list of nodes. The default behavior of thereducemethod is such that the result of the visitXYZ method will be the result of the last child scanned.
 Here is an example to count the number of identifier nodes in a tree: class CountIdentifiers extends TreeScanner<Integer,Void> { @Override public Integer visitIdentifier(IdentifierTree node, Void p) { return 1; } @Override public Integer reduce(Integer r1, Integer r2) { return (r1 == null ? 0 : r1) + (r2 == null ? 0 : r2); } }- Since:
- 1.6
 
- 
- 
Constructor SummaryConstructors Constructor Description TreeScanner()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Rreduce(R r1, R r2)Reduces two results into a combined result.Rscan(Tree tree, P p)Scans a single node.Rscan(Iterable<? extends Tree> nodes, P p)Scans a sequence of nodes.RvisitAnnotatedType(AnnotatedTypeTree node, P p)Visits an AnnotatedTypeTree node.RvisitAnnotation(AnnotationTree node, P p)Visits an AnnotatedTree node.RvisitArrayAccess(ArrayAccessTree node, P p)Visits an ArrayAccessTree node.RvisitArrayType(ArrayTypeTree node, P p)Visits an ArrayTypeTree node.RvisitAssert(AssertTree node, P p)Visits an AssertTree node.RvisitAssignment(AssignmentTree node, P p)Visits an AssignmentTree node.RvisitBinary(BinaryTree node, P p)Visits a BinaryTree node.RvisitBlock(BlockTree node, P p)Visits a BlockTree node.RvisitBreak(BreakTree node, P p)Visits a BreakTree node.RvisitCase(CaseTree node, P p)Visits a CaseTree node.RvisitCatch(CatchTree node, P p)Visits a CatchTree node.RvisitClass(ClassTree node, P p)Visits a ClassTree node.RvisitCompilationUnit(CompilationUnitTree node, P p)Visits a CompilationUnitTree node.RvisitCompoundAssignment(CompoundAssignmentTree node, P p)Visits a CompoundAssignmentTree node.RvisitConditionalExpression(ConditionalExpressionTree node, P p)Visits a ConditionalExpressionTree node.RvisitContinue(ContinueTree node, P p)Visits a ContinueTree node.RvisitDoWhileLoop(DoWhileLoopTree node, P p)Visits a DoWhileTree node.RvisitEmptyStatement(EmptyStatementTree node, P p)Visits an EmptyStatementTree node.RvisitEnhancedForLoop(EnhancedForLoopTree node, P p)Visits an EnhancedForLoopTree node.RvisitErroneous(ErroneousTree node, P p)Visits an ErroneousTree node.RvisitExpressionStatement(ExpressionStatementTree node, P p)Visits an ExpressionStatementTree node.RvisitForLoop(ForLoopTree node, P p)Visits a ForLoopTree node.RvisitIdentifier(IdentifierTree node, P p)Visits an IdentifierTree node.RvisitIf(IfTree node, P p)Visits an IfTree node.RvisitImport(ImportTree node, P p)Visits an ImportTree node.RvisitInstanceOf(InstanceOfTree node, P p)Visits an InstanceOfTree node.RvisitIntersectionType(IntersectionTypeTree node, P p)Visits an IntersectionTypeTree node.RvisitLabeledStatement(LabeledStatementTree node, P p)Visits a LabeledStatementTree node.RvisitLambdaExpression(LambdaExpressionTree node, P p)Visits a LambdaExpressionTree node.RvisitLiteral(LiteralTree node, P p)Visits a LiteralTree node.RvisitMemberReference(MemberReferenceTree node, P p)Visits a MemberReferenceTree node.RvisitMemberSelect(MemberSelectTree node, P p)Visits a MemberSelectTree node.RvisitMethod(MethodTree node, P p)Visits a MethodTree node.RvisitMethodInvocation(MethodInvocationTree node, P p)Visits a MethodInvocationTree node.RvisitModifiers(ModifiersTree node, P p)Visits a ModifiersTree node.RvisitNewArray(NewArrayTree node, P p)Visits a NewArrayTree node.RvisitNewClass(NewClassTree node, P p)Visits a NewClassTree node.RvisitOther(Tree node, P p)Visits an unknown type of Tree node.RvisitPackage(PackageTree node, P p)Visits a PackageTree node.RvisitParameterizedType(ParameterizedTypeTree node, P p)Visits a ParameterizedTypeTree node.RvisitParenthesized(ParenthesizedTree node, P p)Visits a ParenthesizedTree node.RvisitPrimitiveType(PrimitiveTypeTree node, P p)Visits a PrimitiveTypeTree node.RvisitReturn(ReturnTree node, P p)Visits a ReturnTree node.RvisitSwitch(SwitchTree node, P p)Visits a SwitchTree node.RvisitSynchronized(SynchronizedTree node, P p)Visits a SynchronizedTree node.RvisitThrow(ThrowTree node, P p)Visits a ThrowTree node.RvisitTry(TryTree node, P p)Visits a TryTree node.RvisitTypeCast(TypeCastTree node, P p)Visits a TypeCastTree node.RvisitTypeParameter(TypeParameterTree node, P p)Visits a TypeParameterTree node.RvisitUnary(UnaryTree node, P p)Visits a UnaryTree node.RvisitUnionType(UnionTypeTree node, P p)Visits a UnionTypeTree node.RvisitVariable(VariableTree node, P p)Visits a VariableTree node.RvisitWhileLoop(WhileLoopTree node, P p)Visits a WhileLoopTree node.RvisitWildcard(WildcardTree node, P p)Visits a WildcardTypeTree node.- 
Methods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods declared in interface com.sun.source.tree.TreeVisitorvisitExports, visitModule, visitOpens, visitProvides, visitRequires, visitUses
 
- 
 
- 
- 
- 
Method Detail- 
scanpublic R scan(Tree tree, P p) Scans a single node.- Parameters:
- tree- the node to be scanned
- p- a parameter value passed to the visit method
- Returns:
- the result value from the visit method
 
 - 
scanpublic R scan(Iterable<? extends Tree> nodes, P p) Scans a sequence of nodes.- Parameters:
- nodes- the nodes to be scanned
- p- a parameter value to be passed to the visit method for each node
- Returns:
- the combined return value from the visit methods.
      The values are combined using the reducemethod.
 
 - 
reducepublic R reduce(R r1, R r2) Reduces two results into a combined result. The default implementation is to return the first parameter. The general contract of the method is that it may take any action whatsoever.- Parameters:
- r1- the first of the values to be combined
- r2- the second of the values to be combined
- Returns:
- the result of combining the two parameters
 
 - 
visitCompilationUnitpublic R visitCompilationUnit(CompilationUnitTree node, P p) Visits a CompilationUnitTree node. This implementation scans the children in left to right order.- Specified by:
- visitCompilationUnitin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitPackagepublic R visitPackage(PackageTree node, P p) Visits a PackageTree node. This implementation scans the children in left to right order.- Specified by:
- visitPackagein interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitImportpublic R visitImport(ImportTree node, P p) Visits an ImportTree node. This implementation scans the children in left to right order.- Specified by:
- visitImportin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitClasspublic R visitClass(ClassTree node, P p) Visits a ClassTree node. This implementation scans the children in left to right order.- Specified by:
- visitClassin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitMethodpublic R visitMethod(MethodTree node, P p) Visits a MethodTree node. This implementation scans the children in left to right order.- Specified by:
- visitMethodin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitVariablepublic R visitVariable(VariableTree node, P p) Visits a VariableTree node. This implementation scans the children in left to right order.- Specified by:
- visitVariablein interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitEmptyStatementpublic R visitEmptyStatement(EmptyStatementTree node, P p) Visits an EmptyStatementTree node. This implementation returnsnull.- Specified by:
- visitEmptyStatementin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitBlockpublic R visitBlock(BlockTree node, P p) Visits a BlockTree node. This implementation scans the children in left to right order.- Specified by:
- visitBlockin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitDoWhileLooppublic R visitDoWhileLoop(DoWhileLoopTree node, P p) Visits a DoWhileTree node. This implementation scans the children in left to right order.- Specified by:
- visitDoWhileLoopin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitWhileLooppublic R visitWhileLoop(WhileLoopTree node, P p) Visits a WhileLoopTree node. This implementation scans the children in left to right order.- Specified by:
- visitWhileLoopin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitForLooppublic R visitForLoop(ForLoopTree node, P p) Visits a ForLoopTree node. This implementation scans the children in left to right order.- Specified by:
- visitForLoopin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitEnhancedForLooppublic R visitEnhancedForLoop(EnhancedForLoopTree node, P p) Visits an EnhancedForLoopTree node. This implementation scans the children in left to right order.- Specified by:
- visitEnhancedForLoopin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitLabeledStatementpublic R visitLabeledStatement(LabeledStatementTree node, P p) Visits a LabeledStatementTree node. This implementation scans the children in left to right order.- Specified by:
- visitLabeledStatementin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitSwitchpublic R visitSwitch(SwitchTree node, P p) Visits a SwitchTree node. This implementation scans the children in left to right order.- Specified by:
- visitSwitchin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitCasepublic R visitCase(CaseTree node, P p) Visits a CaseTree node. This implementation scans the children in left to right order.- Specified by:
- visitCasein interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitSynchronizedpublic R visitSynchronized(SynchronizedTree node, P p) Visits a SynchronizedTree node. This implementation scans the children in left to right order.- Specified by:
- visitSynchronizedin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitTrypublic R visitTry(TryTree node, P p) Visits a TryTree node. This implementation scans the children in left to right order.- Specified by:
- visitTryin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitCatchpublic R visitCatch(CatchTree node, P p) Visits a CatchTree node. This implementation scans the children in left to right order.- Specified by:
- visitCatchin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitConditionalExpressionpublic R visitConditionalExpression(ConditionalExpressionTree node, P p) Visits a ConditionalExpressionTree node. This implementation scans the children in left to right order.- Specified by:
- visitConditionalExpressionin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitIfpublic R visitIf(IfTree node, P p) Visits an IfTree node. This implementation scans the children in left to right order.- Specified by:
- visitIfin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitExpressionStatementpublic R visitExpressionStatement(ExpressionStatementTree node, P p) Visits an ExpressionStatementTree node. This implementation scans the children in left to right order.- Specified by:
- visitExpressionStatementin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitBreakpublic R visitBreak(BreakTree node, P p) Visits a BreakTree node. This implementation returnsnull.- Specified by:
- visitBreakin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitContinuepublic R visitContinue(ContinueTree node, P p) Visits a ContinueTree node. This implementation returnsnull.- Specified by:
- visitContinuein interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitReturnpublic R visitReturn(ReturnTree node, P p) Visits a ReturnTree node. This implementation scans the children in left to right order.- Specified by:
- visitReturnin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitThrowpublic R visitThrow(ThrowTree node, P p) Visits a ThrowTree node. This implementation scans the children in left to right order.- Specified by:
- visitThrowin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitAssertpublic R visitAssert(AssertTree node, P p) Visits an AssertTree node. This implementation scans the children in left to right order.- Specified by:
- visitAssertin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitMethodInvocationpublic R visitMethodInvocation(MethodInvocationTree node, P p) Visits a MethodInvocationTree node. This implementation scans the children in left to right order.- Specified by:
- visitMethodInvocationin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitNewClasspublic R visitNewClass(NewClassTree node, P p) Visits a NewClassTree node. This implementation scans the children in left to right order.- Specified by:
- visitNewClassin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitNewArraypublic R visitNewArray(NewArrayTree node, P p) Visits a NewArrayTree node. This implementation scans the children in left to right order.- Specified by:
- visitNewArrayin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitLambdaExpressionpublic R visitLambdaExpression(LambdaExpressionTree node, P p) Visits a LambdaExpressionTree node. This implementation scans the children in left to right order.- Specified by:
- visitLambdaExpressionin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitParenthesizedpublic R visitParenthesized(ParenthesizedTree node, P p) Visits a ParenthesizedTree node. This implementation scans the children in left to right order.- Specified by:
- visitParenthesizedin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitAssignmentpublic R visitAssignment(AssignmentTree node, P p) Visits an AssignmentTree node. This implementation scans the children in left to right order.- Specified by:
- visitAssignmentin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitCompoundAssignmentpublic R visitCompoundAssignment(CompoundAssignmentTree node, P p) Visits a CompoundAssignmentTree node. This implementation scans the children in left to right order.- Specified by:
- visitCompoundAssignmentin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitUnarypublic R visitUnary(UnaryTree node, P p) Visits a UnaryTree node. This implementation scans the children in left to right order.- Specified by:
- visitUnaryin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitBinarypublic R visitBinary(BinaryTree node, P p) Visits a BinaryTree node. This implementation scans the children in left to right order.- Specified by:
- visitBinaryin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitTypeCastpublic R visitTypeCast(TypeCastTree node, P p) Visits a TypeCastTree node. This implementation scans the children in left to right order.- Specified by:
- visitTypeCastin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitInstanceOfpublic R visitInstanceOf(InstanceOfTree node, P p) Visits an InstanceOfTree node. This implementation scans the children in left to right order.- Specified by:
- visitInstanceOfin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitArrayAccesspublic R visitArrayAccess(ArrayAccessTree node, P p) Visits an ArrayAccessTree node. This implementation scans the children in left to right order.- Specified by:
- visitArrayAccessin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitMemberSelectpublic R visitMemberSelect(MemberSelectTree node, P p) Visits a MemberSelectTree node. This implementation scans the children in left to right order.- Specified by:
- visitMemberSelectin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitMemberReferencepublic R visitMemberReference(MemberReferenceTree node, P p) Visits a MemberReferenceTree node. This implementation scans the children in left to right order.- Specified by:
- visitMemberReferencein interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitIdentifierpublic R visitIdentifier(IdentifierTree node, P p) Visits an IdentifierTree node. This implementation returnsnull.- Specified by:
- visitIdentifierin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitLiteralpublic R visitLiteral(LiteralTree node, P p) Visits a LiteralTree node. This implementation returnsnull.- Specified by:
- visitLiteralin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitPrimitiveTypepublic R visitPrimitiveType(PrimitiveTypeTree node, P p) Visits a PrimitiveTypeTree node. This implementation returnsnull.- Specified by:
- visitPrimitiveTypein interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitArrayTypepublic R visitArrayType(ArrayTypeTree node, P p) Visits an ArrayTypeTree node. This implementation scans the children in left to right order.- Specified by:
- visitArrayTypein interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitParameterizedTypepublic R visitParameterizedType(ParameterizedTypeTree node, P p) Visits a ParameterizedTypeTree node. This implementation scans the children in left to right order.- Specified by:
- visitParameterizedTypein interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitUnionTypepublic R visitUnionType(UnionTypeTree node, P p) Visits a UnionTypeTree node. This implementation scans the children in left to right order.- Specified by:
- visitUnionTypein interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitIntersectionTypepublic R visitIntersectionType(IntersectionTypeTree node, P p) Visits an IntersectionTypeTree node. This implementation scans the children in left to right order.- Specified by:
- visitIntersectionTypein interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitTypeParameterpublic R visitTypeParameter(TypeParameterTree node, P p) Visits a TypeParameterTree node. This implementation scans the children in left to right order.- Specified by:
- visitTypeParameterin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitWildcardpublic R visitWildcard(WildcardTree node, P p) Visits a WildcardTypeTree node. This implementation scans the children in left to right order.- Specified by:
- visitWildcardin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitModifierspublic R visitModifiers(ModifiersTree node, P p) Visits a ModifiersTree node. This implementation scans the children in left to right order.- Specified by:
- visitModifiersin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitAnnotationpublic R visitAnnotation(AnnotationTree node, P p) Visits an AnnotatedTree node. This implementation scans the children in left to right order.- Specified by:
- visitAnnotationin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitAnnotatedTypepublic R visitAnnotatedType(AnnotatedTypeTree node, P p) Visits an AnnotatedTypeTree node. This implementation scans the children in left to right order.- Specified by:
- visitAnnotatedTypein interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitOtherpublic R visitOther(Tree node, P p) Visits an unknown type of Tree node. This can occur if the language evolves and new kinds of nodes are added to theTreehierarchy. This implementation returnsnull.- Specified by:
- visitOtherin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 - 
visitErroneouspublic R visitErroneous(ErroneousTree node, P p) Visits an ErroneousTree node. This implementation returnsnull.- Specified by:
- visitErroneousin interface- TreeVisitor<R,P>
- Parameters:
- node- the node being visited
- p- a parameter value
- Returns:
- the result of scanning
 
 
- 
 
-