analyzer library

Classes

AdjacentStrings
Two or more string literals that are implicitly concatenated because of being adjacent (separated only by whitespace). [...]
AnalysisError
An error discovered during the analysis of some Dart code. [...]
AnalysisErrorListener
An object that listen for AnalysisErrors being produced by the analysis engine.
AnalysisOptionsErrorCode
The error codes used for errors in analysis options files. The convention for this class is for the name of the error code to indicate the problem that caused the error to be generated and for the error message to explain what is wrong and, when appropriate, how the problem can be corrected.
AnalysisOptionsHintCode
AnalysisOptionsWarningCode
The error codes used for warnings in analysis options files. The convention for this class is for the name of the error code to indicate the problem that caused the error to be generated and for the error message to explain what is wrong and, when appropriate, how the problem can be corrected.
AnnotatedNode
An AST node that can be annotated with both a documentation comment and a list of annotations. [...]
Annotation
An annotation that can be associated with an AST node. [...]
ArgumentList
A list of arguments in the invocation of an executable element (that is, a function, method, or constructor). [...]
AsExpression
An as expression. [...]
AssertInitializer
An assert in the initializer list of a constructor. [...]
Assertion
An assertion, either in a block or in the initializer list of a constructor. [...]
AssertStatement
An assert statement. [...]
AssignmentExpression
An assignment expression. [...]
AstCloner
An AST visitor that will clone any AST structure that it visits. The cloner will only clone the structure, it will not preserve any resolution results or properties associated with the nodes.
AstComparator
An AstVisitor that compares the structure of two AstNodes to see whether they are equal.
AstNode
A node in the AST structure for a Dart program. [...]
AstVisitor<R>
An object that can be used to visit an AST structure. [...]
AwaitExpression
An await expression. [...]
BinaryExpression
A binary (infix) expression. [...]
Block
A sequence of statements. [...]
BlockFunctionBody
A function body that consists of a block of statements. [...]
BooleanErrorListener
An AnalysisErrorListener that keeps track of whether any error has been reported to it.
BooleanLiteral
A boolean literal expression. [...]
BreadthFirstVisitor<R>
An AST visitor that will recursively visit all of the nodes in an AST structure, similar to GeneralizingAstVisitor. This visitor uses a breadth-first ordering rather than the depth-first ordering of GeneralizingAstVisitor. [...]
BreakStatement
A break statement. [...]
CascadeExpression
A sequence of cascaded expressions: expressions that share a common target. [...]
CatchClause
A catch clause within a try statement. [...]
CheckedModeCompileTimeErrorCode
The error codes used for compile time errors caused by constant evaluation that would throw an exception when run in checked mode. The client of the analysis engine is responsible for determining how these errors should be presented to the user (for example, a command-line compiler might elect to treat these errors differently depending whether it is compiling it "checked" mode).
ClassDeclaration
The declaration of a class. [...]
ClassMember
A node that declares a name within the scope of a class declarations. [...]
ClassOrMixinDeclaration
The declaration of a class or mixin. [...]
ClassTypeAlias
A class type alias. [...]
CollectionElement
An element in a list, map or set literal. [...]
Combinator
A combinator associated with an import or export directive. [...]
Comment
A comment within the source code. [...]
CommentReference
A reference to a Dart element that is found within a documentation comment. [...]
CompilationUnit
A compilation unit. [...]
CompilationUnitMember
A node that declares one or more names within the scope of a compilation unit. [...]
CompileTimeErrorCode
The error codes used for compile time errors. The convention for this class is for the name of the error code to indicate the problem that caused the error to be generated and for the error message to explain what is wrong and, when appropriate, how the problem can be corrected.
CompileTimeErrorCodeWithUniqueName
ConditionalExpression
A conditional expression. [...]
Configuration
A configuration in either an import or export directive. [...]
ConstantEvaluator
Instances of the class ConstantEvaluator evaluate constant expressions to produce their compile-time value. [...]
ConstructorDeclaration
A constructor declaration. [...]
ConstructorFieldInitializer
The initialization of a field within a constructor's initialization list. [...]
ConstructorInitializer
A node that can occur in the initializer list of a constructor declaration. [...]
ConstructorName
The name of a constructor. [...]
ConstructorReferenceNode
An AST node that makes reference to a constructor. [...]
ContinueStatement
A continue statement. [...]
Declaration
A node that represents the declaration of one or more names. [...]
DeclaredIdentifier
The declaration of a single identifier. [...]
DefaultFormalParameter
A formal parameter with a default value. [...]
DeferredLibraryReferenceDetector
A recursive AST visitor that is used to run over Expressions to determine whether the expression is composed by at least one deferred PrefixedIdentifier. [...]
DelegatingAstVisitor<T>
An AST visitor that will recursively visit all of the nodes in an AST structure. For each node that is visited, the corresponding visit method on one or more other visitors (the 'delegates') will be invoked. [...]
Directive
A node that represents a directive. [...]
DoStatement
A do statement. [...]
DottedName
A dotted name, used in a configuration within an import or export directive. [...]
DoubleLiteral
A floating point literal expression. [...]
EmptyFunctionBody
An empty function body, which can only appear in constructors or abstract methods. [...]
EmptyStatement
An empty statement. [...]
EnumConstantDeclaration
The declaration of an enum constant. [...]
EnumDeclaration
The declaration of an enumeration. [...]
ErrorCode
An error code associated with an AnalysisError. [...]
ErrorReporter
An object used to create analysis errors and report then to an error listener.
ErrorSeverity
The severity of an ErrorCode.
ErrorType
The type of an ErrorCode.
ExceptionHandlingDelegatingAstVisitor<T>
A DelegatingAstVisitor that will additionally catch all exceptions from the delegates without stopping the visiting. A function must be provided that will be invoked for each such exception. [...]
ExportDirective
An export directive. [...]
Expression
A node that represents an expression. [...]
ExpressionFunctionBody
A function body consisting of a single expression. [...]
ExpressionStatement
An expression used as a statement. [...]
ExtendsClause
The "extends" clause in a class declaration. [...]
ExtensionDeclaration
The declaration of an extension of a type. [...]
ExtensionOverride
An override to force resolution to choose a member from a specific extension. [...]
FieldDeclaration
The declaration of one or more fields of the same type. [...]
FieldFormalParameter
A field formal parameter. [...]
ForEachParts
The parts of a for-each loop that control the iteration. [...]
ForEachPartsWithDeclaration
The parts of a for-each loop that control the iteration when the loop variable is declared as part of the for loop. [...]
ForEachPartsWithIdentifier
The parts of a for-each loop that control the iteration when the loop variable is declared outside of the for loop. [...]
ForElement
The basic structure of a for element. [...]
ForLoopParts
The parts of a for or for-each loop that control the iteration. [...]
FormalParameter
A node representing a parameter to a function. [...]
FormalParameterList
The formal parameter list of a method declaration, function declaration, or function type alias. [...]
ForParts
The parts of a for loop that control the iteration. [...]
ForPartsWithDeclarations
The parts of a for loop that control the iteration when there are one or more variable declarations as part of the for loop. [...]
ForPartsWithExpression
The parts of a for loop that control the iteration when there are no variable declarations as part of the for loop. [...]
ForStatement
A for or for-each statement. [...]
FunctionBody
A node representing the body of a function or method. [...]
FunctionDeclaration
A top-level function declaration. [...]
FunctionDeclarationStatement
A FunctionDeclaration used as a statement. [...]
FunctionExpression
A function expression. [...]
FunctionExpressionInvocation
The invocation of a function resulting from evaluating an expression. [...]
FunctionTypeAlias
A function type alias. [...]
FunctionTypedFormalParameter
A function-typed formal parameter. [...]
GeneralizingAstVisitor<R>
An AST visitor that will recursively visit all of the nodes in an AST structure (like instances of the class RecursiveAstVisitor). In addition, when a node of a specific type is visited not only will the visit method for that specific type of node be invoked, but additional methods for the superclasses of that node will also be invoked. For example, using an instance of this class to visit a Block will cause the method visitBlock to be invoked but will also cause the methods visitStatement and visitNode to be subsequently invoked. This allows visitors to be written that visit all statements without needing to override the visit method for each of the specific subclasses of Statement. [...]
GenericFunctionType
An anonymous function type. [...]
GenericTypeAlias
A generic type alias. [...]
HideCombinator
A combinator that restricts the names being imported to those that are not in a given list. [...]
HintCode
The hints and coding recommendations for best practices which are not mentioned in the Dart Language Specification.
HintCodeWithUniqueName
A HintCode class in which a uniqueName can be given which is not just derived from name.
Identifier
A node that represents an identifier. [...]
IfElement
The basic structure of an if element. [...]
IfStatement
An if statement. [...]
ImplementsClause
The "implements" clause in an class declaration. [...]
ImportDirective
An import directive. [...]
IndexExpression
An index expression. [...]
InstanceCreationExpression
An instance creation expression. [...]
IntegerLiteral
An integer literal expression. [...]
InterpolationElement
A node within a StringInterpolation. [...]
InterpolationExpression
An expression embedded in a string interpolation. [...]
InterpolationString
A non-empty substring of an interpolated string. [...]
InvocationExpression
The invocation of a function or method; either a FunctionExpressionInvocation or a MethodInvocation. [...]
IsExpression
An is expression. [...]
Label
A label on either a LabeledStatement or a NamedExpression. [...]
LabeledStatement
A statement that has a label associated with them. [...]
LibraryDirective
A library directive. [...]
LibraryIdentifier
The identifier for a library. [...]
LintCode
Defines style and best practice recommendations. [...]
ListLiteral
A list literal. [...]
Literal
A node that represents a literal expression. [...]
MapLiteralEntry
A single key/value pair in a map literal. [...]
MethodDeclaration
A method declaration. [...]
MethodInvocation
The invocation of either a function or a method. [...]
MethodReferenceExpression
An expression that implicitly makes reference to a method. [...]
MixinDeclaration
The declaration of a mixin. [...]
NamedCompilationUnitMember
A node that declares a single name within the scope of a compilation unit. [...]
NamedExpression
An expression that has a name associated with it. They are used in method invocations when there are named parameters. [...]
NamedType
A named type, which can optionally include type arguments. [...]
NamespaceDirective
A node that represents a directive that impacts the namespace of a library. [...]
NativeClause
The "native" clause in an class declaration. [...]
NativeFunctionBody
A function body that consists of a native keyword followed by a string literal. [...]
NodeList<E extends AstNode>
A list of AST nodes that have a common parent. [...]
NodeLocator
An object used to locate the AstNode associated with a source range, given the AST structure built from the source. More specifically, they will return the AstNode with the shortest length whose source range completely encompasses the specified range.
NodeLocator2
An object used to locate the AstNode associated with a source range. More specifically, they will return the deepest AstNode which completely encompasses the specified range.
NodeReplacer
An object that will replace one child node in an AST node with another node.
NormalFormalParameter
A formal parameter that is required (is not optional). [...]
NullLiteral
A null literal expression. [...]
NullShortableExpression
Abstract interface for expressions that may participate in null-shorting.
OnClause
The "on" clause in a mixin declaration. [...]
ParameterKind
The kind of a parameter. A parameter can be either positional or named, and can be either required or optional.
ParenthesizedExpression
A parenthesized expression. [...]
PartDirective
A part directive. [...]
PartOfDirective
A part-of directive. [...]
PostfixExpression
A postfix unary expression. [...]
PrefixedIdentifier
An identifier that is prefixed or an access to an object property where the target of the property access is a simple identifier. [...]
PrefixExpression
A prefix unary expression. [...]
PropertyAccess
The access of a property of an object. [...]
RecordingErrorListener
An error listener that will record the errors that are reported to it in a way that is appropriate for caching those errors within an analysis context.
RecursiveAstVisitor<R>
An AST visitor that will recursively visit all of the nodes in an AST structure. For example, using an instance of this class to visit a Block will also cause all of the statements in the block to be visited. [...]
RedirectingConstructorInvocation
The invocation of a constructor in the same class from within a constructor's initialization list. [...]
ResolutionCopier
An object that copies resolution information from one AST structure to another as long as the structures of the corresponding children of a pair of nodes are the same.
RethrowExpression
A rethrow expression. [...]
ReturnStatement
A return statement. [...]
ScopedNameFinder
Traverse the AST from initial child node to successive parents, building a collection of local variable and parameter names visible to the initial child node. In case of name shadowing, the first name seen is the most specific one so names are not redefined. [...]
ScriptTag
A script tag that can optionally occur at the beginning of a compilation unit. [...]
SetOrMapLiteral
A set or map literal. [...]
ShowCombinator
A combinator that restricts the names being imported to those in a given list. [...]
SimpleAstVisitor<R>
An AST visitor that will do nothing when visiting an AST node. It is intended to be a superclass for classes that use the visitor pattern primarily as a dispatch mechanism (and hence don't need to recursively visit a whole structure) and that only need to visit a small number of node types. [...]
SimpleFormalParameter
A simple formal parameter. [...]
SimpleIdentifier
A simple identifier. [...]
SimpleStringLiteral
A string literal expression that does not contain any interpolations. [...]
SingleStringLiteral
A single string literal expression. [...]
SpreadElement
A spread element. [...]
Statement
A node that represents a statement. [...]
StaticTypeWarningCode
The error codes used for static type warnings. The convention for this class is for the name of the error code to indicate the problem that caused the error to be generated and for the error message to explain what is wrong and, when appropriate, how the problem can be corrected.
StaticTypeWarningCodeWithUniqueName
StaticWarningCode
The error codes used for static warnings. The convention for this class is for the name of the error code to indicate the problem that caused the error to be generated and for the error message to explain what is wrong and, when appropriate, how the problem can be corrected.
StaticWarningCodeWithUniqueName
StringInterpolation
A string interpolation literal. [...]
StringLiteral
A string literal expression. [...]
StrongModeCode
This class has Strong Mode specific error codes. [...]
SuperConstructorInvocation
The invocation of a superclass' constructor from within a constructor's initialization list. [...]
SuperExpression
A super expression. [...]
SwitchCase
A case in a switch statement. [...]
SwitchDefault
The default case in a switch statement. [...]
SwitchMember
An element within a switch statement. [...]
SwitchStatement
A switch statement. [...]
SymbolLiteral
A symbol literal expression. [...]
ThisExpression
A this expression. [...]
ThrowExpression
A throw expression. [...]
ThrowingAstVisitor<R>
An AST visitor that will throw an exception if any of the visit methods that are invoked have not been overridden. It is intended to be a superclass for classes that implement the visitor pattern and need to (a) override all of the visit methods or (b) need to override a subset of the visit method and want to catch when any other visit methods have been invoked. [...]
TimedAstVisitor<T>
An AST visitor that captures visit call timings. [...]
TodoCode
The error code indicating a marker in code for work that needs to be finished or revisited.
TopLevelVariableDeclaration
The declaration of one or more top-level variables of the same type. [...]
ToSourceVisitor2
A visitor used to write a source representation of a visited AST node (and all of it's children) to a sink.
TryStatement
A try statement. [...]
TypeAlias
The declaration of a type alias. [...]
TypeAnnotation
A type annotation. [...]
TypeArgumentList
A list of type arguments. [...]
TypedLiteral
A literal that has a type associated with it. [...]
TypeName
The name of a type, which can optionally include type arguments. [...]
TypeParameter
A type parameter. [...]
TypeParameterList
Type parameters within a declaration. [...]
UnifyingAstVisitor<R>
An AST visitor that will recursively visit all of the nodes in an AST structure (like instances of the class RecursiveAstVisitor). In addition, every node will also be visited by using a single unified visitNode method. [...]
UriBasedDirective
A directive that references a URI. [...]
VariableDeclaration
An identifier that has an initial value associated with it. [...]
VariableDeclarationList
The declaration of one or more variables of the same type. [...]
VariableDeclarationStatement
A list of variables that are being declared in a context where a statement is required. [...]
WhileStatement
A while statement. [...]
WithClause
The with clause in a class declaration. [...]
YieldStatement
A yield statement. [...]

Constants

errorCodeValues → const List<ErrorCode>
const [AnalysisOptionsErrorCode.PARSE_ERROR, AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR, AnalysisOptionsWarningCode.ANALYSIS_OPTION_DEPRECATED, AnalysisOptionsWarningCode.INCLUDE_FILE_NOT_FOUN…

Functions

errorCodeByUniqueName(String uniqueName) ErrorCode
Return the ErrorCode with the given uniqueName, or null if not found.
parseCompilationUnit(String contents, { String name, bool suppressErrors: false, bool parseFunctionBodies: true, FeatureSet featureSet }) CompilationUnit
Parses a string of Dart code into an AST. [...]
@Deprecated('Please use parseString instead')
parseDartFile(String path, { bool suppressErrors: false, bool parseFunctionBodies: true, FeatureSet featureSet }) CompilationUnit
Parses a Dart file into an AST. [...]
@Deprecated('Please use parseFile2 instead')
parseDirectives(String contents, { String name, bool suppressErrors: false, FeatureSet featureSet }) CompilationUnit
Parses the script tag and directives in a string of Dart code into an AST. (Currently broken; the entire file is parsed). [...]
@Deprecated('Please use parseString instead')
resolveRelativeUri(Uri baseUri Uri containedUri) → Uri
Resolve the containedUri against baseUri using Dart rules. [...]
setElementDocumentationComment(ElementImpl element, AnnotatedNode node) → void
If the given node has a documentation comment, remember its content and range into the given element.
startsWith(Uri uri1 Uri uri2) → bool
Check whether uri1 starts with (or 'is prefixed by') uri2 by checking path segments.
stringLiteralToString(StringLiteral literal) → String
Converts an AST node representing a string literal into a String.
@Deprecated('Please use StringLiteral.stringValue instead')

Typedefs

ExceptionInDelegateHandler(AstNode node, AstVisitor visitor, dynamic exception, StackTrace stackTrace) → void
A function used to handle exceptions that are thrown by delegates while using an ExceptionHandlingDelegatingAstVisitor.

Exceptions / Errors

AnalyzerError
A wrapper around AnalysisError that provides a more user-friendly string representation.
AnalyzerErrorGroup
An error class that collects multiple AnalyzerErrors that are emitted during a single analysis.