R
- the return type of this visitor's methods. Use Void
for visitors that do not need to return results.P
- the type of the additional parameter to this visitor's
methods. Use Void
for visitors that do not need an
additional parameter.TreeVisitor<R,P>
SimpleTreeVisitorES6
public class SimpleTreeVisitorES5_1<R,P> extends Object implements TreeVisitor<R,P>
The visit methods corresponding to ES 5.1 language constructs walk the "components" of the given tree by calling accept method passing the current visitor and the additional parameter.
For constructs introduced in later versions, visitUnknown
is called instead which throws UnknownTreeException
.
Methods in this class may be overridden subject to their
general contract. Note that annotating methods in concrete
subclasses with @Override
will help
ensure that methods are overridden as intended.
Constructor | Description |
---|---|
SimpleTreeVisitorES5_1() |
Modifier and Type | Method | Description |
---|---|---|
R |
visitArrayAccess(ArrayAccessTree node,
P r) |
Visit array access expression tree.
|
R |
visitArrayLiteral(ArrayLiteralTree node,
P r) |
Visit array literal expression tree.
|
R |
visitAssignment(AssignmentTree node,
P r) |
Visit assignment tree.
|
R |
visitBinary(BinaryTree node,
P r) |
Visit binary expression tree.
|
R |
visitBlock(BlockTree node,
P r) |
Visit block statement tree.
|
R |
visitBreak(BreakTree node,
P r) |
Visit break statement tree.
|
R |
visitCase(CaseTree node,
P r) |
Visit case statement tree.
|
R |
visitCatch(CatchTree node,
P r) |
Visit catch block statement tree.
|
R |
visitClassDeclaration(ClassDeclarationTree node,
P p) |
Visits a
ClassDeclarationTree tree by calling
visitUnknown . |
R |
visitClassExpression(ClassExpressionTree node,
P p) |
Visits a
ClassExpressionTree tree by calling
visitUnknown . |
R |
visitCompilationUnit(CompilationUnitTree node,
P r) |
Visit compilation unit tree.
|
R |
visitCompoundAssignment(CompoundAssignmentTree node,
P r) |
Visit compound assignment tree.
|
R |
visitConditionalExpression(ConditionalExpressionTree node,
P r) |
Visit conditional expression tree.
|
R |
visitContinue(ContinueTree node,
P r) |
Visit continue statement tree.
|
R |
visitDebugger(DebuggerTree node,
P r) |
Visit debugger statement tree.
|
R |
visitDoWhileLoop(DoWhileLoopTree node,
P r) |
Visit do-while statement tree.
|
R |
visitEmptyStatement(EmptyStatementTree node,
P r) |
Visit an empty statement tree.
|
R |
visitErroneous(ErroneousTree node,
P r) |
Visit error expression tree.
|
R |
visitExportEntry(ExportEntryTree node,
P p) |
Visits an
ExportEntryTree tree by calling
visitUnknown . |
R |
visitExpressionStatement(ExpressionStatementTree node,
P r) |
Visit expression statement tree.
|
R |
visitForInLoop(ForInLoopTree node,
P r) |
Visit for..in statement tree.
|
R |
visitForLoop(ForLoopTree node,
P r) |
Visit 'for' statement tree.
|
R |
visitForOfLoop(ForOfLoopTree node,
P p) |
Visits a
ForOfLoopTree tree by calling
visitUnknown . |
R |
visitFunctionCall(FunctionCallTree node,
P r) |
Visit function call expression tree.
|
R |
visitFunctionDeclaration(FunctionDeclarationTree node,
P r) |
Visit function declaration tree.
|
R |
visitFunctionExpression(FunctionExpressionTree node,
P r) |
Visit function expression tree.
|
R |
visitIdentifier(IdentifierTree node,
P r) |
Visit identifier tree.
|
R |
visitIf(IfTree node,
P r) |
Visit 'if' statement tree.
|
R |
visitImportEntry(ImportEntryTree node,
P p) |
Visits an
ImportEntryTree tree by calling
visitUnknown . |
R |
visitInstanceOf(InstanceOfTree node,
P r) |
Visit 'instanceof' expression tree.
|
R |
visitLabeledStatement(LabeledStatementTree node,
P r) |
Visit labeled statement tree.
|
R |
visitLiteral(LiteralTree node,
P r) |
Visit literal expression tree.
|
R |
visitMemberSelect(MemberSelectTree node,
P r) |
Visit member select expression tree.
|
R |
visitModule(ModuleTree node,
P p) |
Visits a
ModuleTree tree by calling
visitUnknown . |
R |
visitNew(NewTree node,
P r) |
Visit 'new' expression tree.
|
R |
visitObjectLiteral(ObjectLiteralTree node,
P r) |
Visit object literal tree.
|
R |
visitParenthesized(ParenthesizedTree node,
P r) |
Visit parenthesized expression tree.
|
R |
visitProperty(PropertyTree node,
P r) |
Visit a property of an object literal expression tree.
|
R |
visitRegExpLiteral(RegExpLiteralTree node,
P r) |
Visit regular expression literal tree.
|
R |
visitReturn(ReturnTree node,
P r) |
Visit return statement tree.
|
R |
visitSpread(SpreadTree node,
P p) |
Visits a
SpreadTree tree by calling
visitUnknown . |
R |
visitSwitch(SwitchTree node,
P r) |
Visit 'switch' statement tree.
|
R |
visitTemplateLiteral(TemplateLiteralTree node,
P p) |
Visits a
TemplateLiteralTree tree by calling
visitUnknown . |
R |
visitThrow(ThrowTree node,
P r) |
Visit 'throw' expression tree.
|
R |
visitTry(TryTree node,
P r) |
Visit 'try' statement tree.
|
R |
visitUnary(UnaryTree node,
P r) |
Visit unary expression tree.
|
R |
visitUnknown(Tree node,
P p) |
Visit unknown expression/statement tree.
|
R |
visitVariable(VariableTree node,
P r) |
Visit variable declaration tree.
|
R |
visitWhileLoop(WhileLoopTree node,
P r) |
Visit 'while' statement tree.
|
R |
visitWith(WithTree node,
P r) |
Visit 'with' statement tree.
|
R |
visitYield(YieldTree node,
P p) |
Visits a
YieldTree tree by calling
visitUnknown . |
public R visitAssignment(AssignmentTree node, P r)
TreeVisitor
visitAssignment
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitCompoundAssignment(CompoundAssignmentTree node, P r)
TreeVisitor
visitCompoundAssignment
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitModule(ModuleTree node, P p)
ModuleTree
tree by calling
visitUnknown
.visitModule
in interface TreeVisitor<R,P>
node
- node being visitedp
- extra parameter passed to the visitorvisitUnknown
public R visitExportEntry(ExportEntryTree node, P p)
ExportEntryTree
tree by calling
visitUnknown
.visitExportEntry
in interface TreeVisitor<R,P>
node
- node being visitedp
- extra parameter passed to the visitorvisitUnknown
public R visitImportEntry(ImportEntryTree node, P p)
ImportEntryTree
tree by calling
visitUnknown
.visitImportEntry
in interface TreeVisitor<R,P>
node
- node being visitedp
- extra parameter passed to the visitorvisitUnknown
public R visitBinary(BinaryTree node, P r)
TreeVisitor
visitBinary
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitBlock(BlockTree node, P r)
TreeVisitor
visitBlock
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitBreak(BreakTree node, P r)
TreeVisitor
visitBreak
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitCase(CaseTree node, P r)
TreeVisitor
visitCase
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitCatch(CatchTree node, P r)
TreeVisitor
visitCatch
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitClassDeclaration(ClassDeclarationTree node, P p)
ClassDeclarationTree
tree by calling
visitUnknown
.visitClassDeclaration
in interface TreeVisitor<R,P>
node
- node being visitedp
- extra parameter passed to the visitorvisitUnknown
public R visitClassExpression(ClassExpressionTree node, P p)
ClassExpressionTree
tree by calling
visitUnknown
.visitClassExpression
in interface TreeVisitor<R,P>
node
- node being visitedp
- extra parameter passed to the visitorvisitUnknown
public R visitConditionalExpression(ConditionalExpressionTree node, P r)
TreeVisitor
visitConditionalExpression
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitContinue(ContinueTree node, P r)
TreeVisitor
visitContinue
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitDebugger(DebuggerTree node, P r)
TreeVisitor
visitDebugger
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitDoWhileLoop(DoWhileLoopTree node, P r)
TreeVisitor
visitDoWhileLoop
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitErroneous(ErroneousTree node, P r)
TreeVisitor
visitErroneous
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitExpressionStatement(ExpressionStatementTree node, P r)
TreeVisitor
visitExpressionStatement
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitForLoop(ForLoopTree node, P r)
TreeVisitor
visitForLoop
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitForInLoop(ForInLoopTree node, P r)
TreeVisitor
visitForInLoop
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitForOfLoop(ForOfLoopTree node, P p)
ForOfLoopTree
tree by calling
visitUnknown
.visitForOfLoop
in interface TreeVisitor<R,P>
node
- node being visitedp
- extra parameter passed to the visitorvisitUnknown
public R visitFunctionCall(FunctionCallTree node, P r)
TreeVisitor
visitFunctionCall
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitFunctionDeclaration(FunctionDeclarationTree node, P r)
TreeVisitor
visitFunctionDeclaration
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitFunctionExpression(FunctionExpressionTree node, P r)
TreeVisitor
visitFunctionExpression
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitIdentifier(IdentifierTree node, P r)
TreeVisitor
visitIdentifier
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitIf(IfTree node, P r)
TreeVisitor
visitIf
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitArrayAccess(ArrayAccessTree node, P r)
TreeVisitor
visitArrayAccess
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitArrayLiteral(ArrayLiteralTree node, P r)
TreeVisitor
visitArrayLiteral
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitLabeledStatement(LabeledStatementTree node, P r)
TreeVisitor
visitLabeledStatement
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitLiteral(LiteralTree node, P r)
TreeVisitor
visitLiteral
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitParenthesized(ParenthesizedTree node, P r)
TreeVisitor
visitParenthesized
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitReturn(ReturnTree node, P r)
TreeVisitor
visitReturn
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitMemberSelect(MemberSelectTree node, P r)
TreeVisitor
visitMemberSelect
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitNew(NewTree node, P r)
TreeVisitor
visitNew
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitObjectLiteral(ObjectLiteralTree node, P r)
TreeVisitor
visitObjectLiteral
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitProperty(PropertyTree node, P r)
TreeVisitor
visitProperty
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitRegExpLiteral(RegExpLiteralTree node, P r)
TreeVisitor
visitRegExpLiteral
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitTemplateLiteral(TemplateLiteralTree node, P p)
TemplateLiteralTree
tree by calling
visitUnknown
.visitTemplateLiteral
in interface TreeVisitor<R,P>
node
- node being visitedp
- extra parameter passed to the visitorvisitUnknown
public R visitEmptyStatement(EmptyStatementTree node, P r)
TreeVisitor
visitEmptyStatement
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitSpread(SpreadTree node, P p)
SpreadTree
tree by calling
visitUnknown
.visitSpread
in interface TreeVisitor<R,P>
node
- node being visitedp
- extra parameter passed to the visitorvisitUnknown
public R visitSwitch(SwitchTree node, P r)
TreeVisitor
visitSwitch
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitThrow(ThrowTree node, P r)
TreeVisitor
visitThrow
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitCompilationUnit(CompilationUnitTree node, P r)
TreeVisitor
visitCompilationUnit
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitTry(TryTree node, P r)
TreeVisitor
visitTry
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitInstanceOf(InstanceOfTree node, P r)
TreeVisitor
visitInstanceOf
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitUnary(UnaryTree node, P r)
TreeVisitor
visitUnary
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitVariable(VariableTree node, P r)
TreeVisitor
visitVariable
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitWhileLoop(WhileLoopTree node, P r)
TreeVisitor
visitWhileLoop
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitWith(WithTree node, P r)
TreeVisitor
visitWith
in interface TreeVisitor<R,P>
node
- node being visitedr
- extra parameter passed to the visitorpublic R visitYield(YieldTree node, P p)
YieldTree
tree by calling
visitUnknown
.visitYield
in interface TreeVisitor<R,P>
node
- node being visitedp
- extra parameter passed to the visitorvisitUnknown
public R visitUnknown(Tree node, P p)
visitUnknown
in interface TreeVisitor<R,P>
SimpleTreeVisitorES5_1
will always throw
UnknownTypeException
. This behavior is not required of a
subclass.node
- node being visitedp
- extra parameter passed to the visitorUnknownTreeException
- a visitor implementation may optionally throw this exception
Copyright © 2014, 2016, Oracle and/or its affiliates. All rights reserved.
DRAFT 9-Ubuntu+0-9b139-1