- java.lang.Object
-
- jdk.nashorn.api.tree.SimpleTreeVisitorES5_1<R,P>
-
- jdk.nashorn.api.tree.SimpleTreeVisitorES6<R,P>
-
- Type Parameters:
R- the return type of this visitor's methods. UseVoidfor visitors that do not need to return results.P- the type of the additional parameter to this visitor's methods. UseVoidfor visitors that do not need an additional parameter.
- All Implemented Interfaces:
TreeVisitor<R,P>
public class SimpleTreeVisitorES6<R,P> extends SimpleTreeVisitorES5_1<R,P>
A simple implementation of the TreeVisitor for ECMAScript edition 6.The visit methods corresponding to ES 6 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,
visitUnknownis called instead which throwsUnknownTreeException.Methods in this class may be overridden subject to their general contract. Note that annotating methods in concrete subclasses with
@Overridewill help ensure that methods are overridden as intended.
-
-
Constructor Summary
Constructors Constructor Description SimpleTreeVisitorES6()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RvisitClassDeclaration(ClassDeclarationTree node, P p)Visit class statement tree.RvisitClassExpression(ClassExpressionTree node, P p)Visit class expression tree.RvisitCompilationUnit(CompilationUnitTree node, P r)Visit compilation unit tree.RvisitExportEntry(ExportEntryTree node, P p)Visit Module ExportEntry tree.RvisitForOfLoop(ForOfLoopTree node, P p)Visit for..of statement tree.RvisitImportEntry(ImportEntryTree node, P p)Visit Module ImportEntry tree.RvisitModule(ModuleTree node, P p)Visit Module tree.RvisitSpread(SpreadTree node, P p)Visit 'spread' expression tree.RvisitTemplateLiteral(TemplateLiteralTree node, P p)Visit template literal tree.RvisitVariable(VariableTree node, P r)Visit variable declaration tree.RvisitYield(YieldTree node, P p)Visit 'yield' expression tree.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class jdk.nashorn.api.tree.SimpleTreeVisitorES5_1
visitArrayAccess, visitArrayLiteral, visitAssignment, visitBinary, visitBlock, visitBreak, visitCase, visitCatch, visitCompoundAssignment, visitConditionalExpression, visitContinue, visitDebugger, visitDoWhileLoop, visitEmptyStatement, visitErroneous, visitExpressionStatement, visitForInLoop, visitForLoop, visitFunctionCall, visitFunctionDeclaration, visitFunctionExpression, visitIdentifier, visitIf, visitInstanceOf, visitLabeledStatement, visitLiteral, visitMemberSelect, visitNew, visitObjectLiteral, visitParenthesized, visitProperty, visitRegExpLiteral, visitReturn, visitSwitch, visitThrow, visitTry, visitUnary, visitUnknown, visitWhileLoop, visitWith
-
-
-
-
Method Detail
-
visitCompilationUnit
public R visitCompilationUnit(CompilationUnitTree node, P r)
Description copied from interface:TreeVisitorVisit compilation unit tree.- Specified by:
visitCompilationUnitin interfaceTreeVisitor<R,P>- Overrides:
visitCompilationUnitin classSimpleTreeVisitorES5_1<R,P>- Parameters:
node- node being visitedr- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitModule
public R visitModule(ModuleTree node, P p)
Visit Module tree.- Specified by:
visitModulein interfaceTreeVisitor<R,P>- Overrides:
visitModulein classSimpleTreeVisitorES5_1<R,P>- Parameters:
node- node being visitedp- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitExportEntry
public R visitExportEntry(ExportEntryTree node, P p)
Visit Module ExportEntry tree.- Specified by:
visitExportEntryin interfaceTreeVisitor<R,P>- Overrides:
visitExportEntryin classSimpleTreeVisitorES5_1<R,P>- Parameters:
node- node being visitedp- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitImportEntry
public R visitImportEntry(ImportEntryTree node, P p)
Visit Module ImportEntry tree.- Specified by:
visitImportEntryin interfaceTreeVisitor<R,P>- Overrides:
visitImportEntryin classSimpleTreeVisitorES5_1<R,P>- Parameters:
node- node being visitedp- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitClassDeclaration
public R visitClassDeclaration(ClassDeclarationTree node, P p)
Visit class statement tree.- Specified by:
visitClassDeclarationin interfaceTreeVisitor<R,P>- Overrides:
visitClassDeclarationin classSimpleTreeVisitorES5_1<R,P>- Parameters:
node- node being visitedp- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitClassExpression
public R visitClassExpression(ClassExpressionTree node, P p)
Visit class expression tree.- Specified by:
visitClassExpressionin interfaceTreeVisitor<R,P>- Overrides:
visitClassExpressionin classSimpleTreeVisitorES5_1<R,P>- Parameters:
node- node being visitedp- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitForOfLoop
public R visitForOfLoop(ForOfLoopTree node, P p)
Visit for..of statement tree.- Specified by:
visitForOfLoopin interfaceTreeVisitor<R,P>- Overrides:
visitForOfLoopin classSimpleTreeVisitorES5_1<R,P>- Parameters:
node- node being visitedp- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitYield
public R visitYield(YieldTree node, P p)
Visit 'yield' expression tree.- Specified by:
visitYieldin interfaceTreeVisitor<R,P>- Overrides:
visitYieldin classSimpleTreeVisitorES5_1<R,P>- Parameters:
node- node being visitedp- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitSpread
public R visitSpread(SpreadTree node, P p)
Visit 'spread' expression tree.- Specified by:
visitSpreadin interfaceTreeVisitor<R,P>- Overrides:
visitSpreadin classSimpleTreeVisitorES5_1<R,P>- Parameters:
node- node being visitedp- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitTemplateLiteral
public R visitTemplateLiteral(TemplateLiteralTree node, P p)
Visit template literal tree.- Specified by:
visitTemplateLiteralin interfaceTreeVisitor<R,P>- Overrides:
visitTemplateLiteralin classSimpleTreeVisitorES5_1<R,P>- Parameters:
node- node being visitedp- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitVariable
public R visitVariable(VariableTree node, P r)
Description copied from interface:TreeVisitorVisit variable declaration tree.- Specified by:
visitVariablein interfaceTreeVisitor<R,P>- Overrides:
visitVariablein classSimpleTreeVisitorES5_1<R,P>- Parameters:
node- node being visitedr- extra parameter passed to the visitor- Returns:
- value from the visitor
-
-