See: Description
Interface | Description |
---|---|
IAccessorDefinition |
A definition representing a
function get or
function set declaration. |
IAppliedVectorDefinition |
A definition representing a specialized vector type.
|
IBindableVariableDefinition |
Marker interface for getter/setter definitions created by variable
declarations that are marked with
[Bindable] metadata. |
IClassDefinition |
A definition representing a
class declaration. |
IClassDefinition.IClassIterator |
This interface represents what the
classIterator method
returns. |
IConstantDefinition |
A definition representing a
const declaration. |
IDefinition |
The base class for all definitions.
|
IDocumentableDefinition |
The base class for definitions which can have ASDoc comments.
|
IEffectDefinition |
Represents effect metadata decorating a class definition,
such as
[Effect(name="rollOverEffect", event="rollOver")] . |
IEventDefinition |
Represents event metadata decorating a class definition,
such as
Event(name="click", type="flash.events.MouseEvent")] . |
IFunctionDefinition |
A definition representing a
function declaration. |
IGetterDefinition |
A definition representing a
function get declaration. |
IInterfaceDefinition |
A definition representing an
interface declaration. |
IMemberedDefinition | |
IMetadataDefinition |
This interface represents definition which are themselves defined by
metadata, such as definitions for events, styles, and effects.
|
INamespaceDefinition |
A definition representing a
namespace declaration. |
INamespaceDefinition.IAnyNamespaceDefinition |
Interface implemented by the any namespace definition.
|
INamespaceDefinition.ICodeModelImplicitDefinitionNamespaceDefinition |
Interface implemented by the code model implicit definition namespace
definition.
|
INamespaceDefinition.IFilePrivateNamespaceDefinition |
Interface implemented by all file private namespace definitions.
|
INamespaceDefinition.IInterfaceNamespaceDefinition |
Interface implemented by all interface namespace definitions.
|
INamespaceDefinition.IInternalNamespaceDefinition |
Interface implemented by all internal namespace definitions.
|
INamespaceDefinition.ILanguageNamespaceDefinition |
Interface implemented by all language namespace definitions.
|
INamespaceDefinition.INamespaceWithPackageName |
Interface implemented by all language namespace definitions associated
with a package.
|
INamespaceDefinition.IPrivateNamespaceDefinition |
Interface implemented by all private namespace definitions.
|
INamespaceDefinition.IProtectedNamespaceDefinition |
Interface implemented by all protected namespace definitions.
|
INamespaceDefinition.IPublicNamespaceDefinition |
Interface implemented by all public namespace definitions.
|
INamespaceDefinition.IStaticProtectedNamespaceDefinition |
Interface implemented by all static protected namespace definitions.
|
IPackageDefinition |
A definition representing a package declaration.
|
IParameterDefinition |
A definition representing a parameter declaration.
|
IQualifiers |
Represents a set of namespaces to be used for name resolution.
|
IScopedDefinition | |
ISetterDefinition |
A definition representing a
function set declaration. |
IStyleDefinition |
Represents style metadata decorating a class definition,
such as
Style(name="color", type="uint", format="color", inherit="yes")] . |
ITypeDefinition |
The base interface for class and interface definitions,
including definitions of vector types.
|
IVariableDefinition |
A definition representing a
var declaration. |
Class | Description |
---|---|
AppliedVectorDefinitionFactory |
A factory for creating
Vector types as they are encountered. |
Enum | Description |
---|---|
IClassDefinition.ClassClassification |
Determines the type of class
|
IFunctionDefinition.FunctionClassification |
Function classifications (local, class member, interface member, and
package member)
|
IInterfaceDefinition.InterfaceClassification |
Determines the type of interface
|
INamespaceDefinition.NamespaceClassification |
Determines the type of namespace
|
IPackageDefinition.PackageKind |
Specifics the kind of package we are dealing with.
|
IVariableDefinition.VariableClassification |
Variable classifications (local, argument, class member, interface
member, and package member)
|
A definition is anything in source code that can be referred to by name: a package, namespace, class, interface, function, getter, setter, parameter, variable, constant, event, style, or effect.
A key part of semantic analysis and code generation consists of determining what each identifier node in an AST refers by resolving it to a definition. This process is called name resolution For example, when you write
for (var i:int = 0; i < n; i++) { trace(i); }the first
i
produces a variable definition named "i".
The second, third, and fourth i
get resolved to this definition.
Most definitions live within scopes. A scope can loosely be thought
of as representing either an entire file (for a file scope)
or a block of code delimited by curly braces (for a package scope,
class scope, interface scope, function/getter/setter scope,
catch scope, or with scope).
Curly braces within some statements, such as those of a for
loop,
do not produce produce scopes, due to the "hoisting" rules of ActionScript.
In addition to being contained in a scope, some definitions contain an inner scope. Therefore a file scope is the root of a hierarchical data structure containing scopes and definitions. (Think of it as the symbol table for the file.) Definitions which are visible to other files are copied into a project scope for cross-file name resolution.
For AS files, the abstract syntax tree is built first and the file scope
is built second. The definitions within the file scope are constructed from
definition nodes (that is, nodes implementing IDefinitionNode
)
in the AST.
For MXML files, a DOM-like representation known as MXMLData
is built first, the file scope is built second, and the abstract syntax tree
is built third.
The definitions within the file scope are constructed from the MXML tags
of the MXMLData
.
After being produced, scopes and definitions that are visible to other files are always resident in memory, so that the other files can perform name resolution. (In fact, they persist even after all other files have performed named resolution, in order to support subsequent incremental compilation.) Scopes and definitions that are internal to a particular file need to exist only when the AST for that file is in memory.
The most important interface in this package is IDefinition
which is the base interface for all definitions.
Each specific type of definition has its own sub-interface:
package | IPackageDefinition |
namespace | INamespaceDefinition |
class | IClassDefinition |
interface | IInterfaceDefinition |
function | IFunctionDefinition |
getter | IGetterDefinition |
setter | ISetterDefinition |
parameter | IParameterDefinition |
variable | IVariableDefinition |
constant | IConstantDefinition |
event | IEventDefinition |
style | IStyleDefinition |
effect | IEffectDefinition |
All definitions have
public
;static
or override
;null
for some types of definitions.
Definitions refer to other definitions indirectly, by name,
using an IReference
. See the references
subpackage for an explanation of this design.
Copyright © 2016 The Apache Software Foundation. All rights reserved.