Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data AnnotatedNode
- data Annotation = Annotation Identifier (Maybe SimpleIdentifier) (Maybe ArgumentList)
- newtype ArgumentList = ArgumentList [Expression]
- data AstNode
- = SwitchMember SwitchMember
- | Statement Statement
- | CatchClause' CatchClause
- | TypeNameNode TypeName
- | TypeArgumentList' TypeArgumentList
- | Label' Label
- | Annotation' Annotation
- | Comment' Comment
- | CommentReference' CommentReference
- | ArgumentList' ArgumentList
- | TypeParameterList' TypeParameterList
- | FormalParameterList' FormalParameterList
- | AnnotatedNode' AnnotatedNode
- | WithClause' WithClause
- | ExtendsClause' ExtendsClause
- | ConstructorName' ConstructorName
- | InterpolationElement' InterpolationElement
- | ConstructorInitializer ConstructorInitializer
- | Combinator Combinator
- | Configuration' Configuration
- | DottedName' DottedName
- | ScriptTag' ScriptTag
- | NativeClause StringLiteral
- | MapLiteralEntry' MapLiteralEntry
- data AsyncModifier
- data Block = Block [Statement]
- data CatchClause = CatchClause (Maybe TypeName) SimpleIdentifier (Maybe SimpleIdentifier) Block
- data ClassMember
- = ConstructorDeclaration (Maybe Comment) [Annotation] Bool Bool Bool Identifier (Maybe SimpleIdentifier) FormalParameterList [ConstructorInitializer] (Maybe ConstructorName) (Maybe FunctionBody)
- | MethodDeclaration (Maybe Comment) [Annotation] Bool (Maybe MethodModifier) (Maybe TypeName) PropertyKeyword Bool SimpleIdentifier (Maybe TypeParameterList) (Maybe FormalParameterList) FunctionBody
- | FieldDeclaration (Maybe Comment) [Annotation] Bool VariableDeclarationList
- data Combinator
- data Comment = Comment [Token] CommentType [CommentReference]
- data CommentReference = CommentReference Bool Identifier
- data CommentType
- data CompilationUnit = CompilationUnit (Maybe ScriptTag) [Directive] [CompilationUnitMember]
- data CompilationUnitMember
- data Configuration = Configuration DottedName StringLiteral StringLiteral
- data ConstructorInitializer
- data ConstructorName = ConstructorName TypeName (Maybe SimpleIdentifier)
- data Declaration
- data DeclaredIdentifier = DeclaredIdentifier (Maybe Comment) [Annotation] FinalConstVarOrType SimpleIdentifier
- data Directive
- newtype DottedName = DottedName [SimpleIdentifier]
- data EnumConstantDeclaration = EnumConstantDeclaration (Maybe Comment) [Annotation] SimpleIdentifier
- data Expression
- = Literal' Literal
- | Identifier' Identifier
- | PrefixExpression Token Expression
- | PostfixExpression Expression Token
- | BinaryExpression Expression Token Expression
- | AssignmentExpression Expression Token Expression
- | FunctionExpression' FunctionExpression
- | InstanceCreationExpression NewOrConst ConstructorName ArgumentList
- | AsExpression Expression TypeName
- | IsExpression Expression Bool TypeName
- | ThrowExpression Expression
- | RethrowExpression
- | ThisExpression
- | SuperExpression
- | ParenthesizedExpression Expression
- | PropertyAccess Expression SimpleIdentifier
- | NamedExpression Label Expression
- | InvocationExpression InvocationExpression
- | ConditionalExpression Expression Expression Expression
- | CascadeExpression Expression [Expression]
- | IndexExpressionForCasecade Expression
- | IndexExpressionForTarget Expression Expression
- | AwaitExpression Expression
- newtype ExtendsClause = ExtendsClause TypeName
- data FinalConstVarOrType
- data FinalVarOrType
- data FormalParameter
- newtype FormalParameterList = FormalParameterList [FormalParameter]
- data FunctionBody
- data FunctionDeclaration = FunctionDeclaration (Maybe Comment) [Annotation] Bool (Maybe TypeName) PropertyKeyword SimpleIdentifier FunctionExpression
- data FunctionExpression = FunctionExpression (Maybe TypeParameterList) FormalParameterList FunctionBody
- data Identifier
- newtype ImplementsClause = ImplementsClause [TypeName]
- data InterpolationElement
- data InvocationExpression
- newtype Label = Label SimpleIdentifier
- newtype LibraryIdentifier = LibraryIdentifier [SimpleIdentifier]
- data Literal
- data MapLiteralEntry = MapLiteralEntry Expression Expression
- data MethodModifier
- data NamedCompilationUnitMember
- = FunctionDeclaration' FunctionDeclaration
- | TypeAlias TypeAlias
- | ClassDeclaration (Maybe Comment) [Annotation] Bool SimpleIdentifier (Maybe TypeParameterList) (Maybe ExtendsClause) (Maybe WithClause) (Maybe ImplementsClause) [ClassMember]
- | EnumDeclaration (Maybe Comment) [Annotation] SimpleIdentifier [EnumConstantDeclaration]
- data NamespaceDirective
- data NewOrConst
- data NormalFormalParameter
- = FunctionTypedFormalParameter (Maybe Comment) [Annotation] (Maybe TypeName) SimpleIdentifier (Maybe TypeParameterList) FormalParameterList
- | FieldFormalParameter (Maybe Comment) [Annotation] (Maybe FinalConstVarOrType) Bool SimpleIdentifier
- | SimpleFormalParameter (Maybe Comment) [Annotation] FinalVarOrType SimpleIdentifier
- data ParameterKind
- = Required
- | Positional
- | Named
- data PropertyKeyword
- newtype ScriptTag = ScriptTag Token
- newtype SimpleIdentifier = SimpleIdentifier Token
- data SingleStringLiteral
- data Statement
- = Block' Block
- | VariableDeclarationStatement VariableDeclarationList
- | ForStatement (Maybe VariableDeclarationList) (Maybe Expression) (Maybe Expression) [Expression] Statement
- | ForEachStatementWithDeclaration Bool DeclaredIdentifier Expression Statement
- | ForEachStatementWithReference Bool SimpleIdentifier Expression Statement
- | WhileStatement Expression Statement
- | DoStatement Statement Expression
- | SwitchStatement Expression [SwitchMember]
- | IfStatement Expression Statement (Maybe Statement)
- | TryStatement Block [CatchClause] (Maybe Block)
- | BreakStatement (Maybe SimpleIdentifier)
- | ContinueStatement (Maybe SimpleIdentifier)
- | ReturnStatement (Maybe Expression)
- | ExpressionStatement Expression
- | FunctionDeclarationStatement FunctionDeclaration
- | AssertStatement Expression (Maybe Expression)
- | YieldStatement Bool Expression
- | EmptyStatement
- | LabeledStatement [Label] Statement
- data StringLiteral
- data SwitchMember
- = SwitchDefault [Label] [Statement]
- | SwitchCase [Label] Expression [Statement]
- type Token = String
- data TypeAlias
- data TypeArgumentList = TypeArgumentList [TypeName]
- data TypedLiteral
- data TypeName = TypeName Identifier (Maybe TypeArgumentList)
- data TypeParameter = TypeParameter (Maybe Comment) [Annotation] SimpleIdentifier (Maybe TypeName)
- newtype TypeParameterList = TypeParameterList [TypeParameter]
- data UriBasedDirective
- data VariableDeclaration = VariableDeclaration SimpleIdentifier (Maybe Expression)
- data VariableDeclarationList = VariableDeclarationList (Maybe Comment) [Annotation] FinalConstVarOrType [VariableDeclaration]
- newtype WithClause = WithClause [TypeName]
Documentation
data AnnotatedNode Source #
An AST node that can be annotated with both a documentation comment and a list of annotations.
data Annotation Source #
An annotation that can be associated with an AST node.
metadata ::= annotation*
annotation ::=
'@' [Identifier] (.
[SimpleIdentifier])? [ArgumentList]?
newtype ArgumentList Source #
A list of arguments in the invocation of an executable element (that is, a function, method, or constructor).
argumentList ::= '(' arguments? ')'
arguments ::= [NamedExpression] (',' [NamedExpression])* | [Expression] (',' [Expression])* (',' [NamedExpression])*
A node in the AST structure for a Dart program.
data AsyncModifier Source #
A sequence of statements.
block ::= '{' statement* '}'
data CatchClause Source #
A catch clause within a try statement.
onPart ::=
catchPart [Block]
| on
type catchPart? [Block]
catchPart ::=
catch
'(' [SimpleIdentifier] (',' [SimpleIdentifier])? ')'
data ClassMember Source #
A node that declares a name within the scope of a class.
ConstructorDeclaration (Maybe Comment) [Annotation] Bool Bool Bool Identifier (Maybe SimpleIdentifier) FormalParameterList [ConstructorInitializer] (Maybe ConstructorName) (Maybe FunctionBody) | |
MethodDeclaration (Maybe Comment) [Annotation] Bool (Maybe MethodModifier) (Maybe TypeName) PropertyKeyword Bool SimpleIdentifier (Maybe TypeParameterList) (Maybe FormalParameterList) FunctionBody | A method declaration. methodDeclaration ::= methodSignature [FunctionBody] methodSignature ::=
methodName ::=
[SimpleIdentifier]
| |
FieldDeclaration (Maybe Comment) [Annotation] Bool VariableDeclarationList | The declaration of one or more fields of the same type. fieldDeclaration ::=
|
data Combinator Source #
A combinator associated with an import or export directive.
combinator ::= [HideCombinator] | [ShowCombinator]
ShowCombinator [SimpleIdentifier] | A combinator that restricts the names being imported to those in a given list. showCombinator ::=
|
HideCombinator [SimpleIdentifier] | A combinator that restricts the names being imported to those that are not in a given list. hideCombinator ::=
|
A comment within the source code.
comment ::= endOfLineComment | blockComment | documentationComment
endOfLineComment ::=
//
(CHARACTER - EOL)* EOL
blockComment ::= '-- ' CHARACTER* '*'
documentationComment ::=
'-- *' (CHARACTER | [CommentReference])* '*'
| (///
(CHARACTER - EOL)* EOL)+
data CommentReference Source #
A reference to a Dart element that is found within a documentation comment.
commentReference ::=
'[' new
? [Identifier] ']'
data CommentType Source #
data CompilationUnit Source #
A compilation unit.
While the grammar restricts the order of the directives and declarations within a compilation unit, this class does not enforce those restrictions. In particular, the children of a compilation unit will be visited in lexical order even if lexical order does not conform to the restrictions of the grammar.
compilationUnit ::= directives declarations
directives ::= [ScriptTag]? [LibraryDirective]? namespaceDirective* [PartDirective]* | [PartOfDirective]
namespaceDirective ::= [ImportDirective] | [ExportDirective]
declarations ::= [CompilationUnitMember]*
data CompilationUnitMember Source #
A node that declares one or more names within the scope of a compilation unit.
compilationUnitMember ::= [ClassDeclaration] | [TypeAlias] | [FunctionDeclaration] | [MethodDeclaration] | [VariableDeclaration] | [VariableDeclaration]
TopLevelVariableDeclaration (Maybe Comment) [Annotation] VariableDeclarationList | The declaration of one or more top-level variables of the same type. topLevelVariableDeclaration ::=
( |
NamedCompilationUnitMember NamedCompilationUnitMember |
data Configuration Source #
data ConstructorInitializer Source #
A node that can occur in the initializer list of a constructor declaration.
constructorInitializer ::= [SuperConstructorInvocation] | [ConstructorFieldInitializer] | [RedirectingConstructorInvocation]
RedirectingConstructorInvocation (Maybe SimpleIdentifier) ArgumentList | The invocation of a constructor in the same class from within a constructor's initialization list. redirectingConstructorInvocation ::=
|
ConstructorFieldInitializer Bool SimpleIdentifier Expression | The initialization of a field within a constructor's initialization list. fieldInitializer ::=
( |
SuperConstructorInvocation (Maybe SimpleIdentifier) ArgumentList | The invocation of a superclass' constructor from within a constructor's initialization list. superInvocation ::=
|
data ConstructorName Source #
The name of a constructor.
constructorName ::=
type (.
identifier)?
data Declaration Source #
A node that represents the declaration of one or more names. Each declared name is visible within a name scope.
data DeclaredIdentifier Source #
The declaration of a single identifier.
declaredIdentifier ::= [Annotation] finalConstVarOrType [SimpleIdentifier]
A node that represents a directive.
directive ::= [ExportDirective] | [ImportDirective] | [LibraryDirective] | [PartDirective] | [PartOfDirective]
UriBasedDirective UriBasedDirective | |
PartOfDirective (Maybe Comment) [Annotation] LibraryIdentifier | A part-of directive. partOfDirective ::=
[Annotation] |
LibraryDirective (Maybe Comment) [Annotation] LibraryIdentifier | A library directive. libraryDirective ::=
[Annotation] |
newtype DottedName Source #
A dotted name, used in a configuration within an import or export directive.
dottedName ::=
[SimpleIdentifier] (.
[SimpleIdentifier])*
data EnumConstantDeclaration Source #
The declaration of an enum constant.
data Expression Source #
A node that represents an expression.
expression ::= [AssignmentExpression] | [ConditionalExpression] cascadeSection* | [ThrowExpression]
Literal' Literal | |
Identifier' Identifier | |
PrefixExpression Token Expression | A prefix unary expression. prefixExpression ::= [Token] [Expression] |
PostfixExpression Expression Token | A postfix unary expression. postfixExpression ::= [Expression] [Token] |
BinaryExpression Expression Token Expression | A binary (infix) expression. binaryExpression ::= [Expression] [Token] [Expression] |
AssignmentExpression Expression Token Expression | An assignment expression. assignmentExpression ::= [Expression] operator [Expression] |
FunctionExpression' FunctionExpression | |
InstanceCreationExpression NewOrConst ConstructorName ArgumentList | An instance creation expression. newExpression ::=
( |
AsExpression Expression TypeName | An as expression. asExpression ::=
[Expression] |
IsExpression Expression Bool TypeName | An is expression. isExpression ::=
[Expression] |
ThrowExpression Expression | A throw expression. throwExpression ::=
|
RethrowExpression | A rethrow expression. rethrowExpression ::=
|
ThisExpression | A this expression. thisExpression ::=
|
SuperExpression | A super expression. superExpression ::=
|
ParenthesizedExpression Expression | A parenthesized expression. parenthesizedExpression ::= '(' [Expression] ')' |
PropertyAccess Expression SimpleIdentifier | The access of a property of an object. Note, however, that accesses to properties of objects can also be represented as [PrefixedIdentifier] nodes in cases where the target is also a simple identifier. propertyAccess ::=
[Expression] |
NamedExpression Label Expression | An expression that has a name associated with it. They are used in method invocations when there are named parameters. namedExpression ::= [Label] [Expression] |
InvocationExpression InvocationExpression | |
ConditionalExpression Expression Expression Expression | A conditional expression. conditionalExpression ::=
[Expression] |
CascadeExpression Expression [Expression] | A sequence of cascaded expressions: expressions that share a common target. There are three kinds of expressions that can be used in a cascade expression: [IndexExpression], [MethodInvocation] and [PropertyAccess]. cascadeExpression ::= [Expression] cascadeSection* cascadeSection ::= '..' (cascadeSelector arguments*) (assignableSelector arguments*)* (assignmentOperator expressionWithoutCascade)? cascadeSelector ::= '[ ' expression '] ' | identifier |
IndexExpressionForCasecade Expression | An index expression. indexExpression ::= [Expression] '[' [Expression] ']' |
IndexExpressionForTarget Expression Expression | |
AwaitExpression Expression | An await expression. awaitExpression ::=
|
newtype ExtendsClause Source #
The "extends" clause in a class declaration.
extendsClause ::=
extends
[TypeName]
data FinalConstVarOrType Source #
data FinalVarOrType Source #
data FormalParameter Source #
A node representing a parameter to a function.
formalParameter ::= [NormalFormalParameter] | [DefaultFormalParameter]
newtype FormalParameterList Source #
The formal parameter list of a method declaration, function declaration, or function type alias.
While the grammar requires all optional formal parameters to follow all of the normal formal parameters and at most one grouping of optional formal parameters, this class does not enforce those constraints. All parameters are flattened into a single list, which can have any or all kinds of parameters (normal, named, and positional) in any order.
formalParameterList ::= '(' ')' | '(' normalFormalParameters (',' optionalFormalParameters)? ')' | '(' optionalFormalParameters ')'
normalFormalParameters ::= [NormalFormalParameter] (',' [NormalFormalParameter])*
optionalFormalParameters ::= optionalPositionalFormalParameters | namedFormalParameters
optionalPositionalFormalParameters ::= '[' [DefaultFormalParameter] (',' [DefaultFormalParameter])* ']'
namedFormalParameters ::= '{' [DefaultFormalParameter] (',' [DefaultFormalParameter])* '}'
data FunctionBody Source #
A node representing the body of a function or method.
functionBody ::= [BlockFunctionBody] | [EmptyFunctionBody] | [ExpressionFunctionBody]
BlockFunctionBody AsyncModifier Block | A function body that consists of a block of statements. |
EmptyFunctionBody | An empty function body, which can only appear in constructors or abstract methods. emptyFunctionBody ::= ';' |
ExpressionFunctionBody Bool Expression | A function body consisting of a single expression. expressionFunctionBody ::=
|
NativeFunctionBody StringLiteral | A function body that consists of a native keyword followed by a string literal. nativeFunctionBody ::=
|
data FunctionDeclaration Source #
A top-level declaration.
functionDeclaration ::=
external
functionSignature
| functionSignature [FunctionBody]
functionSignature ::=
[Type]? (get
| set
)? [SimpleIdentifier] [FormalParameterList]
data FunctionExpression Source #
A function expression.
functionExpression ::= [TypeParameterList]? [FormalParameterList] [FunctionBody]
data Identifier Source #
A node that represents an identifier.
identifier ::= [SimpleIdentifier] | [PrefixedIdentifier]
SimpleIdentifier' SimpleIdentifier | |
PrefixedIdentifier SimpleIdentifier SimpleIdentifier | An identifier that is prefixed or an access to an object property where the target of the property access is a simple identifier. prefixedIdentifier ::=
[SimpleIdentifier] |
LibraryIdentifier' LibraryIdentifier |
newtype ImplementsClause Source #
The "implements" clause in an class declaration.
implementsClause ::=
implements
[TypeName] (',' [TypeName])*
data InterpolationElement Source #
A node within a [StringInterpolation].
interpolationElement ::= [InterpolationExpression] | [InterpolationString]
InterpolationExpression Expression | An expression embedded in a string interpolation. interpolationExpression ::=
|
InterpolationString String | A non-empty substring of an interpolated string. interpolationString ::= characters |
data InvocationExpression Source #
The invocation of a function or method; either a [FunctionExpressionInvocation] or a [MethodInvocation].
FunctionExpressionInvocation Expression (Maybe TypeArgumentList) ArgumentList | The invocation of a function resulting from evaluating an expression. Invocations of methods and other forms of functions are represented by [MethodInvocation] nodes. Invocations of getters and setters are represented by either [PrefixedIdentifier] or [PropertyAccess] nodes. functionExpressionInvocation ::= [Expression] [TypeArgumentList]? [ArgumentList] |
MethodInvocation (Maybe Expression) SimpleIdentifier (Maybe TypeArgumentList) ArgumentList | The invocation of either a function or a method. Invocations of functions resulting from evaluating an expression are represented by [FunctionExpressionInvocation] nodes. Invocations of getters and setters are represented by either [PrefixedIdentifier] or [PropertyAccess] nodes. methodInvocation ::=
([Expression] |
A label on either a [LabeledStatement] or a [NamedExpression].
label ::=
[SimpleIdentifier] :
newtype LibraryIdentifier Source #
The identifier for a library.
libraryIdentifier ::=
[SimpleIdentifier] (.
[SimpleIdentifier])*
A node that represents a literal expression.
literal ::= [BooleanLiteral] | [DoubleLiteral] | [IntegerLiteral] | [ListLiteral] | [MapLiteral] | [NullLiteral] | [StringLiteral]
BooleanLiteral Bool | |
DoubleLiteral Double | |
TypedLiteral TypedLiteral | |
IntegerLiteral Integer | An integer literal expression. integerLiteral ::= decimalIntegerLiteral | hexadecimalIntegerLiteral decimalIntegerLiteral ::= decimalDigit+ hexadecimalIntegerLiteral ::= '0x' hexadecimalDigit+ | '0X' hexadecimalDigit+ |
NullLiteral | A null literal expression. nullLiteral ::=
|
StringLiteral' StringLiteral | |
SymbolLiteral [Token] | A symbol literal expression. symbolLiteral ::=
|
data MapLiteralEntry Source #
A single key/value pair in a map literal.
mapLiteralEntry ::=
[Expression] :
[Expression]
data MethodModifier Source #
data NamedCompilationUnitMember Source #
A node that declares a single name within the scope of a compilation unit.
FunctionDeclaration' FunctionDeclaration | |
TypeAlias TypeAlias | |
ClassDeclaration (Maybe Comment) [Annotation] Bool SimpleIdentifier (Maybe TypeParameterList) (Maybe ExtendsClause) (Maybe WithClause) (Maybe ImplementsClause) [ClassMember] | The declaration of a class. classDeclaration ::=
|
EnumDeclaration (Maybe Comment) [Annotation] SimpleIdentifier [EnumConstantDeclaration] | The declaration of an enumeration. enumType ::=
metadata |
data NamespaceDirective Source #
A node that represents a directive that impacts the namespace of a library.
directive ::= [ExportDirective] | [ImportDirective]
ExportDirective (Maybe Comment) [Annotation] StringLiteral [Configuration] [Combinator] | An export directive. exportDirective ::=
[Annotation] |
ImportDirective (Maybe Comment) [Annotation] StringLiteral [Configuration] Bool (Maybe SimpleIdentifier) [Combinator] | An import directive. importDirective ::=
[Annotation] 'import' [StringLiteral] ( |
data NewOrConst Source #
data NormalFormalParameter Source #
A formal parameter that is required (is not optional).
normalFormalParameter ::= [FunctionTypedFormalParameter] | [FieldFormalParameter] | [SimpleFormalParameter]
FunctionTypedFormalParameter (Maybe Comment) [Annotation] (Maybe TypeName) SimpleIdentifier (Maybe TypeParameterList) FormalParameterList | A function-typed formal parameter. functionSignature ::= [TypeName]? [SimpleIdentifier] [TypeParameterList]? [FormalParameterList] |
FieldFormalParameter (Maybe Comment) [Annotation] (Maybe FinalConstVarOrType) Bool SimpleIdentifier | A field formal parameter. fieldFormalParameter ::=
( |
SimpleFormalParameter (Maybe Comment) [Annotation] FinalVarOrType SimpleIdentifier | A simple formal parameter. simpleFormalParameter ::=
( |
data ParameterKind Source #
data PropertyKeyword Source #
newtype SimpleIdentifier Source #
data SingleStringLiteral Source #
A single string literal expression.
singleStringLiteral ::= [SimpleStringLiteral] | [StringInterpolation]
SimpleStringLiteral String | A string literal expression that does not contain any interpolations. simpleStringLiteral ::= rawStringLiteral | basicStringLiteral rawStringLiteral ::=
simpleStringLiteral ::= multiLineStringLiteral | singleLineStringLiteral multiLineStringLiteral ::= "'''" characters "'''" | '"""' characters '"""' singleLineStringLiteral ::= "'" characters "'" | '"' characters '"' |
StringInterpolation [InterpolationElement] | A string interpolation literal. stringInterpolation ::= ''' [InterpolationElement]* ''' | '"' [InterpolationElement]* '"' |
A node that represents a statement.
statement ::= [Block] | [VariableDeclarationStatement] | [ForStatement] | [ForEachStatement] | [WhileStatement] | [DoStatement] | [SwitchStatement] | [IfStatement] | [TryStatement] | [BreakStatement] | [ContinueStatement] | [ReturnStatement] | [ExpressionStatement] | [FunctionDeclarationStatement]
Block' Block | |
VariableDeclarationStatement VariableDeclarationList | A list of variables that are being declared in a context where a statement is required. variableDeclarationStatement ::= [VariableDeclarationList] ';' |
ForStatement (Maybe VariableDeclarationList) (Maybe Expression) (Maybe Expression) [Expression] Statement | A for statement. forStatement ::=
forLoopParts ::= forInitializerStatement ';' [Expression]? ';' [Expression]? forInitializerStatement ::= [DefaultFormalParameter] | [Expression]? |
ForEachStatementWithDeclaration Bool DeclaredIdentifier Expression Statement | A for-each statement. forEachStatement ::=
|
ForEachStatementWithReference Bool SimpleIdentifier Expression Statement | |
WhileStatement Expression Statement | A while statement. whileStatement ::=
|
DoStatement Statement Expression | A do statement. doStatement ::=
'do' [Statement] |
SwitchStatement Expression [SwitchMember] | A switch statement. switchStatement ::=
|
IfStatement Expression Statement (Maybe Statement) | An if statement. ifStatement ::= 'if' '(' [Expression] ')' [Statement] ('else' [Statement])? |
TryStatement Block [CatchClause] (Maybe Block) | A try statement. tryStatement ::=
finallyClause ::=
|
BreakStatement (Maybe SimpleIdentifier) | |
ContinueStatement (Maybe SimpleIdentifier) | A continue statement. continueStatement ::=
|
ReturnStatement (Maybe Expression) | A return statement. returnStatement ::=
|
ExpressionStatement Expression | An expression used as a statement. expressionStatement ::= [Expression]? ';' |
FunctionDeclarationStatement FunctionDeclaration | A [FunctionDeclaration] used as a statement. |
AssertStatement Expression (Maybe Expression) | An assert statement. assertStatement ::=
|
YieldStatement Bool Expression | A yield statement. yieldStatement ::=
|
EmptyStatement | An empty statement. emptyStatement ::= ';' |
LabeledStatement [Label] Statement | A statement that has a label associated with them. labeledStatement ::= [Label]+ [Statement] |
data StringLiteral Source #
SingleStringLiteral' SingleStringLiteral | |
AdjacentStrings [StringLiteral] | Two or more string literals that are implicitly concatenated because of being adjacent (separated only by whitespace). While the grammar only allows adjacent strings when all of the strings are of the same kind (single line or multi-line), this class doesn't enforce that restriction. adjacentStrings ::= [StringLiteral] [StringLiteral]+ |
data SwitchMember Source #
An element within a switch statement.
switchMember ::= switchCase | switchDefault
SwitchDefault [Label] [Statement] | The default case in a switch statement. switchDefault ::=
[SimpleIdentifier]* 'default' |
SwitchCase [Label] Expression [Statement] | A case in a switch statement. switchCase ::=
[SimpleIdentifier]* 'case' [Expression] |
The declaration of a type alias.
typeAlias ::=
typedef
typeAliasBody
typeAliasBody ::= classTypeAlias | functionTypeAlias
ClassTypeAlias (Maybe Comment) [Annotation] SimpleIdentifier (Maybe TypeParameterList) Bool TypeName WithClause (Maybe ImplementsClause) | A class type alias. classTypeAlias ::=
[SimpleIdentifier] [TypeParameterList]? '=' mixinApplication ::= [TypeName] [WithClause] [ImplementsClause]? ';' |
FunctionTypeAlias (Maybe Comment) [Annotation] (Maybe TypeName) SimpleIdentifier (Maybe TypeParameterList) FormalParameterList | A function type alias. functionTypeAlias ::= functionPrefix [TypeParameterList]? [FormalParameterList] ';' functionPrefix ::= [TypeName]? [SimpleIdentifier] |
data TypeArgumentList Source #
data TypedLiteral Source #
A literal that has a type associated with it.
typedLiteral ::= [ListLiteral] | [MapLiteral]
MapLiteral Bool (Maybe TypeArgumentList) [MapLiteralEntry] | A literal map. mapLiteral ::=
|
ListLiteral Bool (Maybe TypeArgumentList) [Expression] | A list literal. listLiteral ::=
|
The name of a type, which can optionally include type arguments.
typeName ::= [Identifier] typeArguments?
data TypeParameter Source #
A type parameter.
typeParameter ::=
[SimpleIdentifier] (extends
[TypeName])?
newtype TypeParameterList Source #
data UriBasedDirective Source #
A directive that references a URI.
uriBasedDirective ::= [ExportDirective] | [ImportDirective] | [PartDirective]
NamespaceDirective NamespaceDirective | |
PartDirective (Maybe Comment) [Annotation] StringLiteral | A part directive. partDirective ::=
[Annotation] |
data VariableDeclaration Source #
An identifier that has an initial value associated with it. Instances of this class are always children of the class [VariableDeclarationList].
variableDeclaration ::= [SimpleIdentifier] ('=' [Expression])?
data VariableDeclarationList Source #
The declaration of one or more variables of the same type.
variableDeclarationList ::= finalConstVarOrType [VariableDeclaration] (',' [VariableDeclaration])*
finalConstVarOrType ::=
| final
[TypeName]?
| const
[TypeName]?
| var
| [TypeName]
newtype WithClause Source #
The with clause in a class declaration.
withClause ::=
with
[TypeName] (',' [TypeName])*