Class ParseTree
java.lang.Object
com.google.javascript.jscomp.parsing.parser.trees.ParseTree
- Direct Known Subclasses:
ArgumentListTree,ArrayLiteralExpressionTree,ArrayPatternTree,AwaitExpressionTree,BinaryOperatorTree,BlockTree,BreakStatementTree,CallExpressionTree,CaseClauseTree,CatchTree,ClassDeclarationTree,CommaExpressionTree,ComprehensionForTree,ComprehensionIfTree,ComprehensionTree,ComputedPropertyDefinitionTree,ComputedPropertyFieldTree,ComputedPropertyGetterTree,ComputedPropertyMethodTree,ComputedPropertySetterTree,ConditionalExpressionTree,ContinueStatementTree,DebuggerStatementTree,DefaultClauseTree,DefaultParameterTree,DoWhileStatementTree,DynamicImportTree,EmptyStatementTree,ExportDeclarationTree,ExportSpecifierTree,ExpressionStatementTree,FieldDeclarationTree,FinallyTree,ForAwaitOfStatementTree,ForInStatementTree,FormalParameterListTree,ForOfStatementTree,ForStatementTree,FunctionDeclarationTree,GetAccessorTree,IdentifierExpressionTree,IfStatementTree,ImportDeclarationTree,ImportMetaExpressionTree,ImportSpecifierTree,IterRestTree,IterSpreadTree,LabelledStatementTree,LiteralExpressionTree,MemberExpressionTree,MemberLookupExpressionTree,MissingPrimaryExpressionTree,NewExpressionTree,NewTargetExpressionTree,NullTree,ObjectLiteralExpressionTree,ObjectPatternTree,ObjectRestTree,ObjectSpreadTree,OptChainCallExpressionTree,OptionalMemberExpressionTree,OptionalMemberLookupExpressionTree,ParenExpressionTree,ProgramTree,PropertyNameAssignmentTree,ReturnStatementTree,SetAccessorTree,SuperExpressionTree,SwitchStatementTree,TemplateLiteralExpressionTree,TemplateLiteralPortionTree,TemplateSubstitutionTree,ThisExpressionTree,ThrowStatementTree,TryStatementTree,UnaryExpressionTree,UpdateExpressionTree,VariableDeclarationListTree,VariableDeclarationTree,VariableStatementTree,WhileStatementTree,WithStatementTree,YieldExpressionTree
An abstract syntax tree for JavaScript parse trees.
Immutable.
A plain old data structure. Should include data members and simple accessors only.
Derived classes should have a 'Tree' suffix. Each concrete derived class should have a
ParseTreeType whose name matches the derived class name.
A parse tree derived from source should have a non-null location. A parse tree that is
synthesized by the compiler may have a null location.
When adding a new subclass of ParseTree you must also do the following:
- add a new entry to ParseTreeType
- add ParseTree.asXTree()
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasBlock()asCatch()asNull()getEnd()getStart()booleanbooleanbooleanIs valid assignment target for any assignment operator like `=`, `+=`, `-+`, `**=`, etcbooleanIs valid assignment target for non-vanilla assignment operators like `+=`, `-+`, `**=`, etctoString()
-
Field Details
-
type
-
location
-
-
Constructor Details
-
ParseTree
-
-
Method Details
-
getStart
-
getEnd
-
asArrayLiteralExpression
-
asArrayPattern
-
asBinaryOperator
-
asBlock
-
asBreakStatement
-
asCallExpression
-
asOptChainCallExpression
-
asCaseClause
-
asCatch
-
asClassDeclaration
-
asCommaExpression
-
asComprehensionIf
-
asComprehensionFor
-
asComprehension
-
asComputedPropertyDefinition
-
asComputedPropertyField
-
asComputedPropertyGetter
-
asComputedPropertyMethod
-
asComputedPropertySetter
-
asConditionalExpression
-
asContinueStatement
-
asDebuggerStatement
-
asDefaultClause
-
asDefaultParameter
-
asDoWhileStatement
-
asEmptyStatement
-
asExportDeclaration
-
asExportSpecifier
-
asExpressionStatement
-
asFinally
-
asForOfStatement
-
asForInStatement
-
asFormalParameterList
-
asForStatement
-
asFunctionDeclaration
-
asGetAccessor
-
asIdentifierExpression
-
asIfStatement
-
asImportDeclaration
-
asImportSpecifier
-
asDynamicImportExpression
-
asImportMetaExpression
-
asLabelledStatement
-
asLiteralExpression
-
asMemberExpression
-
asOptionalMemberExpression
-
asMemberLookupExpression
-
asOptionalMemberLookupExpression
-
asMissingPrimaryExpression
-
asNewExpression
-
asNull
-
asObjectLiteralExpression
-
asObjectPattern
-
asParenExpression
-
asProgram
-
asPropertyNameAssignment
-
asIterRest
-
asObjectRest
-
asReturnStatement
-
asSetAccessor
-
asIterSpread
-
asObjectSpread
-
asSuperExpression
-
asSwitchStatement
-
asTemplateLiteralExpression
-
asTemplateLiteralPortion
-
asTemplateSubstitution
-
asThisExpression
-
asThrowStatement
-
asTryStatement
-
asUnaryExpression
-
asVariableDeclarationList
-
asVariableDeclaration
-
asVariableStatement
-
asWhileStatement
-
asWithStatement
-
asYieldStatement
-
asAwaitExpression
-
asNewTargetExpression
-
asUpdateExpression
-
asForAwaitOfStatement
-
asFieldDeclaration
-
isPattern
public boolean isPattern() -
isValidNonVanillaAssignmentTarget
public boolean isValidNonVanillaAssignmentTarget()Is valid assignment target for non-vanilla assignment operators like `+=`, `-+`, `**=`, etc -
isValidAssignmentTarget
public boolean isValidAssignmentTarget()Is valid assignment target for any assignment operator like `=`, `+=`, `-+`, `**=`, etc -
isRestParameter
public boolean isRestParameter() -
toString
-