- 
- 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 Known Implementing Classes:
- SimpleTreeVisitorES5_1,- SimpleTreeVisitorES6
 
 
 public interface TreeVisitor<R,P>A visitor of trees, in the style of the visitor design pattern. Classes implementing this interface are used to operate on a tree when the kind of tree is unknown at compile time. When a visitor is passed to an tree'sacceptmethod, thevisitXyzmethod most applicable to that tree is invoked.Classes implementing this interface may or may not throw a NullPointerExceptionif the additional parameterpisnull; see documentation of the implementing class for details.WARNING: It is possible that methods will be added to this interface to accommodate new, currently unknown, language structures added to future versions of the ECMAScript programming language. When new visit methods are added for new Tree subtypes, default method bodies will be introduced which will call visitUnknown method as a fallback. - Since:
- 9
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description RvisitArrayAccess(ArrayAccessTree node, P p)Visit array access expression tree.RvisitArrayLiteral(ArrayLiteralTree node, P p)Visit array literal expression tree.RvisitAssignment(AssignmentTree node, P p)Visit assignment tree.RvisitBinary(BinaryTree node, P p)Visit binary expression tree.RvisitBlock(BlockTree node, P p)Visit block statement tree.RvisitBreak(BreakTree node, P p)Visit break statement tree.RvisitCase(CaseTree node, P p)Visit case statement tree.RvisitCatch(CatchTree node, P p)Visit catch block statement tree.RvisitClassDeclaration(ClassDeclarationTree node, P p)Visit class statement tree.RvisitClassExpression(ClassExpressionTree node, P p)Visit class expression tree.RvisitCompilationUnit(CompilationUnitTree node, P p)Visit compilation unit tree.RvisitCompoundAssignment(CompoundAssignmentTree node, P p)Visit compound assignment tree.RvisitConditionalExpression(ConditionalExpressionTree node, P p)Visit conditional expression tree.RvisitContinue(ContinueTree node, P p)Visit continue statement tree.RvisitDebugger(DebuggerTree node, P p)Visit debugger statement tree.RvisitDoWhileLoop(DoWhileLoopTree node, P p)Visit do-while statement tree.RvisitEmptyStatement(EmptyStatementTree node, P p)Visit an empty statement tree.RvisitErroneous(ErroneousTree node, P p)Visit error expression tree.RvisitExportEntry(ExportEntryTree node, P p)Visit Module ExportEntry tree.RvisitExpressionStatement(ExpressionStatementTree node, P p)Visit expression statement tree.RvisitForInLoop(ForInLoopTree node, P p)Visit for..in statement tree.RvisitForLoop(ForLoopTree node, P p)Visit 'for' statement tree.RvisitForOfLoop(ForOfLoopTree node, P p)Visit for..of statement tree.RvisitFunctionCall(FunctionCallTree node, P p)Visit function call expression tree.RvisitFunctionDeclaration(FunctionDeclarationTree node, P p)Visit function declaration tree.RvisitFunctionExpression(FunctionExpressionTree node, P p)Visit function expression tree.RvisitIdentifier(IdentifierTree node, P p)Visit identifier tree.RvisitIf(IfTree node, P p)Visit 'if' statement tree.RvisitImportEntry(ImportEntryTree node, P p)Visit Module ImportEntry tree.RvisitInstanceOf(InstanceOfTree node, P p)Visit 'instanceof' expression tree.RvisitLabeledStatement(LabeledStatementTree node, P p)Visit labeled statement tree.RvisitLiteral(LiteralTree node, P p)Visit literal expression tree.RvisitMemberSelect(MemberSelectTree node, P p)Visit member select expression tree.RvisitModule(ModuleTree node, P p)Visit Module tree.RvisitNew(NewTree node, P p)Visit 'new' expression tree.RvisitObjectLiteral(ObjectLiteralTree node, P p)Visit object literal tree.RvisitParenthesized(ParenthesizedTree node, P p)Visit parenthesized expression tree.RvisitProperty(PropertyTree node, P p)Visit a property of an object literal expression tree.RvisitRegExpLiteral(RegExpLiteralTree node, P p)Visit regular expression literal tree.RvisitReturn(ReturnTree node, P p)Visit return statement tree.RvisitSpread(SpreadTree node, P p)Visit 'spread' expression tree.RvisitSwitch(SwitchTree node, P p)Visit 'switch' statement tree.RvisitTemplateLiteral(TemplateLiteralTree node, P p)Visit template literal tree.RvisitThrow(ThrowTree node, P p)Visit 'throw' expression tree.RvisitTry(TryTree node, P p)Visit 'try' statement tree.RvisitUnary(UnaryTree node, P p)Visit unary expression tree.RvisitUnknown(Tree node, P p)Visit unknown expression/statement tree.RvisitVariable(VariableTree node, P p)Visit variable declaration tree.RvisitWhileLoop(WhileLoopTree node, P p)Visit 'while' statement tree.RvisitWith(WithTree node, P p)Visit 'with' statement tree.RvisitYield(YieldTree node, P p)Visit 'yield' expression tree.
 
