-
- All Known Subinterfaces:
-
ArrayAccessTree,ArrayLiteralTree,AssignmentTree,BinaryTree,BlockTree,BreakTree,CaseTree,CatchTree,ClassDeclarationTree,ClassExpressionTree,CompilationUnitTree,CompoundAssignmentTree,ConditionalExpressionTree,ConditionalLoopTree,ContinueTree,DebuggerTree,DoWhileLoopTree,EmptyStatementTree,ErroneousTree,ExportEntryTree,ExpressionStatementTree,ExpressionTree,ForInLoopTree,ForLoopTree,ForOfLoopTree,FunctionCallTree,FunctionDeclarationTree,FunctionExpressionTree,GotoTree,IdentifierTree,IfTree,ImportEntryTree,InstanceOfTree,LabeledStatementTree,LiteralTree,LoopTree,MemberSelectTree,ModuleTree,NewTree,ObjectLiteralTree,ParenthesizedTree,PropertyTree,RegExpLiteralTree,ReturnTree,SpreadTree,StatementTree,SwitchTree,TemplateLiteralTree,ThrowTree,TryTree,UnaryTree,VariableTree,WhileLoopTree,WithTree,YieldTree
public interface 树抽象语法树中所有节点的公共接口。警告:该接口及其子接口随着ECMAScript编程语言的发展而发生变化。
- 从以下版本开始:
- 9
-
-
Nested Class Summary
Nested Classes Modifier and Type 接口 描述 static classTree.Kind列举各种树木。
-
方法摘要
所有方法 接口方法 抽象方法 Modifier and Type 方法 描述 <R,D> Raccept(TreeVisitor<R,D> visitor, D data)用于实现访问者模式的接受方法。longgetEndPosition()来源中此树的结束字符偏移量。Tree.KindgetKind()获得这棵树的种类。longgetStartPosition()在源中开始此树的字符偏移量。
-
-
-
方法详细信息
-
getStartPosition
long getStartPosition()
在源中开始此树的字符偏移量。- 结果
- 的位置
-
getEndPosition
long getEndPosition()
来源中此树的结束字符偏移量。- 结果
- 的位置
-
getKind
Tree.Kind getKind()
获得这棵树的种类。- 结果
- 这种树的种类。
-
accept
<R,D> R accept(TreeVisitor<R,D> visitor, D data)
用于实现访问者模式的接受方法。 访问者模式用于对树进行操作。- 参数类型
-
R- 此操作的结果类型。 -
D- 附加数据类型。 - 参数
-
visitor- 树访客 -
data- 传递给访问者方法的附加数据 - 结果
- 访客访问价值
-
-