See: Description
Interface | Description |
---|---|
IASScope |
IASScope represents a scope found within ActionScript. |
IDefinitionSet |
This interface represents an immutable collection of definitions with the
same base name in a particular scope.
|
IFileScope |
Interface implemented by all file scope, which is the root scope for any
source file or SWC script.
|
IFileScopeProvider |
Callback for constructing a
ASFileScope object. |
A scope is a container for definitions.
See the org.apache.flex.compiler.definition
package
for more information about definitions.
A 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.
ActionScript's name resolution algorithm resolves an identifier in a scope to the definition to which it refers. That definition might be in the same scope, an enclosing scope, in the scope of a superclass, or in the project scope.
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.
Copyright © 2016 The Apache Software Foundation. All rights reserved.