Class ParseTree
- java.lang.Object
-
- com.google.javascript.jscomp.parsing.parser.trees.ParseTree
-
- Direct Known Subclasses:
AmbientDeclarationTree,ArgumentListTree,ArrayLiteralExpressionTree,ArrayPatternTree,ArrayTypeTree,AwaitExpressionTree,BinaryOperatorTree,BlockTree,BreakStatementTree,CallExpressionTree,CallSignatureTree,CaseClauseTree,CatchTree,ClassDeclarationTree,CommaExpressionTree,ComprehensionForTree,ComprehensionIfTree,ComprehensionTree,ComputedPropertyDefinitionTree,ComputedPropertyGetterTree,ComputedPropertyMemberVariableTree,ComputedPropertyMethodTree,ComputedPropertySetterTree,ConditionalExpressionTree,ContinueStatementTree,DebuggerStatementTree,DefaultClauseTree,DefaultParameterTree,DoWhileStatementTree,DynamicImportTree,EmptyStatementTree,EnumDeclarationTree,ExportDeclarationTree,ExportSpecifierTree,ExpressionStatementTree,FinallyTree,ForAwaitOfStatementTree,ForInStatementTree,FormalParameterListTree,ForOfStatementTree,ForStatementTree,FunctionDeclarationTree,FunctionTypeTree,GenericTypeListTree,GetAccessorTree,IdentifierExpressionTree,IfStatementTree,ImportDeclarationTree,ImportMetaExpressionTree,ImportSpecifierTree,IndexSignatureTree,InterfaceDeclarationTree,IterRestTree,IterSpreadTree,LabelledStatementTree,LiteralExpressionTree,MemberExpressionTree,MemberLookupExpressionTree,MemberVariableTree,MissingPrimaryExpressionTree,NamespaceDeclarationTree,NamespaceNameTree,NewExpressionTree,NewTargetExpressionTree,NullTree,ObjectLiteralExpressionTree,ObjectPatternTree,ObjectRestTree,ObjectSpreadTree,OptionalCallExpressionTree,OptionalMemberExpressionTree,OptionalMemberLookupExpressionTree,OptionalParameterTree,ParameterizedTypeTree,ParenExpressionTree,ProgramTree,PropertyNameAssignmentTree,RecordTypeTree,ReturnStatementTree,SetAccessorTree,SuperExpressionTree,SwitchStatementTree,TemplateLiteralExpressionTree,TemplateLiteralPortionTree,TemplateSubstitutionTree,ThisExpressionTree,ThrowStatementTree,TryStatementTree,TypeAliasTree,TypedParameterTree,TypeNameTree,TypeQueryTree,UnaryExpressionTree,UnionTypeTree,UpdateExpressionTree,VariableDeclarationListTree,VariableDeclarationTree,VariableStatementTree,WhileStatementTree,WithStatementTree,YieldExpressionTree
public class ParseTree extends java.lang.ObjectAn 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 Modifier and Type Field Description SourceRangelocationParseTreeTypetype
-
Constructor Summary
Constructors Modifier Constructor Description protectedParseTree(ParseTreeType type, SourceRange location)
-
Method Summary
-
-
-
Field Detail
-
type
public final ParseTreeType type
-
location
public final SourceRange location
-
-
Constructor Detail
-
ParseTree
protected ParseTree(ParseTreeType type, SourceRange location)
-
-
Method Detail
-
getStart
public SourcePosition getStart()
-
getEnd
public SourcePosition getEnd()
-
asArrayLiteralExpression
public ArrayLiteralExpressionTree asArrayLiteralExpression()
-
asArrayPattern
public ArrayPatternTree asArrayPattern()
-
asBinaryOperator
public BinaryOperatorTree asBinaryOperator()
-
asBlock
public BlockTree asBlock()
-
asBreakStatement
public BreakStatementTree asBreakStatement()
-
asCallExpression
public CallExpressionTree asCallExpression()
-
asOptionalCallExpression
public OptionalCallExpressionTree asOptionalCallExpression()
-
asCaseClause
public CaseClauseTree asCaseClause()
-
asCatch
public CatchTree asCatch()
-
asClassDeclaration
public ClassDeclarationTree asClassDeclaration()
-
asCommaExpression
public CommaExpressionTree asCommaExpression()
-
asComprehensionIf
public ComprehensionIfTree asComprehensionIf()
-
asComprehensionFor
public ComprehensionForTree asComprehensionFor()
-
asComprehension
public ComprehensionTree asComprehension()
-
asComputedPropertyDefinition
public ComputedPropertyDefinitionTree asComputedPropertyDefinition()
-
asComputedPropertyGetter
public ComputedPropertyGetterTree asComputedPropertyGetter()
-
asComputedPropertyMethod
public ComputedPropertyMethodTree asComputedPropertyMethod()
-
asComputedPropertyMemberVariable
public ComputedPropertyMemberVariableTree asComputedPropertyMemberVariable()
-
asComputedPropertySetter
public ComputedPropertySetterTree asComputedPropertySetter()
-
asConditionalExpression
public ConditionalExpressionTree asConditionalExpression()
-
asContinueStatement
public ContinueStatementTree asContinueStatement()
-
asDebuggerStatement
public DebuggerStatementTree asDebuggerStatement()
-
asDefaultClause
public DefaultClauseTree asDefaultClause()
-
asDefaultParameter
public DefaultParameterTree asDefaultParameter()
-
asDoWhileStatement
public DoWhileStatementTree asDoWhileStatement()
-
asEmptyStatement
public EmptyStatementTree asEmptyStatement()
-
asExportDeclaration
public ExportDeclarationTree asExportDeclaration()
-
asExportSpecifier
public ExportSpecifierTree asExportSpecifier()
-
asExpressionStatement
public ExpressionStatementTree asExpressionStatement()
-
asFinally
public FinallyTree asFinally()
-
asForOfStatement
public ForOfStatementTree asForOfStatement()
-
asForInStatement
public ForInStatementTree asForInStatement()
-
asFormalParameterList
public FormalParameterListTree asFormalParameterList()
-
asForStatement
public ForStatementTree asForStatement()
-
asFunctionDeclaration
public FunctionDeclarationTree asFunctionDeclaration()
-
asGetAccessor
public GetAccessorTree asGetAccessor()
-
asIdentifierExpression
public IdentifierExpressionTree asIdentifierExpression()
-
asIfStatement
public IfStatementTree asIfStatement()
-
asImportDeclaration
public ImportDeclarationTree asImportDeclaration()
-
asImportSpecifier
public ImportSpecifierTree asImportSpecifier()
-
asDynamicImportExpression
public DynamicImportTree asDynamicImportExpression()
-
asImportMetaExpression
public ImportMetaExpressionTree asImportMetaExpression()
-
asLabelledStatement
public LabelledStatementTree asLabelledStatement()
-
asLiteralExpression
public LiteralExpressionTree asLiteralExpression()
-
asMemberExpression
public MemberExpressionTree asMemberExpression()
-
asOptionalMemberExpression
public OptionalMemberExpressionTree asOptionalMemberExpression()
-
asMemberLookupExpression
public MemberLookupExpressionTree asMemberLookupExpression()
-
asOptionalMemberLookupExpression
public OptionalMemberLookupExpressionTree asOptionalMemberLookupExpression()
-
asMemberVariable
public MemberVariableTree asMemberVariable()
-
asMissingPrimaryExpression
public MissingPrimaryExpressionTree asMissingPrimaryExpression()
-
asNewExpression
public NewExpressionTree asNewExpression()
-
asNull
public NullTree asNull()
-
asObjectLiteralExpression
public ObjectLiteralExpressionTree asObjectLiteralExpression()
-
asObjectPattern
public ObjectPatternTree asObjectPattern()
-
asParenExpression
public ParenExpressionTree asParenExpression()
-
asProgram
public ProgramTree asProgram()
-
asPropertyNameAssignment
public PropertyNameAssignmentTree asPropertyNameAssignment()
-
asIterRest
public IterRestTree asIterRest()
-
asObjectRest
public ObjectRestTree asObjectRest()
-
asReturnStatement
public ReturnStatementTree asReturnStatement()
-
asSetAccessor
public SetAccessorTree asSetAccessor()
-
asIterSpread
public IterSpreadTree asIterSpread()
-
asObjectSpread
public ObjectSpreadTree asObjectSpread()
-
asSuperExpression
public SuperExpressionTree asSuperExpression()
-
asSwitchStatement
public SwitchStatementTree asSwitchStatement()
-
asTemplateLiteralExpression
public TemplateLiteralExpressionTree asTemplateLiteralExpression()
-
asTemplateLiteralPortion
public TemplateLiteralPortionTree asTemplateLiteralPortion()
-
asTemplateSubstitution
public TemplateSubstitutionTree asTemplateSubstitution()
-
asThisExpression
public ThisExpressionTree asThisExpression()
-
asThrowStatement
public ThrowStatementTree asThrowStatement()
-
asTryStatement
public TryStatementTree asTryStatement()
-
asTypeName
public TypeNameTree asTypeName()
-
asTypedParameter
public TypedParameterTree asTypedParameter()
-
asOptionalParameter
public OptionalParameterTree asOptionalParameter()
-
asParameterizedType
public ParameterizedTypeTree asParameterizedType()
-
asArrayType
public ArrayTypeTree asArrayType()
-
asRecordType
public RecordTypeTree asRecordType()
-
asUnionType
public UnionTypeTree asUnionType()
-
asFunctionType
public FunctionTypeTree asFunctionType()
-
asTypeQuery
public TypeQueryTree asTypeQuery()
-
asGenericTypeList
public GenericTypeListTree asGenericTypeList()
-
asUnaryExpression
public UnaryExpressionTree asUnaryExpression()
-
asVariableDeclarationList
public VariableDeclarationListTree asVariableDeclarationList()
-
asVariableDeclaration
public VariableDeclarationTree asVariableDeclaration()
-
asVariableStatement
public VariableStatementTree asVariableStatement()
-
asWhileStatement
public WhileStatementTree asWhileStatement()
-
asWithStatement
public WithStatementTree asWithStatement()
-
asYieldStatement
public YieldExpressionTree asYieldStatement()
-
asAwaitExpression
public AwaitExpressionTree asAwaitExpression()
-
asInterfaceDeclaration
public InterfaceDeclarationTree asInterfaceDeclaration()
-
asEnumDeclaration
public EnumDeclarationTree asEnumDeclaration()
-
asTypeAlias
public TypeAliasTree asTypeAlias()
-
asAmbientDeclaration
public AmbientDeclarationTree asAmbientDeclaration()
-
asNamespaceDeclaration
public NamespaceDeclarationTree asNamespaceDeclaration()
-
asIndexSignature
public IndexSignatureTree asIndexSignature()
-
asCallSignature
public CallSignatureTree asCallSignature()
-
asNewTargetExpression
public NewTargetExpressionTree asNewTargetExpression()
-
asUpdateExpression
public UpdateExpressionTree asUpdateExpression()
-
asForAwaitOfStatement
public ForAwaitOfStatementTree asForAwaitOfStatement()
-
isPattern
public boolean isPattern()
-
isValidAssignmentTarget
public boolean isValidAssignmentTarget()
-
isRestParameter
public boolean isRestParameter()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-