flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject [23/51] [partial] - Migrated the directory structure to a more Maven style structure. - Started migrating the Parser from Antlr2+3 and JFlex to Antlr4.
Date Tue, 22 Jul 2014 13:35:49 GMT
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/IFunctionDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/IFunctionDefinition.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/IFunctionDefinition.java
new file mode 100644
index 0000000..2dabe15
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/IFunctionDefinition.java
@@ -0,0 +1,208 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+import org.apache.flex.compiler.definitions.references.IReference;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+
+/**
+ * A definition representing a <code>function</code> declaration.
+ * <p>
+ * An <code>IFunctionDefinition</code is created from an <code>IFunctionNode</code>.
+ * <p>
+ * For example, the function declaration
+ * <pre>public function f(i:int):int;</pre>
+ * creates a function definition whose base name is <code>"f"</code>,
+ * whose namespace reference is to the <code>public</code> namespace,
+ * and whose type reference is named <code>"Function"</code>.
+ * It has an <code>IReference</code> named <code>"int"</code>
+ * representing its return type.
+ * It also owns one parameter definition named <code>"i"</code>.
+ * <p>
+ * A function definition is contained within a file scope, a package scope,
+ * a class scope, an interface scope, or a function scope;
+ * it contains a function scope.
+ */
+public interface IFunctionDefinition extends IScopedDefinition
+{
+    /**
+     * Function classifications (local, class member, interface member, and
+     * package member)
+     */
+    static enum FunctionClassification
+    {
+        /**
+         * Local function contained with a non-visible scope
+         */
+        LOCAL,
+        
+        /**
+         * A function that is a member of a class
+         */
+        CLASS_MEMBER,
+        
+        /**
+         * A function that is a member of a interface
+         */
+        INTERFACE_MEMBER,
+        
+        /**
+         * A function that is a member of a package
+         */
+        PACKAGE_MEMBER,
+        
+        /**
+         * A function that is a member of a file
+         */
+        FILE_MEMBER
+    }
+
+    /**
+     * Get the classification for this function (local, argument, class member,
+     * etc)
+     * 
+     * @return function classification
+     */
+    FunctionClassification getFunctionClassification();
+
+    /**
+     * Get the parameters of this function as an array of
+     * {@link IParameterDefinition} elements
+     * 
+     * @return the parameters of this function
+     */
+    IParameterDefinition[] getParameters();
+
+    /**
+     * Returns <code>true</code> if the function has required parameters.
+     */
+    boolean hasRequiredParameters();
+    
+    /**
+     * Gets a reference to the return type for this function.
+     * <p>
+     * For example, for the function <code>private function f(i:int):String</code>,
+     * this is a reference to the <code>String</code> class.
+     * 
+     * @return An {@link IReference} to a class or interface.
+     */
+    IReference getReturnTypeReference();
+
+    /**
+     * Resolve this function's return type in the given scope and find its
+     * definition
+     * 
+     * @param project the {@link ICompilerProject} in which to resolve
+     * references
+     * @return an {@link ITypeDefinition} representing this function's return
+     * type, or null
+     */
+    ITypeDefinition resolveReturnType(ICompilerProject project);
+
+    /**
+     * Converts this definition's {@link IReference} for its return type
+     * to a human-readable String.
+     * <p>
+     * If the definition does not have a return type reference,
+     * this method returns the empty string.
+     * <p>
+     * This method should only be used for displaying return types in problems,
+     * and not for making semantic decisions.
+     * <p>
+     * Note: 
+     * 
+     * @return The result of calling {@link IReference#getDisplayString}()
+     * on the {@link IReference} representing this definition's return type.
+     */
+    // TODO Builder is currently using this functionality in inconsistent ways;
+    // sometimes it interprets empty string to as <code>void</code> and sometimes as <code>*</code>.
+    String getReturnTypeAsDisplayString();
+
+    /**
+     * Is this a constructor?
+     * 
+     * @return true if the member is a constructor
+     */
+    boolean isConstructor();
+
+    /**
+     * Is this a cast function?
+     * 
+     * @return true if the member is a cast function
+     */
+    boolean isCastFunction();
+
+    /**
+     * Is this function marked as <code>inline</code>?
+     * 
+     * @return <code>true</code> if the function is <code>inline</code>.
+     */
+    boolean isInline();
+
+    /**
+     * Can this function be inlined
+     * 
+     * @return true if function can be inlined
+     */
+    boolean inlineFunction();
+
+    /**
+     * Is this function actually overriding a function in a base class
+     * 
+     * @return true if overriding Note that for valid code, isOverride and
+     * overridesAncestor are the same, but overridesAncestor can return true
+     * even if the override keyword is missing. Conversely, isOverride can
+     * return true, even if there is no matching function in a parent interface
+     */
+    boolean overridesAncestor(ICompilerProject project);
+
+    /**
+     * Finds the definition of the IFunctionDefinition that we are overriding
+     * 
+     * @return an {@link IFunctionDefinition} or null
+     */
+    IFunctionDefinition resolveOverriddenFunction(ICompilerProject project);
+
+    /**
+     * Determines whether this function is an implementation of a function from
+     * an implements Interface
+     * 
+     * @return true if this is an implementation
+     */
+    boolean isImplementation(ICompilerProject project);
+
+    /**
+     * Finds the definition of the IFunctionDefinition that defines this
+     * function
+     * 
+     * @return the parent {@link IFunctionDefinition} or null
+     */
+    IFunctionDefinition resolveImplementedFunction(ICompilerProject project);
+
+    /**
+     * Returns the {@link IFunctionNode} from which this definition was created,
+     * if the definition came from the AST for a source file.
+     * <p>
+     * This method may require the AST to be reloaded or regenerated and
+     * therefore may be slow.
+     */
+    IFunctionNode getFunctionNode();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/IGetterDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/IGetterDefinition.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/IGetterDefinition.java
new file mode 100644
index 0000000..58847a3
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/IGetterDefinition.java
@@ -0,0 +1,43 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+import org.apache.flex.compiler.projects.ICompilerProject;
+
+/**
+ * A definition representing a <code>function get</code> declaration.
+ * <p>
+ * An <code>IGetterDefinition</code is created from an <code>IGetterNode</code>.
+ * <p>
+ * For example, the declaration
+ * <pre>public function get width():Number;</pre>
+ * creates a getter definition whose base name is <code>"width"</code>,
+ * whose namespace reference is to the <code>public</code> namespace,
+ * whose type reference is named <code>"Number"</code>,
+ * and whose return type reference is named <code>"Number"</code>.
+ * <p>
+ * A getter definition is contained within a file scope, a package scope,
+ * a class scope, an interface scope, or a function scope;
+ * it contains a function scope.
+ */
+public interface IGetterDefinition extends IAccessorDefinition
+{
+    ISetterDefinition resolveSetter(ICompilerProject project);
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/IInterfaceDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/IInterfaceDefinition.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/IInterfaceDefinition.java
new file mode 100644
index 0000000..0380b7a
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/IInterfaceDefinition.java
@@ -0,0 +1,111 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+import java.util.Iterator;
+
+import org.apache.flex.compiler.definitions.references.IReference;
+import org.apache.flex.compiler.projects.ICompilerProject;
+
+/**
+ * A definition representing an <code>interface</code> declaration.
+ * <p>
+ * An <code>IInterfaceDefinition</code is created from an <code>IInterfaceNode</code>.
+ * <p>
+ * For example, the interface declaration
+ * <pre>
+ * public class I2 extends I1
+ * {
+ * }</pre>
+ * creates an interface definition whose base name is <code>"I2"</code>,
+ * whose namespace reference is to the <code>public</code> namespace,
+ * and whose type reference is <code>null</code>.
+ * It has an <code>IReference</code> named "I1" to the interface that it extends.
+ * <p>
+ * An interface definition is contained within a file scope or a package scope,
+ * and contains an interface scope.
+ * The members of the interface are represented by definitions in the interface scope.
+ */
+public interface IInterfaceDefinition extends ITypeDefinition
+{
+    /**
+     * Determines the type of interface
+     */
+    static enum InterfaceClassification
+    {
+        /**
+         * An interface contained with a package
+         */
+        PACKAGE_MEMBER,
+
+        /**
+         * An interface contained within a file, outside a package
+         */
+        FILE_MEMBER
+    }
+
+    /**
+     * Returns the classification of this ActionScript interface
+     * 
+     * @return the {@link InterfaceClassification}
+     */
+    InterfaceClassification getInterfaceClassification();
+
+    /**
+     * Returns {@link IReference} objects that will resolve to any interface this
+     * interface directly extends. This does not walk of the inheritance chain.
+     * 
+     * @return An array of interface {@link IReference} objects, or an empty array.
+     */
+    IReference[] getExtendedInterfaceReferences();
+
+    /**
+     * Get the definitions of the extended interfaces. This does not walk up the
+     * inheritance chain, rather only looks at what is directly defined on the
+     * interface.
+     * 
+     * @return implemented interface definitions
+     */
+    IInterfaceDefinition[] resolveExtendedInterfaces(ICompilerProject project);
+
+    /**
+     * Returns the names of any interfaces that this interface
+     * directly references. This does not walk up the inheritance chain, rather
+     * only looks at what is directly defined on the interface
+     * 
+     * @return An array of interface names, or an empty array.
+     */
+    String[] getExtendedInterfacesAsDisplayStrings();
+
+    /**
+     * Creates an iterator for enumerating all of the interfaces that this class
+     * implements. The enumeration includes not just the interfaces that the
+     * class directly implements, but the ones that they extend, and the ones
+     * those extend, etc.
+     * 
+     * @param project The {@link ICompilerProject} within which references
+     * should be resolved
+     * @param includeThis A flag indicating whether the enumeration should start
+     * with this interface rather with than its first superinterface.
+     * @return An iterator that iterates over {@code IInterfaceDefinition}
+     * objects.
+     */
+    Iterator<IInterfaceDefinition> interfaceIterator(ICompilerProject project, boolean includeThis);
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/IMemberedDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/IMemberedDefinition.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/IMemberedDefinition.java
new file mode 100644
index 0000000..4bb9a76
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/IMemberedDefinition.java
@@ -0,0 +1,24 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+public interface IMemberedDefinition extends IScopedDefinition
+{
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/IMetadataDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/IMetadataDefinition.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/IMetadataDefinition.java
new file mode 100644
index 0000000..6b47351
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/IMetadataDefinition.java
@@ -0,0 +1,58 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+/**
+ * This interface represents definition which are themselves defined by
+ * metadata, such as definitions for events, styles, and effects.
+ */
+public interface IMetadataDefinition extends IDocumentableDefinition
+{
+    /**
+     * Gets the definition that this metadata is decorating.
+     * 
+     * @return An {@code IDefinition} object.
+     */
+    IDefinition getDecoratedDefinition();
+
+    /**
+     * Gets the value of the <code>deprecatedSince</code> attribute.
+     * 
+     * @return The attribute value as a String, or <code>null</code> if there is
+     * no such attribute.
+     */
+    String getDeprecatedSince();
+
+    /**
+     * Gets the value of the <code>deprecatedReplacement</code> attribute.
+     * 
+     * @return The attribute value as a String, or <code>null</code> if there is
+     * no such attribute.
+     */
+    String getDeprecatedReplacement();
+
+    /**
+     * Gets the value of the <code>deprecatedMessage</code> attribute.
+     * 
+     * @return The attribute value as a String, or <code>null</code> if there is
+     * no such attribute.
+     */
+    String getDeprecatedMessage();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/INamespaceDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/INamespaceDefinition.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/INamespaceDefinition.java
new file mode 100644
index 0000000..0a84854
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/INamespaceDefinition.java
@@ -0,0 +1,228 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+import org.apache.flex.compiler.definitions.references.INamespaceReference;
+import org.apache.flex.compiler.tree.as.INamespaceNode;
+
+/**
+ * A definition representing a <code>namespace</code> declaration.
+ * <p>
+ * An <code>INamespaceDefinition</code is created from an <code>INamespaceNode</code>.
+ * <p>
+ * For example, the declaration
+ * <pre>public namespace ns = "http://whatever";</pre>
+ * creates a namespace definition whose base name is <code>"ns"</code>,
+ * whose namespace reference is to the <code>public</code> namespace,
+ * and whose type reference is <code>null</code>.
+ * <p>
+ * A user-defined namespace definition is contained within a file scope,
+ * a package scope, a class scope, an interface scope, or a function scope;
+ * it does not contain a scope.
+ * <p>
+ * There are also builtin namespace definitions for <code>public</code>,
+ * <code>protected</code>, <code>private</code>, and <code>internal</code>
+ * namespaces.
+ * <p>
+ * <code>NamespaceDefinition.getPublicNamespaceDefinition()</code>
+ * is the singleton <code>IPublicNamespaceDefinition</code> representing
+ * the <code>public</code> namespace.
+ * All files share the same public namespace.
+ * <p>
+ * <code>NamespaceDefinition.createPrivateNamespaceDefinition()</code>
+ * returns an <code>IPrivateNamespaceDefinition</code> representing
+ * the <code>private</code> namespace for a particular file.
+ * Different files have different private namespaces.
+ * <p>
+ * <code>NamespaceDefinition.createProtectedNamespaceDefinition()</code>
+ * returns an <code>IProtectedNamespaceDefinition</code> representing
+ * the <code>protected</code> namespace for a particular file.
+ * Different fiels have different protected namespaces.
+ * <p>
+ * <code>NamespaceDefinition.createInternalNamespaceDefinition</code>
+ * returns an <code>IInternalNamespaceDefinition</code> representing
+ * the <code>internal</code> naemspace for a particular package.
+ * Different packages have different internal namespaces.
+ */
+public interface INamespaceDefinition extends IDocumentableDefinition, IQualifiers
+{
+    /**
+     * Determines the type of namespace
+     */
+    static enum NamespaceClassification
+    {
+        /**
+         * Local namespace contained with a non-visible scope
+         */
+        LOCAL,
+
+        /**
+         * A namespace that is a member of a package
+         */
+        PACKAGE_MEMBER,
+
+        /**
+         * A namespace that is a member of a class
+         */
+        CLASS_MEMBER,
+
+        /**
+         * A namespace that is a member of a file
+         */
+        FILE_MEMBER,
+
+        /**
+         * A namespace that is part of the ActionScript language: public,
+         * private, protected, internal
+         */
+        LANGUAGE
+    }
+    
+    /**
+     * Get the classification for this namespace (local, package level, etc,
+     * etc)
+     * 
+     * @return a {@link NamespaceClassification}
+     */
+    NamespaceClassification getNamespaceClassification();
+
+    /**
+     * Returns the optional URI associated with this namespace
+     * 
+     * @return the URI or an empty string
+     */
+    String getURI();
+
+    /**
+     * Returns the {@link INamespaceNode} from which this definition was
+     * created, if the definition came from the AST for a source file.
+     * <p>
+     * This method may require the AST to be reloaded or regenerated and
+     * therefore may be slow.
+     */
+    @Override
+    INamespaceNode getNode();
+
+    /**
+     * @param namespace
+     * @return true if namespace and this resolve to the same URI This method is
+     * a much better way of comparing namespaces than comparing them by name
+     * (which should never be done).
+     */
+    boolean equals(INamespaceDefinition namespace);
+
+    boolean isPublicOrInternalNamespace();
+    
+    /**
+     * Interface implemented by all language namespace definitions.
+     */
+    interface ILanguageNamespaceDefinition extends INamespaceReference, INamespaceDefinition
+    {
+    }
+
+    /**
+     * Interface implemented by all language namespace definitions associated
+     * with a package.
+     */
+    interface INamespaceWithPackageName extends ILanguageNamespaceDefinition
+    {
+        /**
+         * Retrieves the string that should be used as the prefix for URI's in
+         * generated protected and static protected namespace definitions in
+         * classes.
+         * 
+         * @return The prefix for URI's of generated namespace definition's.
+         */
+        String getGeneratedURIPrefix();
+
+        /**
+         * Retrieves the package name associated with this namespace.
+         * 
+         * @return the package name associated with this namespace.
+         */
+        String getNamespacePackageName();
+    }
+
+    /**
+     * Interface implemented by all public namespace definitions.
+     */
+    interface IPublicNamespaceDefinition extends INamespaceWithPackageName
+    {
+    }
+
+    /**
+     * Interface implemented by all internal namespace definitions.
+     */
+    interface IInternalNamespaceDefinition extends INamespaceWithPackageName
+    {
+    }
+
+    /**
+     * Interface implemented by the code model implicit definition namespace
+     * definition.
+     */
+    interface ICodeModelImplicitDefinitionNamespaceDefinition extends ILanguageNamespaceDefinition
+    {
+    }
+
+    /**
+     * Interface implemented by all protected namespace definitions.
+     */
+    interface IProtectedNamespaceDefinition extends ILanguageNamespaceDefinition
+    {
+    }
+
+    /**
+     * Interface implemented by all static protected namespace definitions.
+     */
+    interface IStaticProtectedNamespaceDefinition extends ILanguageNamespaceDefinition
+    {
+    }
+
+    /**
+     * Interface implemented by all private namespace definitions.
+     */
+    interface IPrivateNamespaceDefinition extends ILanguageNamespaceDefinition
+    {
+    }
+
+    /**
+     * Interface implemented by the any namespace definition.
+     */
+    interface IAnyNamespaceDefinition extends ILanguageNamespaceDefinition
+    {
+    }
+
+    /**
+     * Interface implemented by all file private namespace definitions. The
+     * distinction between file private namespaces and regular private
+     * namespaces is purely for the benefit of code model clients.
+     */
+    interface IFilePrivateNamespaceDefinition extends IPrivateNamespaceDefinition, INamespaceWithPackageName
+    {
+    }
+
+    /**
+     * Interface implemented by all interface namespace definitions.
+     */
+    interface IInterfaceNamespaceDefinition extends ILanguageNamespaceDefinition
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/IPackageDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/IPackageDefinition.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/IPackageDefinition.java
new file mode 100644
index 0000000..c698e71
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/IPackageDefinition.java
@@ -0,0 +1,74 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+import org.apache.flex.compiler.tree.as.IPackageNode;
+
+/**
+ * A definition representing a package declaration.
+ * <p>
+ * An <code>IPackageDefinition</code is created from an <code>IPackageNode</code>.
+ * <p>
+ * For example, the declaration
+ * <pre>package flash.display
+ * {
+ * }</pre>
+ * creates a package definition whose base name is <code>"display"</code>,
+ * whose namespace reference is to the <code>public</code> namespace,
+ * and whose type reference is <code>null</code>.
+ */
+public interface IPackageDefinition extends IMemberedDefinition
+{
+    /**
+     * Specifics the kind of package we are dealing with. Concrete packages are
+     * those found explicitly in source, while virtual packages are runtime
+     * approximations of packages, spanning multiple files
+     */
+    enum PackageKind
+    {
+        /**
+         * Virtual packages are runtime approximations of packages, spanning
+         * multiple files
+         */
+        VIRTUAL,
+
+        /**
+         * Concrete packages are those found explicitly in source
+         */
+        CONCRETE
+    }
+
+    /**
+     * Returns the kind of package that this node represents
+     * 
+     * @return a {@link PackageKind}
+     */
+    PackageKind getPackageKind();
+
+    /**
+     * Returns the {@link IPackageNode} from which this definition was created,
+     * if the definition came from the AST for a source file.
+     * <p>
+     * This method may require the AST to be reloaded or regenerated and
+     * therefore may be slow.
+     */
+    @Override
+    IPackageNode getNode();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/IParameterDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/IParameterDefinition.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/IParameterDefinition.java
new file mode 100644
index 0000000..b09e8f2
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/IParameterDefinition.java
@@ -0,0 +1,71 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+
+/**
+ * A definition representing a parameter declaration.
+ * <p>
+ * An <code>IParameterDefinition</code> is created from an <code>IParameterNode</code>.
+ * <p>
+ * For example, the function declaration
+ * <pre>public function f(i:int):void;</pre>
+ * creates one parameter definition whose base name is <code>"i"</code>,
+ * whose namespace reference is to the <code>public</code> namespace,
+ * and whose type reference is named <code>"int"</code>.
+ */
+public interface IParameterDefinition extends IVariableDefinition
+{
+    /**
+     * Returns true if this argument is a rest-style argument, signified by ...
+     * 
+     * @return true if we are a restful argument
+     */
+    boolean isRest();
+
+    boolean hasDefaultValue();
+
+    /**
+     * Attempt to resolve the default value assigned to this parameter. This may
+     * cause the AST for the definition to get reloaded, so could be slow.
+     * 
+     * @param project the Project to resolve things in
+     * @return The constant value of the default value, if one can be
+     * determined, or null if it can't be determined. This will be a String,
+     * int, double, boolean, or Namespace depending on what the initial value
+     * was. The value could also be
+     * org.apache.flex.abc.ABCConstants.UNDEFINED_VALUE if the initial
+     * value was the undefined constant value Callers will need to use
+     * instanceof to see what type the value is.
+     */
+    Object resolveDefaultValue(ICompilerProject project);
+
+    /**
+     * Returns the {@link IParameterNode} from which this definition was
+     * created, if the definition came from the AST for a source file.
+     * <p>
+     * This method may require the AST to be reloaded or regenerated and
+     * therefore may be slow.
+     */
+    @Override
+    IParameterNode getNode();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/IQualifiers.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/IQualifiers.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/IQualifiers.java
new file mode 100644
index 0000000..5b15fb2
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/IQualifiers.java
@@ -0,0 +1,58 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+import java.util.Set;
+
+/**
+ * Represents a set of namespaces to be used for name resolution.
+ * <p>
+ * This interface makes it easy to pass around one or more qualifiers
+ * between the name resolution methods without having to have methods
+ * with various signatures.
+ */
+public interface IQualifiers
+{
+    /**
+     * Gets the number of namespaces in the set. This will often be 1.
+     * 
+     * @return The number of namespaces.
+     */
+    int getNamespaceCount();
+
+    /**
+     * Gets the set of namespaces.
+     * 
+     * @return A set of namespace definitions.
+     */
+    Set<INamespaceDefinition> getNamespaceSet();
+
+    /**
+     * Get the first namespace.
+     * <p>
+     * This is an optimization to avoid the frequent construction
+     * of temporary sets, since often an <code>IQualifiers</code>
+     * will only have one namespace in it.
+     * 
+     * @return The first namespace definition in this object,
+     * for use when the namespace set contains only one namespace.
+     */
+    INamespaceDefinition getFirst();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/IScopedDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/IScopedDefinition.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/IScopedDefinition.java
new file mode 100644
index 0000000..629699a
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/IScopedDefinition.java
@@ -0,0 +1,33 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+import org.apache.flex.compiler.scopes.IASScope;
+
+public interface IScopedDefinition extends IDocumentableDefinition
+{
+    /**
+     * Returns the scope that is contained within this definition. The scope
+     * will contain all the children of this definition
+     * 
+     * @return the scope within this {@link IScopedDefinition}
+     */
+    IASScope getContainedScope();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/ISetterDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/ISetterDefinition.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/ISetterDefinition.java
new file mode 100644
index 0000000..665fc59
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/ISetterDefinition.java
@@ -0,0 +1,44 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+import org.apache.flex.compiler.projects.ICompilerProject;
+
+/**
+ * A definition representing a <code>function set</code> declaration.
+ * <p>
+ * An <code>ISetterDefinition</code is created from an <code>ISetterNode</code>.
+ * <p>
+ * For example, the declaration
+ * <pre>public function set width(value:Number):void;</pre>
+ * creates a setter definition whose base name is <code>"width"</code>,
+ * whose namespace reference is to the <code>public</code> namespace,
+ * whose type reference is named <code>"Number"</code>,
+ * and whose return type reference is named <code>"void"</code>.
+ * It also owns one parameter definition named <code>"value"</code>.
+ * <p>
+ * A setter definition is contained within a file scope, a package scope,
+ * a class scope, an interface scope, or a function scope;
+ * it contains a function scope.
+ */
+public interface ISetterDefinition extends IAccessorDefinition
+{
+    IGetterDefinition resolveGetter(ICompilerProject project);
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/IStyleDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/IStyleDefinition.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/IStyleDefinition.java
new file mode 100644
index 0000000..211b1f8
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/IStyleDefinition.java
@@ -0,0 +1,161 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.metadata.IStyleTagNode;
+
+/**
+ * Represents style metadata decorating a class definition,
+ * such as <code>Style(name="color", type="uint", format="color", inherit="yes")]</code>.
+ * <p>
+ * Use {@link #getBaseName}() to get the style's name (e.g., <code>"color"</code>.
+ */
+public interface IStyleDefinition extends IMetadataDefinition
+{
+    /**
+     * Returns the {@link IStyleTagNode} from which this definition was created,
+     * if the definition came from the AST for a source file.
+     * <p>
+     * This method may require the AST to be reloaded or regenerated and
+     * therefore may be slow.
+     */
+    @Override
+    IStyleTagNode getNode();
+
+    /**
+     * Gets the value of this style's <code>arrayType</code> attribute.
+     * <p>
+     * When the <code>type</code> attribute is <code>"Array</code>,
+     * the <code>arrayType</code> attribute specifies the type
+     * of the array elements.
+     * 
+     * @return The value of the <code>arrayType</code> attribute as a String,
+     * or <code>null</code>.
+     */
+    String getArrayType();
+
+    /**
+     * Resolves the type specified by the <code>arrayType</code> attribute
+     * to a class or interface definitions.
+     * <p>
+     * When the value of the <code>type</code> attribute is <code>"Array"</code>,
+     * the <code>arrayType</code> attribute specifies the type
+     * of the array elements.
+     * 
+     * @param project The {@link ICompilerProject} within which references
+     * should be resolved.
+     * @return An {@link ITypeDefinition} for the resolved array type,
+     * or <code>null</code>.
+     */
+    ITypeDefinition resolveArrayType(ICompilerProject project);
+
+    /**
+     * Gets the possible values of this style, as specified by
+     * its <code>enumeration</code> attribute.
+     * <p>
+     * When the value of the <code>type</code> attribute is <code>"String"</code>,
+     * the <code>enumeration</code> attribute specifies the allowed String values.
+     * 
+     * @return The comma-separated values in the <code>enumeration</code>
+     * attribute as an array of Strings, or an empty array.
+     */
+    String[] getEnumeration();
+
+    /**
+     * Gets the value of this style's <code>format</code> attribute.
+     * 
+     * @return The value of the <code>format</code> attribute as a String,
+     * or <code>null</code>.
+     */
+    String getFormat();
+
+    /**
+     * Determines whether this style represents a color.
+     * 
+     * @return <code>true</code> if the value of the <code>format</code>
+     * attribute is <code>"Color"</code>.
+     */
+    boolean isColor();
+
+    /**
+     * Gets the value of this style's <code>inherit</code> attribute.
+     * 
+     * @return The value of the <code>inherit</code> attribute as a String,
+     * or <code>null</code>.
+     */
+    String getInherit();
+    
+    /**
+     * Determines whether this style is inheriting.
+     * 
+     * @return <code>true</code> if the value of the <code>inherit</code>
+     * attribute is <code>"yes"</code>.
+     */
+    boolean isInheriting();
+
+    /**
+     * Gets the value of this style's <code>states</code> attribute.
+     * 
+     * @return The comma-separated values in the <code>states</code> attribute
+     * as an array of Strings, or an empty array.
+     */
+    String[] getStates();
+
+    /**
+     * Gets the value of this style's <code>themes</code> attribute.
+     * 
+     * @return The comma-separated values in the <code>themes</code> attribute
+     * as an array of Strings, or an empty array.
+     */
+    String[] getThemes();
+
+    /**
+     * Gets the value of this style's <code>minValue</code> attribute.
+     * 
+     * @return The value of the <code>minValue</code> attribute as a String,
+     * or <code>null</code>.
+     */
+    String getMinValue();
+
+    /**
+     * Gets the value of this style's <code>minValueExclusive</code> attribute.
+     * 
+     * @return The value of the <code>minValueExclusive</code> attribute as a String,
+     * or <code>null</code>.
+     */
+    String getMinValueExclusive();
+
+    /**
+     * Gets the value of this style's <code>maxValue</code> attribute.
+     * 
+     * @return The value of the <code>maxValue</code> attribute as a String,
+     * or <code>null</code>.
+     */
+    String getMaxValue();
+
+    /**
+     * Gets the value of this style's <code>maxValueExclusive</code> attribute.
+     * 
+     * @return The value of the <code>maxValueExclusive</code> attribute as a String,
+     * or <code>null</code>.
+     */
+    String getMaxValueExclusive();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/ITypeDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/ITypeDefinition.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/ITypeDefinition.java
new file mode 100644
index 0000000..9eb74c2
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/ITypeDefinition.java
@@ -0,0 +1,141 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+import java.util.Set;
+
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.as.ITypeNode;
+
+/**
+ * The base interface for class and interface definitions,
+ * including definitions of vector types.
+ */
+public interface ITypeDefinition extends IMemberedDefinition
+{
+    /**
+     * Determines whether an "is-a" relationship exists between two classes or
+     * interfaces.
+     * <p>
+     * If <code>this</code> is an {@code IClassDefinition} and <code>type</code>
+     * is an {@code IClassDefinition}, this method determines whether
+     * <code>this</code> is a subclass of <code>type</code>.
+     * <p>
+     * If <code>this</code> is an {@code IClassDefinition} and <code>type</code>
+     * is an {@code IInterfaceDefinition}, this method determines whether
+     * <code>this</code> is implements <code>type</code>.
+     * <p>
+     * If <code>this</code> is an {@code IInterfaceDefinition} and
+     * <code>type</code> is an {@code IInterfaceDefinition}, this method
+     * determines whether <code>this</code> is a subinterface of
+     * <code>type</code>.
+     * <p>
+     * A class or interface is considered an instance of itself.
+     * 
+     * @param type An {@code ITypeDefinition} representing a class or interface.
+     * @param project The {@link ICompilerProject} within which references should
+     * be resolved
+     * @return A flag indicating whether an "is-a" relationship exists between
+     * the two types.
+     */
+    boolean isInstanceOf(ITypeDefinition type, ICompilerProject project);
+
+    /**
+     * A variant of <code>isInstanceOf</code> which takes a fully-qualified type
+     * name rather than an {@code ITypeDefinition}.
+     * <p>
+     * While not @deprecated, this method may not do what you want because the
+     * scope containing this type definition will be used to resolve the name
+     * that is specified rather than some other scope which may actually contain
+     * the name in source code.
+     * 
+     * @param qualifiedName A {@code String}, such as <code>"flash.display.Sprite"</code>
+     * , that specified a fully-qualified type name.
+     * @param project The {@link ICompilerProject} within which references should
+     * be resolved
+     * @return A flag indicating whether an "is-a" relationship exists between
+     * the two types.
+     */
+    boolean isInstanceOf(String qualifiedName, ICompilerProject project);
+
+    /**
+     * Creates an Iterable for enumerating the types of this type.
+     * 
+     * @param project The {@link ICompilerProject} within which references
+     * should be resolved.
+     * @param skipThis A flag indicating whether the enumeration should start
+     * with this type rather than with its supertype.
+     * @return An Iterable that iterates over {@code ITypeDefinition} objects.
+     */
+    Iterable<ITypeDefinition> typeIteratable(final ICompilerProject project, final boolean skipThis);
+
+    //todo add support for this
+    /**
+     * Get an array containing all of the members contained within this
+     * {@link ITypeDefinition} nested inside this type. If the hierarchy of this
+     * type allows for overriding member definitions, then this list could
+     * contain shadowed member signatures, since this returns all members from
+     * the hierarchy of this type. To guard against this behavior, the
+     * excludeShadowedMembers parameter exists to ensure non-shadowed members
+     * are returned
+     * 
+     * @param memberFilter ASDefinitionFilter describing the members that should
+     * be included
+     * @param excludeShadowedMembers true if we should only return non-shadowed
+     * members. If A extends B, and B overrides c defined in A, only c from B
+     * will be returned
+     * @return an array containing all of the members matching the
+     * {@link ASDefinitionFilter}
+     */
+    /*
+     * public IDefinition[] getAllMembers(ASDefinitionFilter memberFilter,
+     * boolean excludeShadowedMembers);
+     */
+
+    /**
+     * Returns the {@link ITypeNode} from which this definition was created, if
+     * the definition came from the AST for a source file.
+     * <p>
+     * This method may require the AST to be reloaded or regenerated and
+     * therefore may be slow.
+     */
+    @Override
+    ITypeNode getNode();
+
+    Set<IInterfaceDefinition> resolveAllInterfaces(ICompilerProject project);
+
+    /**
+     * Gets the {@link INamespaceDefinition} that represents the protected
+     * namespace for this type.
+     * 
+     * @return The {@link INamespaceDefinition} that represents the protected
+     * namespace for this type.
+     */
+    INamespaceDefinition getProtectedNamespaceReference();
+
+    /**
+     * Gets the {@link INamespaceDefinition} that represents the static
+     * protected namespace for this type.
+     * 
+     * @return The {@link INamespaceDefinition} that represents the static
+     * protected namespace for this type.
+     */
+    INamespaceDefinition getStaticProtectedNamespaceReference();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/IVariableDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/IVariableDefinition.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/IVariableDefinition.java
new file mode 100644
index 0000000..f454489
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/IVariableDefinition.java
@@ -0,0 +1,181 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions;
+
+import org.apache.flex.compiler.internal.projects.FlexProject;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+
+/**
+ * A definition representing a <code>var</code> declaration.
+ * <p>
+ * An <code>IVariableDefinition</code is created from an <code>IVariableNode</code>
+ * for which <code>isConst()</code> is <code>false</code>.
+ * <p>
+ * For example, the declaration
+ * <pre>
+ * public var i:int = 1;
+ * </pre>
+ * creates a variable definition whose base name is <code>"i"</code>,
+ * whose namespace reference is to the <code>public</code> namespace,
+ * and whose type reference is named <code>"int"</code>.
+ * <p>
+ * A variable definition is contained within a file scope, a package scope,
+ * a class scope, an interface scope, or a function scope;
+ * it does not contain a scope.
+ */
+public interface IVariableDefinition extends IDocumentableDefinition
+{
+    /**
+     * Variable classifications (local, argument, class member, interface
+     * member, and package member)
+     */
+    static enum VariableClassification
+    {
+        /**
+         * Local variable contained within a non-visible scope
+         */
+        LOCAL,
+
+        /**
+         * A parameter in a function scope
+         */
+        PARAMETER,
+
+        /**
+         * A variable that is a member of a class
+         */
+        CLASS_MEMBER,
+
+        /**
+         * A variable that is a member of an interface
+         */
+        INTERFACE_MEMBER,
+
+        /**
+         * A variable that is a member of a package
+         */
+        PACKAGE_MEMBER,
+
+        /**
+         * A variable that is a member of a file
+         */
+        FILE_MEMBER,
+
+        /**
+         * A variable that represents the id attribute of an MXML id
+         */
+        MXML_ID
+    }
+
+    /**
+     * Get the classification for this variable (local, parameter, class member,
+     * etc)
+     * 
+     * @return variable classification
+     */
+    VariableClassification getVariableClassification();
+
+    /**
+     * Returns the {@link IVariableNode} from which this definition was created,
+     * if the definition came from the AST for a source file.
+     * <p>
+     * This method may require the AST to be reloaded or regenerated and
+     * therefore may be slow.
+     */
+    IVariableNode getVariableNode();
+
+    /**
+     * Attempt to resolve the initial value assigned to this variable. This may
+     * cause the AST for the definition to get reloaded, so could be slow.
+     * 
+     * @param project the Project to resolve things in
+     * @return The constant value of the initial value, if one can be
+     * determined, or null if it can't be determined. This will be a String,
+     * int, double, boolean, or Namespace depending on what the initial value
+     * was. The value could also be
+     * org.apache.flex.abc.ABCConstants.UNDEFINED_VALUE if the initial
+     * value was the undefined constant value Callers will need to use
+     * instanceof to see what type the value is.
+     */
+    Object resolveInitialValue(ICompilerProject project);
+
+    /**
+     * Check whether the variable is a skin part. Both optional and required
+     * skin parts are checked for.
+     * 
+     * @return true if a skin part
+     */
+    boolean isSkinPart();
+
+    /**
+     * Check whether the variable is a required skin part. Only required skin
+     * parts are checked for.
+     * 
+     * @return true if a required skin part. false if not a skin part or
+     * optional
+     */
+    boolean isRequiredSkinPart();
+
+    /**
+     * If this {@code IVariableDefinition} is of type <code>Array</code> and has
+     * <code>[ArrayElementType("...")]</code> metadata, this method returns the
+     * specified type for the array elements. Otherwise, it returns
+     * <code>null</code>.
+     */
+    String getArrayElementType(FlexProject project);
+
+    /**
+     * If this {@code IVariableDefinition} is of type
+     * <code>IDeferredInstance</code> and has <code>[InstanceType("...")}</code>
+     * metadata, this method returns the specified type for the deferred
+     * instance. Otherwise, it returns <code>null</code>.
+     */
+    String getInstanceType(FlexProject project);
+
+    /**
+     * If this {@code IVariableDefinition} has
+     * <code>[PercentProxy(...)] metadata,
+     * this method returns the specified property name.
+     * Otherwise, it returns <code>null</code>
+     */
+    String getPercentProxy(FlexProject project);
+
+    /**
+     * If this {@code IVariableDefinition} has <code>[RichTextContent]</code>
+     * metadata, this method returns <code>true</code> Otherwise, it returns
+     * <code>false</code>
+     */
+    boolean hasRichTextContent(FlexProject project);
+
+    /**
+     * If this {@code IVariableDefinition} has <code>[CollapseWhiteSpace]</code>
+     * metadata, this method returns <code>true</code> Otherwise, it returns
+     * <code>false</code>
+     */
+    boolean hasCollapseWhiteSpace(FlexProject project);
+
+    /**
+     * Returns <code>true</code> if this {@code IVariableDefinition} has
+     * <code>[Inspectable(...)]</code> metadata that specifies
+     * <code>format="Color"</code> Otherwise, returns <code>false</code>.
+     */
+    boolean isColor(FlexProject project);
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/IDeprecationInfo.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/IDeprecationInfo.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/IDeprecationInfo.java
new file mode 100644
index 0000000..14dbc92
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/IDeprecationInfo.java
@@ -0,0 +1,32 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions.metadata;
+
+/**
+ * Represents the information represented in <code>[Deprecated]</code> metadata.
+ */
+public interface IDeprecationInfo
+{
+    String getReplacement();
+
+    String getSince();
+
+    String getMessage();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/IMetaTag.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/IMetaTag.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/IMetaTag.java
new file mode 100644
index 0000000..5973333
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/IMetaTag.java
@@ -0,0 +1,60 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions.metadata;
+
+import org.apache.flex.compiler.common.IMetaInfo;
+import org.apache.flex.compiler.common.ISourceLocation;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.tree.metadata.IMetaTagNode;
+
+/**
+ * One IMetaTag corresponds to a single metadata annoation (such as
+ * <code>[Event(name="click", type="flash.events.MouseEvent")])
+ * that applies to a given class, interface, variable, or method.
+ */
+public interface IMetaTag extends IMetaInfo, ISourceLocation
+{
+    // TODO Eliminate this.
+    static final String SINGLE_VALUE = "single";
+
+    /**
+     * The special metadata name that indicates source location of a definition.
+     */
+    static final String GO_TO_DEFINITION_HELP = "__go_to_definition_help";
+    static final String GO_TO_DEFINITION_HELP_POS = "pos";
+
+    /**
+     * Gets the definition to which this metadata annotation is attached.
+     */
+    IDefinition getDecoratedDefinition();
+
+    /**
+     * If the metadata annotation specifies a single keyless value, this method
+     * returns that value. Otherwise, it returns <code>null</code>.
+     * 
+     * @return The keyless value.
+     */
+    String getValue();
+
+    /**
+     * Gets the {@code IMetaTagNode} that produced this {@code IMetaTag}.
+     */
+    IMetaTagNode getTagNode();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/IMetaTagAttribute.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/IMetaTagAttribute.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/IMetaTagAttribute.java
new file mode 100644
index 0000000..9ac5849
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/IMetaTagAttribute.java
@@ -0,0 +1,53 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions.metadata;
+
+/**
+ * An IMetaTagAttribute represents one attribute inside a metadata annotation,
+ * such as <code>name="click"</code> inside [Event(name="click",
+ * type="flash.events.MouseEvent")]</code>.
+ * <p>
+ * Attributes are typically key/value pairs of Strings, but keyless String
+ * values are also allowed. In this case, <code>getValue()</code> returns null.
+ */
+public interface IMetaTagAttribute
+{
+    /**
+     * Gets the key of the attribute, or <code>null</code> if this attribute is
+     * a keyless value.
+     * 
+     * @return A String for the attribute key.
+     */
+    String getKey();
+
+    /**
+     * Does this attribute have a key?
+     * 
+     * @return <code>true</code> if there is a key.
+     */
+    boolean hasKey();
+
+    /**
+     * Gets the value of the attribute.
+     * 
+     * @return A String for the attribute value.
+     */
+    String getValue();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/package.html
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/package.html b/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/package.html
new file mode 100644
index 0000000..34ef0d3
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/metadata/package.html
@@ -0,0 +1,26 @@
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<html>
+<body>
+
+This package contains interfaces representing metadata annotations on definitions.
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/package.html
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/package.html b/compiler/src/main/java/org/apache/flex/compiler/definitions/package.html
new file mode 100644
index 0000000..8d7662f
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/package.html
@@ -0,0 +1,174 @@
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<html>
+<body>
+
+This package contains interfaces for various kinds of <i>definitions</i>
+found in AS and MXML files.
+
+<p>
+A <i>definition</i> 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.
+</p>
+
+<p>
+A key part of <i>semantic analysis</i> and <i>code generation</i> consists of
+determining what each <i>identifier node</i> in an AST refers by <i>resolving</i>
+it to a <i>definition</i>. This process is called <i>name resolution</i>
+For example, when you write
+<pre>
+for (var i:int = 0; i < n; i++)
+{
+    trace(i);
+}
+</pre>
+the first <code>i</code> produces a variable definition named "i".
+The second, third, and fourth <code>i</code> get resolved to this definition.
+</p>
+
+<p>
+Most definitions live within <i>scopes</i>. A <i>scope</i> can loosely be thought
+of as representing either an entire file (for a <i>file scope</i>)
+or a block of code delimited by curly braces (for a <i>package scope</i>,
+<i>class scope</i>, <i>interface scope</i>, <i>function/getter/setter scope</i>,
+<i>catch scope</i>, or <i>with scope</i>).
+Curly braces within some statements, such as those of a <code>for</code> loop,
+do not produce produce scopes, due to the "hoisting" rules of ActionScript.
+</p>
+
+<p>
+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 <i>symbol table</i> for the file.)
+Definitions which are visible to other files are copied into a
+<i>project scope</i> for cross-file name resolution.
+</p>
+
+<p>
+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 <code>IDefinitionNode</code>)
+in the AST.
+For MXML files, a DOM-like representation known as <code>MXMLData</code>
+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 <code>MXMLData</code>.
+</p>
+
+<p>
+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.
+</p>
+
+<p>
+The most important interface in this package is <code>IDefinition</code>
+which is the base interface for all definitions.
+Each specific type of definition has its own sub-interface:
+</p>
+
+<table border="1" cellspacing="0" cellpadding="3">
+	<tr>
+		<td>package</td>
+		<td><code>IPackageDefinition</code></td>
+	</tr>
+	<tr>
+		<td>namespace</td>
+		<td><code>INamespaceDefinition</code></td>
+	</tr>
+	<tr>
+		<td>class</td>
+		<td><code>IClassDefinition</code></td>
+	</tr>
+	<tr>
+		<td>interface</td>
+		<td><code>IInterfaceDefinition</code></td>
+	</tr>
+	<tr>
+		<td>function</td>
+		<td><code>IFunctionDefinition</code></td>
+	</tr>
+	<tr>
+		<td>getter</td>
+		<td><code>IGetterDefinition</code></td>
+	</tr>
+	<tr>
+		<td>setter</td>
+		<td><code>ISetterDefinition</code></td>
+	</tr>
+	<tr>
+		<td>parameter</td>
+		<td><code>IParameterDefinition</code></td>
+	</tr>
+	<tr>
+		<td>variable</td>
+		<td><code>IVariableDefinition</code></td>
+	</tr>
+	<tr>
+		<td>constant</td>
+		<td><code>IConstantDefinition</code></td>
+	</tr>
+	<tr>
+		<td>event</td>
+		<td><code>IEventDefinition</code></td>
+	</tr>
+	<tr>
+		<td>style</td>
+		<td><code>IStyleDefinition</code></td>
+	</tr>
+	<tr>
+		<td>effect</td>
+		<td><code>IEffectDefinition</code></td>
+	</tr>
+</table>
+
+<p>
+All definitions have
+<ul>
+<li>a source location;</li>
+<li>an optional ASDoc comment;</li>
+<li>an optional list of metadata annotations;</li>
+<li>a namespace reference indicating its visibility,
+such as <code>public</code>;</li>
+<li>a set of flags indicating modifiers such as <code>static</code>
+or <code>override</code>;</li>
+<li>a base, or unqualified, name;</li>
+<li>a type reference (which may be <code>null</code>
+for some types of definitions.</li>
+</ul>
+Specific types of definitions of course store additional information.
+For example, a class definition stores a reference to the class it extends
+and references to the interfaces that it implements.
+</p>
+
+<p>
+Definitions refer to other definitions indirectly, by name,
+using an <code>IReference</code>. See the <code>references</code>
+subpackage for an explanation of this design.
+</p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/references/INamespaceReference.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/references/INamespaceReference.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/references/INamespaceReference.java
new file mode 100644
index 0000000..9587bdc
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/references/INamespaceReference.java
@@ -0,0 +1,63 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions.references;
+
+import org.apache.flex.abc.semantics.Namespace;
+import org.apache.flex.compiler.definitions.INamespaceDefinition;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.units.ICompilationUnit;
+
+/**
+ * INamespaceReferences are used in the symbol table to represent
+ * references to namespaces in two contexts:
+ * <ul>
+ * <li>a namespace specified on a <code>const</code>, <code>var</code>,
+ * <code>function</code>, and <code>namespace</code> definition
+ * inside a <code>class</code> or <code>interface</code>;</li>
+ * <li>a namespace specified in a <code>use namespace</code> directive.</li>
+ * </ul>
+ * <p>
+ * In the first context, the INamespaceDefinition can represent a custom namespace
+ * of the form <code>ns1</code>, <code>ns1::ns2</code>,
+ * <code>(ns1::ns2)::ns3</code>, etc.,
+ */
+public interface INamespaceReference
+{
+    /**
+     * Does this namespace reference refer to a builtin language namespace?
+     * @return <code>true</code> if it does.
+     */
+    boolean isLanguageNamespace();
+
+    /**
+     * Resolves this namespace reference to a namespace definition.
+     * @param project {@link ICompilerProject} whose symbol table will be used to resolve
+     * references across {@link ICompilationUnit}'s.
+     * @return The {@link INamespaceDefinition} representing the definition of the namespace.
+     */
+    INamespaceDefinition resolveNamespaceReference(ICompilerProject project);
+
+    // TODO Remove this after we are using INamespaceReference correctly everywhere.
+    String getBaseName();
+
+    boolean isPublicOrInternalNamespace();
+    
+    Namespace resolveAETNamespace(ICompilerProject project);
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/references/IReference.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/references/IReference.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/references/IReference.java
new file mode 100644
index 0000000..54d0efe
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/references/IReference.java
@@ -0,0 +1,89 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions.references;
+
+import org.apache.flex.abc.semantics.Name;
+import org.apache.flex.compiler.common.DependencyType;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.internal.scopes.ASScope;
+import org.apache.flex.compiler.projects.ICompilerProject;
+
+/**
+ * An <code>IReference</code> represents a reference-by-name to an
+ * {@link IDefinition}.
+ * <p>
+ * References are used by the various definition classes to refer to other
+ * definitions; for example, <code>ClassDefinition</code> stores a reference to
+ * its base class and <code>VariableDefinition</code> stores a reference to its
+ * type.
+ * <p>
+ * A reference can resolve to different definitions in different projects. For
+ * example, a reference to the <code>Object</code> class might resolve to the
+ * <code>Object</code> class from <code>playerglobal.swc</code> in a web project
+ * and to the <code>Object</code> class from <code>airglobal.swc</code> in an
+ * AIR project.
+ * <p>
+ * There are a variety of implementations of this interface that represent
+ * different kinds of references, such as unqualified names, multinames, etc.
+ * <p>
+ * To construct an {@link IReference}, use the methods in
+ * {@link ReferenceFactory}.
+ */
+public interface IReference
+{
+    /**
+     * Gets the base name for this reference.
+     * 
+     * @return The base name as a <code>String<code>.
+     */
+    String getName();
+
+    /**
+     * Resolves the reference to its {@link IDefinition} in the given project
+     * and scope.
+     * 
+     * @param project The project in which to resolve the reference.
+     * @param scope The scope where the resolution is occurring.
+     * @param dependencyType The type of dependency to introduce if the reference
+     * resolves outside of the compilation unit.
+     * @param canEscapeWith Whether the resolution should look past a
+     * <code>with</code> scope.
+     * @return The {@link IDefinition} the reference resolves to.
+     */
+    IDefinition resolve(ICompilerProject project, ASScope scope,
+                        DependencyType dependencyType,
+                        boolean canEscapeWith);
+
+    /**
+     * Gets a string representation of this reference suitable for display
+     * in the description of a compiler problem.
+     */
+    String getDisplayString();
+
+    /**
+     * Gets the AET {link Name} that this reference represents in the given
+     * project and scope.
+     * 
+     * @param project The project where the reference is used.
+     * @param scope The scope where the reference is used from.
+     * @return An AET {@link Name} representing this reference
+     */
+    Name getMName(ICompilerProject project, ASScope scope);
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/59f6373b/compiler/src/main/java/org/apache/flex/compiler/definitions/references/IResolvedQualifiersReference.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/definitions/references/IResolvedQualifiersReference.java b/compiler/src/main/java/org/apache/flex/compiler/definitions/references/IResolvedQualifiersReference.java
new file mode 100644
index 0000000..c91510d
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/definitions/references/IResolvedQualifiersReference.java
@@ -0,0 +1,88 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.definitions.references;
+
+import org.apache.flex.abc.semantics.Name;
+import org.apache.flex.compiler.common.DependencyType;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.INamespaceDefinition;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * A subinterface of {@link IReference} where all the qualifiers in the
+ * reference are already resolved to namespace definitions.
+ */
+public interface IResolvedQualifiersReference extends IReference
+{
+    /**
+     * Gets the resolved qualifiers for this reference.
+     * 
+     * @return An immutable set of the {@link INamespaceDefinition} qualifiers.
+     */
+    ImmutableSet<INamespaceDefinition> getQualifiers();
+
+    /**
+     * Resolves this reference to a definition in the given project.
+     * 
+     * @param project The {@link ICompilerProject} in which to resolve the
+     * reference.
+     * @param referencingCompilationUnit The {@link ICompilationUnit} where the
+     * resolution occurs.
+     * @param dependencyType The type of dependency to introduce if this
+     * resolves.
+     * @return The {@link IDefinition} the reference resolves to.
+     */
+    IDefinition resolve(ICompilerProject project,
+                        ICompilationUnit referencingCompilationUnit,
+                        DependencyType dependencyType);
+
+    /**
+     * Resolves this reference to a definition in the given project. This method
+     * will not add any dependencies to the dependency graph in the project.
+     * 
+     * @param project The project in which to resolve the reference.
+     */
+    IDefinition resolve(ICompilerProject project);
+
+    /**
+     * Gets the AET {@link Name} that this reference represents.
+     * 
+     * @return An AET {@link Name} representing this reference.
+     */
+    Name getMName();
+    
+    /**
+     * Determines if base name of this {@link IResolvedQualifiersReference}
+     * matches the base name of the specified
+     * {@link IResolvedQualifiersReference} <b>and</b> at least one qualifier in
+     * the specified {@link IResolvedQualifiersReference} is in the set of
+     * qualifiers in this {@link IResolvedQualifiersReference}.
+     * 
+     * @param toMatch {@link IResolvedQualifiersReference} to test.
+     * @return false if the base name in this
+     * {@link IResolvedQualifiersReference} is not equal to the base name in the
+     * specified {@link IResolvedQualifiersReference}, false if none qualifiers
+     * of the specified {@link IResolvedQualifiersReference} are in the set of
+     * qualifiers in this {@link IResolvedQualifiersReference}, true otherwise.
+     */
+    boolean matches(IResolvedQualifiersReference toMatch);
+}


Mime
View raw message