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
,ComputedPropertyGetterTree
,ComputedPropertyMethodTree
,ComputedPropertySetterTree
,ConditionalExpressionTree
,ContinueStatementTree
,DebuggerStatementTree
,DefaultClauseTree
,DefaultParameterTree
,DoWhileStatementTree
,DynamicImportTree
,EmptyStatementTree
,ExportDeclarationTree
,ExportSpecifierTree
,ExpressionStatementTree
,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
,OptionalCallExpressionTree
,OptionalMemberExpressionTree
,OptionalMemberLookupExpressionTree
,ParenExpressionTree
,ProgramTree
,PropertyNameAssignmentTree
,ReturnStatementTree
,SetAccessorTree
,SuperExpressionTree
,SwitchStatementTree
,TemplateLiteralExpressionTree
,TemplateLiteralPortionTree
,TemplateSubstitutionTree
,ThisExpressionTree
,ThrowStatementTree
,TryStatementTree
,UnaryExpressionTree
,UpdateExpressionTree
,VariableDeclarationListTree
,VariableDeclarationTree
,VariableStatementTree
,WhileStatementTree
,WithStatementTree
,YieldExpressionTree
public class ParseTree extends java.lang.Object
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 Modifier and Type Field Description SourceRange
location
ParseTreeType
type
-
Constructor Summary
Constructors Modifier Constructor Description protected
ParseTree(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()
-
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()
-
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()
-
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()
-
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:
toString
in classjava.lang.Object
-
-