- 
- 
- 
Method Detail- 
visitAssignmentR visitAssignment(AssignmentTree node, P p) Visit assignment tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitCompoundAssignmentR visitCompoundAssignment(CompoundAssignmentTree node, P p) Visit compound assignment tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitBinaryR visitBinary(BinaryTree node, P p) Visit binary expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitBlockR visitBlock(BlockTree node, P p) Visit block statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitBreakR visitBreak(BreakTree node, P p) Visit break statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitCaseR visitCase(CaseTree node, P p) Visit case statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitCatchR visitCatch(CatchTree node, P p) Visit catch block statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitClassDeclarationR visitClassDeclaration(ClassDeclarationTree node, P p) Visit class statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitClassExpressionR visitClassExpression(ClassExpressionTree node, P p) Visit class expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitConditionalExpressionR visitConditionalExpression(ConditionalExpressionTree node, P p) Visit conditional expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitContinueR visitContinue(ContinueTree node, P p) Visit continue statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitDebuggerR visitDebugger(DebuggerTree node, P p) Visit debugger statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitDoWhileLoopR visitDoWhileLoop(DoWhileLoopTree node, P p) Visit do-while statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitErroneousR visitErroneous(ErroneousTree node, P p) Visit error expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitExpressionStatementR visitExpressionStatement(ExpressionStatementTree node, P p) Visit expression statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitForLoopR visitForLoop(ForLoopTree node, P p) Visit 'for' statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitForInLoopR visitForInLoop(ForInLoopTree node, P p) Visit for..in statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitForOfLoopR visitForOfLoop(ForOfLoopTree node, P p) Visit for..of statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitFunctionCallR visitFunctionCall(FunctionCallTree node, P p) Visit function call expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitFunctionDeclarationR visitFunctionDeclaration(FunctionDeclarationTree node, P p) Visit function declaration tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitFunctionExpressionR visitFunctionExpression(FunctionExpressionTree node, P p) Visit function expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitIdentifierR visitIdentifier(IdentifierTree node, P p) Visit identifier tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitIfR visitIf(IfTree node, P p) Visit 'if' statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitArrayAccessR visitArrayAccess(ArrayAccessTree node, P p) Visit array access expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitArrayLiteralR visitArrayLiteral(ArrayLiteralTree node, P p) Visit array literal expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitLabeledStatementR visitLabeledStatement(LabeledStatementTree node, P p) Visit labeled statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitLiteralR visitLiteral(LiteralTree node, P p) Visit literal expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitParenthesizedR visitParenthesized(ParenthesizedTree node, P p) Visit parenthesized expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitReturnR visitReturn(ReturnTree node, P p) Visit return statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitMemberSelectR visitMemberSelect(MemberSelectTree node, P p) Visit member select expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitNewR visitNew(NewTree node, P p) Visit 'new' expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitObjectLiteralR visitObjectLiteral(ObjectLiteralTree node, P p) Visit object literal tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitPropertyR visitProperty(PropertyTree node, P p) Visit a property of an object literal expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitRegExpLiteralR visitRegExpLiteral(RegExpLiteralTree node, P p) Visit regular expression literal tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitTemplateLiteralR visitTemplateLiteral(TemplateLiteralTree node, P p) Visit template literal tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitEmptyStatementR visitEmptyStatement(EmptyStatementTree node, P p) Visit an empty statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitSpreadR visitSpread(SpreadTree node, P p) Visit 'spread' expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitSwitchR visitSwitch(SwitchTree node, P p) Visit 'switch' statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitThrowR visitThrow(ThrowTree node, P p) Visit 'throw' expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitCompilationUnitR visitCompilationUnit(CompilationUnitTree node, P p) Visit compilation unit tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitModuleR visitModule(ModuleTree node, P p) Visit Module tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitExportEntryR visitExportEntry(ExportEntryTree node, P p) Visit Module ExportEntry tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitImportEntryR visitImportEntry(ImportEntryTree node, P p) Visit Module ImportEntry tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitTryR visitTry(TryTree node, P p) Visit 'try' statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitInstanceOfR visitInstanceOf(InstanceOfTree node, P p) Visit 'instanceof' expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitUnaryR visitUnary(UnaryTree node, P p) Visit unary expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitVariableR visitVariable(VariableTree node, P p) Visit variable declaration tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitWhileLoopR visitWhileLoop(WhileLoopTree node, P p) Visit 'while' statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitWithR visitWith(WithTree node, P p) Visit 'with' statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitYieldR visitYield(YieldTree node, P p) Visit 'yield' expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitUnknownR visitUnknown(Tree node, P p) Visit unknown expression/statement tree. This fallback will be called if new Tree subtypes are introduced in future. A specific implementation may throw {unknown tree exception if the visitor implementation was for an older language version.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 
- 
 
-