AstFactory class

A collection of factory methods which may be used to create concrete instances of the interfaces that constitute the AST.

Clients should not extend, implement or mix-in this class.

Constructors

AstFactory()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

adjacentStrings(List<StringLiteral> strings) AdjacentStrings
Returns a newly created list of adjacent strings. To be syntactically valid, the list of strings must contain at least two elements.
annotation(Token atSign, Identifier name, Token period, SimpleIdentifier constructorName, ArgumentList arguments) Annotation
Returns a newly created annotation. Both the period and the constructorName can be null if the annotation is not referencing a named constructor. The arguments can be null if the annotation is not referencing a constructor.
argumentList(Token leftParenthesis, List<Expression> arguments, Token rightParenthesis) ArgumentList
Returns a newly created list of arguments. The list of arguments can be null if there are no arguments.
asExpression(Expression expression, Token asOperator, TypeAnnotation type) AsExpression
Returns a newly created as expression.
assertInitializer(Token assertKeyword, Token leftParenthesis, Expression condition, Token comma, Expression message, Token rightParenthesis) AssertInitializer
Returns a newly created assert initializer. The comma and message can be null if there is no message.
assertStatement(Token assertKeyword, Token leftParenthesis, Expression condition, Token comma, Expression message, Token rightParenthesis, Token semicolon) AssertStatement
Returns a newly created assert statement. The comma and message can be null if there is no message.
assignmentExpression(Expression leftHandSide, Token operator, Expression rightHandSide) AssignmentExpression
Returns a newly created assignment expression.
awaitExpression(Token awaitKeyword, Expression expression) AwaitExpression
Returns a newly created await expression.
binaryExpression(Expression leftOperand, Token operator, Expression rightOperand) BinaryExpression
Returns a newly created binary expression.
block(Token leftBracket, List<Statement> statements, Token rightBracket) Block
Returns a newly created block of code.
blockComment(List<Token> tokens) Comment
Returns a block comment consisting of the given tokens.
blockFunctionBody(Token keyword, Token star, Block block) BlockFunctionBody
Returns a newly created function body consisting of a block of statements. The keyword can be null if there is no keyword specified for the block. The star can be null if there is no star following the keyword (and must be null if there is no keyword).
booleanLiteral(Token literal, bool value) BooleanLiteral
Returns a newly created boolean literal.
breakStatement(Token breakKeyword, SimpleIdentifier label, Token semicolon) BreakStatement
Returns a newly created break statement. The label can be null if there is no label associated with the statement.
cascadeExpression(Expression target, List<Expression> cascadeSections) CascadeExpression
Returns a newly created cascade expression. The list of cascadeSections must contain at least one element.
catchClause(Token onKeyword, TypeAnnotation exceptionType, Token catchKeyword, Token leftParenthesis, SimpleIdentifier exceptionParameter, Token comma, SimpleIdentifier stackTraceParameter, Token rightParenthesis, Block body) CatchClause
Returns a newly created catch clause. The onKeyword and exceptionType can be null if the clause will catch all exceptions. The comma and stackTraceParameter can be null if the stack trace parameter is not defined.
classDeclaration(Comment comment, List<Annotation> metadata, Token abstractKeyword, Token classKeyword, SimpleIdentifier name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause implementsClause, Token leftBracket, List<ClassMember> members, Token rightBracket) ClassDeclaration
Returns a newly created class declaration. Either or both of the comment and metadata can be null if the class does not have the corresponding attribute. The abstractKeyword can be null if the class is not abstract. The typeParameters can be null if the class does not have any type parameters. Any or all of the extendsClause, withClause, and implementsClause can be null if the class does not have the corresponding clause. The list of members can be null if the class does not have any members.
classTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, SimpleIdentifier name, TypeParameterList typeParameters, Token equals, Token abstractKeyword, TypeName superclass, WithClause withClause, ImplementsClause implementsClause, Token semicolon) ClassTypeAlias
Returns a newly created class type alias. Either or both of the comment and metadata can be null if the class type alias does not have the corresponding attribute. The typeParameters can be null if the class does not have any type parameters. The abstractKeyword can be null if the class is not abstract. The implementsClause can be null if the class does not implement any interfaces.
commentReference(Token newKeyword, Identifier identifier) CommentReference
Returns a newly created reference to a Dart element. The newKeyword can be null if the reference is not to a constructor.
compilationUnit({Token beginToken, ScriptTag scriptTag, List<Directive> directives, List<CompilationUnitMember> declarations, Token endToken, FeatureSet featureSet}) CompilationUnit
Returns a newly created compilation unit to have the given directives and declarations. The scriptTag can be null (or omitted) if there is no script tag in the compilation unit. The list of declarations can be null (or omitted) if there are no directives in the compilation unit. The list of declarations can be null (or omitted) if there are no declarations in the compilation unit. The featureSet can be null if the set of features for this compilation unit is not known (this restricts what analysis can be done of the compilation unit).
conditionalExpression(Expression condition, Token question, Expression thenExpression, Token colon, Expression elseExpression) ConditionalExpression
Returns a newly created conditional expression.
configuration(Token ifKeyword, Token leftParenthesis, DottedName name, Token equalToken, StringLiteral value, Token rightParenthesis, StringLiteral libraryUri) Configuration
Returns a newly created configuration.
constructorDeclaration(Comment comment, List<Annotation> metadata, Token externalKeyword, Token constKeyword, Token factoryKeyword, Identifier returnType, Token period, SimpleIdentifier name, FormalParameterList parameters, Token separator, List<ConstructorInitializer> initializers, ConstructorName redirectedConstructor, FunctionBody body) ConstructorDeclaration
Returns a newly created constructor declaration. The externalKeyword can be null if the constructor is not external. Either or both of the comment and metadata can be null if the constructor does not have the corresponding attribute. The constKeyword can be null if the constructor cannot be used to create a constant. The factoryKeyword can be null if the constructor is not a factory. The period and name can both be null if the constructor is not a named constructor. The separator can be null if the constructor does not have any initializers and does not redirect to a different constructor. The list of initializers can be null if the constructor does not have any initializers. The redirectedConstructor can be null if the constructor does not redirect to a different constructor. The body can be null if the constructor does not have a body.
constructorFieldInitializer(Token thisKeyword, Token period, SimpleIdentifier fieldName, Token equals, Expression expression) ConstructorFieldInitializer
Returns a newly created field initializer to initialize the field with the given name to the value of the given expression. The thisKeyword and period can be null if the 'this' keyword was not specified.
constructorName(TypeName type, Token period, SimpleIdentifier name) ConstructorName
Returns a newly created constructor name. The period and name can be null if the constructor being named is the unnamed constructor.
continueStatement(Token continueKeyword, SimpleIdentifier label, Token semicolon) ContinueStatement
Returns a newly created continue statement. The label can be null if there is no label associated with the statement.
declaredIdentifier(Comment comment, List<Annotation> metadata, Token keyword, TypeAnnotation type, SimpleIdentifier identifier) DeclaredIdentifier
Returns a newly created formal parameter. Either or both of the comment and metadata can be null if the declaration does not have the corresponding attribute. The keyword can be null if a type name is given. The type must be null if the keyword is 'var'.
defaultFormalParameter(NormalFormalParameter parameter, ParameterKind kind, Token separator, Expression defaultValue) DefaultFormalParameter
Returns a newly created default formal parameter. The separator and defaultValue can be null if there is no default value.
documentationComment(List<Token> tokens, [List<CommentReference> references]) Comment
Returns a documentation comment consisting of the given tokens and having the given references (if supplied) embedded within it.
doStatement(Token doKeyword, Statement body, Token whileKeyword, Token leftParenthesis, Expression condition, Token rightParenthesis, Token semicolon) DoStatement
Returns a newly created do loop.
dottedName(List<SimpleIdentifier> components) DottedName
Returns a newly created dotted name.
doubleLiteral(Token literal, double value) DoubleLiteral
Returns a newly created floating point literal.
emptyFunctionBody(Token semicolon) EmptyFunctionBody
Returns a newly created function body.
emptyStatement(Token semicolon) EmptyStatement
Returns a newly created empty statement.
endOfLineComment(List<Token> tokens) Comment
Returns an end-of-line comment consisting of the given tokens.
enumConstantDeclaration(Comment comment, List<Annotation> metadata, SimpleIdentifier name) EnumConstantDeclaration
Returns a newly created enum constant declaration. Either or both of the comment and metadata can be null if the constant does not have the corresponding attribute. (Technically, enum constants cannot have metadata, but we allow it for consistency.)
enumDeclaration(Comment comment, List<Annotation> metadata, Token enumKeyword, SimpleIdentifier name, Token leftBracket, List<EnumConstantDeclaration> constants, Token rightBracket) EnumDeclaration
Returns a newly created enumeration declaration. Either or both of the comment and metadata can be null if the declaration does not have the corresponding attribute. The list of constants must contain at least one value.
exportDirective(Comment comment, List<Annotation> metadata, Token keyword, StringLiteral libraryUri, List<Configuration> configurations, List<Combinator> combinators, Token semicolon) ExportDirective
Returns a newly created export directive. Either or both of the comment and metadata can be null if the directive does not have the corresponding attribute. The list of combinators can be null if there are no combinators.
expressionFunctionBody(Token keyword, Token functionDefinition, Expression expression, Token semicolon) ExpressionFunctionBody
Returns a newly created function body consisting of a block of statements. The keyword can be null if the function body is not an async function body.
expressionStatement(Expression expression, Token semicolon) ExpressionStatement
Returns a newly created expression statement.
extendsClause(Token extendsKeyword, TypeName superclass) ExtendsClause
Returns a newly created extends clause.
extensionDeclaration({Comment comment, List<Annotation> metadata, Token extensionKeyword, SimpleIdentifier name, TypeParameterList typeParameters, Token onKeyword, TypeAnnotation extendedType, Token leftBracket, List<ClassMember> members, Token rightBracket}) ExtensionDeclaration
Return a newly created extension declaration. The list of typeParameters can be null if there are no type parameters.
extensionOverride({Identifier extensionName, TypeArgumentList typeArguments, ArgumentList argumentList}) ExtensionOverride
Return a newly created extension override. The list of typeArguments can be null if there are no type arguments.
fieldDeclaration(Comment comment, List<Annotation> metadata, Token staticKeyword, VariableDeclarationList fieldList, Token semicolon) FieldDeclaration
Returns a newly created field declaration. Either or both of the comment and metadata can be null if the declaration does not have the corresponding attribute. The staticKeyword can be null if the field is not a static field. [...]
fieldDeclaration2({Comment comment, List<Annotation> metadata, Token covariantKeyword, Token staticKeyword, VariableDeclarationList fieldList, Token semicolon}) FieldDeclaration
Returns a newly created field declaration. Either or both of the comment and metadata can be null if the declaration does not have the corresponding attribute. The staticKeyword can be null if the field is not a static field.
fieldFormalParameter(Comment comment, List<Annotation> metadata, Token keyword, TypeAnnotation type, Token thisKeyword, Token period, SimpleIdentifier identifier, TypeParameterList typeParameters, FormalParameterList parameters) FieldFormalParameter
Returns a newly created formal parameter. Either or both of the comment and metadata can be null if the parameter does not have the corresponding attribute. The keyword can be null if there is a type. The type must be null if the keyword is 'var'. The thisKeyword and period can be null if the keyword 'this' was not provided. The parameters can be null if this is not a function-typed field formal parameter. [...]
fieldFormalParameter2({Comment comment, List<Annotation> metadata, Token covariantKeyword, Token requiredKeyword, Token keyword, TypeAnnotation type, Token thisKeyword, Token period, SimpleIdentifier identifier, TypeParameterList typeParameters, FormalParameterList parameters, Token question}) FieldFormalParameter
Returns a newly created formal parameter. Either or both of the comment and metadata can be null if the parameter does not have the corresponding attribute. The keyword can be null if there is a type. The type must be null if the keyword is 'var'. The thisKeyword and period can be null if the keyword 'this' was not provided. The parameters can be null if this is not a function-typed field formal parameter.
forEachPartsWithDeclaration({DeclaredIdentifier loopVariable, Token inKeyword, Expression iterable}) ForEachPartsWithDeclaration
Returns a newly created for each part that includes a declaration.
forEachPartsWithIdentifier({SimpleIdentifier identifier, Token inKeyword, Expression iterable}) ForEachPartsWithIdentifier
Returns a newly created for each part that includes an identifier that is declared outside of the loop.
forElement({Token awaitKeyword, Token forKeyword, Token leftParenthesis, ForLoopParts forLoopParts, Token rightParenthesis, CollectionElement body}) ForElement
Returns a newly created for element that can be part of a list, map or set literal.
formalParameterList(Token leftParenthesis, List<FormalParameter> parameters, Token leftDelimiter, Token rightDelimiter, Token rightParenthesis) FormalParameterList
Returns a newly created parameter list. The list of parameters can be null if there are no parameters. The leftDelimiter and rightDelimiter can be null if there are no optional parameters.
forPartsWithDeclarations({VariableDeclarationList variables, Token leftSeparator, Expression condition, Token rightSeparator, List<Expression> updaters}) ForPartsWithDeclarations
Returns a newly created for part that includes a declaration.
forPartsWithExpression({Expression initialization, Token leftSeparator, Expression condition, Token rightSeparator, List<Expression> updaters}) ForPartsWithExpression
Returns a newly created for part that includes an expression.
forStatement({Token awaitKeyword, Token forKeyword, Token leftParenthesis, ForLoopParts forLoopParts, Token rightParenthesis, Statement body}) ForStatement
Returns a newly created for statement.
functionDeclaration(Comment comment, List<Annotation> metadata, Token externalKeyword, TypeAnnotation returnType, Token propertyKeyword, SimpleIdentifier name, FunctionExpression functionExpression) FunctionDeclaration
Returns a newly created function declaration. Either or both of the comment and metadata can be null if the function does not have the corresponding attribute. The externalKeyword can be null if the function is not an external function. The returnType can be null if no return type was specified. The propertyKeyword can be null if the function is neither a getter or a setter.
functionDeclarationStatement(FunctionDeclaration functionDeclaration) FunctionDeclarationStatement
Returns a newly created function declaration statement.
functionExpression(TypeParameterList typeParameters, FormalParameterList parameters, FunctionBody body) FunctionExpression
Returns a newly created function declaration.
functionExpressionInvocation(Expression function, TypeArgumentList typeArguments, ArgumentList argumentList) FunctionExpressionInvocation
Returns a newly created function expression invocation.
functionTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, TypeAnnotation returnType, SimpleIdentifier name, TypeParameterList typeParameters, FormalParameterList parameters, Token semicolon) FunctionTypeAlias
Returns a newly created function type alias. Either or both of the comment and metadata can be null if the function does not have the corresponding attribute. The returnType can be null if no return type was specified. The typeParameters can be null if the function has no type parameters.
functionTypedFormalParameter(Comment comment, List<Annotation> metadata, TypeAnnotation returnType, SimpleIdentifier identifier, TypeParameterList typeParameters, FormalParameterList parameters) FunctionTypedFormalParameter
Returns a newly created formal parameter. Either or both of the comment and metadata can be null if the parameter does not have the corresponding attribute. The returnType can be null if no return type was specified. [...]
functionTypedFormalParameter2({Comment comment, List<Annotation> metadata, Token covariantKeyword, Token requiredKeyword, TypeAnnotation returnType, SimpleIdentifier identifier, TypeParameterList typeParameters, FormalParameterList parameters, Token question}) FunctionTypedFormalParameter
Returns a newly created formal parameter. Either or both of the comment and metadata can be null if the parameter does not have the corresponding attribute. The returnType can be null if no return type was specified.
genericFunctionType(TypeAnnotation returnType, Token functionKeyword, TypeParameterList typeParameters, FormalParameterList parameters, {Token question}) GenericFunctionType
Initialize a newly created generic function type.
genericTypeAlias(Comment comment, List<Annotation> metadata, Token typedefKeyword, SimpleIdentifier name, TypeParameterList typeParameters, Token equals, GenericFunctionType functionType, Token semicolon) GenericTypeAlias
Returns a newly created generic type alias. Either or both of the comment and metadata can be null if the variable list does not have the corresponding attribute. The typeParameters can be null if there are no type parameters.
hideCombinator(Token keyword, List<SimpleIdentifier> hiddenNames) HideCombinator
Returns a newly created import show combinator.
ifElement({Token ifKeyword, Token leftParenthesis, Expression condition, Token rightParenthesis, CollectionElement thenElement, Token elseKeyword, CollectionElement elseElement}) IfElement
Returns a newly created if element that can be part of a list, map or set literal.
ifStatement(Token ifKeyword, Token leftParenthesis, Expression condition, Token rightParenthesis, Statement thenStatement, Token elseKeyword, Statement elseStatement) IfStatement
Returns a newly created if statement. The elseKeyword and elseStatement can be null if there is no else clause.
implementsClause(Token implementsKeyword, List<TypeName> interfaces) ImplementsClause
Returns a newly created implements clause.
importDirective(Comment comment, List<Annotation> metadata, Token keyword, StringLiteral libraryUri, List<Configuration> configurations, Token deferredKeyword, Token asKeyword, SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon) ImportDirective
Returns a newly created import directive. Either or both of the comment and metadata can be null if the function does not have the corresponding attribute. The deferredKeyword can be null if the import is not deferred. The asKeyword and prefix can be null if the import does not specify a prefix. The list of combinators can be null if there are no combinators.
indexExpressionForCascade(Token period, Token leftBracket, Expression index, Token rightBracket) IndexExpression
Returns a newly created index expression suitable for use in a cascade expression.
@Deprecated('Use indexExpressionForCascade2')
indexExpressionForCascade2({Token period, Token question, Token leftBracket, Expression index, Token rightBracket}) IndexExpression
Returns a newly created index expression.
indexExpressionForTarget(Expression target, Token leftBracket, Expression index, Token rightBracket) IndexExpression
Returns a newly created index expression suitable for use outside a cascade expression.
@Deprecated('Use indexExpressionForTarget2')
indexExpressionForTarget2({Expression target, Token question, Token leftBracket, Expression index, Token rightBracket}) IndexExpression
Returns a newly created index expression.
instanceCreationExpression(Token keyword, ConstructorName constructorName, ArgumentList argumentList, {TypeArgumentList typeArguments}) InstanceCreationExpression
Returns a newly created instance creation expression.
integerLiteral(Token literal, int value) IntegerLiteral
Returns a newly created integer literal.
interpolationExpression(Token leftBracket, Expression expression, Token rightBracket) InterpolationExpression
Returns a newly created interpolation expression.
interpolationString(Token contents, String value) InterpolationString
Returns a newly created string of characters that are part of a string interpolation.
isExpression(Expression expression, Token isOperator, Token notOperator, TypeAnnotation type) IsExpression
Returns a newly created is expression. The notOperator can be null if the sense of the test is not negated.
label(SimpleIdentifier label, Token colon) Label
Returns a newly created label.
labeledStatement(List<Label> labels, Statement statement) LabeledStatement
Returns a newly created labeled statement.
libraryDirective(Comment comment, List<Annotation> metadata, Token libraryKeyword, LibraryIdentifier name, Token semicolon) LibraryDirective
Returns a newly created library directive. Either or both of the comment and metadata can be null if the directive does not have the corresponding attribute.
libraryIdentifier(List<SimpleIdentifier> components) LibraryIdentifier
Returns a newly created prefixed identifier.
listLiteral(Token constKeyword, TypeArgumentList typeArguments, Token leftBracket, List<CollectionElement> elements, Token rightBracket) ListLiteral
Returns a newly created list literal. The constKeyword can be null if the literal is not a constant. The typeArguments can be null if no type arguments were declared. The list of elements can be null if the list is empty.
mapLiteralEntry(Expression key, Token separator, Expression value) MapLiteralEntry
Returns a newly created map literal entry.
methodDeclaration(Comment comment, List<Annotation> metadata, Token externalKeyword, Token modifierKeyword, TypeAnnotation returnType, Token propertyKeyword, Token operatorKeyword, SimpleIdentifier name, TypeParameterList typeParameters, FormalParameterList parameters, FunctionBody body) MethodDeclaration
Returns a newly created method declaration. Either or both of the comment and metadata can be null if the declaration does not have the corresponding attribute. The externalKeyword can be null if the method is not external. The modifierKeyword can be null if the method is neither abstract nor static. The returnType can be null if no return type was specified. The propertyKeyword can be null if the method is neither a getter or a setter. The operatorKeyword can be null if the method does not implement an operator. The parameters must be null if this method declares a getter.
methodInvocation(Expression target, Token operator, SimpleIdentifier methodName, TypeArgumentList typeArguments, ArgumentList argumentList) MethodInvocation
Returns a newly created method invocation. The target and operator can be null if there is no target.
mixinDeclaration(Comment comment, List<Annotation> metadata, Token mixinKeyword, SimpleIdentifier name, TypeParameterList typeParameters, OnClause onClause, ImplementsClause implementsClause, Token leftBracket, List<ClassMember> members, Token rightBracket) MixinDeclaration
Return a newly created mixin declaration.
namedExpression(Label name, Expression expression) NamedExpression
Returns a newly created named expression.
nativeClause(Token nativeKeyword, StringLiteral name) NativeClause
Returns a newly created native clause.
nativeFunctionBody(Token nativeKeyword, StringLiteral stringLiteral, Token semicolon) NativeFunctionBody
Returns a newly created function body consisting of the 'native' token, a string literal, and a semicolon.
nodeList<E extends AstNode>(AstNode owner, [List<E> elements]) NodeList<E>
Returns a newly created list of nodes such that all of the nodes that are added to the list will have their parent set to the given owner. The list will initially be populated with the given elements.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
nullLiteral(Token literal) NullLiteral
Returns a newly created null literal.
onClause(Token onKeyword, List<TypeName> superclassConstraints) OnClause
Return a newly created on clause.
parenthesizedExpression(Token leftParenthesis, Expression expression, Token rightParenthesis) ParenthesizedExpression
Returns a newly created parenthesized expression.
partDirective(Comment comment, List<Annotation> metadata, Token partKeyword, StringLiteral partUri, Token semicolon) PartDirective
Returns a newly created part directive. Either or both of the comment and metadata can be null if the directive does not have the corresponding attribute.
partOfDirective(Comment comment, List<Annotation> metadata, Token partKeyword, Token ofKeyword, StringLiteral uri, LibraryIdentifier libraryName, Token semicolon) PartOfDirective
Returns a newly created part-of directive. Either or both of the comment and metadata can be null if the directive does not have the corresponding attribute.
postfixExpression(Expression operand, Token operator) PostfixExpression
Returns a newly created postfix expression.
prefixedIdentifier(SimpleIdentifier prefix, Token period, SimpleIdentifier identifier) PrefixedIdentifier
Returns a newly created prefixed identifier.
prefixExpression(Token operator, Expression operand) PrefixExpression
Returns a newly created prefix expression.
propertyAccess(Expression target, Token operator, SimpleIdentifier propertyName) PropertyAccess
Returns a newly created property access expression.
redirectingConstructorInvocation(Token thisKeyword, Token period, SimpleIdentifier constructorName, ArgumentList argumentList) RedirectingConstructorInvocation
Returns a newly created redirecting invocation to invoke the constructor with the given name with the given arguments. The constructorName can be null if the constructor being invoked is the unnamed constructor.
rethrowExpression(Token rethrowKeyword) RethrowExpression
Returns a newly created rethrow expression.
returnStatement(Token returnKeyword, Expression expression, Token semicolon) ReturnStatement
Returns a newly created return statement. The expression can be null if no explicit value was provided.
scriptTag(Token scriptTag) ScriptTag
Returns a newly created script tag.
setOrMapLiteral({Token constKeyword, TypeArgumentList typeArguments, Token leftBracket, List<CollectionElement> elements, Token rightBracket}) SetOrMapLiteral
Returns a newly created set or map literal. The constKeyword can be null if the literal is not a constant. The typeArguments can be null if no type arguments were declared. The list of elements can be null if the set or map is empty.
showCombinator(Token keyword, List<SimpleIdentifier> shownNames) ShowCombinator
Returns a newly created import show combinator.
simpleFormalParameter(Comment comment, List<Annotation> metadata, Token keyword, TypeAnnotation type, SimpleIdentifier identifier) SimpleFormalParameter
Returns a newly created formal parameter. Either or both of the comment and metadata can be null if the parameter does not have the corresponding attribute. The keyword can be null if a type was specified. The type must be null if the keyword is 'var'. [...]
simpleFormalParameter2({Comment comment, List<Annotation> metadata, Token covariantKeyword, Token requiredKeyword, Token keyword, TypeAnnotation type, SimpleIdentifier identifier}) SimpleFormalParameter
Returns a newly created formal parameter. Either or both of the comment and metadata can be null if the parameter does not have the corresponding attribute. The keyword can be null if a type was specified. The type must be null if the keyword is 'var'.
simpleIdentifier(Token token, {bool isDeclaration = false}) SimpleIdentifier
Returns a newly created identifier.
simpleStringLiteral(Token literal, String value) SimpleStringLiteral
Returns a newly created simple string literal.
spreadElement({Token spreadOperator, Expression expression}) SpreadElement
Returns a newly created spread element.
stringInterpolation(List<InterpolationElement> elements) StringInterpolation
Returns a newly created string interpolation expression.
superConstructorInvocation(Token superKeyword, Token period, SimpleIdentifier constructorName, ArgumentList argumentList) SuperConstructorInvocation
Returns a newly created super invocation to invoke the inherited constructor with the given name with the given arguments. The period and constructorName can be null if the constructor being invoked is the unnamed constructor.
superExpression(Token superKeyword) SuperExpression
Returns a newly created super expression.
switchCase(List<Label> labels, Token keyword, Expression expression, Token colon, List<Statement> statements) SwitchCase
Returns a newly created switch case. The list of labels can be null if there are no labels.
switchDefault(List<Label> labels, Token keyword, Token colon, List<Statement> statements) SwitchDefault
Returns a newly created switch default. The list of labels can be null if there are no labels.
switchStatement(Token switchKeyword, Token leftParenthesis, Expression expression, Token rightParenthesis, Token leftBracket, List<SwitchMember> members, Token rightBracket) SwitchStatement
Returns a newly created switch statement. The list of members can be null if there are no switch members.
symbolLiteral(Token poundSign, List<Token> components) SymbolLiteral
Returns a newly created symbol literal.
thisExpression(Token thisKeyword) ThisExpression
Returns a newly created this expression.
throwExpression(Token throwKeyword, Expression expression) ThrowExpression
Returns a newly created throw expression.
topLevelVariableDeclaration(Comment comment, List<Annotation> metadata, VariableDeclarationList variableList, Token semicolon) TopLevelVariableDeclaration
Returns a newly created top-level variable declaration. Either or both of the comment and metadata can be null if the variable does not have the corresponding attribute.
toString() String
A string representation of this object. [...]
inherited
tryStatement(Token tryKeyword, Block body, List<CatchClause> catchClauses, Token finallyKeyword, Block finallyBlock) TryStatement
Returns a newly created try statement. The list of catchClauses can be null if there are no catch clauses. The finallyKeyword and finallyBlock can be null if there is no finally clause.
typeArgumentList(Token leftBracket, List<TypeAnnotation> arguments, Token rightBracket) TypeArgumentList
Returns a newly created list of type arguments.
typeName(Identifier name, TypeArgumentList typeArguments, {Token question}) TypeName
Returns a newly created type name. The typeArguments can be null if there are no type arguments. The question can be null if there is no question mark.
typeParameter(Comment comment, List<Annotation> metadata, SimpleIdentifier name, Token extendsKeyword, TypeAnnotation bound) TypeParameter
Returns a newly created type parameter. Either or both of the comment and metadata can be null if the parameter does not have the corresponding attribute. The extendsKeyword and bound can be null if the parameter does not have an upper bound.
typeParameterList(Token leftBracket, List<TypeParameter> typeParameters, Token rightBracket) TypeParameterList
Returns a newly created list of type parameters.
variableDeclaration(SimpleIdentifier name, Token equals, Expression initializer) VariableDeclaration
Returns a newly created variable declaration. The equals and initializer can be null if there is no initializer.
variableDeclarationList(Comment comment, List<Annotation> metadata, Token keyword, TypeAnnotation type, List<VariableDeclaration> variables) VariableDeclarationList
Returns a newly created variable declaration list. Either or both of the comment and metadata can be null if the variable list does not have the corresponding attribute. The keyword can be null if a type was specified. The type must be null if the keyword is 'var'. [...]
variableDeclarationList2({Comment comment, List<Annotation> metadata, Token lateKeyword, Token keyword, TypeAnnotation type, List<VariableDeclaration> variables}) VariableDeclarationList
Returns a newly created variable declaration list. Either or both of the comment and metadata can be null if the variable list does not have the corresponding attribute. The keyword can be null if a type was specified. The type must be null if the keyword is 'var'.
variableDeclarationStatement(VariableDeclarationList variableList, Token semicolon) VariableDeclarationStatement
Returns a newly created variable declaration statement.
whileStatement(Token whileKeyword, Token leftParenthesis, Expression condition, Token rightParenthesis, Statement body) WhileStatement
Returns a newly created while statement.
withClause(Token withKeyword, List<TypeName> mixinTypes) WithClause
Returns a newly created with clause.
yieldStatement(Token yieldKeyword, Token star, Expression expression, Token semicolon) YieldStatement
Returns a newly created yield expression. The star can be null if no star was provided.

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited