You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2016/04/13 20:55:53 UTC

[01/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Repository: flex-falcon
Updated Branches:
  refs/heads/feature/maven-migration-test [created] c3dce49fd


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/legacy/ASDefinitionFilter.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/legacy/ASDefinitionFilter.java b/compiler.js/src/org/apache/flex/compiler/internal/legacy/ASDefinitionFilter.java
deleted file mode 100644
index 8473c3d..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/legacy/ASDefinitionFilter.java
+++ /dev/null
@@ -1,2140 +0,0 @@
-/*
- *
- *  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.internal.legacy;
-
-import java.lang.ref.WeakReference;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.flex.compiler.common.ASModifier;
-import org.apache.flex.compiler.common.ModifiersSet;
-import org.apache.flex.compiler.common.RecursionGuard;
-import org.apache.flex.compiler.constants.IASLanguageConstants;
-import org.apache.flex.compiler.constants.IMetaAttributeConstants;
-import org.apache.flex.compiler.constants.INamespaceConstants;
-import org.apache.flex.compiler.definitions.IAccessorDefinition;
-import org.apache.flex.compiler.definitions.IClassDefinition;
-import org.apache.flex.compiler.definitions.IDefinition;
-import org.apache.flex.compiler.definitions.IFunctionDefinition;
-import org.apache.flex.compiler.definitions.IGetterDefinition;
-import org.apache.flex.compiler.definitions.IInterfaceDefinition;
-import org.apache.flex.compiler.definitions.IMetadataDefinition;
-import org.apache.flex.compiler.definitions.INamespaceDefinition;
-import org.apache.flex.compiler.definitions.IPackageDefinition;
-import org.apache.flex.compiler.definitions.ISetterDefinition;
-import org.apache.flex.compiler.definitions.ITypeDefinition;
-import org.apache.flex.compiler.definitions.IVariableDefinition;
-import org.apache.flex.compiler.definitions.metadata.IMetaTag;
-import org.apache.flex.compiler.definitions.references.INamespaceReference;
-import org.apache.flex.compiler.internal.definitions.AppliedVectorDefinition;
-import org.apache.flex.compiler.internal.definitions.ClassDefinition;
-import org.apache.flex.compiler.internal.definitions.ClassDefinitionBase;
-import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
-import org.apache.flex.compiler.internal.definitions.NamespaceDefinition;
-import org.apache.flex.compiler.internal.definitions.ScopedDefinitionBase;
-import org.apache.flex.compiler.internal.definitions.TypeDefinitionBase;
-import org.apache.flex.compiler.internal.scopes.ASFileScope;
-import org.apache.flex.compiler.internal.scopes.ASScope;
-import org.apache.flex.compiler.internal.scopes.ASScopeBase;
-import org.apache.flex.compiler.internal.scopes.MXMLFileScope;
-import org.apache.flex.compiler.internal.scopes.ScopeView;
-import org.apache.flex.compiler.internal.scopes.TypeScope;
-import org.apache.flex.compiler.internal.tree.as.FileNode;
-import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
-import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
-import org.apache.flex.compiler.internal.workspaces.Workspace;
-import org.apache.flex.compiler.projects.ICompilerProject;
-import org.apache.flex.compiler.scopes.IASScope;
-import org.apache.flex.compiler.tree.as.IASNode;
-import org.apache.flex.compiler.tree.as.IClassNode;
-import org.apache.flex.compiler.tree.as.IDefinitionNode;
-import org.apache.flex.compiler.tree.as.IExpressionNode;
-import org.apache.flex.compiler.units.ICompilationUnit;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-
-/**
- * An {@link ASDefinitionFilter} provides the ability to restrict and search
- * specifically for various types of definitions encountered when looking
- * through symbol tables kept inside of scopes.
- * <p>
- * an {@link ASDefinitionFilter} provides the ability to search based on:
- * <ul>
- * <li>Classification of the {@link IDefinition} through
- * {@link ClassificationValue}. For example, we can search for functions but not
- * getters</li>
- * <li>Scope to search in, such as containing, inherited, etc</li>
- * <li>Modifiers on an {@link IDefinition}</li>
- * <li>Namespace of an {@link IDefinition}</li>
- * </ul>
- * </p>
- * <p>
- * While it is possible to build an {@link ASDefinitionFilter} directly, a
- * number of static factory methods exist to build specific filters, such as
- * filters that know how to find members of types, or find all classes for
- * example. When possible, those filters should be used to guarantee correct
- * filtering behavior.
- * </p>
- */
-public class ASDefinitionFilter
-{
-    /**
-     * Cache object that preserves a specific filter for use later, removing any
-     * references to {@link IASNode} contexts. When finished with a query, the
-     * context should be removed by calling clearContext(()
-     */
-    public static final class CachedDefinitionFilter
-    {
-        private ASDefinitionFilter fFilter;
-
-        CachedDefinitionFilter(ASDefinitionFilter filter)
-        {
-            fFilter = filter;
-            fFilter.fContext = null;
-        }
-
-        /**
-         * Returns the underlying {@link ASDefinitionFilter} and sets the
-         * current context.
-         * 
-         * @param context the {@link IASNode} representing the current context
-         * @return the underlying {@link ASDefinitionFilter}
-         */
-        public ASDefinitionFilter getDefinitionFilter(IASNode context)
-        {
-            fFilter.fContext = new NodeFilterContext(context);
-            return fFilter;
-        }
-
-        public ASDefinitionFilter getDefinitionFilter(IDefinition context)
-        {
-            fFilter.fContext = new DefinitionFilterContext(context);
-            return fFilter;
-        }
-
-        /**
-         * Removes any context associated with this filter
-         */
-        public void clearContext()
-        {
-            fFilter.fContext = null;
-        }
-    }
-
-    /**
-     * Enum that determines where a search should look
-     */
-    public static enum SearchScopeValue
-    {
-        /**
-         * Search for definitions in this scope
-         */
-        IMMEDIATE_MEMBERS,
-
-        /**
-         * Search this scope plus the base class scope
-         */
-        INHERITED_MEMBERS,
-
-        /**
-         * Search all available scopes
-         */
-        ALL_SCOPES
-        {
-            @Override
-            public boolean searchAllNamespaces()
-            {
-                return false;
-            }
-        },
-
-        /**
-         * Search scopes up to the parent container
-         */
-        CONTAINING_SCOPES
-        {
-            @Override
-            public boolean searchAllNamespaces()
-            {
-                return false;
-            }
-        };
-
-        public boolean searchAllNamespaces()
-        {
-            return true;
-        }
-    }
-
-    protected SearchScopeValue fSearchScopeRule;
-
-    /**
-     * Classification of definitions that guides an {@link ASDefinitionFilter}
-     */
-    public static enum ClassificationValue
-    {
-        FUNCTIONS,
-        GETTERS,
-        SETTERS,
-        ACCESSORS,
-        VARIABLES,
-        META_TAG_TYPES,
-        CLASSES,
-        INTERFACES,
-        CLASSES_AND_INTERFACES,
-        PACKAGES,
-        CLASSES_INTERFACES_AND_PACKAGES,
-        CLASSES_INTERFACES_AND_NAMESPACES,
-        CLASSES_AND_PACKAGES,
-        INTERFACES_AND_PACKAGES,
-        OBJECTS, // variables, classes, or packages
-        ALL, // functions, variables, classes, or packages 
-        ALL_NO_ACCESSORS, // functions, variables, classes, or packages, but no accessor functions
-        NAMESPACES,
-        MEMBERS_AND_TYPES,
-        VARIABLES_AND_FUNCTIONS,
-        TYPES_FUNCTIONS_AND_VARIABLES,
-        CLASSES_INTERFACES_AND_FUNCTIONS
-    }
-
-    /**
-     * The classification that we are searching for
-     */
-    protected ClassificationValue fClassificationRule;
-
-    /**
-     * IFilter for namespaces
-     */
-    public static class AccessValue
-    {
-        private static class SpecialAccessValue extends AccessValue
-        {
-            public SpecialAccessValue(String name)
-            {
-                super((INamespaceDefinition)null);
-                this.name = name;
-            }
-
-            /**
-             * {@inheritDoc}
-             */
-            @Override
-            public boolean equals(Object obj)
-            {
-                return this == obj;
-            }
-
-            private final String name;
-
-            /**
-             * {@inheritDoc}
-             * <p>
-             * For debugging.
-             */
-            @Override
-            public String toString()
-            {
-                return "SpecialAccessValue(" + name + ")"; //$NON-NLS-1$ //$NON-NLS-2$
-            }
-        }
-
-        public final static AccessValue ALL = new SpecialAccessValue("all"); //$NON-NLS-1$
-
-        public final static AccessValue INCLUDED = new SpecialAccessValue("included"); //$NON-NLS-1$
-
-        public final static AccessValue INTERNAL = new SpecialAccessValue(INamespaceConstants.internal_);
-
-        public final static AccessValue PRIVATE = new SpecialAccessValue(INamespaceConstants.private_);
-
-        public final static AccessValue PROTECTED = new SpecialAccessValue(INamespaceConstants.protected_);
-
-        public final static AccessValue PUBLIC = new SpecialAccessValue(INamespaceConstants.public_);
-
-        //make this the same as public
-        public final static AccessValue AS3 = new AccessValue(NamespaceDefinition.getAS3NamespaceDefinition());
-
-        INamespaceDefinition namespaceDef = null;
-
-        public AccessValue(INamespaceDefinition n)
-        {
-            this.namespaceDef = n;
-        }
-
-        /**
-         * Return a namespace for the access value. May be null
-         * 
-         * @return INamespaceDefinition
-         */
-        public INamespaceDefinition getNamespaceDef()
-        {
-            return namespaceDef;
-        }
-
-        /**
-         * {@inheritDoc}
-         * <p>
-         * For debugging.
-         */
-        @Override
-        public String toString()
-        {
-            return "AccessValue(" + (namespaceDef != null ? namespaceDef.toString() : "null") + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        }
-
-        /**
-         * {@inheritDoc}
-         */
-        @Override
-        public int hashCode()
-        {
-            if (namespaceDef == null)
-                return super.hashCode();
-            return namespaceDef.hashCode();
-        }
-
-        /**
-         * {@inheritDoc}
-         */
-        @Override
-        public boolean equals(Object obj)
-        {
-            if (obj == this)
-                return true;
-            if (obj instanceof SpecialAccessValue)
-                return obj.equals(this);
-            if (obj instanceof AccessValue)
-            {
-                AccessValue that = (AccessValue)obj;
-                if ((that.namespaceDef == namespaceDef) ||
-                     ((namespaceDef != null) && (namespaceDef.equals(that.namespaceDef))))
-                    return true;
-            }
-            return false;
-        }
-
-        @Deprecated
-        public static AccessValue unionAccessRules(AccessValue oldAccessValue, AccessValue newAccessValue)
-        {
-            if (!(oldAccessValue instanceof AccessValue.SpecialAccessValue))
-                return oldAccessValue;
-            if (!(newAccessValue instanceof AccessValue.SpecialAccessValue))
-                return newAccessValue;
-
-            if ((oldAccessValue == AccessValue.ALL) || (newAccessValue == AccessValue.ALL))
-                return AccessValue.ALL;
-
-            if ((oldAccessValue == AccessValue.INTERNAL) || (newAccessValue == AccessValue.INTERNAL))
-                return AccessValue.INTERNAL;
-
-            if ((oldAccessValue == AccessValue.PRIVATE) || (newAccessValue == AccessValue.PRIVATE))
-                return AccessValue.PRIVATE;
-
-            if ((oldAccessValue == AccessValue.PROTECTED) || (newAccessValue == AccessValue.PROTECTED))
-                return AccessValue.PROTECTED;
-
-            if ((oldAccessValue == AccessValue.PUBLIC) || (newAccessValue == AccessValue.PUBLIC))
-                return AccessValue.PUBLIC;
-            return newAccessValue;
-        }
-
-        static public AccessValue createAccessRule(INamespaceDefinition ns)
-        {
-            if (ns != null && ns instanceof NamespaceDefinition)
-            {
-                if (ns instanceof NamespaceDefinition.IPublicNamespaceDefinition)
-                    return AccessValue.PUBLIC;
-                else if (ns instanceof NamespaceDefinition.IPrivateNamespaceDefinition)
-                    return AccessValue.PRIVATE;
-                else if (ns instanceof NamespaceDefinition.IProtectedNamespaceDefinition)
-                    return AccessValue.PROTECTED;
-                else if (ns instanceof NamespaceDefinition.IInternalNamespaceDefinition)
-                    return AccessValue.INTERNAL;
-                else if (ns == NamespaceDefinition.getAS3NamespaceDefinition())
-                    return AccessValue.AS3;
-
-                AccessValue accessValue = new AccessValue(ns);
-                return accessValue;
-            }
-            return AccessValue.PUBLIC;
-        }
-    }
-
-    /**
-     * AccessRule to be used by this filter
-     */
-    protected AccessValue fAccessRule;
-
-    /**
-     * AccessRule to be used by this filter in project-level scope. If not set,
-     * the normal access value will be used
-     */
-    protected AccessValue fProjectAccessRule;
-
-    /**
-     * Indicate whether or not we require imports (and for which definitions)
-     */
-    public static enum RequireImportsValue
-    {
-        YES
-        {
-            @Override
-            public boolean searchAllNamespaces()
-            {
-                return false;
-            }
-        },
-        NO,
-        ONLY_FOR_FUNCTIONS_AND_VARIABLES;
-
-        public boolean searchAllNamespaces()
-        {
-            return true;
-        }
-    }
-
-    protected RequireImportsValue fRequireImportsRule;
-
-    /**
-     * Current package name (so that internals from the given package can be
-     * included) based on the context
-     */
-    private String fPackageName;
-
-    /**
-     * Context (for determining imports)
-     */
-    protected IFilterContext fContext;
-
-    /**
-     * Flag indicating whether or not we should include implicit types (this,
-     * super, cast functions) and constructors
-     */
-    protected boolean fIncludeImplicitsAndConstructors;
-
-    /**
-     * Modifiers (e.g. static, final, override) that must be either present or
-     * missing on all filtered definitions
-     */
-    protected HashMap<ASModifier, Boolean> fRequiredAndExcludedModifiers;
-
-    /**
-     * True if we should include excluded items. Off by default
-     */
-    protected Boolean fIncludeExcluded = null;
-
-    /**
-     * Constructor.
-     * 
-     * @param classification classification (functions, classes, all, etc)
-     * @param searchScope search scope (all, immediate members, etc)
-     * @param access access filter (private, public, etc)
-     * @param context the context node (to be used to determine the current
-     * imports and package)
-     */
-    @Deprecated
-    public ASDefinitionFilter(ClassificationValue classification,
-                              SearchScopeValue searchScope,
-                              AccessValue access, IASNode context)
-    {
-        this(classification, searchScope, access, new NodeFilterContext(context));
-    }
-
-    /**
-     * Constructor.
-     * 
-     * @param classification classification (functions, classes, all, etc)
-     * @param searchScope search scope (all, immediate members, etc)
-     * @param access access filter (private, public, etc)
-     * @param context the context node (to be used to determine the current
-     * imports and package)
-     */
-    public ASDefinitionFilter(ClassificationValue classification,
-                              SearchScopeValue searchScope,
-                              AccessValue access, IDefinition context)
-    {
-        this(classification, searchScope, access, new DefinitionFilterContext(context));
-    }
-
-    /**
-     * Constructor.
-     * 
-     * @param classification classification (functions, classes, all, etc)
-     * @param searchScope search scope (all, immediate members, etc)
-     * @param access access filter (private, public, etc)
-     * @param context the context node (to be used to determine the current
-     * imports and package)
-     */
-    public ASDefinitionFilter(ClassificationValue classification,
-                              SearchScopeValue searchScope,
-                              AccessValue access, IFilterContext context)
-    {
-        fClassificationRule = classification;
-        fSearchScopeRule = searchScope;
-        fAccessRule = access;
-        fContext = context;
-        fRequireImportsRule = RequireImportsValue.YES;
-        fIncludeImplicitsAndConstructors = true;
-    }
-
-    /**
-     * Builds a filter that will find the given definition
-     * 
-     * @param definition the {@link IDefinition} we want to eventually find
-     */
-    public ASDefinitionFilter(IDefinition definition, SearchScopeValue scope)
-    {
-        fIncludeImplicitsAndConstructors = true;
-        fSearchScopeRule = scope;
-        fContext = new DefinitionFilterContext(definition);
-
-        if (definition instanceof IClassDefinition)
-            fClassificationRule = ClassificationValue.CLASSES;
-        else if (definition instanceof IInterfaceDefinition)
-            fClassificationRule = ClassificationValue.INTERFACES;
-        else if (definition instanceof IPackageDefinition)
-            fClassificationRule = ClassificationValue.PACKAGES;
-        else if (definition instanceof ISetterDefinition)
-            fClassificationRule = ClassificationValue.SETTERS;
-        else if (definition instanceof IGetterDefinition)
-            fClassificationRule = ClassificationValue.GETTERS;
-        else if (definition instanceof IVariableDefinition)
-            fClassificationRule = ClassificationValue.VARIABLES;
-        else if (definition instanceof INamespaceDefinition)
-            fClassificationRule = ClassificationValue.NAMESPACES;
-        else if (definition instanceof IFunctionDefinition)
-            fClassificationRule = ClassificationValue.FUNCTIONS;
-        else if (definition instanceof IMetadataDefinition)
-            fClassificationRule = ClassificationValue.META_TAG_TYPES;
-
-        ICompilerProject compilerProject = findProjectForDefinition(definition);
-        fAccessRule = AccessValue.createAccessRule(definition.resolveNamespace(compilerProject));
-
-        ModifiersSet modifiersSet = definition.getModifiers();
-        if (modifiersSet != null)
-        {
-            ASModifier[] modifiers = modifiersSet.getAllModifiers();
-            for (int i = 0; i < modifiers.length; i++)
-            {
-                setRequiredModifier(modifiers[i]);
-            }
-        }
-    }
-
-    /**
-     * Copy constructor
-     * 
-     * @param other definition filter to copy
-     */
-    public ASDefinitionFilter(ASDefinitionFilter other)
-    {
-        fClassificationRule = other.fClassificationRule;
-        fSearchScopeRule = other.fSearchScopeRule;
-        fAccessRule = other.fAccessRule;
-        fPackageName = other.fPackageName;
-        fContext = other.fContext;
-        fRequireImportsRule = other.fRequireImportsRule;
-        fIncludeImplicitsAndConstructors = true; //TODO [dz] FIX THIS IT SEEMS WRONG
-        if (other.fRequiredAndExcludedModifiers != null)
-        {
-            fRequiredAndExcludedModifiers =
-                    new HashMap<ASModifier, Boolean>(other.fRequiredAndExcludedModifiers);
-        }
-        fProjectAccessRule = other.fProjectAccessRule;
-        fIncludeExcluded = other.fIncludeExcluded;
-    }
-
-    /**
-     * caches the current {@link ASDefinitionFilter} so that it can be stored
-     * and used later
-     * 
-     * @return a {@link CachedDefinitionFilter}
-     */
-    public CachedDefinitionFilter cacheFilter()
-    {
-        return new CachedDefinitionFilter(this);
-    }
-
-    /**
-     * Indicate whether to limit the search to this scope, this scope plus the
-     * base class scope, or all available scopes
-     * 
-     * @param searchScopeRule e.g. inherited members, containing scope, etc
-     */
-    public void setSearchScopeRule(SearchScopeValue searchScopeRule)
-    {
-        fSearchScopeRule = searchScopeRule;
-    }
-
-    /**
-     * Indicate which definitions of symbols to search for
-     * 
-     * @param classification e.g. variables, functions, etc
-     */
-    public void setClassification(ClassificationValue classification)
-    {
-        fClassificationRule = classification;
-    }
-
-    /**
-     * Get which definitions of symbols this filter is searching for
-     * 
-     * @return e.g. variables, functions, etc
-     */
-    public ClassificationValue getClassification()
-    {
-        return fClassificationRule;
-    }
-
-    /**
-     * Indicate whether to find private members, public members, namespace
-     * members, etc
-     * 
-     * @param accessRule e.g. private, public, etc
-     */
-    public void setPrimaryAccessRule(AccessValue accessRule)
-    {
-        fAccessRule = accessRule;
-    }
-
-    /**
-     * * Indicate whether to find private members, public members, namespace
-     * members, etc in project-level scope
-     * 
-     * @param accessRule
-     */
-    public void setProjectAccessRule(AccessValue accessRule)
-    {
-        fProjectAccessRule = accessRule;
-    }
-
-    public AccessValue getProjectAccessRule()
-    {
-        return fProjectAccessRule;
-    }
-
-    /**
-     * Returns the AccessValue used by this specific filter
-     * 
-     * @return an {@link AccessValue}
-     */
-    public AccessValue getPrimaryAccessRule()
-    {
-        return fAccessRule;
-    }
-
-    public Set<INamespaceDefinition> getNamespaceSet(ICompilerProject project, ASScope scope)
-    {
-        return getNamespaceSet(project, scope, null);
-    }
-
-    Set<INamespaceDefinition> getNamespaceSet(ICompilerProject project, ASScope scope, String name)
-    {
-        if (fAccessRule != null)
-        {
-            // Check for user defined namespace access value.
-            if (!(fAccessRule instanceof AccessValue.SpecialAccessValue))
-            {
-                return Collections.singleton(fAccessRule.namespaceDef);
-            }
-
-            if (fAccessRule == AccessValue.ALL
-                    // If we are looking for "ALL", but want to require imports, then build
-                    // the normal namespace set
-                    && (fRequireImportsRule.searchAllNamespaces() || fSearchScopeRule.searchAllNamespaces()))
-                return ASScopeBase.allNamespacesSet;
-
-            Set<INamespaceDefinition> contextNamespaceSet = fContext.getNamespaceSet(project, name);
-            // NOTE: We do NOT need a LinkedHashSet here, because this
-            // namespace set is not used for code generation, just for
-            // code model compatibility.
-            Set<INamespaceDefinition> nsSet = new HashSet<INamespaceDefinition>(contextNamespaceSet.size());
-            nsSet.addAll(contextNamespaceSet);
-
-            if ((fAccessRule == AccessValue.PROTECTED) && (scope instanceof TypeScope))
-            {
-                TypeScope typeScope = (TypeScope)scope;
-                IDefinition typeIDefinition = typeScope.getDefinition();
-                if (typeIDefinition instanceof ClassDefinitionBase)
-                {
-                    ClassDefinitionBase classDef = (ClassDefinitionBase)typeIDefinition;
-                    nsSet.add(classDef.getProtectedNamespaceReference());
-                }
-            }
-
-            if (scope != null)
-            {
-                // Add all the interface namespaces, becuase the interface namespaces
-                // are mostly like "public" (i.e. they should be findable when we're searching
-                // for "public" stuff.
-                nsSet.addAll(getInterfaceNamespaceSets(project, scope));
-            }
-
-            if (shouldIncludeImplicitsAndConstructors())
-                nsSet.add(NamespaceDefinition.getCodeModelImplicitDefinitionNamespace());
-
-            return nsSet;
-        }
-
-        return fContext.getNamespaceSet(project, name);
-    }
-
-    public Set<INamespaceDefinition> getNamespaceSetForName(ICompilerProject project, ASScope scope, String name)
-    {
-        return getNamespaceSet(project, scope, name);
-    }
-
-    /**
-     * Helper method to grab the interface namespaces when the DefinitionFilter
-     * is trying to find "public" definitions. Since the interface members get
-     * put in a special namespace, we have to add all those namespaces to the
-     * namespace set when the DefinitionFilter wants to find "public" because
-     * code model considers interface members as "public".
-     * 
-     * @param project Project to use to resolve interfaces
-     * @param scope the scope we're looking in
-     * @return The interface namespace set.
-     */
-    private Set<INamespaceDefinition> getInterfaceNamespaceSets(ICompilerProject project, ASScope scope)
-    {
-        Set<INamespaceDefinition> nsSet = new HashSet<INamespaceDefinition>();
-        while (scope != null)
-        {
-            ScopedDefinitionBase sdb = scope.getDefinition();
-            if (sdb instanceof InterfaceDefinition)
-            {
-                // If we find an interface, then just add it's interface namespace set
-                nsSet.addAll(((InterfaceDefinition)sdb).getInterfaceNamespaceSet(project));
-                break;
-            }
-            else if (sdb instanceof ClassDefinition)
-            {
-                // If we find a class, resolve it's interfaces, and then add all of their interface namespace
-                // sets
-                IInterfaceDefinition[] interfs = ((ClassDefinition)sdb).resolveImplementedInterfaces(project);
-                for (int i = 0, l = interfs.length; i < l; ++i)
-                {
-                    if (interfs[i] != null)
-                        nsSet.addAll(((InterfaceDefinition)interfs[i]).getInterfaceNamespaceSet(project));
-                }
-                break;
-            }
-            scope = scope.getContainingScope();
-        }
-        return nsSet;
-    }
-
-    /**
-     * Indicate whether to require that definitions be imported before including
-     * them in results
-     * 
-     * @param requireImportsRule e.g. yes, no, only_functions_and_variables
-     */
-    public void setRequireImports(RequireImportsValue requireImportsRule)
-    {
-        fRequireImportsRule = requireImportsRule;
-    }
-
-    /**
-     * Flag that determines if we should include classes marked with
-     * [ExcludeClass] metadata. This is only relevant when searching for members
-     * of a package Defaults to false
-     * 
-     * @param includeExcludedClasses true if we want to include excluded
-     * metadata
-     */
-    public void setIncludeExcludedClasses(boolean includeExcludedClasses)
-    {
-        fIncludeExcluded = includeExcludedClasses;
-    }
-
-    /**
-     * True if included classes should be included in this filter
-     * 
-     * @return true if they are being included
-     */
-    public boolean includeExcludedClasses()
-    {
-        return fIncludeExcluded != null && fIncludeExcluded == Boolean.TRUE;
-    }
-
-    @Deprecated
-    public void setFindOpenNamespacesInScope(boolean find)
-    {
-        // NOP  We always know when to look for open namespaces.
-    }
-
-    /**
-     * Add a modifier to the list of modifiers that must be present in order for
-     * a definition to get through the filter
-     * 
-     * @param modifier modifier (e.g. static, final, or override)
-     */
-    public void setRequiredModifier(ASModifier modifier)
-    {
-        if (fRequiredAndExcludedModifiers == null)
-            fRequiredAndExcludedModifiers = new HashMap<ASModifier, Boolean>(4);
-        fRequiredAndExcludedModifiers.put(modifier, Boolean.TRUE);
-    }
-
-    /**
-     * Add a modifier to the list of modifiers that must NOT be present in order
-     * for a definition to get through the filter
-     * 
-     * @param modifier modifier (e.g. static, final, or override)
-     */
-    public void setExcludedModifier(ASModifier modifier)
-    {
-        if (fRequiredAndExcludedModifiers == null)
-            fRequiredAndExcludedModifiers = new HashMap<ASModifier, Boolean>(4);
-        fRequiredAndExcludedModifiers.put(modifier, Boolean.FALSE);
-    }
-
-    /**
-     * Removes a modifier from this list of this either required or excluded
-     * 
-     * @param modifier the modifier
-     */
-    public void removeRequiredOrExcludedModifier(ASModifier modifier)
-    {
-        if (fRequiredAndExcludedModifiers != null)
-            fRequiredAndExcludedModifiers.remove(modifier);
-    }
-
-    /**
-     * Determines if the modifier is required by our filter to indicate a match
-     * 
-     * @param modifier the modifier we are looking for
-     * @return true if we require a modifer
-     */
-    public boolean requiresModifier(ASModifier modifier)
-    {
-        if (fRequiredAndExcludedModifiers != null)
-        {
-            Object object = fRequiredAndExcludedModifiers.get(modifier);
-            if (object instanceof Boolean)
-                return ((Boolean)object).booleanValue();
-        }
-        return false;
-    }
-
-    /**
-     * Determines if the modifier is excluded by our filter to indicate a match
-     * 
-     * @param modifier the modifier we are looking for
-     * @return true if we exclude a modifer
-     */
-    public boolean excludesModifier(ASModifier modifier)
-    {
-        if (fRequiredAndExcludedModifiers != null)
-        {
-            Object object = fRequiredAndExcludedModifiers.get(modifier);
-            if (object instanceof Boolean)
-                return !((Boolean)object).booleanValue();
-        }
-        return false;
-    }
-
-    public void setIncludeImplicitsAndConstructors(boolean includeImplicitsAndConstructors)
-    {
-        fIncludeImplicitsAndConstructors = includeImplicitsAndConstructors;
-    }
-
-    public boolean shouldIncludeImplicitsAndConstructors()
-    {
-        return fIncludeImplicitsAndConstructors;
-    }
-
-    private boolean isClassMember(IDefinition definition)
-    {
-        return definition.getParent() instanceof IClassDefinition;
-    }
-
-    /**
-     * Determines if this filter is looking to match against a user-defined
-     * namespace
-     * 
-     * @return true if this is not a built-in namespace
-     */
-    public boolean isUserDefinedNamespace()
-    {
-        return (fAccessRule != null) && (fAccessRule != AccessValue.AS3) && (fAccessRule.namespaceDef != null);
-    }
-
-    /**
-     * Does the definition match the lists of required/excluded modifiers in
-     * this filter?
-     * 
-     * @param definition definition to test
-     * @return true if this definition matches the modifier requirements
-     */
-    public boolean matchesModifierRules(IDefinition definition)
-    {
-        if (fIncludeExcluded != null && !fIncludeExcluded)
-        {
-            boolean exclude = shouldBeExcluded(definition);
-            if (exclude)
-                return false;
-        }
-
-        if (fRequiredAndExcludedModifiers == null)
-            return true;
-
-        Iterator<ASModifier> modifiers = fRequiredAndExcludedModifiers.keySet().iterator();
-        while (modifiers.hasNext())
-        {
-            ASModifier modifier = modifiers.next();
-
-            // static only applies to class variables and class methods, so ignore
-            // all other cases
-            if (modifier.equals(ASModifier.STATIC))
-            {
-                //if we're a member, keep going unless we're a constructor of a class
-                if (!isClassMember(definition) ||
-                    (isClassMember(definition) &&
-                     definition instanceof IFunctionDefinition &&
-                     ((IFunctionDefinition)definition).isConstructor()))
-                {
-                    continue;
-                }
-            }
-            // final only applies to classes and class methods, so ignore all other cases
-            else if (modifier.equals(ASModifier.FINAL))
-            {
-                if (!(definition instanceof IClassDefinition) &&
-                    (!(definition instanceof IFunctionDefinition) || !isClassMember(definition)))
-                {
-                    continue;
-                }
-            }
-            // override only applies to class methods, so ignore all other cases
-            else if (modifier.equals(ASModifier.OVERRIDE))
-            {
-                if (!(definition instanceof IFunctionDefinition) || !isClassMember(definition))
-                    continue;
-            }
-            // native only applies to functions, so ignore all other cases
-            else if (modifier.equals(ASModifier.NATIVE))
-            {
-                if (!(definition instanceof IFunctionDefinition))
-                    continue;
-            }
-            // dynamic only applies to classes, so ignore all other cases
-            else if (modifier.equals(ASModifier.DYNAMIC))
-            {
-                if (!(definition instanceof IClassDefinition))
-                    continue;
-            }
-
-            if (fRequiredAndExcludedModifiers.get(modifier) == Boolean.TRUE)
-            {
-                if (!definition.hasModifier(modifier))
-                    return false;
-            }
-            else
-            {
-                if (definition.hasModifier(modifier))
-                    return false;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Should the definition be excluded from lookup results because it has
-     * [ExcludeClass] metadata. This method does not check the includeExcluded
-     * flag, it simply checks the definition for the presence of the metadata
-     * 
-     * @param definition the definition to check
-     * @return true, if the definition should be excluded based on ExcludeClass
-     * metadata
-     */
-    private static boolean shouldBeExcluded(IDefinition definition)
-    {
-        if (definition instanceof IClassDefinition)
-        {
-            // Skip any package members that are marked [ExcludeClass]
-            IMetaTag[] metaAttributes =
-                    ((IClassDefinition)definition).getMetaTagsByName(
-                            IMetaAttributeConstants.ATTRIBUTE_EXCLUDECLASS);
-            if (metaAttributes.length > 0)
-                return true;
-        }
-        else if (definition instanceof IInterfaceDefinition)
-        {
-            IMetaTag[] tags = ((IInterfaceDefinition)definition).getMetaTagsByName(IMetaAttributeConstants.ATTRIBUTE_EXCLUDECLASS);
-            if (tags.length > 0)
-            {
-                return true;
-            }
-        }
-        else if (definition instanceof IFunctionDefinition)
-        {
-            if (((IFunctionDefinition)definition).isConstructor())
-            {
-                IDefinition type = definition.getAncestorOfType(IClassDefinition.class);
-                if (type instanceof IClassDefinition)
-                {
-                    IMetaTag[] metaAttributes =
-                            ((IClassDefinition)type).getMetaTagsByName(
-                                    IMetaAttributeConstants.ATTRIBUTE_EXCLUDECLASS);
-                    if (metaAttributes.length > 0)
-                        return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Does the definition match the classification portion of this filter?
-     * 
-     * @param definition definition to test
-     * @return true iff this definition matches the classification rule
-     */
-    public boolean matchesClassificationRule(IDefinition definition)
-    {
-        if (fClassificationRule == ClassificationValue.ALL)
-        {
-            return true;
-        }
-        else if (fClassificationRule == ClassificationValue.ALL_NO_ACCESSORS)
-        {
-            if (definition instanceof IGetterDefinition ||
-                definition instanceof ISetterDefinition)
-            {
-                return false;
-            }
-            return true;
-        }
-        else if (fClassificationRule == ClassificationValue.OBJECTS)
-        {
-            // don't exclude getters and setters
-            return !(definition instanceof IFunctionDefinition) ||
-                     definition instanceof IVariableDefinition;
-        }
-        else if (fClassificationRule == ClassificationValue.ACCESSORS)
-        {
-            return definition instanceof IAccessorDefinition;
-        }
-        else if (fClassificationRule == ClassificationValue.VARIABLES_AND_FUNCTIONS)
-        {
-            return definition instanceof IVariableDefinition ||
-                   definition instanceof IFunctionDefinition ||
-                   definition instanceof IAccessorDefinition;
-        }
-        else if (fClassificationRule == ClassificationValue.GETTERS)
-        {
-            return definition instanceof IGetterDefinition;
-        }
-        else if (fClassificationRule == ClassificationValue.SETTERS)
-        {
-            return definition instanceof ISetterDefinition;
-        }
-        else if (fClassificationRule == ClassificationValue.VARIABLES)
-        {
-            return definition instanceof IVariableDefinition;
-        }
-        else if (fClassificationRule == ClassificationValue.META_TAG_TYPES)
-        {
-            return definition instanceof IMetadataDefinition;
-        }
-        else if (fClassificationRule == ClassificationValue.FUNCTIONS ||
-                 fClassificationRule == ClassificationValue.VARIABLES_AND_FUNCTIONS)
-        {
-            //we might have an anonymous function, and if that's the case, if we have a variable, see if it's of type function
-            //if it is, return true
-            if (definition instanceof IVariableDefinition)
-            {
-                if (definition.getTypeAsDisplayString().equals(IASLanguageConstants.Function) || 
-                		fClassificationRule == ClassificationValue.VARIABLES_AND_FUNCTIONS)
-                    return true;
-            }
-
-            if (definition instanceof IFunctionDefinition)
-            {
-                return true;
-            }
-
-            // if we have a class, but we're filtering on functions, check for
-            // a constructor
-            if (definition instanceof ClassDefinition)
-            {
-                IFunctionDefinition ctor = ((ClassDefinition)definition).getConstructor();
-                return ctor != null;
-            }
-
-            return false;
-        }
-        else if (fClassificationRule == ClassificationValue.NAMESPACES)
-        {
-            return definition instanceof INamespaceDefinition;
-        }
-        else if (fClassificationRule == ClassificationValue.CLASSES)
-        {
-            return definition instanceof IClassDefinition;
-        }
-        else if (fClassificationRule == ClassificationValue.INTERFACES)
-        {
-            return definition instanceof IInterfaceDefinition;
-        }
-        else if (fClassificationRule == ClassificationValue.CLASSES_AND_INTERFACES)
-        {
-            return (definition instanceof IClassDefinition || definition instanceof IInterfaceDefinition);
-        }
-        else if (fClassificationRule == ClassificationValue.PACKAGES)
-        {
-            return definition instanceof IPackageDefinition;
-        }
-        else if (fClassificationRule == ClassificationValue.CLASSES_INTERFACES_AND_PACKAGES)
-        {
-            return (definition instanceof IClassDefinition ||
-                    definition instanceof IInterfaceDefinition || definition instanceof IPackageDefinition);
-        }
-        else if (fClassificationRule == ClassificationValue.CLASSES_INTERFACES_AND_NAMESPACES)
-        {
-            return (definition instanceof IClassDefinition ||
-                    definition instanceof IInterfaceDefinition || definition instanceof INamespaceDefinition);
-        }
-        else if (fClassificationRule == ClassificationValue.CLASSES_AND_PACKAGES)
-        {
-            return (definition instanceof IClassDefinition || definition instanceof IPackageDefinition);
-        }
-        else if (fClassificationRule == ClassificationValue.INTERFACES_AND_PACKAGES)
-        {
-            return (definition instanceof IInterfaceDefinition || definition instanceof IPackageDefinition);
-        }
-        else if (fClassificationRule == ClassificationValue.MEMBERS_AND_TYPES)
-        {
-            return definition instanceof IClassDefinition ||
-                   definition instanceof IFunctionDefinition ||
-                   definition instanceof IInterfaceDefinition ||
-                   definition instanceof IVariableDefinition ||
-                   definition instanceof INamespaceDefinition;
-        }
-        else if (fClassificationRule == ClassificationValue.TYPES_FUNCTIONS_AND_VARIABLES)
-        {
-            return definition instanceof IClassDefinition ||
-                   (definition instanceof IFunctionDefinition &&
-                     !((IFunctionDefinition)definition).isCastFunction() &&
-                     !((IFunctionDefinition)definition).isConstructor() &&
-                     !(definition instanceof IGetterDefinition) &&
-                     !(definition instanceof ISetterDefinition)) ||
-                    definition instanceof IVariableDefinition ||
-                    definition instanceof IInterfaceDefinition;
-        }
-        else if (fClassificationRule == ClassificationValue.CLASSES_INTERFACES_AND_FUNCTIONS)
-        {
-            return definition instanceof IClassDefinition ||
-                   definition instanceof IFunctionDefinition ||
-                   definition instanceof IInterfaceDefinition;
-        }
-        else
-        {
-            // If we get here, the filter has been created with an invalid value.
-            return false;
-        }
-    }
-
-    /**
-     * Does this definition match the implicits/constructors part of this
-     * filter?
-     * 
-     * @param definition node to test
-     * @param scope {@link ASScope} containing the original reference that we
-     * are resolving, can be null for project leve lookups.
-     * @return true iff this node matches the implicits/constructors rule
-     */
-    public boolean matchesIncludeImplicitsAndConstructorsRule(IDefinition definition, ASScope scope)
-    {
-        boolean isImplicit = definition.isImplicit();
-        boolean isConstructor = (definition instanceof IFunctionDefinition) && ((IFunctionDefinition)definition).isConstructor();
-
-        if ((!isImplicit) && (!isConstructor))
-            return true;
-
-        if (fIncludeImplicitsAndConstructors)
-        {
-            // implicit definition and constructors that
-            // are inherited by the main name resolution code
-            // should always be filtered out.
-            // See http://bugs.adobe.com/jira/browse/CMP-1064 for
-            // an example.
-
-            // If this lookup does not originate from an ASScope, then
-            // the implicit definitions could not have been inherited so
-            // return true.
-            if (scope == null)
-                return true;
-
-            // if the definition does not have a containing
-            // scope it can not be inherited, so return true.
-            if (definition.getContainingScope() == null)
-                return true;
-
-            // if the definition associated with the definition is
-            // not a type definition ( like a class or interface ), then
-            // the definition can not be inherited, so return true.
-            if (!(definition.getContainingScope().getDefinition() instanceof TypeDefinitionBase))
-                return true;
-
-            // At this point the definition is known to be a member of a class
-            // or interface.
-            // We need to determine if the scope containing the
-            // definition is an instance scope that is on the scope
-            // chain.
-
-            ASScope currentScope = scope;
-
-            // If the scope chain starts at a type scope
-            // switch to the instance scope view of that type scope.
-            if (currentScope instanceof TypeScope)
-            {
-                currentScope = ((TypeScope)currentScope).getInstanceScope();
-            }
-            else
-            {
-                // Walk up the scope chain until we find a the instance scope for the enclosing
-                // type if there is one.
-                while ((currentScope != null) && (!(currentScope.getDefinition() instanceof TypeDefinitionBase)))
-                    currentScope = currentScope.getContainingScope();
-
-                // There is no enclosing type scope on the scope chain, so we should
-                // filter out the definition ( by returning false ).
-                if (currentScope == null)
-                    return false;
-            }
-
-            assert (currentScope.getDefinition() instanceof TypeDefinitionBase);
-            if (currentScope == definition.getContainingScope())
-                return true;
-        }
-
-        return false;
-
-    }
-
-    /**
-     * Get the require imports value
-     */
-    public RequireImportsValue getRequireImportsValue()
-    {
-        return fRequireImportsRule;
-    }
-
-    /**
-     * Get the context node or null
-     * 
-     * @return context node
-     */
-    public IFilterContext getContext()
-    {
-        return fContext;
-    }
-
-    /**
-     * Does this filter indicate that we should look in base classes and
-     * interfaces?
-     * 
-     * @return true iff we should search inherited scopes
-     */
-    public boolean searchInheritedScopes()
-    {
-        return fSearchScopeRule == SearchScopeValue.ALL_SCOPES ||
-               fSearchScopeRule == SearchScopeValue.INHERITED_MEMBERS;
-    }
-
-    /**
-     * Does this filter indicate that we should look in enclosing blocks
-     * (functions, classes, packages, etc.)?
-     * 
-     * @return true if we should search in containing scopes
-     */
-    public boolean searchContainingScope()
-    {
-        return fSearchScopeRule == SearchScopeValue.ALL_SCOPES ||
-               fSearchScopeRule == SearchScopeValue.CONTAINING_SCOPES;
-    }
-
-    /**
-     * Create a member filter that's appropriate for the given object
-     * definition.
-     * 
-     * @param object the object whose members we want
-     * @param objectDefinition the definition of the object type
-     * @param classificationRule type of data we're searching for (function,
-     * object, variable, whatever)
-     * @param project
-     * @param context the context node (to be used to determine the current
-     * imports and package)
-     * @return appropriate ASDefinitionFilter for member lookup
-     */
-    static public ASDefinitionFilter createMemberFilter(IExpressionNode object,
-                                                        IDefinition objectDefinition,
-                                                        ClassificationValue classificationRule,
-                                                        ICompilerProject project, IFilterContext context)
-    {
-        boolean requireStatic = true;
-        boolean excludeStatic = false;
-        AccessValue accessRule = ASDefinitionFilter.AccessValue.PUBLIC;
-
-        if (objectDefinition instanceof IVariableDefinition)
-        {
-            requireStatic = false;
-            excludeStatic = true;
-
-            ITypeDefinition variableType = objectDefinition.resolveType(project);
-            if (variableType instanceof IClassDefinition)
-            {
-                // If this member access expression is located inside a class definition, we should allow
-                // the user to see private members of variables of that class type and protected members
-                // of variables of base class types.
-                accessRule = adjustAccessRuleForContainingClass(object, (IClassDefinition)variableType, accessRule, project);
-            }
-        }
-        else if (objectDefinition instanceof IClassDefinition ||
-                 objectDefinition instanceof IInterfaceDefinition)
-        {
-            if (!(object instanceof IdentifierNode) &&
-                !(object instanceof MemberAccessExpressionNode))
-            {
-                // If the thing on the left is just some random expression, it can't
-                // be a static.
-                requireStatic = false;
-                excludeStatic = true;
-            }
-
-            if (objectDefinition instanceof IClassDefinition)
-            {
-                accessRule = adjustAccessRuleForContainingClass(object, (IClassDefinition)objectDefinition, accessRule, project);
-            }
-        }
-        else if (objectDefinition instanceof IPackageDefinition ||
-                 objectDefinition instanceof IFunctionDefinition)
-        {
-            requireStatic = false;
-            excludeStatic = false;
-        }
-
-        SearchScopeValue searchRule = ASDefinitionFilter.SearchScopeValue.INHERITED_MEMBERS;
-
-        ASDefinitionFilter filter = new ASDefinitionFilter(classificationRule, searchRule, accessRule, context);
-        if (requireStatic)
-            filter.setRequiredModifier(ASModifier.STATIC);
-        if (excludeStatic)
-            filter.setExcludedModifier(ASModifier.STATIC);
-
-        return filter;
-    }
-
-    /**
-     * Get the containing class. This particular version will even find the
-     * class if the current file is included by a host file and their scopes are
-     * temporarily connected (see Project.connectToIncluder).
-     * 
-     * @param node node to test
-     * @return enclosing class (or null, if no such class can be found)
-     */
-    static private IClassNode getContainingClass(IASNode node)
-    {
-        IClassNode containingClass = (IClassNode)node.getAncestorOfType(IClassNode.class);
-        while (node != null && containingClass == null)
-        {
-            FileNode containingFile = (FileNode)node.getAncestorOfType(FileNode.class);
-            IASScope scope = null;
-            if (containingFile != null)
-                scope = containingFile.getTemporaryEnclosingScope(new RecursionGuard());
-
-            node = containingFile != null ? (scope != null ? scope.getScopeNode() : null) : null;
-            containingClass = node != null ? containingClass = (IClassNode)node.getAncestorOfType(IClassNode.class) : null;
-        }
-        return containingClass;
-    }
-
-    /**
-     * If the member access is taking place inside a class definition, adjust
-     * the access rule to allow private members (if the object's type matches
-     * the class) or protected members (if the object's type matches a base
-     * class of the class).
-     * 
-     * @param memberAccessExpression member access expression for which to
-     * generate the filter
-     * @param resolvedObjectType type of the object in the member access
-     * expression
-     * @param accessRule current access rule
-     * @return new access rule, combining the current value with whatever new
-     * members are allowed (see unionAccessRules)
-     */
-    static private AccessValue adjustAccessRuleForContainingClass(IASNode memberAccessExpression, IClassDefinition resolvedObjectType, AccessValue accessRule, ICompilerProject project)
-    {
-        // If this member access expression is located inside a class definition, we should allow
-        // the user to see private members of variables of that class type and protected members
-        // of variables of base class types.
-        AccessValue newVal = accessRule;
-
-        IClassNode containingClass = getContainingClass(memberAccessExpression);
-        if (containingClass != null)
-        {
-            IClassDefinition containingClassDefinition = containingClass.getDefinition();
-            if (containingClassDefinition.getQualifiedName().equals(resolvedObjectType.getQualifiedName()))
-            {
-                newVal = AccessValue.PRIVATE;
-            }
-            else
-            {
-                IClassDefinition[] ancestors = containingClassDefinition.resolveAncestry(project);
-                for (IClassDefinition ancestor : ancestors)
-                {
-                    if (ancestor.equals(resolvedObjectType))
-                    {
-                        newVal = AccessValue.PROTECTED;
-                        break;
-                    }
-                }
-            }
-        }
-
-        return newVal;
-    }
-
-    /**
-     * Create a filter that matches all functions in all scopes (including
-     * private members)
-     * 
-     * @param context the context node (to be used to determine the current
-     * imports and package and static/not)
-     * @return the filter
-     */
-    @Deprecated
-    static public ASDefinitionFilter createAllFunctionsFilter(IASNode context)
-    {
-        return createAllFunctionsFilter(new NodeFilterContext(context));
-    }
-
-    /**
-     * Create a filter that matches all functions in all scopes (including
-     * private members)
-     * 
-     * @param context the context node (to be used to determine the current
-     * imports and package and static/not)
-     * @return the filter
-     */
-    @Deprecated
-    static public ASDefinitionFilter createAllFunctionsFilter(IDefinition context)
-    {
-        return createAllFunctionsFilter(new DefinitionFilterContext(context));
-    }
-
-    /**
-     * Create a filter that matches all functions in all scopes (including
-     * private members)
-     * 
-     * @param context the context filter (to be used to determine the current
-     * imports and package and static/not)
-     * @return the filter
-     */
-    static public ASDefinitionFilter createAllFunctionsFilter(IFilterContext context)
-    {
-        boolean contextIsStatic = false;
-        if (context != null)
-            contextIsStatic = context.isInStaticContext();
-        ASDefinitionFilter filter = new ASDefinitionFilter(ClassificationValue.FUNCTIONS, SearchScopeValue.ALL_SCOPES, AccessValue.PRIVATE, context);
-        if (contextIsStatic)
-            filter.setRequiredModifier(ASModifier.STATIC);
-        return filter;
-    }
-
-    /**
-     * Create a filter that matches all objects (variables, classes, interfaces,
-     * or packages) in all scopes (including private members)
-     * 
-     * @param context the context node (to be used to determine the current
-     * imports and package and static/not)
-     * @return the filter
-     */
-    @Deprecated
-    static public ASDefinitionFilter createAllObjectsFilter(IASNode context)
-    {
-        return createAllObjectsFilter(new NodeFilterContext(context));
-    }
-
-    /**
-     * Create a filter that matches all objects (variables, classes, interfaces,
-     * or packages) in all scopes (including private members)
-     * 
-     * @param context the context node (to be used to determine the current
-     * imports and package and static/not)
-     * @return the filter
-     */
-    @Deprecated
-    static public ASDefinitionFilter createAllObjectsFilter(IDefinition context)
-    {
-        return createAllObjectsFilter(new DefinitionFilterContext(context));
-    }
-
-    /**
-     * Create a filter that matches all objects (variables, classes, interfaces,
-     * or packages) in all scopes (including private members)
-     * 
-     * @param context the context node (to be used to determine the current
-     * imports and package and static/not)
-     * @return the filter
-     */
-    static public ASDefinitionFilter createAllObjectsFilter(IFilterContext context)
-    {
-        boolean contextIsStatic = false;
-        if (context != null)
-            contextIsStatic = context.isInStaticContext();
-        ASDefinitionFilter filter = new ASDefinitionFilter(ClassificationValue.OBJECTS, SearchScopeValue.ALL_SCOPES, AccessValue.PRIVATE, context);
-        if (contextIsStatic)
-            filter.setRequiredModifier(ASModifier.STATIC);
-        return filter;
-    }
-
-    /**
-     * Create a filter that matches all objects (variables, functions classes,
-     * interfaces, or packages) in all scopes (including private members)
-     * 
-     * @param context the context node (to be used to determine the current
-     * imports and package and static/not)
-     * @return the filter
-     */
-    @Deprecated
-    static public ASDefinitionFilter createAllSymbolsFilter(IASNode context)
-    {
-        return createAllSymbolsFilter(new NodeFilterContext(context));
-    }
-
-    /**
-     * Create a filter that matches all objects (variables, functions classes,
-     * interfaces, or packages) in all scopes (including private members)
-     * 
-     * @param context the context node (to be used to determine the current
-     * imports and package and static/not)
-     * @return the filter
-     */
-    static public ASDefinitionFilter createAllSymbolsFilter(IFilterContext context)
-    {
-        boolean contextIsStatic = false;
-        if (context != null)
-            contextIsStatic = context.isInStaticContext();
-        ASDefinitionFilter filter = new ASDefinitionFilter(ClassificationValue.ALL, SearchScopeValue.ALL_SCOPES, AccessValue.PRIVATE, context);
-        if (contextIsStatic)
-            filter.setRequiredModifier(ASModifier.STATIC);
-        filter.setIncludeExcludedClasses(true);
-        return filter;
-    }
-
-    /**
-     * Create a filter that matches all classes in all scopes
-     * 
-     * @param context the filter context (to be used to determine the current
-     * imports and package)
-     * @return the filter
-     */
-    static public ASDefinitionFilter createAllClassesFilter(IFilterContext context)
-    {
-        ASDefinitionFilter definitionFilter = new ASDefinitionFilter(ClassificationValue.CLASSES, SearchScopeValue.ALL_SCOPES, AccessValue.PUBLIC, context);
-        return definitionFilter;
-    }
-
-    /**
-     * Create a filter that matches all classes in all scopes
-     * 
-     * @param context the context node (to be used to determine the current
-     * imports and package)
-     * @return the filter
-     */
-    static public ASDefinitionFilter createAllClassesFilter(IASNode context)
-    {
-        return createAllClassesFilter(new NodeFilterContext(context));
-    }
-
-    /**
-     * Create a filter that matches all interfaces in all scopes
-     * 
-     * @param context the filter context (to be used to determine the current
-     * imports and package)
-     * @return the filter
-     */
-    static public ASDefinitionFilter createAllInterfacesFilter(IFilterContext context)
-    {
-        ASDefinitionFilter definitionFilter = new ASDefinitionFilter(ClassificationValue.INTERFACES, SearchScopeValue.ALL_SCOPES, AccessValue.PUBLIC, context);
-        return definitionFilter;
-    }
-
-    /**
-     * Create a filter that matches all interfaces in all scopes
-     * 
-     * @param context the context node (to be used to determine the current
-     * imports and package)
-     * @return the filter
-     */
-    static public ASDefinitionFilter createAllInterfacesFilter(IASNode context)
-    {
-        return createAllInterfacesFilter(new NodeFilterContext(context));
-    }
-
-    /**
-     * Create a filter that matches all classes and all interfaces in all scopes
-     * 
-     * @param context the context node (to be used to determine the current
-     * imports and package)
-     * @return the filter
-     */
-    static public ASDefinitionFilter createAllClassesAndInterfacesFilter(IASNode context)
-    {
-        ASDefinitionFilter definitionFilter = new ASDefinitionFilter(ClassificationValue.CLASSES_AND_INTERFACES, SearchScopeValue.ALL_SCOPES, AccessValue.PUBLIC, context);
-        return definitionFilter;
-    }
-
-    /**
-     * Create a filter that matches all classes, packages and all interfaces in
-     * all scopes
-     * 
-     * @param context the context node (to be used to determine the current
-     * imports and package)
-     * @return the filter
-     */
-    static public ASDefinitionFilter createAllClassesInterfacesAndPackagesFilter(IASNode context)
-    {
-        ASDefinitionFilter definitionFilter = new ASDefinitionFilter(ClassificationValue.CLASSES_INTERFACES_AND_PACKAGES, SearchScopeValue.ALL_SCOPES, AccessValue.PUBLIC, context);
-        return definitionFilter;
-    }
-
-    /**
-     * Create a filter that matches all namespaces in all scopes
-     * 
-     * @param context the context node (to be used to determine the current
-     * imports and package)
-     * @return the filter
-     */
-    static public ASDefinitionFilter createAllNamespacesFilter(IASNode context)
-    {
-        return createAllNamespacesFilter(new NodeFilterContext(context));
-    }
-
-    /**
-     * Create a filter that matches all namespaces in all scopes
-     * 
-     * @param context the context node (to be used to determine the current
-     * imports and package)
-     * @return the filter
-     */
-    static public ASDefinitionFilter createAllNamespacesFilter(IFilterContext context)
-    {
-        ASDefinitionFilter definitionFilter = new ASDefinitionFilter(ClassificationValue.NAMESPACES, SearchScopeValue.ALL_SCOPES, AccessValue.PUBLIC, context);
-        return definitionFilter;
-    }
-
-    /**
-     * Create a filter that matches immediate members of a package, class, or
-     * interface
-     * 
-     * @param memberedDefinition definition whose members will be retrieved
-     * using this filter
-     * @param classificationValue classifications (CLASS, FUNCTION, ALL)
-     * @param includePrivateInternalAndNamespaceMembers if true, this filter
-     * will include private, protected, internal, custom namespaced and public
-     * members if false, this filter will only include public members
-     * @return definition filter for retrieving the members
-     */
-    static public ASDefinitionFilter createImmediateMemberFilter(IDefinitionNode memberedDefinition, ClassificationValue classificationValue, boolean includePrivateInternalAndNamespaceMembers)
-    {
-        // If we're including private and internal members, then we should
-        // set the access value to PRIVATE and make sure that our context has
-        // the same package name as the class.  If not, then we should set the
-        // access value to PUBLIC and make sure that our context does not have
-        // the same package name as the class.
-        AccessValue accessValue = AccessValue.PUBLIC;
-        IASNode context = null;
-        boolean dontRequireImports = false;
-        if (includePrivateInternalAndNamespaceMembers)
-        {
-            accessValue = AccessValue.ALL;
-            context = memberedDefinition;
-            // don't require imports, so that we won't do namespace filtering.  This
-            // is a problem, as member methods within a different namespace weren't
-            // being included in the members
-            dontRequireImports = true;
-        }
-        ASDefinitionFilter definitionFilter = new ASDefinitionFilter(classificationValue, SearchScopeValue.IMMEDIATE_MEMBERS, accessValue, context);
-        if (dontRequireImports)
-            definitionFilter.setRequireImports(RequireImportsValue.NO);
-
-        return definitionFilter;
-    }
-
-    static public ASDefinitionFilter createImmediateMemberFilter(IDefinition memberedDefinition, ClassificationValue classificationValue, boolean includePrivateInternalAndNamespaceMembers)
-    {
-        // If we're including private and internal members, then we should
-        // set the access value to PRIVATE and make sure that our context has
-        // the same package name as the class.  If not, then we should set the
-        // access value to PUBLIC and make sure that our context does not have
-        // the same package name as the class.
-        AccessValue accessValue = AccessValue.PUBLIC;
-        IDefinition context = null;
-        boolean dontRequireImports = false;
-        if (includePrivateInternalAndNamespaceMembers)
-        {
-            accessValue = AccessValue.ALL;
-            context = memberedDefinition;
-            // don't require imports, so that we won't do namespace filtering.  This
-            // is a problem, as member methods within a different namespace weren't
-            // being included in the members
-            dontRequireImports = true;
-        }
-        ASDefinitionFilter definitionFilter = new ASDefinitionFilter(classificationValue, SearchScopeValue.IMMEDIATE_MEMBERS, accessValue, context);
-        if (dontRequireImports)
-            definitionFilter.setRequireImports(RequireImportsValue.NO);
-
-        return definitionFilter;
-    }
-
-    /**
-     * Create a filter that matches members that are included from a code
-     * fragment
-     * 
-     * @param classificationValue classifications (CLASS, FUNCTION, ALL)
-     * @return definition filter for retrieving the members
-     */
-    static public ASDefinitionFilter createIncludedSymbolsFilter(ClassificationValue classificationValue, IASNode context)
-    {
-        return ASDefinitionFilter.createIncludedSymbolsFilter(classificationValue, new NodeFilterContext(context));
-    }
-
-    /**
-     * Create a filter that matches members that are included from a code
-     * fragment
-     * 
-     * @param classificationValue classifications (CLASS, FUNCTION, ALL)
-     * @return definition filter for retrieving the members
-     */
-    static public ASDefinitionFilter createIncludedSymbolsFilter(ClassificationValue classificationValue, IFilterContext context)
-    {
-        ASDefinitionFilter definitionFilter = new ASDefinitionFilter(classificationValue, SearchScopeValue.IMMEDIATE_MEMBERS, AccessValue.INCLUDED, context);
-        return definitionFilter;
-    }
-
-    /**
-     * Create a filter that matches all members of a package, class, or
-     * interface (including inherited ones
-     * 
-     * @param memberedDefinition definition whose members will be retrieved
-     * using this filter
-     * @param classificationValue classifications (CLASS, FUNCTION, ALL)
-     * @param includePrivateAndInternalMembers if true, this filter will include
-     * private, protected, internal, and public members if false, this filter
-     * will only include public members
-     * @return definition filter for retrieving the members
-     */
-    static public ASDefinitionFilter createInheritedMemberFilter(IDefinitionNode memberedDefinition, ClassificationValue classificationValue, boolean includePrivateAndInternalMembers)
-    {
-        // If we're including private and internal members, then we should
-        // set the access value to PRIVATE and make sure that our context has
-        // the same package name as the class.  If not, then we should set the
-        // access value to PUBLIC and make sure that our context does not have
-        // the same package name as the class.
-        AccessValue accessValue = AccessValue.PUBLIC;
-        IASNode context = null;
-        if (includePrivateAndInternalMembers)
-        {
-            accessValue = AccessValue.PRIVATE;
-            context = memberedDefinition;
-        }
-        return new ASDefinitionFilter(classificationValue, SearchScopeValue.INHERITED_MEMBERS, accessValue, context);
-    }
-
-    static public ASDefinitionFilter createInheritedMemberFilter(IDefinition memberedDefinition, ClassificationValue classificationValue, boolean includePrivateAndInternalMembers)
-    {
-        // If we're including private and internal members, then we should
-        // set the access value to PRIVATE and make sure that our context has
-        // the same package name as the class.  If not, then we should set the
-        // access value to PUBLIC and make sure that our context does not have
-        // the same package name as the class.
-        AccessValue accessValue = AccessValue.PUBLIC;
-        IDefinition context = null;
-        if (includePrivateAndInternalMembers)
-        {
-            accessValue = AccessValue.PRIVATE;
-            context = memberedDefinition;
-        }
-        return new ASDefinitionFilter(classificationValue, SearchScopeValue.INHERITED_MEMBERS, accessValue, context);
-    }
-
-    /**
-     * Does this ASDefinitionFilter require the use of a different predicate to
-     * filter results found at the project level
-     * 
-     * @return true if the definitions found at the project level should use a
-     * different filter from the rest of the lookup
-     */
-    public boolean needsDifferentProjectPredicate()
-    {
-        return !includeExcludedClasses() || this.getProjectAccessRule() != null;
-    }
-
-    /**
-     * Generate a predicate that will apply the appropriate filtering for
-     * definitions found at the project level
-     * 
-     * @param project the Project the lookup is occurring in
-     * @param scope the scope where we are performing the lookup
-     * @return a Predicate that will correctly filter definitions found at the
-     * project level.
-     */
-    public Predicate<IDefinition> computeProjectPredicate(ICompilerProject project, ASScope scope)
-    {
-        Predicate<IDefinition> projectPredicate = null;
-        if (getProjectAccessRule() != null)
-        {
-            ASDefinitionFilter projectFilter = new ASDefinitionFilter(this);
-            projectFilter.setPrimaryAccessRule(this.getProjectAccessRule());
-            projectPredicate = projectFilter.computePredicate(project, scope);
-        }
-        else
-        {
-            projectPredicate = this.computePredicate(project, scope);
-        }
-        return projectPredicate;
-    }
-
-    /**
-     * Generate a predicate that will filter based on the various flags set on
-     * the ASDefinitionFilter.
-     * 
-     * @param project the Project the lookup is occurring in
-     * @param scope the scope where we are performing the lookup
-     * @return a Predicate that can be used to filter lookup results according
-     * to the settings of the ASDefinitionFilter
-     */
-    public Predicate<IDefinition> computePredicate(ICompilerProject project, ASScope scope)
-    {
-        Predicate<IDefinition> pred = null;
-
-        pred = new FilterPredicate(project, scope, this);
-
-        if (fAccessRule instanceof AccessValue.SpecialAccessValue)
-        {
-            Predicate<IDefinition> accessValPredicate = computeAccessValuePredicate(project, scope);
-            if (accessValPredicate != null)
-            {
-                pred = Predicates.and(pred, accessValPredicate);
-            }
-        }
-        if (!includeExcludedClasses())
-        {
-            Predicate<IDefinition> excludePred = new ExcludedPredicate(scope);
-            pred = Predicates.and(pred, excludePred);
-        }
-        return pred;
-    }
-
-    /**
-     * Generate a predicate based on the AccessValue of the ASDefinitionFilter.
-     * This predicate will do the right thing for private, protected, internal,
-     * or public access values.
-     */
-    public Predicate<IDefinition> computeAccessValuePredicate(ICompilerProject project, ASScope scope)
-    {
-        Predicate<IDefinition> pred = null;
-        if (fAccessRule == AccessValue.ALL)
-        {
-            pred = null;
-        }
-        else if (fAccessRule == AccessValue.PRIVATE)
-        {
-            pred = new PrivateAccessValuePredicate(project, fContext.getNamespaceSet(project));
-        }
-        else
-        {
-            if (fAccessRule == AccessValue.PUBLIC)
-            {
-                pred = new PublicAccessValuePredicate();
-            }
-            else if (fAccessRule == AccessValue.INTERNAL)
-            {
-                pred = new InternalAccessValuePredicate();
-            }
-            else if (fAccessRule == AccessValue.PROTECTED)
-            {
-                pred = new ProtectedAccessValuePredicate();
-            }
-            // CM expects these rules to match the public/internal/protected namespaces,
-            // but to also match stuff in the open namespaces wherever the lookup was occurring
-            if (pred != null)
-                pred = Predicates.or(pred, new NamespaceSetPredicate(project, fContext.getNamespaceSet(project)));
-        }
-        return pred;
-    }
-
-    /**
-     * Predicate used for filters set up with a "PUBLIC" access value.
-     */
-    private static class PublicAccessValuePredicate implements Predicate<IDefinition>
-    {
-        @Override
-        public boolean apply(IDefinition d)
-        {
-            INamespaceReference ns = d.getNamespaceReference();
-            if (ns.isLanguageNamespace())
-            {
-                boolean match = ns instanceof INamespaceDefinition.IPublicNamespaceDefinition ||
-                                ns instanceof INamespaceDefinition.IFilePrivateNamespaceDefinition ||
-                                ns instanceof INamespaceDefinition.IInterfaceNamespaceDefinition;
-                return match;
-            }
-            // user defined namespaces will be handled by another predicate
-            return false;
-        }
-    }
-
-    /**
-     * Predicate used for filters set up with a "INTERNAL" access value.
-     */
-    private static class InternalAccessValuePredicate implements Predicate<IDefinition>
-    {
-        @Override
-        public boolean apply(IDefinition d)
-        {
-            INamespaceReference ns = d.getNamespaceReference();
-            if (ns.isLanguageNamespace())
-            {
-                boolean match = ns.isPublicOrInternalNamespace() ||
-                                ns instanceof INamespaceDefinition.IFilePrivateNamespaceDefinition ||
-                                ns instanceof INamespaceDefinition.IInterfaceNamespaceDefinition;
-                return match;
-            }
-
-            // user defined namespaces will be handled by another predicate
-            return false;
-        }
-    }
-
-    /**
-     * Predicate used for filters set up with a "PROTECTED" access value.
-     */
-    private static class ProtectedAccessValuePredicate implements Predicate<IDefinition>
-    {
-        @Override
-        public boolean apply(IDefinition d)
-        {
-            INamespaceReference nsRef = d.getNamespaceReference();
-            if (nsRef.isLanguageNamespace())
-            {
-                boolean match = nsRef.isPublicOrInternalNamespace() ||
-                                nsRef instanceof INamespaceDefinition.IProtectedNamespaceDefinition ||
-                                nsRef instanceof INamespaceDefinition.IFilePrivateNamespaceDefinition ||
-                                nsRef instanceof INamespaceDefinition.IInterfaceNamespaceDefinition;
-                return match;
-            }
-
-            // user defined namespaces will be handled by another predicate
-            return false;
-        }
-    }
-
-    /**
-     * This implements a very simple namespace set predicate for use in
-     * combination with the various AccessValue Predicates. It does not do the
-     * right thing with respect to protected namespaces - however, when it is
-     * used as intended with the AccessValue predicates this is not an issue as
-     * CM clients construct filters with "PROTECTED" AccessValues only where
-     * they want to find all protecteds, and this does the right thing in that
-     * case.
-     */
-    private static class NamespaceSetPredicate implements Predicate<IDefinition>
-    {
-        protected Set<INamespaceDefinition> nsSet;
-        protected ICompilerProject project;
-
-        NamespaceSetPredicate(ICompilerProject project, Set<INamespaceDefinition> set)
-        {
-            nsSet = set;
-            this.project = project;
-        }
-
-        @Override
-        public boolean apply(IDefinition d)
-        {
-            INamespaceDefinition namespace = d.resolveNamespace(project);
-            if (nsSet.contains(namespace))
-                return true;
-
-            return false;
-
-        }
-
-    }
-
-    /**
-     * Predicate used for filters set up with a "PRIVATE" access value. This
-     * will find the private members of the containing class, but no private
-     * members from base classes, which is what CM clients expect.
-     */
-    private static class PrivateAccessValuePredicate extends NamespaceSetPredicate
-    {
-        PrivateAccessValuePredicate(ICompilerProject project, Set<INamespaceDefinition> set)
-        {
-            super(project, set);
-        }
-
-        @Override
-        public boolean apply(IDefinition d)
-        {
-            INamespaceReference nsRef = d.getNamespaceReference();
-            if (nsRef instanceof INamespaceDefinition.IPrivateNamespaceDefinition || !nsRef.isLanguageNamespace())
-            {
-                // If it's a private namespace, or a user defined namespace, then check if it is in our namespace set
-                // FB says it wants private properties, but it really means it only wants private properties
-                // that are in the open namespace set
-                return super.apply(d);
-            }
-            // If it's any other kind of language namespace, then CM wants it included
-            return true;
-        }
-
-    }
-
-    /**
-     * Predicate to filter out classes and interfaces with [ExcludeClass]
-     * metadata
-     */
-    private static class ExcludedPredicate implements Predicate<IDefinition>
-    {
-        private String filePath;
-
-        /**
-         * @param scope
-         */
-        public ExcludedPredicate(ASScope scope)
-        {
-            if (scope != null)
-            {
-                ASScope fileScope = scope.getFileScope();
-                if (fileScope instanceof ASFileScope)
-                {
-                    filePath = ((ASFileScope)fileScope).getContainingPath();
-                }
-            }
-        }
-
-        @Override
-        public boolean apply(IDefinition arg0)
-        {
-            // check whether the definition is in the same file as the scope
-            // if the files are same, then apply filter only in case of
-            // mxml files and definitions present directly under file 
-            // scope (Component tag in mxml)
-
-            IASScope containingScope = arg0.getContainingScope();
-            if (containingScope != null && containingScope instanceof ASScope)
-            {
-                IASScope fileScope = ((ASScope)containingScope).getFileScope();
-                String defPath = ""; //$NON-NLS-1$
-                if (fileScope instanceof ASFileScope)
-                {
-                    defPath = ((ASFileScope)fileScope).getContainingPath();
-                }
-                if (filePath != null && defPath.equals(filePath))
-                {
-                    // same file, apply filter only in case of mxml
-                    if (containingScope instanceof MXMLFileScope)
-                        return !ASDefinitionFilter.shouldBeExcluded(arg0);
-
-                    return true;
-                }
-            }
-
-            if (ASDefinitionFilter.shouldBeExcluded(arg0))
-                return false;
-            return true;
-        }
-    }
-
-    private ICompilerProject findPropertForContainingPathAndScope(final String containingPath, final IASScope scope, final Iterable<WeakReference<ICompilationUnit>> units)
-    {
-        for (WeakReference<ICompilationUnit> unitRef : units)
-        {
-            ICompilationUnit unit = unitRef.get();
-            if (unit != null)
-            {
-                try
-                {
-                    IASScope[] scopes = unit.getFileScopeRequest().get().getScopes();
-                    for (IASScope cuScope : scopes)
-                    {
-                        if (scope == cuScope)
-                            return unit.getProject();
-                    }
-                }
-                catch (InterruptedException e)
-                {
-                }
-            }
-        }
-        return null;
-    }
-
-    private ICompilerProject findProjectForScope(IASScope scope)
-    {
-        while ((scope != null) && (!(scope instanceof ASFileScope)))
-        {
-            // Check for TypeScope's since the TypeScope
-            // might be a scope for a Vector.
-            // Vector definitions ( aka AppliedVectorDefinition's ) have a reference
-            // to the project, but are not contained by a file scope.
-            if (scope instanceof TypeScope || scope instanceof ScopeView)
-            {
-                ASScope typeScope = (ASScope)scope;
-                ITypeDefinition typeDefinition = (ITypeDefinition)typeScope.getDefinition();
-                if (typeDefinition instanceof AppliedVectorDefinition)
-                    return ((AppliedVectorDefinition)typeDefinition).getProject();
-            }
-            scope = scope.getContainingScope();
-        }
-        if (scope == null)
-            return null;
-        final ASFileScope fileScope = (ASFileScope)scope;
-        final Workspace workspace = (Workspace)fileScope.getWorkspace();
-        final String containingPath = fileScope.getContainingPath();
-        ICompilerProject result = findPropertForContainingPathAndScope(containingPath, scope, workspace.getInvisibleCompilationUnits(containingPath));
-        if (result != null)
-            return result;
-        result = findPropertForContainingPathAndScope(containingPath, scope, workspace.getCompilationUnits(containingPath));
-        return result;
-    }
-
-    private ICompilerProject findProjectForDefinition(IDefinition def)
-    {
-        // first check for cases where we can get the project directly,
-        // rather than getting the scope
-        if (def instanceof AppliedVectorDefinition)
-            return ((AppliedVectorDefinition)def).getProject();
-
-        // If we need to, get the scope and find the project from that.
-        // Warning: this can be slow.
-        return findProjectForScope(def.getContainingScope());
-    }
-}


[26/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestReferenceModel.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestReferenceModel.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestReferenceModel.java
new file mode 100644
index 0000000..d4374b3
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestReferenceModel.java
@@ -0,0 +1,64 @@
+/*
+ *
+ *  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.internal.codegen.externals;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class TestReferenceModel extends ExternalsTestBase
+{
+    @Ignore
+    @Test
+    public void test_full_compile() throws IOException
+    {
+
+        client.cleanOutput();
+
+        // TODO (mschmalle) this root needs to create 'classes' in the root and move 
+        // constants and functions up into it aside classes
+        assertFalse(ExternalsTestUtils.AS_ROOT_DIR.exists());
+
+        // TODO (mschmalle) get warnings and errors from the closure compiler
+        client.compile();
+
+        client.emit();
+
+        assertTrue(config.getAsClassRoot().exists());
+        assertTrue(config.getAsInterfaceRoot().exists());
+        assertTrue(config.getAsFunctionRoot().exists());
+        assertTrue(config.getAsConstantRoot().exists());
+        assertTrue(config.getAsTypeDefRoot().exists());
+    }
+
+    @Override
+    protected void configure(ExternCConfiguration config) throws IOException
+    {
+        config.setASRoot(ExternalsTestUtils.AS_ROOT_DIR);
+
+        ExternalsTestUtils.addTestExcludesFull(config);
+        ExternalsTestUtils.addTestExternalsFull(config);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestTypeExternals.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestTypeExternals.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestTypeExternals.java
new file mode 100644
index 0000000..514f7a9
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestTypeExternals.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.internal.codegen.externals;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.MethodReference;
+import org.junit.Test;
+
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.JSTypeExpression;
+import com.google.javascript.rhino.jstype.JSType;
+import com.google.javascript.rhino.jstype.NamedType;
+
+public class TestTypeExternals extends ExternalsTestBase
+{
+    @Test
+    public void test_constructor() throws IOException
+    {
+        compile("constructor_members.js");
+
+        ClassReference reference = model.getClassReference("Foo");
+        assertTrue(reference.hasInstanceField("bar"));
+        assertFalse(reference.hasInstanceField("foo"));
+        assertTrue(reference.hasInstanceMethod("method1"));
+        assertTrue(reference.hasInstanceMethod("method2"));
+        assertTrue(model.hasConstant("bar"));
+    }
+
+    @SuppressWarnings("unused")
+    @Test
+    public void test_types() throws IOException
+    {
+        compile("types_param.js");
+
+        ClassReference reference = model.getClassReference("Foo");
+
+        JSType jsType1 = getJSType("test1", "arg1");
+        JSType jsType2 = getJSType("test2", "arg1");
+        JSType jsType3 = getJSType("test3", "arg1");
+        JSType jsType4 = getJSType("test4", "arg1");
+        JSType jsType5 = getJSType("test5", "arg1");
+        JSType jsType6 = getJSType("test6", "arg1");
+
+        assertTrue(jsType1.isString());
+        assertTrue(jsType2.isUnionType());
+        assertTrue(jsType3.isRecordType());
+        assertTrue(jsType4.isUnionType());
+        assertTrue(jsType5.isInstanceType());
+        assertTrue(jsType6.isFunctionType());
+
+        assertEquals("String", toParamTypeString(jsType1));
+        assertEquals("foo.bar.Baz", toParamTypeString(jsType2));
+        assertEquals("Object /* {myNum: number, myObject: ?} */",
+                toParamTypeString(jsType3));
+        assertEquals("Number", toParamTypeString(jsType4));
+        assertEquals("Object", toParamTypeString(jsType5));
+        assertEquals("Function /* function (string, boolean): ? */",
+                toParamTypeString(jsType6));
+    }
+
+    public String toParamTypeString(JSType jsType)
+    {
+        String result = "";
+        if (jsType instanceof NamedType)
+        {
+            NamedType nt = (NamedType) jsType;
+            return nt.toAnnotationString();
+        }
+        else if (jsType.isString())
+        {
+            return "String";
+        }
+        else if (jsType.isBooleanObjectType())
+        {
+            return "Boolean";
+        }
+        else if (jsType.isNumber())
+        {
+            return "Number";
+        }
+        else if (jsType.isUnionType())
+        {
+            JSType collapseUnion = jsType.restrictByNotNullOrUndefined();
+            return toParamTypeString(collapseUnion);
+        }
+        else if (jsType.isRecordType())
+        {
+            return "Object /* " + jsType.toAnnotationString() + " */";
+        }
+        else if (jsType.isInstanceType())
+        {
+            return jsType.toAnnotationString();
+        }
+        else if (jsType.isFunctionType())
+        {
+            return "Function /* " + jsType.toAnnotationString() + " */";
+        }
+
+        return result;
+    }
+
+    private JSType getJSType(String methodName, String paramName)
+    {
+    	MethodReference method = model.getClassReference("Foo").getInstanceMethod(methodName);
+    	if (method == null)
+    		method = model.getClassReference("Foo").getStaticMethod(methodName);
+        JSDocInfo comment = method.getComment();
+        JSTypeExpression parameterType = comment.getParameterType("arg1");
+        JSType jsType = model.evaluate(parameterType);
+        return jsType;
+    }
+
+    @Override
+    protected void configure(ExternCConfiguration config) throws IOException
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestTypeInheritence.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestTypeInheritence.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestTypeInheritence.java
new file mode 100644
index 0000000..ee19443
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestTypeInheritence.java
@@ -0,0 +1,87 @@
+/*
+ *
+ *  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.internal.codegen.externals;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.junit.Test;
+
+public class TestTypeInheritence extends ExternalsTestBase
+{
+
+    @Test
+    public void test_superclasses() throws Exception
+    {
+        compile("type_inheritence.js");
+
+        ClassReference EventTarget = model.getInterfaceReference("EventTarget");
+
+        ClassReference Object = model.getClassReference("Object");
+        ClassReference Foo = model.getClassReference("Foo");
+        ClassReference Bar = model.getClassReference("Bar");
+        ClassReference Baz = model.getClassReference("Baz");
+
+        assertNotNull(Object);
+        assertNotNull(EventTarget);
+        assertNotNull(Foo);
+        assertNotNull(Bar);
+        assertNotNull(Baz);
+
+        assertSame(EventTarget, Foo.getImplementedInterfaces().get(0));
+        assertSame(Object, Foo.getSuperClass());
+        assertSame(Foo, Bar.getSuperClass());
+        assertSame(Bar, Baz.getSuperClass());
+
+        List<ClassReference> superClasses = Baz.getSuperClasses();
+        assertEquals(3, superClasses.size());
+        assertSame(Bar, superClasses.get(0));
+        assertSame(Foo, superClasses.get(1));
+        assertSame(Object, superClasses.get(2));
+
+        assertTrue(Foo.hasInstanceMethod("addEventListener"));
+
+        // TODO (mschmalle) need to revisit interface method overload
+        // XXX Since Foo implements EventTarget BUT changes it's signature, we have to
+        // use EventTargt.addEventListener()'s signature
+        String result = client.getEmitter().emit(
+                Foo.getInstanceMethod("addEventListener"));
+        assertEquals(
+                "    /**\n     "
+                        + "* @param opt_useCapture [(boolean|undefined)] \n     "
+                        + "* @see [type_inheritence]\n     */\n"
+                        + "    public function addEventListener(type:String, listener:Object, useCapture:Boolean):Object /* undefined */ "
+                        + "{  return null; }\n", result);
+    }
+
+    @Override
+    protected void configure(ExternCConfiguration config) throws IOException
+    {
+        config.setASRoot(ExternalsTestUtils.AS_ROOT_DIR);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDClassA.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDClassA.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDClassA.java
new file mode 100644
index 0000000..666e67a
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDClassA.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.internal.codegen.js.amd;
+
+import org.apache.flex.compiler.internal.test.AMDTestBase;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * This class tests the production of AMD JavaScript for the test project, class
+ * A.
+ * 
+ * @author Michael Schmalle
+ */
+@Ignore
+public class TestAMDClassA extends AMDTestBase
+{
+    // !!! the errors have to do with how I change 'this' on member expressions
+
+    //--------------------------------------------------------------------------
+    // Class A
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void test_field_msg()
+    {
+        IVariableNode vnode = findField("_msg", classNode);
+        asBlockWalker.visitVariable(vnode);
+        assertOut("_msg$1: {\n\tvalue:0,\n\twritable:true\n}");
+    }
+
+    @Test
+    public void test_constructor()
+    {
+        IFunctionNode vnode = findFunction("A", classNode);
+        asBlockWalker.visitFunction(vnode);
+        assertOut("function A(msg) {\n\tthis.msg = msg;\n}");
+    }
+
+    @Test
+    public void test_get_msg()
+    {
+        IGetterNode node = findGetter("msg", classNode);
+        asBlockWalker.visitGetter(node);
+        assertOut("msg: {\n\tget: function msg$get() {\n\t\treturn String(this._msg$1);\n\t},"
+                + "\n\tset: function msg$set(value) {\n\t\tthis._msg$1 = parseInt(value, 10);\n\t}\n}");
+    }
+
+    @Test
+    public void test_set_msg()
+    {
+        ISetterNode node = findSetter("msg", classNode);
+        asBlockWalker.visitSetter(node);
+        assertOut("msg: {\n\tget: function msg$get() {\n\t\treturn String(this._msg$1);\n\t},"
+                + "\n\tset: function msg$set(value) {\n\t\tthis._msg$1 = parseInt(value, 10);\n\t}\n}");
+    }
+
+    @Test
+    public void test_secret()
+    {
+        IFunctionNode vnode = findFunction("secret", classNode);
+        asBlockWalker.visitFunction(vnode);
+        assertOut("secret$1: function secret(n) {\n\treturn this.msg + n;\n}");
+    }
+
+    @Test
+    public void test_foo()
+    {
+        IFunctionNode vnode = findFunction("foo", classNode);
+        asBlockWalker.visitFunction(vnode);
+        assertOut("foo: function foo(x) {\n\treturn this.secret$1(A.bar(x));\n}");
+    }
+
+    @Test
+    public void test_baz()
+    {
+        IFunctionNode vnode = findFunction("baz", classNode);
+        asBlockWalker.visitFunction(vnode);
+        assertOut("baz: function baz() {\n\tvar tmp = AS3.bind(this, "
+                + "\"secret$1\");\n\treturn tmp(\"-bound\");\n}");
+    }
+
+    @Test
+    public void test_bar()
+    {
+        IFunctionNode vnode = findFunction("bar", classNode);
+        asBlockWalker.visitFunction(vnode);
+        assertOut("bar: function bar(x) {\n\treturn x + 1;\n}");
+    }
+
+    @Test
+    public void test_file()
+    {
+        // not going to put this test production in until everything is concrete and agreed upon
+        asBlockWalker.visitFile(fileNode);
+        //assertOut("");
+    }
+
+    @Override
+    protected String getTypeUnderTest()
+    {
+        return "com.acme.A";
+    }
+}
+
+/*
+
+--------------------------------------------------------------------------------
+02-07-2013
+Current Production of visitFile()
+--------------------------------------------------------------------------------
+
+define(["exports", "runtime/AS3", "classes/I", "classes/String", "classes/parseInt", "classes/trace"], function($exports, AS3, I, String, parseInt, trace) {
+    "use strict"; 
+    AS3.compilationUnit($exports, function($primaryDeclaration){
+        function A(msg) {
+            this.msg = msg;
+        }
+        $primaryDeclaration(AS3.class_({
+            package_: "com.acme",
+            class_: "A",
+            implements_: [
+                I
+            ],
+            members: {
+                constructor: A,
+                _msg$1: {
+                    value:0,
+                    writable:true
+                },
+                msg: {
+                    get: function msg$get() {
+                        return String(this._msg$1);
+                    },
+                    set: function msg$set(value) {
+                        this._msg$1 = parseInt(value, 10);
+                    }
+                },
+                secret$1: function secret(n) {
+                    return this.msg + n;
+                },
+                foo: function foo(x) {
+                    return this.secret$1(A.bar(x));
+                },
+                baz: function baz() {
+                    var tmp = AS3.bind(this, "secret$1");
+                    return tmp("-bound");
+                }
+            },
+            staticMembers: {
+                bar: function bar(x) {
+                    return x + 1;
+                }
+            }
+        }));
+        trace("Class A is initialized!");
+    });
+});
+
+*/

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDClassB.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDClassB.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDClassB.java
new file mode 100644
index 0000000..272aedb
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDClassB.java
@@ -0,0 +1,97 @@
+/*
+ *
+ *  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.internal.codegen.js.amd;
+
+import org.apache.flex.compiler.internal.test.AMDTestBase;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * This class tests the production of AMD JavaScript for the test project, class
+ * B.
+ * 
+ * @author Michael Schmalle
+ */
+@Ignore
+public class TestAMDClassB extends AMDTestBase
+{
+    //--------------------------------------------------------------------------
+    // Class B
+    //--------------------------------------------------------------------------
+    
+    // XXX (mschmalle) () get back to this when more work is done
+    @Test
+    public void test_nowPlusOne()
+    {
+//        IFunctionNode vnode = findFunction("nowPlusOne", classNode);
+//        asBlockWalker.visitFunction(vnode);
+//        assertOut("nowPlusOne: function nowPlusOne() {\n\treturn new Date(B.now.getTime() + 60 * 60 * 1000);\n}");
+    }
+
+    @Test
+    public void test_constructor()
+    {
+        IFunctionNode vnode = findFunction("B", classNode);
+        asBlockWalker.visitFunction(vnode);
+        assertOut("function B(msg, count) {\n\tthis.barfoo = (A._ || A._$get()).bar(3);"
+                + "\n\tSuper.call(this, msg);\n\tthis.count = count;\n\ttrace(\"now: \" + B.now);\n}");
+    }
+
+    @Test
+    public void test_count()
+    {
+        IVariableNode node = findField("count", classNode);
+        asBlockWalker.visitVariable(node);
+        assertOut("count: {\n\tvalue:0,\n\twritable:true\n}");
+    }
+
+    @Test
+    public void test_override_foo()
+    {
+        IFunctionNode vnode = findFunction("foo", classNode);
+        asBlockWalker.visitFunction(vnode);
+        assertOut("foo: function foo(x) {\n\treturn this.foo$2(x + 2) + \"-sub\";\n}");
+    }
+
+    @Test
+    public void test_now()
+    {
+        IVariableNode node = findField("now", classNode);
+        asBlockWalker.visitVariable(node);
+        assertOut("B.now = new Date()");
+    }
+
+    @Test
+    public void test_file()
+    {
+        // not going to put this test production in until everything is concrete and agreed upon
+        asBlockWalker.visitFile(fileNode);
+        //assertOut("");
+    }
+
+    @Override
+    protected String getTypeUnderTest()
+    {
+        return "com.acme.B";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDEmiter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDEmiter.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDEmiter.java
new file mode 100644
index 0000000..71e35dc
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDEmiter.java
@@ -0,0 +1,144 @@
+/*
+ *
+ *  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.internal.codegen.js.amd;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.driver.js.amd.AMDBackend;
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.junit.Test;
+
+/**
+ * This class tests the production of 'AMD' JavaScript output.
+ * <p>
+ * Note; this is a complete prototype more used in figuring out where
+ * abstraction and indirection is needed concerning the AS -> JS translations.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestAMDEmiter extends ASTestBase
+{
+    // TODO (mschmalle) these tests were all ignored... ?
+    
+    @Test
+    public void testSimple()
+    {
+//        String code = "package com.example.components {"
+//                + "import org.apache.flex.html.staticControls.TextButton;"
+//                + "public class MyTextButton extends TextButton {"
+//                + "public function MyTextButton() {if (foo() != 42) { bar(); } }"
+//                + "private var _privateVar:String = \"do \";"
+//                + "public var publicProperty:Number = 100;"
+//                + "public function myFunction(value: String): String{"
+//                + "return \"Don't \" + _privateVar + value; }";
+//        IFileNode node = compileAS(code);
+//        asBlockWalker.visitFile(node);
+//        assertOut("package com.example.components {\n\tpublic class MyTextButton extends TextButton {\n\t\tcom.example.components.MyTextButton = function() {\n\t\t\tif (foo() != 42) {\n\t\t\t\tbar();\n\t\t\t}\n\t\t}\n\t\tprivate var _privateVar:String = \"do \";\n\t\tpublic var publicProperty:Number = 100;\n\t\tcom.example.components.MyTextButton.prototype.myFunction = function(value) {\n\t\t\treturn \"Don't \" + _privateVar + value;\n\t\t}\n\t}\n}");
+    }
+
+    @Test
+    public void testSimpleMethod()
+    {
+//        IFunctionNode node = getMethod("function method1():void{\n}");
+//        asBlockWalker.visitFunction(node);
+//        assertOut("A.prototype.method1 = function() {\n}");
+    }
+
+    @Test
+    public void testSimpleParameterReturnType()
+    {
+//        IFunctionNode node = getMethod("function method1(bar:int):int{\n}");
+//        asBlockWalker.visitFunction(node);
+//        assertOut("A.prototype.method1 = function(bar) {\n}");
+    }
+
+    @Test
+    public void testSimpleMultipleParameter()
+    {
+//        IFunctionNode node = getMethod("function method1(bar:int, baz:String, goo:A):void{\n}");
+//        asBlockWalker.visitFunction(node);
+//        assertOut("A.prototype.method1 = function(bar, baz, goo) {\n}");
+    }
+
+    @Test
+    public void testDefaultParameter()
+    {
+//        /*
+//         foo.bar.A.method1 = function(p1, p2, p3, p4) {
+//            if (arguments.length < 4) {
+//                if (arguments.length < 3) {
+//                    p3 = 3;
+//                }
+//                p4 = 4;
+//            }
+//            return p1 + p2 + p3 + p4;
+//         }
+//         */
+//        IFunctionNode node = getMethod("function method1(p1:int, p2:int, p3:int = 3, p4:int = 4):int{return p1 + p2 + p3 + p4;}");
+//        asBlockWalker.visitFunction(node);
+//        assertOut("A.prototype.method1 = function(p1, p2, p3, p4) {\n\tif (arguments.length < 4) "
+//                + "{\n\t\tif (arguments.length < 3) {\n\t\t\tp3 = 3;\n\t\t}\n\t\tp4 = 4;\n\t}"
+//                + "\n\treturn p1 + p2 + p3 + p4;\n}");
+    }
+
+    @Test
+    public void testDefaultParameter_Body()
+    {
+//        /*
+//        foo.bar.A.method1 = function(bar, bax) {
+//            if (arguments.length < 2) {
+//                if (arguments.length < 1) {
+//                    bar = 42;
+//                }
+//                bax = 4;
+//            }
+//        }
+//        */
+//        IFunctionNode node = getMethod("function method1(bar:int = 42, bax:int = 4):void{if (a) foo();}");
+//        asBlockWalker.visitFunction(node);
+//        assertOut("A.prototype.method1 = function(bar, bax) {\n\tif (arguments.length < 2) {\n\t\t"
+//                + "if (arguments.length < 1) {\n\t\t\tbar = 42;\n\t\t}\n\t\tbax = 4;\n\t}\n\t"
+//                + "if (a)\n\t\tfoo();\n}");
+    }
+
+    @Test
+    public void testDefaultParameter_NoBody_Alternate()
+    {
+//        /*
+//        foo.bar.A.method1 = function(bar, bax) {
+//            if (arguments.length < 2) {
+//                if (arguments.length < 1) {
+//                    bar = 42;
+//                }
+//                bax = 4;
+//            }
+//        }
+//        */
+//        IFunctionNode node = getMethod("function method1(bar:int = 42, bax:int = 4):void{\n}");
+//        asBlockWalker.visitFunction(node);
+//        assertOut("A.prototype.method1 = function(bar, bax) {\n\tif (arguments.length < 2) {\n\t\t"
+//                + "if (arguments.length < 1) {\n\t\t\tbar = 42;\n\t\t}\n\t\tbax = 4;\n\t}\n}");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new AMDBackend();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDInterfaceI.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDInterfaceI.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDInterfaceI.java
new file mode 100644
index 0000000..1be8965
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDInterfaceI.java
@@ -0,0 +1,51 @@
+/*
+ *
+ *  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.internal.codegen.js.amd;
+
+import org.apache.flex.compiler.internal.test.AMDTestBase;
+import org.junit.Test;
+
+/**
+ * This class tests the production of AMD JavaScript for the test project,
+ * interface I.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestAMDInterfaceI extends AMDTestBase
+{
+    //--------------------------------------------------------------------------
+    // Interface I
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void test_file()
+    {
+        asBlockWalker.visitFile(fileNode);
+        assertOut("define([\"exports\", \"runtime/AS3\"], function($exports, AS3) {"
+                + "\n\t\"use strict\"; \n\tAS3.interface_($exports, {\n\t\tpackage_: "
+                + "\"com.acme\",\n\t\tinterface_: \"I\"\n\t});\n});");
+    }
+
+    @Override
+    protected String getTypeUnderTest()
+    {
+        return "com.acme.I";
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDInterfaceIOther.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDInterfaceIOther.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDInterfaceIOther.java
new file mode 100644
index 0000000..b1e78f0
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDInterfaceIOther.java
@@ -0,0 +1,51 @@
+/*
+ *
+ *  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.internal.codegen.js.amd;
+
+import org.apache.flex.compiler.internal.test.AMDTestBase;
+import org.junit.Test;
+
+/**
+ * This class tests the production of AMD JavaScript for the test project,
+ * interface com.acme.sub.IOther.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestAMDInterfaceIOther extends AMDTestBase
+{
+    //--------------------------------------------------------------------------
+    // Interface IOther
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void test_file()
+    {
+        asBlockWalker.visitFile(fileNode);
+        assertOut("define([\"exports\", \"runtime/AS3\"], function($exports, AS3) {"
+                + "\n\t\"use strict\"; \n\tAS3.interface_($exports, {\n\t\tpackage_: "
+                + "\"com.acme.sub\",\n\t\tinterface_: \"IOther\"\n\t});\n});");
+    }
+
+    @Override
+    protected String getTypeUnderTest()
+    {
+        return "com.acme.sub.IOther";
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDInterfaceISub.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDInterfaceISub.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDInterfaceISub.java
new file mode 100644
index 0000000..fea3b4a
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDInterfaceISub.java
@@ -0,0 +1,52 @@
+/*
+ *
+ *  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.internal.codegen.js.amd;
+
+import org.apache.flex.compiler.internal.test.AMDTestBase;
+import org.junit.Test;
+
+/**
+ * This class tests the production of AMD JavaScript for the test project,
+ * interface com.acme.sub.ISub.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestAMDInterfaceISub extends AMDTestBase
+{
+    //--------------------------------------------------------------------------
+    // Interface ISub
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void test_file()
+    {
+        asBlockWalker.visitFile(fileNode);
+        assertOut("define([\"exports\", \"runtime/AS3\", \"classes/com/acme/I\"], "
+                + "function($exports, AS3, I) {\n\t\"use strict\"; \n\tAS3.interface_($exports, {"
+                + "\n\t\tpackage_: \"com.acme.sub\",\n\t\tinterface_: \"ISub\"\n\t\textends_: "
+                + "[\n\t\t\tI\n\t\t]\n\t});\n});");
+    }
+
+    @Override
+    protected String getTypeUnderTest()
+    {
+        return "com.acme.sub.ISub";
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDPackage.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDPackage.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDPackage.java
new file mode 100644
index 0000000..ca8a4c0
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/amd/TestAMDPackage.java
@@ -0,0 +1,127 @@
+/*
+ *
+ *  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.internal.codegen.js.amd;
+
+import java.io.IOException;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.TestPackage;
+import org.apache.flex.compiler.internal.driver.js.amd.AMDBackend;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of AMD JavaScript for AS package.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestAMDPackage extends TestPackage
+{
+
+    @Override
+    @Test
+    public void testPackage_Simple()
+    {
+        IFileNode node = compileAS("package{}");
+        asBlockWalker.visitFile(node);
+        assertOut("");
+    }
+
+    @Override
+    @Test
+    public void testPackage_SimpleName()
+    {
+        IFileNode node = compileAS("package foo {}");
+        asBlockWalker.visitFile(node);
+        assertOut("");
+    }
+
+    @Override
+    @Test
+    public void testPackage_Name()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {}");
+        asBlockWalker.visitFile(node);
+        assertOut("");
+    }
+
+    @Override
+    @Test
+    public void testPackageSimple_Class()
+    {
+        IFileNode node = compileAS("package {public class A{}}");
+        asBlockWalker.visitFile(node);
+        //assertOut("");
+    }
+
+    // XXX (mschmalle) ?
+    @Test
+    public void testPackageSimple_TestA() throws IOException
+    {
+    }
+
+    @Override
+    @Test
+    public void testPackageQualified_Class()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {public class A{}}");
+        asBlockWalker.visitFile(node);
+        //assertOut("");
+    }
+
+    @Override
+    @Test
+    public void testPackageQualified_ClassBody()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {public class A{public function A(){}}}");
+        asBlockWalker.visitFile(node);
+        //assertOut("");
+    }
+
+    @Override
+    @Test
+    public void testPackageQualified_ClassBodyMethodContents()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {public class A{public function A(){if (a){for (var i:Object in obj){doit();}}}}}");
+        asBlockWalker.visitFile(node);
+        //assertOut("");
+    }
+
+    //@Test
+    public void testMethod()
+    {
+        IFunctionNode node = getMethod("function foo(){}");
+        asBlockWalker.visitFunction(node);
+        assertOut("A.prototype.foo = function() {\n}");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new AMDBackend();
+    }
+
+    protected IFileNode getFile(String code)
+    {
+        IFileNode node = compileAS(code);
+        return node;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java
new file mode 100644
index 0000000..58769fe
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java
@@ -0,0 +1,156 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogAccessorMembers;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
+{
+    @Override
+    @Test
+    public void testGetAccessor()
+    {
+        IClassNode node = (IClassNode) getNode("function get foo():int{}",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nObject.defineProperties(FalconTest_A.prototype, /** @lends {FalconTest_A.prototype} */ {\n/** @export */\nfoo: {\nget: /** @this {FalconTest_A} */ function() {\n}}}\n);");
+    }
+
+    @Override
+    @Test
+    public void testGetAccessor_withBody()
+    {
+    	IClassNode node = (IClassNode) getNode("function get foo():int{return -1;}",
+    			IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nObject.defineProperties(FalconTest_A.prototype, /** @lends {FalconTest_A.prototype} */ {\n/** @export */\nfoo: {\nget: /** @this {FalconTest_A} */ function() {\n  return -1;\n}}}\n);");
+    }
+
+    @Override
+    @Test
+    public void testGetAccessor_withNamespace()
+    {
+    	IClassNode node = (IClassNode) getNode("public function get foo():int{return -1;}",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nObject.defineProperties(FalconTest_A.prototype, /** @lends {FalconTest_A.prototype} */ {\n/** @export */\nfoo: {\nget: /** @this {FalconTest_A} */ function() {\n  return -1;\n}}}\n);");
+    }
+
+    @Override
+    @Test
+    public void testGetAccessor_withNamespaceOverride()
+    {
+    	IClassNode node = (IClassNode) getNode("public class B extends A { public override function get foo():int{return super.foo;} }; public class A {public function get foo():int {return 0;}} ",
+        		IClassNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {A}\n */\nB = function() {\n  B.base(this, 'constructor');\n};\ngoog.inherits(B, A);\n\n\nObject.defineProperties(B.prototype, /** @lends {B.prototype} */ {\n/** @export */\nfoo: {\nget: /** @this {B} */ function() {\n  return org.apache.flex.utils.Language.superGetter(B, this, 'foo');\n}}}\n);");
+    }
+
+    @Test
+    public void testGetAccessor_withGeneratedSetOverride()
+    {
+    	IClassNode node = (IClassNode) getNode("public class B extends A { public override function get foo():int{return super.foo;} }; public class A { public function set foo(value:int):void{} public function get foo():int {return 0;}}",
+        		IClassNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {A}\n */\nB = function() {\n  B.base(this, 'constructor');\n};\ngoog.inherits(B, A);\n\n\nObject.defineProperties(B.prototype, /** @lends {B.prototype} */ {\n/** @export */\nfoo: {\nget: /** @this {B} */ function() {\n  return org.apache.flex.utils.Language.superGetter(B, this, 'foo');\n},\nset: /** @this {B} */ function(value) {\norg.apache.flex.utils.Language.superSetter(B, this, 'foo', value);\n}}}\n);");
+    }
+    
+    @Override
+    @Test
+    public void testGetAccessor_withStatic()
+    {
+    	IClassNode node = (IClassNode) getNode("public static function get foo():int{return -1;}",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};Object.defineProperties(FalconTest_A, /** @lends {FalconTest_A} */ {\n/** @export */\nfoo: {\nget: function() {\n  return -1;\n}}}\n);");
+    }
+
+    @Override
+    @Test
+    public void testSetAccessor()
+    {
+    	IClassNode node = (IClassNode) getNode("function set foo(value:int):void{}",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nObject.defineProperties(FalconTest_A.prototype, /** @lends {FalconTest_A.prototype} */ {\n/** @export */\nfoo: {\nset: /** @this {FalconTest_A} */ function(value) {\n}}}\n);");
+    }
+
+    @Override
+    @Test
+    public void testSetAccessor_withBody()
+    {
+    	IClassNode node = (IClassNode) getNode("function set foo(value:int):void{fetch('haai');}",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nObject.defineProperties(FalconTest_A.prototype, /** @lends {FalconTest_A.prototype} */ {\n/** @export */\nfoo: {\nset: /** @this {FalconTest_A} */ function(value) {\n  fetch('haai');\n}}}\n);");
+    }
+
+    @Override
+    @Test
+    public void testSetAccessor_withNamespace()
+    {
+    	IClassNode node = (IClassNode) getNode("public function set foo(value:int):void{}",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\nObject.defineProperties(FalconTest_A.prototype, /** @lends {FalconTest_A.prototype} */ {\n/** @export */\nfoo: {\nset: /** @this {FalconTest_A} */ function(value) {\n}}}\n);");
+    }
+
+    @Override
+    @Test
+    public void testSetAccessor_withNamespaceOverride()
+    {
+    	IClassNode node = (IClassNode) getNode("public class B extends A { public override function set foo(value:int):void {super.foo = value;} }; public class A { public function set foo(value:int):void{}}",
+        		IClassNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {A}\n */\nB = function() {\n  B.base(this, 'constructor');\n};\ngoog.inherits(B, A);\n\n\nObject.defineProperties(B.prototype, /** @lends {B.prototype} */ {\n/** @export */\nfoo: {\nset: /** @this {B} */ function(value) {\n  org.apache.flex.utils.Language.superSetter(B, this, 'foo', value);\n}}}\n);");
+    }
+
+    @Override
+    @Test
+    public void testSetAccessor_withStatic()
+    {
+    	IClassNode node = (IClassNode) getNode("public static function set foo(value:int):void{}",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};Object.defineProperties(FalconTest_A, /** @lends {FalconTest_A} */ {\n/** @export */\nfoo: {\nset: function(value) {\n}}}\n);");
+    }
+
+    @Test
+    public void testSetAccessor_withGeneratedGetOverride()
+    {
+    	IClassNode node = (IClassNode) getNode("public class B extends A { public override function set foo(value:int):void {super.foo = value;} }; public class A { public function set foo(value:int):void{} public function get foo():int { return 0;}}",
+        		IClassNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {A}\n */\nB = function() {\n  B.base(this, 'constructor');\n};\ngoog.inherits(B, A);\n\n\nObject.defineProperties(B.prototype, /** @lends {B.prototype} */ {\n/** @export */\nfoo: {\nget: /** @this {B} */ function() {\nreturn org.apache.flex.utils.Language.superGetter(B, this, 'foo');\n},\nset: /** @this {B} */ function(value) {\n  org.apache.flex.utils.Language.superSetter(B, this, 'foo', value);\n}}}\n);");
+    }
+    
+    @Override
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessors.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessors.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessors.java
new file mode 100644
index 0000000..7083e3a
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessors.java
@@ -0,0 +1,84 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestFlexJSAccessors extends ASTestBase
+{
+    
+    @Test
+    public void testGetAndSetAccessor()
+    {
+        IClassNode node = (IClassNode) getNode(
+                "public function doStuff():void {label = 'hello, bye'; var theLabel:String = label;}; private var _label:String; public function get label():String {return _label}; public function set label(value:String):void {_label = value}; ",
+                IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n * @export\n */\nFalconTest_A.prototype.doStuff = function() {\n  this.label = 'hello, bye';\n  var /** @type {string} */ theLabel = this.label;\n};\n\n\n/**\n * @private\n * @type {string}\n */\nFalconTest_A.prototype._label;\n\n\nObject.defineProperties(FalconTest_A.prototype, /** @lends {FalconTest_A.prototype} */ {\n/** @export */\nlabel: {\nget: /** @this {FalconTest_A} */ function() {\n  return this._label;\n},\nset: /** @this {FalconTest_A} */ function(value) {\n  this._label = value;\n}}}\n);";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testSetAccessorWithMemberAccessOnLeftSide()
+    {
+        IClassNode node = (IClassNode) getNode(
+                "public class B { public function B() {}; public function doStuff():void {this.label = label + 'bye'; var theLabel:String = label;}; private var _label:String; public function get label():String {return _label}; public function set label(value:String):void {_label = value};}",
+                IClassNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\nB = function() {\n};\n\n\n/**\n * @export\n */\nB.prototype.doStuff = function() {\n  this.label = this.label + 'bye';\n  var /** @type {string} */ theLabel = this.label;\n};\n\n\n/**\n * @private\n * @type {string}\n */\nB.prototype._label;\n\n\nObject.defineProperties(B.prototype, /** @lends {B.prototype} */ {\n/** @export */\nlabel: {\nget: /** @this {B} */ function() {\n  return this._label;\n},\nset: /** @this {B} */ function(value) {\n  this._label = value;\n}}}\n);"; 
+        assertOut(expected);
+    }
+
+    @Test
+    public void testSetAccessorWithCompoundRightSide()
+    {
+        IClassNode node = (IClassNode) getNode(
+                "public function doStuff():void {label = label + 'bye'; var theLabel:String = label;}; private var _label:String; public function get label():String {return _label}; public function set label(value:String):void {_label = value}; ",
+                IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n * @export\n */\nFalconTest_A.prototype.doStuff = function() {\n  this.label = this.label + 'bye';\n  var /** @type {string} */ theLabel = this.label;\n};\n\n\n/**\n * @private\n * @type {string}\n */\nFalconTest_A.prototype._label;\n\n\nObject.defineProperties(FalconTest_A.prototype, /** @lends {FalconTest_A.prototype} */ {\n/** @export */\nlabel: {\nget: /** @this {FalconTest_A} */ function() {\n  return this._label;\n},\nset: /** @this {FalconTest_A} */ function(value) {\n  this._label = value;\n}}}\n);";
+        assertOut(expected);
+    }
+    
+    @Test
+    public void testSetAccessorWithMemberAccessOnRightSide()
+    {
+        IClassNode node = (IClassNode) getNode(
+                "public class B { public function B() {}; public function doStuff():void {label = this.label; var theLabel:String = label;}; private var _label:String; public function get label():String {return _label}; public function set label(value:String):void {_label = value};}",
+                IClassNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\nB = function() {\n};\n\n\n/**\n * @export\n */\nB.prototype.doStuff = function() {\n  this.label = this.label;\n  var /** @type {string} */ theLabel = this.label;\n};\n\n\n/**\n * @private\n * @type {string}\n */\nB.prototype._label;\n\n\nObject.defineProperties(B.prototype, /** @lends {B.prototype} */ {\n/** @export */\nlabel: {\nget: /** @this {B} */ function() {\n  return this._label;\n},\nset: /** @this {B} */ function(value) {\n  this._label = value;\n}}}\n);";
+        assertOut(expected);
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
new file mode 100644
index 0000000..509c491
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
@@ -0,0 +1,397 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogClass;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestFlexJSClass extends TestGoogClass
+{
+
+    @Override
+    @Test
+    public void testConstructor_super()
+    {
+        IClassNode node = getClassNode("public class A {public function A() { super(); }}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n  ;\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleExtends()
+    {
+        IClassNode node = getClassNode("public class A extends EventTarget {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Test
+    public void testSimpleExtendsWithArgs()
+    {
+        IClassNode node = getClassNode("public class A extends EventTarget {public function A(arg:String) { super(arg);}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n * @param {string} arg\n */\norg.apache.flex.A = function(arg) {\n  org.apache.flex.A.base(this, 'constructor', arg);\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Test
+    public void testSimpleExtendsWithArgsImplicitSuper()
+    {
+        IClassNode node = getClassNode("public class A extends EventTarget {public function A(arg:String) {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n * @param {string} arg\n */\norg.apache.flex.A = function(arg) {\n  org.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Override
+    @Test
+    public void testSimpleExtendsImplements()
+    {
+        IClassNode node = getClassNode("public class A extends EventTarget implements IEventDispatcher {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n * @implements {flash.events.IEventDispatcher}\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Override
+    @Test
+    public void testSimpleExtendsImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public class A extends EventTarget implements IEventDispatcher, ListenableKey {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n * @implements {flash.events.IEventDispatcher}\n * @implements {goog.events.ListenableKey}\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Override
+    @Test
+    public void testSimpleFinalExtendsImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public final class A extends EventTarget implements IEventDispatcher, ListenableKey {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n * @implements {flash.events.IEventDispatcher}\n * @implements {goog.events.ListenableKey}\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Override
+    @Test
+    public void testQualifiedExtendsImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public class A extends goog.events.EventTarget implements flash.events.IEventDispatcher, goog.events.ListenableKey {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n * @implements {flash.events.IEventDispatcher}\n * @implements {goog.events.ListenableKey}\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Override
+    @Test
+    public void testExtendsConstructor_super()
+    {
+        IClassNode node = getClassNode("public class A extends goog.events.EventTarget { public function A() { super('foo', 42);}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.base(this, 'constructor', 'foo', 42);\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Test
+    public void testConstructor_withArgumentNameMatchingMemberName()
+    {
+        IClassNode node = getClassNode("public class B {public function B(arg1:String) {this.arg1 = arg1}; public var arg1:String;}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n * @param {string} arg1\n */\norg.apache.flex.B = function(arg1) {\n  this.arg1 = arg1;\n};\n\n\n/**\n * @export\n * @type {string}\n */\norg.apache.flex.B.prototype.arg1;";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_withImplicitSelfInReturnValue()
+    {
+        IClassNode node = getClassNode("public class B {public function B() {}; public var event:Event = new Event(); public function foo():String {return event.type;};}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n\nthis.event = new goog.events.Event();\n};\n\n\n/**\n * @export\n * @type {goog.events.Event}\n */\norg.apache.flex.B.prototype.event;\n\n\n/**\n * @export\n * @return {string}\n */\norg.apache.flex.B.prototype.foo = function() {\n  return this.event.type;\n};";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_noArgsNoReturn()
+    {
+        IClassNode node = getClassNode("public class B {public function B() {}; public function foo():void {};}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @export\n */\norg.apache.flex.B.prototype.foo = function() {\n};";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_override()
+    {
+        IClassNode node = getClassNode("public class B {public function B() {}; override public function foo():void {};}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @export\n * @override\n */\norg.apache.flex.B.prototype.foo = function() {\n};";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_overrideWithFunctionBody()
+    {
+        IClassNode node = getClassNode("public class B {public function B() {}; override public function foo(value:Object):void {baz = ''};}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @export\n * @override\n */\norg.apache.flex.B.prototype.foo = function(value) {\n  baz = '';\n};";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_overrideSuperCall()
+    {
+        IClassNode node = getClassNode("public class B {public function B() {}; override public function foo():void {super.foo();};}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @export\n * @override\n */\norg.apache.flex.B.prototype.foo = function() {\n  org.apache.flex.B.base(this, 'foo');\n};";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_setterCall()
+    {
+        IClassNode node = getClassNode("public class B {public function B() {}; public function set baz(value:Object):void {}; public function set foo(value:Object):void {baz = value;};}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\nObject.defineProperties(org.apache.flex.B.prototype, /** @lends {org.apache.flex.B.prototype} */ {\n/** @export */\nbaz: {\nset: /** @this {org.apache.flex.B} */ function(value) {\n}},\n/** @export */\nfoo: {\nset: /** @this {org.apache.flex.B} */ function(value) {\n  this.baz = value;\n}}}\n);";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_overrideSetterSuperCall()
+    {
+        IClassNode node = getClassNode("public class B extends A {public function B() {}; override public function set foo(value:Object):void {super.foo = value;};} class A {public function set foo(value:Object):void {}}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n * @extends {org.apache.flex.A}\n */\norg.apache.flex.B = function() {\n  org.apache.flex.B.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.B, org.apache.flex.A);\n\n\nObject.defineProperties(org.apache.flex.B.prototype, /** @lends {org.apache.flex.B.prototype} */ {\n/** @export */\nfoo: {\nset: /** @this {org.apache.flex.B} */ function(value) {\n  org.apache.flex.utils.Language.superSetter(org.apache.flex.B, this, 'foo', value);\n}}}\n);";
+        assertOut(expected);
+    }
+
+    @Override
+    @Test
+    public void testExtendsConstructor_withArguments()
+    {
+        IClassNode node = getClassNode("public class A extends goog.events.EventTarget {public function A(arg1:String, arg2:int) {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n * @param {string} arg1\n * @param {number} arg2\n */\norg.apache.flex.A = function(arg1, arg2) {\n  org.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Override
+    @Test
+    public void testFields()
+    {
+        IClassNode node = getClassNode("public class A {public var a:Object;protected var b:String; "
+                + "private var c:int; internal var d:uint; var e:Number}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n\n/**\n * @export\n * @type {Object}\n */\norg.apache.flex.A.prototype.a;\n\n\n/**\n * @protected\n * @type {string}\n */\norg.apache.flex.A.prototype.b;\n\n\n/**\n * @private\n * @type {number}\n */\norg.apache.flex.A.prototype.c;\n\n\n/**\n * @export\n * @type {number}\n */\norg.apache.flex.A.prototype.d;\n\n\n/**\n * @export\n * @type {number}\n */\norg.apache.flex.A.prototype.e;");
+    }
+
+    @Override
+    @Test
+    public void testConstants()
+    {
+        IClassNode node = getClassNode("public class A {"
+                + "public static const A:int = 42;"
+                + "protected static const B:Number = 42;"
+                + "private static const C:Number = 42;"
+                + "foo_bar static const C:String = 'me' + 'you';");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n\n/**\n * @export\n * @const\n * @type {number}\n */\norg.apache.flex.A.A = 42;\n\n\n/**\n * @protected\n * @const\n * @type {number}\n */\norg.apache.flex.A.B = 42;\n\n\n/**\n * @private\n * @const\n * @type {number}\n */\norg.apache.flex.A.C = 42;\n\n\n/**\n * @export\n * @const\n * @type {string}\n */\norg.apache.flex.A.C = 'me' + 'you';");
+    }
+
+    @Override
+    @Test
+    public void testAccessors()
+    {
+        IClassNode node = getClassNode("public class A {"
+                + "public function get foo1():Object{return null;}"
+                + "public function set foo1(value:Object):void{}"
+                + "protected function get foo2():Object{return null;}"
+                + "protected function set foo2(value:Object):void{}"
+                + "private function get foo3():Object{return null;}"
+                + "private function set foo3(value:Object):void{}"
+                + "internal function get foo5():Object{return null;}"
+                + "internal function set foo5(value:Object):void{}"
+                + "foo_bar function get foo6():Object{return null;}"
+                + "foo_bar function set foo6(value:Object):void{}" + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n\nObject.defineProperties(org.apache.flex.A.prototype, /** @lends {org.apache.flex.A.prototype} */ {\n/** @export */\nfoo1: {\nget: /** @this {org.apache.flex.A} */ function() {\n  return null;\n},\nset: /** @this {org.apache.flex.A} */ function(value) {\n}},\n/** @export */\nfoo2: {\nget: /** @this {org.apache.flex.A} */ function() {\n  return null;\n},\nset: /** @this {org.apache.flex.A} */ function(value) {\n}},\n/** @export */\nfoo3: {\nget: /** @this {org.apache.flex.A} */ function() {\n  return null;\n},\nset: /** @this {org.apache.flex.A} */ function(value) {\n}},\n/** @export */\nfoo5: {\nget: /** @this {org.apache.flex.A} */ function() {\n  return null;\n},\nset: /** @this {org.apache.flex.A} */ function(value) {\n}},\n/** @export */\nfoo6: {\nget: /** @this {org.apache.flex.A} */ function() {\n  return null;\n},\nset: /** @this {org.apache.flex.A} */ function(value) {\n}}}\n);");
+    }
+
+    @Override
+    @Test
+    public void testMethods()
+    {
+        IClassNode node = getClassNode("public class A {"
+                + "public function foo1():Object{return null;}"
+                + "public final function foo1a():Object{return null;}"
+                + "override public function foo1b():Object{return super.foo1b();}"
+                + "protected function foo2(value:Object):void{}"
+                + "private function foo3(value:Object):void{}"
+                + "internal function foo5(value:Object):void{}"
+                + "foo_bar function foo6(value:Object):void{}"
+                + "public static function foo7(value:Object):void{}"
+                + "foo_bar static function foo7(value:Object):void{}" + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n\n/**\n * @export\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1 = function() {\n  return null;\n};\n\n\n/**\n * @export\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1a = function() {\n  return null;\n};\n\n\n/**\n * @export\n * @override\n */\norg.apache.flex.A.prototype.foo1b = function() {\n  return org.apache.flex.A.base(this, 'foo1b');\n};\n\n\n/**\n * @protected\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo2 = function(value) {\n};\n\n\n/**\n * @private\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo3 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo5 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo6 = function(value) {\n};\n\n\n/**\n * @export\n * @param {Object} value\n */\norg.apache.flex.A.foo7 = function(value) {\n};\n\n\n/**\n * @para
 m {Object} value\n */\norg.apache.flex.A.foo7 = function(value) {\n};");
+    }
+
+    @Test
+    public void testMethodsWithLocalFunctions()
+    {
+        IClassNode node = getClassNode("public class B {"
+                + "public function foo1():Object{function bar1():Object {return null;}; return bar1()}"
+                + "public function foo2():Object{function bar2(param1:Object):Object {return null;}; return bar2('foo');}"
+                + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @export\n * @return {Object}\n */\norg.apache.flex.B.prototype.foo1 = function() {\n  var self = this;\n  function bar1() {\n    return null;\n  };\n  return bar1();\n};\n\n\n/**\n * @export\n * @return {Object}\n */\norg.apache.flex.B.prototype.foo2 = function() {\n  var self = this;\n  function bar2(param1) {\n    return null;\n  };\n  return bar2('foo');\n};");
+    }
+
+    @Test
+    public void testMethodsWithLocalFunctions2()
+    {
+        IClassNode node = getClassNode("public class B {"
+                + "public var baz1:String;"
+                + "public function foo1():String{function bar1():String {return baz1;}; return bar1()}"
+                + "public function foo2():String{function bar2(param1:String):String {return param1 + baz1;}; return bar2('foo');}"
+                + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @export\n * @type {string}\n */\norg.apache.flex.B.prototype.baz1;\n\n\n/**\n * @export\n * @return {string}\n */\norg.apache.flex.B.prototype.foo1 = function() {\n  var self = this;\n  function bar1() {\n    return this.baz1;\n  };\n  return bar1();\n};\n\n\n/**\n * @export\n * @return {string}\n */\norg.apache.flex.B.prototype.foo2 = function() {\n  var self = this;\n  function bar2(param1) {\n    return param1 + this.baz1;\n  };\n  return bar2('foo');\n};");
+    }
+
+    @Test
+    public void testClassWithoutConstructor()
+    {
+        /* AJH couldn't find a way to reproduce the code paths
+         * in a simple test case.  May require multiple compilation
+         * units in the same package.
+         */
+        
+        // (erikdebruin) what's wrong with this test case and/or the resulting code?
+        
+        // (erikdebruin) if you're looking for a way to test multiple cu's 
+        //               (a project), look in 'TestGoogProject' for an example
+        
+        IClassNode node = getClassNode("public class B {"
+                + "public function clone():B { return new B() }"
+                + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @export\n * @return {org.apache.flex.B}\n */\norg.apache.flex.B.prototype.clone = function() {\n  return new org.apache.flex.B();\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimple()
+    {
+        IClassNode node = getClassNode("public class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleInternal()
+    {
+        // (erikdebruin) the AS compiler will enforce 'internal' namespace, 
+        //               in JS we ignore it
+        IClassNode node = getClassNode("internal class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleFinal()
+    {
+        // (erikdebruin) the AS compiler will enforce the 'final' keyword, 
+        //               in JS we ignore it
+        IClassNode node = getClassNode("public final class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleDynamic()
+    {
+        // (erikdebruin) all JS objects are 'dynamic' by design
+        IClassNode node = getClassNode("public dynamic class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleImplements()
+    {
+        IClassNode node = getClassNode("public class A implements IEventDispatcher {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @implements {flash.events.IEventDispatcher}\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public class A implements IEventDispatcher, ListenableKey {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @implements {flash.events.IEventDispatcher}\n * @implements {goog.events.ListenableKey}\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+
+    @Override
+    @Test
+    public void testConstructor()
+    {
+        IClassNode node = getClassNode("public class A {public function A() { }}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+
+    @Override
+    @Test
+    public void testConstructor_withArguments()
+    {
+        IClassNode node = getClassNode("public class A {public function A(arg1:String, arg2:int) {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @param {string} arg1\n * @param {number} arg2\n */\norg.apache.flex.A = function(arg1, arg2) {\n};");
+    }
+
+    @Test
+    public void testConstructor_withBodyAndComplexInitializer()
+    {
+        IClassNode node = getClassNode("public class A {public function A(arg1:String, arg2:int) {arg2 = arg2 + 2;} public var foo:Array = [];}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @param {string} arg1\n * @param {number} arg2\n */\norg.apache.flex.A = function(arg1, arg2) {\n  \n  this.foo = [];\n  arg2 = arg2 + 2;\n};\n\n\n/**\n * @export\n * @type {Array}\n */\norg.apache.flex.A.prototype.foo;");
+    }
+
+    @Test
+    public void testConstructor_withImplicitSuperAndBodyAndComplexInitializer()
+    {
+        IClassNode node = getClassNode("public class A extends EventTarget {public function A(arg1:String, arg2:int) {arg2 = arg2 + 2;} public var foo:Array = [];}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n * @param {string} arg1\n * @param {number} arg2\n */\norg.apache.flex.A = function(arg1, arg2) {\n  org.apache.flex.A.base(this, 'constructor');\n  \n  this.foo = [];\n  arg2 = arg2 + 2;\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);\n\n\n/**\n * @export\n * @type {Array}\n */\norg.apache.flex.A.prototype.foo;");
+    }
+
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+
+}


[51/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
- Check-In of the migrated project to make error analysis easier


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/c3dce49f
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/c3dce49f
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/c3dce49f

Branch: refs/heads/feature/maven-migration-test
Commit: c3dce49fd6607724d674c595624ec7d3c35d4595
Parents: ad94357
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Wed Apr 13 19:32:16 2016 +0200
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Wed Apr 13 19:32:46 2016 +0200

----------------------------------------------------------------------
 FalconJXFormat.xml                              |   295 -
 build.properties                                |    40 -
 build.xml                                       |  1175 -
 .../codegen/UnknownTreePatternInputOutput.java  |   306 +
 .../problems/BaseProblemGeneratorMojo.java      |     9 +-
 .../problems/ProblemEnumGeneratorMojo.java      |    10 +
 .../ProblemResourceBundleGeneratorMojo.java     |     6 +
 .../org/apache/flex/utils/AntTestAdapter.java   |   115 +
 .../org/apache/flex/utils/EnvProperties.java    |   149 +
 .../flex/utils/FilenameNormalization.java       |   109 +
 .../org/apache/flex/utils/ITestAdapter.java     |    50 +
 .../org/apache/flex/utils/MavenTestAdapter.java |   208 +
 .../apache/flex/utils/TestAdapterFactory.java   |    41 +
 .../internal/as/codegen/IASNodeAdapter.java     |    74 +
 compiler-jx/src/assembly/scripts/asjsc          |    70 +
 compiler-jx/src/assembly/scripts/asjsc.bat      |    29 +
 compiler-jx/src/assembly/scripts/compc          |    70 +
 compiler-jx/src/assembly/scripts/compc.bat      |    29 +
 compiler-jx/src/assembly/scripts/mxmlc          |    70 +
 compiler-jx/src/assembly/scripts/mxmlc.bat      |    29 +
 .../jscomp/FlexJSDiagnosticGroups.java          |    58 +
 .../javascript/jscomp/JXCompilerOptions.java    |    34 +
 .../compiler/asdoc/flexjs/ASDocComment.java     |   107 +
 .../apache/flex/compiler/clients/COMPJSC.java   |   430 +
 .../apache/flex/compiler/clients/EXTERNC.java   |   216 +
 .../compiler/clients/ExternCConfiguration.java  |   357 +
 .../flex/compiler/clients/FlexJSToolGroup.java  |    37 +
 .../compiler/clients/JSCompilerEntryPoint.java  |    29 +
 .../flex/compiler/clients/JSConfiguration.java  |    83 +
 .../apache/flex/compiler/clients/MXMLJSC.java   |   847 +
 .../flex/compiler/clients/VF2JSToolGroup.java   |    35 +
 .../codegen/IASGlobalFunctionConstants.java     |    92 +
 .../flex/compiler/codegen/IDocEmitter.java      |    36 +
 .../apache/flex/compiler/codegen/IEmitter.java  |   113 +
 .../flex/compiler/codegen/IEmitterTokens.java   |    24 +
 .../compiler/codegen/ISourceMapEmitter.java     |    30 +
 .../flex/compiler/codegen/ISubEmitter.java      |    45 +
 .../flex/compiler/codegen/as/IASEmitter.java    |   369 +
 .../flex/compiler/codegen/as/IASWriter.java     |    51 +
 .../flex/compiler/codegen/js/IJSDocEmitter.java |    33 +
 .../flex/compiler/codegen/js/IJSEmitter.java    |    85 +
 .../flex/compiler/codegen/js/IJSPublisher.java  |    41 +
 .../flex/compiler/codegen/js/IJSWriter.java     |    43 +
 .../codegen/js/amd/IJSAMDDocEmitter.java        |    40 +
 .../compiler/codegen/js/amd/IJSAMDEmitter.java  |    33 +
 .../codegen/js/flexjs/IJSFlexJSEmitter.java     |    30 +
 .../codegen/js/goog/IJSGoogDocEmitter.java      |   140 +
 .../codegen/js/goog/IJSGoogEmitter.java         |    33 +
 .../codegen/js/vf2js/IJSVF2JSEmitter.java       |    30 +
 .../compiler/codegen/mxml/IMXMLEmitter.java     |   140 +
 .../codegen/mxml/flexjs/IMXMLFlexJSEmitter.java |    39 +
 .../flex/compiler/driver/IApplication.java      |    31 +
 .../apache/flex/compiler/driver/IBackend.java   |   124 +
 .../apache/flex/compiler/driver/IPublisher.java |    25 +
 .../flex/compiler/driver/js/IJSApplication.java |    33 +
 .../flex/compiler/driver/js/IJSBackend.java     |    29 +
 .../flex/compiler/internal/codegen/Emitter.java |   235 +
 .../codegen/as/ASAfterNodeStrategy.java         |    77 +
 .../codegen/as/ASBeforeNodeStrategy.java        |    74 +
 .../internal/codegen/as/ASBlockWalker.java      |   660 +
 .../compiler/internal/codegen/as/ASEmitter.java |  1540 +
 .../internal/codegen/as/ASEmitterTokens.java    |   203 +
 .../internal/codegen/as/ASFilterWriter.java     |    42 +
 .../compiler/internal/codegen/as/ASWriter.java  |    97 +
 .../externals/emit/ReferenceEmitter.java        |   166 +
 .../externals/pass/AbstractCompilerPass.java    |    71 +
 .../codegen/externals/pass/AddMemberPass.java   |   150 +
 .../externals/pass/CollectImportsPass.java      |   188 +
 .../externals/pass/CollectTypesPass.java        |   165 +
 .../externals/pass/NamespaceResolutionPass.java |   120 +
 .../externals/pass/ReferenceCompiler.java       |   135 +
 .../externals/pass/ResolvePackagesPass.java     |   100 +
 .../externals/reference/BaseReference.java      |   297 +
 .../externals/reference/ClassReference.java     |   890 +
 .../externals/reference/ConstantReference.java  |   101 +
 .../externals/reference/FieldReference.java     |   264 +
 .../externals/reference/FunctionReference.java  |   186 +
 .../externals/reference/MemberReference.java    |    51 +
 .../externals/reference/MethodReference.java    |   316 +
 .../reference/NullConstructorReference.java     |    43 +
 .../externals/reference/ParameterReference.java |    53 +
 .../externals/reference/ReferenceModel.java     |   357 +
 .../codegen/externals/utils/DebugLogUtils.java  |    52 +
 .../codegen/externals/utils/FunctionUtils.java  |   232 +
 .../codegen/externals/utils/JSTypeUtils.java    |   169 +
 .../internal/codegen/js/JSDocEmitter.java       |   174 +
 .../internal/codegen/js/JSDocEmitterTokens.java |    38 +
 .../compiler/internal/codegen/js/JSEmitter.java |   453 +
 .../internal/codegen/js/JSEmitterTokens.java    |    47 +
 .../internal/codegen/js/JSFilterWriter.java     |    43 +
 .../internal/codegen/js/JSPublisher.java        |    85 +
 .../internal/codegen/js/JSSessionModel.java     |   180 +
 .../internal/codegen/js/JSSharedData.java       |   116 +
 .../internal/codegen/js/JSSourceMapEmitter.java |    67 +
 .../internal/codegen/js/JSSubEmitter.java       |   126 +
 .../compiler/internal/codegen/js/JSWriter.java  |   166 +
 .../internal/codegen/js/amd/ExportWriter.java   |   230 +
 .../codegen/js/amd/JSAMDDocEmitter.java         |    37 +
 .../internal/codegen/js/amd/JSAMDEmitter.java   |   971 +
 .../codegen/js/amd/JSAMDEmitterTokens.java      |    38 +
 .../internal/codegen/js/amd/TempTools.java      |   451 +
 .../codegen/js/flexjs/JSFlexJSDocEmitter.java   |   391 +
 .../codegen/js/flexjs/JSFlexJSEmitter.java      |  1009 +
 .../js/flexjs/JSFlexJSEmitterTokens.java        |    64 +
 .../codegen/js/flexjs/Notes_JSFlexJSEmitter.txt |   367 +
 .../codegen/js/goog/JSGoogDocEmitter.java       |   531 +
 .../codegen/js/goog/JSGoogDocEmitterTokens.java |    38 +
 .../internal/codegen/js/goog/JSGoogEmitter.java |  1120 +
 .../codegen/js/goog/JSGoogEmitterTokens.java    |    52 +
 .../codegen/js/goog/JSGoogPublisher.java        |   360 +
 .../internal/codegen/js/jsc/JSCJSEmitter.java   |    39 +
 .../internal/codegen/js/jsc/JSCPublisher.java   |    53 +
 .../internal/codegen/js/jx/AccessorEmitter.java |   420 +
 .../internal/codegen/js/jx/AsIsEmitter.java     |   197 +
 .../codegen/js/jx/BinaryOperatorEmitter.java    |   504 +
 .../internal/codegen/js/jx/BindableEmitter.java |   129 +
 .../internal/codegen/js/jx/ClassEmitter.java    |   182 +
 .../js/jx/DefinePropertyFunctionEmitter.java    |   120 +
 .../codegen/js/jx/DoWhileLoopEmitter.java       |    71 +
 .../codegen/js/jx/DynamicAccessEmitter.java     |    54 +
 .../internal/codegen/js/jx/FieldEmitter.java    |   131 +
 .../internal/codegen/js/jx/ForEachEmitter.java  |   157 +
 .../internal/codegen/js/jx/ForLoopEmitter.java  |    99 +
 .../js/jx/FunctionCallArgumentsEmitter.java     |    64 +
 .../codegen/js/jx/FunctionCallEmitter.java      |   200 +
 .../codegen/js/jx/IdentifierEmitter.java        |   257 +
 .../internal/codegen/js/jx/IfEmitter.java       |   117 +
 .../codegen/js/jx/InterfaceEmitter.java         |   131 +
 .../codegen/js/jx/IterationFlowEmitter.java     |    54 +
 .../js/jx/LanguageIdentifierEmitter.java        |    44 +
 .../codegen/js/jx/LiteralContainerEmitter.java  |    96 +
 .../internal/codegen/js/jx/LiteralEmitter.java  |   134 +
 .../codegen/js/jx/MemberAccessEmitter.java      |   323 +
 .../codegen/js/jx/MemberKeywordEmitter.java     |    70 +
 .../internal/codegen/js/jx/MethodEmitter.java   |   145 +
 .../codegen/js/jx/NumericLiteralEmitter.java    |    43 +
 .../js/jx/ObjectDefinePropertyEmitter.java      |   166 +
 .../js/jx/ObjectLiteralValuePairEmitter.java    |    53 +
 .../codegen/js/jx/PackageFooterEmitter.java     |   640 +
 .../codegen/js/jx/PackageHeaderEmitter.java     |   290 +
 .../codegen/js/jx/ParameterEmitter.java         |    61 +
 .../codegen/js/jx/ParametersEmitter.java        |    64 +
 .../internal/codegen/js/jx/ReturnEmitter.java   |    57 +
 .../codegen/js/jx/SelfReferenceEmitter.java     |    52 +
 .../js/jx/SourceMapDirectiveEmitter.java        |    60 +
 .../codegen/js/jx/StatementEmitter.java         |    55 +
 .../codegen/js/jx/SuperCallEmitter.java         |   268 +
 .../codegen/js/jx/TernaryOperatorEmitter.java   |    67 +
 .../codegen/js/jx/UnaryOperatorEmitter.java     |   122 +
 .../codegen/js/jx/VarDeclarationEmitter.java    |   123 +
 .../codegen/js/jx/WhileLoopEmitter.java         |    61 +
 .../internal/codegen/js/node/NodePublisher.java |    63 +
 .../codegen/js/utils/DocEmitterUtils.java       |    49 +
 .../internal/codegen/js/utils/EmitterUtils.java |   513 +
 .../codegen/js/vf2js/JSVF2JSDocEmitter.java     |   270 +
 .../codegen/js/vf2js/JSVF2JSEmitter.java        |  1950 ++
 .../internal/codegen/mxml/MXMLBlockWalker.java  |   436 +
 .../internal/codegen/mxml/MXMLEmitter.java      |   425 +
 .../codegen/mxml/MXMLEmitterTokens.java         |    42 +
 .../internal/codegen/mxml/MXMLWriter.java       |    84 +
 .../mxml/flexjs/MXMLDescriptorSpecifier.java    |   317 +
 .../codegen/mxml/flexjs/MXMLEventSpecifier.java |    99 +
 .../mxml/flexjs/MXMLFlexJSBlockWalker.java      |    83 +
 .../codegen/mxml/flexjs/MXMLFlexJSEmitter.java  |  2320 ++
 .../mxml/flexjs/MXMLFlexJSEmitterTokens.java    |    42 +
 .../mxml/flexjs/MXMLFlexJSPublisher.java        |   656 +
 .../codegen/mxml/flexjs/MXMLNodeSpecifier.java  |   170 +
 .../mxml/flexjs/MXMLScriptSpecifier.java        |    67 +
 .../codegen/mxml/jsc/MXMLJSCJSEmitter.java      |    46 +
 .../vf2js/MXMLVF2JSDescriptorSpecifier.java     |   337 +
 .../codegen/mxml/vf2js/MXMLVF2JSEmitter.java    |  1589 +
 .../codegen/mxml/vf2js/MXMLVF2JSPublisher.java  |   600 +
 .../compiler/internal/driver/as/ASBackend.java  |   159 +
 .../internal/driver/js/JSApplication.java       |    32 +
 .../compiler/internal/driver/js/JSBackend.java  |   171 +
 .../internal/driver/js/JSCompilationUnit.java   |   217 +
 .../internal/driver/js/JSSourceFileHandler.java |    83 +
 .../internal/driver/js/amd/AMDBackend.java      |    53 +
 .../driver/js/flexjs/FlexJSBackend.java         |    53 +
 .../js/flexjs/JSCSSCompilationSession.java      |   414 +
 .../internal/driver/js/goog/GoogBackend.java    |    73 +
 .../driver/js/goog/JSGoogConfiguration.java     |   311 +
 .../internal/driver/js/jsc/JSCBackend.java      |    47 +
 .../internal/driver/js/node/NodeBackend.java    |    47 +
 .../driver/js/vf2js/JSVF2JSConfiguration.java   |    86 +
 .../internal/driver/js/vf2js/VF2JSBackend.java  |    55 +
 .../internal/driver/mxml/MXMLBackend.java       |    80 +
 .../driver/mxml/MXMLSourceFileHandler.java      |    85 +
 .../driver/mxml/flexjs/MXMLFlexJSBackend.java   |   131 +
 .../mxml/flexjs/MXMLFlexJSSWCBackend.java       |   121 +
 .../driver/mxml/jsc/MXMLJSCJSBackend.java       |   121 +
 .../driver/mxml/jsc/MXMLJSCJSSWCBackend.java    |   121 +
 .../driver/mxml/vf2js/MXMLVF2JSBackend.java     |   132 +
 .../driver/mxml/vf2js/MXMLVF2JSSWCBackend.java  |   121 +
 .../compiler/internal/graph/GoogDepsWriter.java |   682 +
 .../internal/graph/VF2JSDepsWriter.java         |   406 +
 .../parsing/as/FlexJSASDocDelegate.java         |   143 +
 .../internal/projects/FlexJSProject.java        |   267 +
 .../internal/targets/FlexJSSWCTarget.java       |   303 +
 .../compiler/internal/targets/FlexJSTarget.java |   295 +
 .../compiler/internal/targets/JSTarget.java     |   231 +
 .../internal/visitor/as/ASNodeHandler.java      |    87 +
 .../internal/visitor/as/ASNodeSwitch.java       |   386 +
 .../visitor/as/BeforeAfterStrategy.java         |   141 +
 .../internal/visitor/mxml/MXMLNodeSwitch.java   |   187 +
 .../UnsupportedLanguageFeatureProblem.java      |    37 +
 .../apache/flex/compiler/targets/IJSTarget.java |    52 +
 .../apache/flex/compiler/utils/ASNodeUtils.java |    93 +
 .../flex/compiler/utils/DefinitionUtils.java    |    37 +
 .../compiler/utils/JSClosureCompilerUtil.java   |    98 +
 .../utils/JSClosureCompilerWrapper.java         |   305 +
 .../apache/flex/compiler/utils/NativeUtils.java |   161 +
 .../utils/VF2JSClosureCompilerWrapper.java      |   224 +
 .../flex/compiler/utils/VF2JSProjectUtils.java  |   132 +
 .../flex/compiler/visitor/IASNodeStrategy.java  |    38 +
 .../flex/compiler/visitor/IBlockVisitor.java    |    28 +
 .../flex/compiler/visitor/IBlockWalker.java     |    47 +
 .../compiler/visitor/as/IASBlockVisitor.java    |   229 +
 .../compiler/visitor/as/IASBlockWalker.java     |    43 +
 .../visitor/mxml/IMXMLBlockVisitor.java         |   138 +
 .../compiler/visitor/mxml/IMXMLBlockWalker.java |    43 +
 .../org.apache.flex.tools.FlexToolGroup         |     2 +
 .../codegen/as/TestAccessorMembers.java         |   101 +
 .../compiler/internal/codegen/as/TestClass.java |   234 +
 .../internal/codegen/as/TestComments.java       |    73 +
 .../internal/codegen/as/TestExpressions.java    |   764 +
 .../internal/codegen/as/TestFieldMembers.java   |   204 +
 .../internal/codegen/as/TestGlobalClasses.java  |   280 +
 .../codegen/as/TestGlobalConstants.java         |    62 +
 .../codegen/as/TestGlobalFunctions.java         |   208 +
 .../internal/codegen/as/TestInterface.java      |   105 +
 .../internal/codegen/as/TestMethodMembers.java  |   147 +
 .../internal/codegen/as/TestPackage.java        |   103 +
 .../internal/codegen/as/TestParenthesis.java    |    98 +
 .../internal/codegen/as/TestStatements.java     |   469 +
 .../codegen/externals/CompilerArguments.java    |   408 +
 .../codegen/externals/ExternalsTestBase.java    |   108 +
 .../codegen/externals/ExternalsTestUtils.java   |   173 +
 .../codegen/externals/TestAnnotationEnum.java   |    82 +
 .../codegen/externals/TestCollectImports.java   |   221 +
 .../codegen/externals/TestConstructor.java      |   119 +
 .../codegen/externals/TestExternChrome.java     |   153 +
 .../codegen/externals/TestExternES3.java        |   122 +
 .../codegen/externals/TestExternJQuery.java     |    67 +
 .../codegen/externals/TestExternJasmine.java    |    83 +
 .../externals/TestExternalsJSCompile.java       |   287 +
 .../codegen/externals/TestPackageNamespace.java |    63 +
 .../codegen/externals/TestReferenceModel.java   |    64 +
 .../codegen/externals/TestTypeExternals.java    |   141 +
 .../codegen/externals/TestTypeInheritence.java  |    87 +
 .../internal/codegen/js/amd/TestAMDClassA.java  |   181 +
 .../internal/codegen/js/amd/TestAMDClassB.java  |    97 +
 .../internal/codegen/js/amd/TestAMDEmiter.java  |   144 +
 .../codegen/js/amd/TestAMDInterfaceI.java       |    51 +
 .../codegen/js/amd/TestAMDInterfaceIOther.java  |    51 +
 .../codegen/js/amd/TestAMDInterfaceISub.java    |    52 +
 .../internal/codegen/js/amd/TestAMDPackage.java |   127 +
 .../js/flexjs/TestFlexJSAccessorMembers.java    |   156 +
 .../codegen/js/flexjs/TestFlexJSAccessors.java  |    84 +
 .../codegen/js/flexjs/TestFlexJSClass.java      |   397 +
 .../codegen/js/flexjs/TestFlexJSEmiter.java     |   364 +
 .../js/flexjs/TestFlexJSExpressions.java        |   975 +
 .../js/flexjs/TestFlexJSFieldMembers.java       |   326 +
 .../codegen/js/flexjs/TestFlexJSFile.java       |   107 +
 .../js/flexjs/TestFlexJSGlobalClasses.java      |   666 +
 .../js/flexjs/TestFlexJSGlobalConstants.java    |    75 +
 .../js/flexjs/TestFlexJSGlobalFunctions.java    |   238 +
 .../codegen/js/flexjs/TestFlexJSInterface.java  |    78 +
 .../js/flexjs/TestFlexJSMethodMembers.java      |   207 +
 .../codegen/js/flexjs/TestFlexJSPackage.java    |  1177 +
 .../codegen/js/flexjs/TestFlexJSProject.java    |   339 +
 .../codegen/js/flexjs/TestFlexJSStatements.java |   600 +
 .../js/goog/TestGoogAccessorMembers.java        |   141 +
 .../internal/codegen/js/goog/TestGoogClass.java |   260 +
 .../codegen/js/goog/TestGoogEmiter.java         |   153 +
 .../codegen/js/goog/TestGoogExpressions.java    |   195 +
 .../codegen/js/goog/TestGoogFieldMembers.java   |   261 +
 .../internal/codegen/js/goog/TestGoogFile.java  |    93 +
 .../codegen/js/goog/TestGoogGlobalClasses.java  |   309 +
 .../js/goog/TestGoogGlobalConstants.java        |    74 +
 .../js/goog/TestGoogGlobalFunctions.java        |   238 +
 .../codegen/js/goog/TestGoogInterface.java      |   113 +
 .../codegen/js/goog/TestGoogMethodMembers.java  |   183 +
 .../codegen/js/goog/TestGoogPackage.java        |   112 +
 .../codegen/js/goog/TestGoogProject.java        |    98 +
 .../codegen/js/goog/TestGoogStatements.java     |   310 +
 .../js/sourcemaps/TestSourceMapExpressions.java |   716 +
 .../js/sourcemaps/TestSourceMapStatements.java  |   171 +
 .../codegen/js/vf2js/TestVF2JSClass.java        |   402 +
 .../codegen/js/vf2js/TestVF2JSExpressions.java  |   124 +
 .../codegen/js/vf2js/TestVF2JSFile.java         |    92 +
 .../codegen/js/vf2js/TestVF2JSProject.java      |   131 +
 .../codegen/js/vf2js/TestVF2JSStatements.java   |   549 +
 .../codegen/mxml/TestMXMLApplication.java       |   109 +
 .../codegen/mxml/TestMXMLAttributes.java        |   118 +
 .../internal/codegen/mxml/TestMXMLNodes.java    |   187 +
 .../internal/codegen/mxml/TestMXMLScript.java   |   106 +
 .../mxml/flexjs/TestFlexJSMXMLApplication.java  |   279 +
 .../mxml/flexjs/TestFlexJSMXMLScript.java       |   237 +
 .../mxml/vf2js/TestVF2JSMXMLApplication.java    |    97 +
 .../compiler/internal/test/AMDTestBase.java     |   149 +
 .../flex/compiler/internal/test/ASTestBase.java |   190 +
 .../compiler/internal/test/FlexJSTestBase.java  |   140 +
 .../flex/compiler/internal/test/ITestBase.java  |    25 +
 .../compiler/internal/test/MXMLTestBase.java    |   141 +
 .../internal/test/SourceMapTestBase.java        |    55 +
 .../flex/compiler/internal/test/TestBase.java   |   678 +
 .../internal/test/VF2JSMXMLTestBase.java        |   219 +
 .../compiler/internal/test/VF2JSTestBase.java   |   238 +
 .../org/apache/flex/utils/EnvProperties.java    |   149 +
 .../amd/simple-project/src/HelloWorld.as        |    55 +
 .../amd/simple-project/src/com/acme/A.as        |    57 +
 .../amd/simple-project/src/com/acme/B.as        |    47 +
 .../amd/simple-project/src/com/acme/I.as        |    26 +
 .../simple-project/src/com/acme/sub/IOther.as   |    25 +
 .../amd/simple-project/src/com/acme/sub/ISub.as |    28 +
 .../resources/externals/app1/as_src/Main.as     |    34 +
 .../externals_unit_tests/annotation_enum.js     |    61 +
 .../externals_unit_tests/constructor_members.js |    57 +
 .../externals_unit_tests/constructor_params.js  |    81 +
 .../imports/import_constructor_signatures.js    |    43 +
 .../imports/import_functions.js                 |    47 +
 .../imports/import_interfaces.js                |    49 +
 .../imports/import_method_signatures.js         |    71 +
 .../imports/import_superclasses.js              |    46 +
 .../externals_unit_tests/package_namespace.js   |    48 +
 .../externals_unit_tests/type_inheritence.js    |    62 +
 .../externals_unit_tests/types_param.js         |    82 +
 .../flexjs/files/FlexJSTest_again.mxml          |    51 +
 .../flexjs/files/FlexJSTest_again_result.js     |   212 +
 .../resources/flexjs/files/LocalFunction.as     |    44 +
 .../flexjs/files/LocalFunction_result.js        |    99 +
 .../resources/flexjs/files/MyInitialView.mxml   |   125 +
 .../flexjs/files/MyInitialView_result.js        |   889 +
 .../flexjs/files/StockDataJSONItemConverter.as  |    40 +
 .../flexjs/files/StockDataJSONItemConverter.js  |    39 +
 .../flexjs/files/controllers/MyController.as    |    92 +
 .../files/controllers/MyController_result.js    |   181 +
 .../resources/flexjs/files/models/MyModel.as    |    59 +
 .../flexjs/files/models/MyModel_result.js       |   125 +
 .../resources/flexjs/files/wildcard_import.mxml |    37 +
 .../flexjs/files/wildcard_import_result.js      |    99 +
 .../flexjs/projects/bad_overrides/Test.as       |    43 +
 .../projects/bad_overrides/Test_result.js       |    94 +
 .../flexjs/projects/bad_overrides/classes/A.as  |    41 +
 .../projects/bad_overrides/classes/A_result.js  |    92 +
 .../flexjs/projects/bad_overrides/classes/B.as  |    25 +
 .../projects/bad_overrides/classes/B_result.js  |    69 +
 .../flexjs/projects/bad_overrides/classes/C.as  |    25 +
 .../projects/bad_overrides/classes/C_result.js  |    69 +
 .../projects/bad_overrides/interfaces/IA.as     |    28 +
 .../bad_overrides/interfaces/IA_result.js       |    69 +
 .../projects/bad_overrides/interfaces/IB.as     |    22 +
 .../bad_overrides/interfaces/IB_result.js       |    62 +
 .../projects/bad_overrides/interfaces/IC.as     |    22 +
 .../bad_overrides/interfaces/IC_result.js       |    62 +
 .../resources/flexjs/projects/circular/Base.as  |    30 +
 .../flexjs/projects/circular/Base_result.js     |    74 +
 .../resources/flexjs/projects/circular/Super.as |    27 +
 .../flexjs/projects/circular/Super_result.js    |    77 +
 .../flexjs/projects/interfaces/Test.as          |    44 +
 .../flexjs/projects/interfaces/Test_result.js   |    95 +
 .../flexjs/projects/interfaces/classes/A.as     |    28 +
 .../projects/interfaces/classes/A_result.js     |    74 +
 .../flexjs/projects/interfaces/classes/B.as     |    25 +
 .../projects/interfaces/classes/B_result.js     |    69 +
 .../flexjs/projects/interfaces/classes/C.as     |    25 +
 .../projects/interfaces/classes/C_result.js     |    69 +
 .../flexjs/projects/interfaces/interfaces/IA.as |    22 +
 .../projects/interfaces/interfaces/IA_result.js |    65 +
 .../flexjs/projects/interfaces/interfaces/IB.as |    22 +
 .../projects/interfaces/interfaces/IB_result.js |    38 +
 .../flexjs/projects/interfaces/interfaces/IC.as |    22 +
 .../projects/interfaces/interfaces/IC_result.js |    65 +
 .../flexjs/projects/interfaces/interfaces/ID.as |    22 +
 .../projects/interfaces/interfaces/ID_result.js |    62 +
 .../flexjs/projects/interfaces/interfaces/IE.as |    26 +
 .../projects/interfaces/interfaces/IE_result.js |    68 +
 .../flexjs/projects/internal/MainClass.as       |    38 +
 .../projects/internal/MainClass_result.js       |   127 +
 .../flexjs/projects/internal/OtherClass.as      |    25 +
 .../projects/internal/OtherClass_result.js      |    69 +
 .../resources/flexjs/projects/overrides/Test.as |    43 +
 .../flexjs/projects/overrides/Test_result.js    |    94 +
 .../flexjs/projects/overrides/classes/A.as      |    41 +
 .../projects/overrides/classes/A_result.js      |    92 +
 .../flexjs/projects/overrides/classes/B.as      |    25 +
 .../projects/overrides/classes/B_result.js      |    69 +
 .../flexjs/projects/overrides/classes/C.as      |    25 +
 .../projects/overrides/classes/C_result.js      |    74 +
 .../flexjs/projects/overrides/interfaces/IA.as  |    28 +
 .../projects/overrides/interfaces/IA_result.js  |    69 +
 .../flexjs/projects/overrides/interfaces/IB.as  |    22 +
 .../projects/overrides/interfaces/IB_result.js  |    62 +
 .../flexjs/projects/overrides/interfaces/IC.as  |    22 +
 .../projects/overrides/interfaces/IC_result.js  |    65 +
 .../AmbiguousDefinition.as                      |    32 +
 .../AmbiguousDefinition_result.js               |    49 +
 .../Event.as                                    |    27 +
 .../Event_result.js                             |    39 +
 .../mypackage/TestClass.as                      |    33 +
 .../otherpackage/Event.as                       |    27 +
 .../DifferentPackageAsConflict.as               |    32 +
 .../DifferentPackageAsConflict_result.js        |    79 +
 .../Event.as                                    |    27 +
 .../Event_result.js                             |    70 +
 .../mypackage/TestClass.as                      |    31 +
 .../mypackage/TestClass_result.js               |    81 +
 .../otherpackage/Event.as                       |    27 +
 .../otherpackage/Event_result.js                |    70 +
 .../Event.as                                    |    27 +
 .../Event_result.js                             |    70 +
 .../NoConflictNoWindow.as                       |    32 +
 .../NoConflictNoWindow_result.js                |    79 +
 .../mypackage/TestClass.as                      |    29 +
 .../mypackage/TestClass_result.js               |    79 +
 .../Event.as                                    |    27 +
 .../Event_result.js                             |    70 +
 .../NoConflictUseWindow.as                      |    32 +
 .../NoConflictUseWindow_result.js               |    79 +
 .../mypackage/TestClass.as                      |    31 +
 .../mypackage/TestClass_result.js               |    79 +
 .../Event.as                                    |    27 +
 .../Event_result.js                             |    70 +
 .../SamePackageAsConflict.as                    |    32 +
 .../SamePackageAsConflict_result.js             |    79 +
 .../mypackage/Event.as                          |    27 +
 .../mypackage/Event_result.js                   |    70 +
 .../mypackage/TestClass.as                      |    29 +
 .../mypackage/TestClass_result.js               |    81 +
 .../package_conflicts_use_window/Event.as       |    27 +
 .../Event_result.js                             |    70 +
 .../package_conflicts_use_window/UseWindow.as   |    32 +
 .../UseWindow_result.js                         |    79 +
 .../mypackage/TestClass.as                      |    33 +
 .../mypackage/TestClass_result.js               |    89 +
 .../otherpackage/Event.as                       |    27 +
 .../otherpackage/Event_result.js                |    70 +
 .../resources/flexjs/projects/super/Base.as     |    43 +
 .../flexjs/projects/super/Base_result.js        |    90 +
 .../resources/flexjs/projects/super/Super.as    |    40 +
 .../flexjs/projects/super/Super_result.js       |    91 +
 .../flexjs/projects/xml_requires/XMLRequire.as  |    30 +
 .../projects/xml_requires/XMLRequire_result.js  |    74 +
 .../src/test/resources/goog/files/call-super.as |    42 +
 .../resources/goog/files/call-super_result.js   |    41 +
 .../src/test/resources/goog/files/get-set.as    |    40 +
 .../test/resources/goog/files/get-set_result.js |    49 +
 .../src/test/resources/goog/files/input.as      |    39 +
 .../src/test/resources/goog/files/output.js     |    47 +
 .../src/test/resources/goog/files/poc.as        |   107 +
 .../src/test/resources/goog/files/poc_result.js |   154 +
 .../resources/goog/files/qualify-new-object.as  |    51 +
 .../goog/files/qualify-new-object_result.js     |    49 +
 .../resources/goog/projects/imports/Case.as     |    30 +
 .../goog/projects/imports/Case_result.js        |    24 +
 .../resources/goog/projects/imports/comps/A.as  |    28 +
 .../goog/projects/imports/comps/A_result.js     |    22 +
 .../resources/goog/projects/imports/comps/B.as  |    27 +
 .../goog/projects/imports/comps/B_result.js     |    20 +
 .../src/test/resources/vf2js/files/SimpleAS.as  |    43 +
 .../resources/vf2js/files/SimpleAS_result.js    |    72 +
 .../test/resources/vf2js/files/SimpleMXML.mxml  |    28 +
 .../resources/vf2js/files/SimpleMXML_result.js  |    67 +
 .../src/test/resources/vf2js/files/Version.as   |    25 +
 .../resources/vf2js/projects/interfaces/Test.as |    46 +
 .../vf2js/projects/interfaces/Test_result.js    |    64 +
 .../vf2js/projects/interfaces/classes/A.as      |    32 +
 .../projects/interfaces/classes/A_result.js     |    51 +
 .../vf2js/projects/interfaces/classes/B.as      |    25 +
 .../projects/interfaces/classes/B_result.js     |    37 +
 .../vf2js/projects/interfaces/classes/C.as      |    25 +
 .../projects/interfaces/classes/C_result.js     |    37 +
 .../vf2js/projects/interfaces/interfaces/IA.as  |    22 +
 .../projects/interfaces/interfaces/IA_result.js |    41 +
 .../vf2js/projects/interfaces/interfaces/IB.as  |    22 +
 .../projects/interfaces/interfaces/IB_result.js |    38 +
 .../vf2js/projects/interfaces/interfaces/IC.as  |    22 +
 .../projects/interfaces/interfaces/IC_result.js |    41 +
 .../vf2js/projects/interfaces/interfaces/ID.as  |    22 +
 .../projects/interfaces/interfaces/ID_result.js |    38 +
 .../vf2js/projects/interfaces/interfaces/IE.as  |    26 +
 .../projects/interfaces/interfaces/IE_result.js |    53 +
 .../vf2js/projects/sdk/SomeSDKClass.as          |    68 +
 .../vf2js/projects/sdk/SomeSDKClass_result.js   |   114 +
 .../vf2js/projects/sdk/bases/HelperBaseClass.as |    33 +
 .../sdk/bases/HelperBaseClass_result.js         |    46 +
 .../simpleMXML/src/SimpleMXML_Project.mxml      |    37 +
 .../simpleMXML/src/SimpleMXML_Project_result.js |    68 +
 .../simpleMXML/src/example/Component.as         |    31 +
 .../simpleMXML/src/example/Component_result.js  |    45 +
 .../test/resources/vf2js/projects/super/Base.as |    65 +
 .../vf2js/projects/super/Base_result.js         |   120 +
 .../resources/vf2js/projects/super/Super.as     |    54 +
 .../vf2js/projects/super/Super_result.js        |    89 +
 compiler.js/.classpath                          |    13 -
 compiler.js/.gitignore                          |     6 -
 compiler.js/.project                            |    17 -
 compiler.js/README                              |    13 -
 compiler.js/bin/mxmlc                           |    70 -
 compiler.js/bin/mxmlc.bat                       |    29 -
 compiler.js/build.xml                           |   261 -
 compiler.js/downloads.xml                       |   363 -
 compiler.js/js/adobe.js                         |   103 -
 .../compiler/problems/Messages_de.properties    |   282 -
 .../compiler/problems/Messages_en.properties    |   283 -
 .../compiler/problems/Messages_es.properties    |   282 -
 .../compiler/problems/Messages_fr.properties    |   282 -
 .../compiler/problems/Messages_it.properties    |   282 -
 .../compiler/problems/Messages_ja.properties    |   282 -
 .../compiler/problems/Messages_ko.properties    |   282 -
 .../compiler/problems/Messages_pt.properties    |   282 -
 .../compiler/problems/Messages_zh_cn.properties |   282 -
 .../compiler/problems/Messages_zh_tw.properties |   282 -
 .../clients/JSCommandLineConfiguration.java     |   356 -
 .../apache/flex/compiler/clients/MXMLJSC.java   |  1629 -
 .../as/codegen/ABCGeneratingReducer.java        |    28 -
 .../as/codegen/JSClassDirectiveProcessor.java   |   378 -
 .../compiler/internal/as/codegen/JSEmitter.java |  3448 --
 .../internal/as/codegen/JSFlexUtils.java        |   152 -
 .../as/codegen/JSGeneratingReducer.java         | 11683 -------
 .../internal/as/codegen/JSGenerator.java        |   925 -
 .../as/codegen/JSGlobalDirectiveProcessor.java  |   345 -
 .../codegen/JSInterfaceDirectiveProcessor.java  |   118 -
 .../codegen/JSMXMLClassDirectiveProcessor.java  |  1616 -
 .../internal/as/codegen/JSMXMLEmitter.java      |   157 -
 .../internal/as/codegen/JSSharedData.java       |   989 -
 .../compiler/internal/as/codegen/JSWriter.java  |  1443 -
 .../compiler/internal/as/codegen/cmc-js.jbg     |   328 -
 .../flex/compiler/internal/driver/IBackend.java |    89 -
 .../compiler/internal/driver/JSBackend.java     |   135 -
 .../internal/driver/JSCompilationUnit.java      |   239 -
 .../internal/driver/JSSourceFileHandler.java    |    82 -
 .../flex/compiler/internal/driver/JSTarget.java |   322 -
 .../compiler/internal/graph/GoogDepsWriter.java |   299 -
 .../internal/legacy/ASDefinitionFilter.java     |  2140 --
 .../compiler/internal/legacy/ASScopeUtils.java  |   388 -
 .../legacy/DefinitionFilterContext.java         |    45 -
 .../internal/legacy/FilterPredicate.java        |   100 -
 .../internal/legacy/IFilterContext.java         |    75 -
 .../legacy/MemberedDefinitionUtils.java         |   128 -
 .../internal/legacy/NodeFilterContext.java      |   175 -
 .../internal/legacy/ScopeFilterContext.java     |    89 -
 .../internal/projects/FlexJSProject.java        |    72 -
 .../problems/MXMLNotImplementedProblem.java     |    43 -
 compiler.js/tests/MainCode.as                   |    44 -
 compiler.js/tests/TestApp.as                    |    67 -
 compiler.jx.tests/.classpath                    |    13 -
 compiler.jx.tests/.gitignore                    |     6 -
 compiler.jx.tests/.project                      |    17 -
 compiler.jx.tests/build.xml                     |   187 -
 compiler.jx.tests/downloads.xml                 |   119 -
 .../codegen/as/TestAccessorMembers.java         |   101 -
 .../compiler/internal/codegen/as/TestClass.java |   234 -
 .../internal/codegen/as/TestComments.java       |    73 -
 .../internal/codegen/as/TestExpressions.java    |   764 -
 .../internal/codegen/as/TestFieldMembers.java   |   204 -
 .../internal/codegen/as/TestGlobalClasses.java  |   280 -
 .../codegen/as/TestGlobalConstants.java         |    62 -
 .../codegen/as/TestGlobalFunctions.java         |   208 -
 .../internal/codegen/as/TestInterface.java      |   105 -
 .../internal/codegen/as/TestMethodMembers.java  |   147 -
 .../internal/codegen/as/TestPackage.java        |   103 -
 .../internal/codegen/as/TestParenthesis.java    |    98 -
 .../internal/codegen/as/TestStatements.java     |   469 -
 .../codegen/externals/CompilerArguments.java    |   408 -
 .../codegen/externals/ExternalsTestBase.java    |   108 -
 .../codegen/externals/ExternalsTestUtils.java   |   173 -
 .../codegen/externals/TestAnnotationEnum.java   |    82 -
 .../codegen/externals/TestCollectImports.java   |   221 -
 .../codegen/externals/TestConstructor.java      |   119 -
 .../codegen/externals/TestExternChrome.java     |   153 -
 .../codegen/externals/TestExternES3.java        |   122 -
 .../codegen/externals/TestExternJQuery.java     |    67 -
 .../codegen/externals/TestExternJasmine.java    |    83 -
 .../externals/TestExternalsJSCompile.java       |   287 -
 .../codegen/externals/TestPackageNamespace.java |    63 -
 .../codegen/externals/TestReferenceModel.java   |    64 -
 .../codegen/externals/TestTypeExternals.java    |   141 -
 .../codegen/externals/TestTypeInheritence.java  |    87 -
 .../internal/codegen/js/amd/TestAMDClassA.java  |   181 -
 .../internal/codegen/js/amd/TestAMDClassB.java  |    97 -
 .../internal/codegen/js/amd/TestAMDEmiter.java  |   144 -
 .../codegen/js/amd/TestAMDInterfaceI.java       |    51 -
 .../codegen/js/amd/TestAMDInterfaceIOther.java  |    51 -
 .../codegen/js/amd/TestAMDInterfaceISub.java    |    52 -
 .../internal/codegen/js/amd/TestAMDPackage.java |   127 -
 .../js/flexjs/TestFlexJSAccessorMembers.java    |   156 -
 .../codegen/js/flexjs/TestFlexJSAccessors.java  |    84 -
 .../codegen/js/flexjs/TestFlexJSClass.java      |   397 -
 .../codegen/js/flexjs/TestFlexJSEmiter.java     |   364 -
 .../js/flexjs/TestFlexJSExpressions.java        |   975 -
 .../js/flexjs/TestFlexJSFieldMembers.java       |   326 -
 .../codegen/js/flexjs/TestFlexJSFile.java       |   107 -
 .../js/flexjs/TestFlexJSGlobalClasses.java      |   666 -
 .../js/flexjs/TestFlexJSGlobalConstants.java    |    75 -
 .../js/flexjs/TestFlexJSGlobalFunctions.java    |   238 -
 .../codegen/js/flexjs/TestFlexJSInterface.java  |    78 -
 .../js/flexjs/TestFlexJSMethodMembers.java      |   207 -
 .../codegen/js/flexjs/TestFlexJSPackage.java    |  1177 -
 .../codegen/js/flexjs/TestFlexJSProject.java    |   339 -
 .../codegen/js/flexjs/TestFlexJSStatements.java |   600 -
 .../js/goog/TestGoogAccessorMembers.java        |   141 -
 .../internal/codegen/js/goog/TestGoogClass.java |   260 -
 .../codegen/js/goog/TestGoogEmiter.java         |   153 -
 .../codegen/js/goog/TestGoogExpressions.java    |   195 -
 .../codegen/js/goog/TestGoogFieldMembers.java   |   261 -
 .../internal/codegen/js/goog/TestGoogFile.java  |    93 -
 .../codegen/js/goog/TestGoogGlobalClasses.java  |   309 -
 .../js/goog/TestGoogGlobalConstants.java        |    74 -
 .../js/goog/TestGoogGlobalFunctions.java        |   238 -
 .../codegen/js/goog/TestGoogInterface.java      |   113 -
 .../codegen/js/goog/TestGoogMethodMembers.java  |   183 -
 .../codegen/js/goog/TestGoogPackage.java        |   112 -
 .../codegen/js/goog/TestGoogProject.java        |    98 -
 .../codegen/js/goog/TestGoogStatements.java     |   310 -
 .../js/sourcemaps/TestSourceMapExpressions.java |   716 -
 .../js/sourcemaps/TestSourceMapStatements.java  |   171 -
 .../codegen/js/vf2js/TestVF2JSClass.java        |   402 -
 .../codegen/js/vf2js/TestVF2JSExpressions.java  |   124 -
 .../codegen/js/vf2js/TestVF2JSFile.java         |    92 -
 .../codegen/js/vf2js/TestVF2JSProject.java      |   131 -
 .../codegen/js/vf2js/TestVF2JSStatements.java   |   549 -
 .../codegen/mxml/TestMXMLApplication.java       |   109 -
 .../codegen/mxml/TestMXMLAttributes.java        |   118 -
 .../internal/codegen/mxml/TestMXMLNodes.java    |   187 -
 .../internal/codegen/mxml/TestMXMLScript.java   |   106 -
 .../mxml/flexjs/TestFlexJSMXMLApplication.java  |   279 -
 .../mxml/flexjs/TestFlexJSMXMLScript.java       |   237 -
 .../mxml/vf2js/TestVF2JSMXMLApplication.java    |    97 -
 .../compiler/internal/test/AMDTestBase.java     |   149 -
 .../flex/compiler/internal/test/ASTestBase.java |   190 -
 .../compiler/internal/test/FlexJSTestBase.java  |   140 -
 .../flex/compiler/internal/test/ITestBase.java  |    25 -
 .../compiler/internal/test/MXMLTestBase.java    |   141 -
 .../internal/test/SourceMapTestBase.java        |    55 -
 .../flex/compiler/internal/test/TestBase.java   |   678 -
 .../internal/test/VF2JSMXMLTestBase.java        |   219 -
 .../compiler/internal/test/VF2JSTestBase.java   |   238 -
 .../org/apache/flex/utils/EnvProperties.java    |   149 -
 .../amd/simple-project/src/HelloWorld.as        |    55 -
 .../amd/simple-project/src/com/acme/A.as        |    57 -
 .../amd/simple-project/src/com/acme/B.as        |    47 -
 .../amd/simple-project/src/com/acme/I.as        |    26 -
 .../simple-project/src/com/acme/sub/IOther.as   |    25 -
 .../amd/simple-project/src/com/acme/sub/ISub.as |    28 -
 .../test-files/externals/app1/as_src/Main.as    |    34 -
 .../externals_unit_tests/annotation_enum.js     |    61 -
 .../externals_unit_tests/constructor_members.js |    57 -
 .../externals_unit_tests/constructor_params.js  |    81 -
 .../imports/import_constructor_signatures.js    |    43 -
 .../imports/import_functions.js                 |    47 -
 .../imports/import_interfaces.js                |    49 -
 .../imports/import_method_signatures.js         |    71 -
 .../imports/import_superclasses.js              |    46 -
 .../externals_unit_tests/package_namespace.js   |    48 -
 .../externals_unit_tests/type_inheritence.js    |    62 -
 .../externals_unit_tests/types_param.js         |    82 -
 .../flexjs/files/FlexJSTest_again.mxml          |    51 -
 .../flexjs/files/FlexJSTest_again_result.js     |   212 -
 .../test-files/flexjs/files/LocalFunction.as    |    44 -
 .../flexjs/files/LocalFunction_result.js        |    99 -
 .../test-files/flexjs/files/MyInitialView.mxml  |   125 -
 .../flexjs/files/MyInitialView_result.js        |   889 -
 .../flexjs/files/StockDataJSONItemConverter.as  |    40 -
 .../flexjs/files/StockDataJSONItemConverter.js  |    39 -
 .../flexjs/files/controllers/MyController.as    |    92 -
 .../files/controllers/MyController_result.js    |   181 -
 .../test-files/flexjs/files/models/MyModel.as   |    59 -
 .../flexjs/files/models/MyModel_result.js       |   125 -
 .../flexjs/files/wildcard_import.mxml           |    37 -
 .../flexjs/files/wildcard_import_result.js      |    99 -
 .../flexjs/projects/bad_overrides/Test.as       |    43 -
 .../projects/bad_overrides/Test_result.js       |    94 -
 .../flexjs/projects/bad_overrides/classes/A.as  |    41 -
 .../projects/bad_overrides/classes/A_result.js  |    92 -
 .../flexjs/projects/bad_overrides/classes/B.as  |    25 -
 .../projects/bad_overrides/classes/B_result.js  |    69 -
 .../flexjs/projects/bad_overrides/classes/C.as  |    25 -
 .../projects/bad_overrides/classes/C_result.js  |    69 -
 .../projects/bad_overrides/interfaces/IA.as     |    28 -
 .../bad_overrides/interfaces/IA_result.js       |    69 -
 .../projects/bad_overrides/interfaces/IB.as     |    22 -
 .../bad_overrides/interfaces/IB_result.js       |    62 -
 .../projects/bad_overrides/interfaces/IC.as     |    22 -
 .../bad_overrides/interfaces/IC_result.js       |    62 -
 .../test-files/flexjs/projects/circular/Base.as |    30 -
 .../flexjs/projects/circular/Base_result.js     |    74 -
 .../flexjs/projects/circular/Super.as           |    27 -
 .../flexjs/projects/circular/Super_result.js    |    77 -
 .../flexjs/projects/interfaces/Test.as          |    44 -
 .../flexjs/projects/interfaces/Test_result.js   |    95 -
 .../flexjs/projects/interfaces/classes/A.as     |    28 -
 .../projects/interfaces/classes/A_result.js     |    74 -
 .../flexjs/projects/interfaces/classes/B.as     |    25 -
 .../projects/interfaces/classes/B_result.js     |    69 -
 .../flexjs/projects/interfaces/classes/C.as     |    25 -
 .../projects/interfaces/classes/C_result.js     |    69 -
 .../flexjs/projects/interfaces/interfaces/IA.as |    22 -
 .../projects/interfaces/interfaces/IA_result.js |    65 -
 .../flexjs/projects/interfaces/interfaces/IB.as |    22 -
 .../projects/interfaces/interfaces/IB_result.js |    38 -
 .../flexjs/projects/interfaces/interfaces/IC.as |    22 -
 .../projects/interfaces/interfaces/IC_result.js |    65 -
 .../flexjs/projects/interfaces/interfaces/ID.as |    22 -
 .../projects/interfaces/interfaces/ID_result.js |    62 -
 .../flexjs/projects/interfaces/interfaces/IE.as |    26 -
 .../projects/interfaces/interfaces/IE_result.js |    68 -
 .../flexjs/projects/internal/MainClass.as       |    38 -
 .../projects/internal/MainClass_result.js       |   127 -
 .../flexjs/projects/internal/OtherClass.as      |    25 -
 .../projects/internal/OtherClass_result.js      |    69 -
 .../flexjs/projects/overrides/Test.as           |    43 -
 .../flexjs/projects/overrides/Test_result.js    |    94 -
 .../flexjs/projects/overrides/classes/A.as      |    41 -
 .../projects/overrides/classes/A_result.js      |    92 -
 .../flexjs/projects/overrides/classes/B.as      |    25 -
 .../projects/overrides/classes/B_result.js      |    69 -
 .../flexjs/projects/overrides/classes/C.as      |    25 -
 .../projects/overrides/classes/C_result.js      |    74 -
 .../flexjs/projects/overrides/interfaces/IA.as  |    28 -
 .../projects/overrides/interfaces/IA_result.js  |    69 -
 .../flexjs/projects/overrides/interfaces/IB.as  |    22 -
 .../projects/overrides/interfaces/IB_result.js  |    62 -
 .../flexjs/projects/overrides/interfaces/IC.as  |    22 -
 .../projects/overrides/interfaces/IC_result.js  |    65 -
 .../AmbiguousDefinition.as                      |    32 -
 .../AmbiguousDefinition_result.js               |    49 -
 .../Event.as                                    |    27 -
 .../Event_result.js                             |    39 -
 .../mypackage/TestClass.as                      |    33 -
 .../otherpackage/Event.as                       |    27 -
 .../DifferentPackageAsConflict.as               |    32 -
 .../DifferentPackageAsConflict_result.js        |    79 -
 .../Event.as                                    |    27 -
 .../Event_result.js                             |    70 -
 .../mypackage/TestClass.as                      |    31 -
 .../mypackage/TestClass_result.js               |    81 -
 .../otherpackage/Event.as                       |    27 -
 .../otherpackage/Event_result.js                |    70 -
 .../Event.as                                    |    27 -
 .../Event_result.js                             |    70 -
 .../NoConflictNoWindow.as                       |    32 -
 .../NoConflictNoWindow_result.js                |    79 -
 .../mypackage/TestClass.as                      |    29 -
 .../mypackage/TestClass_result.js               |    79 -
 .../Event.as                                    |    27 -
 .../Event_result.js                             |    70 -
 .../NoConflictUseWindow.as                      |    32 -
 .../NoConflictUseWindow_result.js               |    79 -
 .../mypackage/TestClass.as                      |    31 -
 .../mypackage/TestClass_result.js               |    79 -
 .../Event.as                                    |    27 -
 .../Event_result.js                             |    70 -
 .../SamePackageAsConflict.as                    |    32 -
 .../SamePackageAsConflict_result.js             |    79 -
 .../mypackage/Event.as                          |    27 -
 .../mypackage/Event_result.js                   |    70 -
 .../mypackage/TestClass.as                      |    29 -
 .../mypackage/TestClass_result.js               |    81 -
 .../package_conflicts_use_window/Event.as       |    27 -
 .../Event_result.js                             |    70 -
 .../package_conflicts_use_window/UseWindow.as   |    32 -
 .../UseWindow_result.js                         |    79 -
 .../mypackage/TestClass.as                      |    33 -
 .../mypackage/TestClass_result.js               |    89 -
 .../otherpackage/Event.as                       |    27 -
 .../otherpackage/Event_result.js                |    70 -
 .../test-files/flexjs/projects/super/Base.as    |    43 -
 .../flexjs/projects/super/Base_result.js        |    90 -
 .../test-files/flexjs/projects/super/Super.as   |    40 -
 .../flexjs/projects/super/Super_result.js       |    91 -
 .../flexjs/projects/xml_requires/XMLRequire.as  |    30 -
 .../projects/xml_requires/XMLRequire_result.js  |    74 -
 .../test-files/goog/files/call-super.as         |    42 -
 .../test-files/goog/files/call-super_result.js  |    41 -
 .../test-files/goog/files/get-set.as            |    40 -
 .../test-files/goog/files/get-set_result.js     |    49 -
 .../test-files/goog/files/input.as              |    39 -
 .../test-files/goog/files/output.js             |    47 -
 compiler.jx.tests/test-files/goog/files/poc.as  |   107 -
 .../test-files/goog/files/poc_result.js         |   154 -
 .../test-files/goog/files/qualify-new-object.as |    51 -
 .../goog/files/qualify-new-object_result.js     |    49 -
 .../test-files/goog/projects/imports/Case.as    |    30 -
 .../goog/projects/imports/Case_result.js        |    24 -
 .../test-files/goog/projects/imports/comps/A.as |    28 -
 .../goog/projects/imports/comps/A_result.js     |    22 -
 .../test-files/goog/projects/imports/comps/B.as |    27 -
 .../goog/projects/imports/comps/B_result.js     |    20 -
 .../test-files/vf2js/files/SimpleAS.as          |    43 -
 .../test-files/vf2js/files/SimpleAS_result.js   |    72 -
 .../test-files/vf2js/files/SimpleMXML.mxml      |    28 -
 .../test-files/vf2js/files/SimpleMXML_result.js |    67 -
 .../test-files/vf2js/files/Version.as           |    25 -
 .../vf2js/projects/interfaces/Test.as           |    46 -
 .../vf2js/projects/interfaces/Test_result.js    |    64 -
 .../vf2js/projects/interfaces/classes/A.as      |    32 -
 .../projects/interfaces/classes/A_result.js     |    51 -
 .../vf2js/projects/interfaces/classes/B.as      |    25 -
 .../projects/interfaces/classes/B_result.js     |    37 -
 .../vf2js/projects/interfaces/classes/C.as      |    25 -
 .../projects/interfaces/classes/C_result.js     |    37 -
 .../vf2js/projects/interfaces/interfaces/IA.as  |    22 -
 .../projects/interfaces/interfaces/IA_result.js |    41 -
 .../vf2js/projects/interfaces/interfaces/IB.as  |    22 -
 .../projects/interfaces/interfaces/IB_result.js |    38 -
 .../vf2js/projects/interfaces/interfaces/IC.as  |    22 -
 .../projects/interfaces/interfaces/IC_result.js |    41 -
 .../vf2js/projects/interfaces/interfaces/ID.as  |    22 -
 .../projects/interfaces/interfaces/ID_result.js |    38 -
 .../vf2js/projects/interfaces/interfaces/IE.as  |    26 -
 .../projects/interfaces/interfaces/IE_result.js |    53 -
 .../vf2js/projects/sdk/SomeSDKClass.as          |    68 -
 .../vf2js/projects/sdk/SomeSDKClass_result.js   |   114 -
 .../vf2js/projects/sdk/bases/HelperBaseClass.as |    33 -
 .../sdk/bases/HelperBaseClass_result.js         |    46 -
 .../simpleMXML/src/SimpleMXML_Project.mxml      |    37 -
 .../simpleMXML/src/SimpleMXML_Project_result.js |    68 -
 .../simpleMXML/src/example/Component.as         |    31 -
 .../simpleMXML/src/example/Component_result.js  |    45 -
 .../test-files/vf2js/projects/super/Base.as     |    65 -
 .../vf2js/projects/super/Base_result.js         |   120 -
 .../test-files/vf2js/projects/super/Super.as    |    54 -
 .../vf2js/projects/super/Super_result.js        |    89 -
 compiler.jx/.classpath                          |    13 -
 compiler.jx/.gitignore                          |     4 -
 compiler.jx/.project                            |    17 -
 compiler.jx/README                              |    62 -
 compiler.jx/bin/asjsc                           |    70 -
 compiler.jx/bin/asjsc.bat                       |    29 -
 compiler.jx/bin/compc                           |    70 -
 compiler.jx/bin/compc.bat                       |    29 -
 compiler.jx/bin/mxmlc                           |    70 -
 compiler.jx/bin/mxmlc.bat                       |    29 -
 compiler.jx/build.xml                           |   180 -
 compiler.jx/downloads.xml                       |   435 -
 compiler.jx/local-template.properties           |    21 -
 .../org.apache.flex.tools.FlexToolGroup         |     2 -
 .../jscomp/FlexJSDiagnosticGroups.java          |    58 -
 .../javascript/jscomp/JXCompilerOptions.java    |    34 -
 .../compiler/asdoc/flexjs/ASDocComment.java     |   107 -
 .../apache/flex/compiler/clients/COMPJSC.java   |   430 -
 .../apache/flex/compiler/clients/EXTERNC.java   |   216 -
 .../compiler/clients/ExternCConfiguration.java  |   357 -
 .../flex/compiler/clients/FlexJSToolGroup.java  |    37 -
 .../compiler/clients/JSCompilerEntryPoint.java  |    29 -
 .../flex/compiler/clients/JSConfiguration.java  |    83 -
 .../apache/flex/compiler/clients/MXMLJSC.java   |   847 -
 .../flex/compiler/clients/VF2JSToolGroup.java   |    35 -
 .../codegen/IASGlobalFunctionConstants.java     |    92 -
 .../flex/compiler/codegen/IDocEmitter.java      |    36 -
 .../apache/flex/compiler/codegen/IEmitter.java  |   113 -
 .../flex/compiler/codegen/IEmitterTokens.java   |    24 -
 .../compiler/codegen/ISourceMapEmitter.java     |    30 -
 .../flex/compiler/codegen/ISubEmitter.java      |    45 -
 .../flex/compiler/codegen/as/IASEmitter.java    |   369 -
 .../flex/compiler/codegen/as/IASWriter.java     |    51 -
 .../flex/compiler/codegen/js/IJSDocEmitter.java |    33 -
 .../flex/compiler/codegen/js/IJSEmitter.java    |    85 -
 .../flex/compiler/codegen/js/IJSPublisher.java  |    41 -
 .../flex/compiler/codegen/js/IJSWriter.java     |    43 -
 .../codegen/js/amd/IJSAMDDocEmitter.java        |    40 -
 .../compiler/codegen/js/amd/IJSAMDEmitter.java  |    33 -
 .../codegen/js/flexjs/IJSFlexJSEmitter.java     |    30 -
 .../codegen/js/goog/IJSGoogDocEmitter.java      |   140 -
 .../codegen/js/goog/IJSGoogEmitter.java         |    33 -
 .../codegen/js/vf2js/IJSVF2JSEmitter.java       |    30 -
 .../compiler/codegen/mxml/IMXMLEmitter.java     |   140 -
 .../codegen/mxml/flexjs/IMXMLFlexJSEmitter.java |    39 -
 .../flex/compiler/driver/IApplication.java      |    31 -
 .../apache/flex/compiler/driver/IBackend.java   |   124 -
 .../apache/flex/compiler/driver/IPublisher.java |    25 -
 .../flex/compiler/driver/js/IJSApplication.java |    33 -
 .../flex/compiler/driver/js/IJSBackend.java     |    29 -
 .../flex/compiler/internal/codegen/Emitter.java |   235 -
 .../codegen/as/ASAfterNodeStrategy.java         |    77 -
 .../codegen/as/ASBeforeNodeStrategy.java        |    74 -
 .../internal/codegen/as/ASBlockWalker.java      |   660 -
 .../compiler/internal/codegen/as/ASEmitter.java |  1540 -
 .../internal/codegen/as/ASEmitterTokens.java    |   203 -
 .../internal/codegen/as/ASFilterWriter.java     |    42 -
 .../compiler/internal/codegen/as/ASWriter.java  |    97 -
 .../externals/emit/ReferenceEmitter.java        |   166 -
 .../externals/pass/AbstractCompilerPass.java    |    71 -
 .../codegen/externals/pass/AddMemberPass.java   |   150 -
 .../externals/pass/CollectImportsPass.java      |   188 -
 .../externals/pass/CollectTypesPass.java        |   165 -
 .../externals/pass/NamespaceResolutionPass.java |   120 -
 .../externals/pass/ReferenceCompiler.java       |   135 -
 .../externals/pass/ResolvePackagesPass.java     |   100 -
 .../externals/reference/BaseReference.java      |   297 -
 .../externals/reference/ClassReference.java     |   890 -
 .../externals/reference/ConstantReference.java  |   101 -
 .../externals/reference/FieldReference.java     |   264 -
 .../externals/reference/FunctionReference.java  |   186 -
 .../externals/reference/MemberReference.java    |    51 -
 .../externals/reference/MethodReference.java    |   316 -
 .../reference/NullConstructorReference.java     |    43 -
 .../externals/reference/ParameterReference.java |    53 -
 .../externals/reference/ReferenceModel.java     |   357 -
 .../codegen/externals/utils/DebugLogUtils.java  |    52 -
 .../codegen/externals/utils/FunctionUtils.java  |   232 -
 .../codegen/externals/utils/JSTypeUtils.java    |   169 -
 .../internal/codegen/js/JSDocEmitter.java       |   174 -
 .../internal/codegen/js/JSDocEmitterTokens.java |    38 -
 .../compiler/internal/codegen/js/JSEmitter.java |   453 -
 .../internal/codegen/js/JSEmitterTokens.java    |    47 -
 .../internal/codegen/js/JSFilterWriter.java     |    43 -
 .../internal/codegen/js/JSPublisher.java        |    85 -
 .../internal/codegen/js/JSSessionModel.java     |   180 -
 .../internal/codegen/js/JSSharedData.java       |   116 -
 .../internal/codegen/js/JSSourceMapEmitter.java |    67 -
 .../internal/codegen/js/JSSubEmitter.java       |   126 -
 .../compiler/internal/codegen/js/JSWriter.java  |   166 -
 .../internal/codegen/js/amd/ExportWriter.java   |   230 -
 .../codegen/js/amd/JSAMDDocEmitter.java         |    37 -
 .../internal/codegen/js/amd/JSAMDEmitter.java   |   971 -
 .../codegen/js/amd/JSAMDEmitterTokens.java      |    38 -
 .../internal/codegen/js/amd/TempTools.java      |   451 -
 .../codegen/js/flexjs/JSFlexJSDocEmitter.java   |   391 -
 .../codegen/js/flexjs/JSFlexJSEmitter.java      |  1009 -
 .../js/flexjs/JSFlexJSEmitterTokens.java        |    64 -
 .../codegen/js/flexjs/Notes_JSFlexJSEmitter.txt |   367 -
 .../codegen/js/goog/JSGoogDocEmitter.java       |   531 -
 .../codegen/js/goog/JSGoogDocEmitterTokens.java |    38 -
 .../internal/codegen/js/goog/JSGoogEmitter.java |  1120 -
 .../codegen/js/goog/JSGoogEmitterTokens.java    |    52 -
 .../codegen/js/goog/JSGoogPublisher.java        |   360 -
 .../internal/codegen/js/jsc/JSCJSEmitter.java   |    39 -
 .../internal/codegen/js/jsc/JSCPublisher.java   |    53 -
 .../internal/codegen/js/jx/AccessorEmitter.java |   420 -
 .../internal/codegen/js/jx/AsIsEmitter.java     |   197 -
 .../codegen/js/jx/BinaryOperatorEmitter.java    |   504 -
 .../internal/codegen/js/jx/BindableEmitter.java |   129 -
 .../internal/codegen/js/jx/ClassEmitter.java    |   182 -
 .../js/jx/DefinePropertyFunctionEmitter.java    |   120 -
 .../codegen/js/jx/DoWhileLoopEmitter.java       |    71 -
 .../codegen/js/jx/DynamicAccessEmitter.java     |    54 -
 .../internal/codegen/js/jx/FieldEmitter.java    |   131 -
 .../internal/codegen/js/jx/ForEachEmitter.java  |   157 -
 .../internal/codegen/js/jx/ForLoopEmitter.java  |    99 -
 .../js/jx/FunctionCallArgumentsEmitter.java     |    64 -
 .../codegen/js/jx/FunctionCallEmitter.java      |   200 -
 .../codegen/js/jx/IdentifierEmitter.java        |   257 -
 .../internal/codegen/js/jx/IfEmitter.java       |   117 -
 .../codegen/js/jx/InterfaceEmitter.java         |   131 -
 .../codegen/js/jx/IterationFlowEmitter.java     |    54 -
 .../js/jx/LanguageIdentifierEmitter.java        |    44 -
 .../codegen/js/jx/LiteralContainerEmitter.java  |    96 -
 .../internal/codegen/js/jx/LiteralEmitter.java  |   134 -
 .../codegen/js/jx/MemberAccessEmitter.java      |   323 -
 .../codegen/js/jx/MemberKeywordEmitter.java     |    70 -
 .../internal/codegen/js/jx/MethodEmitter.java   |   145 -
 .../codegen/js/jx/NumericLiteralEmitter.java    |    43 -
 .../js/jx/ObjectDefinePropertyEmitter.java      |   166 -
 .../js/jx/ObjectLiteralValuePairEmitter.java    |    53 -
 .../codegen/js/jx/PackageFooterEmitter.java     |   640 -
 .../codegen/js/jx/PackageHeaderEmitter.java     |   290 -
 .../codegen/js/jx/ParameterEmitter.java         |    61 -
 .../codegen/js/jx/ParametersEmitter.java        |    64 -
 .../internal/codegen/js/jx/ReturnEmitter.java   |    57 -
 .../codegen/js/jx/SelfReferenceEmitter.java     |    52 -
 .../js/jx/SourceMapDirectiveEmitter.java        |    60 -
 .../codegen/js/jx/StatementEmitter.java         |    55 -
 .../codegen/js/jx/SuperCallEmitter.java         |   268 -
 .../codegen/js/jx/TernaryOperatorEmitter.java   |    67 -
 .../codegen/js/jx/UnaryOperatorEmitter.java     |   122 -
 .../codegen/js/jx/VarDeclarationEmitter.java    |   123 -
 .../codegen/js/jx/WhileLoopEmitter.java         |    61 -
 .../internal/codegen/js/node/NodePublisher.java |    63 -
 .../codegen/js/utils/DocEmitterUtils.java       |    49 -
 .../internal/codegen/js/utils/EmitterUtils.java |   513 -
 .../codegen/js/vf2js/JSVF2JSDocEmitter.java     |   270 -
 .../codegen/js/vf2js/JSVF2JSEmitter.java        |  1950 --
 .../internal/codegen/mxml/MXMLBlockWalker.java  |   436 -
 .../internal/codegen/mxml/MXMLEmitter.java      |   425 -
 .../codegen/mxml/MXMLEmitterTokens.java         |    42 -
 .../internal/codegen/mxml/MXMLWriter.java       |    84 -
 .../mxml/flexjs/MXMLDescriptorSpecifier.java    |   317 -
 .../codegen/mxml/flexjs/MXMLEventSpecifier.java |    99 -
 .../mxml/flexjs/MXMLFlexJSBlockWalker.java      |    83 -
 .../codegen/mxml/flexjs/MXMLFlexJSEmitter.java  |  2320 --
 .../mxml/flexjs/MXMLFlexJSEmitterTokens.java    |    42 -
 .../mxml/flexjs/MXMLFlexJSPublisher.java        |   656 -
 .../codegen/mxml/flexjs/MXMLNodeSpecifier.java  |   170 -
 .../mxml/flexjs/MXMLScriptSpecifier.java        |    67 -
 .../codegen/mxml/jsc/MXMLJSCJSEmitter.java      |    46 -
 .../vf2js/MXMLVF2JSDescriptorSpecifier.java     |   337 -
 .../codegen/mxml/vf2js/MXMLVF2JSEmitter.java    |  1589 -
 .../codegen/mxml/vf2js/MXMLVF2JSPublisher.java  |   600 -
 .../compiler/internal/driver/as/ASBackend.java  |   159 -
 .../internal/driver/js/JSApplication.java       |    32 -
 .../compiler/internal/driver/js/JSBackend.java  |   171 -
 .../internal/driver/js/JSCompilationUnit.java   |   217 -
 .../internal/driver/js/JSSourceFileHandler.java |    83 -
 .../internal/driver/js/amd/AMDBackend.java      |    53 -
 .../driver/js/flexjs/FlexJSBackend.java         |    53 -
 .../js/flexjs/JSCSSCompilationSession.java      |   414 -
 .../internal/driver/js/goog/GoogBackend.java    |    73 -
 .../driver/js/goog/JSGoogConfiguration.java     |   311 -
 .../internal/driver/js/jsc/JSCBackend.java      |    47 -
 .../internal/driver/js/node/NodeBackend.java    |    47 -
 .../driver/js/vf2js/JSVF2JSConfiguration.java   |    86 -
 .../internal/driver/js/vf2js/VF2JSBackend.java  |    55 -
 .../internal/driver/mxml/MXMLBackend.java       |    80 -
 .../driver/mxml/MXMLSourceFileHandler.java      |    85 -
 .../driver/mxml/flexjs/MXMLFlexJSBackend.java   |   131 -
 .../mxml/flexjs/MXMLFlexJSSWCBackend.java       |   121 -
 .../driver/mxml/jsc/MXMLJSCJSBackend.java       |   121 -
 .../driver/mxml/jsc/MXMLJSCJSSWCBackend.java    |   121 -
 .../driver/mxml/vf2js/MXMLVF2JSBackend.java     |   132 -
 .../driver/mxml/vf2js/MXMLVF2JSSWCBackend.java  |   121 -
 .../compiler/internal/graph/GoogDepsWriter.java |   682 -
 .../internal/graph/VF2JSDepsWriter.java         |   406 -
 .../parsing/as/FlexJSASDocDelegate.java         |   143 -
 .../internal/projects/FlexJSProject.java        |   267 -
 .../internal/targets/FlexJSSWCTarget.java       |   303 -
 .../compiler/internal/targets/FlexJSTarget.java |   295 -
 .../compiler/internal/targets/JSTarget.java     |   231 -
 .../internal/visitor/as/ASNodeHandler.java      |    87 -
 .../internal/visitor/as/ASNodeSwitch.java       |   386 -
 .../visitor/as/BeforeAfterStrategy.java         |   141 -
 .../internal/visitor/mxml/MXMLNodeSwitch.java   |   187 -
 .../UnsupportedLanguageFeatureProblem.java      |    37 -
 .../apache/flex/compiler/targets/IJSTarget.java |    52 -
 .../apache/flex/compiler/utils/ASNodeUtils.java |    93 -
 .../flex/compiler/utils/DefinitionUtils.java    |    37 -
 .../compiler/utils/JSClosureCompilerUtil.java   |    98 -
 .../utils/JSClosureCompilerWrapper.java         |   305 -
 .../apache/flex/compiler/utils/NativeUtils.java |   161 -
 .../utils/VF2JSClosureCompilerWrapper.java      |   224 -
 .../flex/compiler/utils/VF2JSProjectUtils.java  |   132 -
 .../flex/compiler/visitor/IASNodeStrategy.java  |    38 -
 .../flex/compiler/visitor/IBlockVisitor.java    |    28 -
 .../flex/compiler/visitor/IBlockWalker.java     |    47 -
 .../compiler/visitor/as/IASBlockVisitor.java    |   229 -
 .../compiler/visitor/as/IASBlockWalker.java     |    43 -
 .../visitor/mxml/IMXMLBlockVisitor.java         |   138 -
 .../compiler/visitor/mxml/IMXMLBlockWalker.java |    43 -
 compiler.tests/.classpath                       |    14 -
 compiler.tests/.gitignore                       |     6 -
 compiler.tests/.project                         |    18 -
 compiler.tests/Hello.as                         |    32 -
 compiler.tests/build.xml                        |   279 -
 compiler.tests/downloads.xml                    |   148 -
 .../feature-tests/as/ASFeatureTestsBase.java    |   228 -
 .../feature-tests/as/ASKeywordTests.java        |   347 -
 .../feature-tests/as/ASNamespaceTests.java      |    93 -
 .../feature-tests/as/ASVariableTests.java       |   131 -
 .../mxml/tags/MXMLArrayTagTests.java            |   176 -
 .../mxml/tags/MXMLBooleanTagTests.java          |    47 -
 .../mxml/tags/MXMLClassTagTests.java            |    45 -
 .../mxml/tags/MXMLComponentTagTests.java        |    74 -
 .../mxml/tags/MXMLDefinitionTagTests.java       |    93 -
 .../mxml/tags/MXMLFeatureTestsBase.java         |   183 -
 .../mxml/tags/MXMLHTTPServiceTagTests.java      |    76 -
 .../mxml/tags/MXMLInstanceTagTests.java         |    45 -
 .../mxml/tags/MXMLInstanceTagTestsBase.java     |    82 -
 .../mxml/tags/MXMLIntTagTests.java              |    49 -
 .../mxml/tags/MXMLMetadataTagTests.java         |   141 -
 .../mxml/tags/MXMLModelTagTests.java            |   161 -
 .../mxml/tags/MXMLNumberTagTests.java           |    45 -
 .../mxml/tags/MXMLObjectTagTests.java           |   293 -
 .../mxml/tags/MXMLRemoteObjectTagTests.java     |    73 -
 .../mxml/tags/MXMLStringTagTests.java           |    45 -
 .../mxml/tags/MXMLUintTagTests.java             |    47 -
 .../mxml/tags/MXMLVectorTagTests.java           |   210 -
 .../mxml/tags/MXMLWebServiceTagTests.java       |    74 -
 .../mxml/tags/MXMLXMLListTagTests.java          |   156 -
 .../mxml/tags/MXMLXMLTagTests.java              |   182 -
 .../properties/MXMLPropertyBooleanTests.java    |   100 -
 .../properties/MXMLPropertyClassTests.java      |   100 -
 .../properties/MXMLPropertyIntTests.java        |   100 -
 .../properties/MXMLPropertyNumberTests.java     |   100 -
 .../properties/MXMLPropertyStringTests.java     |   100 -
 .../properties/MXMLPropertyTestsBase.java       |    91 -
 .../properties/MXMLPropertyUintTests.java       |   100 -
 .../functional-tests/f/SDKSWCTests.java         |   392 -
 .../org/apache/flex/utils/AntTestAdapter.java   |   115 -
 .../org/apache/flex/utils/EnvProperties.java    |   149 -
 .../src/org/apache/flex/utils/ITestAdapter.java |    50 -
 .../org/apache/flex/utils/MavenTestAdapter.java |   208 -
 .../apache/flex/utils/TestAdapterFactory.java   |    41 -
 compiler.tests/template-unittest.properties     |    46 -
 .../css/CSSArrayPropertyValueTests.java         |    92 -
 .../compiler/internal/css/CSSBaseTests.java     |    96 -
 .../css/CSSColorPropertyValueTests.java         |   127 -
 .../internal/css/CSSCombinatorTests.java        |   107 -
 .../compiler/internal/css/CSSDocumentTests.java |   190 -
 .../compiler/internal/css/CSSFontFaceTests.java |   213 -
 .../css/CSSFunctionCallPropertyValueTests.java  |    99 -
 .../css/CSSKeywordPropertyValueTests.java       |    70 -
 .../css/CSSMediaQueryConditionTests.java        |   120 -
 .../css/CSSNamespaceDefinitionTests.java        |   134 -
 .../css/CSSNumberPropertyValueTests.java        |   175 -
 .../compiler/internal/css/CSSPropertyTests.java |    95 -
 .../internal/css/CSSPropertyValueTests.java     |    68 -
 .../css/CSSRgbColorPropertyValueTests.java      |   108 -
 .../compiler/internal/css/CSSRuleTests.java     |   219 -
 .../internal/css/CSSSelectorConditionTests.java |   133 -
 .../compiler/internal/css/CSSSelectorTests.java |   203 -
 .../css/CSSStringPropertyValueTests.java        |    83 -
 .../compiler/internal/mxml/MXMLDataTests.java   |    96 -
 .../internal/mxml/MXMLInstructionDataTests.java |   108 -
 .../internal/mxml/MXMLTextDataTests.java        |   226 -
 .../internal/mxml/MXMLUnitDataTests.java        |    54 -
 .../parsing/mxml/MXMLTokenizerTests.java        |   823 -
 .../internal/tree/mxml/MXMLArrayNodeTests.java  |   138 -
 .../tree/mxml/MXMLBindingNodeTests.java         |   191 -
 .../tree/mxml/MXMLBooleanNodeTests.java         |   268 -
 .../internal/tree/mxml/MXMLClassNodeTests.java  |   110 -
 .../tree/mxml/MXMLClassReferenceNodeTests.java  |    32 -
 .../tree/mxml/MXMLComponentNodeTests.java       |   160 -
 .../tree/mxml/MXMLDeclarationsNodeTests.java    |   102 -
 .../tree/mxml/MXMLDefinitionNodeTests.java      |   154 -
 .../tree/mxml/MXMLDesignLayerNodeTests.java     |   117 -
 .../tree/mxml/MXMLEventSpecifierNodeTests.java  |   201 -
 .../tree/mxml/MXMLExpressionNodeBaseTests.java  |    44 -
 .../tree/mxml/MXMLFunctionNodeTests.java        |   124 -
 .../tree/mxml/MXMLHTTPServiceNodeTests.java     |    69 -
 .../tree/mxml/MXMLImplementsNodeTests.java      |   106 -
 .../tree/mxml/MXMLInstanceNodeTests.java        |    64 -
 .../internal/tree/mxml/MXMLIntNodeTests.java    |   266 -
 .../tree/mxml/MXMLLibraryNodeTests.java         |   108 -
 .../tree/mxml/MXMLMetadataNodeTests.java        |    97 -
 .../internal/tree/mxml/MXMLModelNodeTests.java  |   141 -
 .../internal/tree/mxml/MXMLNodeBaseTests.java   |   209 -
 .../internal/tree/mxml/MXMLNumberNodeTests.java |   203 -
 .../internal/tree/mxml/MXMLObjectNodeTests.java |   156 -
 .../tree/mxml/MXMLPrivateNodeTests.java         |   104 -
 .../MXMLPropertySpecifierNodeBooleanTests.java  |    84 -
 .../MXMLPropertySpecifierNodeClassTests.java    |   118 -
 .../mxml/MXMLPropertySpecifierNodeIntTests.java |    84 -
 .../MXMLPropertySpecifierNodeNumberTests.java   |   363 -
 .../MXMLPropertySpecifierNodeStringTests.java   |    84 -
 .../mxml/MXMLPropertySpecifierNodeTests.java    |    86 -
 .../MXMLPropertySpecifierNodeUintTests.java     |    84 -
 .../internal/tree/mxml/MXMLRegExpNodeTests.java |    95 -
 .../tree/mxml/MXMLRemoteObjectNodeTests.java    |    70 -
 .../tree/mxml/MXMLResourceNodeTests.java        |   127 -
 .../internal/tree/mxml/MXMLScriptNodeTests.java |    94 -
 .../tree/mxml/MXMLSpecifierNodeBaseTests.java   |    33 -
 .../internal/tree/mxml/MXMLStateNodeTests.java  |    79 -
 .../internal/tree/mxml/MXMLStringNodeTests.java |   169 -
 .../internal/tree/mxml/MXMLStyleNodeTests.java  |   133 -
 .../internal/tree/mxml/MXMLUintNodeTests.java   |   206 -
 .../internal/tree/mxml/MXMLVectorNodeTests.java |   203 -
 .../tree/mxml/MXMLWebServiceNodeTests.java      |    69 -
 .../tree/mxml/MXMLXMLListNodeTests.java         |   108 -
 .../internal/tree/mxml/MXMLXMLNodeTests.java    |   148 -
 compiler/.classpath                             |    17 -
 compiler/.project                               |    17 -
 compiler/.settings/org.eclipse.jdt.core.prefs   |   373 -
 compiler/.settings/org.eclipse.jdt.ui.prefs     |     6 -
 compiler/build.xml                              |  1166 -
 compiler/commandline/acompc                     |    29 -
 compiler/commandline/acompc.bat                 |    26 -
 compiler/commandline/amxmlc                     |    29 -
 compiler/commandline/amxmlc.bat                 |    26 -
 compiler/commandline/compc                      |    71 -
 compiler/commandline/compc.bat                  |    32 -
 compiler/commandline/mxmlc                      |    71 -
 compiler/commandline/mxmlc.bat                  |    33 -
 compiler/commandline/optimizer                  |    62 -
 compiler/commandline/optimizer.bat              |    27 -
 compiler/commandline/swcdepends                 |    71 -
 compiler/commandline/swcdepends.bat             |    31 -
 compiler/commandline/swfdump                    |    62 -
 compiler/commandline/swfdump.bat                |    26 -
 ...temManagerFlexModuleFactoryMonkeyPatch.patch |   314 -
 .../projects/support/framework-config.xml       |    32 -
 .../support/multiDefSrc/ResourceModuleBase.as   |    58 -
 .../multiDefSrc/generateCSSStyleDeclarations.as |   165 -
 .../projects/support/src/EmptyModuleFactory.as  |   101 -
 .../projects/support/src/StyleModuleBase.as     |   220 -
 .../support/src/mx/core/FlexModuleFactory.as    |   954 -
 .../projects/support/src/mx/core/Version.as     |    26 -
 .../support/src/mx/managers/SystemManager.as    |  3721 ---
 compiler/dist/runtime/fdb/fdb.jar               |   Bin 601945 -> 0 bytes
 compiler/downloads.xml                          |   479 -
 compiler/flexTasks.tasks                        |    21 -
 .../org.apache.flex.tools.FlexToolGroup         |     1 -
 compiler/src/assembly/scripts/acompc            |    29 +
 compiler/src/assembly/scripts/acompc.bat        |    26 +
 compiler/src/assembly/scripts/amxmlc            |    29 +
 compiler/src/assembly/scripts/amxmlc.bat        |    26 +
 compiler/src/assembly/scripts/compc             |    71 +
 compiler/src/assembly/scripts/compc.bat         |    32 +
 compiler/src/assembly/scripts/mxmlc             |    71 +
 compiler/src/assembly/scripts/mxmlc.bat         |    33 +
 compiler/src/assembly/scripts/optimizer         |    62 +
 compiler/src/assembly/scripts/optimizer.bat     |    27 +
 compiler/src/assembly/scripts/swcdepends        |    71 +
 compiler/src/assembly/scripts/swcdepends.bat    |    31 +
 compiler/src/assembly/scripts/swfdump           |    62 +
 compiler/src/assembly/scripts/swfdump.bat       |    26 +
 .../compiler/internal/parsing/as/ASParser.g     |  3223 ++
 .../parsing/as/ImportMetadataTokenTypes.txt     |    68 +
 .../internal/parsing/as/MetadataParser.g        |   397 +
 .../org/apache/flex/compiler/internal/css/CSS.g |   671 +
 .../apache/flex/compiler/internal/css/CSSTree.g |   442 +
 .../java/org/apache/flex/abc/ABCConstants.java  |   643 +
 .../java/org/apache/flex/abc/ABCEmitter.java    |  2063 ++
 .../java/org/apache/flex/abc/ABCLinker.java     |   779 +
 .../java/org/apache/flex/abc/ABCParser.java     |  1280 +
 .../java/org/apache/flex/abc/ABCReader.java     |    84 +
 .../apache/flex/abc/ClassDependencySort.java    |   173 +
 .../org/apache/flex/abc/EntryOrderedStore.java  |    82 +
 .../src/main/java/org/apache/flex/abc/Pool.java |   172 +
 .../org/apache/flex/abc/PoolingABCVisitor.java  |   635 +
 .../diagnostics/AbstractDiagnosticVisitor.java  |    71 +
 .../abc/diagnostics/DiagnosticsAggregator.java  |   219 +
 .../apache/flex/abc/diagnostics/package.html    |    34 +
 .../org/apache/flex/abc/graph/IBasicBlock.java  |    64 +
 .../org/apache/flex/abc/graph/IFlowgraph.java   |   145 +
 .../algorithms/DepthFirstPreorderIterator.java  |   145 +
 .../abc/graph/algorithms/DominatorTree.java     |   413 +
 .../flex/abc/graph/algorithms/package.html      |    28 +
 .../java/org/apache/flex/abc/graph/package.html |    33 +
 .../abc/instructionlist/InstructionList.java    |  1251 +
 .../flex/abc/instructionlist/package.html       |    27 +
 .../flex/abc/models/FrameModelEncoder.java      |   652 +
 .../flex/abc/models/FrameModelVisitor.java      |   196 +
 .../flex/abc/models/TreeModelEncoder.java       |  1101 +
 .../flex/abc/models/TreeModelVisitor.java       |   149 +
 .../org/apache/flex/abc/models/package.html     |    29 +
 .../flex/abc/optimize/DeadCodeFilter.java       |   156 +
 .../PeepholeOptimizerMethodBodyVisitor.java     |  1520 +
 .../org/apache/flex/abc/optimize/package.html   |    36 +
 .../main/java/org/apache/flex/abc/package.html  |    41 +
 .../apache/flex/abc/print/ABCDumpVisitor.java   |  1095 +
 .../java/org/apache/flex/abc/print/package.html |    27 +
 .../semantics/ArbitraryOperandsInstruction.java |   118 +
 .../org/apache/flex/abc/semantics/Block.java    |   140 +
 .../apache/flex/abc/semantics/ClassInfo.java    |    39 +
 .../flex/abc/semantics/ControlFlowGraph.java    |   580 +
 .../apache/flex/abc/semantics/ECMASupport.java  |   895 +
 .../flex/abc/semantics/ExceptionInfo.java       |   139 +
 .../flex/abc/semantics/FrameCountVisitor.java   |   534 +
 .../semantics/ImmediateOperandInstruction.java  |   112 +
 .../apache/flex/abc/semantics/InstanceInfo.java |    85 +
 .../apache/flex/abc/semantics/Instruction.java  |   313 +
 .../flex/abc/semantics/InstructionFactory.java  |   351 +
 .../org/apache/flex/abc/semantics/Label.java    |   167 +
 .../org/apache/flex/abc/semantics/Metadata.java |   159 +
 .../flex/abc/semantics/MethodBodyInfo.java      |   394 +
 .../apache/flex/abc/semantics/MethodInfo.java   |   210 +
 .../org/apache/flex/abc/semantics/Name.java     |   571 +
 .../apache/flex/abc/semantics/Namespace.java    |   246 +
 .../abc/semantics/NoOperandsInstruction.java    |    36 +
 .../org/apache/flex/abc/semantics/Nsset.java    |   167 +
 .../abc/semantics/OneOperandInstruction.java    |   105 +
 .../apache/flex/abc/semantics/PooledValue.java  |   176 +
 .../apache/flex/abc/semantics/ScriptInfo.java   |    77 +
 .../org/apache/flex/abc/semantics/Trait.java    |   337 +
 .../org/apache/flex/abc/semantics/Traits.java   |   107 +
 .../org/apache/flex/abc/semantics/package.html  |    27 +
 .../flex/abc/visitors/DelegatingABCVisitor.java |   125 +
 .../abc/visitors/DelegatingClassVisitor.java    |    60 +
 .../abc/visitors/DelegatingMetadataVisitor.java |    42 +
 .../visitors/DelegatingMethodBodyVisitor.java   |   110 +
 .../abc/visitors/DelegatingMethodVisitor.java   |    54 +
 .../abc/visitors/DelegatingScriptVisitor.java   |    60 +
 .../abc/visitors/DelegatingTraitVisitor.java    |    59 +
 .../abc/visitors/DelegatingTraitsVisitor.java   |    75 +
 .../apache/flex/abc/visitors/IABCVisitor.java   |   132 +
 .../apache/flex/abc/visitors/IClassVisitor.java |    49 +
 .../flex/abc/visitors/IDiagnosticsVisitor.java  |   118 +
 .../flex/abc/visitors/IFlowGraphVisitor.java    |    53 +
 .../flex/abc/visitors/IMetadataVisitor.java     |    37 +
 .../flex/abc/visitors/IMethodBodyVisitor.java   |   118 +
 .../flex/abc/visitors/IMethodVisitor.java       |    42 +
 .../flex/abc/visitors/IScriptVisitor.java       |    48 +
 .../apache/flex/abc/visitors/ITraitVisitor.java |    51 +
 .../flex/abc/visitors/ITraitsVisitor.java       |    73 +
 .../org/apache/flex/abc/visitors/IVisitor.java  |    37 +
 .../apache/flex/abc/visitors/NilABCVisitor.java |   102 +
 .../flex/abc/visitors/NilClassVisitor.java      |    48 +
 .../abc/visitors/NilDiagnosticsVisitor.java     |    32 +
 .../flex/abc/visitors/NilMetadataVisitor.java   |    33 +
 .../flex/abc/visitors/NilMethodBodyVisitor.java |    97 +
 .../flex/abc/visitors/NilMethodVisitor.java     |    44 +
 .../flex/abc/visitors/NilScriptVisitor.java     |    49 +
 .../flex/abc/visitors/NilTraitVisitor.java      |    47 +
 .../flex/abc/visitors/NilTraitsVisitor.java     |    65 +
 .../apache/flex/abc/visitors/NilVisitors.java   |    74 +
 .../org/apache/flex/abc/visitors/package.html   |    33 +
 .../java/org/apache/flex/compiler/Messages.java |   104 +
 .../org/apache/flex/compiler/ant/COMPCTask.java |   512 +
 .../org/apache/flex/compiler/ant/FlexTask.java  |   418 +
 .../org/apache/flex/compiler/ant/MXMLCTask.java |   493 +
 .../compiler/ant/config/BaseConfigVariable.java |    74 +
 .../compiler/ant/config/ConfigAppendString.java |    48 +
 .../flex/compiler/ant/config/ConfigBoolean.java |    75 +
 .../flex/compiler/ant/config/ConfigInt.java     |    84 +
 .../flex/compiler/ant/config/ConfigString.java  |    70 +
 .../compiler/ant/config/ConfigVariable.java     |    54 +
 .../flex/compiler/ant/config/IOptionSource.java |    33 +
 .../ant/config/NestedAttributeElement.java      |   170 +
 .../flex/compiler/ant/config/OptionSpec.java    |    76 +
 .../ant/config/RepeatableConfigString.java      |    66 +
 .../ant/config/RepeatableConfigVariable.java    |    55 +
 .../flex/compiler/ant/config/package.html       |    27 +
 .../org/apache/flex/compiler/ant/package.html   |    32 +
 .../compiler/ant/types/DefaultScriptLimits.java |    79 +
 .../flex/compiler/ant/types/DefaultSize.java    |    71 +
 .../flex/compiler/ant/types/FlexFileSet.java    |   116 +
 .../flex/compiler/ant/types/FlexSWCFileSet.java |    55 +
 .../apache/flex/compiler/ant/types/Fonts.java   |   151 +
 .../flex/compiler/ant/types/Metadata.java       |   168 +
 .../ant/types/RuntimeSharedLibraryPath.java     |    92 +
 .../flex/compiler/ant/types/URLElement.java     |    64 +
 .../apache/flex/compiler/ant/types/package.html |    27 +
 .../flex/compiler/asdoc/ASDocComment.java       |   250 +
 .../compiler/asdoc/IASDocBundleDelegate.java    |    60 +
 .../flex/compiler/asdoc/IASDocComment.java      |    50 +
 .../flex/compiler/asdoc/IASDocDelegate.java     |    64 +
 .../apache/flex/compiler/asdoc/IASDocTag.java   |    29 +
 .../compiler/asdoc/IASParserASDocDelegate.java  |    90 +
 .../asdoc/IMetadataParserASDocDelegate.java     |    69 +
 .../flex/compiler/asdoc/IPackageDITAParser.java |    52 +
 .../org/apache/flex/compiler/asdoc/package.html |    35 +
 .../org/apache/flex/compiler/clients/ASC.java   |  2254 ++
 .../org/apache/flex/compiler/clients/ASDOC.java |   242 +
 .../org/apache/flex/compiler/clients/COMPC.java |   236 +
 .../flex/compiler/clients/FalconToolGroup.java  |    36 +
 .../org/apache/flex/compiler/clients/MXMLC.java |  1171 +
 .../apache/flex/compiler/clients/Optimizer.java |   512 +
 .../apache/flex/compiler/clients/package.html   |    33 +
 .../clients/problems/CodeGenErrorFilter.java    |    61 +
 .../problems/CompilerProblemCategorizer.java    |   187 +
 .../clients/problems/IProblemFilter.java        |    40 +
 .../problems/ProblemFilterClassCriteria.java    |   113 +
 .../clients/problems/ProblemFormatter.java      |   142 +
 .../clients/problems/ProblemPrinter.java        |    98 +
 .../compiler/clients/problems/ProblemQuery.java |   485 +
 .../clients/problems/ProblemQueryProvider.java  |    24 +
 .../clients/problems/ProblemSettingsFilter.java |   230 +
 .../problems/WorkspaceProblemFormatter.java     |   368 +
 .../flex/compiler/clients/problems/package.html |    27 +
 .../flex/compiler/common/ASImportTarget.java    |   180 +
 .../apache/flex/compiler/common/ASModifier.java |   115 +
 .../flex/compiler/common/DependencyType.java    |   163 +
 .../flex/compiler/common/DependencyTypeSet.java |   261 +
 .../flex/compiler/common/IDecoration.java       |    41 +
 .../compiler/common/IDefinitionPriority.java    |    29 +
 .../flex/compiler/common/IEmbedResolver.java    |    49 +
 .../common/IFileSpecificationGetter.java        |    52 +
 .../flex/compiler/common/IImportTarget.java     |    78 +
 .../apache/flex/compiler/common/IMetaInfo.java  |    56 +
 .../flex/compiler/common/IPathResolver.java     |    41 +
 .../flex/compiler/common/ISourceLocation.java   |    75 +
 .../flex/compiler/common/LibraryPathUtils.java  |    50 +
 .../flex/compiler/common/ModifiersSet.java      |   126 +
 .../apache/flex/compiler/common/Multiname.java  |   204 +
 .../flex/compiler/common/MutablePrefixMap.java  |   162 +
 .../flex/compiler/common/NodeReference.java     |   242 +
 .../apache/flex/compiler/common/PrefixMap.java  |   212 +
 .../flex/compiler/common/PrefixedXMLName.java   |   185 +
 .../flex/compiler/common/RecursionGuard.java    |    66 +
 .../flex/compiler/common/SourceLocation.java    |   361 +
 .../flex/compiler/common/VersionInfo.java       |   379 +
 .../apache/flex/compiler/common/XMLName.java    |   147 +
 .../apache/flex/compiler/common/package.html    |    27 +
 .../config/ApplicationDomainTarget.java         |    79 +
 .../config/CommandLineConfigurator.java         |   607 +
 .../flex/compiler/config/Configuration.java     |  5911 ++++
 .../compiler/config/ConfigurationBuffer.java    |  1346 +
 .../flex/compiler/config/ConfigurationInfo.java |   473 +
 .../config/ConfigurationPathResolver.java       |    80 +
 .../compiler/config/ConfigurationValue.java     |   109 +
 .../flex/compiler/config/Configurator.java      |  3456 ++
 .../config/ICompilerProblemSettings.java        |   213 +
 .../config/ICompilerSettingsConstants.java      |   152 +
 .../flex/compiler/config/RSLSettings.java       |   233 +
 .../apache/flex/compiler/config/package.html    |    39 +
 .../compiler/constants/IASKeywordConstants.java |   155 +
 .../constants/IASLanguageConstants.java         |   153 +
 .../compiler/constants/IASWarningConstants.java |   212 +
 .../compiler/constants/ICSSCoreConstants.java   |    99 +
 .../compiler/constants/IMXMLCoreConstants.java  |    41 +
 .../constants/IMetaAttributeConstants.java      |   221 +
 .../compiler/constants/INamespaceConstants.java |    58 +
 .../apache/flex/compiler/constants/package.html |    26 +
 .../flex/compiler/css/CombinatorType.java       |    41 +
 .../apache/flex/compiler/css/ConditionType.java |    76 +
 .../flex/compiler/css/FontFaceSourceType.java   |    38 +
 .../flex/compiler/css/ICSSCombinator.java       |    52 +
 .../apache/flex/compiler/css/ICSSDocument.java  |    59 +
 .../apache/flex/compiler/css/ICSSFontFace.java  |    83 +
 .../apache/flex/compiler/css/ICSSManager.java   |   131 +
 .../compiler/css/ICSSMediaQueryCondition.java   |    63 +
 .../compiler/css/ICSSNamespaceDefinition.java   |    59 +
 .../org/apache/flex/compiler/css/ICSSNode.java  |    60 +
 .../apache/flex/compiler/css/ICSSProperty.java  |    36 +
 .../flex/compiler/css/ICSSPropertyValue.java    |    28 +
 .../org/apache/flex/compiler/css/ICSSRule.java  |    84 +
 .../apache/flex/compiler/css/ICSSSelector.java  |    96 +
 .../compiler/css/ICSSSelectorCondition.java     |    48 +
 .../org/apache/flex/compiler/css/package.html   |    65 +
 .../AppliedVectorDefinitionFactory.java         |    38 +
 .../definitions/IAccessorDefinition.java        |    36 +
 .../definitions/IAppliedVectorDefinition.java   |    43 +
 .../IBindableVariableDefinition.java            |    33 +
 .../compiler/definitions/IClassDefinition.java  |   488 +
 .../definitions/IConstantDefinition.java        |    50 +
 .../flex/compiler/definitions/IDefinition.java  |   510 +
 .../definitions/IDocumentableDefinition.java    |    45 +
 .../compiler/definitions/IEffectDefinition.java |    69 +
 .../compiler/definitions/IEventDefinition.java  |    41 +
 .../definitions/IFunctionDefinition.java        |   208 +
 .../compiler/definitions/IGetterDefinition.java |    43 +
 .../definitions/IInterfaceDefinition.java       |   111 +
 .../definitions/IMemberedDefinition.java        |    24 +
 .../definitions/IMetadataDefinition.java        |    58 +
 .../definitions/INamespaceDefinition.java       |   228 +
 .../definitions/IPackageDefinition.java         |    74 +
 .../definitions/IParameterDefinition.java       |    71 +
 .../flex/compiler/definitions/IQualifiers.java  |    58 +
 .../compiler/definitions/IScopedDefinition.java |    33 +
 .../compiler/definitions/ISetterDefinition.java |    44 +
 .../compiler/definitions/IStyleDefinition.java  |   161 +
 .../compiler/definitions/ITypeDefinition.java   |   141 +
 .../definitions/IVariableDefinition.java        |   181 +
 .../definitions/metadata/IDeprecationInfo.java  |    32 +
 .../compiler/definitions/metadata/IMetaTag.java |    60 +
 .../definitions/metadata/IMetaTagAttribute.java |    53 +
 .../compiler/definitions/metadata/package.html  |    26 +
 .../flex/compiler/definitions/package.html      |   174 +
 .../references/INamespaceReference.java         |    63 +
 .../definitions/references/IReference.java      |    89 +
 .../IResolvedQualifiersReference.java           |    88 +
 .../references/ReferenceFactory.java            |   293 +
 .../definitions/references/package.html         |    60 +
 .../compiler/exceptions/BURMAbortException.java |    42 +
 .../exceptions/BuildCanceledException.java      |    28 +
 .../exceptions/CircularDependencyException.java |    63 +
 .../exceptions/CodegenInterruptedException.java |    41 +
 .../exceptions/ConfigurationException.java      |   713 +
 .../exceptions/DuplicateLabelException.java     |    40 +
 .../LibraryCircularDependencyException.java     |    63 +
 .../exceptions/MissingBuiltinException.java     |    52 +
 .../UnknownControlFlowTargetException.java      |    40 +
 .../flex/compiler/exceptions/package.html       |    27 +
 .../filespecs/BaseFileSpecification.java        |   102 +
 .../flex/compiler/filespecs/CombinedFile.java   |   245 +
 .../compiler/filespecs/FileSpecification.java   |   130 +
 .../filespecs/IBinaryFileSpecification.java     |    31 +
 .../compiler/filespecs/IFileSpecification.java  |    58 +
 .../apache/flex/compiler/filespecs/package.html |    33 +
 .../apache/flex/compiler/fxg/FXGConstants.java  |   429 +
 .../apache/flex/compiler/fxg/FXGFileNode.java   |    45 +
 .../flex/compiler/fxg/FXGParserFactory.java     |    44 +
 .../apache/flex/compiler/fxg/FXGVersion.java    |   185 +
 .../apache/flex/compiler/fxg/IFXGParser.java    |    54 +
 .../flex/compiler/fxg/IFXGTranscoder.java       |    66 +
 .../apache/flex/compiler/fxg/dom/IFXGNode.java  |   127 +
 .../flex/compiler/fxg/flex/FXGSymbolClass.java  |   147 +
 .../fxg/flex/FlexFXG2SWFTranscoder.java         |  1306 +
 .../flex/compiler/fxg/flex/FlexGraphicNode.java |    31 +
 .../compiler/fxg/flex/FlexParagraphNode.java    |    58 +
 .../compiler/fxg/flex/FlexRichTextNode.java     |    96 +
 .../flex/compiler/fxg/flex/FlexSpanNode.java    |    58 +
 .../compiler/fxg/flex/FlexTextGraphicNode.java  |   161 +
 .../flex/compiler/fxg/logging/FXGLog.java       |    58 +
 .../compiler/fxg/logging/FXGLoggerFactory.java  |    39 +
 .../flex/compiler/fxg/logging/IFXGLogger.java   |    56 +
 .../org/apache/flex/compiler/fxg/package.html   |    31 +
 .../resources/FXGResourceResolverFactory.java   |    40 +
 .../fxg/resources/IFXGResourceResolver.java     |    41 +
 .../compiler/fxg/swf/FXG2SWFTranscoder.java     |  1663 +
 .../compiler/internal/abc/ABCScopeBuilder.java  |   421 +
 .../internal/abc/ClassGeneratorHelper.java      |   483 +
 .../abc/CollectMetadataTraitVisitor.java        |   153 +
 .../internal/abc/FunctionGeneratorHelper.java   |    58 +
 .../abc/ScopedDefinitionTraitsVisitor.java      |   311 +
 .../internal/abc/ScriptDefinitionBuilder.java   |    72 +
 .../internal/abc/TypeDefinitionBuilder.java     |    80 +
 .../as/codegen/ABCGeneratingReducer.java        |  7137 +++++
 .../internal/as/codegen/ABCGenerator.java       |   761 +
 .../internal/as/codegen/BindableHelper.java     |   583 +
 .../compiler/internal/as/codegen/Binding.java   |   738 +
 .../as/codegen/ClassDirectiveProcessor.java     |  1275 +
 .../as/codegen/CodeGeneratorManager.java        |    48 +
 .../internal/as/codegen/ControlFlowContext.java |   200 +
 .../as/codegen/ControlFlowContextManager.java   |   877 +
 .../internal/as/codegen/DirectiveProcessor.java |   264 +
 .../internal/as/codegen/DumpBURMState.java      |    80 +
 .../as/codegen/ExceptionHandlingContext.java    |   301 +
 .../GenerateFunctionInParallelResult.java       |    77 +
 .../as/codegen/GlobalDirectiveProcessor.java    |   558 +
 .../internal/as/codegen/GlobalLexicalScope.java |   429 +
 .../internal/as/codegen/ICodeGenerator.java     |   245 +
 .../as/codegen/ICodeGeneratorFactory.java       |    32 +
 .../as/codegen/InlineFunctionLexicalScope.java  |   267 +
 .../as/codegen/InstructionListNode.java         |   131 +
 .../as/codegen/InterfaceDirectiveProcessor.java |   506 +
 .../codegen/LabelScopeControlFlowContext.java   |   177 +
 .../LabeledStatementControlFlowContext.java     |    70 +
 .../internal/as/codegen/LexicalScope.java       |  2053 ++
 .../as/codegen/LoopControlFlowContext.java      |   139 +
 .../as/codegen/MXMLClassDirectiveProcessor.java |  6127 ++++
 .../as/codegen/SwitchControlFlowContext.java    |    82 +
 .../internal/as/codegen/UnknownTreeFinding.java |   250 +
 .../internal/as/codegen/UnknownTreeHandler.java |   162 +
 .../internal/as/codegen/WithContext.java        |   108 +
 .../compiler/internal/caches/AssetTagCache.java |   193 +
 .../internal/caches/CSSDocumentCache.java       |   387 +
 .../internal/caches/CacheStoreKeyBase.java      |    55 +
 .../caches/ConcurrentCacheStoreBase.java        |   125 +
 .../internal/caches/FileScopeCache.java         |   131 +
 .../compiler/internal/caches/MXMLDataCache.java |   102 +
 .../caches/PackageNamespaceDefinitionCache.java |    63 +
 .../flex/compiler/internal/caches/SWFCache.java |   269 +
 .../compiler/internal/clients/CLIFactory.java   |   220 +
 .../flex/compiler/internal/clients/package.html |    33 +
 .../codegen/databinding/BindingAnalyzer.java    |    99 +
 .../databinding/BindingCodeGenUtils.java        |   737 +
 .../codegen/databinding/BindingDatabase.java    |   415 +
 .../databinding/BindingDestinationMaker.java    |   206 +
 .../codegen/databinding/BindingInfo.java        |   473 +
 .../databinding/FunctionWatcherInfo.java        |    80 +
 .../databinding/MXMLBindingDirectiveHelper.java |   996 +
 .../databinding/PropertyWatcherInfo.java        |    82 +
 .../databinding/StaticPropertyWatcherInfo.java  |    77 +
 .../codegen/databinding/WatcherAnalyzer.java    |   472 +
 .../codegen/databinding/WatcherInfoBase.java    |   300 +
 .../codegen/databinding/XMLWatcherInfo.java     |    51 +
 .../flex/compiler/internal/common/Counter.java  |   138 +
 .../flex/compiler/internal/common/package.html  |    33 +
 .../internal/config/COMPCConfiguration.java     |    60 +
 .../config/CompilerProblemSettings.java         |   227 +
 .../internal/config/DefaultsConfigurator.java   |   181 +
 .../internal/config/FileConfigurator.java       |   677 +
 .../config/FlashBuilderConfigurator.java        |   503 +
 .../compiler/internal/config/FrameInfo.java     |    61 +
 .../internal/config/ICompilerSettings.java      |   840 +
 .../internal/config/IConfigurationFilter.java   |    37 +
 .../compiler/internal/config/IConfigurator.java |   126 +
 .../config/IWriteOnlyProjectSettings.java       |   144 +
 .../internal/config/LoadExternsParser.java      |   111 +
 .../internal/config/QNameNormalization.java     |    78 +
 .../config/RSLArgumentNameGenerator.java        |    52 +
 .../config/RuntimeSharedLibraryPathInfo.java    |   207 +
 .../config/SystemPropertyConfigurator.java      |    83 +
 .../internal/config/TargetSettings.java         |   582 +
 .../annotations/ArgumentNameGenerator.java      |    58 +
 .../internal/config/annotations/Arguments.java  |    66 +
 .../internal/config/annotations/Config.java     |    88 +
 .../annotations/DefaultArgumentValue.java       |    41 +
 .../config/annotations/DeprecatedConfig.java    |    38 +
 .../internal/config/annotations/FlexOnly.java   |    35 +
 .../config/annotations/InfiniteArguments.java   |    37 +
 .../internal/config/annotations/Mapping.java    |    47 +
 .../config/annotations/SoftPrerequisites.java   |    37 +
 .../config/localization/ILocalizedText.java     |    30 +
 .../config/localization/ILocalizer.java         |    30 +
 .../localization/LocalizationManager.java       |   234 +
 .../localization/ResourceBundleLocalizer.java   |    77 +
 .../internal/config/localization/package.html   |    27 +
 .../flex/compiler/internal/config/package.html  |    33 +
 .../internal/css/CSSArrayPropertyValue.java     |    63 +
 .../internal/css/CSSColorPropertyValue.java     |   264 +
 .../compiler/internal/css/CSSCombinator.java    |    57 +
 .../flex/compiler/internal/css/CSSDocument.java |   180 +
 .../flex/compiler/internal/css/CSSFontFace.java |   193 +
 .../css/CSSFunctionCallPropertyValue.java       |    96 +
 .../compiler/internal/css/CSSKeyFrames.java     |    68 +
 .../internal/css/CSSKeywordPropertyValue.java   |    80 +
 .../flex/compiler/internal/css/CSSManager.java  |   295 +
 .../internal/css/CSSMediaQueryCondition.java    |    86 +
 .../compiler/internal/css/CSSModelTreeType.java |    46 +
 .../internal/css/CSSNamespaceDefinition.java    |    75 +
 .../flex/compiler/internal/css/CSSNodeBase.java |   168 +
 .../internal/css/CSSNumberPropertyValue.java    |    94 +
 .../flex/compiler/internal/css/CSSProperty.java |   157 +
 .../compiler/internal/css/CSSPropertyValue.java |    38 +
 .../internal/css/CSSRgbColorPropertyValue.java  |   113 +
 .../internal/css/CSSRgbaColorPropertyValue.java |   125 +
 .../flex/compiler/internal/css/CSSRule.java     |   130 +
 .../flex/compiler/internal/css/CSSSelector.java |   168 +
 .../internal/css/CSSSelectorCondition.java      |    67 +
 .../internal/css/CSSStringPropertyValue.java    |   113 +
 .../flex/compiler/internal/css/CSSTextNode.java |    54 +
 .../compiler/internal/css/CSSTypedNode.java     |    39 +
 .../css/CSSURLAndFormatPropertyValue.java       |    65 +
 .../css/codegen/CSSCompilationSession.java      |   417 +
 .../css/codegen/CSSModuleGenerator.java         |   125 +
 .../internal/css/codegen/CSSReducer.java        |   807 +
 .../internal/css/codegen/ICSSCodeGenResult.java |    45 +
 .../css/codegen/ICSSRuntimeConstants.java       |    44 +
 .../compiler/internal/css/codegen/Pair.java     |   101 +
 .../flex/compiler/internal/css/package.html     |    37 +
 .../css/semantics/ActivatedStyleSheets.java     |   150 +
 .../css/semantics/CSSSemanticAnalyzer.java      |   759 +
 .../definitions/AccessorDefinition.java         |   237 +
 .../definitions/AmbiguousDefinition.java        |   335 +
 .../definitions/AppliedVectorDefinition.java    |   625 +
 .../internal/definitions/ClassDefinition.java   |  1458 +
 .../definitions/ClassDefinitionBase.java        |   681 +
 .../definitions/ClassTraitsDefinition.java      |   381 +
 .../definitions/ConstantDefinition.java         |   212 +
 .../internal/definitions/DefinitionBase.java    |  1735 +
 .../internal/definitions/EffectDefinition.java  |    88 +
 .../internal/definitions/EventDefinition.java   |    49 +
 .../definitions/FunctionDefinition.java         |   610 +
 .../internal/definitions/GetterDefinition.java  |   105 +
 .../definitions/InterfaceDefinition.java        |   625 +
 .../definitions/MemberedDefinition.java         |    39 +
 .../definitions/MetadataDefinitionBase.java     |   152 +
 .../definitions/NamespaceDefinition.java        |  2246 ++
 .../internal/definitions/PackageDefinition.java |   148 +
 .../definitions/ParameterDefinition.java        |   137 +
 .../definitions/ScopedDefinitionBase.java       |    69 +
 .../internal/definitions/SetterDefinition.java  |   104 +
 .../internal/definitions/StyleDefinition.java   |   254 +
 .../SyntheticBindableGetterDefinition.java      |    33 +
 .../SyntheticBindableSetterDefinition.java      |    33 +
 .../definitions/TypeDefinitionBase.java         |   357 +
 .../definitions/VariableDefinition.java         |   380 +
 .../internal/definitions/VectorInformation.java |   311 +
 .../definitions/metadata/DeprecationInfo.java   |    60 +
 .../internal/definitions/metadata/MetaTag.java  |   365 +
 .../definitions/metadata/MetaTagAttribute.java  |    53 +
 .../metadata/ResourceBundleMetaTag.java         |    59 +
 .../definitions/mxml/MXMLEventHandlerScope.java |    81 +
 .../compiler/internal/definitions/package.html  |    42 +
 .../references/BuiltinReference.java            |    85 +
 .../references/LexicalReference.java            |   102 +
 .../references/NotATypeReference.java           |    82 +
 .../references/ParameterizedReference.java      |    90 +
 .../definitions/references/ReferenceCache.java  |    90 +
 .../references/ResolvedQualifiersReference.java |   184 +
 .../references/ResolvedReference.java           |    80 +
 .../internal/embedding/EmbedAttribute.java      |    76 +
 .../compiler/internal/embedding/EmbedData.java  |   678 +
 .../internal/embedding/EmbedMIMEType.java       |   119 +
 .../embedding/transcoders/DataTranscoder.java   |    72 +
 .../embedding/transcoders/ImageTranscoder.java  |   411 +
 .../embedding/transcoders/JPEGTranscoder.java   |   240 +
 .../embedding/transcoders/MovieTranscoder.java  |   516 +
 .../embedding/transcoders/PBJTranscoder.java    |   128 +
 .../transcoders/ScalableTranscoder.java         |   178 +
 .../embedding/transcoders/SkinTranscoder.java   |   489 +
 .../embedding/transcoders/SoundTranscoder.java  |   369 +
 .../embedding/transcoders/TranscoderBase.java   |   366 +
 .../embedding/transcoders/XMLTranscoder.java    |   226 +
 .../filespecs/IZipFileSpecification.java        |    63 +
 .../filespecs/SWCFileSpecification.java         |   142 +
 .../filespecs/StringFileSpecification.java      |    80 +
 .../filespecs/ZipFileSpecification.java         |   126 +
 .../internal/fxg/dom/AbstractFXGNode.java       |   253 +
 .../internal/fxg/dom/AbstractShapeNode.java     |    82 +
 .../internal/fxg/dom/BitmapGraphicNode.java     |    79 +
 .../compiler/internal/fxg/dom/CDATANode.java    |   137 +
 .../internal/fxg/dom/ContentPropertyNode.java   |    80 +
 .../internal/fxg/dom/DOMParserHelper.java       |   691 +
 .../internal/fxg/dom/DefinitionNode.java        |   120 +
 .../compiler/internal/fxg/dom/DelegateNode.java |   227 +
 .../compiler/internal/fxg/dom/EllipseNode.java  |    94 +
 .../internal/fxg/dom/GradientEntryNode.java     |    70 +
 .../internal/fxg/dom/GraphicContentNode.java    |   559 +
 .../internal/fxg/dom/GraphicContext.java        |    82 +
 .../compiler/internal/fxg/dom/GraphicNode.java  |   397 +
 .../internal/fxg/dom/GroupDefinitionNode.java   |   184 +
 .../compiler/internal/fxg/dom/GroupNode.java    |   223 +
 .../compiler/internal/fxg/dom/IFillNode.java    |    40 +
 .../compiler/internal/fxg/dom/IFilterNode.java  |    40 +
 .../internal/fxg/dom/IMaskableNode.java         |    37 +
 .../compiler/internal/fxg/dom/IMaskingNode.java |    43 +
 .../fxg/dom/IPreserveWhiteSpaceNode.java        |    27 +
 .../internal/fxg/dom/IScalableGradientNode.java |    65 +
 .../compiler/internal/fxg/dom/IStrokeNode.java  |    40 +
 .../compiler/internal/fxg/dom/ITextNode.java    |    70 +
 .../internal/fxg/dom/ITransformNode.java        |    40 +
 .../compiler/internal/fxg/dom/LibraryNode.java  |   122 +
 .../compiler/internal/fxg/dom/LineNode.java     |    86 +
 .../internal/fxg/dom/MaskPropertyNode.java      |    65 +
 .../compiler/internal/fxg/dom/PathNode.java     |   105 +
 .../internal/fxg/dom/PlaceObjectNode.java       |    79 +
 .../compiler/internal/fxg/dom/RectNode.java     |   197 +
 .../compiler/internal/fxg/dom/RichTextNode.java |   945 +
 .../internal/fxg/dom/TextGraphicNode.java       |   444 +
 .../fxg/dom/fills/AbstractFillNode.java         |    81 +
 .../internal/fxg/dom/fills/BitmapFillNode.java  |   116 +
 .../fxg/dom/fills/LinearGradientFillNode.java   |   221 +
 .../fxg/dom/fills/RadialGradientFillNode.java   |   227 +
 .../fxg/dom/fills/SolidColorFillNode.java       |    65 +
 .../fxg/dom/filters/AbstractFilterNode.java     |    99 +
 .../fxg/dom/filters/BevelFilterNode.java        |    96 +
 .../fxg/dom/filters/BlurFilterNode.java         |    68 +
 .../fxg/dom/filters/ColorMatrixFilterNode.java  |   104 +
 .../fxg/dom/filters/DropShadowFilterNode.java   |    93 +
 .../fxg/dom/filters/GlowFilterNode.java         |    84 +
 .../dom/filters/GradientBevelFilterNode.java    |   133 +
 .../fxg/dom/filters/GradientGlowFilterNode.java |   132 +
 .../dom/richtext/AbstractRichBlockTextNode.java |   321 +
 .../dom/richtext/AbstractRichParagraphNode.java |   164 +
 .../dom/richtext/AbstractRichTextLeafNode.java  |   372 +
 .../fxg/dom/richtext/AbstractRichTextNode.java  |   230 +
 .../internal/fxg/dom/richtext/BRNode.java       |    64 +
 .../internal/fxg/dom/richtext/DivNode.java      |   210 +
 .../internal/fxg/dom/richtext/ImgNode.java      |   123 +
 .../internal/fxg/dom/richtext/LinkNode.java     |   241 +
 .../fxg/dom/richtext/ParagraphNode.java         |   214 +
 .../internal/fxg/dom/richtext/SpanNode.java     |    81 +
 .../internal/fxg/dom/richtext/TCYNode.java      |   222 +
 .../internal/fxg/dom/richtext/TabNode.java      |    64 +
 .../internal/fxg/dom/richtext/TextHelper.java   |   712 +
 .../fxg/dom/richtext/TextLayoutFormatNode.java  |    45 +
 .../fxg/dom/richtext/TextPropertyNode.java      |    56 +
 .../fxg/dom/strokes/AbstractStrokeNode.java     |   227 +
 .../dom/strokes/LinearGradientStrokeNode.java   |   215 +
 .../dom/strokes/RadialGradientStrokeNode.java   |   226 +
 .../fxg/dom/strokes/SolidColorStrokeNode.java   |    66 +
 .../fxg/dom/text/AbstractCharacterTextNode.java |   255 +
 .../internal/fxg/dom/text/AbstractTextNode.java |   207 +
 .../compiler/internal/fxg/dom/text/BRNode.java  |    46 +
 .../internal/fxg/dom/text/ParagraphNode.java    |   177 +
 .../internal/fxg/dom/text/SpanNode.java         |    72 +
 .../dom/transforms/AbstractTransformNode.java   |    87 +
 .../fxg/dom/transforms/ColorTransformNode.java  |   106 +
 .../internal/fxg/dom/transforms/MatrixNode.java |    76 +
 .../fxg/dom/types/AlignmentBaseline.java        |    72 +
 .../internal/fxg/dom/types/BaselineOffset.java  |   109 +
 .../internal/fxg/dom/types/BaselineShift.java   |   102 +
 .../internal/fxg/dom/types/BevelType.java       |    51 +
 .../internal/fxg/dom/types/BlendMode.java       |   219 +
 .../fxg/dom/types/BlockProgression.java         |    41 +
 .../fxg/dom/types/BreakOpportunity.java         |    53 +
 .../compiler/internal/fxg/dom/types/Caps.java   |    52 +
 .../internal/fxg/dom/types/ColorWithEnum.java   |   103 +
 .../internal/fxg/dom/types/DigitCase.java       |    47 +
 .../internal/fxg/dom/types/DigitWidth.java      |    47 +
 .../internal/fxg/dom/types/Direction.java       |    41 +
 .../fxg/dom/types/DominantBaseline.java         |    72 +
 .../internal/fxg/dom/types/FillMode.java        |    47 +
 .../internal/fxg/dom/types/FontStyle.java       |    41 +
 .../internal/fxg/dom/types/FontWeight.java      |    41 +
 .../fxg/dom/types/InterpolationMethod.java      |    45 +
 .../compiler/internal/fxg/dom/types/Joints.java |    51 +
 .../fxg/dom/types/JustificationRule.java        |    47 +
 .../fxg/dom/types/JustificationStyle.java       |    53 +
 .../internal/fxg/dom/types/Kerning.java         |    51 +
 .../internal/fxg/dom/types/LeadingModel.java    |    76 +
 .../internal/fxg/dom/types/LigatureLevel.java   |    53 +
 .../internal/fxg/dom/types/LineBreak.java       |    51 +
 .../internal/fxg/dom/types/MaskType.java        |    54 +
 .../internal/fxg/dom/types/NumberAuto.java      |   148 +
 .../internal/fxg/dom/types/NumberInherit.java   |    95 +
 .../fxg/dom/types/NumberPercentAuto.java        |    96 +
 .../internal/fxg/dom/types/ResizeMode.java      |    47 +
 .../internal/fxg/dom/types/ScaleMode.java       |    58 +
 .../internal/fxg/dom/types/ScalingGrid.java     |    32 +
 .../internal/fxg/dom/types/SpreadMethod.java    |    51 +
 .../internal/fxg/dom/types/TextAlign.java       |    65 +
 .../internal/fxg/dom/types/TextDecoration.java  |    41 +
 .../internal/fxg/dom/types/TextJustify.java     |    41 +
 .../internal/fxg/dom/types/TextRotation.java    |    59 +
 .../internal/fxg/dom/types/TypographicCase.java |    59 +
 .../internal/fxg/dom/types/VerticalAlign.java   |    59 +
 .../fxg/dom/types/WhiteSpaceCollapse.java       |    46 +
 .../internal/fxg/dom/types/Winding.java         |    43 +
 .../internal/fxg/logging/AbstractLogger.java    |   135 +
 .../internal/fxg/logging/SystemLogger.java      |    84 +
 .../internal/fxg/resources/FXGFileResolver.java |    86 +
 .../fxg/sax/AbstractFXGVersionHandler.java      |   158 +
 .../compiler/internal/fxg/sax/FXGSAXParser.java |   126 +
 .../internal/fxg/sax/FXGSAXScanner.java         |   573 +
 .../fxg/sax/FXGVersionHandlerRegistry.java      |   193 +
 .../internal/fxg/sax/FXG_v1_0_Handler.java      |   156 +
 .../internal/fxg/sax/FXG_v2_0_Handler.java      |   171 +
 .../internal/fxg/sax/IFXGVersionHandler.java    |    75 +
 .../compiler/internal/fxg/swf/DefineImage.java  |    59 +
 .../compiler/internal/fxg/swf/ImageHelper.java  |   555 +
 .../compiler/internal/fxg/swf/ShapeHelper.java  |  1453 +
 .../compiler/internal/fxg/swf/TextHelper.java   |    49 +
 .../compiler/internal/fxg/swf/TypeHelper.java   |   387 +
 .../compiler/internal/fxg/types/FXGMatrix.java  |   165 +
 .../flex/compiler/internal/graph/Graph.java     |   206 +
 .../flex/compiler/internal/graph/GraphEdge.java |    51 +
 .../compiler/internal/graph/GraphMLWriter.java  |   377 +
 .../flex/compiler/internal/graph/IGraph.java    |   103 +
 .../compiler/internal/graph/IGraphEdge.java     |    39 +
 .../compiler/internal/graph/IGraphable.java     |    27 +
 .../compiler/internal/graph/IReportWriter.java  |    45 +
 .../graph/InvalidationBytesCalculator.java      |    89 +
 .../internal/graph/LinkReportWriter.java        |   298 +
 .../internal/graph/SynchronizedGraph.java       |   169 +
 .../internal/graph/TopologicalSort.java         |   225 +
 .../compiler/internal/graph/XMLGraphWriter.java |   126 +
 .../compiler/internal/mxml/EntityProcessor.java |   285 +
 .../flex/compiler/internal/mxml/MXMLData.java   |   965 +
 .../compiler/internal/mxml/MXMLDataManager.java |    62 +
 .../compiler/internal/mxml/MXMLDialect.java     |   709 +
 .../compiler/internal/mxml/MXMLDialect2006.java |   426 +
 .../compiler/internal/mxml/MXMLDialect2009.java |    58 +
 .../compiler/internal/mxml/MXMLDialect2012.java |   105 +
 .../internal/mxml/MXMLInstructionData.java      |   129 +
 .../internal/mxml/MXMLManifestManager.java      |   418 +
 .../mxml/MXMLNamespaceAttributeData.java        |    64 +
 .../internal/mxml/MXMLNamespaceMapping.java     |    76 +
 .../internal/mxml/MXMLStateSplitter.java        |   101 +
 .../internal/mxml/MXMLTagAttributeData.java     |   578 +
 .../compiler/internal/mxml/MXMLTagData.java     |  1135 +
 .../compiler/internal/mxml/MXMLTextData.java    |   390 +
 .../compiler/internal/mxml/MXMLUnitData.java    |   366 +
 .../compiler/internal/mxml/StateDefinition.java |   104 +
 .../internal/mxml/StateDefinitionBase.java      |    81 +
 .../internal/mxml/StateGroupDefinition.java     |    89 +
 .../flex/compiler/internal/mxml/package.html    |    33 +
 .../compiler/internal/parsing/FakingReader.java |   215 +
 .../internal/parsing/FilteringList.java         |    70 +
 .../internal/parsing/ISourceFragment.java       |    64 +
 .../internal/parsing/ITokenStreamFilter.java    |    27 +
 .../internal/parsing/SourceFragment.java        |   133 +
 .../internal/parsing/SourceFragmentsReader.java |   165 +
 .../compiler/internal/parsing/TokenBase.java    |   515 +
 .../internal/parsing/as/ASBalancingScanner.java |   106 +
 .../internal/parsing/as/ASDocToken.java         |    44 +
 .../internal/parsing/as/ASDocTokenizer.java     |    94 +
 .../compiler/internal/parsing/as/ASToken.java   |  1010 +
 .../internal/parsing/as/BaseASParser.java       |  3043 ++
 .../internal/parsing/as/BaseMetaTagParser.java  |   165 +
 .../internal/parsing/as/BaseRawASTokenizer.java |   361 +
 .../internal/parsing/as/BaseRawTokenizer.java   |   387 +
 .../parsing/as/BaseRepairingTokenBuffer.java    |   110 +
 .../as/BaseTokenizerWithFakeCharacters.java     |    78 +
 .../parsing/as/ConfigCompilationUnit.java       |    97 +
 .../internal/parsing/as/ConfigProcessor.java    |   503 +
 .../internal/parsing/as/DeferFunctionBody.java  |    36 +
 .../internal/parsing/as/IProblemReporter.java   |    42 +
 .../parsing/as/IProjectConfigVariables.java     |    74 +
 .../parsing/as/IRepairingTokenBuffer.java       |   118 +
 .../internal/parsing/as/IncludeHandler.java     |   595 +
 .../parsing/as/MetaDataPayloadToken.java        |   127 +
 .../internal/parsing/as/MetadataToken.java      |    96 +
 .../internal/parsing/as/MetadataTokenizer.java  |   355 +
 .../internal/parsing/as/NilASDocDelegate.java   |   131 +
 .../compiler/internal/parsing/as/OffsetCue.java |   127 +
 .../internal/parsing/as/OffsetLookup.java       |   230 +
 .../parsing/as/RepairingTokenBuffer.java        |   153 +
 .../parsing/as/SimpleASDocDelegate.java         |   143 +
 .../parsing/as/StreamingASTokenizer.java        |  1871 ++
 .../parsing/as/StreamingTokenBuffer.java        |   208 +
 .../parsing/mxml/BalancingMXMLProcessor.java    |   139 +
 .../parsing/mxml/BaseRawMXMLTokenizer.java      |   278 +
 .../internal/parsing/mxml/MXMLScopeBuilder.java |   782 +
 .../internal/parsing/mxml/MXMLTagDataDepth.java |   263 +
 .../parsing/mxml/MXMLTagDataPayload.java        |    63 +
 .../internal/parsing/mxml/MXMLToken.java        |   238 +
 .../internal/parsing/mxml/MXMLTokenizer.java    |   439 +
 .../parsing/mxml/MXMLUnitDataIterator.java      |    55 +
 .../flex/compiler/internal/parsing/package.html |    33 +
 .../compiler/internal/projects/ASCProject.java  |    77 +
 .../compiler/internal/projects/ASProject.java   |   470 +
 .../internal/projects/ASSourceFileHandler.java  |    66 +
 .../internal/projects/CompilerProject.java      |  1004 +
 .../internal/projects/ConfigManager.java        |   313 +
 .../internal/projects/DefinitionPriority.java   |   137 +
 .../internal/projects/DependencyGraph.java      |   805 +
 .../internal/projects/FXGSourceFileHandler.java |    66 +
 .../compiler/internal/projects/FlexProject.java |  2186 ++
 .../projects/FlexProjectConfigurator.java       |   250 +
 .../internal/projects/ISourceFileHandler.java   |    89 +
 .../projects/LibraryDependencyGraph.java        |   345 +
 .../internal/projects/LibraryPathManager.java   |   673 +
 .../projects/MXMLSourceFileHandler.java         |    74 +
 .../ResourceBundleSourceFileHandler.java        |    73 +
 .../internal/projects/SourceListManager.java    |   255 +
 .../internal/projects/SourcePathManager.java    |   701 +
 .../internal/projects/ThemeUtilities.java       |    73 +
 .../compiler/internal/projects/package.html     |    33 +
 .../resourcebundles/PropertiesFileParser.java   |   520 +
 .../resourcebundles/ResourceBundleUtils.java    |   336 +
 .../compiler/internal/scopes/ASFileScope.java   |   443 +
 .../internal/scopes/ASFileScopeProvider.java    |    54 +
 .../internal/scopes/ASProjectScope.java         |  2133 ++
 .../flex/compiler/internal/scopes/ASScope.java  |  1698 +
 .../compiler/internal/scopes/ASScopeBase.java   |   519 +
 .../compiler/internal/scopes/ASScopeCache.java  |   675 +
 .../compiler/internal/scopes/CatchScope.java    |    48 +
 .../compiler/internal/scopes/ClosureScope.java  |    33 +
 .../internal/scopes/EmptyDefinitionStore.java   |   102 +
 .../compiler/internal/scopes/FXGFileScope.java  |    33 +
 .../compiler/internal/scopes/FunctionScope.java |    41 +
 .../internal/scopes/IDefinitionStore.java       |   127 +
 .../internal/scopes/IMutableDefinitionSet.java  |    57 +
 .../internal/scopes/LargeDefinitionSet.java     |   102 +
 .../internal/scopes/LargeDefinitionStore.java   |   199 +
 .../compiler/internal/scopes/MXMLFileScope.java |   631 +
 .../internal/scopes/NamespaceSetPredicate.java  |   118 +
 .../internal/scopes/NoDefinitionScope.java      |   132 +
 .../compiler/internal/scopes/PackageScope.java  |   165 +
 .../internal/scopes/SWCFileScopeProvider.java   |   124 +
 .../compiler/internal/scopes/ScopeView.java     |   340 +
 .../internal/scopes/SmallDefinitionSet.java     |   150 +
 .../internal/scopes/SmallDefinitionStore1.java  |   157 +
 .../internal/scopes/SmallDefinitionStore2.java  |   185 +
 .../internal/scopes/SmallDefinitionStore4.java  |   220 +
 .../internal/scopes/SmallDefinitionStore8.java  |   290 +
 .../scopes/SmallDefinitionStoreBase.java        |   341 +
 .../compiler/internal/scopes/TypeScope.java     |   666 +
 .../compiler/internal/scopes/WithScope.java     |    42 +
 .../flex/compiler/internal/scopes/package.html  |    33 +
 .../semantics/MethodBodySemanticChecker.java    |  3063 ++
 .../internal/semantics/PostProcessStep.java     |    27 +
 .../internal/semantics/SemanticUtils.java       |  2968 ++
 .../compiler/internal/targets/AppSWFTarget.java |   390 +
 .../internal/targets/FlexAppSWFTarget.java      |  1857 ++
 .../targets/FlexApplicationFrame1Info.java      |   257 +
 .../compiler/internal/targets/FlexFontInfo.java |    56 +
 .../internal/targets/FlexFrame1Info.java        |   225 +
 .../internal/targets/FlexLibraryFrame1Info.java |    44 +
 .../internal/targets/FlexLibrarySWFTarget.java  |   472 +
 .../compiler/internal/targets/FlexRSLInfo.java  |   235 +
 .../internal/targets/FlexSplashScreenImage.java |    50 +
 .../compiler/internal/targets/FlexTarget.java   |   745 +
 .../internal/targets/ILibrarySWFTarget.java     |    56 +
 .../internal/targets/ITargetAttributes.java     |   116 +
 .../internal/targets/LibrarySWFTarget.java      |   130 +
 .../internal/targets/LinkageChecker.java        |   147 +
 .../internal/targets/NilTargetAttributes.java   |   128 +
 .../compiler/internal/targets/SWCTarget.java    |   995 +
 .../compiler/internal/targets/SWFTarget.java    |   874 +
 .../compiler/internal/targets/TagSorter.java    |   154 +
 .../flex/compiler/internal/targets/Target.java  |   820 +
 .../internal/targets/TargetAttributeBase.java   |   225 +
 .../internal/targets/TargetAttributesMap.java   |   162 +
 .../targets/TargetAttributesMetadata.java       |   140 +
 .../compiler/internal/targets/TargetReport.java |   199 +
 .../flex/compiler/internal/targets/package.html |    33 +
 .../testing/NodesToXMLStringFormatter.java      |   129 +
 .../flex/compiler/internal/testing/package.html |    33 +
 .../compiler/internal/tree/as/AccessorNode.java |   183 +
 .../internal/tree/as/ArrayLiteralNode.java      |   124 +
 .../internal/tree/as/BaseDefinitionNode.java    |   453 +
 .../tree/as/BaseLiteralContainerNode.java       |   185 +
 .../tree/as/BaseStatementExpressionNode.java    |   109 +
 .../internal/tree/as/BaseStatementNode.java     |    67 +
 .../tree/as/BaseTypedDefinitionNode.java        |   223 +
 .../internal/tree/as/BaseVariableNode.java      |   390 +
 .../internal/tree/as/BinaryOperatorAsNode.java  |    95 +
 .../tree/as/BinaryOperatorAssignmentNode.java   |    87 +
 .../BinaryOperatorBitwiseAndAssignmentNode.java |   101 +
 .../tree/as/BinaryOperatorBitwiseAndNode.java   |    88 +
 ...yOperatorBitwiseLeftShiftAssignmentNode.java |   101 +
 .../as/BinaryOperatorBitwiseLeftShiftNode.java  |    88 +
 .../BinaryOperatorBitwiseOrAssignmentNode.java  |   101 +
 .../tree/as/BinaryOperatorBitwiseOrNode.java    |    88 +
 ...OperatorBitwiseRightShiftAssignmentNode.java |   101 +
 .../as/BinaryOperatorBitwiseRightShiftNode.java |    88 +
 ...BitwiseUnsignedRightShiftAssignmentNode.java |   101 +
 ...ryOperatorBitwiseUnsignedRightShiftNode.java |   100 +
 .../BinaryOperatorBitwiseXorAssignmentNode.java |   101 +
 .../tree/as/BinaryOperatorBitwiseXorNode.java   |    88 +
 .../tree/as/BinaryOperatorCommaNode.java        |    88 +
 .../BinaryOperatorDivisionAssignmentNode.java   |   101 +
 .../tree/as/BinaryOperatorDivisionNode.java     |    88 +
 .../tree/as/BinaryOperatorEqualNode.java        |    88 +
 .../as/BinaryOperatorGreaterThanEqualsNode.java |    88 +
 .../tree/as/BinaryOperatorGreaterThanNode.java  |    88 +
 .../internal/tree/as/BinaryOperatorInNode.java  |    88 +
 .../tree/as/BinaryOperatorInstanceOfNode.java   |    88 +
 .../internal/tree/as/BinaryOperatorIsNode.java  |    88 +
 .../as/BinaryOperatorLessThanEqualsNode.java    |    88 +
 .../tree/as/BinaryOperatorLessThanNode.java     |    88 +
 .../BinaryOperatorLogicalAndAssignmentNode.java |   102 +
 .../tree/as/BinaryOperatorLogicalAndNode.java   |    87 +
 .../BinaryOperatorLogicalOrAssignmentNode.java  |   101 +
 .../tree/as/BinaryOperatorLogicalOrNode.java    |    87 +
 .../as/BinaryOperatorMinusAssignmentNode.java   |   101 +
 .../tree/as/BinaryOperatorMinusNode.java        |    88 +
 .../as/BinaryOperatorModuloAssignmentNode.java  |   101 +
 .../tree/as/BinaryOperatorModuloNode.java       |    88 +
 ...aryOperatorMultiplicationAssignmentNode.java |   101 +
 .../as/BinaryOperatorMultiplicationNode.java    |    88 +
 .../tree/as/BinaryOperatorNodeBase.java         |   396 +
 .../tree/as/BinaryOperatorNotEqualNode.java     |    88 +
 .../as/BinaryOperatorPlusAssignmentNode.java    |   101 +
 .../tree/as/BinaryOperatorPlusNode.java         |   138 +
 .../tree/as/BinaryOperatorStrictEqualNode.java  |    88 +
 .../as/BinaryOperatorStrictNotEqualNode.java    |    88 +
 .../compiler/internal/tree/as/BlockNode.java    |    81 +
 .../compiler/internal/tree/as/CatchNode.java    |   140 +
 .../internal/tree/as/ChainedVariableNode.java   |   179 +
 .../compiler/internal/tree/as/ClassNode.java    |   663 +
 .../internal/tree/as/ClassReferenceNode.java    |    91 +
 .../internal/tree/as/ConditionalNode.java       |   111 +
 .../tree/as/ConfigConditionBlockNode.java       |    74 +
 .../internal/tree/as/ConfigConstNode.java       |   131 +
 .../internal/tree/as/ConfigExpressionNode.java  |   108 +
 .../internal/tree/as/ConfigNamespaceNode.java   |    53 +
 .../internal/tree/as/ContainerNode.java         |   168 +
 .../tree/as/DefaultXMLNamespaceNode.java        |   106 +
 .../internal/tree/as/DoWhileLoopNode.java       |    81 +
 .../internal/tree/as/DynamicAccessNode.java     |    86 +
 .../compiler/internal/tree/as/EmbedNode.java    |   142 +
 .../internal/tree/as/ExpressionNodeBase.java    |   505 +
 .../compiler/internal/tree/as/FileNode.java     |   584 +
 .../internal/tree/as/FixedChildrenNode.java     |    38 +
 .../compiler/internal/tree/as/ForLoopNode.java  |   174 +
 .../compiler/internal/tree/as/FullNameNode.java |   183 +
 .../internal/tree/as/FunctionCallNode.java      |   321 +
 .../compiler/internal/tree/as/FunctionNode.java |  1053 +
 .../internal/tree/as/FunctionObjectNode.java    |   145 +
 .../compiler/internal/tree/as/GetterNode.java   |   116 +
 .../tree/as/IInitializableDefinitionNode.java   |    42 +
 .../internal/tree/as/IdentifierNode.java        |  1048 +
 .../flex/compiler/internal/tree/as/IfNode.java  |   119 +
 .../compiler/internal/tree/as/ImportNode.java   |   240 +
 .../internal/tree/as/InterfaceNode.java         |   388 +
 .../internal/tree/as/IterationFlowNode.java     |   134 +
 .../compiler/internal/tree/as/KeywordNode.java  |   173 +
 .../internal/tree/as/LabeledStatementNode.java  |    94 +
 .../tree/as/LanguageIdentifierNode.java         |   592 +
 .../compiler/internal/tree/as/LiteralNode.java  |   306 +
 .../tree/as/MemberAccessExpressionNode.java     |   310 +
 .../compiler/internal/tree/as/MemberedNode.java |    69 +
 .../compiler/internal/tree/as/ModifierNode.java |   120 +
 .../tree/as/ModifiersContainerNode.java         |    54 +
 .../tree/as/NamespaceAccessExpressionNode.java  |   171 +
 .../tree/as/NamespaceIdentifierNode.java        |   368 +
 .../internal/tree/as/NamespaceNode.java         |   243 +
 .../flex/compiler/internal/tree/as/NilNode.java |    59 +
 .../compiler/internal/tree/as/NodeBase.java     |  1038 +
 .../tree/as/NonResolvingIdentifierNode.java     |    92 +
 .../internal/tree/as/NumericLiteralNode.java    |   284 +
 .../internal/tree/as/ObjectLiteralNode.java     |    92 +
 .../tree/as/ObjectLiteralValuePairNode.java     |   136 +
 .../internal/tree/as/OperatorNodeBase.java      |   130 +
 .../compiler/internal/tree/as/PackageNode.java  |   316 +
 .../internal/tree/as/ParameterNode.java         |   311 +
 .../tree/as/QualifiedNameExpressionNode.java    |    96 +
 .../as/QualifiedNamespaceExpressionNode.java    |   140 +
 .../internal/tree/as/RegExpLiteralNode.java     |   188 +
 .../compiler/internal/tree/as/ReturnNode.java   |    89 +
 .../tree/as/RuntimeNameExpressionNode.java      |   120 +
 .../internal/tree/as/ScopedBlockNode.java       |   243 +
 .../compiler/internal/tree/as/SetterNode.java   |   138 +
 .../compiler/internal/tree/as/SwitchNode.java   |   107 +
 .../compiler/internal/tree/as/TerminalNode.java |   118 +
 .../internal/tree/as/TernaryOperatorNode.java   |   184 +
 .../compiler/internal/tree/as/ThrowNode.java    |    85 +
 .../tree/as/TransparentContainerNode.java       |    58 +
 .../compiler/internal/tree/as/TreeNode.java     |   321 +
 .../flex/compiler/internal/tree/as/TryNode.java |   155 +
 .../internal/tree/as/TypedExpressionNode.java   |   305 +
 .../internal/tree/as/UnaryOperatorAtNode.java   |   111 +
 .../tree/as/UnaryOperatorBitwiseNotNode.java    |    86 +
 .../tree/as/UnaryOperatorDeleteNode.java        |    86 +
 .../tree/as/UnaryOperatorLogicalNotNode.java    |    86 +
 .../tree/as/UnaryOperatorMinusNode.java         |    88 +
 .../internal/tree/as/UnaryOperatorNodeBase.java |   285 +
 .../internal/tree/as/UnaryOperatorPlusNode.java |    88 +
 .../tree/as/UnaryOperatorPostDecrementNode.java |    91 +
 .../tree/as/UnaryOperatorPostIncrementNode.java |    91 +
 .../tree/as/UnaryOperatorPreDecrementNode.java  |    87 +
 .../tree/as/UnaryOperatorPreIncrementNode.java  |    87 +
 .../tree/as/UnaryOperatorTypeOfNode.java        |    86 +
 .../internal/tree/as/UnaryOperatorVoidNode.java |    77 +
 .../internal/tree/as/UseNamespaceNode.java      |   130 +
 .../tree/as/VariableExpressionNode.java         |   134 +
 .../compiler/internal/tree/as/VariableNode.java |   248 +
 .../internal/tree/as/VectorLiteralNode.java     |   154 +
 .../internal/tree/as/WhileLoopNode.java         |    64 +
 .../compiler/internal/tree/as/WithNode.java     |   117 +
 .../internal/tree/as/XMLListLiteralNode.java    |    88 +
 .../internal/tree/as/XMLLiteralNode.java        |   123 +
 .../tree/as/metadata/AccessibilityTagNode.java  |    31 +
 .../tree/as/metadata/AlternativeTagNode.java    |    30 +
 .../as/metadata/BaseDefinitionMetaTagNode.java  |   261 +
 .../tree/as/metadata/BasicMetaTagNode.java      |    57 +
 .../as/metadata/DefaultPropertyTagNode.java     |    91 +
 .../tree/as/metadata/EffectTagNode.java         |   106 +
 .../internal/tree/as/metadata/EventTagNode.java |   104 +
 .../tree/as/metadata/EventTriggerTagNode.java   |   103 +
 .../tree/as/metadata/InspectableTagNode.java    |   225 +
 .../internal/tree/as/metadata/MetaTagNode.java  |   285 +
 .../internal/tree/as/metadata/MetaTagValue.java |    51 +
 .../internal/tree/as/metadata/MetaTagsNode.java |   345 +
 .../tree/as/metadata/MultiValueMetaTagNode.java |    70 +
 .../tree/as/metadata/ResourceBundleTagNode.java |   103 +
 .../tree/as/metadata/SkinClassTagNode.java      |    33 +
 .../internal/tree/as/metadata/StyleTagNode.java |   225 +
 .../internal/tree/as/metadata/TypedTagNode.java |    77 +
 .../flex/compiler/internal/tree/as/package.html |    42 +
 .../as/parts/AccessorFunctionContentsPart.java  |    44 +
 .../internal/tree/as/parts/DecorationPart.java  |   184 +
 .../tree/as/parts/FunctionContentsPart.java     |    99 +
 .../as/parts/IAccessorFunctionContentsPart.java |    29 +
 .../internal/tree/as/parts/IDecorationPart.java |    73 +
 .../tree/as/parts/IFunctionContentsPart.java    |    57 +
 .../tree/as/parts/SparseDecorationPart.java     |    83 +
 .../tree/as/parts/VariableDecorationPart.java   |    79 +
 .../internal/tree/mxml/MXMLApplicationNode.java |   115 +
 .../internal/tree/mxml/MXMLArrayNode.java       |   329 +
 .../tree/mxml/MXMLBindingAttributeNode.java     |   155 +
 .../internal/tree/mxml/MXMLBindingNode.java     |   250 +
 .../internal/tree/mxml/MXMLBooleanNode.java     |    80 +
 .../tree/mxml/MXMLClassDefinitionNode.java      |  1132 +
 .../internal/tree/mxml/MXMLClassNode.java       |   150 +
 .../tree/mxml/MXMLClassReferenceNodeBase.java   |   716 +
 .../internal/tree/mxml/MXMLClearNode.java       |    60 +
 .../mxml/MXMLCompilerDirectiveNodeBase.java     |    69 +
 .../tree/mxml/MXMLCompilerDirectiveParser.java  |   126 +
 .../internal/tree/mxml/MXMLComponentNode.java   |   206 +
 .../mxml/MXMLConcatenatedDataBindingNode.java   |    73 +
 .../tree/mxml/MXMLDataBindingParser.java        |   479 +
 .../tree/mxml/MXMLDeclarationsNode.java         |   155 +
 .../tree/mxml/MXMLDeferredInstanceNode.java     |   208 +
 .../internal/tree/mxml/MXMLDefinitionNode.java  |   217 +
 .../internal/tree/mxml/MXMLDesignLayerNode.java |    97 +
 .../internal/tree/mxml/MXMLDocumentNode.java    |   149 +
 .../tree/mxml/MXMLEffectSpecifierNode.java      |    58 +
 .../internal/tree/mxml/MXMLEmbedNode.java       |   145 +
 .../tree/mxml/MXMLEventSpecifierNode.java       |   305 +
 .../tree/mxml/MXMLExpressionNodeBase.java       |   207 +
 .../internal/tree/mxml/MXMLFactoryNode.java     |   114 +
 .../internal/tree/mxml/MXMLFileNode.java        |   535 +
 .../internal/tree/mxml/MXMLFunctionNode.java    |    99 +
 .../internal/tree/mxml/MXMLHTTPServiceNode.java |    97 +
 .../MXMLHTTPServiceRequestPropertyNode.java     |   112 +
 .../internal/tree/mxml/MXMLImplementsNode.java  |   172 +
 .../tree/mxml/MXMLImplicitImportNode.java       |    65 +
 .../internal/tree/mxml/MXMLInstanceNode.java    |   439 +
 .../internal/tree/mxml/MXMLIntNode.java         |    80 +
 .../internal/tree/mxml/MXMLLibraryNode.java     |   112 +
 .../internal/tree/mxml/MXMLLiteralNode.java     |    82 +
 .../internal/tree/mxml/MXMLMetadataNode.java    |   130 +
 .../internal/tree/mxml/MXMLModelNode.java       |   155 +
 .../MXMLModelPropertyContainerNodeBase.java     |   247 +
 .../tree/mxml/MXMLModelPropertyNode.java        |   159 +
 .../internal/tree/mxml/MXMLModelRootNode.java   |    59 +
 .../internal/tree/mxml/MXMLNodeBase.java        |   954 +
 .../internal/tree/mxml/MXMLNumberNode.java      |    84 +
 .../internal/tree/mxml/MXMLObjectNode.java      |    51 +
 .../internal/tree/mxml/MXMLPrivateNode.java     |    70 +
 .../tree/mxml/MXMLPropertySpecifierNode.java    |   546 +
 .../internal/tree/mxml/MXMLRegExpNode.java      |    78 +
 .../tree/mxml/MXMLRemoteObjectMethodNode.java   |   113 +
 .../tree/mxml/MXMLRemoteObjectNode.java         |    85 +
 .../internal/tree/mxml/MXMLReparentNode.java    |   145 +
 .../internal/tree/mxml/MXMLRepeaterNode.java    |    53 +
 .../internal/tree/mxml/MXMLResourceNode.java    |   155 +
 .../internal/tree/mxml/MXMLScriptNode.java      |   276 +
 .../tree/mxml/MXMLSingleDataBindingNode.java    |    81 +
 .../tree/mxml/MXMLSpecifierNodeBase.java        |   177 +
 .../internal/tree/mxml/MXMLStateNode.java       |   244 +
 .../internal/tree/mxml/MXMLStringNode.java      |   124 +
 .../internal/tree/mxml/MXMLStyleNode.java       |   153 +
 .../tree/mxml/MXMLStyleSpecifierNode.java       |   110 +
 .../internal/tree/mxml/MXMLTreeBuilder.java     |   901 +
 .../internal/tree/mxml/MXMLUintNode.java        |    82 +
 .../internal/tree/mxml/MXMLVectorNode.java      |   323 +
 .../internal/tree/mxml/MXMLWebServiceNode.java  |    85 +
 .../tree/mxml/MXMLWebServiceOperationNode.java  |   113 +
 .../internal/tree/mxml/MXMLXMLListNode.java     |   122 +
 .../internal/tree/mxml/MXMLXMLNode.java         |   227 +
 .../compiler/internal/tree/mxml/XMLBuilder.java |   708 +
 .../compiler/internal/tree/mxml/package.html    |    42 +
 .../properties/ResourceBundleEntryNode.java     |    62 +
 .../tree/properties/ResourceBundleFileNode.java |    69 +
 .../internal/tree/properties/package.html       |    43 +
 .../internal/units/ABCCompilationUnit.java      |   239 +
 .../internal/units/ASCompilationUnit.java       |   649 +
 .../internal/units/CompilationUnitBase.java     |  1150 +
 .../internal/units/EmbedCompilationUnit.java    |   333 +
 .../units/EmbedCompilationUnitFactory.java      |   142 +
 .../internal/units/FXGCompilationUnit.java      |   431 +
 .../units/ImportedASCompilationUnit.java        |    70 +
 .../units/InvisibleCompilationUnit.java         |   228 +
 .../internal/units/MXMLCompilationUnit.java     |   290 +
 .../units/ResourceBundleCompilationUnit.java    |   713 +
 .../units/ResourceModuleCompilationUnit.java    |   277 +
 .../internal/units/SWCCompilationUnit.java      |   488 +
 .../units/ServicesXMLCompilationUnit.java       |   117 +
 .../units/SourceCompilationUnitFactory.java     |   165 +
 .../units/StringToCompilationUnitMap.java       |   456 +
 .../units/StyleModuleCompilationUnit.java       |   268 +
 .../flex/compiler/internal/units/package.html   |    33 +
 .../units/requests/ABCBytesRequestResult.java   |   144 +
 .../requests/ABCFileScopeRequestResult.java     |    64 +
 .../requests/ASFileScopeRequestResult.java      |   142 +
 .../requests/EmbedFileScopeRequestResult.java   |    38 +
 .../requests/FileScopeRequestResultBase.java    |   158 +
 .../internal/units/requests/RequestMaker.java   |   266 +
 .../units/requests/SWFTagsRequestResult.java    |   127 +
 .../units/requests/SyntaxTreeRequestResult.java |    92 +
 .../internal/units/requests/package.html        |    33 +
 .../compiler/internal/workspaces/Workspace.java |  1244 +
 .../compiler/internal/workspaces/package.html   |    33 +
 .../apache/flex/compiler/mxml/IMXMLData.java    |   125 +
 .../flex/compiler/mxml/IMXMLDataManager.java    |    53 +
 .../compiler/mxml/IMXMLInstructionData.java     |    47 +
 .../compiler/mxml/IMXMLLanguageConstants.java   |   414 +
 .../compiler/mxml/IMXMLManifestManager.java     |    82 +
 .../mxml/IMXMLNamespaceAttributeData.java       |    39 +
 .../compiler/mxml/IMXMLNamespaceMapping.java    |    42 +
 .../compiler/mxml/IMXMLTagAttributeData.java    |   168 +
 .../apache/flex/compiler/mxml/IMXMLTagData.java |   234 +
 .../flex/compiler/mxml/IMXMLTextData.java       |   122 +
 .../flex/compiler/mxml/IMXMLTypeConstants.java  |   210 +
 .../flex/compiler/mxml/IMXMLUnitData.java       |   167 +
 .../flex/compiler/mxml/IStateDefinition.java    |    49 +
 .../compiler/mxml/IStateDefinitionBase.java     |    39 +
 .../compiler/mxml/IStateGroupDefinition.java    |    50 +
 .../flex/compiler/mxml/IXMLNameResolver.java    |    73 +
 .../org/apache/flex/compiler/mxml/package.html  |    52 +
 .../java/org/apache/flex/compiler/package.html  |   137 +
 .../compiler/parsing/GenericTokenStream.java    |    77 +
 .../compiler/parsing/IASBalancingScanner.java   |    53 +
 .../apache/flex/compiler/parsing/IASToken.java  |    80 +
 .../flex/compiler/parsing/IASTokenizer.java     |    61 +
 .../apache/flex/compiler/parsing/ICMToken.java  |    91 +
 .../flex/compiler/parsing/IMXMLToken.java       |   103 +
 .../flex/compiler/parsing/IMXMLTokenizer.java   |    48 +
 .../flex/compiler/parsing/IMetadataParser.java  |    29 +
 .../flex/compiler/parsing/MXMLTokenFactory.java |    52 +
 .../flex/compiler/parsing/MXMLTokenTypes.java   |   143 +
 .../apache/flex/compiler/parsing/package.html   |    44 +
 .../problems/ANELibraryNotAllowedProblem.java   |    44 +
 .../problems/ASDocNotClosedProblem.java         |    41 +
 .../problems/AbstractDeprecatedAPIProblem.java  |    36 +
 .../problems/AbstractSemanticProblem.java       |    46 +
 .../problems/AccessUndefinedMemberProblem.java  |    45 +
 ...AccessUndefinedPropertyInPackageProblem.java |    50 +
 .../AccessUndefinedPropertyProblem.java         |    44 +
 .../problems/AccessorTypesMustMatchProblem.java |    38 +
 .../problems/AmbiguousGotoTargetProblem.java    |    57 +
 .../problems/AmbiguousReferenceProblem.java     |    41 +
 .../AnyNamespaceCannotBeQualifierProblem.java   |    38 +
 .../compiler/problems/ArrayCastProblem.java     |    44 +
 .../compiler/problems/ArrayDowncastProblem.java |    44 +
 .../compiler/problems/AssignToConstProblem.java |    40 +
 .../problems/AssignToFunctionProblem.java       |    46 +
 .../AssignToNonReferenceValueProblem.java       |    40 +
 .../AssignToReadOnlyPropertyProblem.java        |    43 +
 .../AssignmentInConditionalProblem.java         |    42 +
 .../AttemptToDeleteFixedPropertyProblem.java    |    44 +
 .../AttributesAreNotCallableProblem.java        |    39 +
 ...tesNotAllowedOnPackageDefinitionProblem.java |    46 +
 .../BURMDiagnosticForEachExpectedInProblem.java |    42 +
 .../BURMDiagnosticNotAllowedHereProblem.java    |    43 +
 .../BURMPatternMatchFailureProblem.java         |    44 +
 .../BadAccessInterfaceMemberProblem.java        |    46 +
 .../compiler/problems/BadCharacterProblem.java  |    41 +
 .../problems/BadSetterReturnTypeProblem.java    |    41 +
 .../problems/BaseClassIsFinalProblem.java       |    41 +
 .../compiler/problems/CSSCodeGenProblem.java    |    38 +
 .../compiler/problems/CSSEmbedAssetProblem.java |    46 +
 .../CSSExcludedStylePropertyProblem.java        |    48 +
 .../compiler/problems/CSSParserProblem.java     |    74 +
 .../flex/compiler/problems/CSSProblem.java      |    38 +
 .../CSSUndefinedNamespacePrefixProblem.java     |    46 +
 .../problems/CSSUndefinedTypeProblem.java       |    46 +
 .../CSSUnknownDefaultNamespaceProblem.java      |    48 +
 .../CSSUnresolvedClassReferenceProblem.java     |    45 +
 .../problems/CSSUnusedTypeSelectorProblem.java  |    42 +
 .../problems/CallUndefinedMethodProblem.java    |    42 +
 .../problems/CanNotInsertSemicolonProblem.java  |    40 +
 .../CannotDeleteSuperDescendantsProblem.java    |    44 +
 .../problems/CannotExtendClassProblem.java      |    46 +
 .../problems/CannotExtendInterfaceProblem.java  |    48 +
 .../CannotResolveConfigExpressionProblem.java   |    41 +
 ...olveProjectLevelConfigExpressionProblem.java |    39 +
 .../problems/CircularTypeReferenceProblem.java  |    42 +
 .../ClassesMappedToSameRemoteAliasProblem.java  |    43 +
 .../problems/CodegenInternalProblem.java        |    59 +
 .../flex/compiler/problems/CodegenProblem.java  |    39 +
 .../ComparisonBetweenUnrelatedTypesProblem.java |    48 +
 .../problems/CompiledAsAComponentProblem.java   |    46 +
 .../flex/compiler/problems/CompilerProblem.java |   222 +
 .../problems/CompilerProblemClassification.java |    40 +
 .../problems/CompilerProblemSeverity.java       |    41 +
 .../problems/ComponentTagWithoutURIProblem.java |    46 +
 .../ConfigurationFileNotFoundProblem.java       |    37 +
 .../compiler/problems/ConfigurationProblem.java |    59 +
 ...flictingInheritedNameInNamespaceProblem.java |    45 +
 .../ConflictingNameInNamespaceProblem.java      |    44 +
 .../problems/ConstNotInitializedProblem.java    |    39 +
 .../ConstructorCannotHaveReturnTypeProblem.java |    38 +
 .../problems/ConstructorInInterfaceProblem.java |    45 +
 .../ConstructorIsGetterSetterProblem.java       |    38 +
 .../problems/ConstructorIsStaticProblem.java    |    40 +
 .../ConstructorMustBePublicProblem.java         |    41 +
 .../CountedForLoopInitializerProblem.java       |    42 +
 .../problems/CyclicalIncludesProblem.java       |    38 +
 .../flex/compiler/problems/DateCastProblem.java |    49 +
 .../DecrementMustBeReferenceProblem.java        |    42 +
 .../DefinitionShadowedByPackageNameProblem.java |    35 +
 .../DependencyNotCompatibleProblem.java         |    44 +
 .../compiler/problems/DeprecatedAPIProblem.java |    42 +
 .../DeprecatedAPIWithMessageProblem.java        |    41 +
 .../DeprecatedAPIWithReplacementProblem.java    |    43 +
 ...ecatedAPIWithSinceAndReplacementProblem.java |    46 +
 .../problems/DeprecatedAPIWithSinceProblem.java |    45 +
 .../DeprecatedConfigurationOptionProblem.java   |    48 +
 .../problems/DuplicateAttributeProblem.java     |    41 +
 .../DuplicateClassDefinitionProblem.java        |    45 +
 .../DuplicateFunctionDefinitionProblem.java     |    45 +
 .../DuplicateInterfaceDefinitionProblem.java    |    45 +
 .../problems/DuplicateInterfaceProblem.java     |    55 +
 .../problems/DuplicateLabelProblem.java         |    39 +
 .../DuplicateNamespaceDefinitionProblem.java    |    39 +
 .../DuplicateQNameInSourcePathProblem.java      |    46 +
 .../problems/DuplicateScriptProblem.java        |    42 +
 .../problems/DuplicateSkinStateProblem.java     |    53 +
 .../problems/DuplicateSourceFileProblem.java    |    42 +
 .../problems/DuplicateSwitchCaseProblem.java    |    45 +
 .../DuplicateVariableDefinitionProblem.java     |    48 +
 .../problems/DynamicNotOnClassProblem.java      |    42 +
 .../problems/EmbedAS2TagsModifiedProblem.java   |    43 +
 .../EmbedBadScalingGridTargetProblem.java       |    46 +
 ...ouldNotDetermineSampleFrameCountProblem.java |    42 +
 .../EmbedExceptionWhileTranscodingProblem.java  |    40 +
 .../problems/EmbedInitialValueProblem.java      |    37 +
 .../EmbedInvalidAttributeValueProblem.java      |    40 +
 .../EmbedInvalidUnicodeRangeProblem.java        |    40 +
 .../problems/EmbedMissingSymbolProblem.java     |    46 +
 .../EmbedMovieScalingNoSymbolProblem.java       |    41 +
 .../problems/EmbedMultipleMetaTagsProblem.java  |    42 +
 .../problems/EmbedNoSkinClassProblem.java       |    42 +
 .../problems/EmbedNoSourceAttributeProblem.java |    38 +
 .../EmbedOnlyOnClassesAndVarsProblem.java       |    38 +
 .../EmbedQualityRequiresCompressionProblem.java |    39 +
 .../problems/EmbedQualityValueProblem.java      |    41 +
 .../problems/EmbedScalingGridProblem.java       |    40 +
 .../problems/EmbedScalingGridValueProblem.java  |    40 +
 .../problems/EmbedSkinClassNotFoundProblem.java |    42 +
 ...bedSourceAttributeCouldNotBeReadProblem.java |    39 +
 ...EmbedSourceAttributeDoesNotExistProblem.java |    64 +
 .../EmbedSourceFileNotFoundProblem.java         |    37 +
 .../problems/EmbedTypeNotEmbeddableProblem.java |    42 +
 .../EmbedUnableToReadSourceProblem.java         |    42 +
 .../problems/EmbedUnknownAttributeProblem.java  |    37 +
 .../problems/EmbedUnknownMimeTypeProblem.java   |    39 +
 .../EmbedUnrecogniedFileTypeProblem.java        |    37 +
 .../EmbedUnsupportedAttributeProblem.java       |    41 +
 .../EmbedUnsupportedSamplingRateProblem.java    |    44 +
 .../problems/EmbedUnsupportedTypeProblem.java   |    37 +
 ...tDefinitionKeywordAfterAttributeProblem.java |    49 +
 .../ExpectXmlBeforeNamespaceProblem.java        |    46 +
 ...ExtraCharactersAfterEndOfProgramProblem.java |    38 +
 .../ExtraneousSuperStatementProblem.java        |    40 +
 .../FXGChildNodeNotSupportedProblem.java        |    37 +
 .../FXGContentNotContiguousProblem.java         |    37 +
 .../problems/FXGDefinitionNotFoundProblem.java  |    37 +
 .../problems/FXGErrorEmbeddingImageProblem.java |    39 +
 .../problems/FXGInvalidBooleanValueProblem.java |    36 +
 ...XGInvalidChildColorTransformNodeProblem.java |    37 +
 .../FXGInvalidChildMatrixNodeProblem.java       |    35 +
 .../problems/FXGInvalidChildNodeProblem.java    |    38 +
 .../FXGInvalidColorMatrixValueProblem.java      |    36 +
 .../problems/FXGInvalidColorValueProblem.java   |    34 +
 .../FXGInvalidDefinitionNameProblem.java        |    39 +
 .../problems/FXGInvalidDoubleValueProblem.java  |    34 +
 .../problems/FXGInvalidFloatValueProblem.java   |    34 +
 .../FXGInvalidGroupIDAttributeProblem.java      |    36 +
 .../problems/FXGInvalidIntegerValueProblem.java |    34 +
 .../FXGInvalidLibraryElementProblem.java        |    37 +
 .../problems/FXGInvalidMaskElementProblem.java  |    37 +
 .../FXGInvalidNestingElementsProblem.java       |    37 +
 .../FXGInvalidNodeAttributeProblem.java         |    38 +
 .../problems/FXGInvalidPathDataProblem.java     |    33 +
 .../problems/FXGInvalidPercentValueProblem.java |    34 +
 ...validRectRadiusXRadiusYAttributeProblem.java |    33 +
 .../problems/FXGInvalidRootNodeProblem.java     |    35 +
 .../FXGInvalidScaleGridGroupChildProblem.java   |    35 +
 ...nvalidScaleGridRotationAttributeProblem.java |    35 +
 .../problems/FXGInvalidTabStopsProblem.java     |    36 +
 .../problems/FXGInvalidVersionProblem.java      |    37 +
 .../problems/FXGMissingAttributeProblem.java    |    38 +
 .../FXGMissingGroupChildNodeProblem.java        |    37 +
 .../problems/FXGMultipleElementProblem.java     |    37 +
 .../problems/FXGOutOfRangeValueProblem.java     |    38 +
 .../compiler/problems/FXGParserProblem.java     |    36 +
 ...GPrivateElementNotChildOfGraphicProblem.java |    36 +
 .../FXGPrivateElementNotLastProblem.java        |    38 +
 .../flex/compiler/problems/FXGProblem.java      |    50 +
 .../compiler/problems/FXGScanningProblem.java   |    36 +
 .../problems/FXGUndefinedPropertyProblem.java   |    36 +
 .../FXGUnknownAttributeValueProblem.java        |    38 +
 .../FXGUnknownElementInVersionProblem.java      |    39 +
 .../FXGVersionHandlerNotRegisteredProblem.java  |    37 +
 .../flex/compiler/problems/FatalProblem.java    |    47 +
 .../flex/compiler/problems/FileIOProblem.java   |    39 +
 .../problems/FileInLibraryIOProblem.java        |    43 +
 .../problems/FileInLibraryNotFoundProblem.java  |    41 +
 .../compiler/problems/FileNotFoundProblem.java  |    55 +
 .../compiler/problems/FileWriteProblem.java     |    39 +
 .../problems/FinalOutsideClassProblem.java      |    43 +
 ...FlexOnlyConfigurationOptionNotSupported.java |    44 +
 .../problems/FontEmbeddingNotSupported.java     |    42 +
 .../ForwardReferenceToBaseClassProblem.java     |    51 +
 .../FunctionNotMarkedOverrideProblem.java       |    43 +
 .../problems/FunctionWithoutBodyProblem.java    |    39 +
 .../GetterCannotHaveParametersProblem.java      |    38 +
 .../problems/GetterMustNotBeVoidProblem.java    |    35 +
 .../problems/GlobalBindablePropertyProblem.java |    40 +
 .../HostComponentClassNotFoundProblem.java      |    43 +
 .../HostComponentMustHaveTypeProblem.java       |    41 +
 .../compiler/problems/ICompilerProblem.java     |    53 +
 .../IllegalAssignmentToClassProblem.java        |    43 +
 .../IllogicalComparionWithNaNProblem.java       |    36 +
 ...IllogicalComparisonWithUndefinedProblem.java |    35 +
 .../ImplicitCoercionToSubtypeProblem.java       |    45 +
 .../ImplicitCoercionToUnrelatedTypeProblem.java |    44 +
 ...TypeCheckCoercionToUnrelatedTypeProblem.java |    48 +
 .../ImproperlyConfiguredTargetProblem.java      |    53 +
 .../InaccessibleMethodReferenceProblem.java     |    45 +
 .../InaccessiblePropertyReferenceProblem.java   |    45 +
 ...compatibleDefaultValueOfTypeNullProblem.java |    38 +
 .../IncompatibleInitializerTypeProblem.java     |    59 +
 .../IncompatibleInterfaceMethodProblem.java     |    50 +
 .../problems/IncompatibleOverrideProblem.java   |    42 +
 .../IncrementMustBeReferenceProblem.java        |    42 +
 .../InitializerValueNotAnIntegerProblem.java    |    61 +
 .../InitializerValueOutOfRangeProblem.java      |    63 +
 ...neFunctionNotFinalStaticOrGlobalProblem.java |    41 +
 .../problems/InlineFunctionTooLargeProblem.java |    39 +
 ...InlineNestedInliningNotSupportedProblem.java |    35 +
 .../problems/InlineNoSourceProblem.java         |    35 +
 .../InlineUnsupportedInstructionProblem.java    |    35 +
 .../problems/InlineUnsupportedNodeProblem.java  |    40 +
 .../compiler/problems/InstanceOfProblem.java    |    37 +
 .../InterfaceBindablePropertyProblem.java       |    39 +
 .../InterfaceCannotBeInstantiatedProblem.java   |    42 +
 .../InterfaceMethodOverrideProblem.java         |    46 +
 .../InterfaceMethodWithBodyProblem.java         |    41 +
 .../problems/InterfaceModifierProblem.java      |    41 +
 .../InterfaceNamespaceAttributeProblem.java     |    39 +
 .../problems/InternalCompilerProblem.java       |    49 +
 .../problems/InternalCompilerProblem2.java      |    60 +
 .../problems/InvalidABCByteCodeProblem.java     |    35 +
 .../problems/InvalidAttributeProblem.java       |    38 +
 .../problems/InvalidBackgroundColorProblem.java |    36 +
 .../InvalidByteCodeGeneratedProblem.java        |    65 +
 .../problems/InvalidConfigLocationProblem.java  |    51 +
 .../InvalidDecrementOperandProblem.java         |    40 +
 .../InvalidForInInitializerProblem.java         |    42 +
 .../problems/InvalidImportFileProblem.java      |    38 +
 .../InvalidIncrementOperandProblem.java         |    40 +
 .../compiler/problems/InvalidLabelProblem.java  |    38 +
 .../compiler/problems/InvalidLvalueProblem.java |    39 +
 .../InvalidNamespaceInitializerProblem.java     |    39 +
 .../problems/InvalidNamespaceProblem.java       |    41 +
 .../problems/InvalidOverrideProblem.java        |    46 +
 .../InvalidPrivateNamespaceAttrProblem.java     |    42 +
 .../InvalidPrivateNamespaceProblem.java         |    42 +
 .../InvalidProtectedNamespaceAttrProblem.java   |    42 +
 .../InvalidProtectedNamespaceProblem.java       |    41 +
 .../InvalidPublicNamespaceAttrProblem.java      |    42 +
 .../problems/InvalidPublicNamespaceProblem.java |    41 +
 .../InvalidRestParameterDeclarationProblem.java |    44 +
 .../problems/InvalidSuperExpressionProblem.java |    42 +
 .../problems/InvalidSuperStatementProblem.java  |    39 +
 .../compiler/problems/InvalidTypeProblem.java   |    41 +
 .../problems/LibraryNotFoundProblem.java        |    38 +
 .../problems/LocalBindablePropertyProblem.java  |    41 +
 .../problems/LossyConversionProblem.java        |    43 +
 .../problems/MXMLAttributeVersionProblem.java   |    44 +
 .../compiler/problems/MXMLClassNodeProblem.java |    45 +
 .../MXMLConstructorHasParametersProblem.java    |    44 +
 .../MXMLContentAfterRootTagProblem.java         |    38 +
 .../MXMLContentBeforeRootTagProblem.java        |    38 +
 ...MXMLDatabindingSourceNotBindableProblem.java |    47 +
 .../problems/MXMLDualContentProblem.java        |    44 +
 .../problems/MXMLDuplicateAttributeProblem.java |    44 +
 .../problems/MXMLDuplicateChildTagProblem.java  |    44 +
 .../problems/MXMLDuplicateIDProblem.java        |    41 +
 .../problems/MXMLEmptyAttributeProblem.java     |    41 +
 .../problems/MXMLEmptyEventHandlerProblem.java  |    40 +
 ...xecutableStatementsInScriptBlockProblem.java |    40 +
 .../problems/MXMLFinalClassProblem.java         |    46 +
 .../MXMLIncludeInAndExcludeFromProblem.java     |    42 +
 .../MXMLIncompatibleArrayElementProblem.java    |    48 +
 .../MXMLIncompatibleVectorElementProblem.java   |    40 +
 ...MXMLInvalidDatabindingExpressionProblem.java |    37 +
 .../MXMLInvalidDefinitionNameProblem.java       |    44 +
 .../problems/MXMLInvalidEntityProblem.java      |    40 +
 .../compiler/problems/MXMLInvalidIDProblem.java |    42 +
 .../MXMLInvalidItemCreationPolicyProblem.java   |    42 +
 ...MXMLInvalidItemDestructionPolicyProblem.java |    42 +
 .../problems/MXMLInvalidPercentageProblem.java  |    45 +
 .../MXMLInvalidSourceAttributeProblem.java      |    47 +
 .../problems/MXMLInvalidStyleProblem.java       |    55 +
 .../problems/MXMLInvalidTextForTypeProblem.java |    43 +
 .../MXMLInvalidVectorFixedAttributeProblem.java |    42 +
 .../MXMLInvalidVectorTypeAttributeProblem.java  |    44 +
 .../MXMLLibraryTagNotTheFirstChildProblem.java  |    41 +
 .../problems/MXMLMissingRootTagProblem.java     |    36 +
 .../MXMLMissingVectorTypeAttributeProblem.java  |    43 +
 .../problems/MXMLMultipleRootTagsProblem.java   |    38 +
 .../MXMLNoAllowedAttributesProblem.java         |    40 +
 .../compiler/problems/MXMLNotAClassProblem.java |    45 +
 .../MXMLOtherLanguageNamespaceProblem.java      |    38 +
 ...MXMLOuterDocumentAlreadyDeclaredProblem.java |    43 +
 .../MXMLPercentageNotAllowedProblem.java        |    45 +
 .../problems/MXMLPrivateAttributeProblem.java   |    40 +
 .../problems/MXMLPrivateTagLocationProblem.java |    41 +
 .../problems/MXMLRequiredAttributeProblem.java  |    43 +
 ...LSameBindingSourceAndDestinationProblem.java |    38 +
 .../compiler/problems/MXMLSemanticProblem.java  |    47 +
 .../compiler/problems/MXMLSyntaxProblem.java    |    40 +
 .../problems/MXMLUnclosedTagProblem.java        |    56 +
 .../MXMLUnexpectedAttributeProblem.java         |    38 +
 .../MXMLUnexpectedDatabindingProblem.java       |    38 +
 .../problems/MXMLUnexpectedTagProblem.java      |    38 +
 .../problems/MXMLUnexpectedTextProblem.java     |    38 +
 .../problems/MXMLUnknownNamespaceProblem.java   |    45 +
 .../problems/MXMLUnknownXMLFormatProblem.java   |    42 +
 ...XMLUnrecognizedCompilerDirectiveProblem.java |    42 +
 .../problems/MXMLUnresolvedTagProblem.java      |    42 +
 .../problems/MXMLUnterminatedEntityProblem.java |    38 +
 .../MXMLXMLListMixedContentProblem.java         |    38 +
 .../problems/MXMLXMLOnlyOneRootTagProblem.java  |    39 +
 ...XMLProcessingInstructionLocationProblem.java |    42 +
 .../problems/MXMLXMLRequireContentProblem.java  |    38 +
 .../flex/compiler/problems/ManifestProblem.java |    40 +
 .../MethodCannotBeConstructorProblem.java       |    40 +
 .../problems/MissingBuiltinProblem.java         |    48 +
 .../problems/MissingCatchOrFinallyProblem.java  |    45 +
 ...ssingFactoryClassInFrameMetadataProblem.java |    42 +
 ...ssingLeftBraceBeforeFunctionBodyProblem.java |    40 +
 .../problems/MissingPropertyNameProblem.java    |    33 +
 .../MissingRequirementConfigurationProblem.java |    38 +
 .../problems/MissingSignedDigestProblem.java    |    39 +
 .../problems/MissingSkinPartProblem.java        |    40 +
 .../problems/MissingSkinStateProblem.java       |    38 +
 .../problems/MissingUnsignedDigestProblem.java  |    39 +
 ...ltipleConfigNamespaceDecorationsProblem.java |    35 +
 .../MultipleContructorDefinitionsProblem.java   |    39 +
 ...ipleExternallyVisibleDefinitionsProblem.java |    38 +
 .../MultipleNamespaceAttributesProblem.java     |    38 +
 ...tipleReservedNamespaceAttributesProblem.java |    44 +
 .../problems/MultipleSwitchDefaultsProblem.java |    39 +
 .../NamespaceAttributeNotAllowedProblem.java    |    56 +
 .../problems/NamespaceInInterfaceProblem.java   |    39 +
 .../NamespaceOverrideInsideFunctionProblem.java |    37 +
 .../problems/NativeMethodWithBodyProblem.java   |    39 +
 .../problems/NativeNotOnFunctionProblem.java    |    42 +
 .../problems/NativeUsedInInterfaceProblem.java  |    42 +
 .../problems/NativeVariableProblem.java         |    41 +
 .../compiler/problems/NestedClassProblem.java   |    39 +
 .../problems/NestedGetterSetterProblem.java     |    39 +
 .../problems/NestedInterfaceProblem.java        |    39 +
 .../compiler/problems/NestedPackageProblem.java |    38 +
 .../NoCompilationUnitForDefinitionProblem.java  |    35 +
 .../NoDefaultConstructorInBaseClassProblem.java |    42 +
 .../NoDefinitionForSWCDependencyProblem.java    |    44 +
 .../problems/NoMainDefinitionProblem.java       |    46 +
 .../NoScopesInABCCompilationUnitProblem.java    |    34 +
 .../NoSourceForClassInNamespaceProblem.java     |    36 +
 .../problems/NoSourceForClassProblem.java       |    34 +
 .../problems/NonConstConfigVarProblem.java      |    38 +
 .../problems/NonConstantConfigInitProblem.java  |    55 +
 .../NonConstantParamInitializerProblem.java     |    39 +
 .../NonDirectoryInSourcePathProblem.java        |    43 +
 .../NullUsedWhereOtherExpectedProblem.java      |    38 +
 .../OnlyOneHostComponentAllowedProblem.java     |    40 +
 .../problems/OperandStackUnderflowProblem.java  |    46 +
 .../problems/OverlappingSourcePathProblem.java  |    46 +
 .../compiler/problems/OverrideFinalProblem.java |    42 +
 .../problems/OverrideNotFoundProblem.java       |    43 +
 .../problems/OverrideOutsideClassProblem.java   |    44 +
 .../PackageCannotBeUsedAsValueProblem.java      |    43 +
 .../flex/compiler/problems/ParserProblem.java   |    48 +
 .../problems/PropertyIsWriteOnlyProblem.java    |    43 +
 .../PrototypeInvalidAttributeProblem.java       |    39 +
 .../RemovedConfigurationOptionProblem.java      |    44 +
 .../RequiredParameterAfterOptionalProblem.java  |    40 +
 .../ResourceBundleMalformedEncodingProblem.java |    38 +
 .../ResourceBundleNoBundleParameterProblem.java |    41 +
 .../ResourceBundleNoKeyParameterProblem.java    |    38 +
 .../ResourceBundleNotFoundForLocaleProblem.java |    52 +
 .../problems/ResourceBundleNotFoundProblem.java |    51 +
 ...estParamAndArgumentsUsedTogetherProblem.java |    38 +
 .../RestParameterMustBeLastProblem.java         |    41 +
 .../ReturnCannotBeUsedInGlobalProblem.java      |    44 +
 .../ReturnCannotBeUsedInPackageProblem.java     |    43 +
 .../ReturnCannotBeUsedInStaticProblem.java      |    43 +
 .../problems/ReturnMustReturnValueProblem.java  |    40 +
 .../ReturnValueHasNoTypeDeclarationProblem.java |    39 +
 .../ReturnValueInConstructorProblem.java        |    40 +
 .../ReturnValueMustBeUndefinedProblem.java      |    42 +
 ...SMTextSettingsWrongReferenceTypeProblem.java |    40 +
 .../problems/SWFCharacterIDNotFoundProblem.java |    53 +
 ...ontAlignZonesLinkToIncorrectFontProblem.java |    53 +
 .../problems/SWFFrameCountMismatchProblem.java  |    48 +
 .../problems/SWFInvalidSignatureProblem.java    |    40 +
 .../problems/SWFTagLengthTooLongProblem.java    |    57 +
 .../problems/SWFUnableToReadTagBodyProblem.java |    55 +
 .../problems/SWFUnexpectedEndOfFileProblem.java |    42 +
 .../problems/SWFUnknownFillStyleProblem.java    |    53 +
 .../problems/ScopeStackUnderflowProblem.java    |    44 +
 .../ScopedToDefaultNamespaceProblem.java        |    43 +
 .../flex/compiler/problems/SemanticProblem.java |    47 +
 .../problems/SemanticWarningProblem.java        |    38 +
 .../SetterCannotHaveOptionalProblem.java        |    38 +
 .../SetterMustHaveOneParameterProblem.java      |    38 +
 .../ShadowedConfigNamespaceProblem.java         |    40 +
 .../problems/SkinPartsMustBePublicProblem.java  |    41 +
 .../problems/SourcePathNotFoundProblem.java     |    38 +
 .../problems/StaticAndOverrideProblem.java      |    42 +
 .../StaticNamespaceDefinitionProblem.java       |    42 +
 .../problems/StaticOutsideClassProblem.java     |    42 +
 .../problems/StrictSemanticsProblem.java        |    34 +
 .../problems/StrictUndefinedMethodProblem.java  |    44 +
 ...lMustBeTerminatedBeforeLineBreakProblem.java |    42 +
 .../problems/StringLiteralNotClosedProblem.java |    42 +
 .../flex/compiler/problems/SyntaxProblem.java   |    51 +
 .../ThisUsedInStaticFunctionProblem.java        |    43 +
 .../TooFewFunctionParametersProblem.java        |    42 +
 .../TooManyFunctionParametersProblem.java       |    42 +
 .../problems/UnableToBuildReportProblem.java    |    42 +
 .../problems/UnableToBuildSWFProblem.java       |    35 +
 .../problems/UnableToBuildSWFTagProblem.java    |    36 +
 .../UnableToCreateLinkReportProblem.java        |    42 +
 .../UnableToFindRootClassDefinitionProblem.java |    39 +
 .../problems/UnableToListFilesProblem.java      |    41 +
 .../problems/UnboundMetadataProblem.java        |    39 +
 .../problems/UndefinedConfigNameProblem.java    |    40 +
 .../UndefinedConfigNamespaceProblem.java        |    41 +
 .../compiler/problems/UnexpectedEOFProblem.java |    39 +
 .../problems/UnexpectedExceptionProblem.java    |    39 +
 .../problems/UnexpectedReturnProblem.java       |    42 +
 .../problems/UnexpectedTokenProblem.java        |    38 +
 .../problems/UnfoundPropertyProblem.java        |    40 +
 .../UnimplementedInterfaceMethodProblem.java    |    49 +
 .../problems/UnknownBreakTargetProblem.java     |    41 +
 .../problems/UnknownContinueTargetProblem.java  |    41 +
 .../problems/UnknownGotoTargetProblem.java      |    39 +
 .../compiler/problems/UnknownImportProblem.java |    41 +
 .../problems/UnknownInterfaceProblem.java       |    53 +
 .../problems/UnknownNamespaceProblem.java       |    41 +
 .../problems/UnknownSuperclassProblem.java      |    49 +
 .../compiler/problems/UnknownTypeProblem.java   |    42 +
 .../problems/UnknownWildcardImportProblem.java  |    42 +
 .../problems/UnreachableBlockProblem.java       |    45 +
 .../UnresolvedClassReferenceProblem.java        |    41 +
 .../problems/UnresolvedNamespaceProblem.java    |    38 +
 .../problems/UnsupportedSourceFileProblem.java  |    46 +
 .../problems/VarInInterfaceProblem.java         |    42 +
 ...bleDefinitionDuplicatesParameterProblem.java |    52 +
 .../VariableHasNoTypeDeclarationProblem.java    |    45 +
 .../problems/VirtualOutsideClassProblem.java    |    43 +
 .../flex/compiler/problems/VoidTypeProblem.java |    41 +
 .../compiler/problems/WrongSkinPartProblem.java |    44 +
 .../XMLOpenCloseTagNotMatchProblem.java         |    44 +
 .../problems/annotations/DefaultSeverity.java   |    47 +
 .../annotations/ProblemClassification.java      |    48 +
 .../compiler/problems/annotations/package.html  |    28 +
 .../collections/CompositeProblemFilter.java     |   105 +
 .../problems/collections/FilteredIterator.java  |   137 +
 .../compiler/problems/collections/package.html  |    26 +
 .../apache/flex/compiler/problems/package.html  |    50 +
 .../flex/compiler/projects/IASCProject.java     |    28 +
 .../flex/compiler/projects/IASProject.java      |   248 +
 .../compiler/projects/ICompilerProject.java     |   232 +
 .../flex/compiler/projects/IFlexProject.java    |   208 +
 .../flex/compiler/projects/ProjectFactory.java  |    44 +
 .../apache/flex/compiler/projects/package.html  |   170 +
 .../apache/flex/compiler/scopes/IASScope.java   |   115 +
 .../flex/compiler/scopes/IDefinitionSet.java    |    56 +
 .../apache/flex/compiler/scopes/IFileScope.java |    52 +
 .../compiler/scopes/IFileScopeProvider.java     |    42 +
 .../apache/flex/compiler/scopes/package.html    |    62 +
 .../flex/compiler/targets/ISWCTarget.java       |    64 +
 .../flex/compiler/targets/ISWFTarget.java       |    44 +
 .../apache/flex/compiler/targets/ITarget.java   |   102 +
 .../targets/ITargetProgressMonitor.java         |    68 +
 .../flex/compiler/targets/ITargetReport.java    |   120 +
 .../flex/compiler/targets/ITargetSettings.java  |   485 +
 .../compiler/targets/TargetSettingsProxy.java   |   331 +
 .../apache/flex/compiler/targets/package.html   |    61 +
 .../apache/flex/compiler/tree/ASTNodeID.java    |   349 +
 .../apache/flex/compiler/tree/as/IASNode.java   |   133 +
 .../flex/compiler/tree/as/IAccessorNode.java    |    33 +
 .../compiler/tree/as/IBinaryOperatorNode.java   |    55 +
 .../flex/compiler/tree/as/IBlockNode.java       |    34 +
 .../flex/compiler/tree/as/ICatchNode.java       |    57 +
 .../flex/compiler/tree/as/IClassNode.java       |   105 +
 .../flex/compiler/tree/as/ICommonClassNode.java |    74 +
 .../tree/as/ICompoundAssignmentNode.java        |    71 +
 .../flex/compiler/tree/as/IConditionalNode.java |    34 +
 .../flex/compiler/tree/as/IContainerNode.java   |    88 +
 .../tree/as/IDefaultXMLNamespaceNode.java       |    57 +
 .../flex/compiler/tree/as/IDefinitionNode.java  |   154 +
 .../tree/as/IDocumentableDefinitionNode.java    |    46 +
 .../compiler/tree/as/IDynamicAccessNode.java    |    40 +
 .../flex/compiler/tree/as/IEmbedNode.java       |    57 +
 .../flex/compiler/tree/as/IExpressionNode.java  |    88 +
 .../apache/flex/compiler/tree/as/IFileNode.java |   115 +
 .../compiler/tree/as/IFileNodeAccumulator.java  |    83 +
 .../flex/compiler/tree/as/IForLoopNode.java     |   119 +
 .../compiler/tree/as/IFunctionCallNode.java     |   146 +
 .../flex/compiler/tree/as/IFunctionNode.java    |   187 +
 .../compiler/tree/as/IFunctionObjectNode.java   |    36 +
 .../flex/compiler/tree/as/IGetterNode.java      |    28 +
 .../flex/compiler/tree/as/IIdentifierNode.java  |    82 +
 .../apache/flex/compiler/tree/as/IIfNode.java   |   120 +
 .../flex/compiler/tree/as/IImportNode.java      |   115 +
 .../flex/compiler/tree/as/IInterfaceNode.java   |   133 +
 .../compiler/tree/as/IIterationFlowNode.java    |    74 +
 .../flex/compiler/tree/as/IKeywordNode.java     |    42 +
 .../compiler/tree/as/ILabeledStatementNode.java |    38 +
 .../tree/as/ILanguageIdentifierNode.java        |    77 +
 .../compiler/tree/as/ILiteralContainerNode.java |    41 +
 .../flex/compiler/tree/as/ILiteralNode.java     |   187 +
 .../tree/as/IMemberAccessExpressionNode.java    |    46 +
 .../flex/compiler/tree/as/IModifierNode.java    |    44 +
 .../tree/as/INamespaceAccessExpressionNode.java |    27 +
 .../tree/as/INamespaceDecorationNode.java       |    50 +
 .../flex/compiler/tree/as/INamespaceNode.java   |    71 +
 .../tree/as/INonResolvingIdentifierNode.java    |    28 +
 .../compiler/tree/as/INumericLiteralNode.java   |   111 +
 .../tree/as/IObjectLiteralValuePairNode.java    |    58 +
 .../flex/compiler/tree/as/IOperatorNode.java    |   395 +
 .../flex/compiler/tree/as/IPackageNode.java     |    59 +
 .../flex/compiler/tree/as/IParameterNode.java   |    76 +
 .../compiler/tree/as/IRegExpLiteralNode.java    |   118 +
 .../flex/compiler/tree/as/IReturnNode.java      |    47 +
 .../compiler/tree/as/IScopedDefinitionNode.java |    36 +
 .../flex/compiler/tree/as/IScopedNode.java      |    62 +
 .../flex/compiler/tree/as/ISetterNode.java      |    28 +
 .../flex/compiler/tree/as/IStatementNode.java   |    45 +
 .../flex/compiler/tree/as/ISwitchNode.java      |    85 +
 .../flex/compiler/tree/as/ITerminalNode.java    |   121 +
 .../compiler/tree/as/ITernaryOperatorNode.java  |    66 +
 .../flex/compiler/tree/as/IThrowNode.java       |    45 +
 .../tree/as/ITransparentContainerNode.java      |    29 +
 .../apache/flex/compiler/tree/as/ITryNode.java  |    98 +
 .../apache/flex/compiler/tree/as/ITypeNode.java |    29 +
 .../flex/compiler/tree/as/ITypedClassNode.java  |    53 +
 .../compiler/tree/as/ITypedExpressionNode.java  |    62 +
 .../flex/compiler/tree/as/ITypedNode.java       |    60 +
 .../compiler/tree/as/IUnaryOperatorNode.java    |    44 +
 .../compiler/tree/as/IUseNamespaceNode.java     |    51 +
 .../tree/as/IVariableExpressionNode.java        |    33 +
 .../flex/compiler/tree/as/IVariableNode.java    |   125 +
 .../flex/compiler/tree/as/IWhileLoopNode.java   |   107 +
 .../apache/flex/compiler/tree/as/IWithNode.java |    55 +
 .../as/decorators/IVariableTypeDecorator.java   |    46 +
 .../as/decorators/SymbolDecoratorProvider.java  |    89 +
 .../tree/metadata/IAccessibilityTagNode.java    |    28 +
 .../tree/metadata/IDefaultPropertyTagNode.java  |    39 +
 .../compiler/tree/metadata/IEffectTagNode.java  |    37 +
 .../compiler/tree/metadata/IEventTagNode.java   |    31 +
 .../tree/metadata/IEventTriggerTagNode.java     |    27 +
 .../tree/metadata/IInspectableTagNode.java      |    61 +
 .../compiler/tree/metadata/IMetaTagNode.java    |    52 +
 .../compiler/tree/metadata/IMetaTagsNode.java   |    84 +
 .../tree/metadata/IMultiValueMetaTagNode.java   |    32 +
 .../tree/metadata/IResourceBundleTagNode.java   |    28 +
 .../compiler/tree/metadata/IStyleTagNode.java   |    35 +
 .../compiler/tree/metadata/ITypedTagNode.java   |    28 +
 .../tree/mxml/IMXMLApplicationNode.java         |    58 +
 .../flex/compiler/tree/mxml/IMXMLArrayNode.java |    27 +
 .../tree/mxml/IMXMLBindingAttributeNode.java    |    39 +
 .../compiler/tree/mxml/IMXMLBindingNode.java    |    45 +
 .../compiler/tree/mxml/IMXMLBooleanNode.java    |    42 +
 .../tree/mxml/IMXMLClassDefinitionNode.java     |   162 +
 .../flex/compiler/tree/mxml/IMXMLClassNode.java |    45 +
 .../tree/mxml/IMXMLClassReferenceNode.java      |   134 +
 .../flex/compiler/tree/mxml/IMXMLClearNode.java |    27 +
 .../mxml/IMXMLCompilerDirectiveNodeBase.java    |    35 +
 .../compiler/tree/mxml/IMXMLComponentNode.java  |    53 +
 .../mxml/IMXMLConcatenatedDataBindingNode.java  |    36 +
 .../tree/mxml/IMXMLDataBindingNode.java         |    27 +
 .../mxml/IMXMLDataBindingNodeContainer.java     |    27 +
 .../tree/mxml/IMXMLDeclarationsNode.java        |    38 +
 .../tree/mxml/IMXMLDeferredInstanceNode.java    |    48 +
 .../compiler/tree/mxml/IMXMLDefinitionNode.java |    59 +
 .../tree/mxml/IMXMLDesignLayerNode.java         |   122 +
 .../compiler/tree/mxml/IMXMLDocumentNode.java   |    27 +
 .../tree/mxml/IMXMLEffectSpecifierNode.java     |    35 +
 .../flex/compiler/tree/mxml/IMXMLEmbedNode.java |    27 +
 .../tree/mxml/IMXMLEventSpecifierNode.java      |    58 +
 .../compiler/tree/mxml/IMXMLExpressionNode.java |    47 +
 .../compiler/tree/mxml/IMXMLFactoryNode.java    |    38 +
 .../flex/compiler/tree/mxml/IMXMLFileNode.java  |    72 +
 .../compiler/tree/mxml/IMXMLFunctionNode.java   |    41 +
 .../tree/mxml/IMXMLHTTPServiceNode.java         |    39 +
 .../IMXMLHTTPServiceRequestPropertyNode.java    |    27 +
 .../compiler/tree/mxml/IMXMLImplementsNode.java |    42 +
 .../compiler/tree/mxml/IMXMLInstanceNode.java   |    94 +
 .../flex/compiler/tree/mxml/IMXMLIntNode.java   |    41 +
 .../compiler/tree/mxml/IMXMLLibraryNode.java    |    34 +
 .../compiler/tree/mxml/IMXMLLiteralNode.java    |    37 +
 .../compiler/tree/mxml/IMXMLMetadataNode.java   |    39 +
 .../flex/compiler/tree/mxml/IMXMLModelNode.java |    37 +
 .../mxml/IMXMLModelPropertyContainerNode.java   |    68 +
 .../tree/mxml/IMXMLModelPropertyNode.java       |    35 +
 .../compiler/tree/mxml/IMXMLModelRootNode.java  |    31 +
 .../flex/compiler/tree/mxml/IMXMLNode.java      |    76 +
 .../compiler/tree/mxml/IMXMLNumberNode.java     |    42 +
 .../compiler/tree/mxml/IMXMLObjectNode.java     |    27 +
 .../compiler/tree/mxml/IMXMLPrivateNode.java    |    29 +
 .../tree/mxml/IMXMLPropertySpecifierNode.java   |    51 +
 .../compiler/tree/mxml/IMXMLRegExpNode.java     |    27 +
 .../tree/mxml/IMXMLRemoteObjectMethodNode.java  |    39 +
 .../tree/mxml/IMXMLRemoteObjectNode.java        |    39 +
 .../compiler/tree/mxml/IMXMLReparentNode.java   |    52 +
 .../compiler/tree/mxml/IMXMLRepeaterNode.java   |    32 +
 .../compiler/tree/mxml/IMXMLResourceNode.java   |    53 +
 .../compiler/tree/mxml/IMXMLScriptNode.java     |    55 +
 .../tree/mxml/IMXMLSingleDataBindingNode.java   |    40 +
 .../compiler/tree/mxml/IMXMLSpecifierNode.java  |    51 +
 .../flex/compiler/tree/mxml/IMXMLStateNode.java |    46 +
 .../compiler/tree/mxml/IMXMLStringNode.java     |    41 +
 .../flex/compiler/tree/mxml/IMXMLStyleNode.java |    43 +
 .../tree/mxml/IMXMLStyleSpecifierNode.java      |    32 +
 .../flex/compiler/tree/mxml/IMXMLUintNode.java  |    41 +
 .../compiler/tree/mxml/IMXMLVectorNode.java     |    46 +
 .../compiler/tree/mxml/IMXMLWebServiceNode.java |    39 +
 .../tree/mxml/IMXMLWebServiceOperationNode.java |    39 +
 .../compiler/tree/mxml/IMXMLXMLListNode.java    |    41 +
 .../flex/compiler/tree/mxml/IMXMLXMLNode.java   |    56 +
 .../compiler/tree/mxml/IOldMXMLFileNode.java    |    39 +
 .../apache/flex/compiler/tree/mxml/package.html |    19 +
 .../org/apache/flex/compiler/tree/package.html  |    73 +
 .../properties/IResourceBundleEntryNode.java    |    44 +
 .../properties/IResourceBundleFileNode.java     |    46 +
 .../flex/compiler/units/ICompilationUnit.java   |   264 +
 .../units/IInvisibleCompilationUnit.java        |    64 +
 .../org/apache/flex/compiler/units/package.html |   116 +
 .../units/requests/IABCBytesRequestResult.java  |    53 +
 .../units/requests/IFileScopeRequestResult.java |    62 +
 .../IOutgoingDependenciesRequestResult.java     |    32 +
 .../flex/compiler/units/requests/IRequest.java  |    71 +
 .../compiler/units/requests/IRequestResult.java |    34 +
 .../units/requests/ISWFTagsRequestResult.java   |    46 +
 .../requests/ISyntaxTreeRequestResult.java      |    57 +
 .../flex/compiler/units/requests/package.html   |    81 +
 .../compiler/workspaces/IIndexingReader.java    |    33 +
 .../workspaces/IInvalidationListener.java       |    80 +
 .../flex/compiler/workspaces/IWorkspace.java    |   211 +
 .../workspaces/IWorkspaceProfilingDelegate.java |    57 +
 .../flex/compiler/workspaces/package.html       |    44 +
 .../src/main/java/org/apache/flex/swc/ISWC.java |   101 +
 .../java/org/apache/flex/swc/ISWCComponent.java |    64 +
 .../java/org/apache/flex/swc/ISWCDigest.java    |    48 +
 .../java/org/apache/flex/swc/ISWCFileEntry.java |    58 +
 .../java/org/apache/flex/swc/ISWCLibrary.java   |   105 +
 .../java/org/apache/flex/swc/ISWCManager.java   |    78 +
 .../java/org/apache/flex/swc/ISWCScript.java    |    94 +
 .../java/org/apache/flex/swc/ISWCVersion.java   |   105 +
 .../src/main/java/org/apache/flex/swc/SWC.java  |   218 +
 .../java/org/apache/flex/swc/SWCComponent.java  |   130 +
 .../java/org/apache/flex/swc/SWCDepends.java    |   733 +
 .../java/org/apache/flex/swc/SWCDigest.java     |   106 +
 .../java/org/apache/flex/swc/SWCLibrary.java    |   191 +
 .../java/org/apache/flex/swc/SWCManager.java    |   177 +
 .../java/org/apache/flex/swc/SWCScript.java     |   179 +
 .../java/org/apache/flex/swc/SWCVersion.java    |   183 +
 .../flex/swc/catalog/ICatalogXMLConstants.java  |    66 +
 .../apache/flex/swc/catalog/SWCFileEntry.java   |    70 +
 .../flex/swc/catalog/StAXCatalogReader.java     |   251 +
 .../flex/swc/catalog/StAXCatalogWriter.java     |   379 +
 .../apache/flex/swc/catalog/XMLFormatter.java   |   310 +
 .../org/apache/flex/swc/catalog/package.html    |    27 +
 .../org/apache/flex/swc/dita/IDITAEntry.java    |    42 +
 .../org/apache/flex/swc/dita/IDITAList.java     |    57 +
 .../java/org/apache/flex/swc/dita/package.html  |    31 +
 .../java/org/apache/flex/swc/io/ISWCReader.java |    44 +
 .../java/org/apache/flex/swc/io/ISWCWriter.java |    38 +
 .../apache/flex/swc/io/SWCDirectoryWriter.java  |   155 +
 .../java/org/apache/flex/swc/io/SWCReader.java  |   222 +
 .../java/org/apache/flex/swc/io/SWCWriter.java  |   147 +
 .../org/apache/flex/swc/io/SWCWriterBase.java   |   252 +
 .../java/org/apache/flex/swc/io/package.html    |    31 +
 .../main/java/org/apache/flex/swc/package.html  |    43 +
 .../main/java/org/apache/flex/swf/Header.java   |   239 +
 .../src/main/java/org/apache/flex/swf/ISWF.java |   281 +
 .../java/org/apache/flex/swf/ISWFConstants.java |    42 +
 .../java/org/apache/flex/swf/ITagContainer.java |    33 +
 .../src/main/java/org/apache/flex/swf/SWF.java  |   334 +
 .../main/java/org/apache/flex/swf/SWFFrame.java |   286 +
 .../main/java/org/apache/flex/swf/TagType.java  |   137 +
 .../flex/swf/builders/IShapeIterator.java       |    38 +
 .../apache/flex/swf/builders/ITagBuilder.java   |    30 +
 .../apache/flex/swf/builders/ShapeBuilder.java  |   751 +
 .../org/apache/flex/swf/builders/package.html   |    26 +
 .../org/apache/flex/swf/io/IInputBitStream.java |   214 +
 .../apache/flex/swf/io/IOutputBitStream.java    |   223 +
 .../java/org/apache/flex/swf/io/ISWFReader.java |    43 +
 .../java/org/apache/flex/swf/io/ISWFWriter.java |    49 +
 .../apache/flex/swf/io/ISWFWriterFactory.java   |    34 +
 .../org/apache/flex/swf/io/InputBitStream.java  |   381 +
 .../org/apache/flex/swf/io/LZMACompressor.java  |   169 +
 .../org/apache/flex/swf/io/LZMAInputStream.java |    94 +
 .../org/apache/flex/swf/io/OutputBitStream.java |   382 +
 .../java/org/apache/flex/swf/io/SWFDump.java    |  2594 ++
 .../java/org/apache/flex/swf/io/SWFReader.java  |  2989 ++
 .../java/org/apache/flex/swf/io/SWFWriter.java  |  2718 ++
 .../java/org/apache/flex/swf/io/SizeReport.java |   308 +
 .../flex/swf/io/SizeReportWritingSWFWriter.java |   477 +
 .../java/org/apache/flex/swf/io/package.html    |    31 +
 .../main/java/org/apache/flex/swf/package.html  |    42 +
 .../flex/swf/tags/CSMTextSettingsTag.java       |   140 +
 .../flex/swf/tags/CharacterIterableFactory.java |   237 +
 .../org/apache/flex/swf/tags/CharacterTag.java  |    55 +
 .../flex/swf/tags/DefineBinaryDataTag.java      |    72 +
 .../flex/swf/tags/DefineBitsJPEG2Tag.java       |    49 +
 .../flex/swf/tags/DefineBitsJPEG3Tag.java       |   106 +
 .../flex/swf/tags/DefineBitsLossless2Tag.java   |    44 +
 .../flex/swf/tags/DefineBitsLosslessTag.java    |   139 +
 .../org/apache/flex/swf/tags/DefineBitsTag.java |    79 +
 .../apache/flex/swf/tags/DefineButton2Tag.java  |    74 +
 .../flex/swf/tags/DefineButtonCxformTag.java    |    84 +
 .../flex/swf/tags/DefineButtonSoundTag.java     |   103 +
 .../apache/flex/swf/tags/DefineButtonTag.java   |    96 +
 .../apache/flex/swf/tags/DefineEditTextTag.java |   614 +
 .../apache/flex/swf/tags/DefineFont2Tag.java    |   407 +
 .../apache/flex/swf/tags/DefineFont3Tag.java    |    64 +
 .../apache/flex/swf/tags/DefineFont4Tag.java    |   144 +
 .../flex/swf/tags/DefineFontAlignZonesTag.java  |   109 +
 .../flex/swf/tags/DefineFontInfo2Tag.java       |    60 +
 .../apache/flex/swf/tags/DefineFontInfoTag.java |   199 +
 .../apache/flex/swf/tags/DefineFontNameTag.java |    98 +
 .../org/apache/flex/swf/tags/DefineFontTag.java |   104 +
 .../flex/swf/tags/DefineMorphShape2Tag.java     |   138 +
 .../flex/swf/tags/DefineMorphShapeTag.java      |   179 +
 .../flex/swf/tags/DefineScalingGridTag.java     |   101 +
 .../tags/DefineSceneAndFrameLabelDataTag.java   |    69 +
 .../apache/flex/swf/tags/DefineShape2Tag.java   |    48 +
 .../apache/flex/swf/tags/DefineShape3Tag.java   |    48 +
 .../apache/flex/swf/tags/DefineShape4Tag.java   |    87 +
 .../apache/flex/swf/tags/DefineShapeTag.java    |    90 +
 .../apache/flex/swf/tags/DefineSoundTag.java    |   144 +
 .../apache/flex/swf/tags/DefineSpriteTag.java   |    89 +
 .../apache/flex/swf/tags/DefineText2Tag.java    |    44 +
 .../org/apache/flex/swf/tags/DefineTextTag.java |   163 +
 .../flex/swf/tags/DefineVideoStreamTag.java     |   142 +
 .../java/org/apache/flex/swf/tags/DoABCTag.java |   127 +
 .../flex/swf/tags/EnableDebugger2Tag.java       |    70 +
 .../flex/swf/tags/EnableTelemetryTag.java       |    58 +
 .../java/org/apache/flex/swf/tags/EndTag.java   |    36 +
 .../apache/flex/swf/tags/ExportAssetsTag.java   |   178 +
 .../apache/flex/swf/tags/FileAttributesTag.java |   132 +
 .../org/apache/flex/swf/tags/FrameLabelTag.java |   105 +
 .../apache/flex/swf/tags/IAlwaysLongTag.java    |    29 +
 .../flex/swf/tags/ICharacterReferrer.java       |    34 +
 .../org/apache/flex/swf/tags/ICharacterTag.java |    34 +
 .../flex/swf/tags/IDefineBinaryImageTag.java    |    32 +
 .../apache/flex/swf/tags/IDefineFontTag.java    |    41 +
 .../org/apache/flex/swf/tags/IFontInfo.java     |   123 +
 .../org/apache/flex/swf/tags/IManagedTag.java   |    30 +
 .../java/org/apache/flex/swf/tags/ITag.java     |    35 +
 .../org/apache/flex/swf/tags/JPEGTablesTag.java |    62 +
 .../org/apache/flex/swf/tags/MetadataTag.java   |    76 +
 .../apache/flex/swf/tags/PlaceObject2Tag.java   |   241 +
 .../apache/flex/swf/tags/PlaceObject3Tag.java   |   221 +
 .../apache/flex/swf/tags/PlaceObjectTag.java    |   108 +
 .../apache/flex/swf/tags/ProductInfoTag.java    |   217 +
 .../java/org/apache/flex/swf/tags/RawTag.java   |    70 +
 .../apache/flex/swf/tags/RemoveObject2Tag.java  |    57 +
 .../apache/flex/swf/tags/RemoveObjectTag.java   |    81 +
 .../apache/flex/swf/tags/ScriptLimitsTag.java   |    75 +
 .../flex/swf/tags/SetBackgroundColorTag.java    |    67 +
 .../apache/flex/swf/tags/SetTabIndexTag.java    |    90 +
 .../org/apache/flex/swf/tags/ShowFrameTag.java  |    39 +
 .../flex/swf/tags/SoundStreamBlockTag.java      |    61 +
 .../flex/swf/tags/SoundStreamHead2Tag.java      |    39 +
 .../flex/swf/tags/SoundStreamHeadTag.java       |   227 +
 .../apache/flex/swf/tags/StartSound2Tag.java    |    82 +
 .../org/apache/flex/swf/tags/StartSoundTag.java |    84 +
 .../apache/flex/swf/tags/SymbolClassTag.java    |   151 +
 .../main/java/org/apache/flex/swf/tags/Tag.java |    75 +
 .../org/apache/flex/swf/tags/VideoFrameTag.java |   110 +
 .../java/org/apache/flex/swf/tags/package.html  |    30 +
 .../java/org/apache/flex/swf/types/ARGB.java    |    40 +
 .../org/apache/flex/swf/types/BevelFilter.java  |   231 +
 .../org/apache/flex/swf/types/BlurFilter.java   |    83 +
 .../org/apache/flex/swf/types/ButtonRecord.java |   243 +
 .../java/org/apache/flex/swf/types/CXForm.java  |   100 +
 .../apache/flex/swf/types/CXFormWithAlpha.java  |    60 +
 .../org/apache/flex/swf/types/ClipActions.java  |    31 +
 .../flex/swf/types/ConvolutionFilter.java       |   172 +
 .../apache/flex/swf/types/CurvedEdgeRecord.java |    98 +
 .../apache/flex/swf/types/DropShadowFilter.java |   208 +
 .../org/apache/flex/swf/types/EdgeRecord.java   |    44 +
 .../apache/flex/swf/types/EndShapeRecord.java   |    32 +
 .../org/apache/flex/swf/types/FillStyle.java    |   157 +
 .../apache/flex/swf/types/FillStyleArray.java   |    58 +
 .../java/org/apache/flex/swf/types/Filter.java  |   228 +
 .../apache/flex/swf/types/FocalGradient.java    |    54 +
 .../org/apache/flex/swf/types/GlowFilter.java   |   165 +
 .../org/apache/flex/swf/types/GlyphEntry.java   |    85 +
 .../org/apache/flex/swf/types/GradRecord.java   |    51 +
 .../org/apache/flex/swf/types/Gradient.java     |    96 +
 .../flex/swf/types/GradientBevelFilter.java     |    83 +
 .../flex/swf/types/GradientGlowFilter.java      |   135 +
 .../org/apache/flex/swf/types/IDataType.java    |    28 +
 .../org/apache/flex/swf/types/IFillStyle.java   |    30 +
 .../org/apache/flex/swf/types/ILineStyle.java   |    28 +
 .../apache/flex/swf/types/KerningRecord.java    |    83 +
 .../org/apache/flex/swf/types/LineStyle.java    |    67 +
 .../org/apache/flex/swf/types/LineStyle2.java   |   156 +
 .../apache/flex/swf/types/LineStyleArray.java   |    46 +
 .../java/org/apache/flex/swf/types/Matrix.java  |   124 +
 .../apache/flex/swf/types/MorphFillStyle.java   |   277 +
 .../apache/flex/swf/types/MorphGradRecord.java  |   112 +
 .../apache/flex/swf/types/MorphGradient.java    |    30 +
 .../apache/flex/swf/types/MorphLineStyle.java   |   112 +
 .../apache/flex/swf/types/MorphLineStyle2.java  |   265 +
 .../java/org/apache/flex/swf/types/RGB.java     |    95 +
 .../java/org/apache/flex/swf/types/RGBA.java    |    85 +
 .../java/org/apache/flex/swf/types/Rect.java    |   103 +
 .../java/org/apache/flex/swf/types/Shape.java   |   115 +
 .../org/apache/flex/swf/types/ShapeRecord.java  |    82 +
 .../apache/flex/swf/types/ShapeWithStyle.java   |    77 +
 .../apache/flex/swf/types/SoundEnvelope.java    |    80 +
 .../org/apache/flex/swf/types/SoundInfo.java    |   221 +
 .../flex/swf/types/StraightEdgeRecord.java      |   109 +
 .../flex/swf/types/StyleChangeRecord.java       |   453 +
 .../java/org/apache/flex/swf/types/Styles.java  |    86 +
 .../org/apache/flex/swf/types/TextRecord.java   |   237 +
 .../org/apache/flex/swf/types/ZoneData.java     |    44 +
 .../org/apache/flex/swf/types/ZoneRecord.java   |   104 +
 .../java/org/apache/flex/swf/types/package.html |    31 +
 .../org/apache/flex/utils/ArgumentUtil.java     |   214 +
 .../main/java/org/apache/flex/utils/Base64.java |   306 +
 .../java/org/apache/flex/utils/CheapArray.java  |   268 +
 .../flex/utils/DAByteArrayOutputStream.java     |    51 +
 .../java/org/apache/flex/utils/DirectoryID.java |    48 +
 .../org/apache/flex/utils/ExceptionUtil.java    |   208 +
 .../java/org/apache/flex/utils/FastStack.java   |   109 +
 .../main/java/org/apache/flex/utils/FileID.java |    99 +
 .../java/org/apache/flex/utils/FileUtils.java   |   214 +
 .../flex/utils/FilenameNormalization.java       |   109 +
 .../apache/flex/utils/ILengthAwareReader.java   |    49 +
 .../main/java/org/apache/flex/utils/IntMap.java |   234 +
 .../org/apache/flex/utils/IntMapLRUCache.java   |   313 +
 .../flex/utils/NonLockingStringReader.java      |    49 +
 .../main/java/org/apache/flex/utils/Point.java  |    41 +
 .../org/apache/flex/utils/StringEncoder.java    |    93 +
 .../java/org/apache/flex/utils/StringUtils.java |   105 +
 .../main/java/org/apache/flex/utils/Trace.java  |   146 +
 .../java/org/apache/flex/utils/Version.java     |   261 +
 .../java/org/apache/flex/utils/package.html     |    32 +
 .../compiler/internal/as/codegen/CmcEmitter.jbg |   245 +
 .../internal/as/codegen/CmcPatterns.jbg         |  1001 +
 .../compiler/internal/as/codegen/CmcRules.jbg   |  1258 +
 .../as/codegen/CompoundAssignmentPatterns.jbg   |    39 +
 .../as/codegen/CompoundAssignmentRules.jbg      |    49 +
 .../codegen/CompoundLogicalAssignmentRules.jbg  |    52 +
 .../internal/as/codegen/ConstantArithmetic.jbg  |   257 +
 .../internal/as/codegen/ConstantLogic.jbg       |   253 +
 .../internal/as/codegen/FunctionPatterns.jbg    |    28 +
 .../internal/as/codegen/FunctionRules.jbg       |    36 +
 .../internal/as/codegen/SemanticErrors.jbg      |    59 +
 .../internal/css/codegen/CSSEmitter.jbg         |    58 +
 .../internal/css/codegen/CSSPatterns.jbg        |    82 +
 .../compiler/internal/css/codegen/CSSRules.jbg  |    57 +
 .../internal/parsing/as/RawASDocTokenizer.lex   |   234 +
 .../internal/parsing/as/RawASTokenizer.lex      |  1325 +
 .../internal/parsing/as/skeleton.default        |   349 +
 .../internal/parsing/as/skeleton.falcon         |   398 +
 .../internal/parsing/mxml/RawMXMLTokenizer.lex  |   560 +
 .../org.apache.flex.tools.FlexToolGroup         |     1 +
 .../apache/flex/compiler/messages_en.properties |   350 +
 .../apache/flex/compiler/messages_fr.properties |   716 +
 .../apache/flex/compiler/messages_ja.properties |   716 +
 .../flex/compiler/messages_zh_CN.properties     |   716 +
 compiler/src/main/resources/overview.html       |    53 +
 .../as/codegen/UnknownTreeHandlerPatterns.xml   |    68 +
 .../src/org/apache/flex/abc/ABCConstants.java   |   643 -
 .../src/org/apache/flex/abc/ABCEmitter.java     |  2063 --
 compiler/src/org/apache/flex/abc/ABCLinker.java |   779 -
 compiler/src/org/apache/flex/abc/ABCParser.java |  1280 -
 compiler/src/org/apache/flex/abc/ABCReader.java |    84 -
 .../apache/flex/abc/ClassDependencySort.java    |   173 -
 .../org/apache/flex/abc/EntryOrderedStore.java  |    82 -
 compiler/src/org/apache/flex/abc/Pool.java      |   172 -
 .../org/apache/flex/abc/PoolingABCVisitor.java  |   635 -
 .../diagnostics/AbstractDiagnosticVisitor.java  |    71 -
 .../abc/diagnostics/DiagnosticsAggregator.java  |   219 -
 .../apache/flex/abc/diagnostics/package.html    |    34 -
 .../org/apache/flex/abc/graph/IBasicBlock.java  |    64 -
 .../org/apache/flex/abc/graph/IFlowgraph.java   |   145 -
 .../algorithms/DepthFirstPreorderIterator.java  |   145 -
 .../abc/graph/algorithms/DominatorTree.java     |   413 -
 .../flex/abc/graph/algorithms/package.html      |    28 -
 .../src/org/apache/flex/abc/graph/package.html  |    33 -
 .../abc/instructionlist/InstructionList.java    |  1251 -
 .../flex/abc/instructionlist/package.html       |    27 -
 .../flex/abc/models/FrameModelEncoder.java      |   652 -
 .../flex/abc/models/FrameModelVisitor.java      |   196 -
 .../flex/abc/models/TreeModelEncoder.java       |  1101 -
 .../flex/abc/models/TreeModelVisitor.java       |   149 -
 .../src/org/apache/flex/abc/models/package.html |    29 -
 .../flex/abc/optimize/DeadCodeFilter.java       |   156 -
 .../PeepholeOptimizerMethodBodyVisitor.java     |  1520 -
 .../org/apache/flex/abc/optimize/package.html   |    36 -
 compiler/src/org/apache/flex/abc/package.html   |    41 -
 .../apache/flex/abc/print/ABCDumpVisitor.java   |  1095 -
 .../src/org/apache/flex/abc/print/package.html  |    27 -
 .../semantics/ArbitraryOperandsInstruction.java |   118 -
 .../org/apache/flex/abc/semantics/Block.java    |   140 -
 .../apache/flex/abc/semantics/ClassInfo.java    |    39 -
 .../flex/abc/semantics/ControlFlowGraph.java    |   580 -
 .../apache/flex/abc/semantics/ECMASupport.java  |   895 -
 .../flex/abc/semantics/ExceptionInfo.java       |   139 -
 .../flex/abc/semantics/FrameCountVisitor.java   |   534 -
 .../semantics/ImmediateOperandInstruction.java  |   112 -
 .../apache/flex/abc/semantics/InstanceInfo.java |    85 -
 .../apache/flex/abc/semantics/Instruction.java  |   313 -
 .../flex/abc/semantics/InstructionFactory.java  |   351 -
 .../org/apache/flex/abc/semantics/Label.java    |   167 -
 .../org/apache/flex/abc/semantics/Metadata.java |   159 -
 .../flex/abc/semantics/MethodBodyInfo.java      |   394 -
 .../apache/flex/abc/semantics/MethodInfo.java   |   210 -
 .../src/org/apache/flex/abc/semantics/Name.java |   571 -
 .../apache/flex/abc/semantics/Namespace.java    |   246 -
 .../abc/semantics/NoOperandsInstruction.java    |    36 -
 .../org/apache/flex/abc/semantics/Nsset.java    |   167 -
 .../abc/semantics/OneOperandInstruction.java    |   105 -
 .../apache/flex/abc/semantics/PooledValue.java  |   176 -
 .../apache/flex/abc/semantics/ScriptInfo.java   |    77 -
 .../org/apache/flex/abc/semantics/Trait.java    |   337 -
 .../org/apache/flex/abc/semantics/Traits.java   |   107 -
 .../org/apache/flex/abc/semantics/package.html  |    27 -
 .../flex/abc/visitors/DelegatingABCVisitor.java |   125 -
 .../abc/visitors/DelegatingClassVisitor.java    |    60 -
 .../abc/visitors/DelegatingMetadataVisitor.java |    42 -
 .../visitors/DelegatingMethodBodyVisitor.java   |   110 -
 .../abc/visitors/DelegatingMethodVisitor.java   |    54 -
 .../abc/visitors/DelegatingScriptVisitor.java   |    60 -
 .../abc/visitors/DelegatingTraitVisitor.java    |    59 -
 .../abc/visitors/DelegatingTraitsVisitor.java   |    75 -
 .../apache/flex/abc/visitors/IABCVisitor.java   |   132 -
 .../apache/flex/abc/visitors/IClassVisitor.java |    49 -
 .../flex/abc/visitors/IDiagnosticsVisitor.java  |   118 -
 .../flex/abc/visitors/IFlowGraphVisitor.java    |    53 -
 .../flex/abc/visitors/IMetadataVisitor.java     |    37 -
 .../flex/abc/visitors/IMethodBodyVisitor.java   |   118 -
 .../flex/abc/visitors/IMethodVisitor.java       |    42 -
 .../flex/abc/visitors/IScriptVisitor.java       |    48 -
 .../apache/flex/abc/visitors/ITraitVisitor.java |    51 -
 .../flex/abc/visitors/ITraitsVisitor.java       |    73 -
 .../org/apache/flex/abc/visitors/IVisitor.java  |    37 -
 .../apache/flex/abc/visitors/NilABCVisitor.java |   102 -
 .../flex/abc/visitors/NilClassVisitor.java      |    48 -
 .../abc/visitors/NilDiagnosticsVisitor.java     |    32 -
 .../flex/abc/visitors/NilMetadataVisitor.java   |    33 -
 .../flex/abc/visitors/NilMethodBodyVisitor.java |    97 -
 .../flex/abc/visitors/NilMethodVisitor.java     |    44 -
 .../flex/abc/visitors/NilScriptVisitor.java     |    49 -
 .../flex/abc/visitors/NilTraitVisitor.java      |    47 -
 .../flex/abc/visitors/NilTraitsVisitor.java     |    65 -
 .../apache/flex/abc/visitors/NilVisitors.java   |    74 -
 .../org/apache/flex/abc/visitors/package.html   |    33 -
 .../src/org/apache/flex/compiler/Messages.java  |   104 -
 .../org/apache/flex/compiler/ant/COMPCTask.java |   512 -
 .../org/apache/flex/compiler/ant/FlexTask.java  |   418 -
 .../org/apache/flex/compiler/ant/MXMLCTask.java |   493 -
 .../compiler/ant/config/BaseConfigVariable.java |    74 -
 .../compiler/ant/config/ConfigAppendString.java |    48 -
 .../flex/compiler/ant/config/ConfigBoolean.java |    75 -
 .../flex/compiler/ant/config/ConfigInt.java     |    84 -
 .../flex/compiler/ant/config/ConfigString.java  |    70 -
 .../compiler/ant/config/ConfigVariable.java     |    54 -
 .../flex/compiler/ant/config/IOptionSource.java |    33 -
 .../ant/config/NestedAttributeElement.java      |   170 -
 .../flex/compiler/ant/config/OptionSpec.java    |    76 -
 .../ant/config/RepeatableConfigString.java      |    66 -
 .../ant/config/RepeatableConfigVariable.java    |    55 -
 .../flex/compiler/ant/config/package.html       |    27 -
 .../org/apache/flex/compiler/ant/package.html   |    32 -
 .../compiler/ant/types/DefaultScriptLimits.java |    79 -
 .../flex/compiler/ant/types/DefaultSize.java    |    71 -
 .../flex/compiler/ant/types/FlexFileSet.java    |   116 -
 .../flex/compiler/ant/types/FlexSWCFileSet.java |    55 -
 .../apache/flex/compiler/ant/types/Fonts.java   |   151 -
 .../flex/compiler/ant/types/Metadata.java       |   168 -
 .../ant/types/RuntimeSharedLibraryPath.java     |    92 -
 .../flex/compiler/ant/types/URLElement.java     |    64 -
 .../apache/flex/compiler/ant/types/package.html |    27 -
 .../flex/compiler/asdoc/ASDocComment.java       |   250 -
 .../compiler/asdoc/IASDocBundleDelegate.java    |    60 -
 .../flex/compiler/asdoc/IASDocComment.java      |    50 -
 .../flex/compiler/asdoc/IASDocDelegate.java     |    64 -
 .../apache/flex/compiler/asdoc/IASDocTag.java   |    29 -
 .../compiler/asdoc/IASParserASDocDelegate.java  |    90 -
 .../asdoc/IMetadataParserASDocDelegate.java     |    69 -
 .../flex/compiler/asdoc/IPackageDITAParser.java |    52 -
 .../org/apache/flex/compiler/asdoc/package.html |    35 -
 .../org/apache/flex/compiler/clients/ASC.java   |  2254 --
 .../org/apache/flex/compiler/clients/ASDOC.java |   242 -
 .../org/apache/flex/compiler/clients/COMPC.java |   236 -
 .../flex/compiler/clients/FalconToolGroup.java  |    36 -
 .../org/apache/flex/compiler/clients/MXMLC.java |  1171 -
 .../apache/flex/compiler/clients/Optimizer.java |   512 -
 .../apache/flex/compiler/clients/package.html   |    33 -
 .../clients/problems/CodeGenErrorFilter.java    |    61 -
 .../problems/CompilerProblemCategorizer.java    |   187 -
 .../clients/problems/IProblemFilter.java        |    40 -
 .../problems/ProblemFilterClassCriteria.java    |   113 -
 .../clients/problems/ProblemFormatter.java      |   142 -
 .../clients/problems/ProblemPrinter.java        |    98 -
 .../compiler/clients/problems/ProblemQuery.java |   485 -
 .../clients/problems/ProblemQueryProvider.java  |    24 -
 .../clients/problems/ProblemSettingsFilter.java |   230 -
 .../problems/WorkspaceProblemFormatter.java     |   368 -
 .../flex/compiler/clients/problems/package.html |    27 -
 .../flex/compiler/common/ASImportTarget.java    |   180 -
 .../apache/flex/compiler/common/ASModifier.java |   115 -
 .../flex/compiler/common/DependencyType.java    |   163 -
 .../flex/compiler/common/DependencyTypeSet.java |   261 -
 .../flex/compiler/common/IDecoration.java       |    41 -
 .../compiler/common/IDefinitionPriority.java    |    29 -
 .../flex/compiler/common/IEmbedResolver.java    |    49 -
 .../common/IFileSpecificationGetter.java        |    52 -
 .../flex/compiler/common/IImportTarget.java     |    78 -
 .../apache/flex/compiler/common/IMetaInfo.java  |    56 -
 .../flex/compiler/common/IPathResolver.java     |    41 -
 .../flex/compiler/common/ISourceLocation.java   |    75 -
 .../flex/compiler/common/LibraryPathUtils.java  |    50 -
 .../flex/compiler/common/ModifiersSet.java      |   126 -
 .../apache/flex/compiler/common/Multiname.java  |   204 -
 .../flex/compiler/common/MutablePrefixMap.java  |   162 -
 .../flex/compiler/common/NodeReference.java     |   242 -
 .../apache/flex/compiler/common/PrefixMap.java  |   212 -
 .../flex/compiler/common/PrefixedXMLName.java   |   185 -
 .../flex/compiler/common/RecursionGuard.java    |    66 -
 .../flex/compiler/common/SourceLocation.java    |   361 -
 .../flex/compiler/common/VersionInfo.java       |   379 -
 .../apache/flex/compiler/common/XMLName.java    |   147 -
 .../apache/flex/compiler/common/package.html    |    27 -
 .../config/ApplicationDomainTarget.java         |    79 -
 .../config/CommandLineConfigurator.java         |   607 -
 .../flex/compiler/config/Configuration.java     |  5911 ----
 .../compiler/config/ConfigurationBuffer.java    |  1346 -
 .../flex/compiler/config/ConfigurationInfo.java |   473 -
 .../config/ConfigurationPathResolver.java       |    80 -
 .../compiler/config/ConfigurationValue.java     |   109 -
 .../flex/compiler/config/Configurator.java      |  3456 --
 .../config/ICompilerProblemSettings.java        |   213 -
 .../config/ICompilerSettingsConstants.java      |   152 -
 .../flex/compiler/config/RSLSettings.java       |   233 -
 .../apache/flex/compiler/config/package.html    |    39 -
 .../compiler/constants/IASKeywordConstants.java |   155 -
 .../constants/IASLanguageConstants.java         |   153 -
 .../compiler/constants/IASWarningConstants.java |   212 -
 .../compiler/constants/ICSSCoreConstants.java   |    99 -
 .../compiler/constants/IMXMLCoreConstants.java  |    41 -
 .../constants/IMetaAttributeConstants.java      |   221 -
 .../compiler/constants/INamespaceConstants.java |    58 -
 .../apache/flex/compiler/constants/package.html |    26 -
 .../flex/compiler/css/CombinatorType.java       |    41 -
 .../apache/flex/compiler/css/ConditionType.java |    76 -
 .../flex/compiler/css/FontFaceSourceType.java   |    38 -
 .../flex/compiler/css/ICSSCombinator.java       |    52 -
 .../apache/flex/compiler/css/ICSSDocument.java  |    59 -
 .../apache/flex/compiler/css/ICSSFontFace.java  |    83 -
 .../apache/flex/compiler/css/ICSSManager.java   |   131 -
 .../compiler/css/ICSSMediaQueryCondition.java   |    63 -
 .../compiler/css/ICSSNamespaceDefinition.java   |    59 -
 .../org/apache/flex/compiler/css/ICSSNode.java  |    60 -
 .../apache/flex/compiler/css/ICSSProperty.java  |    36 -
 .../flex/compiler/css/ICSSPropertyValue.java    |    28 -
 .../org/apache/flex/compiler/css/ICSSRule.java  |    84 -
 .../apache/flex/compiler/css/ICSSSelector.java  |    96 -
 .../compiler/css/ICSSSelectorCondition.java     |    48 -
 .../org/apache/flex/compiler/css/package.html   |    65 -
 .../AppliedVectorDefinitionFactory.java         |    38 -
 .../definitions/IAccessorDefinition.java        |    36 -
 .../definitions/IAppliedVectorDefinition.java   |    43 -
 .../IBindableVariableDefinition.java            |    33 -
 .../compiler/definitions/IClassDefinition.java  |   488 -
 .../definitions/IConstantDefinition.java        |    50 -
 .../flex/compiler/definitions/IDefinition.java  |   510 -
 .../definitions/IDocumentableDefinition.java    |    45 -
 .../compiler/definitions/IEffectDefinition.java |    69 -
 .../compiler/definitions/IEventDefinition.java  |    41 -
 .../definitions/IFunctionDefinition.java        |   208 -
 .../compiler/definitions/IGetterDefinition.java |    43 -
 .../definitions/IInterfaceDefinition.java       |   111 -
 .../definitions/IMemberedDefinition.java        |    24 -
 .../definitions/IMetadataDefinition.java        |    58 -
 .../definitions/INamespaceDefinition.java       |   228 -
 .../definitions/IPackageDefinition.java         |    74 -
 .../definitions/IParameterDefinition.java       |    71 -
 .../flex/compiler/definitions/IQualifiers.java  |    58 -
 .../compiler/definitions/IScopedDefinition.java |    33 -
 .../compiler/definitions/ISetterDefinition.java |    44 -
 .../compiler/definitions/IStyleDefinition.java  |   161 -
 .../compiler/definitions/ITypeDefinition.java   |   141 -
 .../definitions/IVariableDefinition.java        |   181 -
 .../definitions/metadata/IDeprecationInfo.java  |    32 -
 .../compiler/definitions/metadata/IMetaTag.java |    60 -
 .../definitions/metadata/IMetaTagAttribute.java |    53 -
 .../compiler/definitions/metadata/package.html  |    26 -
 .../flex/compiler/definitions/package.html      |   174 -
 .../references/INamespaceReference.java         |    63 -
 .../definitions/references/IReference.java      |    89 -
 .../IResolvedQualifiersReference.java           |    88 -
 .../references/ReferenceFactory.java            |   293 -
 .../definitions/references/package.html         |    60 -
 .../compiler/exceptions/BURMAbortException.java |    42 -
 .../exceptions/BuildCanceledException.java      |    28 -
 .../exceptions/CircularDependencyException.java |    63 -
 .../exceptions/CodegenInterruptedException.java |    41 -
 .../exceptions/ConfigurationException.java      |   713 -
 .../exceptions/DuplicateLabelException.java     |    40 -
 .../LibraryCircularDependencyException.java     |    63 -
 .../exceptions/MissingBuiltinException.java     |    52 -
 .../UnknownControlFlowTargetException.java      |    40 -
 .../flex/compiler/exceptions/package.html       |    27 -
 .../filespecs/BaseFileSpecification.java        |   102 -
 .../flex/compiler/filespecs/CombinedFile.java   |   245 -
 .../compiler/filespecs/FileSpecification.java   |   130 -
 .../filespecs/IBinaryFileSpecification.java     |    31 -
 .../compiler/filespecs/IFileSpecification.java  |    58 -
 .../apache/flex/compiler/filespecs/package.html |    33 -
 .../apache/flex/compiler/fxg/FXGConstants.java  |   429 -
 .../apache/flex/compiler/fxg/FXGFileNode.java   |    45 -
 .../flex/compiler/fxg/FXGParserFactory.java     |    44 -
 .../apache/flex/compiler/fxg/FXGVersion.java    |   185 -
 .../apache/flex/compiler/fxg/IFXGParser.java    |    54 -
 .../flex/compiler/fxg/IFXGTranscoder.java       |    66 -
 .../apache/flex/compiler/fxg/dom/IFXGNode.java  |   127 -
 .../flex/compiler/fxg/flex/FXGSymbolClass.java  |   147 -
 .../fxg/flex/FlexFXG2SWFTranscoder.java         |  1306 -
 .../flex/compiler/fxg/flex/FlexGraphicNode.java |    31 -
 .../compiler/fxg/flex/FlexParagraphNode.java    |    58 -
 .../compiler/fxg/flex/FlexRichTextNode.java     |    96 -
 .../flex/compiler/fxg/flex/FlexSpanNode.java    |    58 -
 .../compiler/fxg/flex/FlexTextGraphicNode.java  |   161 -
 .../flex/compiler/fxg/logging/FXGLog.java       |    58 -
 .../compiler/fxg/logging/FXGLoggerFactory.java  |    39 -
 .../flex/compiler/fxg/logging/IFXGLogger.java   |    56 -
 .../org/apache/flex/compiler/fxg/package.html   |    31 -
 .../resources/FXGResourceResolverFactory.java   |    40 -
 .../fxg/resources/IFXGResourceResolver.java     |    41 -
 .../compiler/fxg/swf/FXG2SWFTranscoder.java     |  1663 -
 .../compiler/internal/abc/ABCScopeBuilder.java  |   421 -
 .../internal/abc/ClassGeneratorHelper.java      |   483 -
 .../abc/CollectMetadataTraitVisitor.java        |   153 -
 .../internal/abc/FunctionGeneratorHelper.java   |    58 -
 .../abc/ScopedDefinitionTraitsVisitor.java      |   311 -
 .../internal/abc/ScriptDefinitionBuilder.java   |    72 -
 .../internal/abc/TypeDefinitionBuilder.java     |    80 -
 .../as/codegen/ABCGeneratingReducer.java        |  7137 -----
 .../internal/as/codegen/ABCGenerator.java       |   761 -
 .../internal/as/codegen/BindableHelper.java     |   583 -
 .../compiler/internal/as/codegen/Binding.java   |   738 -
 .../as/codegen/ClassDirectiveProcessor.java     |  1275 -
 .../internal/as/codegen/CmcPatterns.jbg         |  1001 -
 .../compiler/internal/as/codegen/CmcRules.jbg   |  1258 -
 .../as/codegen/CodeGeneratorManager.java        |    48 -
 .../as/codegen/CompoundAssignmentPatterns.jbg   |    39 -
 .../as/codegen/CompoundAssignmentRules.jbg      |    49 -
 .../codegen/CompoundLogicalAssignmentRules.jbg  |    52 -
 .../internal/as/codegen/ConstantArithmetic.jbg  |   257 -
 .../internal/as/codegen/ConstantLogic.jbg       |   253 -
 .../internal/as/codegen/ControlFlowContext.java |   200 -
 .../as/codegen/ControlFlowContextManager.java   |   877 -
 .../internal/as/codegen/DirectiveProcessor.java |   264 -
 .../internal/as/codegen/DumpBURMState.java      |    80 -
 .../as/codegen/ExceptionHandlingContext.java    |   301 -
 .../internal/as/codegen/FunctionPatterns.jbg    |    28 -
 .../internal/as/codegen/FunctionRules.jbg       |    36 -
 .../GenerateFunctionInParallelResult.java       |    77 -
 .../as/codegen/GlobalDirectiveProcessor.java    |   558 -
 .../internal/as/codegen/GlobalLexicalScope.java |   429 -
 .../internal/as/codegen/IASNodeAdapter.java     |    74 -
 .../internal/as/codegen/ICodeGenerator.java     |   245 -
 .../as/codegen/ICodeGeneratorFactory.java       |    32 -
 .../as/codegen/InlineFunctionLexicalScope.java  |   267 -
 .../as/codegen/InstructionListNode.java         |   131 -
 .../as/codegen/InterfaceDirectiveProcessor.java |   506 -
 .../codegen/LabelScopeControlFlowContext.java   |   177 -
 .../LabeledStatementControlFlowContext.java     |    70 -
 .../internal/as/codegen/LexicalScope.java       |  2053 --
 .../as/codegen/LoopControlFlowContext.java      |   139 -
 .../as/codegen/MXMLClassDirectiveProcessor.java |  6127 ----
 .../internal/as/codegen/SemanticErrors.jbg      |    59 -
 .../as/codegen/SwitchControlFlowContext.java    |    82 -
 .../internal/as/codegen/UnknownTreeFinding.java |   250 -
 .../internal/as/codegen/UnknownTreeHandler.java |   162 -
 .../as/codegen/UnknownTreeHandlerPatterns.xml   |    68 -
 .../codegen/UnknownTreePatternInputOutput.java  |   306 -
 .../internal/as/codegen/WithContext.java        |   108 -
 .../flex/compiler/internal/as/codegen/cmc.jbg   |   245 -
 .../compiler/internal/caches/AssetTagCache.java |   193 -
 .../internal/caches/CSSDocumentCache.java       |   387 -
 .../internal/caches/CacheStoreKeyBase.java      |    55 -
 .../caches/ConcurrentCacheStoreBase.java        |   125 -
 .../internal/caches/FileScopeCache.java         |   131 -
 .../compiler/internal/caches/MXMLDataCache.java |   102 -
 .../caches/PackageNamespaceDefinitionCache.java |    63 -
 .../flex/compiler/internal/caches/SWFCache.java |   269 -
 .../compiler/internal/clients/CLIFactory.java   |   220 -
 .../flex/compiler/internal/clients/package.html |    33 -
 .../codegen/databinding/BindingAnalyzer.java    |    99 -
 .../databinding/BindingCodeGenUtils.java        |   737 -
 .../codegen/databinding/BindingDatabase.java    |   415 -
 .../databinding/BindingDestinationMaker.java    |   206 -
 .../codegen/databinding/BindingInfo.java        |   473 -
 .../databinding/FunctionWatcherInfo.java        |    80 -
 .../databinding/MXMLBindingDirectiveHelper.java |   996 -
 .../databinding/PropertyWatcherInfo.java        |    82 -
 .../databinding/StaticPropertyWatcherInfo.java  |    77 -
 .../codegen/databinding/WatcherAnalyzer.java    |   472 -
 .../codegen/databinding/WatcherInfoBase.java    |   300 -
 .../codegen/databinding/XMLWatcherInfo.java     |    51 -
 .../flex/compiler/internal/common/Counter.java  |   138 -
 .../flex/compiler/internal/common/package.html  |    33 -
 .../internal/config/COMPCConfiguration.java     |    60 -
 .../config/CompilerProblemSettings.java         |   227 -
 .../internal/config/DefaultsConfigurator.java   |   181 -
 .../internal/config/FileConfigurator.java       |   677 -
 .../config/FlashBuilderConfigurator.java        |   503 -
 .../compiler/internal/config/FrameInfo.java     |    61 -
 .../internal/config/ICompilerSettings.java      |   840 -
 .../internal/config/IConfigurationFilter.java   |    37 -
 .../compiler/internal/config/IConfigurator.java |   126 -
 .../config/IWriteOnlyProjectSettings.java       |   144 -
 .../internal/config/LoadExternsParser.java      |   111 -
 .../internal/config/QNameNormalization.java     |    78 -
 .../config/RSLArgumentNameGenerator.java        |    52 -
 .../config/RuntimeSharedLibraryPathInfo.java    |   207 -
 .../config/SystemPropertyConfigurator.java      |    83 -
 .../internal/config/TargetSettings.java         |   582 -
 .../annotations/ArgumentNameGenerator.java      |    58 -
 .../internal/config/annotations/Arguments.java  |    66 -
 .../internal/config/annotations/Config.java     |    88 -
 .../annotations/DefaultArgumentValue.java       |    41 -
 .../config/annotations/DeprecatedConfig.java    |    38 -
 .../internal/config/annotations/FlexOnly.java   |    35 -
 .../config/annotations/InfiniteArguments.java   |    37 -
 .../internal/config/annotations/Mapping.java    |    47 -
 .../config/annotations/SoftPrerequisites.java   |    37 -
 .../config/localization/ILocalizedText.java     |    30 -
 .../config/localization/ILocalizer.java         |    30 -
 .../localization/LocalizationManager.java       |   234 -
 .../localization/ResourceBundleLocalizer.java   |    77 -
 .../internal/config/localization/package.html   |    27 -
 .../flex/compiler/internal/config/package.html  |    33 -
 .../org/apache/flex/compiler/internal/css/CSS.g |   671 -
 .../internal/css/CSSArrayPropertyValue.java     |    63 -
 .../internal/css/CSSColorPropertyValue.java     |   264 -
 .../compiler/internal/css/CSSCombinator.java    |    57 -
 .../flex/compiler/internal/css/CSSDocument.java |   180 -
 .../flex/compiler/internal/css/CSSFontFace.java |   193 -
 .../css/CSSFunctionCallPropertyValue.java       |    96 -
 .../compiler/internal/css/CSSKeyFrames.java     |    68 -
 .../internal/css/CSSKeywordPropertyValue.java   |    80 -
 .../flex/compiler/internal/css/CSSManager.java  |   295 -
 .../internal/css/CSSMediaQueryCondition.java    |    86 -
 .../compiler/internal/css/CSSModelTreeType.java |    46 -
 .../internal/css/CSSNamespaceDefinition.java    |    75 -
 .../flex/compiler/internal/css/CSSNodeBase.java |   168 -
 .../internal/css/CSSNumberPropertyValue.java    |    94 -
 .../flex/compiler/internal/css/CSSProperty.java |   157 -
 .../compiler/internal/css/CSSPropertyValue.java |    38 -
 .../internal/css/CSSRgbColorPropertyValue.java  |   113 -
 .../internal/css/CSSRgbaColorPropertyValue.java |   125 -
 .../flex/compiler/internal/css/CSSRule.java     |   130 -
 .../flex/compiler/internal/css/CSSSelector.java |   168 -
 .../internal/css/CSSSelectorCondition.java      |    67 -
 .../internal/css/CSSStringPropertyValue.java    |   113 -
 .../flex/compiler/internal/css/CSSTextNode.java |    54 -
 .../apache/flex/compiler/internal/css/CSSTree.g |   442 -
 .../compiler/internal/css/CSSTypedNode.java     |    39 -
 .../css/CSSURLAndFormatPropertyValue.java       |    65 -
 .../css/codegen/CSSCompilationSession.java      |   417 -
 .../css/codegen/CSSModuleGenerator.java         |   125 -
 .../internal/css/codegen/CSSPatterns.jbg        |    82 -
 .../internal/css/codegen/CSSReducer.java        |   807 -
 .../compiler/internal/css/codegen/CSSRules.jbg  |    57 -
 .../internal/css/codegen/ICSSCodeGenResult.java |    45 -
 .../css/codegen/ICSSRuntimeConstants.java       |    44 -
 .../compiler/internal/css/codegen/Pair.java     |   101 -
 .../flex/compiler/internal/css/codegen/css.jbg  |    58 -
 .../flex/compiler/internal/css/package.hmtl     |    37 -
 .../css/semantics/ActivatedStyleSheets.java     |   150 -
 .../css/semantics/CSSSemanticAnalyzer.java      |   759 -
 .../definitions/AccessorDefinition.java         |   237 -
 .../definitions/AmbiguousDefinition.java        |   335 -
 .../definitions/AppliedVectorDefinition.java    |   625 -
 .../internal/definitions/ClassDefinition.java   |  1458 -
 .../definitions/ClassDefinitionBase.java        |   681 -
 .../definitions/ClassTraitsDefinition.java      |   381 -
 .../definitions/ConstantDefinition.java         |   212 -
 .../internal/definitions/DefinitionBase.java    |  1735 -
 .../internal/definitions/EffectDefinition.java  |    88 -
 .../internal/definitions/EventDefinition.java   |    49 -
 .../definitions/FunctionDefinition.java         |   610 -
 .../internal/definitions/GetterDefinition.java  |   105 -
 .../definitions/InterfaceDefinition.java        |   625 -
 .../definitions/MemberedDefinition.java         |    39 -
 .../definitions/MetadataDefinitionBase.java     |   152 -
 .../definitions/NamespaceDefinition.java        |  2246 --
 .../internal/definitions/PackageDefinition.java |   148 -
 .../definitions/ParameterDefinition.java        |   137 -
 .../definitions/ScopedDefinitionBase.java       |    69 -
 .../internal/definitions/SetterDefinition.java  |   104 -
 .../internal/definitions/StyleDefinition.java   |   254 -
 .../SyntheticBindableGetterDefinition.java      |    33 -
 .../SyntheticBindableSetterDefinition.java      |    33 -
 .../definitions/TypeDefinitionBase.java         |   357 -
 .../definitions/VariableDefinition.java         |   380 -
 .../internal/definitions/VectorInformation.java |   311 -
 .../definitions/metadata/DeprecationInfo.java   |    60 -
 .../internal/definitions/metadata/MetaTag.java  |   365 -
 .../definitions/metadata/MetaTagAttribute.java  |    53 -
 .../metadata/ResourceBundleMetaTag.java         |    59 -
 .../definitions/mxml/MXMLEventHandlerScope.java |    81 -
 .../compiler/internal/definitions/package.html  |    42 -
 .../references/BuiltinReference.java            |    85 -
 .../references/LexicalReference.java            |   102 -
 .../references/NotATypeReference.java           |    82 -
 .../references/ParameterizedReference.java      |    90 -
 .../definitions/references/ReferenceCache.java  |    90 -
 .../references/ResolvedQualifiersReference.java |   184 -
 .../references/ResolvedReference.java           |    80 -
 .../internal/embedding/EmbedAttribute.java      |    76 -
 .../compiler/internal/embedding/EmbedData.java  |   678 -
 .../internal/embedding/EmbedMIMEType.java       |   119 -
 .../embedding/transcoders/DataTranscoder.java   |    72 -
 .../embedding/transcoders/ImageTranscoder.java  |   411 -
 .../embedding/transcoders/JPEGTranscoder.java   |   240 -
 .../embedding/transcoders/MovieTranscoder.java  |   516 -
 .../embedding/transcoders/PBJTranscoder.java    |   128 -
 .../transcoders/ScalableTranscoder.java         |   178 -
 .../embedding/transcoders/SkinTranscoder.java   |   489 -
 .../embedding/transcoders/SoundTranscoder.java  |   369 -
 .../embedding/transcoders/TranscoderBase.java   |   366 -
 .../embedding/transcoders/XMLTranscoder.java    |   226 -
 .../filespecs/IZipFileSpecification.java        |    63 -
 .../filespecs/SWCFileSpecification.java         |   142 -
 .../filespecs/StringFileSpecification.java      |    80 -
 .../filespecs/ZipFileSpecification.java         |   126 -
 .../internal/fxg/dom/AbstractFXGNode.java       |   253 -
 .../internal/fxg/dom/AbstractShapeNode.java     |    82 -
 .../internal/fxg/dom/BitmapGraphicNode.java     |    79 -
 .../compiler/internal/fxg/dom/CDATANode.java    |   137 -
 .../internal/fxg/dom/ContentPropertyNode.java   |    80 -
 .../internal/fxg/dom/DOMParserHelper.java       |   691 -
 .../internal/fxg/dom/DefinitionNode.java        |   120 -
 .../compiler/internal/fxg/dom/DelegateNode.java |   227 -
 .../compiler/internal/fxg/dom/EllipseNode.java  |    94 -
 .../internal/fxg/dom/GradientEntryNode.java     |    70 -
 .../internal/fxg/dom/GraphicContentNode.java    |   559 -
 .../internal/fxg/dom/GraphicContext.java        |    82 -
 .../compiler/internal/fxg/dom/GraphicNode.java  |   397 -
 .../internal/fxg/dom/GroupDefinitionNode.java   |   184 -
 .../compiler/internal/fxg/dom/GroupNode.java    |   223 -
 .../compiler/internal/fxg/dom/IFillNode.java    |    40 -
 .../compiler/internal/fxg/dom/IFilterNode.java  |    40 -
 .../internal/fxg/dom/IMaskableNode.java         |    37 -
 .../compiler/internal/fxg/dom/IMaskingNode.java |    43 -
 .../fxg/dom/IPreserveWhiteSpaceNode.java        |    27 -
 .../internal/fxg/dom/IScalableGradientNode.java |    65 -
 .../compiler/internal/fxg/dom/IStrokeNode.java  |    40 -
 .../compiler/internal/fxg/dom/ITextNode.java    |    70 -
 .../internal/fxg/dom/ITransformNode.java        |    40 -
 .../compiler/internal/fxg/dom/LibraryNode.java  |   122 -
 .../compiler/internal/fxg/dom/LineNode.java     |    86 -
 .../internal/fxg/dom/MaskPropertyNode.java      |    65 -
 .../compiler/internal/fxg/dom/PathNode.java     |   105 -
 .../internal/fxg/dom/PlaceObjectNode.java       |    79 -
 .../compiler/internal/fxg/dom/RectNode.java     |   197 -
 .../compiler/internal/fxg/dom/RichTextNode.java |   945 -
 .../internal/fxg/dom/TextGraphicNode.java       |   444 -
 .../fxg/dom/fills/AbstractFillNode.java         |    81 -
 .../internal/fxg/dom/fills/BitmapFillNode.java  |   116 -
 .../fxg/dom/fills/LinearGradientFillNode.java   |   221 -
 .../fxg/dom/fills/RadialGradientFillNode.java   |   227 -
 .../fxg/dom/fills/SolidColorFillNode.java       |    65 -
 .../fxg/dom/filters/AbstractFilterNode.java     |    99 -
 .../fxg/dom/filters/BevelFilterNode.java        |    96 -
 .../fxg/dom/filters/BlurFilterNode.java         |    68 -
 .../fxg/dom/filters/ColorMatrixFilterNode.java  |   104 -
 .../fxg/dom/filters/DropShadowFilterNode.java   |    93 -
 .../fxg/dom/filters/GlowFilterNode.java         |    84 -
 .../dom/filters/GradientBevelFilterNode.java    |   133 -
 .../fxg/dom/filters/GradientGlowFilterNode.java |   132 -
 .../dom/richtext/AbstractRichBlockTextNode.java |   321 -
 .../dom/richtext/AbstractRichParagraphNode.java |   164 -
 .../dom/richtext/AbstractRichTextLeafNode.java  |   372 -
 .../fxg/dom/richtext/AbstractRichTextNode.java  |   230 -
 .../internal/fxg/dom/richtext/BRNode.java       |    64 -
 .../internal/fxg/dom/richtext/DivNode.java      |   210 -
 .../internal/fxg/dom/richtext/ImgNode.java      |   123 -
 .../internal/fxg/dom/richtext/LinkNode.java     |   241 -
 .../fxg/dom/richtext/ParagraphNode.java         |   214 -
 .../internal/fxg/dom/richtext/SpanNode.java     |    81 -
 .../internal/fxg/dom/richtext/TCYNode.java      |   222 -
 .../internal/fxg/dom/richtext/TabNode.java      |    64 -
 .../internal/fxg/dom/richtext/TextHelper.java   |   712 -
 .../fxg/dom/richtext/TextLayoutFormatNode.java  |    45 -
 .../fxg/dom/richtext/TextPropertyNode.java      |    56 -
 .../fxg/dom/strokes/AbstractStrokeNode.java     |   227 -
 .../dom/strokes/LinearGradientStrokeNode.java   |   215 -
 .../dom/strokes/RadialGradientStrokeNode.java   |   226 -
 .../fxg/dom/strokes/SolidColorStrokeNode.java   |    66 -
 .../fxg/dom/text/AbstractCharacterTextNode.java |   255 -
 .../internal/fxg/dom/text/AbstractTextNode.java |   207 -
 .../compiler/internal/fxg/dom/text/BRNode.java  |    46 -
 .../internal/fxg/dom/text/ParagraphNode.java    |   177 -
 .../internal/fxg/dom/text/SpanNode.java         |    72 -
 .../dom/transforms/AbstractTransformNode.java   |    87 -
 .../fxg/dom/transforms/ColorTransformNode.java  |   106 -
 .../internal/fxg/dom/transforms/MatrixNode.java |    76 -
 .../fxg/dom/types/AlignmentBaseline.java        |    72 -
 .../internal/fxg/dom/types/BaselineOffset.java  |   109 -
 .../internal/fxg/dom/types/BaselineShift.java   |   102 -
 .../internal/fxg/dom/types/BevelType.java       |    51 -
 .../internal/fxg/dom/types/BlendMode.java       |   219 -
 .../fxg/dom/types/BlockProgression.java         |    41 -
 .../fxg/dom/types/BreakOpportunity.java         |    53 -
 .../compiler/internal/fxg/dom/types/Caps.java   |    52 -
 .../internal/fxg/dom/types/ColorWithEnum.java   |   103 -
 .../internal/fxg/dom/types/DigitCase.java       |    47 -
 .../internal/fxg/dom/types/DigitWidth.java      |    47 -
 .../internal/fxg/dom/types/Direction.java       |    41 -
 .../fxg/dom/types/DominantBaseline.java         |    72 -
 .../internal/fxg/dom/types/FillMode.java        |    47 -
 .../internal/fxg/dom/types/FontStyle.java       |    41 -
 .../internal/fxg/dom/types/FontWeight.java      |    41 -
 .../fxg/dom/types/InterpolationMethod.java      |    45 -
 .../compiler/internal/fxg/dom/types/Joints.java |    51 -
 .../fxg/dom/types/JustificationRule.java        |    47 -
 .../fxg/dom/types/JustificationStyle.java       |    53 -
 .../internal/fxg/dom/types/Kerning.java         |    51 -
 .../internal/fxg/dom/types/LeadingModel.java    |    76 -
 .../internal/fxg/dom/types/LigatureLevel.java   |    53 -
 .../internal/fxg/dom/types/LineBreak.java       |    51 -
 .../internal/fxg/dom/types/MaskType.java        |    54 -
 .../internal/fxg/dom/types/NumberAuto.java      |   148 -
 .../internal/fxg/dom/types/NumberInherit.java   |    95 -
 .../fxg/dom/types/NumberPercentAuto.java        |    96 -
 .../internal/fxg/dom/types/ResizeMode.java      |    47 -
 .../internal/fxg/dom/types/ScaleMode.java       |    58 -
 .../internal/fxg/dom/types/ScalingGrid.java     |    32 -
 .../internal/fxg/dom/types/SpreadMethod.java    |    51 -
 .../internal/fxg/dom/types/TextAlign.java       |    65 -
 .../internal/fxg/dom/types/TextDecoration.java  |    41 -
 .../internal/fxg/dom/types/TextJustify.java     |    41 -
 .../internal/fxg/dom/types/TextRotation.java    |    59 -
 .../internal/fxg/dom/types/TypographicCase.java |    59 -
 .../internal/fxg/dom/types/VerticalAlign.java   |    59 -
 .../fxg/dom/types/WhiteSpaceCollapse.java       |    46 -
 .../internal/fxg/dom/types/Winding.java         |    43 -
 .../internal/fxg/logging/AbstractLogger.java    |   135 -
 .../internal/fxg/logging/SystemLogger.java      |    84 -
 .../internal/fxg/resources/FXGFileResolver.java |    86 -
 .../fxg/sax/AbstractFXGVersionHandler.java      |   158 -
 .../compiler/internal/fxg/sax/FXGSAXParser.java |   126 -
 .../internal/fxg/sax/FXGSAXScanner.java         |   573 -
 .../fxg/sax/FXGVersionHandlerRegistry.java      |   193 -
 .../internal/fxg/sax/FXG_v1_0_Handler.java      |   156 -
 .../internal/fxg/sax/FXG_v2_0_Handler.java      |   171 -
 .../internal/fxg/sax/IFXGVersionHandler.java    |    75 -
 .../compiler/internal/fxg/swf/DefineImage.java  |    59 -
 .../compiler/internal/fxg/swf/ImageHelper.java  |   555 -
 .../compiler/internal/fxg/swf/ShapeHelper.java  |  1453 -
 .../compiler/internal/fxg/swf/TextHelper.java   |    49 -
 .../compiler/internal/fxg/swf/TypeHelper.java   |   387 -
 .../compiler/internal/fxg/types/FXGMatrix.java  |   165 -
 .../flex/compiler/internal/graph/Graph.java     |   206 -
 .../flex/compiler/internal/graph/GraphEdge.java |    51 -
 .../compiler/internal/graph/GraphMLWriter.java  |   377 -
 .../flex/compiler/internal/graph/IGraph.java    |   103 -
 .../compiler/internal/graph/IGraphEdge.java     |    39 -
 .../compiler/internal/graph/IGraphable.java     |    27 -
 .../compiler/internal/graph/IReportWriter.java  |    45 -
 .../graph/InvalidationBytesCalculator.java      |    89 -
 .../internal/graph/LinkReportWriter.java        |   298 -
 .../internal/graph/SynchronizedGraph.java       |   169 -
 .../internal/graph/TopologicalSort.java         |   225 -
 .../compiler/internal/graph/XMLGraphWriter.java |   126 -
 .../compiler/internal/mxml/EntityProcessor.java |   285 -
 .../flex/compiler/internal/mxml/MXMLData.java   |   965 -
 .../compiler/internal/mxml/MXMLDataManager.java |    62 -
 .../compiler/internal/mxml/MXMLDialect.java     |   709 -
 .../compiler/internal/mxml/MXMLDialect2006.java |   426 -
 .../compiler/internal/mxml/MXMLDialect2009.java |    58 -
 .../compiler/internal/mxml/MXMLDialect2012.java |   105 -
 .../internal/mxml/MXMLInstructionData.java      |   129 -
 .../internal/mxml/MXMLManifestManager.java      |   418 -
 .../mxml/MXMLNamespaceAttributeData.java        |    64 -
 .../internal/mxml/MXMLNamespaceMapping.java     |    76 -
 .../internal/mxml/MXMLStateSplitter.java        |   101 -
 .../internal/mxml/MXMLTagAttributeData.java     |   578 -
 .../compiler/internal/mxml/MXMLTagData.java     |  1135 -
 .../compiler/internal/mxml/MXMLTextData.java    |   390 -
 .../compiler/internal/mxml/MXMLUnitData.java    |   366 -
 .../compiler/internal/mxml/StateDefinition.java |   104 -
 .../internal/mxml/StateDefinitionBase.java      |    81 -
 .../internal/mxml/StateGroupDefinition.java     |    89 -
 .../flex/compiler/internal/mxml/package.html    |    33 -
 .../compiler/internal/parsing/FakingReader.java |   215 -
 .../internal/parsing/FilteringList.java         |    70 -
 .../internal/parsing/ISourceFragment.java       |    64 -
 .../internal/parsing/ITokenStreamFilter.java    |    27 -
 .../internal/parsing/SourceFragment.java        |   133 -
 .../internal/parsing/SourceFragmentsReader.java |   165 -
 .../compiler/internal/parsing/TokenBase.java    |   515 -
 .../internal/parsing/as/ASBalancingScanner.java |   106 -
 .../internal/parsing/as/ASDocToken.java         |    44 -
 .../internal/parsing/as/ASDocTokenizer.java     |    94 -
 .../compiler/internal/parsing/as/ASParser.g     |  3223 --
 .../compiler/internal/parsing/as/ASToken.java   |  1010 -
 .../internal/parsing/as/BaseASParser.java       |  3043 --
 .../internal/parsing/as/BaseMetaTagParser.java  |   165 -
 .../internal/parsing/as/BaseRawASTokenizer.java |   361 -
 .../internal/parsing/as/BaseRawTokenizer.java   |   387 -
 .../parsing/as/BaseRepairingTokenBuffer.java    |   110 -
 .../as/BaseTokenizerWithFakeCharacters.java     |    78 -
 .../parsing/as/ConfigCompilationUnit.java       |    97 -
 .../internal/parsing/as/ConfigProcessor.java    |   503 -
 .../internal/parsing/as/DeferFunctionBody.java  |    36 -
 .../internal/parsing/as/IProblemReporter.java   |    42 -
 .../parsing/as/IProjectConfigVariables.java     |    74 -
 .../parsing/as/IRepairingTokenBuffer.java       |   118 -
 .../parsing/as/ImportMetadataTokenTypes.txt     |    68 -
 .../internal/parsing/as/IncludeHandler.java     |   595 -
 .../parsing/as/MetaDataPayloadToken.java        |   127 -
 .../internal/parsing/as/MetadataParser.g        |   397 -
 .../internal/parsing/as/MetadataToken.java      |    96 -
 .../internal/parsing/as/MetadataTokenizer.java  |   355 -
 .../internal/parsing/as/NilASDocDelegate.java   |   131 -
 .../compiler/internal/parsing/as/OffsetCue.java |   127 -
 .../internal/parsing/as/OffsetLookup.java       |   230 -
 .../internal/parsing/as/RawASDocTokenizer.lex   |   234 -
 .../internal/parsing/as/RawASTokenizer.lex      |  1325 -
 .../parsing/as/RepairingTokenBuffer.java        |   153 -
 .../parsing/as/SimpleASDocDelegate.java         |   143 -
 .../parsing/as/StreamingASTokenizer.java        |  1871 --
 .../parsing/as/StreamingTokenBuffer.java        |   208 -
 .../internal/parsing/as/skeleton.default        |   349 -
 .../internal/parsing/as/skeleton.falcon         |   398 -
 .../parsing/mxml/BalancingMXMLProcessor.java    |   139 -
 .../parsing/mxml/BaseRawMXMLTokenizer.java      |   278 -
 .../internal/parsing/mxml/MXMLScopeBuilder.java |   782 -
 .../internal/parsing/mxml/MXMLTagDataDepth.java |   263 -
 .../parsing/mxml/MXMLTagDataPayload.java        |    63 -
 .../internal/parsing/mxml/MXMLToken.java        |   238 -
 .../internal/parsing/mxml/MXMLTokenizer.java    |   439 -
 .../parsing/mxml/MXMLUnitDataIterator.java      |    55 -
 .../internal/parsing/mxml/RawMXMLTokenizer.lex  |   560 -
 .../flex/compiler/internal/parsing/package.html |    33 -
 .../compiler/internal/projects/ASCProject.java  |    77 -
 .../compiler/internal/projects/ASProject.java   |   470 -
 .../internal/projects/ASSourceFileHandler.java  |    66 -
 .../internal/projects/CompilerProject.java      |  1004 -
 .../internal/projects/ConfigManager.java        |   313 -
 .../internal/projects/DefinitionPriority.java   |   137 -
 .../internal/projects/DependencyGraph.java      |   805 -
 .../internal/projects/FXGSourceFileHandler.java |    66 -
 .../compiler/internal/projects/FlexProject.java |  2186 --
 .../projects/FlexProjectConfigurator.java       |   250 -
 .../internal/projects/ISourceFileHandler.java   |    89 -
 .../projects/LibraryDependencyGraph.java        |   345 -
 .../internal/projects/LibraryPathManager.java   |   673 -
 .../projects/MXMLSourceFileHandler.java         |    74 -
 .../ResourceBundleSourceFileHandler.java        |    73 -
 .../internal/projects/SourceListManager.java    |   255 -
 .../internal/projects/SourcePathManager.java    |   701 -
 .../internal/projects/ThemeUtilities.java       |    73 -
 .../compiler/internal/projects/package.html     |    33 -
 .../resourcebundles/PropertiesFileParser.java   |   520 -
 .../resourcebundles/ResourceBundleUtils.java    |   336 -
 .../compiler/internal/scopes/ASFileScope.java   |   443 -
 .../internal/scopes/ASFileScopeProvider.java    |    54 -
 .../internal/scopes/ASProjectScope.java         |  2133 --
 .../flex/compiler/internal/scopes/ASScope.java  |  1698 -
 .../compiler/internal/scopes/ASScopeBase.java   |   519 -
 .../compiler/internal/scopes/ASScopeCache.java  |   675 -
 .../compiler/internal/scopes/CatchScope.java    |    48 -
 .../compiler/internal/scopes/ClosureScope.java  |    33 -
 .../internal/scopes/EmptyDefinitionStore.java   |   102 -
 .../compiler/internal/scopes/FXGFileScope.java  |    33 -
 .../compiler/internal/scopes/FunctionScope.java |    41 -
 .../internal/scopes/IDefinitionStore.java       |   127 -
 .../internal/scopes/IMutableDefinitionSet.java  |    57 -
 .../internal/scopes/LargeDefinitionSet.java     |   102 -
 .../internal/scopes/LargeDefinitionStore.java   |   199 -
 .../compiler/internal/scopes/MXMLFileScope.java |   631 -
 .../internal/scopes/NamespaceSetPredicate.java  |   118 -
 .../internal/scopes/NoDefinitionScope.java      |   132 -
 .../compiler/internal/scopes/PackageScope.java  |   165 -
 .../internal/scopes/SWCFileScopeProvider.java   |   124 -
 .../compiler/internal/scopes/ScopeView.java     |   340 -
 .../internal/scopes/SmallDefinitionSet.java     |   150 -
 .../internal/scopes/SmallDefinitionStore1.java  |   157 -
 .../internal/scopes/SmallDefinitionStore2.java  |   185 -
 .../internal/scopes/SmallDefinitionStore4.java  |   220 -
 .../internal/scopes/SmallDefinitionStore8.java  |   290 -
 .../scopes/SmallDefinitionStoreBase.java        |   341 -
 .../compiler/internal/scopes/TypeScope.java     |   666 -
 .../compiler/internal/scopes/WithScope.java     |    42 -
 .../flex/compiler/internal/scopes/package.html  |    33 -
 .../semantics/MethodBodySemanticChecker.java    |  3063 --
 .../internal/semantics/PostProcessStep.java     |    27 -
 .../internal/semantics/SemanticUtils.java       |  2968 --
 .../compiler/internal/targets/AppSWFTarget.java |   390 -
 .../internal/targets/FlexAppSWFTarget.java      |  1857 --
 .../targets/FlexApplicationFrame1Info.java      |   257 -
 .../compiler/internal/targets/FlexFontInfo.java |    56 -
 .../internal/targets/FlexFrame1Info.java        |   225 -
 .../internal/targets/FlexLibraryFrame1Info.java |    44 -
 .../internal/targets/FlexLibrarySWFTarget.java  |   472 -
 .../compiler/internal/targets/FlexRSLInfo.java  |   235 -
 .../internal/targets/FlexSplashScreenImage.java |    50 -
 .../compiler/internal/targets/FlexTarget.java   |   745 -
 .../internal/targets/ILibrarySWFTarget.java     |    56 -
 .../internal/targets/ITargetAttributes.java     |   116 -
 .../internal/targets/LibrarySWFTarget.java      |   130 -
 .../internal/targets/LinkageChecker.java        |   147 -
 .../internal/targets/NilTargetAttributes.java   |   128 -
 .../compiler/internal/targets/SWCTarget.java    |   995 -
 .../compiler/internal/targets/SWFTarget.java    |   874 -
 .../compiler/internal/targets/TagSorter.java    |   154 -
 .../flex/compiler/internal/targets/Target.java  |   820 -
 .../internal/targets/TargetAttributeBase.java   |   225 -
 .../internal/targets/TargetAttributesMap.java   |   162 -
 .../targets/TargetAttributesMetadata.java       |   140 -
 .../compiler/internal/targets/TargetReport.java |   199 -
 .../flex/compiler/internal/targets/package.html |    33 -
 .../testing/NodesToXMLStringFormatter.java      |   129 -
 .../flex/compiler/internal/testing/package.html |    33 -
 .../compiler/internal/tree/as/AccessorNode.java |   183 -
 .../internal/tree/as/ArrayLiteralNode.java      |   124 -
 .../internal/tree/as/BaseDefinitionNode.java    |   453 -
 .../tree/as/BaseLiteralContainerNode.java       |   185 -
 .../tree/as/BaseStatementExpressionNode.java    |   109 -
 .../internal/tree/as/BaseStatementNode.java     |    67 -
 .../tree/as/BaseTypedDefinitionNode.java        |   223 -
 .../internal/tree/as/BaseVariableNode.java      |   390 -
 .../internal/tree/as/BinaryOperatorAsNode.java  |    95 -
 .../tree/as/BinaryOperatorAssignmentNode.java   |    87 -
 .../BinaryOperatorBitwiseAndAssignmentNode.java |   101 -
 .../tree/as/BinaryOperatorBitwiseAndNode.java   |    88 -
 ...yOperatorBitwiseLeftShiftAssignmentNode.java |   101 -
 .../as/BinaryOperatorBitwiseLeftShiftNode.java  |    88 -
 .../BinaryOperatorBitwiseOrAssignmentNode.java  |   101 -
 .../tree/as/BinaryOperatorBitwiseOrNode.java    |    88 -
 ...OperatorBitwiseRightShiftAssignmentNode.java |   101 -
 .../as/BinaryOperatorBitwiseRightShiftNode.java |    88 -
 ...BitwiseUnsignedRightShiftAssignmentNode.java |   101 -
 ...ryOperatorBitwiseUnsignedRightShiftNode.java |   100 -
 .../BinaryOperatorBitwiseXorAssignmentNode.java |   101 -
 .../tree/as/BinaryOperatorBitwiseXorNode.java   |    88 -
 .../tree/as/BinaryOperatorCommaNode.java        |    88 -
 .../BinaryOperatorDivisionAssignmentNode.java   |   101 -
 .../tree/as/BinaryOperatorDivisionNode.java     |    88 -
 .../tree/as/BinaryOperatorEqualNode.java        |    88 -
 .../as/BinaryOperatorGreaterThanEqualsNode.java |    88 -
 .../tree/as/BinaryOperatorGreaterThanNode.java  |    88 -
 .../internal/tree/as/BinaryOperatorInNode.java  |    88 -
 .../tree/as/BinaryOperatorInstanceOfNode.java   |    88 -
 .../internal/tree/as/BinaryOperatorIsNode.java  |    88 -
 .../as/BinaryOperatorLessThanEqualsNode.java    |    88 -
 .../tree/as/BinaryOperatorLessThanNode.java     |    88 -
 .../BinaryOperatorLogicalAndAssignmentNode.java |   102 -
 .../tree/as/BinaryOperatorLogicalAndNode.java   |    87 -
 .../BinaryOperatorLogicalOrAssignmentNode.java  |   101 -
 .../tree/as/BinaryOperatorLogicalOrNode.java    |    87 -
 .../as/BinaryOperatorMinusAssignmentNode.java   |   101 -
 .../tree/as/BinaryOperatorMinusNode.java        |    88 -
 .../as/BinaryOperatorModuloAssignmentNode.java  |   101 -
 .../tree/as/BinaryOperatorModuloNode.java       |    88 -
 ...aryOperatorMultiplicationAssignmentNode.java |   101 -
 .../as/BinaryOperatorMultiplicationNode.java    |    88 -
 .../tree/as/BinaryOperatorNodeBase.java         |   396 -
 .../tree/as/BinaryOperatorNotEqualNode.java     |    88 -
 .../as/BinaryOperatorPlusAssignmentNode.java    |   101 -
 .../tree/as/BinaryOperatorPlusNode.java         |   138 -
 .../tree/as/BinaryOperatorStrictEqualNode.java  |    88 -
 .../as/BinaryOperatorStrictNotEqualNode.java    |    88 -
 .../compiler/internal/tree/as/BlockNode.java    |    81 -
 .../compiler/internal/tree/as/CatchNode.java    |   140 -
 .../internal/tree/as/ChainedVariableNode.java   |   179 -
 .../compiler/internal/tree/as/ClassNode.java    |   663 -
 .../internal/tree/as/ClassReferenceNode.java    |    91 -
 .../internal/tree/as/ConditionalNode.java       |   111 -
 .../tree/as/ConfigConditionBlockNode.java       |    74 -
 .../internal/tree/as/ConfigConstNode.java       |   131 -
 .../internal/tree/as/ConfigExpressionNode.java  |   108 -
 .../internal/tree/as/ConfigNamespaceNode.java   |    53 -
 .../internal/tree/as/ContainerNode.java         |   168 -
 .../tree/as/DefaultXMLNamespaceNode.java        |   106 -
 .../internal/tree/as/DoWhileLoopNode.java       |    81 -
 .../internal/tree/as/DynamicAccessNode.java     |    86 -
 .../compiler/internal/tree/as/EmbedNode.java    |   142 -
 .../internal/tree/as/ExpressionNodeBase.java    |   505 -
 .../compiler/internal/tree/as/FileNode.java     |   584 -
 .../internal/tree/as/FixedChildrenNode.java     |    38 -
 .../compiler/internal/tree/as/ForLoopNode.java  |   174 -
 .../compiler/internal/tree/as/FullNameNode.java |   183 -
 .../internal/tree/as/FunctionCallNode.java      |   321 -
 .../compiler/internal/tree/as/FunctionNode.java |  1053 -
 .../internal/tree/as/FunctionObjectNode.java    |   145 -
 .../compiler/internal/tree/as/GetterNode.java   |   116 -
 .../tree/as/IInitializableDefinitionNode.java   |    42 -
 .../internal/tree/as/IdentifierNode.java        |  1048 -
 .../flex/compiler/internal/tree/as/IfNode.java  |   119 -
 .../compiler/internal/tree/as/ImportNode.java   |   240 -
 .../internal/tree/as/InterfaceNode.java         |   388 -
 .../internal/tree/as/IterationFlowNode.java     |   134 -
 .../compiler/internal/tree/as/KeywordNode.java  |   173 -
 .../internal/tree/as/LabeledStatementNode.java  |    94 -
 .../tree/as/LanguageIdentifierNode.java         |   592 -
 .../compiler/internal/tree/as/LiteralNode.java  |   306 -
 .../tree/as/MemberAccessExpressionNode.java     |   310 -
 .../compiler/internal/tree/as/MemberedNode.java |    69 -
 .../compiler/internal/tree/as/ModifierNode.java |   120 -
 .../tree/as/ModifiersContainerNode.java         |    54 -
 .../tree/as/NamespaceAccessExpressionNode.java  |   171 -
 .../tree/as/NamespaceIdentifierNode.java        |   368 -
 .../internal/tree/as/NamespaceNode.java         |   243 -
 .../flex/compiler/internal/tree/as/NilNode.java |    59 -
 .../compiler/internal/tree/as/NodeBase.java     |  1038 -
 .../tree/as/NonResolvingIdentifierNode.java     |    92 -
 .../internal/tree/as/NumericLiteralNode.java    |   284 -
 .../internal/tree/as/ObjectLiteralNode.java     |    92 -
 .../tree/as/ObjectLiteralValuePairNode.java     |   136 -
 .../internal/tree/as/OperatorNodeBase.java      |   130 -
 .../compiler/internal/tree/as/PackageNode.java  |   316 -
 .../internal/tree/as/ParameterNode.java         |   311 -
 .../tree/as/QualifiedNameExpressionNode.java    |    96 -
 .../as/QualifiedNamespaceExpressionNode.java    |   140 -
 .../internal/tree/as/RegExpLiteralNode.java     |   188 -
 .../compiler/internal/tree/as/ReturnNode.java   |    89 -
 .../tree/as/RuntimeNameExpressionNode.java      |   120 -
 .../internal/tree/as/ScopedBlockNode.java       |   243 -
 .../compiler/internal/tree/as/SetterNode.java   |   138 -
 .../compiler/internal/tree/as/SwitchNode.java   |   107 -
 .../compiler/internal/tree/as/TerminalNode.java |   118 -
 .../internal/tree/as/TernaryOperatorNode.java   |   184 -
 .../compiler/internal/tree/as/ThrowNode.java    |    85 -
 .../tree/as/TransparentContainerNode.java       |    58 -
 .../compiler/internal/tree/as/TreeNode.java     |   321 -
 .../flex/compiler/internal/tree/as/TryNode.java |   155 -
 .../internal/tree/as/TypedExpressionNode.java   |   305 -
 .../internal/tree/as/UnaryOperatorAtNode.java   |   111 -
 .../tree/as/UnaryOperatorBitwiseNotNode.java    |    86 -
 .../tree/as/UnaryOperatorDeleteNode.java        |    86 -
 .../tree/as/UnaryOperatorLogicalNotNode.java    |    86 -
 .../tree/as/UnaryOperatorMinusNode.java         |    88 -
 .../internal/tree/as/UnaryOperatorNodeBase.java |   285 -
 .../internal/tree/as/UnaryOperatorPlusNode.java |    88 -
 .../tree/as/UnaryOperatorPostDecrementNode.java |    91 -
 .../tree/as/UnaryOperatorPostIncrementNode.java |    91 -
 .../tree/as/UnaryOperatorPreDecrementNode.java  |    87 -
 .../tree/as/UnaryOperatorPreIncrementNode.java  |    87 -
 .../tree/as/UnaryOperatorTypeOfNode.java        |    86 -
 .../internal/tree/as/UnaryOperatorVoidNode.java |    77 -
 .../internal/tree/as/UseNamespaceNode.java      |   130 -
 .../tree/as/VariableExpressionNode.java         |   134 -
 .../compiler/internal/tree/as/VariableNode.java |   248 -
 .../internal/tree/as/VectorLiteralNode.java     |   154 -
 .../internal/tree/as/WhileLoopNode.java         |    64 -
 .../compiler/internal/tree/as/WithNode.java     |   117 -
 .../internal/tree/as/XMLListLiteralNode.java    |    88 -
 .../internal/tree/as/XMLLiteralNode.java        |   123 -
 .../tree/as/metadata/AccessibilityTagNode.java  |    31 -
 .../tree/as/metadata/AlternativeTagNode.java    |    30 -
 .../as/metadata/BaseDefinitionMetaTagNode.java  |   261 -
 .../tree/as/metadata/BasicMetaTagNode.java      |    57 -
 .../as/metadata/DefaultPropertyTagNode.java     |    91 -
 .../tree/as/metadata/EffectTagNode.java         |   106 -
 .../internal/tree/as/metadata/EventTagNode.java |   104 -
 .../tree/as/metadata/EventTriggerTagNode.java   |   103 -
 .../tree/as/metadata/InspectableTagNode.java    |   225 -
 .../internal/tree/as/metadata/MetaTagNode.java  |   285 -
 .../internal/tree/as/metadata/MetaTagValue.java |    51 -
 .../internal/tree/as/metadata/MetaTagsNode.java |   345 -
 .../tree/as/metadata/MultiValueMetaTagNode.java |    70 -
 .../tree/as/metadata/ResourceBundleTagNode.java |   103 -
 .../tree/as/metadata/SkinClassTagNode.java      |    33 -
 .../internal/tree/as/metadata/StyleTagNode.java |   225 -
 .../internal/tree/as/metadata/TypedTagNode.java |    77 -
 .../flex/compiler/internal/tree/as/package.html |    42 -
 .../as/parts/AccessorFunctionContentsPart.java  |    44 -
 .../internal/tree/as/parts/DecorationPart.java  |   184 -
 .../tree/as/parts/FunctionContentsPart.java     |    99 -
 .../as/parts/IAccessorFunctionContentsPart.java |    29 -
 .../internal/tree/as/parts/IDecorationPart.java |    73 -
 .../tree/as/parts/IFunctionContentsPart.java    |    57 -
 .../tree/as/parts/SparseDecorationPart.java     |    83 -
 .../tree/as/parts/VariableDecorationPart.java   |    79 -
 .../internal/tree/mxml/MXMLApplicationNode.java |   115 -
 .../internal/tree/mxml/MXMLArrayNode.java       |   329 -
 .../tree/mxml/MXMLBindingAttributeNode.java     |   155 -
 .../internal/tree/mxml/MXMLBindingNode.java     |   250 -
 .../internal/tree/mxml/MXMLBooleanNode.java     |    80 -
 .../tree/mxml/MXMLClassDefinitionNode.java      |  1132 -
 .../internal/tree/mxml/MXMLClassNode.java       |   150 -
 .../tree/mxml/MXMLClassReferenceNodeBase.java   |   716 -
 .../internal/tree/mxml/MXMLClearNode.java       |    60 -
 .../mxml/MXMLCompilerDirectiveNodeBase.java     |    69 -
 .../tree/mxml/MXMLCompilerDirectiveParser.java  |   126 -
 .../internal/tree/mxml/MXMLComponentNode.java   |   206 -
 .../mxml/MXMLConcatenatedDataBindingNode.java   |    73 -
 .../tree/mxml/MXMLDataBindingParser.java        |   479 -
 .../tree/mxml/MXMLDeclarationsNode.java         |   155 -
 .../tree/mxml/MXMLDeferredInstanceNode.java     |   208 -
 .../internal/tree/mxml/MXMLDefinitionNode.java  |   217 -
 .../internal/tree/mxml/MXMLDesignLayerNode.java |    97 -
 .../internal/tree/mxml/MXMLDocumentNode.java    |   149 -
 .../tree/mxml/MXMLEffectSpecifierNode.java      |    58 -
 .../internal/tree/mxml/MXMLEmbedNode.java       |   145 -
 .../tree/mxml/MXMLEventSpecifierNode.java       |   305 -
 .../tree/mxml/MXMLExpressionNodeBase.java       |   207 -
 .../internal/tree/mxml/MXMLFactoryNode.java     |   114 -
 .../internal/tree/mxml/MXMLFileNode.java        |   535 -
 .../internal/tree/mxml/MXMLFunctionNode.java    |    99 -
 .../internal/tree/mxml/MXMLHTTPServiceNode.java |    97 -
 .../MXMLHTTPServiceRequestPropertyNode.java     |   112 -
 .../internal/tree/mxml/MXMLImplementsNode.java  |   172 -
 .../tree/mxml/MXMLImplicitImportNode.java       |    65 -
 .../internal/tree/mxml/MXMLInstanceNode.java    |   439 -
 .../internal/tree/mxml/MXMLIntNode.java         |    80 -
 .../internal/tree/mxml/MXMLLibraryNode.java     |   112 -
 .../internal/tree/mxml/MXMLLiteralNode.java     |    82 -
 .../internal/tree/mxml/MXMLMetadataNode.java    |   130 -
 .../internal/tree/mxml/MXMLModelNode.java       |   155 -
 .../MXMLModelPropertyContainerNodeBase.java     |   247 -
 .../tree/mxml/MXMLModelPropertyNode.java        |   159 -
 .../internal/tree/mxml/MXMLModelRootNode.java   |    59 -
 .../internal/tree/mxml/MXMLNodeBase.java        |   954 -
 .../internal/tree/mxml/MXMLNumberNode.java      |    84 -
 .../internal/tree/mxml/MXMLObjectNode.java      |    51 -
 .../internal/tree/mxml/MXMLPrivateNode.java     |    70 -
 .../tree/mxml/MXMLPropertySpecifierNode.java    |   546 -
 .../internal/tree/mxml/MXMLRegExpNode.java      |    78 -
 .../tree/mxml/MXMLRemoteObjectMethodNode.java   |   113 -
 .../tree/mxml/MXMLRemoteObjectNode.java         |    85 -
 .../internal/tree/mxml/MXMLReparentNode.java    |   145 -
 .../internal/tree/mxml/MXMLRepeaterNode.java    |    53 -
 .../internal/tree/mxml/MXMLResourceNode.java    |   155 -
 .../internal/tree/mxml/MXMLScriptNode.java      |   276 -
 .../tree/mxml/MXMLSingleDataBindingNode.java    |    81 -
 .../tree/mxml/MXMLSpecifierNodeBase.java        |   177 -
 .../internal/tree/mxml/MXMLStateNode.java       |   244 -
 .../internal/tree/mxml/MXMLStringNode.java      |   124 -
 .../internal/tree/mxml/MXMLStyleNode.java       |   153 -
 .../tree/mxml/MXMLStyleSpecifierNode.java       |   110 -
 .../internal/tree/mxml/MXMLTreeBuilder.java     |   901 -
 .../internal/tree/mxml/MXMLUintNode.java        |    82 -
 .../internal/tree/mxml/MXMLVectorNode.java      |   323 -
 .../internal/tree/mxml/MXMLWebServiceNode.java  |    85 -
 .../tree/mxml/MXMLWebServiceOperationNode.java  |   113 -
 .../internal/tree/mxml/MXMLXMLListNode.java     |   122 -
 .../internal/tree/mxml/MXMLXMLNode.java         |   227 -
 .../compiler/internal/tree/mxml/XMLBuilder.java |   708 -
 .../compiler/internal/tree/mxml/package.html    |    42 -
 .../properties/ResourceBundleEntryNode.java     |    62 -
 .../tree/properties/ResourceBundleFileNode.java |    69 -
 .../internal/tree/properties/package.html       |    43 -
 .../internal/units/ABCCompilationUnit.java      |   239 -
 .../internal/units/ASCompilationUnit.java       |   649 -
 .../internal/units/CompilationUnitBase.java     |  1150 -
 .../internal/units/EmbedCompilationUnit.java    |   333 -
 .../units/EmbedCompilationUnitFactory.java      |   142 -
 .../internal/units/FXGCompilationUnit.java      |   431 -
 .../units/ImportedASCompilationUnit.java        |    70 -
 .../units/InvisibleCompilationUnit.java         |   228 -
 .../internal/units/MXMLCompilationUnit.java     |   290 -
 .../units/ResourceBundleCompilationUnit.java    |   713 -
 .../units/ResourceModuleCompilationUnit.java    |   277 -
 .../internal/units/SWCCompilationUnit.java      |   488 -
 .../units/ServicesXMLCompilationUnit.java       |   117 -
 .../units/SourceCompilationUnitFactory.java     |   165 -
 .../units/StringToCompilationUnitMap.java       |   456 -
 .../units/StyleModuleCompilationUnit.java       |   268 -
 .../flex/compiler/internal/units/package.html   |    33 -
 .../units/requests/ABCBytesRequestResult.java   |   144 -
 .../requests/ABCFileScopeRequestResult.java     |    64 -
 .../requests/ASFileScopeRequestResult.java      |   142 -
 .../requests/EmbedFileScopeRequestResult.java   |    38 -
 .../requests/FileScopeRequestResultBase.java    |   158 -
 .../internal/units/requests/RequestMaker.java   |   266 -
 .../units/requests/SWFTagsRequestResult.java    |   127 -
 .../units/requests/SyntaxTreeRequestResult.java |    92 -
 .../internal/units/requests/package.html        |    33 -
 .../compiler/internal/workspaces/Workspace.java |  1244 -
 .../compiler/internal/workspaces/package.html   |    33 -
 .../apache/flex/compiler/messages_en.properties |   350 -
 .../apache/flex/compiler/messages_fr.properties |   716 -
 .../apache/flex/compiler/messages_ja.properties |   716 -
 .../flex/compiler/messages_zh_CN.properties     |   716 -
 .../apache/flex/compiler/mxml/IMXMLData.java    |   125 -
 .../flex/compiler/mxml/IMXMLDataManager.java    |    53 -
 .../compiler/mxml/IMXMLInstructionData.java     |    47 -
 .../compiler/mxml/IMXMLLanguageConstants.java   |   414 -
 .../compiler/mxml/IMXMLManifestManager.java     |    82 -
 .../mxml/IMXMLNamespaceAttributeData.java       |    39 -
 .../compiler/mxml/IMXMLNamespaceMapping.java    |    42 -
 .../compiler/mxml/IMXMLTagAttributeData.java    |   168 -
 .../apache/flex/compiler/mxml/IMXMLTagData.java |   234 -
 .../flex/compiler/mxml/IMXMLTextData.java       |   122 -
 .../flex/compiler/mxml/IMXMLTypeConstants.java  |   210 -
 .../flex/compiler/mxml/IMXMLUnitData.java       |   167 -
 .../flex/compiler/mxml/IStateDefinition.java    |    49 -
 .../compiler/mxml/IStateDefinitionBase.java     |    39 -
 .../compiler/mxml/IStateGroupDefinition.java    |    50 -
 .../flex/compiler/mxml/IXMLNameResolver.java    |    73 -
 .../org/apache/flex/compiler/mxml/package.html  |    52 -
 .../src/org/apache/flex/compiler/package.html   |   137 -
 .../compiler/parsing/GenericTokenStream.java    |    77 -
 .../compiler/parsing/IASBalancingScanner.java   |    53 -
 .../apache/flex/compiler/parsing/IASToken.java  |    80 -
 .../flex/compiler/parsing/IASTokenizer.java     |    61 -
 .../apache/flex/compiler/parsing/ICMToken.java  |    91 -
 .../flex/compiler/parsing/IMXMLToken.java       |   103 -
 .../flex/compiler/parsing/IMXMLTokenizer.java   |    48 -
 .../flex/compiler/parsing/IMetadataParser.java  |    29 -
 .../flex/compiler/parsing/MXMLTokenFactory.java |    52 -
 .../flex/compiler/parsing/MXMLTokenTypes.java   |   143 -
 .../apache/flex/compiler/parsing/package.html   |    44 -
 .../problems/ANELibraryNotAllowedProblem.java   |    44 -
 .../problems/ASDocNotClosedProblem.java         |    41 -
 .../problems/AbstractDeprecatedAPIProblem.java  |    36 -
 .../problems/AbstractSemanticProblem.java       |    46 -
 .../problems/AccessUndefinedMemberProblem.java  |    45 -
 ...AccessUndefinedPropertyInPackageProblem.java |    50 -
 .../AccessUndefinedPropertyProblem.java         |    44 -
 .../problems/AccessorTypesMustMatchProblem.java |    38 -
 .../problems/AmbiguousGotoTargetProblem.java    |    57 -
 .../problems/AmbiguousReferenceProblem.java     |    41 -
 .../AnyNamespaceCannotBeQualifierProblem.java   |    38 -
 .../compiler/problems/ArrayCastProblem.java     |    44 -
 .../compiler/problems/ArrayDowncastProblem.java |    44 -
 .../compiler/problems/AssignToConstProblem.java |    40 -
 .../problems/AssignToFunctionProblem.java       |    46 -
 .../AssignToNonReferenceValueProblem.java       |    40 -
 .../AssignToReadOnlyPropertyProblem.java        |    43 -
 .../AssignmentInConditionalProblem.java         |    42 -
 .../AttemptToDeleteFixedPropertyProblem.java    |    44 -
 .../AttributesAreNotCallableProblem.java        |    39 -
 ...tesNotAllowedOnPackageDefinitionProblem.java |    46 -
 .../BURMDiagnosticForEachExpectedInProblem.java |    42 -
 .../BURMDiagnosticNotAllowedHereProblem.java    |    43 -
 .../BURMPatternMatchFailureProblem.java         |    44 -
 .../BadAccessInterfaceMemberProblem.java        |    46 -
 .../compiler/problems/BadCharacterProblem.java  |    41 -
 .../problems/BadSetterReturnTypeProblem.java    |    41 -
 .../problems/BaseClassIsFinalProblem.java       |    41 -
 .../compiler/problems/CSSCodeGenProblem.java    |    38 -
 .../compiler/problems/CSSEmbedAssetProblem.java |    46 -
 .../CSSExcludedStylePropertyProblem.java        |    48 -
 .../compiler/problems/CSSParserProblem.java     |    74 -
 .../flex/compiler/problems/CSSProblem.java      |    38 -
 .../CSSUndefinedNamespacePrefixProblem.java     |    46 -
 .../problems/CSSUndefinedTypeProblem.java       |    46 -
 .../CSSUnknownDefaultNamespaceProblem.java      |    48 -
 .../CSSUnresolvedClassReferenceProblem.java     |    45 -
 .../problems/CSSUnusedTypeSelectorProblem.java  |    42 -
 .../problems/CallUndefinedMethodProblem.java    |    42 -
 .../problems/CanNotInsertSemicolonProblem.java  |    40 -
 .../CannotDeleteSuperDescendantsProblem.java    |    44 -
 .../problems/CannotExtendClassProblem.java      |    46 -
 .../problems/CannotExtendInterfaceProblem.java  |    48 -
 .../CannotResolveConfigExpressionProblem.java   |    41 -
 ...olveProjectLevelConfigExpressionProblem.java |    39 -
 .../problems/CircularTypeReferenceProblem.java  |    42 -
 .../ClassesMappedToSameRemoteAliasProblem.java  |    43 -
 .../problems/CodegenInternalProblem.java        |    59 -
 .../flex/compiler/problems/CodegenProblem.java  |    39 -
 .../ComparisonBetweenUnrelatedTypesProblem.java |    48 -
 .../problems/CompiledAsAComponentProblem.java   |    46 -
 .../flex/compiler/problems/CompilerProblem.java |   222 -
 .../problems/CompilerProblemClassification.java |    40 -
 .../problems/CompilerProblemSeverity.java       |    41 -
 .../problems/ComponentTagWithoutURIProblem.java |    46 -
 .../ConfigurationFileNotFoundProblem.java       |    37 -
 .../compiler/problems/ConfigurationProblem.java |    59 -
 ...flictingInheritedNameInNamespaceProblem.java |    45 -
 .../ConflictingNameInNamespaceProblem.java      |    44 -
 .../problems/ConstNotInitializedProblem.java    |    39 -
 .../ConstructorCannotHaveReturnTypeProblem.java |    38 -
 .../problems/ConstructorInInterfaceProblem.java |    45 -
 .../ConstructorIsGetterSetterProblem.java       |    38 -
 .../problems/ConstructorIsStaticProblem.java    |    40 -
 .../ConstructorMustBePublicProblem.java         |    41 -
 .../CountedForLoopInitializerProblem.java       |    42 -
 .../problems/CyclicalIncludesProblem.java       |    38 -
 .../flex/compiler/problems/DateCastProblem.java |    49 -
 .../DecrementMustBeReferenceProblem.java        |    42 -
 .../DefinitionShadowedByPackageNameProblem.java |    35 -
 .../DependencyNotCompatibleProblem.java         |    44 -
 .../compiler/problems/DeprecatedAPIProblem.java |    42 -
 .../DeprecatedAPIWithMessageProblem.java        |    41 -
 .../DeprecatedAPIWithReplacementProblem.java    |    43 -
 ...ecatedAPIWithSinceAndReplacementProblem.java |    46 -
 .../problems/DeprecatedAPIWithSinceProblem.java |    45 -
 .../DeprecatedConfigurationOptionProblem.java   |    48 -
 .../problems/DuplicateAttributeProblem.java     |    41 -
 .../DuplicateClassDefinitionProblem.java        |    45 -
 .../DuplicateFunctionDefinitionProblem.java     |    45 -
 .../DuplicateInterfaceDefinitionProblem.java    |    45 -
 .../problems/DuplicateInterfaceProblem.java     |    55 -
 .../problems/DuplicateLabelProblem.java         |    39 -
 .../DuplicateNamespaceDefinitionProblem.java    |    39 -
 .../DuplicateQNameInSourcePathProblem.java      |    46 -
 .../problems/DuplicateScriptProblem.java        |    42 -
 .../problems/DuplicateSkinStateProblem.java     |    53 -
 .../problems/DuplicateSourceFileProblem.java    |    42 -
 .../problems/DuplicateSwitchCaseProblem.java    |    45 -
 .../DuplicateVariableDefinitionProblem.java     |    48 -
 .../problems/DynamicNotOnClassProblem.java      |    42 -
 .../problems/EmbedAS2TagsModifiedProblem.java   |    43 -
 .../EmbedBadScalingGridTargetProblem.java       |    46 -
 ...ouldNotDetermineSampleFrameCountProblem.java |    42 -
 .../EmbedExceptionWhileTranscodingProblem.java  |    40 -
 .../problems/EmbedInitialValueProblem.java      |    37 -
 .../EmbedInvalidAttributeValueProblem.java      |    40 -
 .../EmbedInvalidUnicodeRangeProblem.java        |    40 -
 .../problems/EmbedMissingSymbolProblem.java     |    46 -
 .../EmbedMovieScalingNoSymbolProblem.java       |    41 -
 .../problems/EmbedMultipleMetaTagsProblem.java  |    42 -
 .../problems/EmbedNoSkinClassProblem.java       |    42 -
 .../problems/EmbedNoSourceAttributeProblem.java |    38 -
 .../EmbedOnlyOnClassesAndVarsProblem.java       |    38 -
 .../EmbedQualityRequiresCompressionProblem.java |    39 -
 .../problems/EmbedQualityValueProblem.java      |    41 -
 .../problems/EmbedScalingGridProblem.java       |    40 -
 .../problems/EmbedScalingGridValueProblem.java  |    40 -
 .../problems/EmbedSkinClassNotFoundProblem.java |    42 -
 ...bedSourceAttributeCouldNotBeReadProblem.java |    39 -
 ...EmbedSourceAttributeDoesNotExistProblem.java |    64 -
 .../EmbedSourceFileNotFoundProblem.java         |    37 -
 .../problems/EmbedTypeNotEmbeddableProblem.java |    42 -
 .../EmbedUnableToReadSourceProblem.java         |    42 -
 .../problems/EmbedUnknownAttributeProblem.java  |    37 -
 .../problems/EmbedUnknownMimeTypeProblem.java   |    39 -
 .../EmbedUnrecogniedFileTypeProblem.java        |    37 -
 .../EmbedUnsupportedAttributeProblem.java       |    41 -
 .../EmbedUnsupportedSamplingRateProblem.java    |    44 -
 .../problems/EmbedUnsupportedTypeProblem.java   |    37 -
 ...tDefinitionKeywordAfterAttributeProblem.java |    49 -
 .../ExpectXmlBeforeNamespaceProblem.java        |    46 -
 ...ExtraCharactersAfterEndOfProgramProblem.java |    38 -
 .../ExtraneousSuperStatementProblem.java        |    40 -
 .../FXGChildNodeNotSupportedProblem.java        |    37 -
 .../FXGContentNotContiguousProblem.java         |    37 -
 .../problems/FXGDefinitionNotFoundProblem.java  |    37 -
 .../problems/FXGErrorEmbeddingImageProblem.java |    39 -
 .../problems/FXGInvalidBooleanValueProblem.java |    36 -
 ...XGInvalidChildColorTransformNodeProblem.java |    37 -
 .../FXGInvalidChildMatrixNodeProblem.java       |    35 -
 .../problems/FXGInvalidChildNodeProblem.java    |    38 -
 .../FXGInvalidColorMatrixValueProblem.java      |    36 -
 .../problems/FXGInvalidColorValueProblem.java   |    34 -
 .../FXGInvalidDefinitionNameProblem.java        |    39 -
 .../problems/FXGInvalidDoubleValueProblem.java  |    34 -
 .../problems/FXGInvalidFloatValueProblem.java   |    34 -
 .../FXGInvalidGroupIDAttributeProblem.java      |    36 -
 .../problems/FXGInvalidIntegerValueProblem.java |    34 -
 .../FXGInvalidLibraryElementProblem.java        |    37 -
 .../problems/FXGInvalidMaskElementProblem.java  |    37 -
 .../FXGInvalidNestingElementsProblem.java       |    37 -
 .../FXGInvalidNodeAttributeProblem.java         |    38 -
 .../problems/FXGInvalidPathDataProblem.java     |    33 -
 .../problems/FXGInvalidPercentValueProblem.java |    34 -
 ...validRectRadiusXRadiusYAttributeProblem.java |    33 -
 .../problems/FXGInvalidRootNodeProblem.java     |    35 -
 .../FXGInvalidScaleGridGroupChildProblem.java   |    35 -
 ...nvalidScaleGridRotationAttributeProblem.java |    35 -
 .../problems/FXGInvalidTabStopsProblem.java     |    36 -
 .../problems/FXGInvalidVersionProblem.java      |    37 -
 .../problems/FXGMissingAttributeProblem.java    |    38 -
 .../FXGMissingGroupChildNodeProblem.java        |    37 -
 .../problems/FXGMultipleElementProblem.java     |    37 -
 .../problems/FXGOutOfRangeValueProblem.java     |    38 -
 .../compiler/problems/FXGParserProblem.java     |    36 -
 ...GPrivateElementNotChildOfGraphicProblem.java |    36 -
 .../FXGPrivateElementNotLastProblem.java        |    38 -
 .../flex/compiler/problems/FXGProblem.java      |    50 -
 .../compiler/problems/FXGScanningProblem.java   |    36 -
 .../problems/FXGUndefinedPropertyProblem.java   |    36 -
 .../FXGUnknownAttributeValueProblem.java        |    38 -
 .../FXGUnknownElementInVersionProblem.java      |    39 -
 .../FXGVersionHandlerNotRegisteredProblem.java  |    37 -
 .../flex/compiler/problems/FatalProblem.java    |    47 -
 .../flex/compiler/problems/FileIOProblem.java   |    39 -
 .../problems/FileInLibraryIOProblem.java        |    43 -
 .../problems/FileInLibraryNotFoundProblem.java  |    41 -
 .../compiler/problems/FileNotFoundProblem.java  |    55 -
 .../compiler/problems/FileWriteProblem.java     |    39 -
 .../problems/FinalOutsideClassProblem.java      |    43 -
 ...FlexOnlyConfigurationOptionNotSupported.java |    44 -
 .../problems/FontEmbeddingNotSupported.java     |    42 -
 .../ForwardReferenceToBaseClassProblem.java     |    51 -
 .../FunctionNotMarkedOverrideProblem.java       |    43 -
 .../problems/FunctionWithoutBodyProblem.java    |    39 -
 .../GetterCannotHaveParametersProblem.java      |    38 -
 .../problems/GetterMustNotBeVoidProblem.java    |    35 -
 .../problems/GlobalBindablePropertyProblem.java |    40 -
 .../HostComponentClassNotFoundProblem.java      |    43 -
 .../HostComponentMustHaveTypeProblem.java       |    41 -
 .../compiler/problems/ICompilerProblem.java     |    53 -
 .../IllegalAssignmentToClassProblem.java        |    43 -
 .../IllogicalComparionWithNaNProblem.java       |    36 -
 ...IllogicalComparisonWithUndefinedProblem.java |    35 -
 .../ImplicitCoercionToSubtypeProblem.java       |    45 -
 .../ImplicitCoercionToUnrelatedTypeProblem.java |    44 -
 ...TypeCheckCoercionToUnrelatedTypeProblem.java |    48 -
 .../ImproperlyConfiguredTargetProblem.java      |    53 -
 .../InaccessibleMethodReferenceProblem.java     |    45 -
 .../InaccessiblePropertyReferenceProblem.java   |    45 -
 ...compatibleDefaultValueOfTypeNullProblem.java |    38 -
 .../IncompatibleInitializerTypeProblem.java     |    59 -
 .../IncompatibleInterfaceMethodProblem.java     |    50 -
 .../problems/IncompatibleOverrideProblem.java   |    42 -
 .../IncrementMustBeReferenceProblem.java        |    42 -
 .../InitializerValueNotAnIntegerProblem.java    |    61 -
 .../InitializerValueOutOfRangeProblem.java      |    63 -
 ...neFunctionNotFinalStaticOrGlobalProblem.java |    41 -
 .../problems/InlineFunctionTooLargeProblem.java |    39 -
 ...InlineNestedInliningNotSupportedProblem.java |    35 -
 .../problems/InlineNoSourceProblem.java         |    35 -
 .../InlineUnsupportedInstructionProblem.java    |    35 -
 .../problems/InlineUnsupportedNodeProblem.java  |    40 -
 .../compiler/problems/InstanceOfProblem.java    |    37 -
 .../InterfaceBindablePropertyProblem.java       |    39 -
 .../InterfaceCannotBeInstantiatedProblem.java   |    42 -
 .../InterfaceMethodOverrideProblem.java         |    46 -
 .../InterfaceMethodWithBodyProblem.java         |    41 -
 .../problems/InterfaceModifierProblem.java      |    41 -
 .../InterfaceNamespaceAttributeProblem.java     |    39 -
 .../problems/InternalCompilerProblem.java       |    49 -
 .../problems/InternalCompilerProblem2.java      |    60 -
 .../problems/InvalidABCByteCodeProblem.java     |    35 -
 .../problems/InvalidAttributeProblem.java       |    38 -
 .../problems/InvalidBackgroundColorProblem.java |    36 -
 .../InvalidByteCodeGeneratedProblem.java        |    65 -
 .../problems/InvalidConfigLocationProblem.java  |    51 -
 .../InvalidDecrementOperandProblem.java         |    40 -
 .../InvalidForInInitializerProblem.java         |    42 -
 .../problems/InvalidImportFileProblem.java      |    38 -
 .../InvalidIncrementOperandProblem.java         |    40 -
 .../compiler/problems/InvalidLabelProblem.java  |    38 -
 .../compiler/problems/InvalidLvalueProblem.java |    39 -
 .../InvalidNamespaceInitializerProblem.java     |    39 -
 .../problems/InvalidNamespaceProblem.java       |    41 -
 .../problems/InvalidOverrideProblem.java        |    46 -
 .../InvalidPrivateNamespaceAttrProblem.java     |    42 -
 .../InvalidPrivateNamespaceProblem.java         |    42 -
 .../InvalidProtectedNamespaceAttrProblem.java   |    42 -
 .../InvalidProtectedNamespaceProblem.java       |    41 -
 .../InvalidPublicNamespaceAttrProblem.java      |    42 -
 .../problems/InvalidPublicNamespaceProblem.java |    41 -
 .../InvalidRestParameterDeclarationProblem.java |    44 -
 .../problems/InvalidSuperExpressionProblem.java |    42 -
 .../problems/InvalidSuperStatementProblem.java  |    39 -
 .../compiler/problems/InvalidTypeProblem.java   |    41 -
 .../problems/LibraryNotFoundProblem.java        |    38 -
 .../problems/LocalBindablePropertyProblem.java  |    41 -
 .../problems/LossyConversionProblem.java        |    43 -
 .../problems/MXMLAttributeVersionProblem.java   |    44 -
 .../compiler/problems/MXMLClassNodeProblem.java |    45 -
 .../MXMLConstructorHasParametersProblem.java    |    44 -
 .../MXMLContentAfterRootTagProblem.java         |    38 -
 .../MXMLContentBeforeRootTagProblem.java        |    38 -
 ...MXMLDatabindingSourceNotBindableProblem.java |    47 -
 .../problems/MXMLDualContentProblem.java        |    44 -
 .../problems/MXMLDuplicateAttributeProblem.java |    44 -
 .../problems/MXMLDuplicateChildTagProblem.java  |    44 -
 .../problems/MXMLDuplicateIDProblem.java        |    41 -
 .../problems/MXMLEmptyAttributeProblem.java     |    41 -
 .../problems/MXMLEmptyEventHandlerProblem.java  |    40 -
 ...xecutableStatementsInScriptBlockProblem.java |    40 -
 .../problems/MXMLFinalClassProblem.java         |    46 -
 .../MXMLIncludeInAndExcludeFromProblem.java     |    42 -
 .../MXMLIncompatibleArrayElementProblem.java    |    48 -
 .../MXMLIncompatibleVectorElementProblem.java   |    40 -
 ...MXMLInvalidDatabindingExpressionProblem.java |    37 -
 .../MXMLInvalidDefinitionNameProblem.java       |    44 -
 .../problems/MXMLInvalidEntityProblem.java      |    40 -
 .../compiler/problems/MXMLInvalidIDProblem.java |    42 -
 .../MXMLInvalidItemCreationPolicyProblem.java   |    42 -
 ...MXMLInvalidItemDestructionPolicyProblem.java |    42 -
 .../problems/MXMLInvalidPercentageProblem.java  |    45 -
 .../MXMLInvalidSourceAttributeProblem.java      |    47 -
 .../problems/MXMLInvalidStyleProblem.java       |    55 -
 .../problems/MXMLInvalidTextForTypeProblem.java |    43 -
 .../MXMLInvalidVectorFixedAttributeProblem.java |    42 -
 .../MXMLInvalidVectorTypeAttributeProblem.java  |    44 -
 .../MXMLLibraryTagNotTheFirstChildProblem.java  |    41 -
 .../problems/MXMLMissingRootTagProblem.java     |    36 -
 .../MXMLMissingVectorTypeAttributeProblem.java  |    43 -
 .../problems/MXMLMultipleRootTagsProblem.java   |    38 -
 .../MXMLNoAllowedAttributesProblem.java         |    40 -
 .../compiler/problems/MXMLNotAClassProblem.java |    45 -
 .../MXMLOtherLanguageNamespaceProblem.java      |    38 -
 ...MXMLOuterDocumentAlreadyDeclaredProblem.java |    43 -
 .../MXMLPercentageNotAllowedProblem.java        |    45 -
 .../problems/MXMLPrivateAttributeProblem.java   |    40 -
 .../problems/MXMLPrivateTagLocationProblem.java |    41 -
 .../problems/MXMLRequiredAttributeProblem.java  |    43 -
 ...LSameBindingSourceAndDestinationProblem.java |    38 -
 .../compiler/problems/MXMLSemanticProblem.java  |    47 -
 .../compiler/problems/MXMLSyntaxProblem.java    |    40 -
 .../problems/MXMLUnclosedTagProblem.java        |    56 -
 .../MXMLUnexpectedAttributeProblem.java         |    38 -
 .../MXMLUnexpectedDatabindingProblem.java       |    38 -
 .../problems/MXMLUnexpectedTagProblem.java      |    38 -
 .../problems/MXMLUnexpectedTextProblem.java     |    38 -
 .../problems/MXMLUnknownNamespaceProblem.java   |    45 -
 .../problems/MXMLUnknownXMLFormatProblem.java   |    42 -
 ...XMLUnrecognizedCompilerDirectiveProblem.java |    42 -
 .../problems/MXMLUnresolvedTagProblem.java      |    42 -
 .../problems/MXMLUnterminatedEntityProblem.java |    38 -
 .../MXMLXMLListMixedContentProblem.java         |    38 -
 .../problems/MXMLXMLOnlyOneRootTagProblem.java  |    39 -
 ...XMLProcessingInstructionLocationProblem.java |    42 -
 .../problems/MXMLXMLRequireContentProblem.java  |    38 -
 .../flex/compiler/problems/ManifestProblem.java |    40 -
 .../MethodCannotBeConstructorProblem.java       |    40 -
 .../problems/MissingBuiltinProblem.java         |    48 -
 .../problems/MissingCatchOrFinallyProblem.java  |    45 -
 ...ssingFactoryClassInFrameMetadataProblem.java |    42 -
 ...ssingLeftBraceBeforeFunctionBodyProblem.java |    40 -
 .../problems/MissingPropertyNameProblem.java    |    33 -
 .../MissingRequirementConfigurationProblem.java |    38 -
 .../problems/MissingSignedDigestProblem.java    |    39 -
 .../problems/MissingSkinPartProblem.java        |    40 -
 .../problems/MissingSkinStateProblem.java       |    38 -
 .../problems/MissingUnsignedDigestProblem.java  |    39 -
 ...ltipleConfigNamespaceDecorationsProblem.java |    35 -
 .../MultipleContructorDefinitionsProblem.java   |    39 -
 ...ipleExternallyVisibleDefinitionsProblem.java |    38 -
 .../MultipleNamespaceAttributesProblem.java     |    38 -
 ...tipleReservedNamespaceAttributesProblem.java |    44 -
 .../problems/MultipleSwitchDefaultsProblem.java |    39 -
 .../NamespaceAttributeNotAllowedProblem.java    |    56 -
 .../problems/NamespaceInInterfaceProblem.java   |    39 -
 .../NamespaceOverrideInsideFunctionProblem.java |    37 -
 .../problems/NativeMethodWithBodyProblem.java   |    39 -
 .../problems/NativeNotOnFunctionProblem.java    |    42 -
 .../problems/NativeUsedInInterfaceProblem.java  |    42 -
 .../problems/NativeVariableProblem.java         |    41 -
 .../compiler/problems/NestedClassProblem.java   |    39 -
 .../problems/NestedGetterSetterProblem.java     |    39 -
 .../problems/NestedInterfaceProblem.java        |    39 -
 .../compiler/problems/NestedPackageProblem.java |    38 -
 .../NoCompilationUnitForDefinitionProblem.java  |    35 -
 .../NoDefaultConstructorInBaseClassProblem.java |    42 -
 .../NoDefinitionForSWCDependencyProblem.java    |    44 -
 .../problems/NoMainDefinitionProblem.java       |    46 -
 .../NoScopesInABCCompilationUnitProblem.java    |    34 -
 .../NoSourceForClassInNamespaceProblem.java     |    36 -
 .../problems/NoSourceForClassProblem.java       |    34 -
 .../problems/NonConstConfigVarProblem.java      |    38 -
 .../problems/NonConstantConfigInitProblem.java  |    55 -
 .../NonConstantParamInitializerProblem.java     |    39 -
 .../NonDirectoryInSourcePathProblem.java        |    43 -
 .../NullUsedWhereOtherExpectedProblem.java      |    38 -
 .../OnlyOneHostComponentAllowedProblem.java     |    40 -
 .../problems/OperandStackUnderflowProblem.java  |    46 -
 .../problems/OverlappingSourcePathProblem.java  |    46 -
 .../compiler/problems/OverrideFinalProblem.java |    42 -
 .../problems/OverrideNotFoundProblem.java       |    43 -
 .../problems/OverrideOutsideClassProblem.java   |    44 -
 .../PackageCannotBeUsedAsValueProblem.java      |    43 -
 .../flex/compiler/problems/ParserProblem.java   |    48 -
 .../problems/PropertyIsWriteOnlyProblem.java    |    43 -
 .../PrototypeInvalidAttributeProblem.java       |    39 -
 .../RemovedConfigurationOptionProblem.java      |    44 -
 .../RequiredParameterAfterOptionalProblem.java  |    40 -
 .../ResourceBundleMalformedEncodingProblem.java |    38 -
 .../ResourceBundleNoBundleParameterProblem.java |    41 -
 .../ResourceBundleNoKeyParameterProblem.java    |    38 -
 .../ResourceBundleNotFoundForLocaleProblem.java |    52 -
 .../problems/ResourceBundleNotFoundProblem.java |    51 -
 ...estParamAndArgumentsUsedTogetherProblem.java |    38 -
 .../RestParameterMustBeLastProblem.java         |    41 -
 .../ReturnCannotBeUsedInGlobalProblem.java      |    44 -
 .../ReturnCannotBeUsedInPackageProblem.java     |    43 -
 .../ReturnCannotBeUsedInStaticProblem.java      |    43 -
 .../problems/ReturnMustReturnValueProblem.java  |    40 -
 .../ReturnValueHasNoTypeDeclarationProblem.java |    39 -
 .../ReturnValueInConstructorProblem.java        |    40 -
 .../ReturnValueMustBeUndefinedProblem.java      |    42 -
 ...SMTextSettingsWrongReferenceTypeProblem.java |    40 -
 .../problems/SWFCharacterIDNotFoundProblem.java |    53 -
 ...ontAlignZonesLinkToIncorrectFontProblem.java |    53 -
 .../problems/SWFFrameCountMismatchProblem.java  |    48 -
 .../problems/SWFInvalidSignatureProblem.java    |    40 -
 .../problems/SWFTagLengthTooLongProblem.java    |    57 -
 .../problems/SWFUnableToReadTagBodyProblem.java |    55 -
 .../problems/SWFUnexpectedEndOfFileProblem.java |    42 -
 .../problems/SWFUnknownFillStyleProblem.java    |    53 -
 .../problems/ScopeStackUnderflowProblem.java    |    44 -
 .../ScopedToDefaultNamespaceProblem.java        |    43 -
 .../flex/compiler/problems/SemanticProblem.java |    47 -
 .../problems/SemanticWarningProblem.java        |    38 -
 .../SetterCannotHaveOptionalProblem.java        |    38 -
 .../SetterMustHaveOneParameterProblem.java      |    38 -
 .../ShadowedConfigNamespaceProblem.java         |    40 -
 .../problems/SkinPartsMustBePublicProblem.java  |    41 -
 .../problems/SourcePathNotFoundProblem.java     |    38 -
 .../problems/StaticAndOverrideProblem.java      |    42 -
 .../StaticNamespaceDefinitionProblem.java       |    42 -
 .../problems/StaticOutsideClassProblem.java     |    42 -
 .../problems/StrictSemanticsProblem.java        |    34 -
 .../problems/StrictUndefinedMethodProblem.java  |    44 -
 ...lMustBeTerminatedBeforeLineBreakProblem.java |    42 -
 .../problems/StringLiteralNotClosedProblem.java |    42 -
 .../flex/compiler/problems/SyntaxProblem.java   |    51 -
 .../ThisUsedInStaticFunctionProblem.java        |    43 -
 .../TooFewFunctionParametersProblem.java        |    42 -
 .../TooManyFunctionParametersProblem.java       |    42 -
 .../problems/UnableToBuildReportProblem.java    |    42 -
 .../problems/UnableToBuildSWFProblem.java       |    35 -
 .../problems/UnableToBuildSWFTagProblem.java    |    36 -
 .../UnableToCreateLinkReportProblem.java        |    42 -
 .../UnableToFindRootClassDefinitionProblem.java |    39 -
 .../problems/UnableToListFilesProblem.java      |    41 -
 .../problems/UnboundMetadataProblem.java        |    39 -
 .../problems/UndefinedConfigNameProblem.java    |    40 -
 .../UndefinedConfigNamespaceProblem.java        |    41 -
 .../compiler/problems/UnexpectedEOFProblem.java |    39 -
 .../problems/UnexpectedExceptionProblem.java    |    39 -
 .../problems/UnexpectedReturnProblem.java       |    42 -
 .../problems/UnexpectedTokenProblem.java        |    38 -
 .../problems/UnfoundPropertyProblem.java        |    40 -
 .../UnimplementedInterfaceMethodProblem.java    |    49 -
 .../problems/UnknownBreakTargetProblem.java     |    41 -
 .../problems/UnknownContinueTargetProblem.java  |    41 -
 .../problems/UnknownGotoTargetProblem.java      |    39 -
 .../compiler/problems/UnknownImportProblem.java |    41 -
 .../problems/UnknownInterfaceProblem.java       |    53 -
 .../problems/UnknownNamespaceProblem.java       |    41 -
 .../problems/UnknownSuperclassProblem.java      |    49 -
 .../compiler/problems/UnknownTypeProblem.java   |    42 -
 .../problems/UnknownWildcardImportProblem.java  |    42 -
 .../problems/UnreachableBlockProblem.java       |    45 -
 .../UnresolvedClassReferenceProblem.java        |    41 -
 .../problems/UnresolvedNamespaceProblem.java    |    38 -
 .../problems/UnsupportedSourceFileProblem.java  |    46 -
 .../problems/VarInInterfaceProblem.java         |    42 -
 ...bleDefinitionDuplicatesParameterProblem.java |    52 -
 .../VariableHasNoTypeDeclarationProblem.java    |    45 -
 .../problems/VirtualOutsideClassProblem.java    |    43 -
 .../flex/compiler/problems/VoidTypeProblem.java |    41 -
 .../compiler/problems/WrongSkinPartProblem.java |    44 -
 .../XMLOpenCloseTagNotMatchProblem.java         |    44 -
 .../problems/annotations/DefaultSeverity.java   |    47 -
 .../annotations/ProblemClassification.java      |    48 -
 .../compiler/problems/annotations/package.html  |    28 -
 .../collections/CompositeProblemFilter.java     |   105 -
 .../problems/collections/FilteredIterator.java  |   137 -
 .../compiler/problems/collections/package.html  |    26 -
 .../apache/flex/compiler/problems/package.html  |    50 -
 .../flex/compiler/projects/IASCProject.java     |    28 -
 .../flex/compiler/projects/IASProject.java      |   248 -
 .../compiler/projects/ICompilerProject.java     |   232 -
 .../flex/compiler/projects/IFlexProject.java    |   208 -
 .../flex/compiler/projects/ProjectFactory.java  |    44 -
 .../apache/flex/compiler/projects/package.html  |   170 -
 .../apache/flex/compiler/scopes/IASScope.java   |   115 -
 .../flex/compiler/scopes/IDefinitionSet.java    |    56 -
 .../apache/flex/compiler/scopes/IFileScope.java |    52 -
 .../compiler/scopes/IFileScopeProvider.java     |    42 -
 .../apache/flex/compiler/scopes/package.html    |    62 -
 .../flex/compiler/targets/ISWCTarget.java       |    64 -
 .../flex/compiler/targets/ISWFTarget.java       |    44 -
 .../apache/flex/compiler/targets/ITarget.java   |   102 -
 .../targets/ITargetProgressMonitor.java         |    68 -
 .../flex/compiler/targets/ITargetReport.java    |   120 -
 .../flex/compiler/targets/ITargetSettings.java  |   485 -
 .../compiler/targets/TargetSettingsProxy.java   |   331 -
 .../apache/flex/compiler/targets/package.html   |    61 -
 .../apache/flex/compiler/tree/ASTNodeID.java    |   349 -
 .../apache/flex/compiler/tree/as/IASNode.java   |   133 -
 .../flex/compiler/tree/as/IAccessorNode.java    |    33 -
 .../compiler/tree/as/IBinaryOperatorNode.java   |    55 -
 .../flex/compiler/tree/as/IBlockNode.java       |    34 -
 .../flex/compiler/tree/as/ICatchNode.java       |    57 -
 .../flex/compiler/tree/as/IClassNode.java       |   105 -
 .../flex/compiler/tree/as/ICommonClassNode.java |    74 -
 .../tree/as/ICompoundAssignmentNode.java        |    71 -
 .../flex/compiler/tree/as/IConditionalNode.java |    34 -
 .../flex/compiler/tree/as/IContainerNode.java   |    88 -
 .../tree/as/IDefaultXMLNamespaceNode.java       |    57 -
 .../flex/compiler/tree/as/IDefinitionNode.java  |   154 -
 .../tree/as/IDocumentableDefinitionNode.java    |    46 -
 .../compiler/tree/as/IDynamicAccessNode.java    |    40 -
 .../flex/compiler/tree/as/IEmbedNode.java       |    57 -
 .../flex/compiler/tree/as/IExpressionNode.java  |    88 -
 .../apache/flex/compiler/tree/as/IFileNode.java |   115 -
 .../compiler/tree/as/IFileNodeAccumulator.java  |    83 -
 .../flex/compiler/tree/as/IForLoopNode.java     |   119 -
 .../compiler/tree/as/IFunctionCallNode.java     |   146 -
 .../flex/compiler/tree/as/IFunctionNode.java    |   187 -
 .../compiler/tree/as/IFunctionObjectNode.java   |    36 -
 .../flex/compiler/tree/as/IGetterNode.java      |    28 -
 .../flex/compiler/tree/as/IIdentifierNode.java  |    82 -
 .../apache/flex/compiler/tree/as/IIfNode.java   |   120 -
 .../flex/compiler/tree/as/IImportNode.java      |   115 -
 .../flex/compiler/tree/as/IInterfaceNode.java   |   133 -
 .../compiler/tree/as/IIterationFlowNode.java    |    74 -
 .../flex/compiler/tree/as/IKeywordNode.java     |    42 -
 .../compiler/tree/as/ILabeledStatementNode.java |    38 -
 .../tree/as/ILanguageIdentifierNode.java        |    77 -
 .../compiler/tree/as/ILiteralContainerNode.java |    41 -
 .../flex/compiler/tree/as/ILiteralNode.java     |   187 -
 .../tree/as/IMemberAccessExpressionNode.java    |    46 -
 .../flex/compiler/tree/as/IModifierNode.java    |    44 -
 .../tree/as/INamespaceAccessExpressionNode.java |    27 -
 .../tree/as/INamespaceDecorationNode.java       |    50 -
 .../flex/compiler/tree/as/INamespaceNode.java   |    71 -
 .../tree/as/INonResolvingIdentifierNode.java    |    28 -
 .../compiler/tree/as/INumericLiteralNode.java   |   111 -
 .../tree/as/IObjectLiteralValuePairNode.java    |    58 -
 .../flex/compiler/tree/as/IOperatorNode.java    |   395 -
 .../flex/compiler/tree/as/IPackageNode.java     |    59 -
 .../flex/compiler/tree/as/IParameterNode.java   |    76 -
 .../compiler/tree/as/IRegExpLiteralNode.java    |   118 -
 .../flex/compiler/tree/as/IReturnNode.java      |    47 -
 .../compiler/tree/as/IScopedDefinitionNode.java |    36 -
 .../flex/compiler/tree/as/IScopedNode.java      |    62 -
 .../flex/compiler/tree/as/ISetterNode.java      |    28 -
 .../flex/compiler/tree/as/IStatementNode.java   |    45 -
 .../flex/compiler/tree/as/ISwitchNode.java      |    85 -
 .../flex/compiler/tree/as/ITerminalNode.java    |   121 -
 .../compiler/tree/as/ITernaryOperatorNode.java  |    66 -
 .../flex/compiler/tree/as/IThrowNode.java       |    45 -
 .../tree/as/ITransparentContainerNode.java      |    29 -
 .../apache/flex/compiler/tree/as/ITryNode.java  |    98 -
 .../apache/flex/compiler/tree/as/ITypeNode.java |    29 -
 .../flex/compiler/tree/as/ITypedClassNode.java  |    53 -
 .../compiler/tree/as/ITypedExpressionNode.java  |    62 -
 .../flex/compiler/tree/as/ITypedNode.java       |    60 -
 .../compiler/tree/as/IUnaryOperatorNode.java    |    44 -
 .../compiler/tree/as/IUseNamespaceNode.java     |    51 -
 .../tree/as/IVariableExpressionNode.java        |    33 -
 .../flex/compiler/tree/as/IVariableNode.java    |   125 -
 .../flex/compiler/tree/as/IWhileLoopNode.java   |   107 -
 .../apache/flex/compiler/tree/as/IWithNode.java |    55 -
 .../as/decorators/IVariableTypeDecorator.java   |    46 -
 .../as/decorators/SymbolDecoratorProvider.java  |    89 -
 .../tree/metadata/IAccessibilityTagNode.java    |    28 -
 .../tree/metadata/IDefaultPropertyTagNode.java  |    39 -
 .../compiler/tree/metadata/IEffectTagNode.java  |    37 -
 .../compiler/tree/metadata/IEventTagNode.java   |    31 -
 .../tree/metadata/IEventTriggerTagNode.java     |    27 -
 .../tree/metadata/IInspectableTagNode.java      |    61 -
 .../compiler/tree/metadata/IMetaTagNode.java    |    52 -
 .../compiler/tree/metadata/IMetaTagsNode.java   |    84 -
 .../tree/metadata/IMultiValueMetaTagNode.java   |    32 -
 .../tree/metadata/IResourceBundleTagNode.java   |    28 -
 .../compiler/tree/metadata/IStyleTagNode.java   |    35 -
 .../compiler/tree/metadata/ITypedTagNode.java   |    28 -
 .../tree/mxml/IMXMLApplicationNode.java         |    58 -
 .../flex/compiler/tree/mxml/IMXMLArrayNode.java |    27 -
 .../tree/mxml/IMXMLBindingAttributeNode.java    |    39 -
 .../compiler/tree/mxml/IMXMLBindingNode.java    |    45 -
 .../compiler/tree/mxml/IMXMLBooleanNode.java    |    42 -
 .../tree/mxml/IMXMLClassDefinitionNode.java     |   162 -
 .../flex/compiler/tree/mxml/IMXMLClassNode.java |    45 -
 .../tree/mxml/IMXMLClassReferenceNode.java      |   134 -
 .../flex/compiler/tree/mxml/IMXMLClearNode.java |    27 -
 .../mxml/IMXMLCompilerDirectiveNodeBase.java    |    35 -
 .../compiler/tree/mxml/IMXMLComponentNode.java  |    53 -
 .../mxml/IMXMLConcatenatedDataBindingNode.java  |    36 -
 .../tree/mxml/IMXMLDataBindingNode.java         |    27 -
 .../mxml/IMXMLDataBindingNodeContainer.java     |    27 -
 .../tree/mxml/IMXMLDeclarationsNode.java        |    38 -
 .../tree/mxml/IMXMLDeferredInstanceNode.java    |    48 -
 .../compiler/tree/mxml/IMXMLDefinitionNode.java |    59 -
 .../tree/mxml/IMXMLDesignLayerNode.java         |   122 -
 .../compiler/tree/mxml/IMXMLDocumentNode.java   |    27 -
 .../tree/mxml/IMXMLEffectSpecifierNode.java     |    35 -
 .../flex/compiler/tree/mxml/IMXMLEmbedNode.java |    27 -
 .../tree/mxml/IMXMLEventSpecifierNode.java      |    58 -
 .../compiler/tree/mxml/IMXMLExpressionNode.java |    47 -
 .../compiler/tree/mxml/IMXMLFactoryNode.java    |    38 -
 .../flex/compiler/tree/mxml/IMXMLFileNode.java  |    72 -
 .../compiler/tree/mxml/IMXMLFunctionNode.java   |    41 -
 .../tree/mxml/IMXMLHTTPServiceNode.java         |    39 -
 .../IMXMLHTTPServiceRequestPropertyNode.java    |    27 -
 .../compiler/tree/mxml/IMXMLImplementsNode.java |    42 -
 .../compiler/tree/mxml/IMXMLInstanceNode.java   |    94 -
 .../flex/compiler/tree/mxml/IMXMLIntNode.java   |    41 -
 .../compiler/tree/mxml/IMXMLLibraryNode.java    |    34 -
 .../compiler/tree/mxml/IMXMLLiteralNode.java    |    37 -
 .../compiler/tree/mxml/IMXMLMetadataNode.java   |    39 -
 .../flex/compiler/tree/mxml/IMXMLModelNode.java |    37 -
 .../mxml/IMXMLModelPropertyContainerNode.java   |    68 -
 .../tree/mxml/IMXMLModelPropertyNode.java       |    35 -
 .../compiler/tree/mxml/IMXMLModelRootNode.java  |    31 -
 .../flex/compiler/tree/mxml/IMXMLNode.java      |    76 -
 .../compiler/tree/mxml/IMXMLNumberNode.java     |    42 -
 .../compiler/tree/mxml/IMXMLObjectNode.java     |    27 -
 .../compiler/tree/mxml/IMXMLPrivateNode.java    |    29 -
 .../tree/mxml/IMXMLPropertySpecifierNode.java   |    51 -
 .../compiler/tree/mxml/IMXMLRegExpNode.java     |    27 -
 .../tree/mxml/IMXMLRemoteObjectMethodNode.java  |    39 -
 .../tree/mxml/IMXMLRemoteObjectNode.java        |    39 -
 .../compiler/tree/mxml/IMXMLReparentNode.java   |    52 -
 .../compiler/tree/mxml/IMXMLRepeaterNode.java   |    32 -
 .../compiler/tree/mxml/IMXMLResourceNode.java   |    53 -
 .../compiler/tree/mxml/IMXMLScriptNode.java     |    55 -
 .../tree/mxml/IMXMLSingleDataBindingNode.java   |    40 -
 .../compiler/tree/mxml/IMXMLSpecifierNode.java  |    51 -
 .../flex/compiler/tree/mxml/IMXMLStateNode.java |    46 -
 .../compiler/tree/mxml/IMXMLStringNode.java     |    41 -
 .../flex/compiler/tree/mxml/IMXMLStyleNode.java |    43 -
 .../tree/mxml/IMXMLStyleSpecifierNode.java      |    32 -
 .../flex/compiler/tree/mxml/IMXMLUintNode.java  |    41 -
 .../compiler/tree/mxml/IMXMLVectorNode.java     |    46 -
 .../compiler/tree/mxml/IMXMLWebServiceNode.java |    39 -
 .../tree/mxml/IMXMLWebServiceOperationNode.java |    39 -
 .../compiler/tree/mxml/IMXMLXMLListNode.java    |    41 -
 .../flex/compiler/tree/mxml/IMXMLXMLNode.java   |    56 -
 .../compiler/tree/mxml/IOldMXMLFileNode.java    |    39 -
 .../apache/flex/compiler/tree/mxml/index.html   |    19 -
 .../org/apache/flex/compiler/tree/package.html  |    73 -
 .../properties/IResourceBundleEntryNode.java    |    44 -
 .../properties/IResourceBundleFileNode.java     |    46 -
 .../flex/compiler/units/ICompilationUnit.java   |   264 -
 .../units/IInvisibleCompilationUnit.java        |    64 -
 .../org/apache/flex/compiler/units/package.html |   116 -
 .../units/requests/IABCBytesRequestResult.java  |    53 -
 .../units/requests/IFileScopeRequestResult.java |    62 -
 .../IOutgoingDependenciesRequestResult.java     |    32 -
 .../flex/compiler/units/requests/IRequest.java  |    71 -
 .../compiler/units/requests/IRequestResult.java |    34 -
 .../units/requests/ISWFTagsRequestResult.java   |    46 -
 .../requests/ISyntaxTreeRequestResult.java      |    57 -
 .../flex/compiler/units/requests/package.html   |    81 -
 .../compiler/workspaces/IIndexingReader.java    |    33 -
 .../workspaces/IInvalidationListener.java       |    80 -
 .../flex/compiler/workspaces/IWorkspace.java    |   211 -
 .../workspaces/IWorkspaceProfilingDelegate.java |    57 -
 .../flex/compiler/workspaces/package.html       |    44 -
 compiler/src/org/apache/flex/swc/ISWC.java      |   101 -
 .../src/org/apache/flex/swc/ISWCComponent.java  |    64 -
 .../src/org/apache/flex/swc/ISWCDigest.java     |    48 -
 .../src/org/apache/flex/swc/ISWCFileEntry.java  |    58 -
 .../src/org/apache/flex/swc/ISWCLibrary.java    |   105 -
 .../src/org/apache/flex/swc/ISWCManager.java    |    78 -
 .../src/org/apache/flex/swc/ISWCScript.java     |    94 -
 .../src/org/apache/flex/swc/ISWCVersion.java    |   105 -
 compiler/src/org/apache/flex/swc/SWC.java       |   218 -
 .../src/org/apache/flex/swc/SWCComponent.java   |   130 -
 .../src/org/apache/flex/swc/SWCDepends.java     |   733 -
 compiler/src/org/apache/flex/swc/SWCDigest.java |   106 -
 .../src/org/apache/flex/swc/SWCLibrary.java     |   191 -
 .../src/org/apache/flex/swc/SWCManager.java     |   177 -
 compiler/src/org/apache/flex/swc/SWCScript.java |   179 -
 .../src/org/apache/flex/swc/SWCVersion.java     |   183 -
 .../flex/swc/catalog/ICatalogXMLConstants.java  |    66 -
 .../apache/flex/swc/catalog/SWCFileEntry.java   |    70 -
 .../flex/swc/catalog/StAXCatalogReader.java     |   251 -
 .../flex/swc/catalog/StAXCatalogWriter.java     |   379 -
 .../apache/flex/swc/catalog/XMLFormatter.java   |   310 -
 .../org/apache/flex/swc/catalog/package.html    |    27 -
 .../org/apache/flex/swc/dita/IDITAEntry.java    |    42 -
 .../src/org/apache/flex/swc/dita/IDITAList.java |    57 -
 .../src/org/apache/flex/swc/dita/package.html   |    31 -
 .../src/org/apache/flex/swc/io/ISWCReader.java  |    44 -
 .../src/org/apache/flex/swc/io/ISWCWriter.java  |    38 -
 .../apache/flex/swc/io/SWCDirectoryWriter.java  |   155 -
 .../src/org/apache/flex/swc/io/SWCReader.java   |   222 -
 .../src/org/apache/flex/swc/io/SWCWriter.java   |   147 -
 .../org/apache/flex/swc/io/SWCWriterBase.java   |   252 -
 .../src/org/apache/flex/swc/io/package.html     |    31 -
 compiler/src/org/apache/flex/swc/package.html   |    43 -
 compiler/src/org/apache/flex/swf/Header.java    |   239 -
 compiler/src/org/apache/flex/swf/ISWF.java      |   281 -
 .../src/org/apache/flex/swf/ISWFConstants.java  |    42 -
 .../src/org/apache/flex/swf/ITagContainer.java  |    33 -
 compiler/src/org/apache/flex/swf/SWF.java       |   334 -
 compiler/src/org/apache/flex/swf/SWFFrame.java  |   286 -
 compiler/src/org/apache/flex/swf/TagType.java   |   137 -
 .../flex/swf/builders/IShapeIterator.java       |    38 -
 .../apache/flex/swf/builders/ITagBuilder.java   |    30 -
 .../apache/flex/swf/builders/ShapeBuilder.java  |   751 -
 .../org/apache/flex/swf/builders/package.html   |    26 -
 .../org/apache/flex/swf/io/IInputBitStream.java |   214 -
 .../apache/flex/swf/io/IOutputBitStream.java    |   223 -
 .../src/org/apache/flex/swf/io/ISWFReader.java  |    43 -
 .../src/org/apache/flex/swf/io/ISWFWriter.java  |    49 -
 .../apache/flex/swf/io/ISWFWriterFactory.java   |    34 -
 .../org/apache/flex/swf/io/InputBitStream.java  |   381 -
 .../org/apache/flex/swf/io/LZMACompressor.java  |   169 -
 .../org/apache/flex/swf/io/LZMAInputStream.java |    94 -
 .../org/apache/flex/swf/io/OutputBitStream.java |   382 -
 .../src/org/apache/flex/swf/io/SWFDump.java     |  2594 --
 .../src/org/apache/flex/swf/io/SWFReader.java   |  2989 --
 .../src/org/apache/flex/swf/io/SWFWriter.java   |  2718 --
 .../src/org/apache/flex/swf/io/SizeReport.java  |   308 -
 .../flex/swf/io/SizeReportWritingSWFWriter.java |   477 -
 .../src/org/apache/flex/swf/io/package.html     |    31 -
 compiler/src/org/apache/flex/swf/package.html   |    42 -
 .../flex/swf/tags/CSMTextSettingsTag.java       |   140 -
 .../flex/swf/tags/CharacterIterableFactory.java |   237 -
 .../org/apache/flex/swf/tags/CharacterTag.java  |    55 -
 .../flex/swf/tags/DefineBinaryDataTag.java      |    72 -
 .../flex/swf/tags/DefineBitsJPEG2Tag.java       |    49 -
 .../flex/swf/tags/DefineBitsJPEG3Tag.java       |   106 -
 .../flex/swf/tags/DefineBitsLossless2Tag.java   |    44 -
 .../flex/swf/tags/DefineBitsLosslessTag.java    |   139 -
 .../org/apache/flex/swf/tags/DefineBitsTag.java |    79 -
 .../apache/flex/swf/tags/DefineButton2Tag.java  |    74 -
 .../flex/swf/tags/DefineButtonCxformTag.java    |    84 -
 .../flex/swf/tags/DefineButtonSoundTag.java     |   103 -
 .../apache/flex/swf/tags/DefineButtonTag.java   |    96 -
 .../apache/flex/swf/tags/DefineEditTextTag.java |   614 -
 .../apache/flex/swf/tags/DefineFont2Tag.java    |   407 -
 .../apache/flex/swf/tags/DefineFont3Tag.java    |    64 -
 .../apache/flex/swf/tags/DefineFont4Tag.java    |   144 -
 .../flex/swf/tags/DefineFontAlignZonesTag.java  |   109 -
 .../flex/swf/tags/DefineFontInfo2Tag.java       |    60 -
 .../apache/flex/swf/tags/DefineFontInfoTag.java |   199 -
 .../apache/flex/swf/tags/DefineFontNameTag.java |    98 -
 .../org/apache/flex/swf/tags/DefineFontTag.java |   104 -
 .../flex/swf/tags/DefineMorphShape2Tag.java     |   138 -
 .../flex/swf/tags/DefineMorphShapeTag.java      |   179 -
 .../flex/swf/tags/DefineScalingGridTag.java     |   101 -
 .../tags/DefineSceneAndFrameLabelDataTag.java   |    69 -
 .../apache/flex/swf/tags/DefineShape2Tag.java   |    48 -
 .../apache/flex/swf/tags/DefineShape3Tag.java   |    48 -
 .../apache/flex/swf/tags/DefineShape4Tag.java   |    87 -
 .../apache/flex/swf/tags/DefineShapeTag.java    |    90 -
 .../apache/flex/swf/tags/DefineSoundTag.java    |   144 -
 .../apache/flex/swf/tags/DefineSpriteTag.java   |    89 -
 .../apache/flex/swf/tags/DefineText2Tag.java    |    44 -
 .../org/apache/flex/swf/tags/DefineTextTag.java |   163 -
 .../flex/swf/tags/DefineVideoStreamTag.java     |   142 -
 .../src/org/apache/flex/swf/tags/DoABCTag.java  |   127 -
 .../flex/swf/tags/EnableDebugger2Tag.java       |    70 -
 .../flex/swf/tags/EnableTelemetryTag.java       |    58 -
 .../src/org/apache/flex/swf/tags/EndTag.java    |    36 -
 .../apache/flex/swf/tags/ExportAssetsTag.java   |   178 -
 .../apache/flex/swf/tags/FileAttributesTag.java |   132 -
 .../org/apache/flex/swf/tags/FrameLabelTag.java |   105 -
 .../apache/flex/swf/tags/IAlwaysLongTag.java    |    29 -
 .../flex/swf/tags/ICharacterReferrer.java       |    34 -
 .../org/apache/flex/swf/tags/ICharacterTag.java |    34 -
 .../flex/swf/tags/IDefineBinaryImageTag.java    |    32 -
 .../apache/flex/swf/tags/IDefineFontTag.java    |    41 -
 .../src/org/apache/flex/swf/tags/IFontInfo.java |   123 -
 .../org/apache/flex/swf/tags/IManagedTag.java   |    30 -
 compiler/src/org/apache/flex/swf/tags/ITag.java |    35 -
 .../org/apache/flex/swf/tags/JPEGTablesTag.java |    62 -
 .../org/apache/flex/swf/tags/MetadataTag.java   |    76 -
 .../apache/flex/swf/tags/PlaceObject2Tag.java   |   241 -
 .../apache/flex/swf/tags/PlaceObject3Tag.java   |   221 -
 .../apache/flex/swf/tags/PlaceObjectTag.java    |   108 -
 .../apache/flex/swf/tags/ProductInfoTag.java    |   217 -
 .../src/org/apache/flex/swf/tags/RawTag.java    |    70 -
 .../apache/flex/swf/tags/RemoveObject2Tag.java  |    57 -
 .../apache/flex/swf/tags/RemoveObjectTag.java   |    81 -
 .../apache/flex/swf/tags/ScriptLimitsTag.java   |    75 -
 .../flex/swf/tags/SetBackgroundColorTag.java    |    67 -
 .../apache/flex/swf/tags/SetTabIndexTag.java    |    90 -
 .../org/apache/flex/swf/tags/ShowFrameTag.java  |    39 -
 .../flex/swf/tags/SoundStreamBlockTag.java      |    61 -
 .../flex/swf/tags/SoundStreamHead2Tag.java      |    39 -
 .../flex/swf/tags/SoundStreamHeadTag.java       |   227 -
 .../apache/flex/swf/tags/StartSound2Tag.java    |    82 -
 .../org/apache/flex/swf/tags/StartSoundTag.java |    84 -
 .../apache/flex/swf/tags/SymbolClassTag.java    |   151 -
 compiler/src/org/apache/flex/swf/tags/Tag.java  |    75 -
 .../org/apache/flex/swf/tags/VideoFrameTag.java |   110 -
 .../src/org/apache/flex/swf/tags/package.html   |    30 -
 .../src/org/apache/flex/swf/types/ARGB.java     |    40 -
 .../org/apache/flex/swf/types/BevelFilter.java  |   231 -
 .../org/apache/flex/swf/types/BlurFilter.java   |    83 -
 .../org/apache/flex/swf/types/ButtonRecord.java |   243 -
 .../src/org/apache/flex/swf/types/CXForm.java   |   100 -
 .../apache/flex/swf/types/CXFormWithAlpha.java  |    60 -
 .../org/apache/flex/swf/types/ClipActions.java  |    31 -
 .../flex/swf/types/ConvolutionFilter.java       |   172 -
 .../apache/flex/swf/types/CurvedEdgeRecord.java |    98 -
 .../apache/flex/swf/types/DropShadowFilter.java |   208 -
 .../org/apache/flex/swf/types/EdgeRecord.java   |    44 -
 .../apache/flex/swf/types/EndShapeRecord.java   |    32 -
 .../org/apache/flex/swf/types/FillStyle.java    |   157 -
 .../apache/flex/swf/types/FillStyleArray.java   |    58 -
 .../src/org/apache/flex/swf/types/Filter.java   |   228 -
 .../apache/flex/swf/types/FocalGradient.java    |    54 -
 .../org/apache/flex/swf/types/GlowFilter.java   |   165 -
 .../org/apache/flex/swf/types/GlyphEntry.java   |    85 -
 .../org/apache/flex/swf/types/GradRecord.java   |    51 -
 .../src/org/apache/flex/swf/types/Gradient.java |    96 -
 .../flex/swf/types/GradientBevelFilter.java     |    83 -
 .../flex/swf/types/GradientGlowFilter.java      |   135 -
 .../org/apache/flex/swf/types/IDataType.java    |    28 -
 .../org/apache/flex/swf/types/IFillStyle.java   |    30 -
 .../org/apache/flex/swf/types/ILineStyle.java   |    28 -
 .../apache/flex/swf/types/KerningRecord.java    |    83 -
 .../org/apache/flex/swf/types/LineStyle.java    |    67 -
 .../org/apache/flex/swf/types/LineStyle2.java   |   156 -
 .../apache/flex/swf/types/LineStyleArray.java   |    46 -
 .../src/org/apache/flex/swf/types/Matrix.java   |   124 -
 .../apache/flex/swf/types/MorphFillStyle.java   |   277 -
 .../apache/flex/swf/types/MorphGradRecord.java  |   112 -
 .../apache/flex/swf/types/MorphGradient.java    |    30 -
 .../apache/flex/swf/types/MorphLineStyle.java   |   112 -
 .../apache/flex/swf/types/MorphLineStyle2.java  |   265 -
 compiler/src/org/apache/flex/swf/types/RGB.java |    95 -
 .../src/org/apache/flex/swf/types/RGBA.java     |    85 -
 .../src/org/apache/flex/swf/types/Rect.java     |   103 -
 .../src/org/apache/flex/swf/types/Shape.java    |   115 -
 .../org/apache/flex/swf/types/ShapeRecord.java  |    82 -
 .../apache/flex/swf/types/ShapeWithStyle.java   |    77 -
 .../apache/flex/swf/types/SoundEnvelope.java    |    80 -
 .../org/apache/flex/swf/types/SoundInfo.java    |   221 -
 .../flex/swf/types/StraightEdgeRecord.java      |   109 -
 .../flex/swf/types/StyleChangeRecord.java       |   453 -
 .../src/org/apache/flex/swf/types/Styles.java   |    86 -
 .../org/apache/flex/swf/types/TextRecord.java   |   237 -
 .../src/org/apache/flex/swf/types/ZoneData.java |    44 -
 .../org/apache/flex/swf/types/ZoneRecord.java   |   104 -
 .../src/org/apache/flex/swf/types/package.html  |    31 -
 .../src/org/apache/flex/utils/ArgumentUtil.java |   214 -
 compiler/src/org/apache/flex/utils/Base64.java  |   306 -
 .../src/org/apache/flex/utils/CheapArray.java   |   268 -
 .../flex/utils/DAByteArrayOutputStream.java     |    51 -
 .../src/org/apache/flex/utils/DirectoryID.java  |    48 -
 .../org/apache/flex/utils/ExceptionUtil.java    |   208 -
 .../src/org/apache/flex/utils/FastStack.java    |   109 -
 compiler/src/org/apache/flex/utils/FileID.java  |    99 -
 .../src/org/apache/flex/utils/FileUtils.java    |   214 -
 .../flex/utils/FilenameNormalization.java       |   109 -
 .../apache/flex/utils/ILengthAwareReader.java   |    49 -
 compiler/src/org/apache/flex/utils/IntMap.java  |   234 -
 .../org/apache/flex/utils/IntMapLRUCache.java   |   313 -
 .../flex/utils/NonLockingStringReader.java      |    49 -
 compiler/src/org/apache/flex/utils/Point.java   |    41 -
 .../org/apache/flex/utils/StringEncoder.java    |    93 -
 .../src/org/apache/flex/utils/StringUtils.java  |   105 -
 compiler/src/org/apache/flex/utils/Trace.java   |   146 -
 compiler/src/org/apache/flex/utils/Version.java |   261 -
 compiler/src/org/apache/flex/utils/package.html |    32 -
 compiler/src/overview.html                      |    53 -
 .../src/test/java/as/ASFeatureTestsBase.java    |   228 +
 compiler/src/test/java/as/ASKeywordTests.java   |   347 +
 compiler/src/test/java/as/ASNamespaceTests.java |    93 +
 compiler/src/test/java/as/ASVariableTests.java  |   131 +
 compiler/src/test/java/f/SDKSWCTests.java       |   392 +
 .../test/java/mxml/tags/MXMLArrayTagTests.java  |   176 +
 .../java/mxml/tags/MXMLBooleanTagTests.java     |    47 +
 .../test/java/mxml/tags/MXMLClassTagTests.java  |    45 +
 .../java/mxml/tags/MXMLComponentTagTests.java   |    74 +
 .../java/mxml/tags/MXMLDefinitionTagTests.java  |    93 +
 .../java/mxml/tags/MXMLFeatureTestsBase.java    |   183 +
 .../java/mxml/tags/MXMLHTTPServiceTagTests.java |    76 +
 .../java/mxml/tags/MXMLInstanceTagTests.java    |    45 +
 .../mxml/tags/MXMLInstanceTagTestsBase.java     |    82 +
 .../test/java/mxml/tags/MXMLIntTagTests.java    |    49 +
 .../java/mxml/tags/MXMLMetadataTagTests.java    |   141 +
 .../test/java/mxml/tags/MXMLModelTagTests.java  |   161 +
 .../test/java/mxml/tags/MXMLNumberTagTests.java |    45 +
 .../test/java/mxml/tags/MXMLObjectTagTests.java |   293 +
 .../mxml/tags/MXMLRemoteObjectTagTests.java     |    73 +
 .../test/java/mxml/tags/MXMLStringTagTests.java |    45 +
 .../test/java/mxml/tags/MXMLUintTagTests.java   |    47 +
 .../test/java/mxml/tags/MXMLVectorTagTests.java |   210 +
 .../java/mxml/tags/MXMLWebServiceTagTests.java  |    74 +
 .../java/mxml/tags/MXMLXMLListTagTests.java     |   156 +
 .../test/java/mxml/tags/MXMLXMLTagTests.java    |   182 +
 .../css/CSSArrayPropertyValueTests.java         |    92 +
 .../compiler/internal/css/CSSBaseTests.java     |    96 +
 .../css/CSSColorPropertyValueTests.java         |   127 +
 .../internal/css/CSSCombinatorTests.java        |   107 +
 .../compiler/internal/css/CSSDocumentTests.java |   190 +
 .../compiler/internal/css/CSSFontFaceTests.java |   213 +
 .../css/CSSFunctionCallPropertyValueTests.java  |    99 +
 .../css/CSSKeywordPropertyValueTests.java       |    70 +
 .../css/CSSMediaQueryConditionTests.java        |   120 +
 .../css/CSSNamespaceDefinitionTests.java        |   134 +
 .../css/CSSNumberPropertyValueTests.java        |   175 +
 .../compiler/internal/css/CSSPropertyTests.java |    95 +
 .../internal/css/CSSPropertyValueTests.java     |    68 +
 .../css/CSSRgbColorPropertyValueTests.java      |   108 +
 .../compiler/internal/css/CSSRuleTests.java     |   219 +
 .../internal/css/CSSSelectorConditionTests.java |   133 +
 .../compiler/internal/css/CSSSelectorTests.java |   203 +
 .../css/CSSStringPropertyValueTests.java        |    83 +
 .../compiler/internal/mxml/MXMLDataTests.java   |    96 +
 .../internal/mxml/MXMLInstructionDataTests.java |   108 +
 .../internal/mxml/MXMLTextDataTests.java        |   226 +
 .../internal/mxml/MXMLUnitDataTests.java        |    54 +
 .../parsing/mxml/MXMLTokenizerTests.java        |   823 +
 .../internal/tree/mxml/MXMLArrayNodeTests.java  |   138 +
 .../tree/mxml/MXMLBindingNodeTests.java         |   191 +
 .../tree/mxml/MXMLBooleanNodeTests.java         |   268 +
 .../internal/tree/mxml/MXMLClassNodeTests.java  |   110 +
 .../tree/mxml/MXMLClassReferenceNodeTests.java  |    32 +
 .../tree/mxml/MXMLComponentNodeTests.java       |   160 +
 .../tree/mxml/MXMLDeclarationsNodeTests.java    |   102 +
 .../tree/mxml/MXMLDefinitionNodeTests.java      |   154 +
 .../tree/mxml/MXMLDesignLayerNodeTests.java     |   117 +
 .../tree/mxml/MXMLEventSpecifierNodeTests.java  |   201 +
 .../tree/mxml/MXMLExpressionNodeBaseTests.java  |    44 +
 .../tree/mxml/MXMLFunctionNodeTests.java        |   124 +
 .../tree/mxml/MXMLHTTPServiceNodeTests.java     |    69 +
 .../tree/mxml/MXMLImplementsNodeTests.java      |   106 +
 .../tree/mxml/MXMLInstanceNodeTests.java        |    64 +
 .../internal/tree/mxml/MXMLIntNodeTests.java    |   266 +
 .../tree/mxml/MXMLLibraryNodeTests.java         |   108 +
 .../tree/mxml/MXMLMetadataNodeTests.java        |    97 +
 .../internal/tree/mxml/MXMLModelNodeTests.java  |   141 +
 .../internal/tree/mxml/MXMLNodeBaseTests.java   |   209 +
 .../internal/tree/mxml/MXMLNumberNodeTests.java |   203 +
 .../internal/tree/mxml/MXMLObjectNodeTests.java |   156 +
 .../tree/mxml/MXMLPrivateNodeTests.java         |   104 +
 .../MXMLPropertySpecifierNodeBooleanTests.java  |    84 +
 .../MXMLPropertySpecifierNodeClassTests.java    |   118 +
 .../mxml/MXMLPropertySpecifierNodeIntTests.java |    84 +
 .../MXMLPropertySpecifierNodeNumberTests.java   |   363 +
 .../MXMLPropertySpecifierNodeStringTests.java   |    84 +
 .../mxml/MXMLPropertySpecifierNodeTests.java    |    86 +
 .../MXMLPropertySpecifierNodeUintTests.java     |    84 +
 .../internal/tree/mxml/MXMLRegExpNodeTests.java |    95 +
 .../tree/mxml/MXMLRemoteObjectNodeTests.java    |    70 +
 .../tree/mxml/MXMLResourceNodeTests.java        |   127 +
 .../internal/tree/mxml/MXMLScriptNodeTests.java |    94 +
 .../tree/mxml/MXMLSpecifierNodeBaseTests.java   |    33 +
 .../internal/tree/mxml/MXMLStateNodeTests.java  |    79 +
 .../internal/tree/mxml/MXMLStringNodeTests.java |   169 +
 .../internal/tree/mxml/MXMLStyleNodeTests.java  |   133 +
 .../internal/tree/mxml/MXMLUintNodeTests.java   |   206 +
 .../internal/tree/mxml/MXMLVectorNodeTests.java |   203 +
 .../tree/mxml/MXMLWebServiceNodeTests.java      |    69 +
 .../tree/mxml/MXMLXMLListNodeTests.java         |   108 +
 .../internal/tree/mxml/MXMLXMLNodeTests.java    |   148 +
 .../properties/MXMLPropertyBooleanTests.java    |   100 +
 .../java/properties/MXMLPropertyClassTests.java |   100 +
 .../java/properties/MXMLPropertyIntTests.java   |   100 +
 .../properties/MXMLPropertyNumberTests.java     |   100 +
 .../properties/MXMLPropertyStringTests.java     |   100 +
 .../java/properties/MXMLPropertyTestsBase.java  |    91 +
 .../java/properties/MXMLPropertyUintTests.java  |   100 +
 .../flex/compiler/tools/AnnotateClass.java      |    81 -
 .../compiler/tools/ProblemEnumGenerator.java    |   231 -
 .../flex/compiler/tools/ProblemLocalizer.java   |   155 -
 externs/GCL/externs/goog/a11y/aria/announcer.js |   123 -
 externs/GCL/externs/goog/a11y/aria/aria.js      |   386 -
 .../GCL/externs/goog/a11y/aria/attributes.js    |   389 -
 .../GCL/externs/goog/a11y/aria/datatables.js    |    68 -
 externs/GCL/externs/goog/a11y/aria/roles.js     |   216 -
 externs/GCL/externs/goog/array/array.js         |  1655 -
 externs/GCL/externs/goog/asserts/asserts.js     |   365 -
 .../GCL/externs/goog/async/animationdelay.js    |   267 -
 .../GCL/externs/goog/async/conditionaldelay.js  |   228 -
 externs/GCL/externs/goog/async/delay.js         |   182 -
 externs/GCL/externs/goog/async/freelist.js      |    88 -
 externs/GCL/externs/goog/async/nexttick.js      |   241 -
 externs/GCL/externs/goog/async/run.js           |   130 -
 externs/GCL/externs/goog/async/throttle.js      |   195 -
 externs/GCL/externs/goog/async/workqueue.js     |   139 -
 externs/GCL/externs/goog/base.js                |  2547 --
 externs/GCL/externs/goog/bootstrap/nodejs.js    |   110 -
 .../GCL/externs/goog/bootstrap/webworkers.js    |    37 -
 externs/GCL/externs/goog/color/alpha.js         |   472 -
 externs/GCL/externs/goog/color/color.js         |   776 -
 externs/GCL/externs/goog/color/names.js         |   176 -
 externs/GCL/externs/goog/crypt/aes.js           |  1029 -
 externs/GCL/externs/goog/crypt/arc4.js          |   164 -
 externs/GCL/externs/goog/crypt/base64.js        |   286 -
 externs/GCL/externs/goog/crypt/basen.js         |   242 -
 externs/GCL/externs/goog/crypt/blobhasher.js    |   285 -
 externs/GCL/externs/goog/crypt/blockcipher.js   |    52 -
 externs/GCL/externs/goog/crypt/cbc.js           |   153 -
 externs/GCL/externs/goog/crypt/crypt.js         |   173 -
 externs/GCL/externs/goog/crypt/hash.js          |    69 -
 externs/GCL/externs/goog/crypt/hash32.js        |   184 -
 externs/GCL/externs/goog/crypt/hmac.js          |   160 -
 externs/GCL/externs/goog/crypt/md5.js           |   435 -
 externs/GCL/externs/goog/crypt/pbkdf2.js        |   128 -
 externs/GCL/externs/goog/crypt/sha1.js          |   294 -
 externs/GCL/externs/goog/crypt/sha2.js          |   338 -
 externs/GCL/externs/goog/crypt/sha224.js        |    50 -
 externs/GCL/externs/goog/crypt/sha256.js        |    49 -
 externs/GCL/externs/goog/crypt/sha2_64bit.js    |   550 -
 externs/GCL/externs/goog/crypt/sha384.js        |    59 -
 externs/GCL/externs/goog/crypt/sha512.js        |    59 -
 externs/GCL/externs/goog/crypt/sha512_256.js    |    65 -
 externs/GCL/externs/goog/css/autocomplete.css   |    43 -
 externs/GCL/externs/goog/css/bubble.css         |    84 -
 externs/GCL/externs/goog/css/button.css         |    38 -
 externs/GCL/externs/goog/css/charpicker.css     |   206 -
 externs/GCL/externs/goog/css/checkbox.css       |    38 -
 .../GCL/externs/goog/css/colormenubutton.css    |    25 -
 externs/GCL/externs/goog/css/colorpalette.css   |    54 -
 .../externs/goog/css/colorpicker-simplegrid.css |    49 -
 externs/GCL/externs/goog/css/combobox.css       |    54 -
 externs/GCL/externs/goog/css/common.css         |    41 -
 externs/GCL/externs/goog/css/css3button.css     |    77 -
 externs/GCL/externs/goog/css/css3menubutton.css |    23 -
 externs/GCL/externs/goog/css/custombutton.css   |   161 -
 externs/GCL/externs/goog/css/datepicker.css     |   154 -
 externs/GCL/externs/goog/css/dialog.css         |    72 -
 .../GCL/externs/goog/css/dimensionpicker.css    |    47 -
 .../GCL/externs/goog/css/dragdropdetector.css   |    48 -
 externs/GCL/externs/goog/css/editor/bubble.css  |    73 -
 externs/GCL/externs/goog/css/editor/dialog.css  |    66 -
 .../externs/goog/css/editor/equationeditor.css  |   113 -
 .../GCL/externs/goog/css/editor/linkdialog.css  |    36 -
 externs/GCL/externs/goog/css/editortoolbar.css  |   225 -
 externs/GCL/externs/goog/css/filteredmenu.css   |    30 -
 .../goog/css/filterobservingmenuitem.css        |    25 -
 externs/GCL/externs/goog/css/flatbutton.css     |    64 -
 externs/GCL/externs/goog/css/flatmenubutton.css |    63 -
 externs/GCL/externs/goog/css/hovercard.css      |    51 -
 externs/GCL/externs/goog/css/hsvapalette.css    |   231 -
 externs/GCL/externs/goog/css/hsvpalette.css     |   179 -
 .../GCL/externs/goog/css/imagelessbutton.css    |   160 -
 .../externs/goog/css/imagelessmenubutton.css    |    23 -
 .../GCL/externs/goog/css/inputdatepicker.css    |    12 -
 externs/GCL/externs/goog/css/linkbutton.css     |    26 -
 externs/GCL/externs/goog/css/menu.css           |    27 -
 externs/GCL/externs/goog/css/menubar.css        |    57 -
 externs/GCL/externs/goog/css/menubutton.css     |   169 -
 externs/GCL/externs/goog/css/menuitem.css       |   148 -
 externs/GCL/externs/goog/css/menuseparator.css  |    19 -
 .../GCL/externs/goog/css/multitestrunner.css    |   121 -
 externs/GCL/externs/goog/css/palette.css        |    36 -
 .../GCL/externs/goog/css/popupdatepicker.css    |    17 -
 externs/GCL/externs/goog/css/roundedpanel.css   |    29 -
 externs/GCL/externs/goog/css/roundedtab.css     |   158 -
 externs/GCL/externs/goog/css/submenu.css        |    38 -
 externs/GCL/externs/goog/css/tab.css            |   105 -
 externs/GCL/externs/goog/css/tabbar.css         |    52 -
 externs/GCL/externs/goog/css/tablesorter.css    |    14 -
 externs/GCL/externs/goog/css/toolbar.css        |   400 -
 externs/GCL/externs/goog/css/tooltip.css        |    14 -
 externs/GCL/externs/goog/css/tree.css           |   146 -
 .../GCL/externs/goog/css/tristatemenuitem.css   |    43 -
 externs/GCL/externs/goog/cssom/cssom.js         |   455 -
 .../externs/goog/cssom/cssom_test_import_1.css  |    11 -
 .../externs/goog/cssom/cssom_test_import_2.css  |    10 -
 .../externs/goog/cssom/cssom_test_link_1.css    |    10 -
 externs/GCL/externs/goog/cssom/iframe/style.js  |  1016 -
 .../goog/cssom/iframe/style_test_import.css     |    10 -
 .../GCL/externs/goog/datasource/datamanager.js  |   561 -
 .../GCL/externs/goog/datasource/datasource.js   |   658 -
 externs/GCL/externs/goog/datasource/expr.js     |   545 -
 .../GCL/externs/goog/datasource/fastdatanode.js |   814 -
 .../GCL/externs/goog/datasource/jsdatasource.js |   462 -
 .../externs/goog/datasource/jsondatasource.js   |   153 -
 .../goog/datasource/jsxmlhttpdatasource.js      |   196 -
 .../externs/goog/datasource/xmldatasource.js    |   417 -
 externs/GCL/externs/goog/date/date.js           |  1761 --
 externs/GCL/externs/goog/date/datelike.js       |    27 -
 externs/GCL/externs/goog/date/daterange.js      |   430 -
 externs/GCL/externs/goog/date/duration.js       |   153 -
 externs/GCL/externs/goog/date/relative.js       |   490 -
 .../externs/goog/date/relativewithplurals.js    |   120 -
 externs/GCL/externs/goog/date/utcdatetime.js    |   191 -
 externs/GCL/externs/goog/db/cursor.js           |   215 -
 externs/GCL/externs/goog/db/db.js               |   185 -
 externs/GCL/externs/goog/db/error1.js           |   364 -
 externs/GCL/externs/goog/db/index.js            |   246 -
 externs/GCL/externs/goog/db/indexeddb.js        |   353 -
 externs/GCL/externs/goog/db/keyrange.js         |   118 -
 externs/GCL/externs/goog/db/objectstore.js      |   400 -
 externs/GCL/externs/goog/db/transaction.js      |   223 -
 externs/GCL/externs/goog/debug/console.js       |   207 -
 externs/GCL/externs/goog/debug/debug.js         |   653 -
 externs/GCL/externs/goog/debug/debugwindow.js   |   632 -
 externs/GCL/externs/goog/debug/devcss/devcss.js |   445 -
 .../externs/goog/debug/devcss/devcssrunner.js   |    26 -
 externs/GCL/externs/goog/debug/divconsole.js    |   150 -
 .../externs/goog/debug/entrypointregistry.js    |   158 -
 externs/GCL/externs/goog/debug/error2.js        |    63 -
 externs/GCL/externs/goog/debug/errorhandler.js  |   367 -
 .../externs/goog/debug/errorhandlerweakdep.js   |    38 -
 externs/GCL/externs/goog/debug/errorreporter.js |   434 -
 externs/GCL/externs/goog/debug/fancywindow.js   |   385 -
 externs/GCL/externs/goog/debug/formatter.js     |   387 -
 externs/GCL/externs/goog/debug/fpsdisplay.js    |   165 -
 externs/GCL/externs/goog/debug/gcdiagnostics.js |   143 -
 externs/GCL/externs/goog/debug/logbuffer.js     |   148 -
 externs/GCL/externs/goog/debug/logger.js        |   873 -
 externs/GCL/externs/goog/debug/logrecord.js     |   242 -
 .../externs/goog/debug/logrecordserializer.js   |   121 -
 .../externs/goog/debug/relativetimeprovider.js  |    84 -
 externs/GCL/externs/goog/debug/tracer.js        |   725 -
 .../goog/demos/autocompleteremotedata.js        |    18 -
 .../goog/demos/autocompleterichremotedata.js    |    33 -
 externs/GCL/externs/goog/demos/css/demo.css     |    75 -
 .../GCL/externs/goog/demos/css/emojipicker.css  |    36 -
 .../GCL/externs/goog/demos/css/emojisprite.css  |    92 -
 externs/GCL/externs/goog/demos/editor/deps.js   |    21 -
 .../GCL/externs/goog/demos/editor/helloworld.js |    82 -
 .../goog/demos/editor/helloworlddialog.js       |   173 -
 .../goog/demos/editor/helloworlddialogplugin.js |   117 -
 externs/GCL/externs/goog/demos/emoji/200.gif    |   Bin 941 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/201.gif    |   Bin 980 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/202.gif    |   Bin 1054 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/203.gif    |   Bin 996 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/204.gif    |   Bin 1016 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/205.gif    |   Bin 1032 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/206.gif    |   Bin 990 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2BC.gif    |   Bin 1039 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2BD.gif    |   Bin 986 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2BE.gif    |   Bin 1074 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2BF.gif    |   Bin 996 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2C0.gif    |   Bin 1036 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2C1.gif    |   Bin 1080 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2C2.gif    |   Bin 1049 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2C3.gif    |   Bin 1104 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2C4.gif    |   Bin 1072 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2C5.gif    |   Bin 1087 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2C6.gif    |   Bin 1041 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2C7.gif    |   Bin 1079 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2C8.gif    |   Bin 1049 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2C9.gif    |   Bin 996 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2CA.gif    |   Bin 2299 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2CB.gif    |   Bin 992 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2CC.gif    |   Bin 977 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2CD.gif    |   Bin 1035 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2CE.gif    |   Bin 1074 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2CF.gif    |   Bin 1022 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2D0.gif    |   Bin 987 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2D1.gif    |   Bin 997 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2D2.gif    |   Bin 1012 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2D3.gif    |   Bin 1040 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2D4.gif    |   Bin 1043 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2D5.gif    |   Bin 1014 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2D6.gif    |   Bin 1026 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2D7.gif    |   Bin 1048 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2D8.gif    |   Bin 884 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2D9.gif    |   Bin 974 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2DA.gif    |   Bin 920 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2DB.gif    |   Bin 949 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2DC.gif    |   Bin 949 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2DD.gif    |   Bin 1000 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2DE.gif    |   Bin 963 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2DF.gif    |   Bin 865 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2E0.gif    |   Bin 1018 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2E1.gif    |   Bin 1004 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2E2.gif    |   Bin 1046 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2E3.gif    |   Bin 1547 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2E4.gif    |   Bin 999 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2E5.gif    |   Bin 1032 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2E6.gif    |   Bin 1013 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2E7.gif    |   Bin 1040 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2E8.gif    |   Bin 1028 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2E9.gif    |   Bin 1030 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2EA.gif    |   Bin 1001 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2EB.gif    |   Bin 1086 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2EC.gif    |   Bin 1007 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2ED.gif    |   Bin 1045 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2EE.gif    |   Bin 1016 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2EF.gif    |   Bin 2363 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2F0.gif    |   Bin 1014 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2F1.gif    |   Bin 1902 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2F2.gif    |   Bin 1092 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2F3.gif    |   Bin 1033 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2F4.gif    |   Bin 1065 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2F5.gif    |   Bin 954 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2F6.gif    |   Bin 1030 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2F7.gif    |   Bin 1006 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2F8.gif    |   Bin 1016 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2F9.gif    |   Bin 1051 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2FA.gif    |   Bin 1082 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2FB.gif    |   Bin 1012 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2FC.gif    |   Bin 977 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2FD.gif    |   Bin 989 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2FE.gif    |   Bin 1036 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/2FF.gif    |   Bin 1034 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/none.gif   |   Bin 834 -> 0 bytes
 externs/GCL/externs/goog/demos/emoji/sprite.png |   Bin 25195 -> 0 bytes
 .../GCL/externs/goog/demos/emoji/sprite2.png    |   Bin 27856 -> 0 bytes
 .../GCL/externs/goog/demos/emoji/unknown.gif    |   Bin 90 -> 0 bytes
 .../externs/goog/demos/graphics/tigerdata.js    |  2841 --
 .../GCL/externs/goog/demos/samplecomponent.js   |   189 -
 externs/GCL/externs/goog/demos/xpc/xpcdemo.js   |   308 -
 .../GCL/externs/goog/disposable/disposable.js   |   307 -
 .../GCL/externs/goog/disposable/idisposable.js  |    45 -
 .../GCL/externs/goog/dom/abstractmultirange.js  |    76 -
 externs/GCL/externs/goog/dom/abstractrange.js   |   529 -
 .../goog/dom/animationframe/animationframe.js   |   287 -
 .../externs/goog/dom/animationframe/polyfill.js |    61 -
 externs/GCL/externs/goog/dom/annotate.js        |   357 -
 externs/GCL/externs/goog/dom/browserfeature1.js |    72 -
 .../goog/dom/browserrange/abstractrange.js      |   350 -
 .../goog/dom/browserrange/browserrange.js       |   149 -
 .../externs/goog/dom/browserrange/geckorange.js |    88 -
 .../externs/goog/dom/browserrange/ierange.js    |   935 -
 .../externs/goog/dom/browserrange/operarange.js |    84 -
 .../externs/goog/dom/browserrange/w3crange.js   |   396 -
 .../goog/dom/browserrange/webkitrange.js        |   108 -
 .../goog/dom/bufferedviewportsizemonitor.js     |   201 -
 externs/GCL/externs/goog/dom/classes.js         |   239 -
 externs/GCL/externs/goog/dom/classlist.js       |   277 -
 externs/GCL/externs/goog/dom/controlrange.js    |   494 -
 externs/GCL/externs/goog/dom/dataset.js         |   154 -
 externs/GCL/externs/goog/dom/dom.js             |  2990 --
 externs/GCL/externs/goog/dom/fontsizemonitor.js |   162 -
 externs/GCL/externs/goog/dom/forms.js           |   417 -
 externs/GCL/externs/goog/dom/fullscreen.js      |   144 -
 externs/GCL/externs/goog/dom/iframe.js          |   216 -
 externs/GCL/externs/goog/dom/inputtype.js       |    66 -
 externs/GCL/externs/goog/dom/iter.js            |   129 -
 externs/GCL/externs/goog/dom/multirange.js      |   510 -
 externs/GCL/externs/goog/dom/nodeiterator.js    |    87 -
 externs/GCL/externs/goog/dom/nodeoffset.js      |   114 -
 externs/GCL/externs/goog/dom/nodetype.js        |    48 -
 .../externs/goog/dom/pattern/abstractpattern.js |    58 -
 .../GCL/externs/goog/dom/pattern/allchildren.js |    72 -
 .../goog/dom/pattern/callback/callback.js       |    82 -
 .../goog/dom/pattern/callback/counter.js        |    69 -
 .../externs/goog/dom/pattern/childmatches.js    |   145 -
 externs/GCL/externs/goog/dom/pattern/endtag.js  |    54 -
 externs/GCL/externs/goog/dom/pattern/fulltag.js |    88 -
 externs/GCL/externs/goog/dom/pattern/matcher.js |   144 -
 .../GCL/externs/goog/dom/pattern/nodetype.js    |    59 -
 externs/GCL/externs/goog/dom/pattern/pattern.js |    93 -
 externs/GCL/externs/goog/dom/pattern/repeat.js  |   177 -
 .../GCL/externs/goog/dom/pattern/sequence.js    |   135 -
 .../GCL/externs/goog/dom/pattern/starttag.js    |    53 -
 externs/GCL/externs/goog/dom/pattern/tag.js     |   128 -
 externs/GCL/externs/goog/dom/pattern/text.js    |    67 -
 externs/GCL/externs/goog/dom/range.js           |   226 -
 externs/GCL/externs/goog/dom/rangeendpoint.js   |    32 -
 externs/GCL/externs/goog/dom/safe.js            |   325 -
 externs/GCL/externs/goog/dom/savedcaretrange.js |   215 -
 externs/GCL/externs/goog/dom/savedrange.js      |    74 -
 externs/GCL/externs/goog/dom/selection.js       |   472 -
 externs/GCL/externs/goog/dom/tagiterator.js     |   360 -
 externs/GCL/externs/goog/dom/tagname.js         |   160 -
 externs/GCL/externs/goog/dom/tags.js            |    42 -
 externs/GCL/externs/goog/dom/textrange.js       |   615 -
 .../GCL/externs/goog/dom/textrangeiterator.js   |   239 -
 externs/GCL/externs/goog/dom/vendor.js          |    96 -
 .../GCL/externs/goog/dom/viewportsizemonitor.js |   165 -
 externs/GCL/externs/goog/dom/xml.js             |   204 -
 .../GCL/externs/goog/editor/browserfeature2.js  |   273 -
 .../externs/goog/editor/clicktoeditwrapper.js   |   423 -
 externs/GCL/externs/goog/editor/command.js      |    76 -
 .../externs/goog/editor/contenteditablefield.js |   108 -
 externs/GCL/externs/goog/editor/defines.js      |    34 -
 externs/GCL/externs/goog/editor/field.js        |  2750 --
 externs/GCL/externs/goog/editor/focus.js        |    32 -
 externs/GCL/externs/goog/editor/icontent.js     |   300 -
 externs/GCL/externs/goog/editor/link.js         |   390 -
 externs/GCL/externs/goog/editor/node.js         |   484 -
 externs/GCL/externs/goog/editor/plugin.js       |   463 -
 .../goog/editor/plugins/abstractbubbleplugin.js |   712 -
 .../goog/editor/plugins/abstractdialogplugin.js |   333 -
 .../goog/editor/plugins/abstracttabhandler.js   |    78 -
 .../goog/editor/plugins/basictextformatter.js   |  1769 --
 .../externs/goog/editor/plugins/blockquote.js   |   451 -
 .../externs/goog/editor/plugins/emoticons.js    |    89 -
 .../externs/goog/editor/plugins/enterhandler.js |   768 -
 .../externs/goog/editor/plugins/firststrong.js  |   334 -
 .../goog/editor/plugins/headerformatter.js      |    96 -
 .../externs/goog/editor/plugins/linkbubble.js   |   585 -
 .../goog/editor/plugins/linkdialogplugin.js     |   438 -
 .../goog/editor/plugins/linkshortcutplugin.js   |    61 -
 .../goog/editor/plugins/listtabhandler.js       |    68 -
 .../externs/goog/editor/plugins/loremipsum.js   |   192 -
 .../goog/editor/plugins/removeformatting.js     |   780 -
 .../goog/editor/plugins/spacestabhandler.js     |    92 -
 .../externs/goog/editor/plugins/tableeditor.js  |   475 -
 .../goog/editor/plugins/tagonenterhandler.js    |   744 -
 .../GCL/externs/goog/editor/plugins/undoredo.js |  1016 -
 .../goog/editor/plugins/undoredomanager.js      |   338 -
 .../goog/editor/plugins/undoredostate.js        |    86 -
 externs/GCL/externs/goog/editor/range.js        |   632 -
 .../GCL/externs/goog/editor/seamlessfield.js    |   746 -
 externs/GCL/externs/goog/editor/style.js        |   225 -
 externs/GCL/externs/goog/editor/table.js        |   570 -
 .../externs/goog/events/actioneventwrapper.js   |   151 -
 .../GCL/externs/goog/events/actionhandler.js    |   184 -
 externs/GCL/externs/goog/events/browserevent.js |   386 -
 .../GCL/externs/goog/events/browserfeature3.js  |    85 -
 externs/GCL/externs/goog/events/event.js        |   143 -
 externs/GCL/externs/goog/events/eventhandler.js |   459 -
 externs/GCL/externs/goog/events/eventid.js      |    47 -
 externs/GCL/externs/goog/events/events.js       |   983 -
 externs/GCL/externs/goog/events/eventtarget.js  |   394 -
 externs/GCL/externs/goog/events/eventtype.js    |   233 -
 externs/GCL/externs/goog/events/eventwrapper.js |    66 -
 .../GCL/externs/goog/events/filedrophandler.js  |   222 -
 externs/GCL/externs/goog/events/focushandler.js |   107 -
 externs/GCL/externs/goog/events/imehandler.js   |   369 -
 externs/GCL/externs/goog/events/inputhandler.js |   212 -
 externs/GCL/externs/goog/events/keycodes.js     |   420 -
 externs/GCL/externs/goog/events/keyhandler.js   |   556 -
 externs/GCL/externs/goog/events/keynames.js     |   139 -
 externs/GCL/externs/goog/events/listenable.js   |   335 -
 externs/GCL/externs/goog/events/listener.js     |   131 -
 externs/GCL/externs/goog/events/listenermap.js  |   308 -
 .../externs/goog/events/mousewheelhandler.js    |   296 -
 .../GCL/externs/goog/events/onlinehandler.js    |   159 -
 externs/GCL/externs/goog/events/pastehandler.js |   517 -
 externs/GCL/externs/goog/events/wheelevent.js   |   169 -
 externs/GCL/externs/goog/events/wheelhandler.js |   159 -
 externs/GCL/externs/goog/format/emailaddress.js |   499 -
 externs/GCL/externs/goog/format/format.js       |   502 -
 .../externs/goog/format/htmlprettyprinter.js    |   408 -
 .../format/internationalizedemailaddress.js     |   256 -
 .../externs/goog/format/jsonprettyprinter.js    |   414 -
 externs/GCL/externs/goog/fs/entry.js            |   272 -
 externs/GCL/externs/goog/fs/entryimpl.js        |   404 -
 externs/GCL/externs/goog/fs/error3.js           |   181 -
 externs/GCL/externs/goog/fs/filereader.js       |   288 -
 externs/GCL/externs/goog/fs/filesaver.js        |   166 -
 externs/GCL/externs/goog/fs/filesystem.js       |    41 -
 externs/GCL/externs/goog/fs/filesystemimpl.js   |    65 -
 externs/GCL/externs/goog/fs/filewriter.js       |   111 -
 externs/GCL/externs/goog/fs/fs.js               |   278 -
 externs/GCL/externs/goog/fs/progressevent.js    |    69 -
 externs/GCL/externs/goog/fs/url.js              |   105 -
 externs/GCL/externs/goog/functions/functions.js |   332 -
 externs/GCL/externs/goog/fx/abstractdragdrop.js |  1540 -
 externs/GCL/externs/goog/fx/anim/anim.js        |   211 -
 externs/GCL/externs/goog/fx/animation.js        |   524 -
 externs/GCL/externs/goog/fx/animationqueue.js   |   310 -
 externs/GCL/externs/goog/fx/css3/fx.js          |    63 -
 externs/GCL/externs/goog/fx/css3/transition.js  |   201 -
 .../GCL/externs/goog/fx/cssspriteanimation.js   |   130 -
 externs/GCL/externs/goog/fx/dom.js              |   686 -
 externs/GCL/externs/goog/fx/dragdrop.js         |    50 -
 externs/GCL/externs/goog/fx/dragdropgroup.js    |   109 -
 externs/GCL/externs/goog/fx/dragger.js          |   869 -
 externs/GCL/externs/goog/fx/draglistgroup.js    |  1312 -
 .../GCL/externs/goog/fx/dragscrollsupport.js    |   300 -
 externs/GCL/externs/goog/fx/easing.js           |    85 -
 externs/GCL/externs/goog/fx/fx.js               |    34 -
 externs/GCL/externs/goog/fx/transition.js       |    76 -
 externs/GCL/externs/goog/fx/transitionbase.js   |   236 -
 .../externs/goog/graphics/abstractgraphics.js   |   454 -
 .../externs/goog/graphics/affinetransform.js    |   588 -
 .../GCL/externs/goog/graphics/canvaselement.js  |   812 -
 .../GCL/externs/goog/graphics/canvasgraphics.js |   670 -
 externs/GCL/externs/goog/graphics/element.js    |   164 -
 .../GCL/externs/goog/graphics/ellipseelement.js |    63 -
 .../externs/goog/graphics/ext/coordinates.js    |   159 -
 .../GCL/externs/goog/graphics/ext/element.js    |   963 -
 .../GCL/externs/goog/graphics/ext/ellipse.js    |    60 -
 externs/GCL/externs/goog/graphics/ext/ext.js    |    31 -
 .../GCL/externs/goog/graphics/ext/graphics.js   |   218 -
 externs/GCL/externs/goog/graphics/ext/group.js  |   216 -
 externs/GCL/externs/goog/graphics/ext/image.js  |    64 -
 externs/GCL/externs/goog/graphics/ext/path.js   |   142 -
 .../GCL/externs/goog/graphics/ext/rectangle.js  |    55 -
 externs/GCL/externs/goog/graphics/ext/shape.js  |   145 -
 .../goog/graphics/ext/strokeandfillelement.js   |    70 -
 externs/GCL/externs/goog/graphics/fill.js       |    46 -
 externs/GCL/externs/goog/graphics/font.js       |    64 -
 externs/GCL/externs/goog/graphics/graphics.js   |   142 -
 .../GCL/externs/goog/graphics/groupelement.js   |    58 -
 .../GCL/externs/goog/graphics/imageelement.js   |    70 -
 .../GCL/externs/goog/graphics/lineargradient.js |   175 -
 externs/GCL/externs/goog/graphics/path.js       |   511 -
 .../GCL/externs/goog/graphics/pathelement.js    |    54 -
 externs/GCL/externs/goog/graphics/paths.js      |    86 -
 .../GCL/externs/goog/graphics/rectelement.js    |    63 -
 externs/GCL/externs/goog/graphics/solidfill.js  |    74 -
 externs/GCL/externs/goog/graphics/stroke.js     |    86 -
 .../goog/graphics/strokeandfillelement.js       |   114 -
 externs/GCL/externs/goog/graphics/svgelement.js |   284 -
 .../GCL/externs/goog/graphics/svggraphics.js    |   878 -
 .../GCL/externs/goog/graphics/textelement.js    |    55 -
 externs/GCL/externs/goog/graphics/vmlelement.js |   438 -
 .../GCL/externs/goog/graphics/vmlgraphics.js    |   948 -
 externs/GCL/externs/goog/history/event.js       |    55 -
 externs/GCL/externs/goog/history/eventtype.js   |    30 -
 externs/GCL/externs/goog/history/history.js     |  1005 -
 .../GCL/externs/goog/history/html5history.js    |   303 -
 externs/GCL/externs/goog/html/flash.js          |   177 -
 .../GCL/externs/goog/html/legacyconversions.js  |   200 -
 externs/GCL/externs/goog/html/safehtml.js       |   756 -
 externs/GCL/externs/goog/html/safescript.js     |   234 -
 externs/GCL/externs/goog/html/safestyle.js      |   442 -
 externs/GCL/externs/goog/html/safestylesheet.js |   276 -
 externs/GCL/externs/goog/html/safeurl.js        |   431 -
 externs/GCL/externs/goog/html/silverlight.js    |    92 -
 .../GCL/externs/goog/html/trustedresourceurl.js |   224 -
 .../externs/goog/html/uncheckedconversions.js   |   231 -
 externs/GCL/externs/goog/html/utils.js          |    67 -
 externs/GCL/externs/goog/i18n/bidi.js           |   897 -
 externs/GCL/externs/goog/i18n/bidiformatter.js  |   596 -
 .../externs/goog/i18n/charlistdecompressor.js   |   158 -
 externs/GCL/externs/goog/i18n/charpickerdata.js |  3666 ---
 externs/GCL/externs/goog/i18n/collation.js      |    58 -
 .../goog/i18n/compactnumberformatsymbols.js     |  9763 ------
 .../goog/i18n/compactnumberformatsymbols_ext.js | 27778 -----------------
 externs/GCL/externs/goog/i18n/currency.js       |   437 -
 .../GCL/externs/goog/i18n/currencycodemap.js    |   207 -
 externs/GCL/externs/goog/i18n/datetimeformat.js |   771 -
 externs/GCL/externs/goog/i18n/datetimeparse.js  |  1150 -
 .../GCL/externs/goog/i18n/datetimepatterns.js   |  2520 --
 .../externs/goog/i18n/datetimepatternsext.js    | 14208 ---------
 .../GCL/externs/goog/i18n/datetimesymbols.js    |  4524 ---
 .../GCL/externs/goog/i18n/datetimesymbolsext.js | 22115 -------------
 externs/GCL/externs/goog/i18n/graphemebreak.js  |   214 -
 externs/GCL/externs/goog/i18n/messageformat.js  |   780 -
 externs/GCL/externs/goog/i18n/mime.js           |   111 -
 externs/GCL/externs/goog/i18n/numberformat.js   |  1266 -
 .../externs/goog/i18n/numberformatsymbols.js    |  4271 ---
 .../externs/goog/i18n/numberformatsymbolsext.js | 11335 -------
 externs/GCL/externs/goog/i18n/ordinalrules.js   |   748 -
 externs/GCL/externs/goog/i18n/pluralrules.js    |  1120 -
 externs/GCL/externs/goog/i18n/timezone.js       |   341 -
 externs/GCL/externs/goog/i18n/uchar.js          |   292 -
 .../externs/goog/i18n/uchar/localnamefetcher.js |    74 -
 .../GCL/externs/goog/i18n/uchar/namefetcher.js  |    70 -
 .../goog/i18n/uchar/remotenamefetcher.js        |   282 -
 externs/GCL/externs/goog/i18n/ucharnames.js     |  1098 -
 externs/GCL/externs/goog/images/blank.gif       |   Bin 49 -> 0 bytes
 .../GCL/externs/goog/images/bubble_close.jpg    |   Bin 586 -> 0 bytes
 externs/GCL/externs/goog/images/bubble_left.gif |   Bin 85 -> 0 bytes
 .../GCL/externs/goog/images/bubble_right.gif    |   Bin 86 -> 0 bytes
 externs/GCL/externs/goog/images/button-bg.gif   |   Bin 454 -> 0 bytes
 .../GCL/externs/goog/images/check-outline.gif   |   Bin 69 -> 0 bytes
 .../GCL/externs/goog/images/check-sprite.gif    |   Bin 75 -> 0 bytes
 externs/GCL/externs/goog/images/check.gif       |   Bin 53 -> 0 bytes
 externs/GCL/externs/goog/images/close_box.gif   |   Bin 65 -> 0 bytes
 .../externs/goog/images/color-swatch-tick.gif   |   Bin 69 -> 0 bytes
 .../externs/goog/images/dialog_close_box.gif    |   Bin 86 -> 0 bytes
 .../goog/images/dimension-highlighted.png       |   Bin 171 -> 0 bytes
 .../goog/images/dimension-unhighlighted.png     |   Bin 171 -> 0 bytes
 externs/GCL/externs/goog/images/dropdn.gif      |   Bin 51 -> 0 bytes
 .../GCL/externs/goog/images/dropdn_disabled.gif |   Bin 51 -> 0 bytes
 externs/GCL/externs/goog/images/dropdown.gif    |   Bin 78 -> 0 bytes
 .../GCL/externs/goog/images/gears_bluedot.gif   |   Bin 236 -> 0 bytes
 .../GCL/externs/goog/images/gears_online.gif    |   Bin 137 -> 0 bytes
 .../GCL/externs/goog/images/gears_paused.gif    |   Bin 93 -> 0 bytes
 .../GCL/externs/goog/images/gears_syncing.gif   |   Bin 761 -> 0 bytes
 .../GCL/externs/goog/images/hsv-sprite-sm.gif   |   Bin 11851 -> 0 bytes
 .../GCL/externs/goog/images/hsv-sprite-sm.png   |   Bin 19537 -> 0 bytes
 externs/GCL/externs/goog/images/hsv-sprite.gif  |   Bin 33309 -> 0 bytes
 externs/GCL/externs/goog/images/hsv-sprite.png  |   Bin 58142 -> 0 bytes
 .../GCL/externs/goog/images/hsva-sprite-sm.gif  |   Bin 12571 -> 0 bytes
 .../GCL/externs/goog/images/hsva-sprite-sm.png  |   Bin 19921 -> 0 bytes
 externs/GCL/externs/goog/images/hsva-sprite.gif |   Bin 36428 -> 0 bytes
 externs/GCL/externs/goog/images/hsva-sprite.png |   Bin 60591 -> 0 bytes
 .../goog/images/left_anchor_bubble_bot.gif      |   Bin 431 -> 0 bytes
 .../goog/images/left_anchor_bubble_top.gif      |   Bin 332 -> 0 bytes
 externs/GCL/externs/goog/images/menu-arrows.gif |   Bin 113 -> 0 bytes
 externs/GCL/externs/goog/images/minus.png       |   Bin 238 -> 0 bytes
 .../goog/images/no_anchor_bubble_bot.gif        |   Bin 228 -> 0 bytes
 .../goog/images/no_anchor_bubble_top.gif        |   Bin 123 -> 0 bytes
 .../GCL/externs/goog/images/offlineicons.png    |   Bin 5643 -> 0 bytes
 externs/GCL/externs/goog/images/plus.png        |   Bin 239 -> 0 bytes
 externs/GCL/externs/goog/images/ratingstars.gif |   Bin 1139 -> 0 bytes
 .../goog/images/right_anchor_bubble_bot.gif     |   Bin 425 -> 0 bytes
 .../goog/images/right_anchor_bubble_top.gif     |   Bin 335 -> 0 bytes
 externs/GCL/externs/goog/images/toolbar-bg.png  |   Bin 203 -> 0 bytes
 .../externs/goog/images/toolbar-separator.gif   |   Bin 472 -> 0 bytes
 .../GCL/externs/goog/images/toolbar_icons.gif   |   Bin 1062 -> 0 bytes
 externs/GCL/externs/goog/images/tree/I.png      |   Bin 232 -> 0 bytes
 .../GCL/externs/goog/images/tree/cleardot.gif   |   Bin 43 -> 0 bytes
 externs/GCL/externs/goog/images/tree/tree.gif   |   Bin 1568 -> 0 bytes
 externs/GCL/externs/goog/images/tree/tree.png   |   Bin 1262 -> 0 bytes
 externs/GCL/externs/goog/images/ui_controls.jpg |   Bin 21680 -> 0 bytes
 externs/GCL/externs/goog/iter/iter.js           |  1305 -
 .../GCL/externs/goog/json/evaljsonprocessor.js  |    67 -
 externs/GCL/externs/goog/json/hybrid.js         |   103 -
 .../externs/goog/json/hybridjsonprocessor.js    |    47 -
 externs/GCL/externs/goog/json/json.js           |   365 -
 externs/GCL/externs/goog/json/json_perf.js      |   112 -
 .../externs/goog/json/nativejsonprocessor.js    |    73 -
 externs/GCL/externs/goog/json/processor.js      |    33 -
 .../goog/labs/dom/pagevisibilitymonitor.js      |   211 -
 .../labs/events/nondisposableeventtarget.js     |   305 -
 externs/GCL/externs/goog/labs/events/touch.js   |    82 -
 externs/GCL/externs/goog/labs/format/csv.js     |   415 -
 .../goog/labs/html/attribute_rewriter.js        |    74 -
 externs/GCL/externs/goog/labs/html/sanitizer.js |   392 -
 externs/GCL/externs/goog/labs/html/scrubber.js  |  1027 -
 .../GCL/externs/goog/labs/i18n/listformat.js    |   261 -
 .../GCL/externs/goog/labs/i18n/listsymbols.js   |  1796 --
 .../externs/goog/labs/i18n/listsymbolsext.js    | 10071 ------
 .../GCL/externs/goog/labs/iterable/iterable.js  |   139 -
 externs/GCL/externs/goog/labs/mock/mock.js      |   861 -
 externs/GCL/externs/goog/labs/net/image.js      |    94 -
 .../externs/goog/labs/net/testdata/cleardot.gif |   Bin 43 -> 0 bytes
 .../goog/labs/net/testdata/xhr_test_json.data   |     2 -
 .../goog/labs/net/testdata/xhr_test_text.data   |     1 -
 externs/GCL/externs/goog/labs/net/webchannel.js |   311 -
 .../externs/goog/labs/net/webchannel/channel.js |   181 -
 .../goog/labs/net/webchannel/channelrequest.js  |  1084 -
 .../goog/labs/net/webchannel/connectionstate.js |    50 -
 .../net/webchannel/forwardchannelrequestpool.js |   279 -
 .../goog/labs/net/webchannel/netutils.js        |   162 -
 .../goog/labs/net/webchannel/requeststats.js    |   383 -
 .../goog/labs/net/webchannel/webchannelbase.js  |  2084 --
 .../net/webchannel/webchannelbasetransport.js   |   379 -
 .../goog/labs/net/webchannel/webchanneldebug.js |   260 -
 .../externs/goog/labs/net/webchannel/wire.js    |    75 -
 .../externs/goog/labs/net/webchannel/wirev8.js  |   136 -
 .../goog/labs/net/webchanneltransport.js        |    75 -
 .../goog/labs/net/webchanneltransportfactory.js |    37 -
 externs/GCL/externs/goog/labs/net/xhr.js        |   468 -
 externs/GCL/externs/goog/labs/object/object.js  |    47 -
 .../externs/goog/labs/pubsub/broadcastpubsub.js |   564 -
 .../labs/storage/boundedcollectablestorage.js   |   287 -
 externs/GCL/externs/goog/labs/structs/map.js    |   348 -
 .../GCL/externs/goog/labs/structs/map_perf.js   |   205 -
 .../GCL/externs/goog/labs/structs/multimap.js   |   282 -
 .../goog/labs/style/pixeldensitymonitor.js      |   179 -
 .../GCL/externs/goog/labs/testing/assertthat.js |    58 -
 .../goog/labs/testing/decoratormatcher.js       |    95 -
 .../goog/labs/testing/dictionarymatcher.js      |   273 -
 .../externs/goog/labs/testing/environment.js    |   293 -
 .../externs/goog/labs/testing/logicmatcher.js   |   212 -
 .../GCL/externs/goog/labs/testing/matcher.js    |    80 -
 .../externs/goog/labs/testing/numbermatcher.js  |   346 -
 .../externs/goog/labs/testing/objectmatcher.js  |   317 -
 .../externs/goog/labs/testing/stringmatcher.js  |   415 -
 .../GCL/externs/goog/labs/useragent/browser.js  |   327 -
 .../GCL/externs/goog/labs/useragent/device.js   |    65 -
 .../GCL/externs/goog/labs/useragent/engine.js   |   160 -
 .../GCL/externs/goog/labs/useragent/platform.js |   160 -
 externs/GCL/externs/goog/labs/useragent/util.js |   148 -
 externs/GCL/externs/goog/locale/countries.js    |   291 -
 .../goog/locale/defaultlocalenameconstants.js   |   941 -
 .../GCL/externs/goog/locale/genericfontnames.js |    73 -
 .../externs/goog/locale/genericfontnamesdata.js |   327 -
 externs/GCL/externs/goog/locale/locale.js       |   403 -
 .../externs/goog/locale/nativenameconstants.js  |  1354 -
 .../externs/goog/locale/scriptToLanguages.js    |   482 -
 .../externs/goog/locale/timezonedetection.js    |   116 -
 .../externs/goog/locale/timezonefingerprint.js  |   248 -
 externs/GCL/externs/goog/locale/timezonelist.js |   131 -
 externs/GCL/externs/goog/log/log.js             |   197 -
 .../GCL/externs/goog/math/affinetransform.js    |   589 -
 externs/GCL/externs/goog/math/bezier.js         |   340 -
 externs/GCL/externs/goog/math/box.js            |   389 -
 externs/GCL/externs/goog/math/coordinate.js     |   268 -
 externs/GCL/externs/goog/math/coordinate3.js    |   170 -
 .../GCL/externs/goog/math/exponentialbackoff.js |   104 -
 externs/GCL/externs/goog/math/integer.js        |   739 -
 .../goog/math/interpolator/interpolator1.js     |    64 -
 .../externs/goog/math/interpolator/linear1.js   |    84 -
 .../externs/goog/math/interpolator/pchip1.js    |    82 -
 .../externs/goog/math/interpolator/spline1.js   |   203 -
 externs/GCL/externs/goog/math/line.js           |   179 -
 externs/GCL/externs/goog/math/long.js           |   804 -
 externs/GCL/externs/goog/math/math.js           |   435 -
 externs/GCL/externs/goog/math/matrix.js         |   681 -
 externs/GCL/externs/goog/math/path.js           |   598 -
 externs/GCL/externs/goog/math/paths.js          |    86 -
 externs/GCL/externs/goog/math/range.js          |   186 -
 externs/GCL/externs/goog/math/rangeset.js       |   396 -
 externs/GCL/externs/goog/math/rect.js           |   464 -
 externs/GCL/externs/goog/math/size.js           |   227 -
 externs/GCL/externs/goog/math/tdma.js           |    73 -
 externs/GCL/externs/goog/math/vec2.js           |   284 -
 externs/GCL/externs/goog/math/vec3.js           |   310 -
 externs/GCL/externs/goog/memoize/memoize.js     |   104 -
 .../externs/goog/messaging/abstractchannel.js   |   209 -
 .../externs/goog/messaging/bufferedchannel.js   |   287 -
 .../externs/goog/messaging/deferredchannel.js   |    98 -
 .../GCL/externs/goog/messaging/loggerclient.js  |   132 -
 .../GCL/externs/goog/messaging/loggerserver.js  |   100 -
 .../externs/goog/messaging/messagechannel.js    |   116 -
 externs/GCL/externs/goog/messaging/messaging.js |    32 -
 .../GCL/externs/goog/messaging/multichannel.js  |   303 -
 .../GCL/externs/goog/messaging/portcaller.js    |   152 -
 .../GCL/externs/goog/messaging/portchannel.js   |   401 -
 .../GCL/externs/goog/messaging/portnetwork.js   |    78 -
 .../GCL/externs/goog/messaging/portoperator.js  |   198 -
 .../externs/goog/messaging/respondingchannel.js |   234 -
 .../messaging/testdata/portchannel_worker.js    |    37 -
 .../messaging/testdata/portnetwork_worker1.js   |    32 -
 .../messaging/testdata/portnetwork_worker2.js   |    32 -
 .../externs/goog/module/abstractmoduleloader.js |    58 -
 externs/GCL/externs/goog/module/basemodule.js   |    47 -
 externs/GCL/externs/goog/module/loader.js       |   347 -
 externs/GCL/externs/goog/module/module.js       |    33 -
 externs/GCL/externs/goog/module/moduleinfo.js   |   341 -
 .../externs/goog/module/moduleloadcallback.js   |    86 -
 externs/GCL/externs/goog/module/moduleloader.js |   461 -
 .../GCL/externs/goog/module/modulemanager.js    |  1358 -
 .../GCL/externs/goog/module/testdata/modA_1.js  |    26 -
 .../GCL/externs/goog/module/testdata/modA_2.js  |    29 -
 .../GCL/externs/goog/module/testdata/modB_1.js  |    33 -
 externs/GCL/externs/goog/net/browserchannel.js  |  2765 --
 externs/GCL/externs/goog/net/bulkloader.js      |   182 -
 .../GCL/externs/goog/net/bulkloaderhelper.js    |   119 -
 externs/GCL/externs/goog/net/channeldebug.js    |   300 -
 externs/GCL/externs/goog/net/channelrequest.js  |  1339 -
 externs/GCL/externs/goog/net/cookies.js         |   371 -
 .../GCL/externs/goog/net/corsxmlhttpfactory.js  |   272 -
 externs/GCL/externs/goog/net/crossdomainrpc.js  |   894 -
 .../externs/goog/net/crossdomainrpc_test.css    |     7 -
 externs/GCL/externs/goog/net/errorcode.js       |   130 -
 externs/GCL/externs/goog/net/eventtype.js       |    37 -
 externs/GCL/externs/goog/net/filedownloader.js  |   746 -
 externs/GCL/externs/goog/net/httpstatus.js      |   116 -
 externs/GCL/externs/goog/net/iframeio.js        |  1405 -
 .../goog/net/iframeio_different_base_test.data  |     2 -
 .../GCL/externs/goog/net/iframeloadmonitor.js   |   204 -
 externs/GCL/externs/goog/net/imageloader.js     |   338 -
 .../externs/goog/net/imageloader_testimg1.gif   |   Bin 453 -> 0 bytes
 .../externs/goog/net/imageloader_testimg2.gif   |   Bin 460 -> 0 bytes
 .../externs/goog/net/imageloader_testimg3.gif   |   Bin 13446 -> 0 bytes
 externs/GCL/externs/goog/net/ipaddress.js       |   509 -
 externs/GCL/externs/goog/net/jsloader.js        |   367 -
 externs/GCL/externs/goog/net/jsonp.js           |   340 -
 externs/GCL/externs/goog/net/mockiframeio.js    |   308 -
 .../externs/goog/net/multiiframeloadmonitor.js  |   118 -
 .../externs/goog/net/networkstatusmonitor.js    |    47 -
 externs/GCL/externs/goog/net/tmpnetwork.js      |   164 -
 externs/GCL/externs/goog/net/websocket.js       |   524 -
 .../externs/goog/net/wrapperxmlhttpfactory.js   |    71 -
 externs/GCL/externs/goog/net/xhrio.js           |  1224 -
 externs/GCL/externs/goog/net/xhriopool.js       |    79 -
 externs/GCL/externs/goog/net/xhrlike.js         |   124 -
 externs/GCL/externs/goog/net/xhrmanager.js      |   772 -
 externs/GCL/externs/goog/net/xmlhttp.js         |   246 -
 externs/GCL/externs/goog/net/xmlhttpfactory.js  |    67 -
 .../externs/goog/net/xpc/crosspagechannel.js    |   855 -
 .../goog/net/xpc/crosspagechannelrole.js        |    30 -
 .../GCL/externs/goog/net/xpc/directtransport.js |   635 -
 .../goog/net/xpc/frameelementmethodtransport.js |   270 -
 .../goog/net/xpc/iframepollingtransport.js      |   985 -
 .../goog/net/xpc/iframerelaytransport.js        |   410 -
 .../goog/net/xpc/nativemessagingtransport.js    |   648 -
 .../GCL/externs/goog/net/xpc/nixtransport.js    |   483 -
 externs/GCL/externs/goog/net/xpc/relay.js       |    73 -
 externs/GCL/externs/goog/net/xpc/transport.js   |   105 -
 externs/GCL/externs/goog/net/xpc/xpc.js         |   300 -
 externs/GCL/externs/goog/object/object.js       |   686 -
 .../goog/positioning/absoluteposition.js        |    73 -
 .../goog/positioning/abstractposition.js        |    44 -
 .../goog/positioning/anchoredposition.js        |    92 -
 .../positioning/anchoredviewportposition.js     |   189 -
 .../externs/goog/positioning/clientposition.js  |    89 -
 .../goog/positioning/menuanchoredposition.js    |    66 -
 .../GCL/externs/goog/positioning/positioning.js |   619 -
 .../goog/positioning/viewportclientposition.js  |   124 -
 .../goog/positioning/viewportposition.js        |    66 -
 externs/GCL/externs/goog/promise/promise.js     |  1304 -
 externs/GCL/externs/goog/promise/resolver.js    |    48 -
 externs/GCL/externs/goog/promise/thenable.js    |   111 -
 externs/GCL/externs/goog/proto/proto.js         |    44 -
 externs/GCL/externs/goog/proto/serializer.js    |    70 -
 externs/GCL/externs/goog/proto2/descriptor.js   |   202 -
 .../GCL/externs/goog/proto2/fielddescriptor.js  |   312 -
 .../GCL/externs/goog/proto2/lazydeserializer.js |    70 -
 externs/GCL/externs/goog/proto2/message.js      |   722 -
 .../GCL/externs/goog/proto2/objectserializer.js |   176 -
 .../GCL/externs/goog/proto2/pbliteserializer.js |   199 -
 externs/GCL/externs/goog/proto2/serializer.js   |   182 -
 .../externs/goog/proto2/textformatserializer.js |  1072 -
 externs/GCL/externs/goog/proto2/util.js         |    54 -
 externs/GCL/externs/goog/pubsub/pubsub.js       |   321 -
 externs/GCL/externs/goog/pubsub/topicid.js      |    61 -
 externs/GCL/externs/goog/pubsub/typedpubsub.js  |   126 -
 externs/GCL/externs/goog/reflect/reflect.js     |    78 -
 .../GCL/externs/goog/result/deferredadaptor.js  |    59 -
 .../GCL/externs/goog/result/dependentresult.js  |    45 -
 .../GCL/externs/goog/result/result_interface.js |   119 -
 externs/GCL/externs/goog/result/resultutil.js   |   556 -
 externs/GCL/externs/goog/result/simpleresult.js |   260 -
 externs/GCL/externs/goog/soy/data.js            |   160 -
 externs/GCL/externs/goog/soy/renderer.js        |   314 -
 externs/GCL/externs/goog/soy/soy.js             |   218 -
 externs/GCL/externs/goog/spell/spellcheck.js    |   478 -
 externs/GCL/externs/goog/stats/basicstat.js     |   270 -
 .../externs/goog/storage/collectablestorage.js  |   134 -
 .../externs/goog/storage/encryptedstorage.js    |   196 -
 externs/GCL/externs/goog/storage/errorcode.js   |    30 -
 .../GCL/externs/goog/storage/expiringstorage.js |   141 -
 .../externs/goog/storage/mechanism/errorcode.js |    31 -
 .../storage/mechanism/errorhandlingmechanism.js |   131 -
 .../goog/storage/mechanism/html5localstorage.js |    46 -
 .../storage/mechanism/html5sessionstorage.js    |    47 -
 .../goog/storage/mechanism/html5webstorage.js   |   172 -
 .../goog/storage/mechanism/ieuserdata.js        |   279 -
 .../goog/storage/mechanism/iterablemechanism.js |    86 -
 .../externs/goog/storage/mechanism/mechanism.js |    57 -
 .../goog/storage/mechanism/mechanismfactory.js  |   112 -
 .../goog/storage/mechanism/prefixedmechanism.js |    92 -
 externs/GCL/externs/goog/storage/richstorage.js |   150 -
 externs/GCL/externs/goog/storage/storage.js     |    97 -
 externs/GCL/externs/goog/string/const.js        |   182 -
 externs/GCL/externs/goog/string/linkify.js      |   252 -
 externs/GCL/externs/goog/string/newlines.js     |   154 -
 externs/GCL/externs/goog/string/parser.js       |    38 -
 externs/GCL/externs/goog/string/path.js         |   169 -
 externs/GCL/externs/goog/string/string.js       |  1565 -
 externs/GCL/externs/goog/string/stringbuffer.js |   103 -
 externs/GCL/externs/goog/string/stringformat.js |   250 -
 externs/GCL/externs/goog/string/stringifier.js  |    38 -
 externs/GCL/externs/goog/string/typedstring.js  |    48 -
 externs/GCL/externs/goog/structs/avltree.js     |   899 -
 .../GCL/externs/goog/structs/circularbuffer.js  |   216 -
 externs/GCL/externs/goog/structs/collection.js  |    56 -
 externs/GCL/externs/goog/structs/heap.js        |   334 -
 .../GCL/externs/goog/structs/inversionmap.js    |   155 -
 externs/GCL/externs/goog/structs/linkedmap.js   |   488 -
 externs/GCL/externs/goog/structs/map.js         |   456 -
 externs/GCL/externs/goog/structs/node.js        |    73 -
 externs/GCL/externs/goog/structs/pool.js        |   376 -
 .../GCL/externs/goog/structs/prioritypool.js    |   182 -
 .../GCL/externs/goog/structs/priorityqueue.js   |    66 -
 externs/GCL/externs/goog/structs/quadtree.js    |   570 -
 externs/GCL/externs/goog/structs/queue.js       |   187 -
 externs/GCL/externs/goog/structs/set.js         |   279 -
 externs/GCL/externs/goog/structs/simplepool.js  |   200 -
 externs/GCL/externs/goog/structs/stringset.js   |   405 -
 externs/GCL/externs/goog/structs/structs.js     |   354 -
 externs/GCL/externs/goog/structs/treenode.js    |   458 -
 externs/GCL/externs/goog/structs/trie.js        |   395 -
 externs/GCL/externs/goog/structs/weak/weak.js   |   159 -
 externs/GCL/externs/goog/style/bidi.js          |   184 -
 externs/GCL/externs/goog/style/cursor.js        |   116 -
 externs/GCL/externs/goog/style/style.js         |  2045 --
 .../GCL/externs/goog/style/style_test_rect.svg  |    11 -
 externs/GCL/externs/goog/style/transform.js     |   169 -
 externs/GCL/externs/goog/style/transition.js    |   133 -
 externs/GCL/externs/goog/testing/asserts.js     |  1265 -
 .../externs/goog/testing/async/mockcontrol.js   |   175 -
 externs/GCL/externs/goog/testing/benchmark.js   |    96 -
 externs/GCL/externs/goog/testing/dom.js         |   633 -
 externs/GCL/externs/goog/testing/editor/dom.js  |   293 -
 .../externs/goog/testing/editor/fieldmock.js    |   116 -
 .../goog/testing/events/eventobserver.js        |    87 -
 .../GCL/externs/goog/testing/events/events.js   |   727 -
 .../GCL/externs/goog/testing/events/matchers.js |    42 -
 .../goog/testing/events/onlinehandler.js        |    65 -
 .../externs/goog/testing/expectedfailures.js    |   237 -
 externs/GCL/externs/goog/testing/fs/blob.js     |   135 -
 externs/GCL/externs/goog/testing/fs/entry.js    |   637 -
 externs/GCL/externs/goog/testing/fs/file.js     |    53 -
 .../GCL/externs/goog/testing/fs/filereader.js   |   275 -
 .../GCL/externs/goog/testing/fs/filesystem.js   |    64 -
 .../GCL/externs/goog/testing/fs/filewriter.js   |   268 -
 externs/GCL/externs/goog/testing/fs/fs.js       |   169 -
 .../externs/goog/testing/fs/progressevent.js    |    82 -
 .../GCL/externs/goog/testing/functionmock.js    |   176 -
 externs/GCL/externs/goog/testing/graphics.js    |    64 -
 .../GCL/externs/goog/testing/i18n/asserts.js    |    77 -
 externs/GCL/externs/goog/testing/jsunit.js      |   162 -
 externs/GCL/externs/goog/testing/loosemock.js   |   242 -
 .../testing/messaging/mockmessagechannel.js     |    80 -
 .../goog/testing/messaging/mockmessageevent.js  |   102 -
 .../goog/testing/messaging/mockmessageport.js   |    86 -
 .../goog/testing/messaging/mockportnetwork.js   |    66 -
 externs/GCL/externs/goog/testing/mock.js        |   645 -
 .../externs/goog/testing/mockclassfactory.js    |   585 -
 externs/GCL/externs/goog/testing/mockclock.js   |   600 -
 externs/GCL/externs/goog/testing/mockcontrol.js |   220 -
 .../GCL/externs/goog/testing/mockinterface.js   |    45 -
 .../GCL/externs/goog/testing/mockmatchers.js    |   400 -
 externs/GCL/externs/goog/testing/mockrandom.js  |   153 -
 externs/GCL/externs/goog/testing/mockrange.js   |    67 -
 externs/GCL/externs/goog/testing/mockstorage.js |   108 -
 .../GCL/externs/goog/testing/mockuseragent.js   |   143 -
 externs/GCL/externs/goog/testing/net/xhrio.js   |   743 -
 .../GCL/externs/goog/testing/net/xhriopool.js   |    65 -
 .../goog/testing/objectpropertystring.js        |    68 -
 .../externs/goog/testing/performancetable.css   |    46 -
 .../externs/goog/testing/performancetable.js    |   196 -
 .../externs/goog/testing/performancetimer.js    |   418 -
 .../externs/goog/testing/propertyreplacer.js    |   245 -
 .../GCL/externs/goog/testing/proto2/proto2.js   |   145 -
 .../GCL/externs/goog/testing/pseudorandom.js    |   180 -
 .../GCL/externs/goog/testing/recordfunction.js  |   215 -
 externs/GCL/externs/goog/testing/singleton.js   |    46 -
 externs/GCL/externs/goog/testing/stacktrace.js  |   594 -
 .../goog/testing/storage/fakemechanism.js       |    68 -
 externs/GCL/externs/goog/testing/strictmock.js  |   130 -
 .../externs/goog/testing/style/layoutasserts.js |   310 -
 externs/GCL/externs/goog/testing/style/style.js |   101 -
 .../externs/goog/testing/ui/rendererasserts.js  |    58 -
 .../externs/goog/testing/ui/rendererharness.js  |   177 -
 externs/GCL/externs/goog/testing/ui/style.js    |   140 -
 externs/GCL/externs/goog/testing/watchers.js    |    46 -
 externs/GCL/externs/goog/timer/timer.js         |   329 -
 externs/GCL/externs/goog/tweak/entries.js       |  1002 -
 externs/GCL/externs/goog/tweak/registry.js      |   315 -
 externs/GCL/externs/goog/tweak/tweak.js         |   301 -
 externs/GCL/externs/goog/tweak/tweakui.js       |   841 -
 .../GCL/externs/goog/ui/abstractspellchecker.js |  1231 -
 externs/GCL/externs/goog/ui/ac/ac.js            |    50 -
 externs/GCL/externs/goog/ui/ac/arraymatcher.js  |   216 -
 externs/GCL/externs/goog/ui/ac/autocomplete.js  |   921 -
 .../GCL/externs/goog/ui/ac/cachingmatcher.js    |   273 -
 externs/GCL/externs/goog/ui/ac/inputhandler.js  |  1327 -
 externs/GCL/externs/goog/ui/ac/remote.js        |   114 -
 .../externs/goog/ui/ac/remotearraymatcher.js    |   274 -
 externs/GCL/externs/goog/ui/ac/renderer.js      |  1109 -
 externs/GCL/externs/goog/ui/ac/renderoptions.js |    80 -
 .../GCL/externs/goog/ui/ac/richinputhandler.js  |    58 -
 externs/GCL/externs/goog/ui/ac/richremote.js    |   113 -
 .../goog/ui/ac/richremotearraymatcher.js        |   144 -
 externs/GCL/externs/goog/ui/activitymonitor.js  |   348 -
 externs/GCL/externs/goog/ui/advancedtooltip.js  |   367 -
 externs/GCL/externs/goog/ui/animatedzippy.js    |   202 -
 externs/GCL/externs/goog/ui/attachablemenu.js   |   476 -
 externs/GCL/externs/goog/ui/bidiinput.js        |   174 -
 externs/GCL/externs/goog/ui/bubble.js           |   490 -
 externs/GCL/externs/goog/ui/button.js           |   214 -
 externs/GCL/externs/goog/ui/buttonrenderer.js   |   219 -
 externs/GCL/externs/goog/ui/buttonside.js       |    41 -
 externs/GCL/externs/goog/ui/charcounter.js      |   199 -
 externs/GCL/externs/goog/ui/charpicker.js       |   925 -
 externs/GCL/externs/goog/ui/checkbox.js         |   272 -
 externs/GCL/externs/goog/ui/checkboxmenuitem.js |    53 -
 externs/GCL/externs/goog/ui/checkboxrenderer.js |   191 -
 externs/GCL/externs/goog/ui/colorbutton.js      |    59 -
 .../GCL/externs/goog/ui/colorbuttonrenderer.js  |    75 -
 externs/GCL/externs/goog/ui/colormenubutton.js  |   215 -
 .../externs/goog/ui/colormenubuttonrenderer.js  |   148 -
 externs/GCL/externs/goog/ui/colorpalette.js     |   179 -
 externs/GCL/externs/goog/ui/colorpicker.js      |   345 -
 .../GCL/externs/goog/ui/colorsplitbehavior.js   |    61 -
 externs/GCL/externs/goog/ui/combobox.js         |   993 -
 externs/GCL/externs/goog/ui/component.js        |  1298 -
 externs/GCL/externs/goog/ui/container.js        |  1354 -
 .../GCL/externs/goog/ui/containerrenderer.js    |   375 -
 .../GCL/externs/goog/ui/containerscroller.js    |   223 -
 externs/GCL/externs/goog/ui/control.js          |  1542 -
 externs/GCL/externs/goog/ui/controlcontent.js   |    28 -
 externs/GCL/externs/goog/ui/controlrenderer.js  |   949 -
 externs/GCL/externs/goog/ui/cookieeditor.js     |   185 -
 .../GCL/externs/goog/ui/css3buttonrenderer.js   |   155 -
 .../externs/goog/ui/css3menubuttonrenderer.js   |   148 -
 externs/GCL/externs/goog/ui/cssnames.js         |    29 -
 externs/GCL/externs/goog/ui/custombutton.js     |    58 -
 .../GCL/externs/goog/ui/custombuttonrenderer.js |   272 -
 .../GCL/externs/goog/ui/customcolorpalette.js   |   141 -
 externs/GCL/externs/goog/ui/datepicker.js       |  1550 -
 .../GCL/externs/goog/ui/datepickerrenderer.js   |    55 -
 externs/GCL/externs/goog/ui/decorate.js         |    38 -
 .../goog/ui/defaultdatepickerrenderer.js        |   202 -
 externs/GCL/externs/goog/ui/dialog.js           |  1611 -
 externs/GCL/externs/goog/ui/dimensionpicker.js  |   318 -
 .../externs/goog/ui/dimensionpickerrenderer.js  |   420 -
 externs/GCL/externs/goog/ui/dragdropdetector.js |   648 -
 externs/GCL/externs/goog/ui/drilldownrow.js     |   547 -
 .../externs/goog/ui/editor/abstractdialog.js    |   444 -
 externs/GCL/externs/goog/ui/editor/bubble.js    |   559 -
 .../externs/goog/ui/editor/defaulttoolbar.js    |  1066 -
 .../GCL/externs/goog/ui/editor/linkdialog.js    |  1065 -
 externs/GCL/externs/goog/ui/editor/messages.js  |   148 -
 externs/GCL/externs/goog/ui/editor/tabpane.js   |   202 -
 .../externs/goog/ui/editor/toolbarcontroller.js |   296 -
 .../externs/goog/ui/editor/toolbarfactory.js    |   439 -
 externs/GCL/externs/goog/ui/emoji/emoji.js      |    73 -
 .../GCL/externs/goog/ui/emoji/emojipalette.js   |   288 -
 .../goog/ui/emoji/emojipaletterenderer.js       |   210 -
 .../GCL/externs/goog/ui/emoji/emojipicker.js    |   802 -
 .../externs/goog/ui/emoji/popupemojipicker.js   |   411 -
 .../ui/emoji/progressiveemojipaletterenderer.js |   100 -
 externs/GCL/externs/goog/ui/emoji/spriteinfo.js |   213 -
 externs/GCL/externs/goog/ui/filteredmenu.js     |   638 -
 .../externs/goog/ui/filterobservingmenuitem.js  |    98 -
 .../goog/ui/filterobservingmenuitemrenderer.js  |    63 -
 .../GCL/externs/goog/ui/flatbuttonrenderer.js   |   148 -
 .../externs/goog/ui/flatmenubuttonrenderer.js   |   209 -
 externs/GCL/externs/goog/ui/formpost.js         |   109 -
 externs/GCL/externs/goog/ui/gauge.js            |  1014 -
 externs/GCL/externs/goog/ui/gaugetheme.js       |   170 -
 externs/GCL/externs/goog/ui/hovercard.js        |   458 -
 externs/GCL/externs/goog/ui/hsvapalette.js      |   295 -
 externs/GCL/externs/goog/ui/hsvpalette.js       |   527 -
 externs/GCL/externs/goog/ui/idgenerator.js      |    48 -
 externs/GCL/externs/goog/ui/idletimer.js        |   300 -
 externs/GCL/externs/goog/ui/iframemask.js       |   258 -
 .../externs/goog/ui/imagelessbuttonrenderer.js  |   208 -
 .../goog/ui/imagelessmenubuttonrenderer.js      |   213 -
 externs/GCL/externs/goog/ui/inputdatepicker.js  |   343 -
 externs/GCL/externs/goog/ui/itemevent.js        |    51 -
 .../externs/goog/ui/keyboardshortcuthandler.js  |  1162 -
 externs/GCL/externs/goog/ui/labelinput.js       |   614 -
 .../GCL/externs/goog/ui/linkbuttonrenderer.js   |    67 -
 .../GCL/externs/goog/ui/media/flashobject.js    |   632 -
 externs/GCL/externs/goog/ui/media/flickr.js     |   314 -
 .../GCL/externs/goog/ui/media/googlevideo.js    |   283 -
 externs/GCL/externs/goog/ui/media/media.js      |   290 -
 externs/GCL/externs/goog/ui/media/mediamodel.js |   978 -
 externs/GCL/externs/goog/ui/media/mp3.js        |   226 -
 externs/GCL/externs/goog/ui/media/photo.js      |   144 -
 externs/GCL/externs/goog/ui/media/picasa.js     |   327 -
 externs/GCL/externs/goog/ui/media/vimeo.js      |   278 -
 externs/GCL/externs/goog/ui/media/youtube.js    |   359 -
 externs/GCL/externs/goog/ui/menu.js             |   479 -
 externs/GCL/externs/goog/ui/menubar.js          |    44 -
 externs/GCL/externs/goog/ui/menubardecorator.js |    35 -
 externs/GCL/externs/goog/ui/menubarrenderer.js  |    68 -
 externs/GCL/externs/goog/ui/menubase.js         |   190 -
 externs/GCL/externs/goog/ui/menubutton.js       |  1052 -
 .../GCL/externs/goog/ui/menubuttonrenderer.js   |   192 -
 externs/GCL/externs/goog/ui/menuheader.js       |    62 -
 .../GCL/externs/goog/ui/menuheaderrenderer.js   |    54 -
 externs/GCL/externs/goog/ui/menuitem.js         |   322 -
 externs/GCL/externs/goog/ui/menuitemrenderer.js |   356 -
 externs/GCL/externs/goog/ui/menurenderer.js     |   115 -
 externs/GCL/externs/goog/ui/menuseparator.js    |    52 -
 .../externs/goog/ui/menuseparatorrenderer.js    |   114 -
 .../GCL/externs/goog/ui/mockactivitymonitor.js  |    72 -
 .../goog/ui/modalariavisibilityhelper.js        |    87 -
 externs/GCL/externs/goog/ui/modalpopup.js       |   732 -
 .../GCL/externs/goog/ui/nativebuttonrenderer.js |   213 -
 externs/GCL/externs/goog/ui/option.js           |    68 -
 externs/GCL/externs/goog/ui/palette.js          |   604 -
 externs/GCL/externs/goog/ui/paletterenderer.js  |   383 -
 .../externs/goog/ui/plaintextspellchecker.js    |   643 -
 externs/GCL/externs/goog/ui/popup.js            |   185 -
 externs/GCL/externs/goog/ui/popupbase.js        |   894 -
 externs/GCL/externs/goog/ui/popupcolorpicker.js |   475 -
 externs/GCL/externs/goog/ui/popupdatepicker.js  |   288 -
 externs/GCL/externs/goog/ui/popupmenu.js        |   643 -
 externs/GCL/externs/goog/ui/progressbar.js      |   408 -
 externs/GCL/externs/goog/ui/prompt.js           |   411 -
 externs/GCL/externs/goog/ui/rangemodel.js       |   303 -
 externs/GCL/externs/goog/ui/ratings.js          |   509 -
 externs/GCL/externs/goog/ui/registry.js         |   172 -
 .../GCL/externs/goog/ui/richtextspellchecker.js |   780 -
 externs/GCL/externs/goog/ui/roundedpanel.js     |   632 -
 .../GCL/externs/goog/ui/roundedtabrenderer.js   |   201 -
 externs/GCL/externs/goog/ui/scrollfloater.js    |   637 -
 externs/GCL/externs/goog/ui/select.js           |   538 -
 .../GCL/externs/goog/ui/selectionmenubutton.js  |   302 -
 externs/GCL/externs/goog/ui/selectionmodel.js   |   301 -
 externs/GCL/externs/goog/ui/separator.js        |    80 -
 externs/GCL/externs/goog/ui/serverchart.js      |  1840 --
 externs/GCL/externs/goog/ui/slider.js           |   136 -
 externs/GCL/externs/goog/ui/sliderbase.js       |  1657 -
 externs/GCL/externs/goog/ui/splitbehavior.js    |   335 -
 externs/GCL/externs/goog/ui/splitpane.js        |   911 -
 .../externs/goog/ui/style/app/buttonrenderer.js |   205 -
 .../goog/ui/style/app/menubuttonrenderer.js     |   236 -
 .../ui/style/app/primaryactionbuttonrenderer.js |    89 -
 externs/GCL/externs/goog/ui/submenu.js          |   672 -
 externs/GCL/externs/goog/ui/submenurenderer.js  |   241 -
 externs/GCL/externs/goog/ui/tab.js              |   103 -
 externs/GCL/externs/goog/ui/tabbar.js           |   395 -
 externs/GCL/externs/goog/ui/tabbarrenderer.js   |   165 -
 externs/GCL/externs/goog/ui/tablesorter.js      |   324 -
 externs/GCL/externs/goog/ui/tabpane.js          |   682 -
 externs/GCL/externs/goog/ui/tabrenderer.js      |   153 -
 externs/GCL/externs/goog/ui/textarea.js         |   736 -
 externs/GCL/externs/goog/ui/textarearenderer.js |   170 -
 externs/GCL/externs/goog/ui/togglebutton.js     |    58 -
 externs/GCL/externs/goog/ui/toolbar.js          |    59 -
 externs/GCL/externs/goog/ui/toolbarbutton.js    |    54 -
 .../externs/goog/ui/toolbarbuttonrenderer.js    |    57 -
 .../externs/goog/ui/toolbarcolormenubutton.js   |    57 -
 .../goog/ui/toolbarcolormenubuttonrenderer.js   |   101 -
 .../GCL/externs/goog/ui/toolbarmenubutton.js    |    56 -
 .../goog/ui/toolbarmenubuttonrenderer.js        |    57 -
 externs/GCL/externs/goog/ui/toolbarrenderer.js  |    90 -
 externs/GCL/externs/goog/ui/toolbarselect.js    |    55 -
 externs/GCL/externs/goog/ui/toolbarseparator.js |    53 -
 .../externs/goog/ui/toolbarseparatorrenderer.js |    95 -
 .../GCL/externs/goog/ui/toolbartogglebutton.js  |    53 -
 externs/GCL/externs/goog/ui/tooltip.js          |  1050 -
 externs/GCL/externs/goog/ui/tree/basenode.js    |  1569 -
 externs/GCL/externs/goog/ui/tree/treecontrol.js |   642 -
 externs/GCL/externs/goog/ui/tree/treenode.js    |   100 -
 externs/GCL/externs/goog/ui/tree/typeahead.js   |   332 -
 externs/GCL/externs/goog/ui/tristatemenuitem.js |   196 -
 .../externs/goog/ui/tristatemenuitemrenderer.js |    92 -
 externs/GCL/externs/goog/ui/twothumbslider.js   |   159 -
 externs/GCL/externs/goog/ui/zippy.js            |   461 -
 externs/GCL/externs/goog/uri/uri.js             |  1507 -
 externs/GCL/externs/goog/uri/utils.js           |  1116 -
 .../GCL/externs/goog/useragent/adobereader.js   |    90 -
 externs/GCL/externs/goog/useragent/flash.js     |   156 -
 externs/GCL/externs/goog/useragent/iphoto.js    |    87 -
 externs/GCL/externs/goog/useragent/jscript.js   |    95 -
 externs/GCL/externs/goog/useragent/keyboard.js  |    49 -
 externs/GCL/externs/goog/useragent/platform.js  |    83 -
 externs/GCL/externs/goog/useragent/product.js   |   175 -
 .../externs/goog/useragent/product_isversion.js |   143 -
 externs/GCL/externs/goog/useragent/useragent.js |   538 -
 externs/GCL/externs/goog/vec/float32array.js    |   111 -
 externs/GCL/externs/goog/vec/float64array.js    |   118 -
 externs/GCL/externs/goog/vec/mat3.js            |  1211 -
 externs/GCL/externs/goog/vec/mat3d.js           |  1039 -
 externs/GCL/externs/goog/vec/mat3f.js           |  1039 -
 externs/GCL/externs/goog/vec/mat4.js            |  1822 --
 externs/GCL/externs/goog/vec/mat4d.js           |  1769 --
 externs/GCL/externs/goog/vec/mat4f.js           |  1769 --
 externs/GCL/externs/goog/vec/matrix3.js         |   720 -
 externs/GCL/externs/goog/vec/matrix4.js         |  1405 -
 externs/GCL/externs/goog/vec/quaternion.js      |   458 -
 externs/GCL/externs/goog/vec/ray.js             |    95 -
 externs/GCL/externs/goog/vec/vec.js             |    73 -
 externs/GCL/externs/goog/vec/vec2.js            |   439 -
 externs/GCL/externs/goog/vec/vec2d.js           |   424 -
 externs/GCL/externs/goog/vec/vec2f.js           |   424 -
 externs/GCL/externs/goog/vec/vec3.js            |   542 -
 externs/GCL/externs/goog/vec/vec3d.js           |   426 -
 externs/GCL/externs/goog/vec/vec3f.js           |   426 -
 externs/GCL/externs/goog/vec/vec4.js            |   479 -
 externs/GCL/externs/goog/vec/vec4d.js           |   366 -
 externs/GCL/externs/goog/vec/vec4f.js           |   366 -
 externs/GCL/externs/goog/webgl/webgl.js         |  2194 --
 externs/GCL/externs/goog/window/window.js       |   284 -
 externs/GCL/src/goog/Disposable.as              |   146 -
 externs/GCL/src/goog/bind.as                    |    20 -
 externs/GCL/src/goog/disposable/Disposable.as   |    28 -
 externs/GCL/src/goog/disposable/IDisposable.as  |    28 -
 .../GCL/src/goog/disposable/MonitoringMode.as   |    45 -
 externs/GCL/src/goog/events.as                  |    23 -
 externs/GCL/src/goog/events/BrowserEvent.as     |   109 -
 .../src/goog/events/BrowserEvent/MouseButton.as |    47 -
 .../src/goog/events/CaptureSimulationMode.as    |    45 -
 externs/GCL/src/goog/events/Event.as            |    66 -
 externs/GCL/src/goog/events/EventTarget.as      |   227 -
 externs/GCL/src/goog/events/EventType.as        |   852 -
 externs/GCL/src/goog/events/Listenable.as       |   157 -
 externs/GCL/src/goog/events/ListenableKey.as    |    87 -
 externs/GCL/src/goog/global.as                  |    19 -
 externs/GCL/src/main/flex/goog/Disposable.as    |   146 +
 externs/GCL/src/main/flex/goog/bind.as          |    20 +
 .../src/main/flex/goog/disposable/Disposable.as |    28 +
 .../main/flex/goog/disposable/IDisposable.as    |    28 +
 .../main/flex/goog/disposable/MonitoringMode.as |    45 +
 externs/GCL/src/main/flex/goog/events.as        |    23 +
 .../src/main/flex/goog/events/BrowserEvent.as   |   109 +
 .../goog/events/BrowserEvent/MouseButton.as     |    47 +
 .../flex/goog/events/CaptureSimulationMode.as   |    45 +
 externs/GCL/src/main/flex/goog/events/Event.as  |    66 +
 .../src/main/flex/goog/events/EventTarget.as    |   227 +
 .../GCL/src/main/flex/goog/events/EventType.as  |   852 +
 .../GCL/src/main/flex/goog/events/Listenable.as |   157 +
 .../src/main/flex/goog/events/ListenableKey.as  |    87 +
 externs/GCL/src/main/flex/goog/global.as        |    19 +
 .../cordova/externs/cordova_file_plugin-4-11.js |    26 -
 .../main/javascript/cordova_file_plugin-4-11.js |    26 +
 externs/createjs/missing.js                     |    91 -
 externs/createjs/src/main/javascript/missing.js |    91 +
 externs/flex-config.xml                         |   362 -
 externs/js/missing.js                           |   253 -
 externs/js/src/AS3.as                           |    33 -
 externs/js/src/Vector-template.as               |    81 -
 externs/js/src/Vector.as                        |    81 -
 externs/js/src/main/flex/AS3.as                 |    33 +
 externs/js/src/main/flex/__AS3__/vec/Vector.as  |    81 +
 externs/js/src/main/javascript/missing.js       |   253 +
 externs/node/externs/node.js                    |    30 -
 externs/node/src/main/javascript/node.js        |    30 +
 .../src/flex2/compiler/CompilerAPI.java         |   137 -
 .../src/flex2/compiler/CompilerException.java   |    53 -
 .../src/flex2/compiler/ILocalizableMessage.java |    35 -
 .../src/flex2/compiler/Logger.java              |    94 -
 .../src/flex2/compiler/Source.java              |   126 -
 .../src/flex2/compiler/SourceList.java          |   366 -
 .../src/flex2/compiler/SourcePath.java          |   641 -
 .../src/flex2/compiler/SymbolTable.java         |    60 -
 .../flex2/compiler/as3/As3Configuration.java    |   166 -
 .../compiler/common/CompilerConfiguration.java  |  3295 --
 .../flex2/compiler/common/Configuration.java    |  2030 --
 .../common/ConfigurationPathResolver.java       |   164 -
 .../compiler/common/DefaultsConfigurator.java   |   214 -
 .../compiler/common/FontsConfiguration.java     |   304 -
 .../compiler/common/FramesConfiguration.java    |   109 -
 .../compiler/common/LocalFilePathResolver.java  |    83 -
 .../compiler/common/MetadataConfiguration.java  |   353 -
 .../compiler/common/MxmlConfiguration.java      |   308 -
 .../common/NamespacesConfiguration.java         |   165 -
 .../src/flex2/compiler/common/PathResolver.java |   161 -
 ...ntimeSharedLibrarySettingsConfiguration.java |   342 -
 .../compiler/common/SinglePathResolver.java     |    38 -
 .../config/AdvancedConfigurationInfo.java       |    34 -
 .../config/CommandLineConfigurator.java         |   642 -
 .../compiler/config/ConfigurationBuffer.java    |  1444 -
 .../compiler/config/ConfigurationException.java |   657 -
 .../compiler/config/ConfigurationFilter.java    |    39 -
 .../compiler/config/ConfigurationInfo.java      |   331 -
 .../compiler/config/ConfigurationValue.java     |   110 -
 .../flex2/compiler/config/FileConfigurator.java |   755 -
 .../config/ServicesDependenciesWrapper.java     |   423 -
 .../config/SystemPropertyConfigurator.java      |    83 -
 .../extensions/ExtensionsConfiguration.java     |   134 -
 .../src/flex2/compiler/io/FileUtil.java         |   590 -
 .../src/flex2/compiler/io/LocalFile.java        |   205 -
 .../src/flex2/compiler/io/NetworkFile.java      |   148 -
 .../src/flex2/compiler/io/VirtualFile.java      |   102 -
 .../flex2/compiler/mxml/MxmlConfiguration.java  |   182 -
 .../flex2/compiler/mxml/lang/StandardDefs.java  |   908 -
 .../flex2/compiler/mxml/lang/TextParser.java    |   134 -
 .../src/flex2/compiler/util/AbstractLogger.java |   174 -
 .../src/flex2/compiler/util/Benchmark.java      |    30 -
 .../flex2/compiler/util/CompilerControl.java    |    62 -
 .../flex2/compiler/util/CompilerMessage.java    |   201 -
 .../src/flex2/compiler/util/ConsoleLogger.java  |   404 -
 .../src/flex2/compiler/util/ManifestParser.java |   239 -
 .../src/flex2/compiler/util/MimeMappings.java   |   295 -
 .../src/flex2/compiler/util/Name.java           |    59 -
 .../src/flex2/compiler/util/NameFormatter.java  |   170 -
 .../src/flex2/compiler/util/NameMappings.java   |   183 -
 .../flex2/compiler/util/PerformanceData.java    |    47 -
 .../src/flex2/compiler/util/QName.java          |   160 -
 .../flex2/compiler/util/ThreadLocalToolkit.java |   624 -
 .../flex2/compiler/util/URLPathResolver.java    |    75 -
 .../src/flex2/linker/LinkerConfiguration.java   |   207 -
 .../src/flex2/linker/SimpleMovie.java           |   194 -
 .../flex2/tools/CommandLineConfiguration.java   |   296 -
 flex-compiler-oem/src/flex2/tools/CompJSC.java  |    37 -
 flex-compiler-oem/src/flex2/tools/Compc.java    |    58 -
 .../src/flex2/tools/CompcConfiguration.java     |   530 -
 .../src/flex2/tools/LicensesConfiguration.java  |    78 -
 flex-compiler-oem/src/flex2/tools/MxmlJSC.java  |   100 -
 flex-compiler-oem/src/flex2/tools/Mxmlc.java    |   328 -
 flex-compiler-oem/src/flex2/tools/PreLink.java  |   178 -
 flex-compiler-oem/src/flex2/tools/Tool.java     |   477 -
 .../src/flex2/tools/ToolsConfiguration.java     |   357 -
 .../src/flex2/tools/VersionInfo.java            |   260 -
 .../tools/flexbuilder/BuilderApplication.java   |   405 -
 .../tools/flexbuilder/BuilderConfiguration.java |   497 -
 .../flex2/tools/flexbuilder/BuilderLibrary.java |   393 -
 .../src/flex2/tools/oem/Application.java        |   949 -
 .../src/flex2/tools/oem/ApplicationCache.java   |    41 -
 .../src/flex2/tools/oem/Builder.java            |   281 -
 .../src/flex2/tools/oem/Configuration.java      |  1442 -
 .../src/flex2/tools/oem/Library.java            |  1209 -
 .../src/flex2/tools/oem/LibraryCache.java       |    33 -
 .../src/flex2/tools/oem/Logger.java             |    53 -
 .../src/flex2/tools/oem/Message.java            |    93 -
 .../src/flex2/tools/oem/PathResolver.java       |    39 -
 .../src/flex2/tools/oem/ProgressMeter.java      |    52 -
 .../src/flex2/tools/oem/Report.java             |   353 -
 .../src/flex2/tools/oem/VirtualLocalFile.java   |   245 -
 .../flex2/tools/oem/VirtualLocalFileSystem.java |   130 -
 .../ApplicationCompilerConfiguration.java       |   254 -
 .../flex2/tools/oem/internal/BuilderLogger.java |    54 -
 .../oem/internal/ConfigurationConstants.java    |   141 -
 .../tools/oem/internal/GenericMessage.java      |    73 -
 .../internal/LibraryCompilerConfiguration.java  |   131 -
 .../tools/oem/internal/LinkerConfiguration.java |   470 -
 .../tools/oem/internal/OEMConfiguration.java    |  2814 --
 .../flex2/tools/oem/internal/OEMConsole.java    |   712 -
 .../flex2/tools/oem/internal/OEMLogAdapter.java |   222 -
 .../src/flex2/tools/oem/internal/OEMReport.java |   770 -
 .../src/flex2/tools/oem/internal/OEMUtil.java   |   459 -
 .../src/macromedia/asc/embedding/ConfigVar.java |    43 -
 .../asc/embedding/WarningConstants.java         |   670 -
 .../src/macromedia/asc/util/ObjectList.java     |   127 -
 .../main/java/flex2/compiler/CompilerAPI.java   |   137 +
 .../java/flex2/compiler/CompilerException.java  |    53 +
 .../flex2/compiler/ILocalizableMessage.java     |    35 +
 .../src/main/java/flex2/compiler/Logger.java    |    94 +
 .../src/main/java/flex2/compiler/Source.java    |   126 +
 .../main/java/flex2/compiler/SourceList.java    |   366 +
 .../main/java/flex2/compiler/SourcePath.java    |   641 +
 .../main/java/flex2/compiler/SymbolTable.java   |    60 +
 .../flex2/compiler/as3/As3Configuration.java    |   166 +
 .../compiler/common/CompilerConfiguration.java  |  3295 ++
 .../flex2/compiler/common/Configuration.java    |  2030 ++
 .../common/ConfigurationPathResolver.java       |   164 +
 .../compiler/common/DefaultsConfigurator.java   |   214 +
 .../compiler/common/FontsConfiguration.java     |   304 +
 .../compiler/common/FramesConfiguration.java    |   109 +
 .../compiler/common/LocalFilePathResolver.java  |    83 +
 .../compiler/common/MetadataConfiguration.java  |   353 +
 .../compiler/common/MxmlConfiguration.java      |   308 +
 .../common/NamespacesConfiguration.java         |   165 +
 .../flex2/compiler/common/PathResolver.java     |   161 +
 ...ntimeSharedLibrarySettingsConfiguration.java |   342 +
 .../compiler/common/SinglePathResolver.java     |    38 +
 .../config/AdvancedConfigurationInfo.java       |    34 +
 .../config/CommandLineConfigurator.java         |   642 +
 .../compiler/config/ConfigurationBuffer.java    |  1444 +
 .../compiler/config/ConfigurationException.java |   657 +
 .../compiler/config/ConfigurationFilter.java    |    39 +
 .../compiler/config/ConfigurationInfo.java      |   331 +
 .../compiler/config/ConfigurationValue.java     |   110 +
 .../flex2/compiler/config/FileConfigurator.java |   755 +
 .../config/ServicesDependenciesWrapper.java     |   423 +
 .../config/SystemPropertyConfigurator.java      |    83 +
 .../extensions/ExtensionsConfiguration.java     |   134 +
 .../main/java/flex2/compiler/io/FileUtil.java   |   590 +
 .../main/java/flex2/compiler/io/LocalFile.java  |   205 +
 .../java/flex2/compiler/io/NetworkFile.java     |   148 +
 .../java/flex2/compiler/io/VirtualFile.java     |   102 +
 .../flex2/compiler/mxml/MxmlConfiguration.java  |   182 +
 .../flex2/compiler/mxml/lang/StandardDefs.java  |   908 +
 .../flex2/compiler/mxml/lang/TextParser.java    |   134 +
 .../flex2/compiler/util/AbstractLogger.java     |   174 +
 .../java/flex2/compiler/util/Benchmark.java     |    30 +
 .../flex2/compiler/util/CompilerControl.java    |    62 +
 .../flex2/compiler/util/CompilerMessage.java    |   201 +
 .../java/flex2/compiler/util/ConsoleLogger.java |   404 +
 .../flex2/compiler/util/ManifestParser.java     |   239 +
 .../java/flex2/compiler/util/MimeMappings.java  |   295 +
 .../src/main/java/flex2/compiler/util/Name.java |    59 +
 .../java/flex2/compiler/util/NameFormatter.java |   170 +
 .../java/flex2/compiler/util/NameMappings.java  |   183 +
 .../flex2/compiler/util/PerformanceData.java    |    47 +
 .../main/java/flex2/compiler/util/QName.java    |   160 +
 .../flex2/compiler/util/ThreadLocalToolkit.java |   624 +
 .../flex2/compiler/util/URLPathResolver.java    |    75 +
 .../java/flex2/linker/LinkerConfiguration.java  |   207 +
 .../src/main/java/flex2/linker/SimpleMovie.java |   194 +
 .../flex2/tools/CommandLineConfiguration.java   |   296 +
 .../src/main/java/flex2/tools/CompJSC.java      |    37 +
 .../src/main/java/flex2/tools/Compc.java        |    58 +
 .../java/flex2/tools/CompcConfiguration.java    |   530 +
 .../java/flex2/tools/LicensesConfiguration.java |    78 +
 .../src/main/java/flex2/tools/MxmlJSC.java      |   100 +
 .../src/main/java/flex2/tools/Mxmlc.java        |   328 +
 .../src/main/java/flex2/tools/PreLink.java      |   178 +
 .../src/main/java/flex2/tools/Tool.java         |   477 +
 .../java/flex2/tools/ToolsConfiguration.java    |   357 +
 .../src/main/java/flex2/tools/VersionInfo.java  |   260 +
 .../tools/flexbuilder/BuilderApplication.java   |   405 +
 .../tools/flexbuilder/BuilderConfiguration.java |   497 +
 .../flex2/tools/flexbuilder/BuilderLibrary.java |   393 +
 .../main/java/flex2/tools/oem/Application.java  |   949 +
 .../java/flex2/tools/oem/ApplicationCache.java  |    41 +
 .../src/main/java/flex2/tools/oem/Builder.java  |   281 +
 .../java/flex2/tools/oem/Configuration.java     |  1442 +
 .../src/main/java/flex2/tools/oem/Library.java  |  1209 +
 .../main/java/flex2/tools/oem/LibraryCache.java |    33 +
 .../src/main/java/flex2/tools/oem/Logger.java   |    53 +
 .../src/main/java/flex2/tools/oem/Message.java  |    93 +
 .../main/java/flex2/tools/oem/PathResolver.java |    39 +
 .../java/flex2/tools/oem/ProgressMeter.java     |    52 +
 .../src/main/java/flex2/tools/oem/Report.java   |   353 +
 .../java/flex2/tools/oem/VirtualLocalFile.java  |   245 +
 .../flex2/tools/oem/VirtualLocalFileSystem.java |   130 +
 .../ApplicationCompilerConfiguration.java       |   254 +
 .../flex2/tools/oem/internal/BuilderLogger.java |    54 +
 .../oem/internal/ConfigurationConstants.java    |   141 +
 .../tools/oem/internal/GenericMessage.java      |    73 +
 .../internal/LibraryCompilerConfiguration.java  |   131 +
 .../tools/oem/internal/LinkerConfiguration.java |   470 +
 .../tools/oem/internal/OEMConfiguration.java    |  2814 ++
 .../flex2/tools/oem/internal/OEMConsole.java    |   712 +
 .../flex2/tools/oem/internal/OEMLogAdapter.java |   222 +
 .../flex2/tools/oem/internal/OEMReport.java     |   770 +
 .../java/flex2/tools/oem/internal/OEMUtil.java  |   459 +
 .../macromedia/asc/embedding/ConfigVar.java     |    43 +
 .../asc/embedding/WarningConstants.java         |   670 +
 .../java/macromedia/asc/util/ObjectList.java    |   127 +
 implicit_imports.patch                          |   147 -
 installer.properties/en_US.properties           |    22 -
 installer.xml                                   |   186 -
 jenkins.xml                                     |    71 -
 maven.txt                                       |     6 -
 maven.xml                                       |   189 -
 maven/falcon-compiler-oem.pom                   |    15 -
 maven/falcon-compiler.pom                       |    78 -
 maven/falcon-jx-compiler.pom                    |    64 -
 pom.xml                                         |     1 -
 releasecandidate.xml                            |   497 -
 6350 files changed, 447706 insertions(+), 902175 deletions(-)
----------------------------------------------------------------------



[25/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSEmiter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSEmiter.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSEmiter.java
new file mode 100644
index 0000000..c02200e
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSEmiter.java
@@ -0,0 +1,364 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import org.apache.flex.compiler.clients.MXMLJSC;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogEmiter;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.internal.parsing.as.FlexJSASDocDelegate;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestFlexJSEmiter extends TestGoogEmiter
+{
+    @Override
+    public void setUp()
+    {
+        project = new FlexJSProject(workspace);
+
+        super.setUp();
+    }
+
+    @Override
+    @Test
+    public void testSimple()
+    {
+        String code = "package com.example.components {"
+                + "import goog.events.EventTarget;"
+                + "public class MyEventTarget extends EventTarget {"
+                + "public function MyEventTarget() {if (foo() != 42) { bar(); } }"
+                + "private var _privateVar:String = \"do \";"
+                + "public var publicProperty:Number = 100;"
+                + "public function myFunction(value: String): String{"
+                + "return \"Don't \" + _privateVar + value; }";
+        IFileNode node = compileAS(code);
+        asBlockWalker.visitFile(node);
+	        assertOutWithMetadata("/**\n" +
+        		" * com.example.components.MyEventTarget\n" +
+        		" *\n" +
+        		" * @fileoverview\n" +
+        		" *\n" +
+        		" * @suppress {checkTypes|accessControls}\n" +
+        		" */\n" +
+        		"\n" +
+        		"goog.provide('com.example.components.MyEventTarget');\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @constructor\n" +
+        		" * @extends {goog.events.EventTarget}\n" +
+        		" */\n" +
+        		"com.example.components.MyEventTarget = function() {\n" +
+        		"  com.example.components.MyEventTarget.base(this, 'constructor');\n" +
+        		"  if (foo() != 42) {\n" +
+        		"    bar();\n" +
+        		"  }\n" +
+        		"};\n" +
+        		"goog.inherits(com.example.components.MyEventTarget, goog.events.EventTarget);\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @private\n" +
+        		" * @type {string}\n" +
+        		" */\n" +
+        		"com.example.components.MyEventTarget.prototype._privateVar = \"do \";\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @export\n" +
+        		" * @type {number}\n" +
+        		" */\n" +
+        		"com.example.components.MyEventTarget.prototype.publicProperty = 100;\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @export\n" +
+        		" * @param {string} value\n" +
+        		" * @return {string}\n" +
+        		" */\n" +
+        		"com.example.components.MyEventTarget.prototype.myFunction = function(value) {\n" +
+        		"  return \"Don't \" + this._privateVar + value;\n" +
+        		"};\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Metadata\n" +
+        		" *\n" +
+        		" * @type {Object.<string, Array.<Object>>}\n" +
+        		" */\n" +
+        		"com.example.components.MyEventTarget.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'MyEventTarget', qName: 'com.example.components.MyEventTarget'}] };\n" +
+          		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('com.example.components.MyEventTarget', com.example.components.MyEventTarget);\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"com.example.components.MyEventTarget.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"        'publicProperty': { type: 'Number'}\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"        'MyEventTarget': { type: '', declaredBy: 'com.example.components.MyEventTarget'},\n" +
+        		"        'myFunction': { type: 'String', declaredBy: 'com.example.components.MyEventTarget'}\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n");
+    }
+
+    @Override
+    @Test
+    public void testSimpleInterface()
+    {
+        String code = "package com.example.components {"
+                + "public interface TestInterface { } }";
+        IFileNode node = compileAS(code);
+        asBlockWalker.visitFile(node);
+        assertOutWithMetadata("/**\n" +
+        		" * com.example.components.TestInterface\n" +
+        		" *\n" +
+        		" * @fileoverview\n" +
+        		" *\n" +
+        		" * @suppress {checkTypes|accessControls}\n" +
+        		" */\n" +
+        		"\n" +
+        		"goog.provide('com.example.components.TestInterface');\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @interface\n" +
+        		" */\ncom.example.components.TestInterface = function() {\n" +
+        		"};\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Metadata\n" +
+        		" *\n" +
+        		" * @type {Object.<string, Array.<Object>>}\n" +
+        		" */\n" +
+        		"com.example.components.TestInterface.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'TestInterface', qName: 'com.example.components.TestInterface'}] };\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"com.example.components.TestInterface.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n");
+    }
+
+    @Override
+    @Test
+    public void testSimpleClass()
+    {
+        String code = "package com.example.components {"
+                + "public class TestClass { } }";
+        IFileNode node = compileAS(code);
+        asBlockWalker.visitFile(node);
+        assertOutWithMetadata("/**\n" +
+        		" * com.example.components.TestClass\n" +
+        		" *\n" +
+        		" * @fileoverview\n" +
+        		" *\n" +
+        		" * @suppress {checkTypes|accessControls}\n" +
+        		" */\n" +
+        		"\n" +
+        		"goog.provide('com.example.components.TestClass');\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @constructor\n" +
+        		" */\n" +
+        		"com.example.components.TestClass = function() {\n" +
+        		"};\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Metadata\n" +
+        		" *\n" +
+        		" * @type {Object.<string, Array.<Object>>}\n" +
+        		" */\n" +
+        		"com.example.components.TestClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'TestClass', qName: 'com.example.components.TestClass'}] };\n" +
+          		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('com.example.components.TestClass', com.example.components.TestClass);\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"com.example.components.TestClass.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n");
+    }
+    
+
+    @Override
+    @Test
+    public void testDefaultParameter()
+    {
+        IFunctionNode node = getMethodWithPackage("function method1(p1:int, p2:int, p3:int = 3, p4:int = 4):int{return p1 + p2 + p3 + p4;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {number} p1\n * @param {number} p2\n * @param {number=} p3\n * @param {number=} p4\n * @return {number}\n */\n"
+                + "foo.bar.FalconTest_A.prototype.method1 = function(p1, p2, p3, p4) {\n"
+                + "  p3 = typeof p3 !== 'undefined' ? p3 : 3;\n"
+                + "  p4 = typeof p4 !== 'undefined' ? p4 : 4;\n"
+                + "  return p1 + p2 + p3 + p4;\n}");
+    }
+
+    @Override
+    @Test
+    public void testDefaultParameter_Body()
+    {
+        IFunctionNode node = getMethodWithPackage("function method1(bar:int = 42, bax:int = 4):void{if (a) foo();}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {number=} bar\n * @param {number=} bax\n */\n"
+                + "foo.bar.FalconTest_A.prototype.method1 = function(bar, bax) {\n"
+                + "  bar = typeof bar !== 'undefined' ? bar : 42;\n"
+                + "  bax = typeof bax !== 'undefined' ? bax : 4;\n"
+                + "  if (a)\n    foo();\n}");
+    }
+
+    @Override
+    @Test
+    public void testDefaultParameter_NoBody()
+    {
+        IFunctionNode node = getMethodWithPackage("function method1(p1:int, p2:int, p3:int = 3, p4:int = 4):int{}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {number} p1\n * @param {number} p2\n * @param {number=} p3\n * @param {number=} p4\n * @return {number}\n */\n"
+                + "foo.bar.FalconTest_A.prototype.method1 = function(p1, p2, p3, p4) {\n"
+                + "  p3 = typeof p3 !== 'undefined' ? p3 : 3;\n"
+                + "  p4 = typeof p4 !== 'undefined' ? p4 : 4;\n}");
+    }
+
+    @Override
+    @Test
+    public void testSimpleParameterReturnType()
+    {
+        IFunctionNode node = getMethodWithPackage("function method1(bar:int):int{\n}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {number} bar\n * @return {number}\n */\n"
+                + "foo.bar.FalconTest_A.prototype.method1 = function(bar) {\n}");
+    }
+
+    @Override
+    @Test
+    public void testSimpleMultipleParameter()
+    {
+        IFunctionNode node = getMethodWithPackage("function method1(bar:int, baz:String, goo:Array):void{\n}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {number} bar\n * @param {string} baz\n * @param {Array} goo\n */\n"
+                + "foo.bar.FalconTest_A.prototype.method1 = function(bar, baz, goo) {\n}");
+    }
+
+    @Override
+    @Test
+    public void testSimpleMultipleParameter_JSDoc()
+    {
+        IFunctionNode node = getMethodWithPackage("/**\n * This is copied from ASDoc.\n */\nfunction method1(bar:int, baz:String, goo:Array):void{\n}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * This is copied from ASDoc.\n * @param {number} bar\n * @param {string} baz\n * @param {Array} goo\n */\n"
+                + "foo.bar.FalconTest_A.prototype.method1 = function(bar, baz, goo) {\n}");
+    }
+
+    @Test
+    public void testSimpleMultipleParameter_JSDocSingleLine()
+    {
+        IFunctionNode node = getMethodWithPackage("/** This is copied from ASDoc. */\nfunction method1(bar:int, baz:String, goo:Array):void{\n}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/** This is copied from ASDoc. \n * @param {number} bar\n * @param {string} baz\n * @param {Array} goo\n */\n"
+                + "foo.bar.FalconTest_A.prototype.method1 = function(bar, baz, goo) {\n}");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+    
+    @Override
+    protected void addDependencies()
+    {
+        super.addDependencies();
+        workspace.setASDocDelegate(new FlexJSASDocDelegate());
+        MXMLJSC.keepASDoc = true;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java
new file mode 100644
index 0000000..b5786f6
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java
@@ -0,0 +1,975 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogExpressions;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.tree.as.ClassNode;
+import org.apache.flex.compiler.internal.tree.as.LiteralNode;
+import org.apache.flex.compiler.internal.tree.as.NodeBase;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestFlexJSExpressions extends TestGoogExpressions
+{
+    @Override
+    public void setUp()
+    {
+    	project = new FlexJSProject(workspace);
+    	((FlexJSProject)project).config = new JSGoogConfiguration();
+        super.setUp();
+    }
+
+    @Ignore
+    @Override
+    @Test
+    public void testVisitLanguageIdentifierNode_SuperMember()
+    {
+        // (erikdebruin) this test doesn't make sense in FlexJS context
+        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getNode(
+                "if (a) super.foo;", IMemberAccessExpressionNode.class);
+        asBlockWalker.visitMemberAccessExpression(node);
+        assertOut("super.foo");
+    }
+
+    @Override
+    @Test
+    public void testVisitLanguageIdentifierNode_SuperMethod_1()
+    {
+        IFunctionNode node = getMethod("function foo(){if (a) super.foo();}");
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.foo = function() {\n  if (a)\n    FalconTest_A.base(this, 'foo');\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitLanguageIdentifierNode_SuperMethod_2()
+    {
+        IFunctionNode node = getMethod("function foo(){if (a) super.foo(a, b, c);}");
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.foo = function() {\n  if (a)\n    FalconTest_A.base(this, 'foo', a, b, c);\n}");
+    }
+
+    //----------------------------------
+    // Primary expression keywords
+    //----------------------------------
+
+    //----------------------------------
+    // Logical
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitBinaryOperatorNode_LogicalAndAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a &&= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a = a && b");
+    }
+
+    @Override
+    @Test
+    public void testVisitBinaryOperatorNode_LogicalOrAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a ||= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a = a || b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_getterAtEndOfLeftSide()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public function b(s:String):Boolean {return this.c + 10; } public function get c():int { return 0; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.c + 10");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_functionCallOnLeft()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public function b(s:String):Boolean {return s.toLowerCase() == 'foo'; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("s.toLowerCase() == 'foo'");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_functionCallOnLeftContained()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public function b(s:String):Boolean {return (s.toLowerCase() == 'foo'); }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("(s.toLowerCase() == 'foo')");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_setterAssignment()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public function set b(value:int):void {}; public function c() { b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_setterAssignmentWithThis()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public function set b(value:int):void {}; public function c() { this.b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_setterAssignmentWithThisMXML()
+    {
+        // simulate MXML script conditions.
+        // get class def
+        // disconnect fileNode from parent
+        // set thisclass on emitter to class def
+        IFileNode node = (IFileNode) getNode(
+                "public class B { public function c() { this.b = 1; }; public function set b(value:int):void {}}",
+                IFileNode.class, WRAP_LEVEL_PACKAGE, true);
+        IFunctionNode fnode = (IFunctionNode) findFirstDescendantOfType(
+                node, IFunctionNode.class);
+        IClassNode classnode = (IClassNode) findFirstDescendantOfType(
+                node, IClassNode.class);
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) findFirstDescendantOfType(
+                fnode, IBinaryOperatorNode.class);
+        ((NodeBase)fnode).setParent(null);
+        IClassDefinition def = classnode.getDefinition();
+
+        ((JSFlexJSEmitter)asEmitter).getModel().setCurrentClass(def);
+        asBlockWalker.visitBinaryOperator(bnode);
+        assertOut("this.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_setterAssignmentMXML()
+    {
+        // simulate MXML script conditions.
+        // get class def
+        // disconnect fileNode from parent
+        // set thisclass on emitter to class def
+        IFileNode node = (IFileNode) getNode(
+                "public class B { public function c() { b = 1; }; public function set b(value:int):void {}}",
+                IFileNode.class, WRAP_LEVEL_PACKAGE, true);
+        IFunctionNode fnode = (IFunctionNode) findFirstDescendantOfType(
+                node, IFunctionNode.class);
+        IClassNode classnode = (IClassNode) findFirstDescendantOfType(
+                node, IClassNode.class);
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) findFirstDescendantOfType(
+                fnode, IBinaryOperatorNode.class);
+        ((NodeBase)fnode).setParent(null);
+        IClassDefinition def = classnode.getDefinition();
+
+        ((JSFlexJSEmitter)asEmitter).getModel().setCurrentClass(def);
+        asBlockWalker.visitBinaryOperator(bnode);
+        assertOut("this.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_setterAssignmentOtherInstance()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public function set b(value:int):void {}; public function c(other:B) { other.b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("other.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_nestedSetterAssignment()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public function set b(value:int):void {}; public function get d():B {}; public function c(other:B) { d.d.b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.d.d.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_nestedSetterAssignmentOtherInstance()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public function set b(value:int):void {}; public function get d():B {}; public function c(other:B) { other.d.b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("other.d.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_setterAssignmentFromGetter()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public function set b(value:int):void {}; public function c() { b = b + 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.b = this.b + 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_setterAssignmentFromGetterMaskedByLocal()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public function set b(value:int):void {}; public function c() { var b:int; b = b + 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("b = b + 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_setterAssignmentFromGetterMaskedByParam()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public function set b(value:int):void {}; public function c(b:int) { b = b + 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("b = b + 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_bindableAssignment()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {[Bindable] public var b:int; public function c() { b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_bindableAssignmentWithThis()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {[Bindable] public var b:int; public function c() { this.b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_bindableAssignmentOtherInstance()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {[Bindable] public var b:int; public function c(other:B) { other.b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("other.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_bindableSetterAssignment()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {[Bindable] public var b:int; [Bindable] public var d:B; public function c(other:B) { d.d.b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.d.d.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_bindableSetterAssignmentOtherInstance()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {[Bindable] public var b:int; [Bindable] public var d:B; public function c(other:B) { other.d.b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("other.d.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_bindableAssignmentFromGetter()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {[Bindable] public var b:int; public function c() { b = b + 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.b = this.b + 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_bindableAssignmentFromGetterMaskedByLocal()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {[Bindable] public var b:int; public function c() { var b:int; b = b + 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("b = b + 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_bindableAssignmentFromGetterMaskedByParam()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {[Bindable] public var b:int; public function c(b:int) { b = b + 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("b = b + 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_varAssignment()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public var b:int; public function c() { b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_varAssignmentWithThis()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public var b:int; public function c() { this.b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_varAssignmentOtherInstance()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public var b:int; public function c(other:B) { other.b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("other.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_varSetterAssignment()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {[Bindable] public var b:int; public var d:B; public function c(other:B) { d.d.b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.d.d.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_varVarAssignment()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public var b:int; public var d:B; public function c(other:B) { d.d.b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.d.d.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_varSetterAssignmentOtherInstance()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {[Bindable] public var b:int; public var d:B; public function c(other:B) { other.d.b = 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("other.d.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_varAssignmentFromVar()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public var b:int; public function c() { b = b + 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("this.b = this.b + 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_varAssignmentFromVarMaskedByLocal()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public var b:int; public function c() { var b:int; b = b + 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("b = b + 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_varAssignmentFromVarMaskedByParam()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public var b:int; public function c(b:int) { b = b + 1; }}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("b = b + 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_staticSetterAssignment()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function c() { b = 1; }; public static function set b(value:int):void {}}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) findFirstDescendantOfType(
+                node, IBinaryOperatorNode.class);
+        asBlockWalker.visitBinaryOperator(bnode);
+        assertOut("foo.bar.B.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_staticSetterAssignmentWithPath()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function c() { foo.bar.B.b = 1; }; public static function set b(value:int):void {}}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) findFirstDescendantOfType(
+                node, IBinaryOperatorNode.class);
+        asBlockWalker.visitBinaryOperator(bnode);
+        assertOut("foo.bar.B.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_staticSetterAssignmentOtherInstance()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function c() { d.b = 1; }; public function set b(value:int):void {}; public static function get d():B {}}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) findFirstDescendantOfType(
+                node, IBinaryOperatorNode.class);
+        asBlockWalker.visitBinaryOperator(bnode);
+        assertOut("foo.bar.B.d.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_staticSetterAssignmentOtherInstanceMXML()
+    {
+        // simulate MXML script conditions.
+        // get class def
+        // disconnect fileNode from parent
+        // set thisclass on emitter to class def
+        IFileNode node = (IFileNode) getNode(
+                "public class B {public function c() { d.b = 1; }; public function set b(value:int):void {}; public static function get d():B {}}",
+                IFileNode.class, WRAP_LEVEL_PACKAGE, true);
+        IFunctionNode fnode = (IFunctionNode) findFirstDescendantOfType(
+                node, IFunctionNode.class);
+        IClassNode classnode = (IClassNode) findFirstDescendantOfType(
+                node, IClassNode.class);
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) findFirstDescendantOfType(
+                fnode, IBinaryOperatorNode.class);
+        ((NodeBase)fnode).setParent(null);
+        IClassDefinition def = classnode.getDefinition();
+
+        ((JSFlexJSEmitter)asEmitter).getModel().setCurrentClass(def);
+        asBlockWalker.visitBinaryOperator(bnode);
+        assertOut("foo.bar.B.d.b = 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_staticSetterAssignmentFromGetter()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function c() { b = b + 1; }; public static function set b(value:int):void {}; public static function get b():int {}}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) findFirstDescendantOfType(
+                node, IBinaryOperatorNode.class);
+        asBlockWalker.visitBinaryOperator(bnode);
+        assertOut("foo.bar.B.b = foo.bar.B.b + 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_staticSetterAssignmentFromGetterMaskedByLocal()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function c() { var b:int; b = b + 1; }; public static function set b(value:int):void {}; public static function get b():int {}}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) findFirstDescendantOfType(
+                node, IBinaryOperatorNode.class);
+        asBlockWalker.visitBinaryOperator(bnode);
+        assertOut("b = b + 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_staticSetterAssignmentFromGetterMaskedByParam()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function c(b:int) { b = b + 1; }; public static function set b(value:int):void {}; public static function get b():int {}}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) findFirstDescendantOfType(
+                node, IBinaryOperatorNode.class);
+        asBlockWalker.visitBinaryOperator(bnode);
+        assertOut("b = b + 1");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_varAssignmentFromSuperSuperClass()
+    {
+        // simulate MXML script conditions.
+        // get class def
+        // disconnect fileNode from parent
+        // set thisclass on emitter to class def
+        IFileNode node = (IFileNode) getNode(
+                "class B extends C { public function c() { E(model).labelText = null; } } class C extends D {} class D { public var model:Object; } class E { public function set labelText(value:String) {} }",
+                IFileNode.class, WRAP_LEVEL_PACKAGE, true);
+        IFunctionNode fnode = (IFunctionNode) findFirstDescendantOfType(
+                node, IFunctionNode.class);
+        IClassNode classnode = (IClassNode) findFirstDescendantOfType(
+                node, IClassNode.class);
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) findFirstDescendantOfType(
+                fnode, IBinaryOperatorNode.class);
+        ((NodeBase)fnode).setParent(null);
+        IClassDefinition def = classnode.getDefinition();
+
+        ((JSFlexJSEmitter)asEmitter).getModel().setCurrentClass(def);
+        asBlockWalker.visitBinaryOperator(bnode);
+        assertOut("org.apache.flex.utils.Language.as(this.model, foo.bar.E, true).labelText = null");
+    }
+
+    @Test
+    public void testNamedFunctionAsArgument()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function b() { function c(f:Function):void {}; function d():void {}; c(d); }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nB.prototype.b = function() {\n  var self = this;\n  function c(f) {\n  };\n  function d() {\n  };\n  c(org.apache.flex.utils.Language.closure(d, this, 'd'));\n}");
+    }
+
+    @Test
+    public void testNamedFunctionAsArgument2()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function b() { function c(s:String, f:Function):void {}; function d():void {}; c('foo', d); }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nB.prototype.b = function() {\n  var self = this;\n  function c(s, f) {\n  };\n  function d() {\n  };\n  c('foo', org.apache.flex.utils.Language.closure(d, this, 'd'));\n}");
+    }
+
+    @Test
+    public void testNamedFunctionAsArgument3()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function b() {  c('foo', d); function c(s:String, f:Function):void {}; function d():void {};}}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nB.prototype.b = function() {\n  var self = this;\n  function c(s, f) {\n  };\n  function d() {\n  };\n  c('foo', org.apache.flex.utils.Language.closure(d, this, 'd'));\n  \n}");
+    }
+
+    @Test
+    public void testNamedFunctionAsArgument4()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function b() { function d():void {}; c('foo', d); } public function c(s:String, f:Function):void {};}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nB.prototype.b = function() {\n  var self = this;\n  function d() {\n  };\n  this.c('foo', org.apache.flex.utils.Language.closure(d, this, 'd'));\n}");
+    }
+
+    @Test
+    public void testMethodAsArgument()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function b() { function c(f:Function):void {}; c(b); }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nB.prototype.b = function() {\n  var self = this;\n  function c(f) {\n  };\n  c(org.apache.flex.utils.Language.closure(this.b, this, 'b'));\n}");
+    }
+
+    @Test
+    public void testStaticMethodAsArgument()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {static public function b() { function c(f:Function):void {}; c(b); }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nfoo.bar.B.b = function() {\n  function c(f) {\n  };\n  c(foo.bar.B.b);\n}");
+    }
+
+    @Test
+    public void testMethodAsVariable()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function b() { function c(f:Function):void {}; var f:Function = b; c(f); }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nB.prototype.b = function() {\n  var self = this;\n  function c(f) {\n  };\n  var /** @type {Function} */ f = org.apache.flex.utils.Language.closure(this.b, this, 'b');\n  c(f);\n}");
+    }
+    
+    @Test
+    public void testStaticMethodAsVariable()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {static public function b() { function c(f:Function):void {}; var f:Function = b; c(f); }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nfoo.bar.B.b = function() {\n  function c(f) {\n  };\n  var /** @type {Function} */ f = foo.bar.B.b;\n  c(f);\n}");
+    }
+    
+    @Test
+    public void testStaticMethodAsVariableFullyQualified()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {static public function b() { function c(f:Function):void {}; var f:Function = foo.bar.B.b; c(f); }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nfoo.bar.B.b = function() {\n  function c(f) {\n  };\n  var /** @type {Function} */ f = foo.bar.B.b;\n  c(f);\n}");
+    }
+    
+    @Test
+    public void testMethodAsAssign()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function b() { function c(f:Function):void {}; var f:Function; f = b; c(f); }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nB.prototype.b = function() {\n  var self = this;\n  function c(f) {\n  };\n  var /** @type {Function} */ f;\n  f = org.apache.flex.utils.Language.closure(this.b, this, 'b');\n  c(f);\n}");
+    }
+    
+    @Test
+    public void testStaticMethodAsAssign()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {static public function b() { function c(f:Function):void {}; var f:Function; f = b; c(f); }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nfoo.bar.B.b = function() {\n  function c(f) {\n  };\n  var /** @type {Function} */ f;\n  f = foo.bar.B.b;\n  c(f);\n}");
+    }
+    
+    @Test
+    public void testMethodAsValue()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function b() { function c(f:Function):void {}; var f:Array = [b]; c(f[0]); }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nB.prototype.b = function() {\n  var self = this;\n  function c(f) {\n  };\n  var /** @type {Array} */ f = [org.apache.flex.utils.Language.closure(this.b, this, 'b')];\n  c(f[0]);\n}");
+    }
+    
+    @Test
+    public void testStaticMethodAsValue()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {static public function b() { function c(f:Function):void {}; var f:Array = [b]; c(f); }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nfoo.bar.B.b = function() {\n  function c(f) {\n  };\n  var /** @type {Array} */ f = [foo.bar.B.b];\n  c(f);\n}");
+    }
+    
+    @Test
+    public void testThisMethodAsParam()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function b() { function c(f:Function):void {}; c(this.b); }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nB.prototype.b = function() {\n  var self = this;\n  function c(f) {\n  };\n  c(org.apache.flex.utils.Language.closure(this.b, this, 'b'));\n}");
+    }
+    
+    @Test
+    public void testNativeGetter()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function b():int { var s:String; return s.length; }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        // String.length is a getter but is a property in JS, so don't generate set_length() call.
+        assertOut("/**\n * @export\n * @return {number}\n */\nfoo.bar.B.prototype.b = function() {\n  var /** @type {string} */ s;\n  return s.length;\n}");
+    }
+
+    @Test
+    public void testNativeVectorGetter()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function b():int { var a:Vector.<String>; return a.length; }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        // String.length is a getter but is a property in JS, so don't generate set_length() call.
+        assertOut("/**\n * @export\n * @return {number}\n */\nfoo.bar.B.prototype.b = function() {\n  var /** @type {Array} */ a;\n  return a.length;\n}");
+    }
+
+    //----------------------------------
+    // Other
+    //----------------------------------
+
+    @Test
+    public void testClassCast()
+    {
+        IClassNode node = (IClassNode) getNode("import goog.events.ListenableKey; public class B implements ListenableKey { public function B() { ListenableKey(b).type = ''; } }", ClassNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @implements {goog.events.ListenableKey}\n */\nB = function() {\n  org.apache.flex.utils.Language.as(b, goog.events.ListenableKey, true).type = '';\n};");
+    }
+
+    @Test
+    public void testClassCastOfGetter()
+    {
+        IFunctionNode node = getMethod("function foo(){var foo:Object = FalconTest_A(bar).bar = '';}; public function get bar():Object { return this; };");
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.foo = function() {\n  var /** @type {Object} */ foo = org.apache.flex.utils.Language.as(this.bar, FalconTest_A, true).bar = '';\n}");
+    }
+
+    @Test
+    public void testFunctionCall()
+    {
+        IFunctionNode node = getMethod("function foo(){bar(b).text = '';}");
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.foo = function() {\n  bar(b).text = '';\n}");
+    }
+    
+    @Test
+    public void testFunctionCallFullyQualified()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "import goog.bind; public class B {public function b() { goog.bind(b, this); }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nfoo.bar.B.prototype.b = function() {\n  goog.bind(org.apache.flex.utils.Language.closure(this.b, this, 'b'), this);\n}");
+    }
+
+    @Test
+    public void testFunctionMemberFullyQualified()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "import flash.utils.clearTimeout; public class B {public function b() { clearTimeout.length; }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nfoo.bar.B.prototype.b = function() {\n  flash.utils.clearTimeout.length;\n}");
+    }
+
+    @Test
+    public void testComplexBooleanExpression()
+    {
+        IFunctionNode node = getMethod("function foo(b:Boolean):Boolean {var c:String; var d:String; if (!(b ? c : d)) { return b;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {boolean} b\n * @return {boolean}\n */\nFalconTest_A.prototype.foo = function(b) {\n  var /** @type {string} */ c;\n  var /** @type {string} */ d;\n  if (!(b ? c : d)) {\n    return b;\n  }\n}");
+    }
+
+    @Override
+    @Test
+    public void testAnonymousFunction()
+    {
+    	IFunctionNode node = (IFunctionNode) getNode("var a = function(){};",
+                IFunctionNode.class);
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.falconTest_a = function() {\n" +
+        		  "  var self = this;\n" +
+        		  "  var /** @type {Function} */ __localFn0__ = function() {\n" +
+        		  "  }\n" +
+        		  "  var /** @type {*} */ a = __localFn0__;\n" +
+        		  "}");
+    }
+
+    @Override
+    @Test
+    public void testAnonymousFunctionWithParamsReturn()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "var a:Object = function(foo:int, bar:String = 'goo'):int{return -1;};",
+                IFunctionNode.class);
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.falconTest_a = function() {\n" +
+      		  "  var self = this;\n" +
+      		  "  var /** @type {Function} */ __localFn0__ = function(foo, bar) {\n" +
+      		  "    bar = typeof bar !== 'undefined' ? bar : 'goo';\n" +
+      		  "    return -1;\n" +
+      		  "  }\n" +
+      		  "  var /** @type {Object} */ a = __localFn0__;\n" +
+      		  "}");
+    }
+
+    @Override
+    @Test
+    public void testAnonymousFunctionAsArgument()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "addListener('foo', function(event:Object):void{doit();})",
+                IFunctionNode.class);
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.falconTest_a = function() {\n" +
+      		  "  var self = this;\n" +
+      		  "  var /** @type {Function} */ __localFn0__ = function(event) {\n" +
+      		  "    doit();\n" +
+      		  "  }\n" +
+      		  "  addListener('foo', __localFn0__);\n" +
+      		  "}");
+    }
+
+    @Test
+    public void testES5StrictAnonymousFunctions()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "var a:Object = {}; var b:Function = function(foo:Object) { foo.bar = 10 }; var c:Object = b(a);",
+                IFunctionNode.class);
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.falconTest_a = function() {\n" +
+        		  "  var self = this;\n" +
+        		  "  var /** @type {Function} */ __localFn0__ = function(foo) {\n    foo.bar = 10;\n  }\n" +
+        		  "  var /** @type {Object} */ a = {};\n" +
+        		  "  var /** @type {Function} */ b = __localFn0__;\n" +
+        		  "  var /** @type {Object} */ c = b(a);\n}");
+    }
+    
+    @Test
+    public void testES5StrictNamedLocalFunctions()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "var a:Object = {}; function b(foo:Object) { foo.bar = 10 }; var c:Object = b(a);",
+                IFunctionNode.class);
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.falconTest_a = function() {\n" +
+        		  "  var self = this;\n" +
+        		  "  function b(foo) {\n    foo.bar = 10;\n  };\n" +
+        		  "  var /** @type {Object} */ a = {};\n" +
+        		  "  var /** @type {Object} */ c = b(a);\n}");
+    }
+    
+    @Override
+    @Test
+    public void testVisitAs()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a as b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("org.apache.flex.utils.Language.as(a, b)");
+    }
+
+    @Test
+    public void testVisitAs2()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function b(o:Object):int { var a:B; a = o as B; }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n * @param {Object} o\n * @return {number}\n */\nfoo.bar.B.prototype.b = function(o) {\n  var /** @type {foo.bar.B} */ a;\n  a = org.apache.flex.utils.Language.as(o, foo.bar.B);\n}");
+    }
+
+    @Test
+    public void testVisitAsMemberVariable()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {private var memberVar:Class; public function b(o:Object):int { var a:B; a = o as memberVar; }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n * @param {Object} o\n * @return {number}\n */\nfoo.bar.B.prototype.b = function(o) {\n  var /** @type {foo.bar.B} */ a;\n  a = org.apache.flex.utils.Language.as(o, this.memberVar);\n}");
+    }
+
+    @Test
+    public void testVisitJSDoc()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class LinkableString {public function b(o:Object):int { var a:LinkableString; a = o as LinkableString; }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n * @param {Object} o\n * @return {number}\n */\nfoo.bar.LinkableString.prototype.b = function(o) {\n  var /** @type {foo.bar.LinkableString} */ a;\n  a = org.apache.flex.utils.Language.as(o, foo.bar.LinkableString);\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitBinaryOperator_Is()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a is b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("org.apache.flex.utils.Language.is(a, b)");
+    }
+
+    @Test
+    public void testVisitStringLiteralEmbeddedDoubleQuote()
+    {
+    	// a = " ' \" ";
+        LiteralNode node = (LiteralNode) getExpressionNode(
+                "a = \" ' \\\" \"", LiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        assertOut("\" ' \\\" \"");
+    }
+
+    @Test
+    public void testVisitStringLiteralSingleQuote()
+    {
+    	// a = ' \' " ';
+        LiteralNode node = (LiteralNode) getExpressionNode(
+                "a = ' \\' \" '", LiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        assertOut("' \\' \" '");
+    }
+
+    @Test
+    public void testVisitStringLiteral2029()
+    {
+    	// a = "\u2029";
+        LiteralNode node = (LiteralNode) getExpressionNode(
+                "a = \"\\u2029\"", LiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        assertOut("\"\\u2029\"");
+    }
+    
+    @Test
+    public void testVisitStringLiteral2028()
+    {
+    	// a = "\u2028";
+        LiteralNode node = (LiteralNode) getExpressionNode(
+                "a = \"\\u2028\"", LiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        assertOut("\"\\u2028\"");
+    }
+    
+    @Test
+    public void testVisitCallFunctionReturnedFromFunction()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode("function foo(a:String, b:String):Function { return null }; return foo(3, 4)(1, 2);", 
+        							IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("foo(3, 4)(1, 2)");
+    }
+    
+    @Test
+    public void testVisitNewSimple()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode("return new Fn(1, 2);", 
+        							IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("new Fn(1, 2)");
+    }
+    
+    @Test
+    public void testVisitNewComplex()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode("return new Fn(\"a\", \"b\", \"return a + b;\")(1, 2);", 
+        							IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("new Fn(\"a\", \"b\", \"return a + b;\")(1, 2)");
+    }
+
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java
new file mode 100644
index 0000000..0859a7b
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFieldMembers.java
@@ -0,0 +1,326 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogFieldMembers;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestFlexJSFieldMembers extends TestGoogFieldMembers
+{
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+
+    @Override
+    @Test
+    public void testField()
+    {
+        IVariableNode node = getField("var foo;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @type {*}\n */\nFalconTest_A.prototype.foo");
+    }
+
+    @Override
+    @Test
+    public void testField_withType()
+    {
+        IVariableNode node = getField("var foo:int;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @type {number}\n */\nFalconTest_A.prototype.foo");
+    }
+
+    @Override
+    @Test
+    public void testField_withTypeValue()
+    {
+        IVariableNode node = getField("var foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @type {number}\n */\nFalconTest_A.prototype.foo = 420");
+    }
+
+    @Test
+    public void testField_withTypeValue_Negative()
+    {
+        IVariableNode node = getField("var foo:int = -420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @type {number}\n */\nFalconTest_A.prototype.foo = -420");
+    }
+
+    @Override
+    @Test
+    public void testField_withNamespaceTypeValue()
+    {
+        IVariableNode node = getField("private var foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @private\n * @type {number}\n */\nFalconTest_A.prototype.foo = 420");
+    }
+
+    @Override
+    @Test
+    public void testField_withCustomNamespaceTypeValue()
+    {
+        IVariableNode node = getField("mx_internal var foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        // (erikdebruin) we ignore custom namespaces completely (are there side effects I'm missing?)
+        assertOut("/**\n * @export\n * @type {number}\n */\nFalconTest_A.prototype.foo = 420");
+    }
+
+    @Override
+    @Test
+    public void testField_withNamespaceTypeCollection()
+    {
+        IVariableNode node = getField("protected var foo:Vector.<Foo>;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @protected\n * @type {Array}\n */\nFalconTest_A.prototype.foo");
+    }
+
+    @Override
+    @Test
+    public void testField_withNamespaceTypeCollectionComplex()
+    {
+        IVariableNode node = getField("protected var foo:Vector.<Vector.<Vector.<Foo>>>;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @protected\n * @type {Array}\n */\nFalconTest_A.prototype.foo");
+    }
+
+    @Override
+    @Test
+    public void testField_withNamespaceTypeValueComplex()
+    {
+    	IClassNode node = (IClassNode) getNode("protected var foo:Foo = new Foo('bar', 42);",
+    			IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n\nthis.foo = new Foo('bar', 42);\n};\n\n\n/**\n * @protected\n * @type {Foo}\n */\nFalconTest_A.prototype.foo;");
+    }
+
+    @Test
+    public void testStaticField()
+    {
+        IVariableNode node = getField("static var foo;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @type {*}\n */\nFalconTest_A.foo");
+    }
+
+    @Test
+    public void testStaticField_withType()
+    {
+        IVariableNode node = getField("static var foo:int;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @type {number}\n */\nFalconTest_A.foo");
+    }
+
+    @Test
+    public void testStaticField_withTypeValue()
+    {
+        IVariableNode node = getField("static var foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @type {number}\n */\nFalconTest_A.foo = 420");
+    }
+
+    @Test
+    public void testField_withTypeValueArrayLiteral()
+    {
+    	IClassNode node = (IClassNode) getNode("protected var foo:Array = [ 'foo' ]",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n\nthis.foo = ['foo'];\n};\n\n\n/**\n * @protected\n * @type {Array}\n */\nFalconTest_A.prototype.foo;");
+    }
+    
+    @Test
+    public void testField_withTypeValueObjectLiteral()
+    {
+    	IClassNode node = (IClassNode) getNode("protected var foo:Object = { 'foo': 'bar' }",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n\nthis.foo = {'foo':'bar'};\n};\n\n\n/**\n * @protected\n * @type {Object}\n */\nFalconTest_A.prototype.foo;");
+    }
+    
+    @Test
+    public void testStaticField_withTypeValueObjectLiteral()
+    {
+    	IClassNode node = (IClassNode) getNode("static public var foo:Object = { 'foo': 'bar' }",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n * @export\n * @type {Object}\n */\nFalconTest_A.foo = {'foo':'bar'};");
+    }
+    
+    @Test
+    public void testField_withTypeValueFunctionCall()
+    {
+    	IClassNode node = (IClassNode) getNode("protected var foo:Number = parseFloat('1E2')",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n\nthis.foo = parseFloat('1E2');\n};\n\n\n/**\n * @protected\n * @type {number}\n */\nFalconTest_A.prototype.foo;");
+    }
+    
+    @Test
+    public void testStaticField_withFunctionInitializer()
+    {
+    	IClassNode node = (IClassNode) getNode("private static var empty:Function = function():void {}",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n * @private\n * @type {Function}\n */\nFalconTest_A.empty = function() {\n};");
+    }
+    
+    @Override
+    @Test
+    public void testField_withList()
+    {
+        IVariableNode node = getField("protected var a:int = 4, b:int = 11, c:int = 42;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @protected\n * @type {number}\n */\nFalconTest_A.prototype.a = 4;\n\n/**\n * @protected\n * @type {number}\n */\nFalconTest_A.prototype.b = 11;\n\n/**\n * @protected\n * @type {number}\n */\nFalconTest_A.prototype.c = 42");
+    }
+
+    //--------------------------------------------------------------------------
+    // Constants
+    //--------------------------------------------------------------------------
+
+    @Override
+    @Test
+    public void testConstant()
+    {
+        IVariableNode node = getField("static const foo;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @const\n * @type {*}\n */\nFalconTest_A.foo");
+    }
+
+    @Test
+    public void testConstant_nonStatic()
+    {
+        IVariableNode node = getField("const foo;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @const\n * @type {*}\n */\nFalconTest_A.prototype.foo");
+    }
+
+    @Override
+    @Test
+    public void testConstant_withType()
+    {
+        IVariableNode node = getField("static const foo:int;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @const\n * @type {number}\n */\nFalconTest_A.foo");
+    }
+
+    @Test
+    public void testConstant_withType_nonStatic()
+    {
+        IVariableNode node = getField("const foo:int;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @const\n * @type {number}\n */\nFalconTest_A.prototype.foo");
+    }
+
+    @Override
+    @Test
+    public void testConstant_withTypeValue()
+    {
+        IVariableNode node = getField("static const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @const\n * @type {number}\n */\nFalconTest_A.foo = 420");
+    }
+
+    @Test
+    public void testConstant_withComplexTypeValue()
+    {
+        IVariableNode node = getField("static const foo:Number = parseFloat('1E2');");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @const\n * @type {number}\n */\nFalconTest_A.foo = parseFloat('1E2')");
+    }
+
+    @Test
+    public void testConstant_withTypeValue_nonStatic()
+    {
+        IVariableNode node = getField("const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @const\n * @type {number}\n */\nFalconTest_A.prototype.foo = 420");
+    }
+
+    @Test
+    public void testConstant_withComplexTypeValue_nonStatic()
+    {
+    	IClassNode node = (IClassNode) getNode("protected const foo:Number = parseFloat('1E2');",
+    			IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n\nthis.foo = parseFloat('1E2');\n};\n\n\n/**\n * @protected\n * @const\n * @type {number}\n */\nFalconTest_A.prototype.foo;");
+    }
+    
+    @Test
+    public void testConstant_withTypeValueArrayLiteral()
+    {
+    	IClassNode node = (IClassNode) getNode("protected const foo:Array = [ 'foo' ]",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n\nthis.foo = ['foo'];\n};\n\n\n/**\n * @protected\n * @const\n * @type {Array}\n */\nFalconTest_A.prototype.foo;");
+    }
+    
+    @Test
+    public void testConstant_withTypeValueObjectLiteral()
+    {
+    	IClassNode node = (IClassNode) getNode("protected const foo:Object = { 'foo': 'bar' }",
+        		IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n\nthis.foo = {'foo':'bar'};\n};\n\n\n/**\n * @protected\n * @const\n * @type {Object}\n */\nFalconTest_A.prototype.foo;");
+    }
+
+    @Override
+    @Test
+    public void testConstant_withNamespaceTypeValue()
+    {
+        IVariableNode node = getField("private static const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @private\n * @const\n * @type {number}\n */\nFalconTest_A.foo = 420");
+    }
+
+    @Test
+    public void testConstant_withNamespaceTypeValue_nonStatic()
+    {
+        IVariableNode node = getField("private const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @private\n * @const\n * @type {number}\n */\nFalconTest_A.prototype.foo = 420");
+    }
+
+    @Override
+    @Test
+    public void testConstant_withCustomNamespaceTypeValue()
+    {
+        IVariableNode node = getField("mx_internal static const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        // (erikdebruin) we ignore custom namespaces completely (are there side effects I'm missing?)
+        assertOut("/**\n * @export\n * @const\n * @type {number}\n */\nFalconTest_A.foo = 420");
+    }
+
+    @Test
+    public void testConstant_withCustomNamespaceTypeValue_nonStatic()
+    {
+        IVariableNode node = getField("mx_internal const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        // (erikdebruin) we ignore custom namespaces completely (are there side effects I'm missing?)
+        assertOut("/**\n * @export\n * @const\n * @type {number}\n */\nFalconTest_A.prototype.foo = 420");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFile.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFile.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFile.java
new file mode 100644
index 0000000..3e72c22
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSFile.java
@@ -0,0 +1,107 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import java.io.File;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.test.FlexJSTestBase;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid 'goog' JS code from an external
+ * file.
+ * 
+ * @author Erik de Bruin
+ */
+public class TestFlexJSFile extends FlexJSTestBase
+{
+    @Override
+    public void setUp()
+    {
+        super.setUp();
+    	((FlexJSProject)project).config = new JSGoogConfiguration();
+    }
+
+    @Test
+    public void testLocalFunction()
+    {
+        String fileName = "LocalFunction";
+
+        IFileNode node = compileAS(fileName, true,
+                new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                        "flexjs/files").getPath(),
+                false);
+        
+        asBlockWalker.visitFile(node);
+        
+        //writeResultToFile(writer.toString(), fileName);
+        
+        assertOutWithMetadata(getCodeFromFile(fileName + "_result", true,
+                "flexjs" + File.separator + "files"));
+    }
+
+    @Test
+    public void testFlexJSMyController()
+    {
+        String fileName = "controllers/MyController";
+
+        IFileNode node = compileAS(fileName, true,
+                new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                        "flexjs/files").getPath(),
+                false);
+        
+        asBlockWalker.visitFile(node);
+        
+        //writeResultToFile(writer.toString(), fileName);
+        
+        assertOutWithMetadata(getCodeFromFile(fileName + "_result", true,
+                "flexjs" + File.separator + "files"));
+    }
+
+    @Test
+    public void testFlexJSMyModel()
+    {
+        String fileName = "models/MyModel";
+
+        IFileNode node = compileAS(fileName, true,
+                new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                        "flexjs/files").getPath(),
+                false);
+
+        asBlockWalker.visitFile(node);
+        
+        //writeResultToFile(writer.toString(), fileName);
+        
+        assertOutWithMetadata(getCodeFromFile(fileName + "_result", true,
+                "flexjs" + File.separator + "files"));
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+}


[30/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/graph/VF2JSDepsWriter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/graph/VF2JSDepsWriter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/graph/VF2JSDepsWriter.java
new file mode 100644
index 0000000..4d625d4
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/graph/VF2JSDepsWriter.java
@@ -0,0 +1,406 @@
+/*
+ *
+ *  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.internal.graph;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Scanner;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.flex.compiler.clients.problems.ProblemQuery;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.problems.FileNotFoundProblem;
+
+import com.google.common.io.Files;
+
+public class VF2JSDepsWriter {
+
+	public VF2JSDepsWriter(File outputFolder, String mainClassName, JSGoogConfiguration config)
+	{
+		this.outputFolderPath = outputFolder.getAbsolutePath();
+		this.mainName = mainClassName;
+		otherPaths = config.getSDKJSLib();
+	}
+	
+	private ProblemQuery problems;
+	private String outputFolderPath;
+	private String mainName;
+	private List<String> otherPaths;
+	private boolean problemsFound = false;
+	
+	private HashMap<String,GoogDep> depMap = new HashMap<String,GoogDep>();
+	
+	public ArrayList<String> getListOfFiles() throws InterruptedException
+	{
+		buildDB();
+		ArrayList<GoogDep> dps = sort(mainName);
+		ArrayList<String> files = new ArrayList<String>();
+		for (GoogDep gd : dps)
+		{
+			files.add(gd.filePath);
+		}
+		return files;
+	}
+	
+	public boolean generateDeps(ProblemQuery problems, StringBuilder depsFileData)
+			throws InterruptedException, FileNotFoundException
+	{
+	    problemsFound = false;
+	    this.problems = problems;
+		buildDB();
+		ArrayList<GoogDep> dps = sort(mainName);
+		String outString = "// generated by FalconJS" + "\n";
+		int n = dps.size();
+		for (int i = n - 1; i >= 0; i--)
+		{
+			GoogDep gd = dps.get(i);
+			if (!isGoogClass(gd.className)) 
+			{
+			    String s = "goog.addDependency('";
+	            s += relativePath(gd.filePath);
+	            s += "', ['";
+	            s += gd.className;
+	            s += "'], [";
+	            s += getDependencies(gd.deps);
+	            s += "]);\n";
+	            outString += s;
+			}
+		}
+		depsFileData.append(outString);
+		return !problemsFound; 
+	}
+	
+	private boolean isGoogClass(String className)
+	{
+	    return className.startsWith("goog.");
+	}
+	
+	private void buildDB()
+	{
+		addDeps(mainName);
+	}
+	
+    public ArrayList<String> filePathsInOrder = new ArrayList<String>();
+    
+    public ArrayList<String> additionalHTML = new ArrayList<String>();
+    
+    private HashMap<String, GoogDep> visited = new HashMap<String, GoogDep>();
+    
+	private ArrayList<GoogDep> sort(String rootClassName)
+	{
+		ArrayList<GoogDep> arr = new ArrayList<GoogDep>();
+		GoogDep current = depMap.get(rootClassName);
+		sortFunction(current, arr);
+		return arr;
+	}
+	
+	private void sortFunction(GoogDep current, ArrayList<GoogDep> arr)
+	{
+		visited.put(current.className, current);
+		
+		filePathsInOrder.add(current.filePath);
+        System.out.println("Dependencies calculated for '" + current.filePath + "'");
+
+		ArrayList<String> deps = current.deps;
+		for (String className : deps)
+		{
+			if (!visited.containsKey(className) && !isGoogClass(className))
+			{
+				GoogDep gd = depMap.get(className);
+				sortFunction(gd, arr);
+			}
+		}
+		arr.add(current);
+	}
+	
+	private void addDeps(String className)
+	{
+		if (depMap.containsKey(className) || isGoogClass(className))
+			return;
+		
+		// build goog dependency list
+		GoogDep gd = new GoogDep();
+		gd.className = className;
+		gd.filePath = getFilePath(className);
+		depMap.put(gd.className, gd);
+		ArrayList<String> deps = getDirectDependencies(gd.filePath);
+		
+		gd.deps = new ArrayList<String>();
+		ArrayList<String> circulars = new ArrayList<String>();
+		for (String dep : deps)
+		{
+		    if (depMap.containsKey(dep) && !isGoogClass(dep))
+		    {
+		        circulars.add(dep);
+		        continue;
+		    }
+			gd.deps.add(dep);
+		}
+        for (String dep : deps)
+        {
+            addDeps(dep);
+        }
+		if (circulars.size() > 0)
+		{
+		    // remove requires that would cause circularity
+		    try
+            {
+                List<String> fileLines = Files.readLines(new File(gd.filePath), 
+                		Charset.defaultCharset());
+                ArrayList<String> finalLines = new ArrayList<String>();
+                
+                //String inherits = getBaseClass(fileLines, className);
+                
+                for (String line : fileLines)
+                {
+                    int c = line.indexOf("goog.require");
+                    if (c > -1)
+                    {
+                        int c2 = line.indexOf(")");
+                        String s = line.substring(c + 14, c2 - 1);
+                        if (circulars.contains(s) /* && !s.equals(inherits) */ )
+                            continue;
+                    }
+                    finalLines.add(line);
+                }
+                File file = new File(gd.filePath);  
+                PrintWriter out = new PrintWriter(new FileWriter(file));  
+                for (String s : finalLines)
+                {
+                    out.println(s);
+                }
+                out.close();
+                    
+            }
+            catch (IOException e)
+            {
+                e.printStackTrace();
+            }
+		    
+		}
+	}
+	
+	String getBaseClass(List<String> lines, String className)
+	{
+	    int n = lines.size();
+	    for (int i = 0; i < n; i++)
+	    {
+	        String line = lines.get(i);
+	        int c2;
+	        int c = line.indexOf("goog.inherits");
+	        if (c > -1)
+	        {
+	            String inheritLine = ""; 
+                while (true)
+                {
+                    inheritLine += line;
+                    c2 = line.indexOf(")");
+                    if (c2 > -1)
+                        break;
+                    else
+                    {
+                        i++;
+                        line = lines.get(i);
+                    }
+                }
+	            c = inheritLine.indexOf(",");
+                c2 = inheritLine.indexOf(")");
+                return inheritLine.substring(c + 1, c2).trim();            
+	        }
+	    }
+	    return null;
+	}
+	
+	String getFilePath(String className)
+	{
+	    String fn;
+	    File destFile;
+	    File f;
+	    
+		String classPath = className.replace(".", File.separator);
+		
+        fn = outputFolderPath + File.separator + classPath + ".js";
+        f = new File(fn);
+        if (f.exists())
+        {
+            return fn;
+        }
+        
+        for (String otherPath : otherPaths)
+        {
+    		fn = otherPath + File.separator + classPath + ".js";
+    		f = new File(fn);
+    		if (f.exists())
+    		{
+    			fn = outputFolderPath + File.separator + classPath + ".js";
+    			destFile = new File(fn);
+    			// copy source to output
+    			try {
+    				FileUtils.copyFile(f, destFile);
+    				
+    				// (erikdebruin) copy class assets files
+    				if (className.indexOf("org.apache.flex") > -1)
+    				{
+    				    File assetsDir = new File(f.getParentFile(), "assets");
+    				    if (assetsDir.exists())
+    				    {
+    				        String nameOfClass = className.substring(className.lastIndexOf('.') + 1);
+    				        
+    				        File[] assetsList = assetsDir.listFiles();
+    				        for (int i = 0; i < assetsList.length; i++) 
+    				        {
+    				            File assetFile = assetsList[i];
+    				            String assetFileName = assetFile.getName();
+    				            
+    				            if (assetFile.isFile() && assetFileName.indexOf(nameOfClass) == 0) 
+    				            {
+    				                String pathOfClass = "";
+    				                pathOfClass = className.substring(0, className.lastIndexOf('.'));
+    				                pathOfClass = pathOfClass.replace(".", File.separator);
+    				                
+                                    destFile = new File(outputFolderPath + 
+                                            File.separator + pathOfClass + 
+                                            File.separator + "assets" + 
+                                            File.separator + assetFileName);
+                                    FileUtils.copyFile(assetFile, destFile);
+                                    
+                                    destFile = new File(outputFolderPath.replace("js-debug", "js-release") + 
+                                            File.separator + pathOfClass + 
+                                            File.separator + "assets" + 
+                                            File.separator + assetFileName);
+                                    FileUtils.copyFile(assetFile, destFile);
+                                    
+    	                            System.out.println("Copied assets of the '" + nameOfClass + "' class");
+    				            }
+    				        }
+    				    }
+    				}
+    			} catch (IOException e) {
+    				System.out.println("Error copying file for class: " + className);
+    			}
+    			return fn;
+    		}
+        }
+        
+		System.out.println("Could not find file for class: " + className);
+		problems.add(new FileNotFoundProblem(className));
+		problemsFound = true;
+		return "";
+	}
+	
+	private ArrayList<String> getDirectDependencies(String fn)
+	{
+		ArrayList<String> deps = new ArrayList<String>();
+		
+		FileInputStream fis;
+		try {
+			fis = new FileInputStream(fn);
+			Scanner scanner = new Scanner(fis, "UTF-8");
+			boolean inInjectHTML = false;
+			while (scanner.hasNextLine())
+			{
+				String s = scanner.nextLine();
+				if (s.indexOf("goog.inherits") > -1)
+					break;
+                if (inInjectHTML)
+                {
+                    int c = s.indexOf("</inject_html>");
+                    if (c > -1)
+                    {
+                        inInjectHTML = false;
+                        continue;
+                    }
+                }    
+                if (inInjectHTML)
+                {
+				    additionalHTML.add(s);
+				    continue;
+                }
+				int c = s.indexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+				if (c > -1)
+				{
+					int c2 = s.indexOf(")");
+					s = s.substring(c + 14, c2 - 1);
+					deps.add(s);
+				}
+                c = s.indexOf("<inject_html>");
+                if (c > -1)
+                {
+                    inInjectHTML = true;
+                }
+			}
+			scanner.close();
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		}
+		return deps;
+	}
+	
+	private String getDependencies(ArrayList<String> deps)
+	{
+		String s = "";
+		for (String dep : deps)
+		{
+			if (s.length() > 0)
+			{
+				s += ", ";
+			}
+			s += "'" + dep + "'";			
+		}
+		return s;
+	}
+
+	String relativePath(String path)
+	{
+        if (path.indexOf(outputFolderPath) == 0)
+        {
+            path = path.replace(outputFolderPath, "../../..");
+        }
+        else
+        {
+    	    for (String otherPath : otherPaths)
+    	    {
+        		if (path.indexOf(otherPath) == 0)
+        		{
+        			path = path.replace(otherPath, "../../..");
+        			
+        		}
+    	    }
+        }
+		// paths are actually URIs and always have forward slashes
+		path = path.replace('\\', '/');
+		return path;
+	}
+	private class GoogDep
+	{
+		public String filePath;
+		public String className;
+		public ArrayList<String> deps;
+		
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/parsing/as/FlexJSASDocDelegate.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/parsing/as/FlexJSASDocDelegate.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/parsing/as/FlexJSASDocDelegate.java
new file mode 100644
index 0000000..868e5d7
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/parsing/as/FlexJSASDocDelegate.java
@@ -0,0 +1,143 @@
+/*
+ *
+ *  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.internal.parsing.as;
+
+
+
+
+import antlr.Token;
+
+import org.apache.flex.compiler.asdoc.IASDocComment;
+import org.apache.flex.compiler.asdoc.IASDocDelegate;
+import org.apache.flex.compiler.asdoc.IASParserASDocDelegate;
+import org.apache.flex.compiler.asdoc.IMetadataParserASDocDelegate;
+import org.apache.flex.compiler.asdoc.IPackageDITAParser;
+import org.apache.flex.compiler.asdoc.flexjs.ASDocComment;
+import org.apache.flex.compiler.common.ISourceLocation;
+import org.apache.flex.compiler.definitions.IDocumentableDefinition;
+import org.apache.flex.compiler.tree.as.IDocumentableDefinitionNode;
+
+/**
+ * Default implementation of {@link IASDocDelegate} that does not have any code
+ * model or eclipse dependencies.
+ */
+public final class FlexJSASDocDelegate implements IASDocDelegate
+{
+    private static final FlexJSASDocDelegate INSTANCE = new FlexJSASDocDelegate();
+
+    /**
+     * Gets the single instance of this delegate.
+     * 
+     * @return The single instance of this delegate.
+     */
+    public static IASDocDelegate get()
+    {
+        return INSTANCE;
+    }
+
+    public FlexJSASDocDelegate()
+    {
+    }
+
+    @Override
+    public IASParserASDocDelegate getASParserASDocDelegate()
+    {
+        return new ASDelegate();
+    }
+
+    @Override
+    public IASDocComment createASDocComment(ISourceLocation location, IDocumentableDefinition definition)
+    {
+        return null;
+    }
+
+    @Override
+    public IPackageDITAParser getPackageDitaParser()
+    {
+        return IPackageDITAParser.NIL_PARSER;
+    }
+
+    private static final class ASDelegate implements IASParserASDocDelegate
+    {
+        @SuppressWarnings("unused")
+		static final ASDelegate INSTANCE = new ASDelegate();
+
+        @Override
+        public void beforeVariable()
+        {
+        }
+
+        @Override
+        public void afterVariable()
+        {
+        }
+
+        Token currentToken;
+        
+        @Override
+        public void setCurrentASDocToken(Token asDocToken)
+        {
+            currentToken = asDocToken;
+        }
+
+        @Override
+        public IASDocComment afterDefinition(IDocumentableDefinitionNode definitionNode)
+        {
+            if (currentToken == null)
+                return null;
+            
+            ASDocComment comment = new ASDocComment(currentToken);
+            currentToken = null;
+            return comment;
+        }
+
+        @Override
+        public IMetadataParserASDocDelegate getMetadataParserASDocDelegate()
+        {
+            return MetadataDelegate.INSTANCE;
+        }
+
+    }
+
+    private static final class MetadataDelegate implements IMetadataParserASDocDelegate
+    {
+        static final MetadataDelegate INSTANCE = new MetadataDelegate();
+
+        @Override
+        public void setCurrentASDocToken(Token asDocToken)
+        {
+        }
+
+        @Override
+        public IASDocComment afterDefinition(IDocumentableDefinitionNode definitionNode)
+        {
+            return null;
+        }
+
+        @Override
+        public void clearMetadataComment(String metaDataTagName)
+        {
+        }
+
+        @Override
+        public void afterMetadata(int metaDataEndOffset)
+        {
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/projects/FlexJSProject.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/projects/FlexJSProject.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/projects/FlexJSProject.java
new file mode 100644
index 0000000..67869ab
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/projects/FlexJSProject.java
@@ -0,0 +1,267 @@
+/*
+ *
+ *  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.internal.projects;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.flex.compiler.common.DependencyType;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.css.codegen.CSSCompilationSession;
+import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
+import org.apache.flex.compiler.internal.driver.js.flexjs.JSCSSCompilationSession;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.scopes.ASProjectScope.DefinitionPromise;
+import org.apache.flex.compiler.internal.targets.LinkageChecker;
+import org.apache.flex.compiler.internal.tree.mxml.MXMLClassDefinitionNode;
+import org.apache.flex.compiler.internal.units.SWCCompilationUnit;
+import org.apache.flex.compiler.internal.workspaces.Workspace;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+
+/**
+ * @author aharui
+ * 
+ */
+public class FlexJSProject extends FlexProject
+{
+
+    /**
+     * Constructor
+     * 
+     * @param workspace The {@code Workspace} containing this project.
+     */
+    public FlexJSProject(Workspace workspace)
+    {
+        super(workspace);
+        MXMLClassDefinitionNode.GENERATED_ID_BASE = MXMLFlexJSEmitterTokens.ID_PREFIX.getToken();
+    }
+
+    private HashMap<ICompilationUnit, HashMap<String, String>> interfaces = new HashMap<ICompilationUnit, HashMap<String, String>>();
+    private HashMap<ICompilationUnit, HashMap<String, DependencyType>> requires = new HashMap<ICompilationUnit, HashMap<String, DependencyType>>();
+
+    public JSGoogConfiguration config;
+    
+    public ICompilationUnit mainCU;
+
+    @Override
+    public void addDependency(ICompilationUnit from, ICompilationUnit to,
+            DependencyType dt, String qname)
+    {
+        // ToDo (erikdebruin): add VF2JS conditional -> only use check during full SDK compilation
+        List<IDefinition> dp = to.getDefinitionPromises();
+
+        if (dp.size() == 0)
+            return;
+
+        IDefinition def = dp.get(0);
+        // IDefinition def = to.getDefinitionPromises().get(0);
+        IDefinition actualDef = ((DefinitionPromise) def).getActualDefinition();
+        boolean isInterface = actualDef instanceof InterfaceDefinition;
+        if (!isInterface)
+        {
+            if (from != to)
+            {
+                HashMap<String, DependencyType> reqs;
+                if (requires.containsKey(from))
+                    reqs = requires.get(from);
+                else
+                {
+                    reqs = new HashMap<String, DependencyType>();
+                    requires.put(from, reqs);
+                }
+                if (reqs.containsKey(qname))
+                {
+                    // inheritance is important so remember it
+                    if (reqs.get(qname) != DependencyType.INHERITANCE)
+                    {
+                        if (!isExternalLinkage(to))
+                            reqs.put(qname, dt);
+                    }
+                }
+                else if (!isExternalLinkage(to) || qname.equals("Namespace"))
+                {
+                	if (qname.equals("XML"))
+                		needXML = true;
+                    reqs.put(qname, dt);
+                }
+            }
+        }
+        else
+        {
+            if (from != to)
+            {
+                HashMap<String, String> interfacesArr;
+
+                if (interfaces.containsKey(from))
+                {
+                    interfacesArr = interfaces.get(from);
+                }
+                else
+                {
+                    interfacesArr = new HashMap<String, String>();
+                    interfaces.put(from, interfacesArr);
+                }
+
+                if (!interfacesArr.containsKey(qname))
+                {
+                	if (qname.equals("org.apache.flex.core.IValuesImpl"))
+                		needCSS = true;
+                    interfacesArr.put(qname, qname);
+                }
+            }
+        }
+
+        super.addDependency(from, to, dt, qname);
+    }
+
+    public boolean needLanguage;
+    public boolean needCSS;
+    public boolean needXML;
+    
+    private LinkageChecker linkageChecker;
+    private ITargetSettings ts;
+    
+    // definitions that should be considered external linkage
+    public Collection<String> unitTestExterns;
+
+    private boolean isExternalLinkage(ICompilationUnit cu)
+    {
+        if (linkageChecker == null)
+        {
+            ts = getTargetSettings();
+            linkageChecker = new LinkageChecker(this, ts);
+        }
+        // in unit tests, ts may be null and LinkageChecker NPEs
+        if (ts == null)
+        {
+        	if (unitTestExterns != null)
+        	{
+        		try {
+        			if (!(cu instanceof SWCCompilationUnit))
+        				if (unitTestExterns.contains(cu.getQualifiedNames().get(0)))
+        					return true;
+				} catch (InterruptedException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+        	}
+            return false;
+        }
+
+        List<String> qnames;
+		try {
+			qnames = cu.getQualifiedNames();
+	        String qname = qnames.get(0);
+	        if (qname.equals("QName"))
+	        	return false;
+		} catch (InterruptedException e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+        try
+        {
+            return linkageChecker.isExternal(cu);
+        }
+        catch (InterruptedException e)
+        {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+    public ArrayList<String> getInterfaces(ICompilationUnit from)
+    {
+        if (interfaces.containsKey(from))
+        {
+            HashMap<String, String> map = interfaces.get(from);
+            ArrayList<String> arr = new ArrayList<String>();
+            Set<String> cus = map.keySet();
+            for (String s : cus)
+                arr.add(s);
+            return arr;
+        }
+        return null;
+    }
+
+    public ArrayList<String> getRequires(ICompilationUnit from)
+    {
+        if (requires.containsKey(from))
+        {
+            HashMap<String, DependencyType> map = requires.get(from);
+            ArrayList<String> arr = new ArrayList<String>();
+            Set<String> cus = map.keySet();
+            for (String s : cus)
+                arr.add(s);
+            return arr;
+        }
+        return null;
+    }
+
+    JSCSSCompilationSession cssSession = new JSCSSCompilationSession();
+
+    @Override
+    public CSSCompilationSession getCSSCompilationSession()
+    {
+        // When building SWFs, each MXML document may have its own styles
+        // specified by fx:Style blocks.  The CSS is separately compiled and
+        // stored in the class definition for the MXML document.  That helps
+        // with deferred loading of classes.  The styles and thus the
+        // classes for an MXML document are not initialized until the MXML
+        // class is initialized.
+        // For JS compilation, the CSS for non-standard CSS could be done the
+        // same way, but AFAICT, standard CSS properties are best loaded by
+        // specifying a .CSS file in the HTML.  The CSS is probably less text
+        // than its codegen'd representation, and the browser can probably
+        // load a .CSS file faster than us trying to run code to update the
+        // styles.
+        // So, for FlexJS, all style blocks from all MXML files are gathered into
+        // one .css file and a corresponding codegen block that is output as
+        // part of the main .JS file.
+        return cssSession;
+    }
+
+    private HashMap<IASNode, String> astCache = new HashMap<IASNode, String>();
+
+    @Override
+    public void addToASTCache(IASNode ast)
+    {
+        astCache.put(ast, "");
+    }
+
+    @Override
+    public void setTargetSettings(ITargetSettings value)
+    {
+         super.setTargetSettings(value);
+         ts = value;
+         linkageChecker = new LinkageChecker(this, value);
+         try {
+			linkageChecker.initExterns();
+		} catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/targets/FlexJSSWCTarget.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/targets/FlexJSSWCTarget.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/targets/FlexJSSWCTarget.java
new file mode 100644
index 0000000..339e3a8
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/targets/FlexJSSWCTarget.java
@@ -0,0 +1,303 @@
+/*
+ *
+ *  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.internal.targets;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.flex.compiler.common.XMLName;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.references.IResolvedQualifiersReference;
+import org.apache.flex.compiler.definitions.references.ReferenceFactory;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.projects.SourcePathManager;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.problems.NoCompilationUnitForDefinitionProblem;
+import org.apache.flex.compiler.problems.NoSourceForClassInNamespaceProblem;
+import org.apache.flex.compiler.problems.NoSourceForClassProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.IJSTarget;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.units.ICompilationUnit.UnitType;
+
+import com.google.common.base.Function;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+
+public class FlexJSSWCTarget extends JSTarget implements IJSTarget
+{
+    protected ICompilationUnit mainCU;
+    protected RootedCompilationUnits rootedCompilationUnits;
+
+    /**
+     * Initialize a JS target with the owner project and root compilation units.
+     * 
+     * @param project the owner project
+     */
+    public FlexJSSWCTarget(IASProject project, ITargetSettings targetSettings,
+            ITargetProgressMonitor progressMonitor)
+    {
+        super(project, targetSettings, progressMonitor);
+        flexProject = (FlexJSProject)project;
+    }
+
+    private FlexJSProject flexProject;
+    
+    @Override
+    protected Target.RootedCompilationUnits computeRootedCompilationUnits() throws InterruptedException
+    {
+        final Set<ICompilationUnit> rootCompilationUnits = new HashSet<ICompilationUnit>();
+
+        final Collection<File> includedSourceFiles = targetSettings.getIncludeSources();
+        final Set<String> includeClassNameSet = ImmutableSet.copyOf(targetSettings.getIncludeClasses());
+        final Set<String> includedNamespaces = ImmutableSet.copyOf(targetSettings.getIncludeNamespaces());
+
+        final ArrayList<ICompilerProblem> problems = new ArrayList<ICompilerProblem>();
+        
+        // Select definitions according to configurations.
+
+        // include-namespace
+        final Collection<ICompilationUnit> includeNamespaceUnits = 
+            getCompilationUnitsForIncludedNamespaces(includedNamespaces, problems); 
+        rootCompilationUnits.addAll(includeNamespaceUnits);
+        
+        // include-class + include-namespace
+        rootCompilationUnits.addAll(getCompilationUnitsFromClassNames(null, includeClassNameSet, problems));
+
+        // include-source
+        for (final File includedSourceFileName : includedSourceFiles)
+        {
+            // Get all the compilation units in the project that reference the specified file.
+            Collection<ICompilationUnit> compilationUnitsForFile = project.getWorkspace().getCompilationUnits(includedSourceFileName.getAbsolutePath(), project);
+            
+            // For compilation units with that differ by qname, choose the compilation that
+            // appears first on the source-path.
+            if (compilationUnitsForFile.size() > 1)
+            {
+                compilationUnitsForFile = filterUnitsBasedOnSourcePath(compilationUnitsForFile);
+            }
+            
+            for (ICompilationUnit cu : compilationUnitsForFile)
+            {
+                // IFilter out any compilation unit in the list where the specified file is not the root
+                // source file compiled by the compilation unit.
+                if (cu.getAbsoluteFilename().equals(includedSourceFileName.getAbsolutePath()))
+                    rootCompilationUnits.add(cu);
+            }
+        }
+
+        //Add compilation units for included resource bundles
+        for (ICompilationUnit rbCompUnit : getIncludedResourceBundlesCompilationUnits(problems))
+            rootCompilationUnits.add(rbCompUnit);
+
+        // -include and -include-libraries
+        rootCompilationUnits.addAll(getIncludesCompilationUnits());
+        rootCompilationUnits.addAll(getIncludeLibrariesCompilationUnits());
+        
+        return new Target.RootedCompilationUnits(rootCompilationUnits, problems);
+    }
+
+    /**
+     * For compilation units with the same absolute source path, filter based on
+     * the source path. The compilation unit found on the highest priority
+     * source path wins. The rest of the compilation units with qnames are
+     * discared. If a unit is not on the source path or does not have a qname or
+     * more than one qname, then let it thru the filter.
+     * 
+     * @param compilationUnitsForFile list of compilation units to filter.
+     * @return filtered compilation units.
+     * @throws InterruptedException
+     */
+    private Collection<ICompilationUnit> filterUnitsBasedOnSourcePath(Collection<ICompilationUnit> compilationUnitsForFile) throws InterruptedException
+    {
+        List<ICompilationUnit> sourcePathUnits = new ArrayList<ICompilationUnit>(compilationUnitsForFile);
+        boolean foundHighestPriorityUnit = false;
+        for (File sourcePath : flexProject.getSourcePath())
+        {
+            for (ICompilationUnit unit : sourcePathUnits)
+            {
+                // We only care about filtering units on the source path
+                // that follow the single definition rule.
+                UnitType unitType = unit.getCompilationUnitType();
+                if (unitType == UnitType.AS_UNIT || unitType == UnitType.FXG_UNIT ||
+                    unitType == UnitType.MXML_UNIT || unitType == UnitType.CSS_UNIT)
+                {
+                    Collection<String> qnames = unit.getQualifiedNames();
+                    if (qnames.size() > 1)
+                        continue;
+                    
+                    String unitQname = qnames.isEmpty() ? "" : qnames.iterator().next();
+                    String computedQname = SourcePathManager.computeQName(sourcePath, new File(unit.getAbsoluteFilename()));
+                    
+                    if (unitQname.equals(computedQname))
+                    {
+                        // We found a unit on the source path. Only keep the 
+                        // first unit found on the source path and remove the 
+                        // others.
+                        if (foundHighestPriorityUnit)
+                            compilationUnitsForFile.remove(unit);
+                        
+                        foundHighestPriorityUnit = true;
+                        break; // should only be one compilation unit on a source path
+                    }
+                }
+            }
+        }
+        
+        return compilationUnitsForFile;
+    }
+
+    /**
+     * Get the compilation units for the given included namespaces. Also perform error
+     * checking.
+     * 
+     * @param namespaces the namespaces included in this swc target.
+     * @param problems A collection where detected problems are added.
+     * @return A collection of compilation units.
+     * @throws InterruptedException 
+     */
+    private Collection<ICompilationUnit> getCompilationUnitsForIncludedNamespaces(
+            Collection<String> namespaces,
+            Collection<ICompilerProblem> problems) throws InterruptedException
+    {
+        final Collection<ICompilationUnit> allUnits = new HashSet<ICompilationUnit>();
+        
+        for (String namespace : namespaces)
+        {
+            // For each namespace get the set of classes. 
+            // From the classes get the the compilation units.
+            // Validate the compilation units are resolved to source
+            // files unless there are lookupOnly entries.
+            final Collection<String> includeNamespaceQualifiedNames =
+                flexProject.getQualifiedClassNamesForManifestNamespaces(
+                        Collections.singleton(namespace));
+            final Collection<ICompilationUnit> units = 
+                getCompilationUnitsFromClassNames(namespace, includeNamespaceQualifiedNames, problems);
+            validateIncludeNamespaceEntries(namespace, units, problems);
+            allUnits.addAll(units);
+        }
+        return allUnits;
+    }
+    
+    /**
+     * Validate that the manifest entries in the included namespaces resolve to
+     * source files, not classes from other SWCs. The exception is for entries
+     * that are "lookupOnly".
+     * 
+     * @param namespace The target namespace.
+     * @param units The compilation units found in that namespace.
+     * @param problems detected problems are added to this list.
+     * @throws InterruptedException 
+     */
+    private void validateIncludeNamespaceEntries(String namespace, 
+            Collection<ICompilationUnit> units, 
+            Collection<ICompilerProblem> problems) throws InterruptedException
+    {
+        for (ICompilationUnit unit : units)
+        {
+            List<String> classNames = unit.getQualifiedNames();
+            String className = classNames.get(classNames.size() - 1);
+            Collection<XMLName> xmlNames = flexProject.getTagNamesForClass(className);
+            for (XMLName xmlName : xmlNames)
+            {
+                if (namespace.equals(xmlName.getXMLNamespace()))
+                {
+                    if (!flexProject.isManifestComponentLookupOnly(xmlName) && 
+                        unit.getCompilationUnitType() == UnitType.SWC_UNIT)
+                    {
+                        problems.add(new NoSourceForClassInNamespaceProblem(namespace, className));
+                    }
+                    break;
+                }
+            }
+        }
+    }
+
+    /**
+     * Return a collection of compilation units for a collection of class names. 
+     *
+     * @param namespace the namespace of the classes. Null if there is no namespace.
+     * @param classNames
+     * @param problems detected problems are added to this list.
+     * @return a collection of compilation units.
+     */
+    private Collection<ICompilationUnit> getCompilationUnitsFromClassNames(String namespace,
+            Collection<String> classNames,
+            final Collection<ICompilerProblem> problems)
+    {
+        Collection<String> compilableClassNames = new ArrayList<String>();
+        for (String className : classNames)
+        {
+            Collection<XMLName> tagNames = flexProject.getTagNamesForClass(className);
+            boolean okToAdd = true;
+            for (XMLName tagName : tagNames)
+            {
+                if (flexProject.isManifestComponentLookupOnly(tagName))
+                    okToAdd = false;
+            }
+            if (okToAdd)
+                compilableClassNames.add(className);
+        }
+        
+        // Class names are turned into references and then info compilation units.
+        final Iterable<IResolvedQualifiersReference> references = 
+            Iterables.transform(compilableClassNames, new Function<String, IResolvedQualifiersReference>()
+                {
+                    @Override
+                    public IResolvedQualifiersReference apply(String qualifiedName)
+                    {
+                        return ReferenceFactory.packageQualifiedReference(project.getWorkspace(), qualifiedName, true);
+                    }
+                });
+
+        Collection<ICompilationUnit> units = new LinkedList<ICompilationUnit>();
+        for (IResolvedQualifiersReference reference : references)
+        {
+            IDefinition def = reference.resolve(flexProject);
+            if (def == null)
+            {
+                if (namespace == null)
+                    problems.add(new NoSourceForClassProblem(reference.getDisplayString()));
+                else
+                    problems.add(new NoSourceForClassInNamespaceProblem(namespace, reference.getDisplayString()));
+            }
+            else
+            {
+                ICompilationUnit defCU = project.getScope().getCompilationUnitForDefinition(def);
+                if (defCU == null)
+                    problems.add(new NoCompilationUnitForDefinitionProblem(def.getBaseName()));
+                else
+                    units.add(defCU);
+            }
+        }
+
+        return units;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/targets/FlexJSTarget.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/targets/FlexJSTarget.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/targets/FlexJSTarget.java
new file mode 100644
index 0000000..dd3fe6f
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/targets/FlexJSTarget.java
@@ -0,0 +1,295 @@
+/*
+ *
+ *  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.internal.targets;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.flex.compiler.css.ICSSDocument;
+import org.apache.flex.compiler.css.ICSSManager;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.internal.css.semantics.ActivatedStyleSheets;
+import org.apache.flex.compiler.internal.driver.js.flexjs.JSCSSCompilationSession;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.units.SWCCompilationUnit;
+import org.apache.flex.compiler.problems.FileNotFoundProblem;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.IJSTarget;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.units.ICompilationUnit.UnitType;
+
+import com.google.common.collect.ImmutableList;
+
+public class FlexJSTarget extends JSTarget implements IJSTarget
+{
+    /**
+     * Initialize a JS target with the owner project and root compilation units.
+     * 
+     * @param project the owner project
+     */
+    public FlexJSTarget(IASProject project, ITargetSettings targetSettings,
+            ITargetProgressMonitor progressMonitor)
+    {
+        super(project, targetSettings, progressMonitor);
+        flexProject = (FlexJSProject)project;
+    }
+    
+    private final FlexJSProject flexProject;
+
+    ///////////
+    //
+    //  Copied from FlexAppSWFTarget.java then modified
+    //
+    ///////////
+    /**
+     * Discovers dependent compilation units from a set of root compilation
+     * units.
+     * <p>
+     * For each public visible definition in all the compilation units, if
+     * there's an applicable CSS rule, check if the CSS rule pulls in any
+     * dependencies. (i.e. embedded assets, skin classes) Add the dependencies
+     * to the list of compilation units, and check if they have any applicable
+     * CSS rules which could pull in more dependencies. Loop until we reach a
+     * stable set of compilation units.
+     * <p>
+     * CSS rules in these CSS documents can introduce class dependencies. If any
+     * candidate rule matches a class known to be linked into the target, the
+     * candidate rule's dependencies are selected for linking. Those selected
+     * dependencies will be included in the next iteration of the dependency
+     * discovery loop.
+     * <p>
+     * Once a CSS document is "activated", it stays in this collection and its
+     * rules are tested against all classes introduced in the
+     * "dependency discovery loop".
+     * <p>
+     * For example: Suppose in project P, there are "A.as" and "styles.css", and
+     * class "A" is selected for linking.<br>
+     * In "styles.css", there're two rules:
+     * 
+     * <pre>
+     * A { xSkin : ClassReference("B"); }
+     * K { xSkin : ClassReference("L"); }
+     * </pre>
+     * 
+     * In the 1st iteration, rule "A" is matched, which introduces dependency on
+     * "B". <br>
+     * "B" is defined in a SWC library "myskins.swc", and there's a
+     * "defaults.css" in "myskins.swc".
+     * 
+     * <pre>
+     * B { ySkin : ClassReference("C"); }
+     * A { ySkin : ClassReference("D"); }
+     * K { ySkin : ClassReference("M"); }
+     * </pre>
+     * 
+     * In the 2nd iteration, rule "A" and rule "B" in "defaults.css" are
+     * matched, which introduces dependencies on "C" and "D". However, "K" has
+     * not been selected so far, so "L" and "M" are not selected.
+     * <p>
+     * Now imagine, "C" is defined in "anotherSkin.swc", and there's a
+     * "defaults.css" in "anotherSkin.swc" as well.
+     * 
+     * <pre>
+     * C { zSkin : ClassReference("K"); }
+     * </pre>
+     * 
+     * In the 3rd iteration, rule "C" is matched because "C" was selected in the
+     * previous iteration, which makes "K" the selected dependency.
+     * <p>
+     * At the beginning of the 4th iteration, the classes selected for linking
+     * are "A", "B", "C", "D" and "K". In this iteration, these classes will be
+     * tested against all the "activated style sheets" - "styles.css" and two
+     * "defaults.css" in "myskins.swc" and "anotherSkin.swc". "K" rules in
+     * "styles.css" and "myskins.swc" are now matched, which introduces new
+     * dependencies on "L" and "M".
+     * <p>
+     * In the 5th iteration, the classes to link are "A", "B", "C", "D", "K",
+     * "L" and "M". They are tested against all the activate CSS. No more
+     * dependencies are introduced by CSS rules, making it the last iteration of
+     * the loop.
+     * 
+     * @param compilationUnits Collection of compilation units known to be
+     * linked in.
+     * @param problems Collection of {@link ICompilerProblem}'s that the each
+     * found {@link ICompilationUnit} is added to.
+     * @return All compilation units which were compiled
+     * @throws InterruptedException
+     */
+    @Override
+    protected Set<ICompilationUnit> findAllCompilationUnitsToLink(final Collection<ICompilationUnit> compilationUnits,
+            final Collection<ICompilerProblem> problems)
+            throws InterruptedException
+    {
+        JSCSSCompilationSession cssCompilationSession = (JSCSSCompilationSession) flexProject.getCSSCompilationSession();
+        cssCompilationSession.setKeepAllTypeSelectors(targetSettings.keepAllTypeSelectors());
+        
+        // Performance heuristic: let's start compilation on all of the compilation
+        // units we know about up front. This is particularly useful on SWC projects where 
+        // we are using "include-sources" to force a bunch of possibly unrelated classes to be
+        // compiled.
+        // Note that by putting the code here, we will start aggressive early compilation for 
+        // all projects. Limited data so far shows this this is a good thing. But down the
+        // road it's possible that we might find tests cases that force us to reconsider / refine
+        // this "shotgun" approach.
+        for (ICompilationUnit cu : compilationUnits)
+            cu.startBuildAsync(getTargetType());
+        
+
+        assert compilationUnits != null : "compilation units can't be null";
+        assert problems != null : "problems can't be null";
+
+        // Collection of all the compilation units that will be linked in the target.
+        final Set<ICompilationUnit> allCompilationUnitsInTarget =
+                new HashSet<ICompilationUnit>(compilationUnits);
+
+        // Collection of all the referenced CSS. Once a CSS is activated, it's always
+        // included in the dependency checking, even none of its rules are matched.
+        final ActivatedStyleSheets activatedStyleSheets = new ActivatedStyleSheets();
+
+        final ICSSManager cssManager = flexProject.getCSSManager();
+        
+        collectThemes(cssManager, activatedStyleSheets, problems);
+        collectDefaultCSS(cssManager, activatedStyleSheets, problems);
+        
+        // The dependency discovery loop. 
+        // It terminates when no more dependencies are introduced by CSS.
+        boolean done = false;
+        while (!done)
+        {
+            //LoggingProfiler.onStartIteration();
+            
+            // Get all non-CSS dependencies.
+            final Set<ICompilationUnit> dependencies =
+                    getDependentCompilationUnits(allCompilationUnitsInTarget, problems);
+            //LoggingProfiler.onCompilationUnitDependenciesChanged(allCompilationUnitsInTarget, dependencies);
+            allCompilationUnitsInTarget.addAll(dependencies);
+
+            // Get all activated defaults.css from SWCs.
+            final Map<ICSSDocument, File> activatedDefaultCSSList =
+                        getAllDefaultCSS(cssManager, allCompilationUnitsInTarget);
+            for (final Map.Entry<ICSSDocument, File> entry : activatedDefaultCSSList.entrySet())
+            {
+                activatedStyleSheets.addLibraryCSS(entry.getKey(), entry.getValue().getAbsolutePath());
+            }
+            //LoggingProfiler.onDefaultsCSSCollectionChanged(activatedStyleSheets);
+
+            // Get all dependencies introduced by defaults.css from SWCs. 
+            final ImmutableList<IDefinition> definitions =
+                        Target.getAllExternallyVisibleDefinitions(allCompilationUnitsInTarget);
+            final Collection<ICompilationUnit> cssDependencies = new HashSet<ICompilationUnit>();
+            for (final ICSSDocument cssDocument : activatedStyleSheets.all())
+            {
+                // Side-effects of this method:
+                // 1. Resolve all type selectors in the CSS model to IClassDefinition definitions.
+                // 2. Activate CSS rules whose subject is in the definition set.
+                final Collection<ICompilationUnit> dependentCUListFromCSS =
+                        cssManager.getDependentCompilationUnitsFromCSS(
+                                cssCompilationSession,
+                                cssDocument,
+                                definitions,
+                                problems);
+                cssDependencies.addAll(dependentCUListFromCSS);
+                //LoggingProfiler.onCSSDependenciesChanged(dependentCUListFromCSS);
+            }
+
+            // If there's more dependencies introduced by CSS, the loop continues.
+            done = !allCompilationUnitsInTarget.addAll(cssDependencies);
+        }
+
+        // add to front so user specified css overrides defaults
+        cssCompilationSession.cssDocuments.addAll(0, activatedStyleSheets.sort());
+        
+        return super.findAllCompilationUnitsToLink(compilationUnits, problems);
+    }
+
+    /**
+     * Collect CSS from themes.
+     */
+    private void collectThemes(
+            final ICSSManager cssManager,
+            final ActivatedStyleSheets activatedStyleSheets,
+            final Collection<ICompilerProblem> problems)
+    {
+        final Collection<ICSSDocument> cssFromThemes = cssManager.getCSSFromThemes(problems);
+        for (final ICSSDocument themeCSS : cssFromThemes)
+        {
+            // Theme files are sorted by declaration order instead of filenames, so we needn't
+            // their filenames here.
+            activatedStyleSheets.addThemeCSS(themeCSS);
+        }
+    }
+    
+    /**
+     * Collect CSS from 'defaults-css-files' configuration option.
+     */
+    private void collectDefaultCSS(
+            final ICSSManager cssManager,
+            final ActivatedStyleSheets activatedStyleSheets,
+            final Collection<ICompilerProblem> problems)
+    {
+        for (final String defaultsCSSPath : getTargetSettings().getDefaultsCSSFiles())
+        {
+            final ICSSDocument defaultsCSSModel = cssManager.getCSS(defaultsCSSPath);
+            if (defaultsCSSModel == null)
+                problems.add(new FileNotFoundProblem(defaultsCSSPath));
+            else
+                activatedStyleSheets.addDefaultCSS(defaultsCSSModel);
+        }
+    }
+    
+    /**
+     * Find all the {@link SWCCompilationUnit}'s, and return the default CSS
+     * model in the SWCs.
+     * 
+     * @param cssManager Project-level CSS manager.
+     * @param compilationUnits All the compilation units. Non-SWC compilation
+     * units are ignored.
+     * @return Model of the default CSS in the SWCs. The map keys are CSS
+     * models; the values are the enclosing SWC file.
+     */
+    private static Map<ICSSDocument, File> getAllDefaultCSS(
+            final ICSSManager cssManager,
+            final Collection<ICompilationUnit> compilationUnits)
+    {
+        assert cssManager != null : "Expected CSS manager.";
+        assert compilationUnits != null : "Expected collection of compilation units.";
+
+        final Map<ICSSDocument, File> result = new HashMap<ICSSDocument, File>();
+        for (final ICompilationUnit compilationUnit : compilationUnits)
+        {
+            if (compilationUnit.getCompilationUnitType() == UnitType.SWC_UNIT)
+            {
+                final File swcFile = new File(compilationUnit.getAbsoluteFilename());
+                final ICSSDocument defaultCSS = cssManager.getDefaultCSS(swcFile);
+                if (defaultCSS != null)
+                    result.put(defaultCSS, swcFile);
+            }
+        }
+        return result;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/targets/JSTarget.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/targets/JSTarget.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/targets/JSTarget.java
new file mode 100644
index 0000000..adba905
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/targets/JSTarget.java
@@ -0,0 +1,231 @@
+/*
+ *
+ *  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.internal.targets;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.flex.compiler.driver.js.IJSApplication;
+import org.apache.flex.compiler.exceptions.BuildCanceledException;
+import org.apache.flex.compiler.internal.codegen.js.JSSharedData;
+import org.apache.flex.compiler.internal.driver.js.JSApplication;
+import org.apache.flex.compiler.internal.projects.CompilerProject;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.IJSTarget;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetReport;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.units.ICompilationUnit;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+
+public class JSTarget extends Target implements IJSTarget
+{
+    protected ICompilationUnit mainCU;
+    protected RootedCompilationUnits rootedCompilationUnits;
+
+    /**
+     * Initialize a JS target with the owner project and root compilation units.
+     * 
+     * @param project the owner project
+     */
+    public JSTarget(IASProject project, ITargetSettings targetSettings,
+            ITargetProgressMonitor progressMonitor)
+    {
+        super((CompilerProject) project, targetSettings, progressMonitor);
+    }
+
+    @Override
+    public TargetType getTargetType()
+    {
+        // can't do anything, TargetType is only swf|swc
+        return null;
+    }
+
+    @Override
+    protected ITargetReport computeTargetReport() throws InterruptedException
+    {
+        // TODO Should return a new TargetReport relating to the js app?
+        return null;
+    }
+
+    @Override
+    protected RootedCompilationUnits computeRootedCompilationUnits()
+            throws InterruptedException
+    {
+        if (mainCU != null)
+        {
+            return new Target.RootedCompilationUnits(ImmutableSet.of(mainCU),
+                    Collections.<ICompilerProblem> emptyList());
+        }
+        return new Target.RootedCompilationUnits(
+                Collections.<ICompilationUnit> emptySet(),
+                Collections.<ICompilerProblem> emptyList());
+    }
+
+    @Override
+    public RootedCompilationUnits getRootedCompilationUnits()
+            throws InterruptedException
+    {
+        if (rootedCompilationUnits == null)
+            rootedCompilationUnits = computeRootedCompilationUnits();
+        return rootedCompilationUnits;
+    }
+
+    @Override
+    public IJSApplication build(Collection<ICompilerProblem> problems)
+    {
+        buildStarted();
+        try
+        {
+            Iterable<ICompilerProblem> fatalProblems = getFatalProblems();
+            if (!Iterables.isEmpty(fatalProblems))
+            {
+                Iterables.addAll(problems, fatalProblems);
+                return null;
+            }
+
+            Set<ICompilationUnit> compilationUnitSet = new HashSet<ICompilationUnit>();
+            Target.RootedCompilationUnits rootedCompilationUnits = getRootedCompilationUnits();
+            Iterables.addAll(problems, rootedCompilationUnits.getProblems());
+
+            compilationUnitSet.addAll(rootedCompilationUnits.getUnits());
+
+            buildAndCollectProblems(compilationUnitSet, problems);
+
+            List<ICompilationUnit> reachableCompilationUnits = project
+                    .getReachableCompilationUnitsInSWFOrder(rootedCompilationUnits
+                            .getUnits());
+
+            IJSApplication application = initializeApplication(reachableCompilationUnits);
+
+            //            ISWF swf = initializeSWF(reachableCompilationUnits);
+            //
+            //            // make main frame for DoABC tags
+            //            final SWFFrame mainFrame = new SWFFrame();
+            //            swf.addFrame(mainFrame);
+            //
+            //            // Add definitions.
+            //            for (final ICompilationUnit cu : compilationUnitSet)
+            //            {
+            //                // ignore externals
+            //                if (isLinkageExternal(cu, targetSettings))
+            //                    continue;
+            //
+            //                // ignore any resource bundles
+            //                if (cu instanceof ResourceBundleCompilationUnit)
+            //                    continue;
+            //
+            //                // Create a DoABC tag per compilation unit.
+            //
+            //                // Please add this API to SWFTarget. Thx.
+            //                // protected Boolean addToFrame(ICompilationUnit cu, SWFFrame mainFrame) throws InterruptedException
+            //                // final boolean tagsAdded = cu.getSWFTagsRequest().get().addToFrame(mainFrame);
+            //                final boolean tagsAdded = addToFrame(cu, mainFrame);
+            //                if (!tagsAdded)
+            //                {
+            //                    ICompilerProblem problem = new UnableToBuildSWFTagProblem(cu.getAbsoluteFilename());
+            //                    problems.add(problem);
+            //                }
+            //            }
+            //
+            //            createLinkReport(problems);
+
+            return application;
+        }
+        catch (BuildCanceledException bce)
+        {
+            return null;
+        }
+        catch (InterruptedException ie)
+        {
+            return null;
+        }
+        finally
+        {
+            buildFinished();
+        }
+    }
+
+    protected IJSApplication initializeApplication(
+            List<ICompilationUnit> reachableCompilationUnits)
+    {
+        JSApplication result = new JSApplication();
+        // TODO set properties of the application
+        return result;
+    }
+
+    protected void buildAndCollectProblems(
+            final Set<ICompilationUnit> compilationUnits,
+            final Collection<ICompilerProblem> problems)
+            throws InterruptedException
+    {
+        final JSSharedData sharedData = JSSharedData.instance;
+        sharedData.beginCodeGen();
+
+        BuiltCompilationUnitSet builtCompilationUnits = getBuiltCompilationUnitSet();
+
+        //        if (JSSharedData.OUTPUT_ISOLATED)
+        //        {
+        final ICompilationUnit rootCU = getRootClassCompilationUnit();
+        compilationUnits.clear();
+        compilationUnits.add(rootCU);
+
+        // i added
+        Iterables.addAll(problems, builtCompilationUnits.problems);
+        //        }
+        //        else
+        //        {
+        //            final List<ICompilationUnit> allUnits = new ArrayList<ICompilationUnit>();
+        //            allUnits.addAll(project
+        //                    .getReachableCompilationUnitsInSWFOrder(builtCompilationUnits.compilationUnits));
+        //            final List<ICompilationUnit> cuList = sortCompilationUnits(allUnits);
+        //            compilationUnits.clear();
+        //            for (ICompilationUnit cu : cuList)
+        //                compilationUnits.add(cu);
+        //        }
+        sharedData.endCodeGen();
+    }
+
+    private ICompilationUnit getRootClassCompilationUnit()
+    {
+        String rootClassFileName = targetSettings.getRootSourceFileName();
+        if (rootClassFileName == null)
+            return null;
+
+        Collection<ICompilationUnit> rootClassCompilationUnits = project
+                .getCompilationUnits(rootClassFileName);
+        assert rootClassCompilationUnits.size() == 1 : "There must only be a single compilation unit for the root source file!";
+        return Iterables.getOnlyElement(rootClassCompilationUnits);
+    }
+
+    public IJSApplication build(ICompilationUnit unit,
+            Collection<ICompilerProblem> problems)
+    {
+        mainCU = unit;
+        return build(problems);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/as/ASNodeHandler.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/as/ASNodeHandler.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/as/ASNodeHandler.java
new file mode 100644
index 0000000..168c0dd
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/as/ASNodeHandler.java
@@ -0,0 +1,87 @@
+/*
+ *
+ *  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.internal.visitor.as;
+
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+
+/**
+ * A concrete implementation of the {@link IASNodeStrategy} that allows a
+ * subclass to either implement the {@link IASNode} handling directly or pass a
+ * child {@link IASNodeStrategy} that this class will delegate it's
+ * {@link #handle(IASNode)} method to.
+ * 
+ * @author Michael Schmalle
+ * 
+ * @see BeforeAfterStrategy
+ */
+public class ASNodeHandler implements IASNodeStrategy
+{
+    private IASNodeStrategy handler;
+
+    /**
+     * Returns the {@link IASNodeStrategy} currently being used to handle
+     * {@link IASNode} AST.
+     * 
+     * @return The current strategy.
+     */
+    public IASNodeStrategy getHandler()
+    {
+        return handler;
+    }
+
+    /**
+     * Sets the {@link IASNode} handler strategy.
+     * 
+     * @param handler The {@link IASNodeStrategy} to handle the specific
+     * {@link IASNode}.
+     */
+    public void setHandler(IASNodeStrategy handler)
+    {
+        this.handler = handler;
+    }
+
+    /**
+     * Constructor, used when this handler directly implements
+     * {@link #handle(IASNode)} and does not composite a child
+     * {@link IASNodeStrategy}.
+     */
+    public ASNodeHandler()
+    {
+    }
+
+    /**
+     * Constructor, creates a node strategy that composites a child
+     * {@link IASNodeStrategy} implemented in the {@link #handle(IASNode)}
+     * method.
+     * 
+     * @param handler The {@link IASNode} handler to be used in this strategy.
+     */
+    public ASNodeHandler(IASNodeStrategy handler)
+    {
+        this.handler = handler;
+    }
+
+    @Override
+    public void handle(IASNode node)
+    {
+        handler.handle(node);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java
new file mode 100644
index 0000000..d925b6d
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java
@@ -0,0 +1,386 @@
+/*
+ *
+ *  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.internal.visitor.as;
+
+import org.apache.flex.compiler.internal.tree.as.BinaryOperatorAsNode;
+import org.apache.flex.compiler.internal.tree.as.BinaryOperatorIsNode;
+import org.apache.flex.compiler.internal.tree.as.ConfigConditionBlockNode;
+import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
+import org.apache.flex.compiler.internal.tree.as.NamespaceAccessExpressionNode;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IBlockNode;
+import org.apache.flex.compiler.tree.as.ICatchNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IDefaultXMLNamespaceNode;
+import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
+import org.apache.flex.compiler.tree.as.IEmbedNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IFunctionObjectNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IIfNode;
+import org.apache.flex.compiler.tree.as.IImportNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.IIterationFlowNode;
+import org.apache.flex.compiler.tree.as.IKeywordNode;
+import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
+import org.apache.flex.compiler.tree.as.ILiteralNode;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.INamespaceAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.INamespaceNode;
+import org.apache.flex.compiler.tree.as.INumericLiteralNode;
+import org.apache.flex.compiler.tree.as.IObjectLiteralValuePairNode;
+import org.apache.flex.compiler.tree.as.IPackageNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.IReturnNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.apache.flex.compiler.tree.as.ISwitchNode;
+import org.apache.flex.compiler.tree.as.ITerminalNode;
+import org.apache.flex.compiler.tree.as.ITernaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IThrowNode;
+import org.apache.flex.compiler.tree.as.ITryNode;
+import org.apache.flex.compiler.tree.as.ITypedExpressionNode;
+import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IUseNamespaceNode;
+import org.apache.flex.compiler.tree.as.IVariableExpressionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.tree.as.IWhileLoopNode;
+import org.apache.flex.compiler.tree.as.IWithNode;
+import org.apache.flex.compiler.tree.metadata.IMetaTagNode;
+import org.apache.flex.compiler.tree.metadata.IMetaTagsNode;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+import org.apache.flex.compiler.visitor.IBlockVisitor;
+import org.apache.flex.compiler.visitor.as.IASBlockVisitor;
+
+/**
+ * The {@link ASNodeSwitch} class is an {@link IASNodeStrategy} implementation
+ * that handles {@link IASNode} types based on the node interface type.
+ * <p>
+ * All traversable {@link ASTNodeID} node visitor methods are found within the
+ * class {@link #handle(IASNode)} method's if else statements.
+ * 
+ * @author Michael Schmalle
+ */
+public class ASNodeSwitch implements IASNodeStrategy
+{
+    private IASBlockVisitor visitor;
+
+    /**
+     * Creates a new node switch using the {@link #visitor} to handle the
+     * {@link IASNode} in the current traverse.
+     * 
+     * @param visitor The {@link IASBlockVisitor} strategy that will visit an
+     * {@link IASNode} based on it's type.
+     */
+    public ASNodeSwitch(IBlockVisitor visitor)
+    {
+        this.visitor = (IASBlockVisitor) visitor;
+    }
+
+    @Override
+    public void handle(IASNode node)
+    {
+    	// ToDo (erikdebruin): add VF2JS conditional -> only use check during full SDK compilation
+        if (node == null)
+            return;
+
+        // TODO (mschmalle) Still working on the switch, its complication in the expressions
+        switch (node.getNodeID())
+        {
+        case ContainerID:
+            visitor.visitContainer((IContainerNode) node);
+            return;
+
+        case ConfigBlockID:
+        	ConfigConditionBlockNode condcomp = (ConfigConditionBlockNode)node;
+        	if (condcomp.getChildCount() > 0) // will be 0 if conditional compile variable is false
+                visitor.visitBlock((IBlockNode) node);
+            return;
+
+        case E4XFilterID:
+            visitor.visitE4XFilter((IMemberAccessExpressionNode) node);
+            return;
+
+        case FileID:
+            visitor.visitFile((IFileNode) node);
+            return;
+
+        case PackageID:
+            visitor.visitPackage((IPackageNode) node);
+            return;
+
+        case ClassID:
+            visitor.visitClass((IClassNode) node);
+            return;
+
+        case InterfaceID:
+            visitor.visitInterface((IInterfaceNode) node);
+            return;
+
+        case GetterID:
+            visitor.visitGetter((IGetterNode) node);
+            return;
+
+        case SetterID:
+            visitor.visitSetter((ISetterNode) node);
+            return;
+
+        case FunctionID:
+            visitor.visitFunction((IFunctionNode) node);
+            return;
+
+        case ArgumentID:
+        case ArgumentRestID:
+            visitor.visitParameter((IParameterNode) node);
+            return;
+
+        case VariableID:
+        case BindableVariableID:
+            visitor.visitVariable((IVariableNode) node);
+            return;
+
+        case NamespaceID:
+            visitor.visitNamespace((INamespaceNode) node);
+            return;
+
+        case CatchID:
+            visitor.visitCatch((ICatchNode) node);
+            return;
+
+        case ForEachLoopID:
+        case ForLoopID:
+            visitor.visitForLoop((IForLoopNode) node);
+            return;
+
+        case FinallyID:
+        case DefaultID:
+        case ElseID:
+        case TerminalID:
+            visitor.visitTerminal((ITerminalNode) node);
+            return;
+
+        case TryID:
+            visitor.visitTry((ITryNode) node);
+            return;
+
+        case WithID:
+            visitor.visitWith((IWithNode) node);
+            return;
+
+        case IfStatementID:
+            visitor.visitIf((IIfNode) node);
+            return;
+
+        case SwitchID:
+            visitor.visitSwitch((ISwitchNode) node);
+            return;
+
+        case WhileLoopID:
+        case DoWhileLoopID:
+            visitor.visitWhileLoop((IWhileLoopNode) node);
+            return;
+
+        case FunctionCallID:
+            visitor.visitFunctionCall((IFunctionCallNode) node);
+            return;
+
+        case TypedExpressionID:
+            visitor.visitTypedExpression((ITypedExpressionNode) node);
+            return;
+
+        case IdentifierID:
+        case NamespaceIdentifierID:
+        case NonResolvingIdentifierID:
+            if (node instanceof ILanguageIdentifierNode)
+            {
+                visitor.visitLanguageIdentifierNode((ILanguageIdentifierNode) node);
+                return;
+            }
+            visitor.visitIdentifier((IIdentifierNode) node);
+            return;
+
+            //case LiteralIntegerZeroID:
+        case LiteralIntegerID:
+            //case LiteralIntegerZeroID:
+        case LiteralUintID:
+            visitor.visitNumericLiteral((INumericLiteralNode) node);
+            return;
+
+            //        case LiteralArrayID:
+            //        case LiteralBooleanID:
+            //        case LiteralNullID:
+            //        case LiteralNumberID:
+            //        case LiteralObjectID:
+            //        case LiteralRegexID:
+            //        case LiteralStringID:
+            //        case LiteralVoidID:
+            //        case LiteralXMLID:
+            //        case LiteralID:
+            //            visitor.visitLiteral((ILiteralNode) node);
+            //            return;
+
+            //        case MemberAccessExpressionID:
+            //            visitor.visitMemberAccessExpression((IMemberAccessExpressionNode) node);
+            //            return;
+
+        case ArrayIndexExpressionID:
+            visitor.visitDynamicAccess((IDynamicAccessNode) node);
+            return;
+
+            //        case NamespaceAccessExpressionID:
+            //            visitor.visitNamespaceAccessExpression((NamespaceAccessExpressionNode) node);
+            //            return;
+
+            //        case TODO:
+            //            visitor.visitBinaryOperator((IBinaryOperatorNode) node);
+            //            break;
+            //
+            //        case TODO:
+            //            visitor.visitUnaryOperator((IUnaryOperatorNode) node);
+            //            break;
+
+        case ReturnStatementID:
+            visitor.visitReturn((IReturnNode) node);
+            return;
+
+        case ThrowsStatementID:
+            visitor.visitThrow((IThrowNode) node);
+            return;
+
+        case TernaryExpressionID:
+            visitor.visitTernaryOperator((ITernaryOperatorNode) node);
+            return;
+
+        case BlockID:
+            visitor.visitBlock((IBlockNode) node);
+            return;
+
+        case LabledStatementID:
+            visitor.visitLabeledStatement((LabeledStatementNode) node);
+            return;
+
+        case BreakID:
+        case ContinueID:
+        case GotoID:
+            visitor.visitIterationFlow((IIterationFlowNode) node);
+            return;
+
+            //        case ObjectLiteralValuePairID:
+            //            visitor.visitObjectLiteralValuePair((IObjectLiteralValuePairNode) node);
+            //            return;
+
+        case SuperID:
+        case VoidID:
+            // XXX this should be removed
+            visitor.visitLanguageIdentifierNode((ILanguageIdentifierNode) node);
+            return;
+
+        case DefaultXMLStatementID:
+            visitor.visitDefaultXMLNamespace((IDefaultXMLNamespaceNode) node);
+            return;
+
+            //        case TODO:
+            //            visitor.visitKeyword((IKeywordNode) node);
+            //            break;
+        case VariableExpressionID:
+            visitor.visitVariableExpression((IVariableExpressionNode) node);
+            return;
+        case FunctionObjectID:
+        case AnonymousFunctionID:
+            visitor.visitFunctionObject((IFunctionObjectNode) node);
+            return;
+        
+        default:
+            break;
+        }
+
+        // IExpressionNode
+        if (node instanceof IUseNamespaceNode)
+        {
+            visitor.visitUseNamespace((IUseNamespaceNode) node);
+        }
+        else if (node instanceof IEmbedNode)
+        {
+            visitor.visitEmbed((IEmbedNode) node);
+        }
+        else if (node instanceof IObjectLiteralValuePairNode)
+        {
+            visitor.visitObjectLiteralValuePair((IObjectLiteralValuePairNode) node);
+        }
+        else if (node instanceof NamespaceAccessExpressionNode)
+        {
+            visitor.visitNamespaceAccessExpression((INamespaceAccessExpressionNode) node);
+        }
+        else if (node instanceof IMemberAccessExpressionNode)
+        {
+            visitor.visitMemberAccessExpression((IMemberAccessExpressionNode) node);
+        }
+        else if (node instanceof IBinaryOperatorNode)
+        {
+            if (node instanceof BinaryOperatorAsNode)
+                visitor.visitAsOperator((IBinaryOperatorNode) node);
+            else if (node instanceof BinaryOperatorIsNode)
+                visitor.visitIsOperator((IBinaryOperatorNode) node);
+            else
+                visitor.visitBinaryOperator((IBinaryOperatorNode) node);
+        }
+        // IUnaryOperatorNode > IOperator
+        else if (node instanceof IUnaryOperatorNode)
+        {
+            visitor.visitUnaryOperator((IUnaryOperatorNode) node);
+        }
+        else if (node instanceof IKeywordNode)
+        {
+            visitor.visitKeyword((IKeywordNode) node);
+        }
+        else if (node instanceof IMetaTagsNode)
+        {
+            visitor.visitMetaTags((IMetaTagsNode) node);
+        }
+        else if (node instanceof IMetaTagNode)
+        {
+            visitor.visitMetaTag((IMetaTagNode) node);
+        }
+        else if (node instanceof IImportNode)
+        {
+            visitor.visitImport((IImportNode) node);
+        }
+        else if (node instanceof ILiteralNode)
+        {
+            visitor.visitLiteral((ILiteralNode) node);
+        }
+        else if (node instanceof IExpressionNode)
+        {
+            visitor.visitExpression((IExpressionNode) node);
+        }
+        else
+        {
+            throw new RuntimeException("handle() not found "
+                    + node.getClass().getName());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/as/BeforeAfterStrategy.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/as/BeforeAfterStrategy.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/as/BeforeAfterStrategy.java
new file mode 100644
index 0000000..5b5bf95
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/as/BeforeAfterStrategy.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.internal.visitor.as;
+
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IBlockNode;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+
+/**
+ * The {@link BeforeAfterStrategy} implements a before and after {@link IASNode}
+ * handler.
+ * <p>
+ * When {@link #handle(IASNode)} is called on an instance of this class, the
+ * default {@link #handle(IASNode)} method will first call the
+ * {@link #getBefore()} handle() method , the will call the supers handle()
+ * implementation which is to call the {@link #getHandler()} handle() method.
+ * Finally, the {@link #getAfter()} handler's handle() method will be called.
+ * <p>
+ * Currently, this strategy is used for indenting and {@link IBlockNode} pre and
+ * post symbol management.
+ * 
+ * @author Michael Schmalle
+ */
+public class BeforeAfterStrategy extends ASNodeHandler
+{
+    private IASNodeStrategy before;
+
+    /**
+     * Returns the {@link IASNodeStrategy} called before the
+     * {@link #getHandler()}'s handle() method.
+     * 
+     * @return The before handler.
+     */
+    public IASNodeStrategy getBefore()
+    {
+        return before;
+    }
+
+    /**
+     * Sets the before handler.
+     * 
+     * @param before The before handler.
+     */
+    public void setBefore(IASNodeStrategy value)
+    {
+        this.before = value;
+    }
+
+    private IASNodeStrategy after;
+
+    /**
+     * Returns the {@link IASNodeStrategy} called after the
+     * {@link #getHandler()}'s handle() method.
+     * 
+     * @return The after handler.
+     */
+    public IASNodeStrategy getAfter()
+    {
+        return after;
+    }
+
+    /**
+     * Sets the after handler.
+     * 
+     * @param after The after handler.
+     */
+    public void setAfter(IASNodeStrategy value)
+    {
+        this.after = value;
+    }
+
+    /**
+     * Constructor, creates a strategy that implements a before and after
+     * {@link IASNodeStrategy}.
+     * 
+     * @param handler The handler that will be called between the before and
+     * after {@link #handle(IASNode)} method.
+     * @param before The before handler.
+     * @param after The after handler.
+     */
+    public BeforeAfterStrategy(IASNodeStrategy handler, IASNodeStrategy before,
+            IASNodeStrategy after)
+    {
+        super(handler);
+        this.before = before;
+        this.after = after;
+    }
+
+    @Override
+    public void handle(IASNode node)
+    {
+        before(node);
+        super.handle(node);
+        after(node);
+    }
+
+    /**
+     * Called before the {@link #handle(IASNode)} method.
+     * <p>
+     * If the {@link #getAfter()} strategy is <code>null</code>, this method
+     * does nothing.
+     * 
+     * @param node The current {@link IASNode} being handled by the strategy.
+     */
+    protected void after(IASNode node)
+    {
+        if (after != null)
+            after.handle(node);
+    }
+
+    /**
+     * Called after the {@link #handle(IASNode)} method.
+     * <p>
+     * If the {@link #getBefore()} strategy is <code>null</code>, this method
+     * does nothing.
+     * 
+     * @param node The current {@link IASNode} being handled by the strategy.
+     */
+    protected void before(IASNode node)
+    {
+        if (before != null)
+            before.handle(node);
+    }
+}


[05/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSMXMLClassDirectiveProcessor.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSMXMLClassDirectiveProcessor.java b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSMXMLClassDirectiveProcessor.java
deleted file mode 100644
index 0f098cc..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSMXMLClassDirectiveProcessor.java
+++ /dev/null
@@ -1,1616 +0,0 @@
-package org.apache.flex.compiler.internal.as.codegen;
-
-import static org.apache.flex.abc.ABCConstants.CONSTANT_PrivateNs;
-import static org.apache.flex.abc.ABCConstants.OP_applytype;
-import static org.apache.flex.abc.ABCConstants.OP_callproperty;
-import static org.apache.flex.abc.ABCConstants.OP_callpropvoid;
-import static org.apache.flex.abc.ABCConstants.OP_construct;
-import static org.apache.flex.abc.ABCConstants.OP_constructprop;
-import static org.apache.flex.abc.ABCConstants.OP_dup;
-import static org.apache.flex.abc.ABCConstants.OP_finddef;
-import static org.apache.flex.abc.ABCConstants.OP_findpropstrict;
-import static org.apache.flex.abc.ABCConstants.OP_getlex;
-import static org.apache.flex.abc.ABCConstants.OP_getlocal0;
-import static org.apache.flex.abc.ABCConstants.OP_getlocal3;
-import static org.apache.flex.abc.ABCConstants.OP_getproperty;
-import static org.apache.flex.abc.ABCConstants.OP_newarray;
-import static org.apache.flex.abc.ABCConstants.OP_newobject;
-import static org.apache.flex.abc.ABCConstants.OP_pushdouble;
-import static org.apache.flex.abc.ABCConstants.OP_pushfalse;
-import static org.apache.flex.abc.ABCConstants.OP_pushnull;
-import static org.apache.flex.abc.ABCConstants.OP_pushstring;
-import static org.apache.flex.abc.ABCConstants.OP_pushtrue;
-import static org.apache.flex.abc.ABCConstants.OP_pushuint;
-import static org.apache.flex.abc.ABCConstants.OP_setproperty;
-import static org.apache.flex.abc.ABCConstants.TRAIT_Const;
-import static org.apache.flex.abc.ABCConstants.TRAIT_Method;
-import static org.apache.flex.abc.ABCConstants.TRAIT_Var;
-import static org.apache.flex.compiler.mxml.IMXMLTypeConstants.ADD_EVENT_LISTENER_CALL_OPERANDS;
-import static org.apache.flex.compiler.mxml.IMXMLTypeConstants.CREATE_XML_DOCUMENT_CALL_OPERANDS;
-import static org.apache.flex.compiler.mxml.IMXMLTypeConstants.GET_INSTANCE_CALL_OPERANDS;
-import static org.apache.flex.compiler.mxml.IMXMLTypeConstants.NAME_HANDLER_FUNCTION;
-import static org.apache.flex.compiler.mxml.IMXMLTypeConstants.NAME_ID;
-import static org.apache.flex.compiler.mxml.IMXMLTypeConstants.NAME_NAME;
-import static org.apache.flex.compiler.mxml.IMXMLTypeConstants.NAME_OVERRIDES;
-import static org.apache.flex.compiler.mxml.IMXMLTypeConstants.NAME_TARGET;
-import static org.apache.flex.compiler.mxml.IMXMLTypeConstants.NAME_VALUE;
-import static org.apache.flex.compiler.mxml.IMXMLTypeConstants.SET_STYLE_CALL_OPERANDS;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.flex.abc.ABCConstants;
-import org.apache.flex.abc.instructionlist.InstructionList;
-import org.apache.flex.abc.semantics.MethodInfo;
-import org.apache.flex.abc.semantics.Name;
-import org.apache.flex.abc.semantics.Namespace;
-import org.apache.flex.abc.semantics.Nsset;
-import org.apache.flex.abc.semantics.Trait;
-import org.apache.flex.abc.visitors.IABCVisitor;
-import org.apache.flex.abc.visitors.ITraitVisitor;
-import org.apache.flex.abc.visitors.ITraitsVisitor;
-import org.apache.flex.compiler.common.ASModifier;
-import org.apache.flex.compiler.constants.IASLanguageConstants;
-import org.apache.flex.compiler.constants.IASLanguageConstants.BuiltinType;
-import org.apache.flex.compiler.css.ICSSDocument;
-import org.apache.flex.compiler.definitions.IDefinition;
-import org.apache.flex.compiler.definitions.ITypeDefinition;
-import org.apache.flex.compiler.exceptions.CodegenInterruptedException;
-import org.apache.flex.compiler.internal.as.codegen.ICodeGenerator.IConstantValue;
-import org.apache.flex.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.Context;
-import org.apache.flex.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.IL;
-import org.apache.flex.compiler.internal.caches.CSSDocumentCache;
-import org.apache.flex.compiler.internal.css.codegen.CSSCompilationSession;
-import org.apache.flex.compiler.internal.css.codegen.CSSEmitter;
-import org.apache.flex.compiler.internal.css.codegen.CSSReducer;
-import org.apache.flex.compiler.internal.definitions.ClassDefinition;
-import org.apache.flex.compiler.internal.definitions.DefinitionBase;
-import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
-import org.apache.flex.compiler.internal.definitions.NamespaceDefinition;
-import org.apache.flex.compiler.internal.definitions.TypeDefinitionBase;
-import org.apache.flex.compiler.internal.projects.FlexProject;
-import org.apache.flex.compiler.internal.resourcebundles.ResourceBundleUtils;
-import org.apache.flex.compiler.internal.scopes.ASProjectScope;
-import org.apache.flex.compiler.internal.scopes.ASScope;
-import org.apache.flex.compiler.internal.semantics.SemanticUtils;
-import org.apache.flex.compiler.internal.tree.as.FunctionNode;
-import org.apache.flex.compiler.internal.tree.as.NodeBase;
-import org.apache.flex.compiler.internal.tree.as.VariableNode;
-import org.apache.flex.compiler.mxml.IMXMLLanguageConstants;
-import org.apache.flex.compiler.mxml.IMXMLTypeConstants;
-import org.apache.flex.compiler.problems.CSSCodeGenProblem;
-import org.apache.flex.compiler.problems.ICompilerProblem;
-import org.apache.flex.compiler.problems.MXMLNotImplementedProblem;
-import org.apache.flex.compiler.problems.MXMLOuterDocumentAlreadyDeclaredProblem;
-import org.apache.flex.compiler.projects.ICompilerProject;
-import org.apache.flex.compiler.projects.IFlexProject;
-import org.apache.flex.compiler.tree.ASTNodeID;
-import org.apache.flex.compiler.tree.as.IASNode;
-import org.apache.flex.compiler.tree.as.IExpressionNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLArrayNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLBooleanNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLClassDefinitionNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLClassNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLClassReferenceNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLComponentNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLConcatenatedDataBindingNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLDeferredInstanceNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLDesignLayerNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLEffectSpecifierNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLEmbedNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLEventSpecifierNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLFactoryNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLFunctionNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLInstanceNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLIntNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLNumberNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLObjectNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLRegExpNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLRemoteObjectMethodNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLResourceNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLSingleDataBindingNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLStateNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLStringNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLStyleNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLStyleSpecifierNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLUintNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLVectorNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLWebServiceOperationNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLXMLListNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLXMLNode;
-import org.apache.flex.compiler.units.ICompilationUnit;
-
-import com.google.common.base.Strings;
-
-/**
- * {@link MXMLClassDirectiveProcessor} is a subclass of
- * {@code ClassDirectiveProcessor} that generates an ABC class
- * from an {@link IMXMLClassDefinitionNode} and its contents.
- * 
- * Here are some register usage conventions for Code Generation:
- *      local3: during parts of the constructor, local3 is used for a 
- *          lookup array of DeferredInstanceFromFunction.
- *      local1 and 2: Used during the constructor as temporaries
- *          for some data-binding init.
- */
-public class JSMXMLClassDirectiveProcessor extends MXMLClassDirectiveProcessor
-{
-    /**
-     * Initialize the {@link MXMLClassDirectiveProcessor} and its
-     * associated AET data structures.
-     * @param d - the MXML document's AST.
-     * @param enclosingScope - the immediately enclosing lexical scope.
-     * @param emitter - the active ABC emitter.
-     */
-    JSMXMLClassDirectiveProcessor(IMXMLClassDefinitionNode classDefinitionNode,
-                                LexicalScope enclosingScope, IABCVisitor emitter)
-    {
-        super(classDefinitionNode, 
-              enclosingScope, emitter);  
-        
-        JSMXMLEmitter jsMXMLEmitter = (JSMXMLEmitter)emitter;
-        jsMXMLEmitter.register(this);
-    }
-    
-    /**
-     * A Map mapping an event node to the Name of the event handler
-     * method (>0, >1, etc.) associated with that node.
-     * <p>
-     * The handler method may or may not exist at the time
-     * that the handler name is assigned to the event node.
-     * For example, when a State tag appears before
-     * an instance tag with a state-dependent event,
-     * the name will get assigned and the code generated later.
-     * <p>
-     * This map is managed ONLY by getEventHandlerName().
-     */
-    private final Map<IMXMLEventSpecifierNode, Name> eventHandlerMap =
-        new HashMap<IMXMLEventSpecifierNode, Name>();
-
-    /**
-     * An incrementing counter used to create the names of the
-     * auto-generated event handler methods.
-     */
-    private int eventHandlerCounter = 0;
-
-    /**
-     * Autogenerated event handler methods are named $EH0, $EH1, etc.
-     * Using short names, and using the same names in each MXML document,
-     * decreases SWF size.
-     * Using a character that is not legal in ActionScript identifiers
-     * means that even if the event handler must be public
-     * (because it is referenced in a descriptor)
-     * the name will not collide with the name of a developer-written
-     * method and cannot be accessed from developer code.
-     */
-    private static final String EVENT_HANDLER_NAME_BASE = "$EH";
-
-    private String NEWLINE = "\n";
-    public ArrayList<Name> variableTraits;
-    private ArrayList<String> instanceData = new ArrayList<String>();
-    public ArrayList<String> fragments = new ArrayList<String>();
-    private FragmentList properties = new FragmentList();
-    private FragmentList styles = new FragmentList();
-    private FragmentList events = new FragmentList();
-    private FragmentList children = new FragmentList();
-    private FragmentList model = new FragmentList();
-    private FragmentList beads = new FragmentList();
-    private FragmentList currentList;
-    private boolean inContentFactory;
-    private String className;
-    
-    @Override
-    public void processMainClassDefinitionNode(IMXMLClassDefinitionNode node)
-    {
-        // Leave a reference to the class on the stack.
-        ClassDefinition classDefinition =
-            (ClassDefinition)((IMXMLClassDefinitionNode)node).getClassDefinition();
-        className = classDefinition.getQualifiedName();
-    	currentList = properties;
-    	super.processMainClassDefinitionNode(node);
-    }
-
-    @Override
-    public void addVariableTrait(Name varName, Name varType)
-    {
-    	if (variableTraits == null)
-    		variableTraits = new ArrayList<Name>();
-    	variableTraits.add(varName);
-    	variableTraits.add(varType);
-    }
-
-    @Override
-    public void addBindableVariableTrait(Name varName, Name varType, IDefinition def)
-    {
-    	String var = /*"_" + */varName.getBaseName();
-    	Name backingVar = new Name(new Namespace(JSSharedData.CONSTANT_PrivateNs), var);
-    	variableTraits.add(backingVar);
-    	variableTraits.add(varType);
-
-    	fragments.add("/**"
-    	    	 + NEWLINE +  " * @this {" + className + "}"
-    	    	 + NEWLINE +  " * @return {" + varType.getBaseName() + "}"
-    	    	 + NEWLINE +  " */"
-    	    	 + NEWLINE +  className + ".prototype.get_" + varName.getBaseName() + " = function()"
-    	    	 + NEWLINE +  "{"
-    	    	 + NEWLINE +  "    return this." + var + ";"
-    	    	 + NEWLINE +  "};");
-    	
-    	fragments.add("/**"
-   	    	 + NEWLINE +  " * @this {" + className + "}"
-   	    	 + NEWLINE +  " * @param {" + varType.getBaseName() + "} value"
-   	    	 + NEWLINE +  " */"
-   	    	 + NEWLINE +  className + ".prototype.set_" + varName.getBaseName() + " = function(value)"
-   	    	 + NEWLINE +  "{"
-   	    	 + NEWLINE +  "    if (value != this." + var + ")"
-   	    	 + NEWLINE +  "        this." + var + " = value;"
-   	    	 + NEWLINE +  "};");
-    }
-    
-    @Override
-    protected void processMXMLClassDefinition(IMXMLClassDefinitionNode node, Context context)
-    {
-        // Create the <Component> or <Definition> class.
-        MXMLClassDirectiveProcessor dp = new MXMLClassDirectiveProcessor(node, globalScope, emitter);
-        dp.processMainClassDefinitionNode(node);
-        dp.finishClassDefinition();
-    }
-    
-    @Override
-    void setDocument(IMXMLClassReferenceNode node, boolean conditionally, Context context)
-    {
-        if (node.isVisualElementContainer() || node.isContainer())
-        {
-        	currentList.add("document");
-        	currentList.add(true);
-        	currentList.addExplicit("this");
-        }	
-    }
-    
-    /**
-     * Adds the current set of childEvents, childStyles, and childProperties to currentList;
-     * @param context
-     * @param addCounters
-     * @param skipContentFactory
-     * @return
-     */
-    @Override
-    int setSpecifiers(Context context, Boolean addCounters, Boolean skipContentFactory)
-    {
-    	if (skipContentFactory)
-    		return 0;
-    	
-    	int numProperties = properties.size() / 3;
-    	if (context.hasBeads)
-    		numProperties++;
-    	if (context.hasModel)
-    		numProperties++;
-		currentList.add(numProperties);
-		if (context.hasModel)
-		{
-			currentList.add("model");
-			currentList.addObjectTypeMarker();
-			currentList.addExplicit("[" + model.toString() + "]");
-		}
-		currentList.addAll(properties);
-		if (context.hasBeads)
-		{
-			currentList.add("beads");
-			currentList.addExplicit(beads.toString());
-		}
-    	currentList.add(styles.size() / 3);
-    	currentList.addAll(styles);
-    	currentList.add(events.size() / 2);
-    	currentList.addAll(events);
-    	if (children.size() == 0)
-    		currentList.addNull();
-    	else
-    		currentList.addExplicit("[" + children.toString() + "]");
-    	return (properties.size() + styles.size() + events.size()) / 3;
-    }
-
-    @Override
-    void overrideMXMLDescriptorGetter(IMXMLClassDefinitionNode node, Context context)
-    {
-        // Leave a reference to the class on the stack.
-        ClassDefinition classDefinition =
-            (ClassDefinition)((IMXMLClassDefinitionNode)node).getClassDefinition();
-        String className = classDefinition.getQualifiedName();
-
-    	fragments.add("/**"
-    	 + NEWLINE +  " * @override"
-    	 + NEWLINE +  " * @this {" + className + "}"
-    	 + NEWLINE +  " * @return {Array} the Array of UI element descriptors."
-    	 + NEWLINE +  " */"
-    	 + NEWLINE +  className + ".prototype.get_MXMLDescriptor = function()"
-    	 + NEWLINE +  "{"
-    	 + NEWLINE +  "    if (this.mxmldd == undefined)"
-    	 + NEWLINE +  "    {"
-    	 + NEWLINE +  "         /** @type {Array} */"
-    	 + NEWLINE +  "         var arr = goog.base(this, 'get_MXMLDescriptor');"
-    	 + NEWLINE +  "         /** @type {Array} */"
-    	 + NEWLINE +  "         var data = " + addInstanceData()
-    	 + NEWLINE +  "         if (arr)"
-    	 + NEWLINE +  "             this.mxmldd = arr.concat(data);"
-    	 + NEWLINE +  "         else"
-    	 + NEWLINE +  "             this.mxmldd = data;"
-    	 + NEWLINE +  "    }"
-    	 + NEWLINE +  "    return this.mxmldd;"
-    	 + NEWLINE +  "};");
-    	 
-    }
-
-    private String addInstanceData()
-    {
-    	StringBuilder sb = new StringBuilder();
-    	sb.append("[" + NEWLINE);
-    	int n = children.size();
-    	for (int i = 0; i < n; i++)
-    	{
-    		String s = children.get(i);
-    		sb.append(s);
-    		if (i < n - 1)
-    			sb.append("," + NEWLINE);
-    		else
-    			sb.append(NEWLINE);
-    	}
-        sb.append("];" + NEWLINE);
-    	return sb.toString();
-    }
-
-    void overrideMXMLPropertiesGetter(IMXMLClassDefinitionNode node, Context context, int numElements)
-    {
-        // Leave a reference to the class on the stack.
-        ClassDefinition classDefinition =
-            (ClassDefinition)((IMXMLClassDefinitionNode)node).getClassDefinition();
-        String className = classDefinition.getQualifiedName();
-
-        fragments.add("/**"
-    	    	 + NEWLINE +  " * @override"
-    	    	 + NEWLINE +  " * @this {" + className + "}"
-    	    	 + NEWLINE +  " * @return {Array} the Array of UI element descriptors."
-    	    	 + NEWLINE +  " */"
-    	    	 + NEWLINE +  className + ".prototype.get_MXMLProperties = function()"
-    	    	 + NEWLINE +  "{"
-    	    	 + NEWLINE +  "    if (this.mxmldp == undefined)"
-    	    	 + NEWLINE +  "    {"
-    	    	 + NEWLINE +  "         /** @type {Array} */"
-    	    	 + NEWLINE +  "         var arr = goog.base(this, 'get_MXMLProperties');"
-    	    	 + NEWLINE +  "         /** @type {Array} */"
-    	    	 + NEWLINE +  "         var data = " + addPropertiesData(context)
-    	    	 + NEWLINE +  "         if (arr)"
-    	    	 + NEWLINE +  "             this.mxmldp = arr.concat(data);"
-    	    	 + NEWLINE +  "         else"
-    	    	 + NEWLINE +  "             this.mxmldp = data;"
-    	    	 + NEWLINE +  "    }"
-    	    	 + NEWLINE +  "    return this.mxmldp;"
-    	    	 + NEWLINE +  "};");
-    	    	 
-    }
-    
-    private String addPropertiesData(Context context)
-    {
-    	StringBuilder sb = new StringBuilder();
-    	sb.append("[" + NEWLINE);
-    	int n = properties.size();
-    	int numProperties = n / 3;
-    	if (context.hasModel)
-    		numProperties++;
-    	if (context.hasBeads)
-    		numProperties++;
-    	sb.append(new Integer(numProperties).toString() + ',' + NEWLINE);
-    	if (context.hasModel)
-    	{
-    		sb.append("'model'");
-    		sb.append("," + NEWLINE);
-    		sb.append(model.toString());
-    		sb.append("," + NEWLINE);
-    	}
-    	for (int i = 0; i < n; i++)
-    	{
-    		String s = properties.get(i);
-    		sb.append(s);
-    		sb.append("," + NEWLINE);
-    	}
-    	if (context.hasBeads)
-    	{
-    		sb.append("'beads'");
-    		sb.append("," + NEWLINE);
-    		sb.append(beads.toString());
-    		sb.append("," + NEWLINE);
-    	}
-    	n = styles.size();
-    	sb.append(new Integer(n / 3).toString() + ',' + NEWLINE);
-    	for (int i = 0; i < n; i++)
-    	{
-    		String s = styles.get(i);
-    		sb.append(s);
-    		sb.append("," + NEWLINE);
-    	}
-    	n = events.size();
-    	if (n == 0)
-        	sb.append("0" + NEWLINE);
-    	else
-    		sb.append(new Integer(n / 2).toString() + ',' + NEWLINE);
-    	for (int i = 0; i < n; i++)
-    	{
-    		String s = events.get(i);
-    		sb.append(s);
-    		if (i < n - 1)
-    			sb.append("," + NEWLINE);
-    		else
-    			sb.append(NEWLINE);
-    	}
-        sb.append("];" + NEWLINE);
-    	return sb.toString();
-    }
-
-    @Override
-    void processMXMLBoolean(IMXMLBooleanNode booleanNode, Context context)
-    {
-        if (booleanNode.getParent().getNodeID() == ASTNodeID.MXMLPropertySpecifierID)
-            currentList.addSimpleTypeMarker(); // simple type
-
-        boolean value = isDataBound(booleanNode) ? false : booleanNode.getValue();       
-        currentList.add(value);
-        traverse(booleanNode, context);
-    }
-    
-    @Override
-    void processMXMLInt(IMXMLIntNode intNode, Context context)
-    {
-        if (intNode.getParent().getNodeID() == ASTNodeID.MXMLPropertySpecifierID)
-            currentList.addSimpleTypeMarker(); // simple type
-
-        int value = isDataBound(intNode) ? 0 : intNode.getValue();
-        currentList.add(value);
-        traverse(intNode, context);
-     }
-    
-    @Override
-    void processMXMLUint(IMXMLUintNode uintNode, Context context)
-    {
-        if (uintNode.getParent().getNodeID() == ASTNodeID.MXMLPropertySpecifierID)
-            currentList.addSimpleTypeMarker(); // simple type
-
-        long value = isDataBound(uintNode) ? 0 : uintNode.getValue();
-        currentList.add(value);
-        traverse(uintNode, context);
-     }
-
-    @Override
-    void processMXMLNumber(IMXMLNumberNode numberNode, Context context)
-    {
-        if (numberNode.getParent().getNodeID() == ASTNodeID.MXMLPropertySpecifierID)
-            currentList.addSimpleTypeMarker(); // simple type
-
-        double value = isDataBound(numberNode) ? Double.NaN : numberNode.getValue();
-        currentList.add(value);
-        traverse(numberNode, context);
-    }
-    
-    @Override
-    void processMXMLString(IMXMLStringNode stringNode, Context context)
-    {
-        if (stringNode.getParent().getNodeID() == ASTNodeID.MXMLPropertySpecifierID)
-            currentList.addSimpleTypeMarker(); // simple type
-
-        String value = isDataBound(stringNode) ? null : stringNode.getValue();
-        if (value != null)
-            currentList.add(value);
-        else
-            currentList.addNull();
-        
-        traverse(stringNode, context);
-    }
-
-    @Override
-    void processMXMLClass(IMXMLClassNode classNode, Context context)
-    {        
-    	MXMLNotImplementedProblem problem = new MXMLNotImplementedProblem(classNode, "MXML Class");
-        getProblems().add(problem);
-        /*
-    	// Don't call skipCodegen() because a null Class is represented
-        // by the expression node being null.
-        if (isDataBindingNode(classNode))
-            return;
-        
-        IExpressionNode expressionNode = (IExpressionNode)classNode.getExpressionNode();
-        if (expressionNode != null)
-        {
-            InstructionList init_expression = classScope.getGenerator().generateInstructions(
-                expressionNode, CmcEmitter.__expression_NT, this.classScope);
-            context.addAll(init_expression);
-        }
-        else
-        {
-            context.addInstruction(OP_pushnull);
-        }
-        */
-    }
-
-    /**
-     * Generates an instruction in the current context
-     * to push the value of an {@code IMXMLFunctionNode}.
-     *
-     * Will also generate the function, if the FunctionNode specifies a function expression.
-     *
-     * If no expression is provided in the function node, this will push null
-     */
-    void processMXMLFunction(IMXMLFunctionNode functionNode, Context context)
-    {
-    	MXMLNotImplementedProblem problem = new MXMLNotImplementedProblem(functionNode, "MXML Function");
-        getProblems().add(problem);
-        /*
-        // Don't call skipCodegen() because a null Function is represented
-        // by the expression node being null.
-        if (isDataBindingNode(functionNode))
-            return;
-        
-        IExpressionNode expressionNode = (IExpressionNode)functionNode.getExpressionNode();
-        if (expressionNode != null)
-        {
-            InstructionList init_expression = classScope.getGenerator().generateInstructions(
-                expressionNode, CmcEmitter.__expression_NT, this.classScope);
-            context.addAll(init_expression);
-        }
-        else
-        {
-            context.addInstruction(OP_pushnull);
-        }
-        */
-    }
-
-    @Override
-    void processMXMLRegExp(IMXMLRegExpNode regexpNode, Context context)
-    {
-    	MXMLNotImplementedProblem problem = new MXMLNotImplementedProblem(regexpNode, "MXML RegExp");
-        getProblems().add(problem);
-        /*
-        // Don't call skipCodegen() because a parameterless RegExp is represented
-        // by the expression node being null.
-        if (isDataBindingNode(regexpNode))
-            return;
-        
-        IExpressionNode expressionNode = (IExpressionNode)regexpNode.getExpressionNode();
-        if (expressionNode != null )
-        {
-            InstructionList init_expression = classScope.getGenerator().generateInstructions(
-                expressionNode, CmcEmitter.__expression_NT, this.classScope);
-            context.addAll(init_expression);
-        }
-        else
-        {
-            context.addInstruction(OP_findpropstrict, ABCGeneratingReducer.regexType);
-            context.addInstruction(OP_constructprop, new Object[] {ABCGeneratingReducer.regexType, 0});
-        }
-        */
-    }
-
-    @Override
-    void processMXMLDesignLayer(IMXMLDesignLayerNode node, Context context)
-    {
-    	MXMLNotImplementedProblem problem = new MXMLNotImplementedProblem(node, "MXML DesignLayer");
-        getProblems().add(problem);
-    }
-    
-    @Override
-    void processMXMLWebServiceOperation(IMXMLWebServiceOperationNode node, Context context)
-    {
-    	MXMLNotImplementedProblem problem = new MXMLNotImplementedProblem(node, "MXML WebServices");
-        getProblems().add(problem);
-    }
-    
-    @Override
-    void processMXMLRemoteObjectMethod(IMXMLRemoteObjectMethodNode node, Context context)
-    {
-    	MXMLNotImplementedProblem problem = new MXMLNotImplementedProblem(node, "MXML Remote Object");
-        getProblems().add(problem);
-    }
-    
-    @Override
-    void processMXMLObject(IMXMLObjectNode objectNode, Context context)
-    {
-    	FragmentList savedCurrentList = currentList;
-    	currentList = new FragmentList();
-    	
-        traverse(objectNode, context);
-        
-        StringBuilder sb = new StringBuilder();
-        sb.append("{");
-        int n = currentList.size();
-        for (int i = 0; i < n; i++)
-        {
-        	String s = currentList.get(i++);
-        	sb.append(s + ":");
-        	sb.append(currentList.get(i));
-        	if (i < n - 1)
-        		sb.append(",");
-        }
-        sb.append("}");        
-        currentList = savedCurrentList;
-        currentList.addExplicit(sb.toString());
-    }
-    
-    @Override
-    void processMXMLArray(IMXMLArrayNode arrayNode, Context context)
-    {
-        boolean savedMakingArrayValues = context.makingArrayValues;
-        
-    	if (!inContentFactory)
-        {
-            if (context.parentContext.isStateDescriptor)
-                currentList.addArrayTypeMarker(); // array of descriptors
-            else
-            {
-                boolean isSimple = true;
-                
-                for (int i = 0; i < arrayNode.getChildCount(); i++)
-                {
-                    final IASNode child = arrayNode.getChild(i);
-                    ASTNodeID nodeID = child.getNodeID();
-                    if (nodeID == ASTNodeID.MXMLArrayID || nodeID == ASTNodeID.MXMLInstanceID)
-                    {
-                        isSimple = false;
-                        break;
-                    }
-                }
-                context.makingArrayValues = true;
-                if (isSimple)
-                    currentList.addSimpleTypeMarker(); // arrays are simple values      
-                else
-                	currentList.addArrayTypeMarker();
-            }
-        }
-
-    	FragmentList savedCurrentList = currentList;
-    	currentList = new FragmentList();
-
-    	traverse(arrayNode, context);
-        
-    	FragmentList childList = currentList;
-    	currentList = savedCurrentList;
-    	
-        // TODO: can we do better?
-        // Now that stack will have the array children on it.
-        // But we may not have created one for every child of arrayNode.
-        // It would be best if we could remember how many we created, but
-        // we can't easily do that. So we use our "knowledge" that children
-        // are always created unless they are state dependent instances.
-        int nMax = arrayNode.getChildCount();
-        int numStateDependentChildren=0;
-        for (int i=0; i<nMax; ++i)
-        {
-            IASNode ch = arrayNode.getChild(i);
-            if (isStateDependentInstance(ch))
-            {
-                ++numStateDependentChildren;
-            }
-        }
-        
-        if (inContentFactory)
-        {
-            // pass the number of things we found up to the parent context. In spark controls
-            // the array of children is buried by a layer or two
-            currentList.addAll(childList);
-        }
-        else if (context.parentContext.isStateDescriptor)
-        {
-            StringBuilder sb = new StringBuilder();
-            sb.append("[");
-            sb.append(childList.toString());
-            sb.append("]");        
-            currentList.addExplicit(sb.toString());     
-        }
-        else if (context.makingArrayValues)
-        {
-        	currentList.addAll(childList);
-        }
-        context.makingArrayValues = savedMakingArrayValues;
-    }
-    
-    @Override
-    void processMXMLVector(IMXMLVectorNode vectorNode, Context context)
-    {
-    	MXMLNotImplementedProblem problem = new MXMLNotImplementedProblem(vectorNode, "MXML Vector");
-        getProblems().add(problem);
-    }
-    
-    void processMXMLInstance(IMXMLInstanceNode instanceNode, Context context)
-    {       
-        FragmentList savedList = currentList;
-        FragmentList savedProperties = properties;
-        FragmentList savedStyles = styles;
-        FragmentList savedEvents = events;
-        FragmentList savedChildren = children;
-        FragmentList savedBeads = beads;
-        FragmentList savedModel = model;
-        boolean savedHasBeads = context.hasBeads;
-        boolean savedHasModel = context.hasModel;
-        
-        properties = new FragmentList();
-        styles = new FragmentList();
-        events = new FragmentList();
-        children = new FragmentList();
-        beads = new FragmentList();
-        model = new FragmentList();
-        context.hasBeads = false;
-        context.hasModel = false;
-        
-        if (!context.isStateDescriptor && !inContentFactory && !context.parentContext.makingArrayValues)
-            currentList.addObjectTypeMarker(); // complex type
-
-        traverse(instanceNode, context);        
-
-        int numElements = 0;
-
-        currentList = properties;
-        
-        setDocument(instanceNode, false, context);
-        
-        // Sets the id property if the instance
-        // implements IDeferredInstantiationUIComponent.
-        String id = instanceNode.getID();
-        if (id != null)
-        {
-            currentList.add("id");
-            currentList.addSimpleTypeMarker();
-            currentList.add(id);
-        }
-        else
-        {
-            id = instanceNode.getEffectiveID();
-            if (id != null)
-            {
-                currentList.add("_id");
-                currentList.addSimpleTypeMarker();
-                currentList.add(id);
-            }
-        }
-        // bail out now.  Other properties will be added in processMXMLState
-        if (context.isStateDescriptor)
-            return;
-        
-        
-        if (!inContentFactory)
-        	currentList = new FragmentList();
-        else
-        	currentList = savedList;
-        
-    	currentList.add(context.instanceClassName);
-        numElements += setSpecifiers(context, true, false);
-        
-        if (!inContentFactory)
-        {
-        	StringBuilder sb = new StringBuilder();
-        	sb.append("[");
-        	sb.append(currentList.toString());
-        	sb.append("]");
-            currentList = savedList;
-        	currentList.addExplicit(sb.toString());
-        }
-        
-        currentList = savedList;
-        properties = savedProperties;
-        styles = savedStyles;
-        events = savedEvents;
-        children = savedChildren;
-        beads = savedBeads;
-        model = savedModel;
-        context.hasBeads = savedHasBeads;
-        context.hasModel = savedHasModel;
-    }
-
-    @Override
-    void processMXMLFactory(IMXMLFactoryNode factoryNode, Context context)
-    {
-        // Get the Name for the mx.core.ClassFactory class.
-        ICompilerProject project = getProject();
-        ClassDefinition classReference = (ClassDefinition)factoryNode.getClassReference(project);
-        Name factoryClassName = classReference.getMName(project);
-        
-        // Push this class.
-        currentList.add(factoryClassName);
-        
-        // Push the class to be used as the generator,
-        // by traversing the child MXMLClassNode.
-        traverse(factoryNode, context);
-        
-        // Call new ClassFactory(generator), leaving the new instance on the stack.
-        currentList.addExplicit("new " + factoryClassName.toString());
-    }
-    
-    @Override
-    void processMXMLDeferredInstance(IMXMLDeferredInstanceNode deferredInstanceNode, Context context)
-    {
-        // Push the class or function to be used as the generator,
-        // by traversing the child MXMLClassNode or MXMLInstanceNode.
-        traverse(deferredInstanceNode, context);
-    }
-    
-    @Override
-    void processMXMLPropertySpecifier(IMXMLPropertySpecifierNode propertyNode, Context context)
-    {
-        // State-dependent nodes are handled by processMXMLState().
-        if (isStateDependent(propertyNode))
-            return;
-                
-        String propertyName = propertyNode.getName();
-        
-        if (propertyName.equals("mxmlContentFactory") || propertyName.equals("mxmlContent"))
-        {
-        	FragmentList savedList = currentList;
-            currentList = children;
-            inContentFactory = true;
-            
-            traverse(propertyNode, context);
-            
-            inContentFactory = false;
-            currentList = savedList;
-        }
-        else if (propertyName.equals("states"))
-        {
-            context.isStateDescriptor = true;
-            
-        	FragmentList savedList = currentList;
-            currentList = properties;
-            
-            currentList.add(propertyName);
-            
-            traverse(propertyNode, context);
-                            
-            currentList = savedList;
-        }
-        else if (propertyName.equals("model"))
-        {
-            context.hasModel = true;
-            
-        	FragmentList savedList = currentList;
-            currentList = model;
-            
-            traverse(propertyNode, context);
-                            
-            currentList = savedList;
-        }
-        else if (propertyName.equals("beads"))
-        {
-            context.hasBeads = true;
-            
-        	FragmentList savedList = currentList;
-            currentList = beads;
-            boolean savedInContentFactory = inContentFactory;
-            inContentFactory = false;
-            
-            traverse(propertyNode, context);
-            
-            inContentFactory = savedInContentFactory;
-            currentList = savedList;
-        }
-        else
-        {
-        	FragmentList savedList = currentList;
-            currentList = properties;
-
-        	currentList.add(propertyName);
-            
-            traverse(propertyNode, context);
-            
-            currentList = savedList;
-        }
-    }
-    
-    @Override
-    void processMXMLStyleSpecifier(IMXMLStyleSpecifierNode styleNode, Context context)
-    {        
-        // State-dependent nodes are handled by processMXMLState().
-        if (isStateDependent(styleNode))
-            return;
-        
-        // Data bound styles don't need this processing either
-        IMXMLInstanceNode value = styleNode.getInstanceNode();
-        if (isDataBindingNode(value))
-        {
-            return;
-        }
-        
-        // Style specifiers on the class definition node
-        // generate code in the moduleFactory setter.
-        if (styleNode.getParent() instanceof IMXMLClassDefinitionNode)
-        {
-        	FragmentList savedList = currentList;
-        	currentList = styles;
-        	
-            // Push the second argument: the value of the style.
-            // Do this by codegen'ing sole child, which is an IMXMLInstanceNode.
-            traverse(styleNode, context);
-
-            currentList = savedList;
-            
-        }
-        
-        else
-        {
-        	FragmentList savedList = currentList;
-        	currentList = styles;
-
-        	String styleName = styleNode.getName();
-            
-            // Push the first argument: the name of the style.
-            currentList.add(styleName);
-            
-            // Push the second argument: the value of the style.
-            // Do this by codegen'ing sole child, which is an IMXMLInstanceNode.
-            traverse(styleNode, context);
-            
-            currentList = savedList;
-        }
-    }
-    
-    @Override
-    void processMXMLEffectSpecifier(IMXMLEffectSpecifierNode effectNode, Context context)
-    {
-    	MXMLNotImplementedProblem problem = new MXMLNotImplementedProblem(effectNode, "MXML Effect");
-        getProblems().add(problem);
-    }
-    
-    @Override
-    void processMXMLEventSpecifier(IMXMLEventSpecifierNode eventNode, Context context)
-    {  
-        // Event nodes (including state-dependent ones)
-        // generate a new event handler method.
-        // Create a MethodInfo and a method trait for the handler.
-        Name name = getEventHandlerName(eventNode);
-        MethodInfo methodInfo = createEventHandlerMethodInfo(
-            getProject(), eventNode, name.getBaseName());
-        ITraitVisitor traitVisitor =
-            itraits.visitMethodTrait(TRAIT_Method, name, 0, methodInfo);
-        
-        // Use ABCGenerator to codegen the handler body from the
-        // ActionScript nodes that are the children of the event node.
-        classScope.getGenerator().generateMethodBodyForFunction(
-            methodInfo, eventNode, classScope, null);
-
-        // Otherwise, state-dependent nodes are handled by processMXMLState().
-        if (isStateDependent(eventNode))
-            return;
-        
-        String eventName = eventNode.getName();
-        Name eventHandler = getEventHandlerName(eventNode);
-
-    	FragmentList savedList = currentList;
-    	currentList = events;
-    	
-        currentList.add(eventName);
-        
-        currentList.addExplicit("this." + eventHandler.getBaseName());
-
-        currentList = savedList;
-    }
-    
-    @Override
-    void processMXMLResource(IMXMLResourceNode node, Context context)
-    {
-    	MXMLNotImplementedProblem problem = new MXMLNotImplementedProblem(node, "MXML Resources");
-        getProblems().add(problem);
-    }
-    
-    @Override
-    void processMXMLState(IMXMLStateNode stateNode, Context context)
-    {
-        int numElements = 1;
-        
-        context.isStateDescriptor = true;
-        
-        // First process the State node as an instance node,
-        // so that properties (name, stateGroups, basedOn) get set
-        // and event handlers (enterState, etc.) get set.
-        processMXMLInstance(stateNode, context);
-        
-        // Init the name property of the state (it's not a normal property specifier nodes
-        // TODO: should we make this a property node?
-        String name = stateNode.getStateName();
-        if (name != null)
-        {
-            currentList.add("name");
-            currentList.addSimpleTypeMarker();
-            currentList.add(name);
-        }
-        
-        // In MXML 2009 and later, a state's 'overrides' property is implicitly
-        // determined by the nodes that are dependent on this state.
-        // We use these nodes to autogenerate runtime IOverride objects
-        // and set them as the value of the 'overrides' property.
-        IMXMLClassDefinitionNode classDefinitionNode = stateNode.getClassDefinitionNode();
-        List<IMXMLNode> nodes = classDefinitionNode.getNodesDependentOnState(stateNode.getStateName());
-        if (nodes != null)
-        {
-            currentList.add("overrides");
-            currentList.addArrayTypeMarker();  // complex array
-           
-            // First step: process all instance overrides before any other overrides.
-            //  why: because a) ensure instances exists before trying to apply property overrides
-            //               b) because the old compiler did
-            // Do it in reverse order
-            //              a) because the way old compiler generated destination and relativeTo
-            //              properties relies on doing it backwards.
-            //
-            // Each one will generate code to push an IOverride instance.
-            for (int i=nodes.size()-1; i>=0; --i)
-            {
-                IMXMLNode node = nodes.get(i);
-                if (node.getNodeID() == ASTNodeID.MXMLInstanceID)
-                {
-                    processInstanceOverride((IMXMLInstanceNode)node, context);
-                }
-            }
-            // Next process the non-instance overrides dependent on this state.
-            // Each one will generate code to push an IOverride instance.
-            for (IMXMLNode node : nodes)
-            {
-                switch (node.getNodeID())
-                {
-                    case MXMLPropertySpecifierID:
-                    {
-                        processPropertyOverride((IMXMLPropertySpecifierNode)node, context);
-                        break;
-                    }
-                    case MXMLStyleSpecifierID:
-                    {
-                        processStyleOverride((IMXMLStyleSpecifierNode)node, context);
-                        break;
-                    }
-                    case MXMLEventSpecifierID:
-                    {
-                        processEventOverride((IMXMLEventSpecifierNode)node, context);
-                        break;
-                    }
-                }
-            }
-            
-            numElements += setSpecifiers(context, true, false);
-        }
-    }
-    
-    @Override
-    void processPropertyOrStyleOverride(Name overrideName, IMXMLPropertySpecifierNode propertyOrStyleNode, Context context)
-    {
-        IASNode parentNode = propertyOrStyleNode.getParent();
-        String id = parentNode instanceof IMXMLInstanceNode ?
-                    ((IMXMLInstanceNode)parentNode).getEffectiveID() :
-                    "";
-        
-        String name = propertyOrStyleNode.getName();        
-        
-        IMXMLInstanceNode propertyOrStyleValueNode = propertyOrStyleNode.getInstanceNode();
-        
-        // Construct the SetProperty or SetStyle object.
-        currentList.add(overrideName);
-        
-        currentList.add(3);
-        // Set its 'target' property to the id of the object
-        // whose property or style this override will set.
-        currentList.add("target");
-        currentList.addSimpleTypeMarker();
-        currentList.add(id);
-
-        // Set its 'name' property to the name of the property or style.
-        currentList.add("name");
-        currentList.addSimpleTypeMarker();
-        currentList.add(name);
-
-        // Set its 'value' property to the value of the property or style.
-        currentList.add("value");
-        processNode(propertyOrStyleValueNode, context); // push value
-
-        currentList.add(0); // styles
-        currentList.add(0); // effects
-        currentList.add(0); // events
-        currentList.addNull(); // children
-    }
-    
-    /**
-     * Generates instructions in the current context
-     * to create an instance of mx.states.SetEventHandler
-     * with its <code>target</code>, <code>name</code>,
-     * and <code>handlerFunction</code> properties set.
-     */
-    void processEventOverride(IMXMLEventSpecifierNode eventNode, Context context)
-    {
-        FlexProject project = getProject();
-        Name eventOverride = project.getEventOverrideClassName();
-        
-        IASNode parentNode = eventNode.getParent();
-        String id = parentNode instanceof IMXMLInstanceNode ?
-                    ((IMXMLInstanceNode)parentNode).getEffectiveID() :
-                    "";
-        
-        String name = eventNode.getName();
-        
-        Name eventHandler = getEventHandlerName(eventNode);
-
-        // Construct the SetEventHandler object.
-        currentList.add(eventOverride);
-        currentList.add(3);
-        
-        // Set its 'target' property to the id of the object
-        // whose event this override will set.
-        currentList.add(NAME_TARGET);
-        currentList.addSimpleTypeMarker();
-        currentList.add(id);
-
-        // Set its 'name' property to the name of the event.
-        currentList.add(NAME_NAME);
-        currentList.addSimpleTypeMarker();
-        currentList.add(name);
-
-        // Set its 'handlerFunction' property to the autogenerated event handler.
-        currentList.add(NAME_HANDLER_FUNCTION);
-        currentList.addSimpleTypeMarker();
-        currentList.add(eventHandler);
-    }
-    
-    /**
-     * Generates instructions in the current context
-     * to create an instance of mx.states.AddItems...
-     * 
-     * Assumes lookup table is still in local3
-     */
-
-    void processInstanceOverride(IMXMLInstanceNode instanceNode, Context context)
-    {
-        FlexProject project = getProject();
-        Name instanceOverrideName = project.getInstanceOverrideClassName();
-        
-        currentList.add(instanceOverrideName);
-
-        // Now set properties on it!
-        
-        //----------------------------------------------------------------------
-        // First property: set itemsFactory to the deferredInstanceFunction we created earlier
-        Integer index = nodeToIndexMap.get(instanceNode);
-        assert index != null;
-
-        FragmentList addItemsList = new FragmentList();
-        addItemsList.add("itemsDescriptor");
-        addItemsList.addSimpleTypeMarker();  // the value is an array of descriptor data that will be parsed later
-        FragmentList savedList = currentList;
-        currentList = new FragmentList();
-        InstructionList il = nodeToInstanceDescriptorMap.get(instanceNode);
-        addItemsList.addExplicit("[" + currentList.toString() + "]");
-        currentList = savedList;
-
-        //-----------------------------------------------------------------------------
-        // Second property set: maybe set destination and propertyName
-        
-        // get the property specifier node for the property the instanceNode represents
-        IMXMLPropertySpecifierNode propertySpecifier = (IMXMLPropertySpecifierNode) 
-            instanceNode.getAncestorOfType( IMXMLPropertySpecifierNode.class);
-    
-        if (propertySpecifier == null)
-        {
-           assert false;        // I think this indicates an invalid tree...
-        }
-        else
-        {
-            // Check the parent - if it's an instance then we want to use these
-            // nodes to get our property values from. If not, then it's the root
-            // and we don't need to specify destination
-            
-            IASNode parent = propertySpecifier.getParent();
-            if (parent instanceof IMXMLInstanceNode)
-            {
-               IMXMLInstanceNode parentInstance = (IMXMLInstanceNode)parent;
-               String parentId = parentInstance.getEffectiveID();
-               assert parentId != null;
-               String propName = propertySpecifier.getName();
-               
-               
-               addItemsList.add("destination");
-               addItemsList.addSimpleTypeMarker(); // simple type
-               addItemsList.add(parentId); 
-               addItemsList.add("propertyName");
-               addItemsList.addSimpleTypeMarker(); // simple type
-               addItemsList.add(propName); 
-            }
-        }  
-        
-        //---------------------------------------------------------------
-        // Third property set: position and relativeTo
-        String positionPropertyValue = null;
-        String relativeToPropertyValue = null;
-       
-        // look to see if we have any sibling nodes that are not state dependent
-        // that come BEFORE us
-        IASNode instanceParent = instanceNode.getParent();
-        IASNode prevStatelessSibling=null;
-        for (int i=0; i< instanceParent.getChildCount(); ++i)
-        {
-            IASNode sib = instanceParent.getChild(i);
-            assert sib instanceof IMXMLInstanceNode;    // surely our siblings are also instances?
-           
-            // stop looking for previous nodes when we find ourself
-            if (sib == instanceNode)
-                break;
-
-            if (!isStateDependent(sib))
-            {
-                prevStatelessSibling = sib;
-            }
-        }
-        
-        if (prevStatelessSibling == null) {
-            positionPropertyValue = "first";        // TODO: these should be named constants
-        }
-        else {
-            positionPropertyValue = "after";
-            relativeToPropertyValue = ((IMXMLInstanceNode)prevStatelessSibling).getEffectiveID();
-        }
-       
-        addItemsList.add("position");
-        addItemsList.addSimpleTypeMarker(); // simple type
-        addItemsList.add(positionPropertyValue); 
-        
-        // relativeTo
-        if (relativeToPropertyValue != null)
-        {
-        	addItemsList.add("relativeTo");
-            addItemsList.addSimpleTypeMarker(); // simple type
-        	addItemsList.add(relativeToPropertyValue); 
-        }
-        
-        currentList.add(addItemsList.size() / 3);
-        currentList.addAll(addItemsList);
-        currentList.add(0); // styles
-        currentList.add(0); // effects
-        currentList.add(0); // events
-        currentList.addNull(); // children
-    }
-    
-    void processMXMLComponent(IMXMLComponentNode node, Context context)
-    {
-        // Resolve the outer document, and if it doesn't resolve to the contingent
-        // definition, that means there is already an existing definition declared
-        // which is an error.
-        ClassDefinition componentClass = (ClassDefinition)node.getContainedClassDefinition();
-        ASScope classScope = componentClass.getContainedScope();
-        IDefinition outerDocument = classScope.getPropertyFromDef(
-            getProject(), componentClass, IMXMLLanguageConstants.PROPERTY_OUTER_DOCUMENT, false);
-        assert (outerDocument != null) : "outerDocument should never be null, as always added";
-        if (!outerDocument.isContingent())
-        {
-            ICompilerProblem problem = new MXMLOuterDocumentAlreadyDeclaredProblem(outerDocument);
-             getProblems().add(problem);
-        }
-
-        // Process the MXMLComponentNode as an MXMLFactoryNode, which it extends.
-        // This leaves a ClassFactory on the stack.
-        processMXMLFactory(node, context);
-        
-        // factory.properties = { outerDocument: this }
-        currentList.add(IMXMLTypeConstants.NAME_PROPERTIES);
-        currentList.addSimpleTypeMarker();
-        currentList.addExplicit("{" + IMXMLLanguageConstants.PROPERTY_OUTER_DOCUMENT + ": this}");
-    }
-    
-    void processMXMLEmbed(IMXMLEmbedNode node, Context context)
-    {
-    	MXMLNotImplementedProblem problem = new MXMLNotImplementedProblem(node, "MXML Embedding");
-        getProblems().add(problem);
-    }
-
-    void processMXMLXML(IMXMLXMLNode node, Context context)
-    {
-    	MXMLNotImplementedProblem problem = new MXMLNotImplementedProblem(node, "MXML XML");
-        getProblems().add(problem);
-    }
-    
-    void processMXMLXMLList(IMXMLXMLListNode node, Context context)
-    {
-    	MXMLNotImplementedProblem problem = new MXMLNotImplementedProblem(node, "MXML XMLList");
-        getProblems().add(problem);
-    }
-
-    /**
-     * Copied from JSClassDirectiveProcessor
-     * Declare a function. TODO: static vs. instance.
-     */
-    @Override
-    void declareFunction(FunctionNode func)
-    {
-        func.parseFunctionBody(classScope.getProblems());
-
-        boolean is_constructor = func.isConstructor();
-
-        functionSemanticChecks(func);
-
-        //  Save the constructor function until
-        //  we've seen all the instance variables
-        //  that might need initialization.
-        if (is_constructor)
-        {
-            this.ctorFunction = func;
-        }
-        else
-        {
-            MethodInfo mi = classScope.getGenerator().generateFunction(func, classScope, null);
-            ITraitVisitor tv;
-
-            if (mi != null)
-            {
-                FunctionDefinition funcDef = func.getDefinition();
-                Name funcName = funcDef.getMName(classScope.getProject());
-
-                if (func.hasModifier(ASModifier.STATIC))
-                    tv = ctraits.visitMethodTrait(functionTraitKind(func, TRAIT_Method), funcName, 0, mi);
-                else
-                {
-                    tv = itraits.visitMethodTrait(functionTraitKind(func, TRAIT_Method), funcName, 0, mi);
-                    if (funcDef.getNamespaceReference() instanceof NamespaceDefinition.IProtectedNamespaceDefinition)
-                        this.iinfo.flags |= ABCConstants.CLASS_FLAG_protected;
-                }
-
-                this.classScope.processMetadata(tv, funcDef.getAllMetaTags());
-
-                if (func.hasModifier(ASModifier.FINAL))
-                    tv.visitAttribute(Trait.TRAIT_FINAL, Boolean.TRUE);
-                if (func.hasModifier(ASModifier.OVERRIDE))
-                    tv.visitAttribute(Trait.TRAIT_OVERRIDE, Boolean.TRUE);
-            }
-        }
-    }
-
-    /**
-     * Copied from JSClassDirectiveProcessor
-     * Declare a variable. TODO: static vs. instance.
-     */
-    @Override
-    void declareVariable(VariableNode var)
-    {
-        verifyVariableModifiers(var);
-
-        DefinitionBase varDef = var.getDefinition();
-        JSGenerator jsGenerator = (JSGenerator)classScope.getGenerator();
-        jsGenerator.getReducer().startDeclareVariable(varDef);
-
-        boolean is_static = var.hasModifier(ASModifier.STATIC);
-        boolean is_const = SemanticUtils.isConst(var, classScope.getProject());
-        // simple initializers for public/protected vars go right on prototype.
-        // the rest (all private vars), all "complex" initializers (like array) get
-        // initialized in the constructor
-        boolean needs_constructor_init = true;
-        
-        //  generateConstantValue() returns null if no constant value
-        //  can be generated, and null is the correct value for "no value."
-        IConstantValue constantValue =  jsGenerator.generateConstantValue(var.getAssignedValueNode(), this.classScope.getProject());
-
-        //  initializer is null if no constant value
-        //  can be generated, and null is the correct value for "no value."
-        Object initializer = constantValue != null ? constantValue.getValue() : null;
-
-        ITraitVisitor tv = declareVariable(var, varDef, is_static, is_const, initializer);
-
-        this.classScope.processMetadata(tv, varDef.getAllMetaTags());
-
-        //  Generate variable initializers and append them to the 
-        //  proper initialization list.
-        if (var.getChildCount() > 1)
-        {
-            //  We need to put the correct traits visitor on the class'
-            //  LexicalScope; the BURM may encounter variable declarations
-            //  chained onto this one, and it will need the traits visitor to declare them.
-
-            //  Save the scope's current traits visitor (which should be null)
-            //  and restore it 
-            ITraitsVisitor saved_traits_visitor = this.classScope.traitsVisitor;
-            assert (saved_traits_visitor == null);
-            try
-            {
-                // the following line causes duplicate Traits.
-                // JSEmitter::emitTraits works around duplicate Traits by checking against
-                // a visitedTraits set.
-                this.classScope.traitsVisitor = (is_static) ? ctraits : itraits;
-                this.classScope.resetDebugInfo();
-                InstructionList init_expression = jsGenerator.generateInstructions(var, CmcJSEmitter.__statement_NT, this.classScope);
-                if (init_expression != null && !init_expression.isEmpty())
-                {
-                    // final JSEmitter emitter = (JSEmitter)this.classScope.getEmitter();
-                    final String str = JSGeneratingReducer.instructionListToString(init_expression, true);
-
-                    if (str.contains(" = "))
-                    {
-                        final String varInit = jsGenerator.getReducer().getVariableInitializer(varDef);
-                        if (varInit != null && !varInit.isEmpty())
-                        {
-                            // set the value of the slot trait.
-                            final String varName = varDef.getBaseName();
-                            for (Trait t : this.classScope.traitsVisitor.getTraits())
-                            {
-                                final byte kind = t.getKind();
-                                if (kind == TRAIT_Const || kind == TRAIT_Var)
-                                {
-                                	boolean is_private = false;
-                                    final Name name = t.getNameAttr(Trait.TRAIT_NAME);
-                                    Namespace ns = name.getSingleQualifier();
-                                    if (ns.getKind() == CONSTANT_PrivateNs)
-                                    	is_private = true;
-                                    if (name.getBaseName().equals(varName))
-                                    {
-                                        t.setAttr(Trait.SLOT_VALUE, varInit);
-                                        if (!is_private)
-                                        	needs_constructor_init = false;
-                                        break;
-                                    }
-                                }
-                            }
-
-                        }
-
-                        if (is_static)
-                        {
-                            // see finishClassDefinition.
-                            // We clear cinitInsns only if there are no side effects
-                            // by initializing the static members directly.
-                            // If varInit is null, or varInit is isEmpty() 
-                            // then we have side effects. 
-                            if (!init_expression.isEmpty())
-                                registerClassInit(var);
-
-                            cinitInsns.addAll(init_expression);
-                        }
-                        else if (needs_constructor_init)
-                            iinitInsns.addAll(init_expression);
-                    }
-                }
-            }
-            finally
-            {
-                this.classScope.traitsVisitor = saved_traits_visitor;
-            }
-        }
-
-        jsGenerator.getReducer().endDeclareVariable(varDef);
-    }
-    
-    private void registerClassInit(IASNode node)
-    {
-        final String fullName = JSGeneratingReducer.createFullNameFromDefinition(classScope.getProject(), classDefinition);
-        if (!fullName.equals(JSSharedData.JS_FRAMEWORK_NAME))
-        {
-            JSGenerator jsGenerator = (JSGenerator)classScope.getGenerator();
-            JSSharedData.instance.registerClassInit(fullName);
-            jsGenerator.getReducer().warnClassInitPerformance(node);
-            jsGenerator.getReducer().setNeedsSecondPass();
-        }
-    }
-
-    /**
-     * Determines the Name of the event handler method for an event node.
-     * This can get called to preassign the name before the method gets generated.
-     */
-    protected Name getEventHandlerName(IMXMLEventSpecifierNode eventNode)
-    {
-        // Check the map to see if a handler name
-        // has already been assigned to this event node.
-        Name name = eventHandlerMap.get(eventNode);
-        
-        // If so, return it.
-        if (name != null)
-            return name;
-        
-        // Otherwise, generate the next one in the sequence "$EH0", "$EH1", etc.
-        String baseName = EVENT_HANDLER_NAME_BASE + eventHandlerCounter++;
-        
-        name = new Name(baseName);
-        
-        // Remember it in the map.
-        eventHandlerMap.put(eventNode, name);
-        
-        return name;
-    }
-
-    static class FragmentList
-    {
-    	ArrayList<String> list = new ArrayList<String>();
-    	
-    	void add(boolean value)
-    	{
-    		if (value)	
-    			list.add("true");
-    		else
-    			list.add("false");
-    	}
-
-    	void add(int value)
-    	{
-    		list.add(new Integer(value).toString());
-    	}
-    	
-    	void add(long value)
-    	{
-    		list.add(new Long(value).toString());
-    	}
-    	
-    	void add(double value)
-    	{
-    		list.add(new Double(value).toString());
-    	}
-
-    	void add(Name name)
-    	{
-    		StringBuilder sb = new StringBuilder();
-    		String s = name.getSingleQualifier().getName();
-    		if (s.length() > 0)
-    		{
-        		sb.append(s);
-        		sb.append(".");    			
-    		}
-    		sb.append(name.getBaseName());
-    		list.add(sb.toString());
-    	}
-    	
-    	void add(String string)
-    	{
-    		list.add("'" + string + "'");
-    	}
-    	
-    	void addExplicit(String string)
-    	{
-    		list.add(string);
-    	}
-
-    	void addAll(FragmentList addlist)
-    	{
-    		list.addAll(addlist.list);
-    	}
-    	
-    	void addSimpleTypeMarker()
-    	{
-    		list.add("true");
-    	}
-    	
-    	void addObjectTypeMarker()
-    	{
-    		list.add("false");
-    	}
-    	
-    	void addArrayTypeMarker()
-    	{
-    		list.add("null");
-    	}
-    	
-    	void addNull()
-    	{
-    		list.add("null");
-    	}
-    	
-    	int size()
-    	{
-    		return list.size();
-    	}
-    	
-    	String get(int i)
-    	{
-    		return list.get(i);
-    	}
-
-    	public String toString()
-    	{
-    		StringBuilder sb = new StringBuilder();
-    		int n = list.size();
-    		for (int i = 0; i < n; i++)
-    		{
-    			sb.append(list.get(i));
-    			if (i < n - 1)
-    				sb.append(", ");
-    		}
-    		return sb.toString();
-    	}
-    	
-    }
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSMXMLEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSMXMLEmitter.java b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSMXMLEmitter.java
deleted file mode 100644
index 54e4cc8..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSMXMLEmitter.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.apache.flex.compiler.internal.as.codegen;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-
-import org.apache.flex.abc.semantics.InstanceInfo;
-import org.apache.flex.abc.semantics.MethodInfo;
-import org.apache.flex.abc.semantics.Name;
-import org.apache.flex.compiler.definitions.IClassDefinition;
-import org.apache.flex.compiler.definitions.IDefinition;
-import org.apache.flex.compiler.definitions.IPackageDefinition;
-import org.apache.flex.compiler.internal.as.codegen.JSEmitter.EmitterClassVisitor;
-import org.apache.flex.compiler.internal.definitions.ClassDefinition;
-import org.apache.flex.compiler.internal.projects.FlexJSProject;
-import org.apache.flex.compiler.internal.scopes.ASProjectScope;
-import org.apache.flex.compiler.projects.ICompilerProject;
-import org.apache.flex.compiler.scopes.IASScope;
-import org.apache.flex.compiler.units.ICompilationUnit;
-import org.apache.flex.compiler.units.ICompilationUnit.Operation;
-
-class JSMXMLEmitter extends JSEmitter
-{
-
-	public JSMXMLEmitter(JSSharedData sharedData, Operation buildPhase,
-			ICompilerProject project, JSGenerator generator) {
-		super(sharedData, buildPhase, project, generator);
-		// TODO Auto-generated constructor stub
-	}
-	
-	private JSMXMLClassDirectiveProcessor cdp;
-    private String NEWLINE = "\n";
-	
-	public void register(JSMXMLClassDirectiveProcessor cdp)
-	{
-		this.cdp = cdp;
-	}
-	
-	@Override
-	public byte[] emit()
-	{
-		try {
-			generateClass();
-		} catch (Exception e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		return w.toByteArray();
-	}
-	
-	private void generateClass() throws Exception
-	{
-		ClassDefinition definition = cdp.classDefinition;
-        IClassDefinition superClass = (ClassDefinition)definition.resolveBaseClass(cdp.getProject());
-        String classQName = definition.getQualifiedName();
-		writeString("goog.provide('" + classQName + "');" + NEWLINE);
-        writeString(NEWLINE);
-        /*
-		String[] list = definition.getImplicitImports();
-		ArrayList<String> imps = new ArrayList<String>(Arrays.asList(list));
-		imps.add(superClass.getQualifiedName());
-		Collections.sort(imps);
-        for (String imp : imps)
-        {
-            if (imp.indexOf("__AS3__") != -1)
-                continue;
-            writeString("goog.require('" + imp + "');");
-            writeString(NEWLINE);
-        }
-        writeString(NEWLINE);
-        */
-        FlexJSProject project = (FlexJSProject)m_project;
-        ASProjectScope projectScope = (ASProjectScope) m_project.getScope();
-        ICompilationUnit cu = projectScope.getCompilationUnitForDefinition(definition);
-        ArrayList<String> deps = project.getRequires(cu);
-        emitRequires(deps, classQName);
-
-        writeString("/**" + NEWLINE);
-        writeString(" * @constructor" + NEWLINE);
-        if (superClass != null)
-        	writeString(" * @extends {" + superClass.getQualifiedName() + "}" + NEWLINE);
-        writeString(" */" + NEWLINE);
-        writeString(definition.getQualifiedName() + " = function() {" + NEWLINE);
-        if (superClass != null)
-        	writeString("    " + superClass.getQualifiedName() + ".call(this);" + NEWLINE);
-        
-        for (int i = 0; i < cdp.variableTraits.size(); i += 2)
-        {
-            writeString(NEWLINE);
-        	Name name = cdp.variableTraits.get(i);
-        	Name type = cdp.variableTraits.get(i + 1);
-        	writeString("    /**" + NEWLINE);
-        	writeString("     * @private" + NEWLINE);
-        	writeString("     * @type {");
-        		String ns = type.getSingleQualifier().getName();
-        		if (ns.length() > 0)
-        		{
-        			writeString(ns);
-        			writeString(".");
-        		}
-        		writeString(type.getBaseName());
-        		writeString("}" + NEWLINE);
-        	writeString("     */" + NEWLINE);
-        	writeString("    this." + name.getBaseName() + ";");
-        	writeString(NEWLINE);
-        }
-        writeString("};" + NEWLINE);
-        
-        if (superClass != null)
-        {
-            writeString("goog.inherits(" + definition.getQualifiedName() + ", "
-                    + superClass.getQualifiedName() + ");" + NEWLINE);
-            writeString(NEWLINE);
-        }
-        
-        // write out instance traits for script block
-        for (EmitterClassVisitor clz : this.definedClasses)
-        {
-            InstanceInfo ii = clz.instanceInfo;
-
-            // Skipping classes that are "marked" as IExtern.
-            final Boolean isExtern = isExtern(ii);
-            if (isExtern)
-                return;
-
-            final Boolean isInterface = ii.isInterface();
-            final Boolean isPackageFunction = ii.name == null;
-
-            String packageName;
-            String className;
-            if (ii.name != null)
-            {
-                final IDefinition def = getDefinition(ii.name);
-                packageName = def.getPackageName();
-                className = JSGeneratingReducer.getBasenameFromName(ii.name);
-            }
-            else
-            {
-                packageName = m_packageName;
-                className = "";
-            }
-            // register class with super class
-            final IDefinition superClassDef = getDefinition(ii.superName);
-            final String superClassName = superClassDef == null ? "Object" : superClassDef.getQualifiedName();
-        	emitTraits(clz.instanceTraits, true, isExtern, isInterface, isPackageFunction, (MethodInfo)null, packageName, className, superClassName, "this.", "", ",", "\t");
-        }
-        writeString(NEWLINE);
-        writeString(NEWLINE);
-        
-		for (String s : cdp.fragments)
-		{
-			writeString(s);
-            writeString(NEWLINE);
-            writeString(NEWLINE);
-		}
-	}
-}
\ No newline at end of file


[28/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestClass.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestClass.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestClass.java
new file mode 100644
index 0000000..3787d45
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestClass.java
@@ -0,0 +1,234 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid ActionScript3 code for Class
+ * production.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestClass extends ASTestBase
+{
+    //--------------------------------------------------------------------------
+    // Class
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void testSimple()
+    {
+        IClassNode node = getClassNode("public class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A {\n}");
+    }
+
+    @Test
+    public void testSimpleInternal()
+    {
+        IClassNode node = getClassNode("internal class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("internal class A {\n}");
+    }
+
+    @Test
+    public void testSimpleFinal()
+    {
+        IClassNode node = getClassNode("public final class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("public final class A {\n}");
+    }
+
+    @Test
+    public void testSimpleDynamic()
+    {
+        IClassNode node = getClassNode("public dynamic class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("public dynamic class A {\n}");
+    }
+
+    @Test
+    public void testSimpleExtends()
+    {
+        IClassNode node = getClassNode("public class A extends B {}");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A extends B {\n}");
+    }
+
+    @Test
+    public void testSimpleImplements()
+    {
+        IClassNode node = getClassNode("public class A implements IA {}");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A implements IA {\n}");
+    }
+
+    @Test
+    public void testSimpleImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public class A implements IA, IB, IC {}");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A implements IA, IB, IC {\n}");
+    }
+
+    @Test
+    public void testSimpleExtendsImplements()
+    {
+        IClassNode node = getClassNode("public class A extends B implements IA {}");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A extends B implements IA {\n}");
+    }
+
+    @Test
+    public void testSimpleExtendsImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public class A extends B implements IA, IB, IC {}");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A extends B implements IA, IB, IC {\n}");
+    }
+
+    @Test
+    public void testSimpleFinalExtendsImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public final class A extends B implements IA, IB, IC {}");
+        asBlockWalker.visitClass(node);
+        assertOut("public final class A extends B implements IA, IB, IC {\n}");
+    }
+
+    @Test
+    public void testQualifiedExtendsImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public class A extends goo.B implements foo.bar.IA, goo.foo.IB, baz.boo.IC {}");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A extends goo.B implements foo.bar.IA, goo.foo.IB, baz.boo.IC {\n}");
+    }
+
+    @Test
+    public void testConstructor()
+    {
+        IClassNode node = getClassNode("public class A {public function A(){super('foo', 42);}}");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A {\n\tpublic function A() {\n\t\tsuper('foo', 42);\n\t}\n}");
+    }
+
+    @Test
+    public void testConstructor_withArguments()
+    {
+        IClassNode node = getClassNode("public class A {public function A(arg1:String, arg2:int) {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A {\n\tpublic function A(arg1:String, arg2:int) {\n\t}\n}");
+    }
+
+    @Test
+    public void testExtendsConstructor_withArguments()
+    {
+        IClassNode node = getClassNode("public class A extends B {public function A(arg1:String, arg2:int) {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A extends B {\n\tpublic function A(arg1:String, arg2:int) {\n\t}\n}");
+    }
+
+    @Test
+    public void testFields()
+    {
+        IClassNode node = getClassNode("public class A {public var a:Object;protected var b:String; "
+                + "private var c:int; internal var d:uint; var e:Number}");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A {\n\tpublic var a:Object;\n\tprotected var b:String;"
+                + "\n\tprivate var c:int;\n\tvar d:uint;\n\tvar e:Number;\n}");
+    }
+
+    @Test
+    public void testConstants()
+    {
+        IClassNode node = getClassNode("public class A {"
+                + "public static const A:int = 42;"
+                + "protected static const B:Number = 42;"
+                + "private static const C:Number = 42;"
+                + "foo_bar static const C:String = 'me' + 'you';");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A {\n\tpublic static const A:int = 42;\n\t"
+                + "protected static const B:Number = 42;\n\tprivate static const "
+                + "C:Number = 42;\n\tfoo_bar static const C:String = 'me' + 'you';\n}");
+    }
+
+    @Test
+    public void testAccessors()
+    {
+        IClassNode node = getClassNode("public class A {"
+                + "public function get foo1():Object{return null;}"
+                + "public function set foo1(value:Object):void{}"
+                + "protected function get foo2():Object{return null;}"
+                + "protected function set foo2(value:Object):void{}"
+                + "private function get foo3():Object{return null;}"
+                + "private function set foo3(value:Object):void{}"
+                + "internal function get foo5():Object{return null;}"
+                + "internal function set foo5(value:Object):void{}"
+                + "foo_bar function get foo6():Object{return null;}"
+                + "foo_bar function set foo6(value:Object):void{}" + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A {\n\tpublic function get foo1():Object {"
+                + "\n\t\treturn null;\n\t}\n\tpublic function set foo1(value:Object)"
+                + ":void {\n\t}\n\tprotected function get foo2():Object {\n\t\treturn "
+                + "null;\n\t}\n\tprotected function set foo2(value:Object):void "
+                + "{\n\t}\n\tprivate function get foo3():Object {\n\t\treturn null;"
+                + "\n\t}\n\tprivate function set foo3(value:Object):void {\n\t}\n\t"
+                + "function get foo5():Object {\n\t\treturn null;\n\t}\n\tfunction set "
+                + "foo5(value:Object):void {\n\t}\n\tfoo_bar function get foo6():Object "
+                + "{\n\t\treturn null;\n\t}\n\tfoo_bar function set "
+                + "foo6(value:Object):void {\n\t}\n}");
+    }
+
+    @Test
+    public void testMethods()
+    {
+        IClassNode node = getClassNode("public class A {"
+                + "public function foo1():Object{return null;}"
+                + "public final function foo1a():Object{return null;}"
+                + "override public function foo1b():Object{return super.foo1b();}"
+                + "protected function foo2(value:Object):void{}"
+                + "private function foo3(value:Object):void{}"
+                + "internal function foo5(value:Object):void{}"
+                + "foo_bar function foo6(value:Object):void{}"
+                + "public static function foo7(value:Object):void{}"
+                + "foo_bar static function foo7(value:Object):void{}" + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("public class A {\n\tpublic function foo1():Object {\n\t\treturn "
+                + "null;\n\t}\n\tpublic final function foo1a():Object {\n\t\treturn "
+                + "null;\n\t}\n\tpublic override function foo1b():Object {\n\t\treturn "
+                + "super.foo1b();\n\t}\n\tprotected function foo2(value:Object):void "
+                + "{\n\t}\n\tprivate function foo3(value:Object):void {\n\t}\n\tfunction "
+                + "foo5(value:Object):void {\n\t}\n\tfoo_bar function foo6(value:Object"
+                + "):void {\n\t}\n\tpublic static function foo7(value:Object):void {\n\t}"
+                + "\n\tfoo_bar static function foo7(value:Object):void {\n\t}\n}");
+    }
+
+    protected IClassNode getClassNode(String code)
+    {
+        String source = "package {" + code + "}";
+        IFileNode node = compileAS(source);
+        IClassNode child = (IClassNode) findFirstDescendantOfType(node,
+                IClassNode.class);
+        return child;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestComments.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestComments.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestComments.java
new file mode 100644
index 0000000..bb38475
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestComments.java
@@ -0,0 +1,73 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestComments extends ASTestBase
+{
+    // (mschmalle) comments aren't preserved, no need for them in release 
+    //             output...
+
+    @Test
+    public void testComment_SingleLine()
+    {
+//        IFunctionNode node = getMethod("function a():void {// single line comment};");
+//        visitor.visitFunction(node);
+//        assertOut("function a():void {\n\t// single line comment\n}");
+    }
+
+    @Test
+    public void testComment_SingleLine_After()
+    {
+//        IFunctionNode node = getMethod("function a():void {var a:String = ''; // single line comment};");
+//        visitor.visitFunction(node);
+//        assertOut("function a():void {\n\tvar a:String = ''; // single line comment\n}");
+    }
+
+    @Test
+    public void testComment_MultiLine()
+    {
+//        IFunctionNode node = getMethod("function a():void {/*first line comment\nsecond line comment*/};");
+//        visitor.visitFunction(node);
+//        assertOut("function a():void {\n\t/*first line comment\n\tsecond line comment*/\n}");
+    }
+
+    @Test
+    public void testComment_InLine()
+    {
+//        IFunctionNode node = getMethod("function a():void {var a:String /* inline comment */ = 'Hello world';};");
+//        visitor.visitFunction(node);
+//        assertOut("function a():void {\n\tvar a:String /* inline comment */ = 'Hello world';\n}");
+    }
+
+    @Test
+    public void testComment_ASDoc()
+    {
+//        IFunctionNode node = getMethod("function a():void {/**\n * line comment\n */};");
+//        visitor.visitFunction(node);
+//        assertOut("function a():void {\n\t/**\n\t * line comment\n\t */};");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestExpressions.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestExpressions.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestExpressions.java
new file mode 100644
index 0000000..ab7d66f
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestExpressions.java
@@ -0,0 +1,764 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.internal.tree.as.ArrayLiteralNode;
+import org.apache.flex.compiler.internal.tree.as.ObjectLiteralNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IIterationFlowNode;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.INamespaceAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.IReturnNode;
+import org.apache.flex.compiler.tree.as.ITernaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * @author Michael Schmalle
+ */
+public class TestExpressions extends ASTestBase
+{
+
+    @Test
+    public void testVisitLanguageIdentifierNode_This()
+    {
+        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getNode(
+                "if (a) this.a;", IMemberAccessExpressionNode.class);
+        asBlockWalker.visitMemberAccessExpression(node);
+        assertOut("this.a");
+    }
+
+    @Test
+    public void testVisitLanguageIdentifierNode_SuperMember()
+    {
+        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getNode(
+                "if (a) super.foo;", IMemberAccessExpressionNode.class);
+        asBlockWalker.visitMemberAccessExpression(node);
+        assertOut("super.foo");
+    }
+
+    @Test
+    public void testVisitLanguageIdentifierNode_SuperMethod_1()
+    {
+        // NOTE: This is here as an example that a method call to super
+        // is always held within a IFunctionCallNode, here it's a plain member access
+        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getNode(
+                "if (a) super.foo();", IMemberAccessExpressionNode.class);
+        asBlockWalker.visitMemberAccessExpression(node);
+        assertOut("super.foo");
+    }
+
+    @Test
+    public void testVisitLanguageIdentifierNode_SuperMethod_2()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode(
+                "if (a) super.foo(a, b, c);", IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("super.foo(a, b, c)");
+    }
+
+    @Test
+    public void testVisitLanguageIdentifierNode_This1()
+    {
+        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getNode(
+                "if (a) this.a;", IMemberAccessExpressionNode.class);
+
+        asBlockWalker.visitMemberAccessExpression(node);
+        assertOut("this.a");
+    }
+
+    @Test
+    public void testVisitLanguageIdentifierNode_This2()
+    {
+        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getNode(
+                "if (a) this.a;", IMemberAccessExpressionNode.class);
+
+        asBlockWalker.visitMemberAccessExpression(node);
+        assertOut("this.a");
+    }
+
+    //----------------------------------
+    // Primary expression keywords
+    //----------------------------------
+
+    //----------------------------------
+    // Arithmetic
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_Plus()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a + b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a + b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_Minus()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a - b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a - b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_Divide()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a / b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a / b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_Modulo()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a % b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a % b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_Multiply()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a * b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a * b");
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_PostIncrement()
+    {
+        IUnaryOperatorNode node = getUnaryNode("a++");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("a++");
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_PreIncrement()
+    {
+        IUnaryOperatorNode node = getUnaryNode("++a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("++a");
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_PostDecrement()
+    {
+        IUnaryOperatorNode node = getUnaryNode("a--");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("a--");
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_PreDecrement()
+    {
+        IUnaryOperatorNode node = getUnaryNode("--a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("--a");
+    }
+
+    //----------------------------------
+    // Arithmetic compound assignment
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_PlusAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a += b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a += b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_MinusAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a -= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a -= b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_DivideAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a /= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a /= b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_ModuloAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a %= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a %= b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_MultiplyAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a *= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a *= b");
+    }
+
+    //----------------------------------
+    // Assignment
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_Assignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a = b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a = b");
+    }
+
+    //----------------------------------
+    // Bitwise
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseAnd()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a & b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a & b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseLeftShift()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a << b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a << b");
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_BitwiseNot()
+    {
+        IUnaryOperatorNode node = getUnaryNode("~a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("~a");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseOr()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a | b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a | b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseRightShift()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a >> b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a >> b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseUnsignedRightShift()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a >>> b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a >>> b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseXOR()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a ^ b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a ^ b");
+    }
+
+    //----------------------------------
+    // Bitwise compound assignment
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseAndAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a &= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a &= b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseLeftShiftAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a <<= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a <<= b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseOrAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a |= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a |= b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseRightShiftAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a >>= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a >>= b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseUnsignedRightShiftAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a >>>= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a >>>= b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseXORAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a ^= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a ^= b");
+    }
+
+    //----------------------------------
+    // Comparison
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_Equal()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a == b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a == b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_GreaterThan()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a > b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a > b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_GreaterThanEqual()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a >= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a >= b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_NotEqual()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a != b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a != b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_LessThan()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a < b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a < b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_LessThanEqual()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a <= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a <= b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_StrictEqual()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a === b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a === b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_StrictNotEqual()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a !== b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a !== b");
+    }
+
+    //----------------------------------
+    // Logical
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_LogicalAnd()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a && b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a && b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_LogicalAndAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a &&= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a &&= b");
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_LogicalNot()
+    {
+        IUnaryOperatorNode node = getUnaryNode("!a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("!a");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_LogicalOr()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a || b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a || b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_LogicalOrAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a ||= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a ||= b");
+    }
+
+    //----------------------------------
+    // Other
+    //----------------------------------
+
+    @Test
+    public void testParentheses_1()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a = (a + b);",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:* = (a + b)");
+    }
+
+    @Test
+    public void testParentheses_2()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a = (a + b) - c;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:* = (a + b) - c");
+    }
+
+    @Test
+    public void testParentheses_3()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "var a = ((a + b) - (c + d)) * e;", IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:* = ((a + b) - (c + d)) * e");
+    }
+
+    @Test
+    public void testAnonymousFunction()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a = function(){};",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:* = function() {\n}");
+    }
+
+    @Test
+    public void testAnonymousFunctionWithParamsReturn()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "var a:Object = function(foo:int, bar:String = 'goo'):int{return -1;};",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Object = function(foo:int, bar:String = 'goo'):int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testAnonymousFunctionAsArgument()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode(
+                "addListener('foo', function(event:Object):void{doit();});",
+                IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("addListener('foo', function(event:Object):void {\n\tdoit();\n})");
+    }
+
+    @Test
+    public void testVisitDynamicAccessNode_1()
+    {
+        IDynamicAccessNode node = getDynamicAccessNode("a[b]");
+        asBlockWalker.visitDynamicAccess(node);
+        assertOut("a[b]");
+    }
+
+    @Test
+    public void testVisitDynamicAccessNode_2()
+    {
+        IDynamicAccessNode node = getDynamicAccessNode("a[b[c][d]]");
+        asBlockWalker.visitDynamicAccess(node);
+        assertOut("a[b[c][d]]");
+    }
+
+    @Test
+    public void testVisitAs()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a as b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a as b");
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_Comma()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a, b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a, b");
+    }
+
+    @Test
+    public void testVisitTernaryOperatorNode()
+    {
+        ITernaryOperatorNode node = (ITernaryOperatorNode) getExpressionNode(
+                "a ? b : c", ITernaryOperatorNode.class);
+        asBlockWalker.visitTernaryOperator(node);
+        assertOut("a ? b : c");
+    }
+
+    @Test
+    public void testVisitUnaryOperator_Delete()
+    {
+        IUnaryOperatorNode node = getUnaryNode("delete a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("delete a");
+    }
+
+    @Test
+    public void testVisitMemberAccess_1()
+    {
+        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getExpressionNode(
+                "a.b", IMemberAccessExpressionNode.class);
+        asBlockWalker.visitMemberAccessExpression(node);
+        assertOut("a.b");
+    }
+
+    @Test
+    public void testVisitMemberAccess_2()
+    {
+        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getExpressionNode(
+                "a.b.c.d", IMemberAccessExpressionNode.class);
+        asBlockWalker.visitMemberAccessExpression(node);
+        assertOut("a.b.c.d");
+    }
+
+    @Test
+    public void testVisitBinaryOperator_In()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a in b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a in b");
+    }
+
+    @Test
+    public void testVisitBinaryOperator_Instancof()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a instanceof b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a instanceof b");
+    }
+
+    @Test
+    public void testVisitBinaryOperator_Is()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a is b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a is b");
+    }
+
+    @Test
+    public void testVisitBinaryOperator_NamespaceAccess_1()
+    {
+        INamespaceAccessExpressionNode node = getNamespaceAccessExpressionNode("a::b");
+        asBlockWalker.visitNamespaceAccessExpression(node);
+        assertOut("a::b");
+    }
+
+    @Test
+    public void testVisitBinaryOperator_NamespaceAccess_2()
+    {
+        INamespaceAccessExpressionNode node = getNamespaceAccessExpressionNode("a::b::c");
+        asBlockWalker.visitNamespaceAccessExpression(node);
+        assertOut("a::b::c");
+    }
+
+    @Test
+    public void testVisitBinaryOperator_New()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getExpressionNode(
+                "new Object()", IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("new Object()");
+    }
+
+    @Test
+    public void testVisitObjectLiteral_1()
+    {
+        ObjectLiteralNode node = (ObjectLiteralNode) getExpressionNode(
+                "a = {a:1}", ObjectLiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        assertOut("{a:1}");
+    }
+
+    @Test
+    public void testVisitObjectLiteral_2()
+    {
+        ObjectLiteralNode node = (ObjectLiteralNode) getExpressionNode(
+                "a = {a:1,b:{c:2,d:{e:4}}}", ObjectLiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        assertOut("{a:1, b:{c:2, d:{e:4}}}");
+    }
+
+    @Test
+    public void testVisitArrayLiteral_1()
+    {
+        ArrayLiteralNode node = (ArrayLiteralNode) getExpressionNode(
+                "a = [0,1,2]", ArrayLiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        assertOut("[0, 1, 2]");
+    }
+
+    @Test
+    public void testVisitArrayLiteral_2()
+    {
+        ArrayLiteralNode node = (ArrayLiteralNode) getExpressionNode(
+                "a = [0,[0,1,[0,1]],2,[1,2]]", ArrayLiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        assertOut("[0, [0, 1, [0, 1]], 2, [1, 2]]");
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_Typeof()
+    {
+        IUnaryOperatorNode node = getUnaryNode("typeof(a)");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("typeof(a)");
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_Typeof_NoParens()
+    {
+        // TODO (mschmalle) the notation without parenthesis is also valid in AS/JS
+        IUnaryOperatorNode node = getUnaryNode("typeof a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("typeof(a)");
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_Void()
+    {
+        IUnaryOperatorNode node = getUnaryNode("void a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("void a");
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_Concate_1()
+    {
+        IBinaryOperatorNode node = getBinaryNode("\"a\" + \"b\"");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("\"a\" + \"b\"");
+    }
+
+    // TODO (mschmalle) what's up with the escaping of backslashes?
+    @Test
+    public void testVisitUnaryOperatorNode_Concate_2()
+    {
+//        IBinaryOperatorNode node = getBinaryNode("\"a\\\"\" + \"\\\"b\"");
+//        asBlockWalker.visitBinaryOperator(node);
+//        assertOut("\"a\\\"\" + \"\\\"b\"");
+    }
+
+    @Test
+    public void testVisitIterationFlowNode_Break()
+    {
+        IIterationFlowNode node = (IIterationFlowNode) getNode("break",
+                IIterationFlowNode.class);
+        asBlockWalker.visitIterationFlow(node);
+        assertOut("break");
+    }
+
+    @Test
+    public void testVisitIterationFlowNode_Continue()
+    {
+        IIterationFlowNode node = (IIterationFlowNode) getNode("continue",
+                IIterationFlowNode.class);
+        asBlockWalker.visitIterationFlow(node);
+        assertOut("continue");
+    }
+
+    @Test
+    public void testVisitReturn()
+    {
+        IReturnNode node = (IReturnNode) getNode("return", IReturnNode.class);
+        asBlockWalker.visitReturn(node);
+        assertOut("return");
+    }
+
+    @Test
+    public void testVisitFunctionCall_1()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode("a()", IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("a()");
+    }
+
+    @Test
+    public void testVisitFunctionCall_2()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode("a(b)", IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("a(b)");
+    }
+
+    @Test
+    public void testVisitFunctionCall_3()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode("a(b, c)", IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("a(b, c)");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestFieldMembers.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestFieldMembers.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestFieldMembers.java
new file mode 100644
index 0000000..0de9f0e
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestFieldMembers.java
@@ -0,0 +1,204 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.INamespaceNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid ActionScript3 code for Class Field
+ * members.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestFieldMembers extends ASTestBase
+{
+    /*
+     * Field, Constant, [Namespace]
+     * 
+     * var foo;
+     * var foo:int;
+     * var foo:int = 42;
+     * private var foo:int;
+     * private var foo:int = 42;
+     * protected var foo:int;
+     * public var foo:int;
+     */
+
+    //--------------------------------------------------------------------------
+    // Field
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void testField()
+    {
+        IVariableNode node = getField("var foo;");
+        asBlockWalker.visitVariable(node);
+        assertOut("var foo:*");
+    }
+
+    @Test
+    public void testField_withType()
+    {
+        IVariableNode node = getField("var foo:int;");
+        asBlockWalker.visitVariable(node);
+        assertOut("var foo:int");
+    }
+
+    @Test
+    public void testField_withTypeValue()
+    {
+        IVariableNode node = getField("var foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("var foo:int = 420");
+    }
+
+    @Test
+    public void testField_withNamespaceTypeValue()
+    {
+        IVariableNode node = getField("private var foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("private var foo:int = 420");
+    }
+
+    @Test
+    public void testField_withCustomNamespaceTypeValue()
+    {
+        IVariableNode node = getField("mx_internal var foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("mx_internal var foo:int = 420");
+    }
+
+    @Test
+    public void testField_withNamespaceTypeCollection()
+    {
+        IVariableNode node = getField("protected var foo:Vector.<Foo>;");
+        asBlockWalker.visitVariable(node);
+        assertOut("protected var foo:Vector.<Foo>");
+    }
+
+    @Test
+    public void testField_withNamespaceTypeCollectionComplex()
+    {
+        IVariableNode node = getField("protected var foo:Vector.<Vector.<Vector.<Foo>>>;");
+        asBlockWalker.visitVariable(node);
+        assertOut("protected var foo:Vector.<Vector.<Vector.<Foo>>>");
+    }
+
+    @Test
+    public void testField_withNamespaceTypeValueComplex()
+    {
+        IVariableNode node = getField("protected var foo:Foo = new Foo('bar', 42);");
+        asBlockWalker.visitVariable(node);
+        assertOut("protected var foo:Foo = new Foo('bar', 42)");
+    }
+
+    @Test
+    public void testField_withList()
+    {
+        IVariableNode node = getField("protected var a:int = 4, b:int = 11, c:int = 42;");
+        asBlockWalker.visitVariable(node);
+        assertOut("protected var a:int = 4, b:int = 11, c:int = 42");
+    }
+
+    //--------------------------------------------------------------------------
+    // Constant
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void testConstant()
+    {
+        IVariableNode node = getField("static const foo;");
+        asBlockWalker.visitVariable(node);
+        assertOut("static const foo:*");
+    }
+
+    @Test
+    public void testConstant_withType()
+    {
+        IVariableNode node = getField("static const foo:int;");
+        asBlockWalker.visitVariable(node);
+        assertOut("static const foo:int");
+    }
+
+    @Test
+    public void testConstant_withTypeValue()
+    {
+        IVariableNode node = getField("static const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("static const foo:int = 420");
+    }
+
+    @Test
+    public void testConstant_withNamespaceTypeValue()
+    {
+        IVariableNode node = getField("private static const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("private static const foo:int = 420");
+    }
+
+    @Test
+    public void testConstant_withCustomNamespaceTypeValue()
+    {
+        IVariableNode node = getField("mx_internal static const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("mx_internal static const foo:int = 420");
+    }
+
+    //--------------------------------------------------------------------------
+    // Namespace
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void testNamespace()
+    {
+        INamespaceNode node = getNamespace("namespace ns = \"http://whatever\";");
+        asBlockWalker.visitNamespace(node);
+        assertOut("namespace ns = \"http://whatever\"");
+    }
+
+    @Test
+    public void testNamespace_public()
+    {
+        INamespaceNode node = getNamespace("public namespace ns = \"http://whatever\";");
+        asBlockWalker.visitNamespace(node);
+        assertOut("public namespace ns = \"http://whatever\"");
+    }
+
+    @Test
+    public void testNamespace_protected()
+    {
+        INamespaceNode node = getNamespace("protected namespace ns = \"http://whatever\";");
+        asBlockWalker.visitNamespace(node);
+        assertOut("protected namespace ns = \"http://whatever\"");
+    }
+
+    protected INamespaceNode getNamespace(String code)
+    {
+        String source = "package {public class A {" + code + "}}";
+        IFileNode node = compileAS(source);
+        INamespaceNode child = (INamespaceNode) findFirstDescendantOfType(node,
+                INamespaceNode.class);
+        return child;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestGlobalClasses.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestGlobalClasses.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestGlobalClasses.java
new file mode 100644
index 0000000..6f5797f
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestGlobalClasses.java
@@ -0,0 +1,280 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestGlobalClasses extends ASTestBase
+{
+    @Test
+    public void testArgumentError()
+    {
+        IVariableNode node = getVariable("var a:ArgumentError = new ArgumentError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:ArgumentError = new ArgumentError()");
+    }
+
+    @Test
+    public void testArguments()
+    {
+        IFunctionNode node = getMethod("function a():void {\ttrace(arguments);}");
+        asBlockWalker.visitFunction(node);
+        assertOut("function a():void {\n\ttrace(arguments);\n}");
+    }
+
+    @Test
+    public void testArray()
+    {
+        IVariableNode node = getVariable("var a:Array = new Array(1);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Array = new Array(1)");
+    }
+
+    @Test
+    public void testBoolean()
+    {
+        IVariableNode node = getVariable("var a:Boolean = new Boolean(1);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Boolean = new Boolean(1)");
+    }
+
+    @Test
+    public void testClass()
+    {
+        IVariableNode node = getVariable("var a:Class = Class(FooBar)");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Class = Class(FooBar)");
+    }
+
+    @Test
+    public void testDate()
+    {
+        IVariableNode node = getVariable("var a:Date = new Date();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Date = new Date()");
+    }
+
+    @Test
+    public void testDefinitionError()
+    {
+        IVariableNode node = getVariable("var a:DefinitionError = new DefinitionError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:DefinitionError = new DefinitionError()");
+    }
+
+    @Test
+    public void testError()
+    {
+        IVariableNode node = getVariable("var a:Error = new Error();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Error = new Error()");
+    }
+
+    @Test
+    public void testEvalError()
+    {
+        IVariableNode node = getVariable("var a:EvalError = new EvalError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:EvalError = new EvalError()");
+    }
+
+    @Test
+    public void testFunction()
+    {
+        IVariableNode node = getVariable("var a:Function = new Function();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Function = new Function()");
+    }
+
+    @Test
+    public void testInt()
+    {
+        IVariableNode node = getVariable("var a:int = new int(1.8);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:int = new int(1.8)");
+    }
+
+    @Test
+    public void testJSON()
+    {
+        IVariableNode node = getVariable("var a:JSON = new JSON();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:JSON = new JSON()");
+    }
+
+    @Test
+    public void testMath()
+    {
+        IVariableNode node = getVariable("var a:Number = Math.PI;");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Number = Math.PI");
+    }
+
+    @Test
+    public void testNamespace()
+    {
+        IVariableNode node = getVariable("var a:Namespace = new Namespace(\"http://example.com\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Namespace = new Namespace(\"http://example.com\")");
+    }
+
+    @Test
+    public void testNumber()
+    {
+        IVariableNode node = getVariable("var a:Number = new Number(\"1\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Number = new Number(\"1\")");
+    }
+
+    @Test
+    public void testObject()
+    {
+        IVariableNode node = getVariable("var a:Object = new Object();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Object = new Object()");
+    }
+
+    @Test
+    public void testQName()
+    {
+        IVariableNode node = getVariable("var a:QName = new QName();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:QName = new QName()");
+    }
+
+    @Test
+    public void testRangeError()
+    {
+        IVariableNode node = getVariable("var a:RangeError = new RangeError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:RangeError = new RangeError()");
+    }
+
+    @Test
+    public void testReferenceError()
+    {
+        IVariableNode node = getVariable("var a:ReferenceError = new ReferenceError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:ReferenceError = new ReferenceError()");
+    }
+
+    // TODO (mschmalle) the backslashes in don't match the backslashes out...
+    @Test
+    public void testRegExp()
+    {
+//        IVariableNode node = getVariable("var a:RegExp = new RegExp('test-\\d', 'i');");
+//        asBlockWalker.visitVariable(node);
+//        assertOut("var a:RegExp = new RegExp('test-\\\\d', 'i')");
+    }
+
+    @Test
+    public void testRegExp_Literal()
+    {
+        IVariableNode node = getVariable("var a:RegExp = /test-\\d/i;");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:RegExp = /test-\\d/i");
+    }
+
+    @Test
+    public void testSecurityError()
+    {
+        IVariableNode node = getVariable("var a:SecurityError = new SecurityError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:SecurityError = new SecurityError()");
+    }
+
+    @Test
+    public void testString()
+    {
+        IVariableNode node = getVariable("var a:String = new String(\"100\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:String = new String(\"100\")");
+    }
+
+    @Test
+    public void testSyntaxError()
+    {
+        IVariableNode node = getVariable("var a:SyntaxError = new SyntaxError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:SyntaxError = new SyntaxError()");
+    }
+
+    @Test
+    public void testTypeError()
+    {
+        IVariableNode node = getVariable("var a:TypeError = new TypeError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:TypeError = new TypeError()");
+    }
+
+    @Test
+    public void testUint()
+    {
+        IVariableNode node = getVariable("var a:uint = new uint(-100);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:uint = new uint(-100)");
+    }
+
+    @Test
+    public void testURIError()
+    {
+        IVariableNode node = getVariable("var a:URIError = new URIError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:URIError = new URIError()");
+    }
+
+    @Test
+    public void testVector()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = new Vector.<String>(['Hello', 'World']);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Vector.<String> = new Vector.<String>(['Hello', 'World'])");
+    }
+
+    @Test
+    public void testVerifyError()
+    {
+        IVariableNode node = getVariable("var a:VerifyError = new VerifyError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:VerifyError = new VerifyError()");
+    }
+
+    @Test
+    public void testXML()
+    {
+        IVariableNode node = getVariable("var a:XML = new XML('@');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:XML = new XML('@')");
+    }
+
+    @Test
+    public void testXMLList()
+    {
+        IVariableNode node = getVariable("var a:XMLList = new XMLList('<!-- comment -->');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:XMLList = new XMLList('<!-- comment -->')");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestGlobalConstants.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestGlobalConstants.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestGlobalConstants.java
new file mode 100644
index 0000000..ada60af
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestGlobalConstants.java
@@ -0,0 +1,62 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestGlobalConstants extends ASTestBase
+{
+    @Test
+    public void testInfinity()
+    {
+        IVariableNode node = getField("var a:Number = Infinity;");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Number = Infinity");
+    }
+
+    @Test
+    public void testNegativeInfinity()
+    {
+        IVariableNode node = getField("var a:Number = -Infinity;");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Number = -Infinity");
+    }
+
+    @Test
+    public void testNaN()
+    {
+        IVariableNode node = getField("var a:Number = NaN;");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Number = NaN");
+    }
+
+    @Test
+    public void testUndefined()
+    {
+        IVariableNode node = getField("var a:* = undefined;");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:* = undefined");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestGlobalFunctions.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestGlobalFunctions.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestGlobalFunctions.java
new file mode 100644
index 0000000..2b7a274
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestGlobalFunctions.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.internal.codegen.as;
+
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestGlobalFunctions extends ASTestBase
+{
+    @Test
+    public void testArray()
+    {
+        IVariableNode node = getVariable("var a:Array = Array(1);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Array = Array(1)");
+    }
+
+    @Test
+    public void testBoolean()
+    {
+        IVariableNode node = getVariable("var a:Boolean = Boolean(1);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Boolean = Boolean(1)");
+    }
+
+    @Test
+    public void testDecodeURI()
+    {
+        IVariableNode node = getVariable("var a:String = decodeURI('http://whatever.com');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:String = decodeURI('http://whatever.com')");
+    }
+
+    @Test
+    public void testDecodeURIComponent()
+    {
+        IVariableNode node = getVariable("var a:String = decodeURIComponent('http://whatever.com');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:String = decodeURIComponent('http://whatever.com')");
+    }
+
+    @Test
+    public void testEncodeURI()
+    {
+        IVariableNode node = getVariable("var a:String = encodeURI('http://whatever.com');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:String = encodeURI('http://whatever.com')");
+    }
+
+    @Test
+    public void testEncodeURIComponent()
+    {
+        IVariableNode node = getVariable("var a:String = encodeURIComponent('http://whatever.com');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:String = encodeURIComponent('http://whatever.com')");
+    }
+
+    @Test
+    public void testEscape()
+    {
+        IVariableNode node = getVariable("var a:String = escape('http://whatever.com');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:String = escape('http://whatever.com')");
+    }
+
+    @Test
+    public void testInt()
+    {
+        IVariableNode node = getVariable("var a:int = int(1.8);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:int = int(1.8)");
+    }
+
+    @Test
+    public void testIsFinite()
+    {
+        IVariableNode node = getVariable("var a:Boolean = isFinite(1000000.9);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Boolean = isFinite(1000000.9)");
+    }
+
+    @Test
+    public void testIsNaN()
+    {
+        IVariableNode node = getVariable("var a:Boolean = isNaN(NaN);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Boolean = isNaN(NaN)");
+    }
+
+    @Test
+    public void testIsXMLName()
+    {
+        IVariableNode node = getVariable("var a:Boolean = isXMLName(\"?\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Boolean = isXMLName(\"?\")");
+    }
+
+    @Test
+    public void testNumber()
+    {
+        IVariableNode node = getVariable("var a:Number = Number(\"1\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Number = Number(\"1\")");
+    }
+
+    @Test
+    public void testObject()
+    {
+        IVariableNode node = getVariable("var a:Object = Object(\"1\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Object = Object(\"1\")");
+    }
+
+    @Test
+    public void testParseFloat()
+    {
+        IVariableNode node = getVariable("var a:Number = parseFloat(\"1.8\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Number = parseFloat(\"1.8\")");
+    }
+
+    @Test
+    public void testParseInt()
+    {
+        IVariableNode node = getVariable("var a:Number = parseInt(\"666\", 10);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Number = parseInt(\"666\", 10)");
+    }
+
+    @Test
+    public void testString()
+    {
+        IVariableNode node = getVariable("var a:String = String(100);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:String = String(100)");
+    }
+
+    @Test
+    public void testTrace()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode(
+                "trace('Hello World');", IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("trace('Hello World')");
+    }
+
+    @Test
+    public void testUint()
+    {
+        IVariableNode node = getVariable("var a:uint = uint(-100);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:uint = uint(-100)");
+    }
+
+    @Test
+    public void testUnescape()
+    {
+        IVariableNode node = getVariable("var a:String = unescape('%25');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:String = unescape('%25')");
+    }
+
+    @Test
+    public void testVector()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = Vector.<String>(['Hello', 'World']);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Vector.<String> = Vector.<String>(['Hello', 'World'])");
+    }
+
+    @Test
+    public void testXML()
+    {
+        IVariableNode node = getVariable("var a:XML = XML('@');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:XML = XML('@')");
+    }
+
+    @Test
+    public void testXMLList()
+    {
+        IVariableNode node = getVariable("var a:XMLList = XMLList('<!-- comment -->');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:XMLList = XMLList('<!-- comment -->')");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestInterface.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestInterface.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestInterface.java
new file mode 100644
index 0000000..2b15349
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestInterface.java
@@ -0,0 +1,105 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid ActionScript3 code for Interface
+ * production.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestInterface extends ASTestBase
+{
+    //--------------------------------------------------------------------------
+    // Interface
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void testSimple()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA{}");
+        asBlockWalker.visitInterface(node);
+        assertOut("public interface IA {\n}");
+    }
+
+    @Test
+    public void testSimpleExtends()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA extends IB{}");
+        asBlockWalker.visitInterface(node);
+        assertOut("public interface IA extends IB {\n}");
+    }
+
+    @Test
+    public void testSimpleExtendsMultiple()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA extends IB, IC, ID {}");
+        asBlockWalker.visitInterface(node);
+        assertOut("public interface IA extends IB, IC, ID {\n}");
+    }
+
+    @Test
+    public void testQualifiedExtendsMultiple()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA extends foo.bar.IB, baz.goo.IC, foo.ID {}");
+        asBlockWalker.visitInterface(node);
+        assertOut("public interface IA extends foo.bar.IB, baz.goo.IC, foo.ID {\n}");
+    }
+
+    @Test
+    public void testAccessors()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA {"
+                + "function get foo1():Object;"
+                + "function set foo1(value:Object):void;}");
+        asBlockWalker.visitInterface(node);
+        assertOut("public interface IA {\n\tfunction get foo1():Object;\n\t"
+                + "function set foo1(value:Object):void;\n}");
+    }
+
+    @Test
+    public void testMethods()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA {"
+                + "function foo1():Object;"
+                + "function foo1(value:Object):void;}");
+        asBlockWalker.visitInterface(node);
+        assertOut("public interface IA {\n\tfunction foo1():Object;\n\t"
+                + "function foo1(value:Object):void;\n}");
+    }
+
+    @Test
+    public void testAccessorsMethods()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA {"
+                + "function get foo1():Object;"
+                + "function set foo1(value:Object):void;"
+                + "function baz1():Object;"
+                + "function baz2(value:Object):void;}");
+        asBlockWalker.visitInterface(node);
+        assertOut("public interface IA {\n\tfunction get foo1():Object;"
+                + "\n\tfunction set foo1(value:Object):void;\n\tfunction baz1()"
+                + ":Object;\n\tfunction baz2(value:Object):void;\n}");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestMethodMembers.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestMethodMembers.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestMethodMembers.java
new file mode 100644
index 0000000..ce4316f
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestMethodMembers.java
@@ -0,0 +1,147 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid ActionScript3 code for Class Method
+ * members.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestMethodMembers extends ASTestBase
+{
+    /*
+     * Method
+     * 
+     * function foo(){}
+     * function foo():int{}
+     * function foo(bar):int{}
+     * function foo(bar:String):int{}
+     * function foo(bar:String = "baz"):int{}
+     * function foo(bar:String, baz:int = null):int{}
+     * function foo(bar:String, ...rest):int{}
+     * public function foo(bar:String, baz:int = null):int{}
+     * public static function foo(bar:String, baz:int = null):int{}
+     */
+
+    //--------------------------------------------------------------------------
+    // Method
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void testMethod()
+    {
+        IFunctionNode node = getMethod("function foo(){}");
+        asBlockWalker.visitFunction(node);
+        assertOut("function foo() {\n}");
+    }
+
+    @Test
+    public void testMethod_withReturnType()
+    {
+        IFunctionNode node = getMethod("function foo():int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("function foo():int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testMethod_withParameterReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("function foo(bar:*):int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testMethod_withParameterTypeReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar:String):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("function foo(bar:String):int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testMethod_withDefaultParameterTypeReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar:String = \"baz\"):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("function foo(bar:String = \"baz\"):int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testMethod_withMultipleDefaultParameterTypeReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar:String, baz:int = null):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("function foo(bar:String, baz:int = null):int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testMethod_withRestParameterTypeReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar:String, ...rest):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("function foo(bar:String, ...rest):int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testMethod_withNamespace()
+    {
+        IFunctionNode node = getMethod("public function foo(bar:String, baz:int = null):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("public function foo(bar:String, baz:int = null):int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testMethod_withNamespaceCustom()
+    {
+        IFunctionNode node = getMethod("mx_internal function foo(bar:String, baz:int = null):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("mx_internal function foo(bar:String, baz:int = null):int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testMethod_withNamespaceModifiers()
+    {
+        IFunctionNode node = getMethod("public static function foo(bar:String, baz:int = null):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("public static function foo(bar:String, baz:int = null):int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testMethod_withNamespaceModifierOverride()
+    {
+        IFunctionNode node = getMethod("public override function foo(bar:String, baz:int = null):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("public override function foo(bar:String, baz:int = null):int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testMethod_withNamespaceModifierOverrideBackwards()
+    {
+        IFunctionNode node = getMethod("override public function foo(bar:String, baz:int = null):int{return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("public override function foo(bar:String, baz:int = null):int {\n\treturn -1;\n}");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestPackage.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestPackage.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestPackage.java
new file mode 100644
index 0000000..ad8b4e7
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestPackage.java
@@ -0,0 +1,103 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid ActionScript3 code for Package
+ * production.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestPackage extends ASTestBase
+{
+    //--------------------------------------------------------------------------
+    // Package
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void testPackage_Simple()
+    {
+        IFileNode node = compileAS("package{}");
+        asBlockWalker.visitFile(node);
+        assertOut("package {\n}");
+    }
+
+    @Test
+    public void testPackage_SimpleName()
+    {
+        IFileNode node = compileAS("package foo {}");
+        asBlockWalker.visitFile(node);
+        assertOut("package foo {\n}");
+    }
+
+    @Test
+    public void testPackage_Name()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {}");
+        asBlockWalker.visitFile(node);
+        assertOut("package foo.bar.baz {\n}");
+    }
+
+    @Test
+    public void testPackageSimple_Class()
+    {
+        IFileNode node = compileAS("package {public class A{}}");
+        asBlockWalker.visitFile(node);
+        assertOut("package {\n\tpublic class A {\n\t}\n}");
+    }
+
+    @Test
+    public void testPackageQualified_Class()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {public class A{}}");
+        asBlockWalker.visitFile(node);
+        assertOut("package foo.bar.baz {\n\tpublic class A {\n\t}\n}");
+    }
+
+    @Test
+    public void testPackageQualified_ClassBody()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {public class A{public function A(){}}}");
+        asBlockWalker.visitFile(node);
+        assertOut("package foo.bar.baz {\n\tpublic class A {\n\t\tpublic function A() {\n\t\t}\n\t}\n}");
+    }
+
+    @Test
+    public void testPackageQualified_ClassBodyMethodContents()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {public class A{public function A(){if (a){for each(var i:Object in obj){doit();}}}}}");
+        asBlockWalker.visitFile(node);
+        assertOut("package foo.bar.baz {\n\tpublic class A {\n\t\tpublic function A() {\n\t\t\t"
+                + "if (a) {\n\t\t\t\tfor each (var i:Object in obj) {\n\t\t\t\t\tdoit();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}");
+    }
+
+    // TODO (mschmalle) implement Import unit tests for as
+    @Test
+    public void testPackage_Import()
+    {
+//        IFileNode node = compileAS("package{import foo.bar.Baz;}");
+//        asBlockWalker.visitFile(node);
+//        assertOut("package {\nimport foo.bar.Baz;}");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestParenthesis.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestParenthesis.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestParenthesis.java
new file mode 100644
index 0000000..5674dd9
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestParenthesis.java
@@ -0,0 +1,98 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IReturnNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * @author Michael Schmalle
+ */
+public class TestParenthesis extends ASTestBase
+{
+    @Test
+    public void testParentheses_1()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a = (a + b);",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:* = (a + b)");
+    }
+
+    @Test
+    public void testParentheses_2()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "var a = ((a + b) - (c + d)) * e;", IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:* = ((a + b) - (c + d)) * e");
+    }
+
+    @Test
+    public void testParentheses_3()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "a = (a + b) - c + d * e;", IBinaryOperatorNode.class);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a = (a + b) - c + d * e");
+    }
+
+    @Test
+    public void testParentheses_4()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "a = ((a + b) - (c + d)) * e;", IBinaryOperatorNode.class);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a = ((a + b) - (c + d)) * e");
+    }
+
+    @Test
+    public void testParentheses_Strings1()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "a = '' + '' + '' + ''", IBinaryOperatorNode.class);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a = '' + '' + '' + ''");
+    }
+
+    @Test
+    public void testParentheses_Strings2()
+    {
+        // this is a whacked test but is just proves the logic that for now, 
+        // we only leave out parens for String literals on the right hand side
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "a = '' + 2 + '' + '' * 4 ", IBinaryOperatorNode.class);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a = '' + 2 + '' + '' * 4");
+    }
+    
+    @Test
+    public void testParentheses_Ternary()
+    {
+        IReturnNode node = (IReturnNode) getNode(
+        		"return \"a \" + (a < b ? \"<\" : \">=\") + \" b\";", IReturnNode.class);
+        asBlockWalker.visitReturn(node);
+        assertOut("return \"a \" + (a < b ? \"<\" : \">=\") + \" b\"");
+    }
+
+}


[16/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/Event_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/Event_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/Event_result.js
new file mode 100644
index 0000000..2a536c8
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/Event_result.js
@@ -0,0 +1,70 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from Event.as
+ * Event
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Event');
+
+
+
+/**
+ * @constructor
+ */
+Event = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Event.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Event', qName: 'Event'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Event', Event);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Event.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'Event': { type: '', declaredBy: 'Event'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/mypackage/TestClass.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/mypackage/TestClass.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/mypackage/TestClass.as
new file mode 100644
index 0000000..80b4427
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/mypackage/TestClass.as
@@ -0,0 +1,31 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mypackage
+{
+  import otherpackage.Event;
+  
+  public class TestClass
+  {
+    public function TestClass() 
+    {
+    }
+
+	private var event:Event = new Event();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/mypackage/TestClass_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/mypackage/TestClass_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/mypackage/TestClass_result.js
new file mode 100644
index 0000000..16fd128
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/mypackage/TestClass_result.js
@@ -0,0 +1,81 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from mypackage/TestClass.as
+ * mypackage.TestClass
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('mypackage.TestClass');
+
+goog.require('otherpackage.Event');
+
+
+
+/**
+ * @constructor
+ */
+mypackage.TestClass = function() {
+
+this.event = new otherpackage.Event();
+};
+
+
+/**
+ * @private
+ * @type {otherpackage.Event}
+ */
+mypackage.TestClass.prototype.event;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+mypackage.TestClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'TestClass', qName: 'mypackage.TestClass'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('mypackage.TestClass', mypackage.TestClass);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+mypackage.TestClass.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'TestClass': { type: '', declaredBy: 'mypackage.TestClass'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/otherpackage/Event.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/otherpackage/Event.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/otherpackage/Event.as
new file mode 100644
index 0000000..c3aebf5
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/otherpackage/Event.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 otherpackage
+{
+  public class Event
+  {
+    public function Event() 
+    {
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/otherpackage/Event_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/otherpackage/Event_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/otherpackage/Event_result.js
new file mode 100644
index 0000000..b033e7c
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/otherpackage/Event_result.js
@@ -0,0 +1,70 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from otherpackage/Event.as
+ * otherpackage.Event
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('otherpackage.Event');
+
+
+
+/**
+ * @constructor
+ */
+otherpackage.Event = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+otherpackage.Event.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Event', qName: 'otherpackage.Event'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('otherpackage.Event', otherpackage.Event);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+otherpackage.Event.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'Event': { type: '', declaredBy: 'otherpackage.Event'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/Event.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/Event.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/Event.as
new file mode 100644
index 0000000..31633de
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/Event.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+  public class Event
+  {
+    public function Event() 
+    {
+    }; 
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/Event_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/Event_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/Event_result.js
new file mode 100644
index 0000000..2a536c8
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/Event_result.js
@@ -0,0 +1,70 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from Event.as
+ * Event
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Event');
+
+
+
+/**
+ * @constructor
+ */
+Event = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Event.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Event', qName: 'Event'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Event', Event);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Event.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'Event': { type: '', declaredBy: 'Event'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/NoConflictNoWindow.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/NoConflictNoWindow.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/NoConflictNoWindow.as
new file mode 100644
index 0000000..9920389
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/NoConflictNoWindow.as
@@ -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
+{
+  import mypackage.TestClass;
+  
+  public class NoConflictNoWindow
+  {
+    public function NoConflictNoWindow() 
+    {
+        testClass = new TestClass();
+    }; 
+
+    private var testClass:TestClass;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/NoConflictNoWindow_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/NoConflictNoWindow_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/NoConflictNoWindow_result.js
new file mode 100644
index 0000000..310f61d
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/NoConflictNoWindow_result.js
@@ -0,0 +1,79 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * NoConflictNoWindow
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('NoConflictNoWindow');
+
+goog.require('mypackage.TestClass');
+
+
+
+/**
+ * @constructor
+ */
+NoConflictNoWindow = function() {
+  this.testClass = new mypackage.TestClass();
+};
+
+
+/**
+ * @private
+ * @type {mypackage.TestClass}
+ */
+NoConflictNoWindow.prototype.testClass;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+NoConflictNoWindow.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'NoConflictNoWindow', qName: 'NoConflictNoWindow'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('NoConflictNoWindow', NoConflictNoWindow);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+NoConflictNoWindow.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'NoConflictNoWindow': { type: '', declaredBy: 'NoConflictNoWindow'}
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/mypackage/TestClass.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/mypackage/TestClass.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/mypackage/TestClass.as
new file mode 100644
index 0000000..83726f9
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/mypackage/TestClass.as
@@ -0,0 +1,29 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mypackage
+{  
+  public class TestClass
+  {
+    public function TestClass() 
+    {
+    }; 
+
+	private var event:Event = new Event();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/mypackage/TestClass_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/mypackage/TestClass_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/mypackage/TestClass_result.js
new file mode 100644
index 0000000..f091648
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_no_window/mypackage/TestClass_result.js
@@ -0,0 +1,79 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from mypackage/TestClass.as
+ * mypackage.TestClass
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('mypackage.TestClass');
+
+
+
+/**
+ * @constructor
+ */
+mypackage.TestClass = function() {
+
+this.event = new Event();
+};
+
+
+/**
+ * @private
+ * @type {Event}
+ */
+mypackage.TestClass.prototype.event;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+mypackage.TestClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'TestClass', qName: 'mypackage.TestClass'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('mypackage.TestClass', mypackage.TestClass);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+mypackage.TestClass.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'TestClass': { type: '', declaredBy: 'mypackage.TestClass'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/Event.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/Event.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/Event.as
new file mode 100644
index 0000000..31633de
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/Event.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+  public class Event
+  {
+    public function Event() 
+    {
+    }; 
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/Event_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/Event_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/Event_result.js
new file mode 100644
index 0000000..2a536c8
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/Event_result.js
@@ -0,0 +1,70 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from Event.as
+ * Event
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Event');
+
+
+
+/**
+ * @constructor
+ */
+Event = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Event.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Event', qName: 'Event'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Event', Event);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Event.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'Event': { type: '', declaredBy: 'Event'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/NoConflictUseWindow.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/NoConflictUseWindow.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/NoConflictUseWindow.as
new file mode 100644
index 0000000..aea54ec
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/NoConflictUseWindow.as
@@ -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
+{
+  import mypackage.TestClass;
+  
+  public class NoConflictUseWindow
+  {
+    public function NoConflictUseWindow() 
+    {
+        testClass = new TestClass();
+    }; 
+
+    private var testClass:TestClass;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/NoConflictUseWindow_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/NoConflictUseWindow_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/NoConflictUseWindow_result.js
new file mode 100644
index 0000000..09dc7d8
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/NoConflictUseWindow_result.js
@@ -0,0 +1,79 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * NoConflictUseWindow
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('NoConflictUseWindow');
+
+goog.require('mypackage.TestClass');
+
+
+
+/**
+ * @constructor
+ */
+NoConflictUseWindow = function() {
+  this.testClass = new mypackage.TestClass();
+};
+
+
+/**
+ * @private
+ * @type {mypackage.TestClass}
+ */
+NoConflictUseWindow.prototype.testClass;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+NoConflictUseWindow.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'NoConflictUseWindow', qName: 'NoConflictUseWindow'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('NoConflictUseWindow', NoConflictUseWindow);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+NoConflictUseWindow.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'NoConflictUseWindow': { type: '', declaredBy: 'NoConflictUseWindow'}
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/mypackage/TestClass.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/mypackage/TestClass.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/mypackage/TestClass.as
new file mode 100644
index 0000000..08104e0
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/mypackage/TestClass.as
@@ -0,0 +1,31 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mypackage
+{ 
+  import window.Event;
+   
+  public class TestClass
+  {
+    public function TestClass() 
+    {
+    }
+
+	private var event:Event = new Event();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/mypackage/TestClass_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/mypackage/TestClass_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/mypackage/TestClass_result.js
new file mode 100644
index 0000000..f091648
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_no_conflict_use_window/mypackage/TestClass_result.js
@@ -0,0 +1,79 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from mypackage/TestClass.as
+ * mypackage.TestClass
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('mypackage.TestClass');
+
+
+
+/**
+ * @constructor
+ */
+mypackage.TestClass = function() {
+
+this.event = new Event();
+};
+
+
+/**
+ * @private
+ * @type {Event}
+ */
+mypackage.TestClass.prototype.event;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+mypackage.TestClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'TestClass', qName: 'mypackage.TestClass'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('mypackage.TestClass', mypackage.TestClass);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+mypackage.TestClass.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'TestClass': { type: '', declaredBy: 'mypackage.TestClass'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/Event.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/Event.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/Event.as
new file mode 100644
index 0000000..1a1d54c
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/Event.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+  public class Event
+  {
+    public function Event() 
+    {
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/Event_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/Event_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/Event_result.js
new file mode 100644
index 0000000..2a536c8
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/Event_result.js
@@ -0,0 +1,70 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from Event.as
+ * Event
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Event');
+
+
+
+/**
+ * @constructor
+ */
+Event = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Event.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Event', qName: 'Event'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Event', Event);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Event.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'Event': { type: '', declaredBy: 'Event'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/SamePackageAsConflict.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/SamePackageAsConflict.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/SamePackageAsConflict.as
new file mode 100644
index 0000000..0535c94
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/SamePackageAsConflict.as
@@ -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
+{
+  import mypackage.TestClass;
+  
+  public class SamePackageAsConflict
+  {
+    public function SamePackageAsConflict() 
+    {
+        testClass = new TestClass();
+    }
+
+    private var testClass:TestClass;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/SamePackageAsConflict_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/SamePackageAsConflict_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/SamePackageAsConflict_result.js
new file mode 100644
index 0000000..190077a
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/SamePackageAsConflict_result.js
@@ -0,0 +1,79 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * SamePackageAsConflict
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('SamePackageAsConflict');
+
+goog.require('mypackage.TestClass');
+
+
+
+/**
+ * @constructor
+ */
+SamePackageAsConflict = function() {
+  this.testClass = new mypackage.TestClass();
+};
+
+
+/**
+ * @private
+ * @type {mypackage.TestClass}
+ */
+SamePackageAsConflict.prototype.testClass;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+SamePackageAsConflict.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'SamePackageAsConflict', qName: 'SamePackageAsConflict'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('SamePackageAsConflict', SamePackageAsConflict);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+SamePackageAsConflict.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'SamePackageAsConflict': { type: '', declaredBy: 'SamePackageAsConflict'}
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/Event.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/Event.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/Event.as
new file mode 100644
index 0000000..c2a900c
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/Event.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mypackage
+{
+  public class Event
+  {
+    public function Event() 
+    {
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/Event_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/Event_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/Event_result.js
new file mode 100644
index 0000000..718f1c0
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/Event_result.js
@@ -0,0 +1,70 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from mypackage/Event.as
+ * mypackage.Event
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('mypackage.Event');
+
+
+
+/**
+ * @constructor
+ */
+mypackage.Event = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+mypackage.Event.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Event', qName: 'mypackage.Event'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('mypackage.Event', mypackage.Event);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+mypackage.Event.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'Event': { type: '', declaredBy: 'mypackage.Event'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/TestClass.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/TestClass.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/TestClass.as
new file mode 100644
index 0000000..f323cca
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/TestClass.as
@@ -0,0 +1,29 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mypackage
+{
+  public class TestClass
+  {
+    public function TestClass() 
+    {
+    }
+
+	private var event:Event = new Event();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/TestClass_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/TestClass_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/TestClass_result.js
new file mode 100644
index 0000000..a7b72a7
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_same_package_as_conflict/mypackage/TestClass_result.js
@@ -0,0 +1,81 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from mypackage/TestClass.as
+ * mypackage.TestClass
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('mypackage.TestClass');
+
+goog.require('mypackage.Event');
+
+
+
+/**
+ * @constructor
+ */
+mypackage.TestClass = function() {
+
+this.event = new mypackage.Event();
+};
+
+
+/**
+ * @private
+ * @type {mypackage.Event}
+ */
+mypackage.TestClass.prototype.event;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+mypackage.TestClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'TestClass', qName: 'mypackage.TestClass'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('mypackage.TestClass', mypackage.TestClass);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+mypackage.TestClass.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'TestClass': { type: '', declaredBy: 'mypackage.TestClass'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/Event.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/Event.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/Event.as
new file mode 100644
index 0000000..1a1d54c
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/Event.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+  public class Event
+  {
+    public function Event() 
+    {
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/Event_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/Event_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/Event_result.js
new file mode 100644
index 0000000..2a536c8
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/Event_result.js
@@ -0,0 +1,70 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from Event.as
+ * Event
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Event');
+
+
+
+/**
+ * @constructor
+ */
+Event = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Event.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Event', qName: 'Event'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Event', Event);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Event.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'Event': { type: '', declaredBy: 'Event'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/UseWindow.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/UseWindow.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/UseWindow.as
new file mode 100644
index 0000000..ee270bb
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/UseWindow.as
@@ -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
+{
+  import mypackage.TestClass;
+  
+  public class UseWindow
+  {
+    public function UseWindow() 
+    {
+        testClass = new TestClass();
+    }
+
+    private var testClass:TestClass;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/UseWindow_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/UseWindow_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/UseWindow_result.js
new file mode 100644
index 0000000..1660094
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/UseWindow_result.js
@@ -0,0 +1,79 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * UseWindow
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('UseWindow');
+
+goog.require('mypackage.TestClass');
+
+
+
+/**
+ * @constructor
+ */
+UseWindow = function() {
+  this.testClass = new mypackage.TestClass();
+};
+
+
+/**
+ * @private
+ * @type {mypackage.TestClass}
+ */
+UseWindow.prototype.testClass;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+UseWindow.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'UseWindow', qName: 'UseWindow'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('UseWindow', UseWindow);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+UseWindow.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'UseWindow': { type: '', declaredBy: 'UseWindow'}
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/mypackage/TestClass.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/mypackage/TestClass.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/mypackage/TestClass.as
new file mode 100644
index 0000000..9923833
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/mypackage/TestClass.as
@@ -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 mypackage
+{
+  import otherpackage.Event;
+  import window.Event;
+  
+  public class TestClass
+  {
+    public function TestClass() 
+    {
+    }
+
+	private var event1:window.Event = new window.Event();
+	private var event2:otherpackage.Event = new otherpackage.Event();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/mypackage/TestClass_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/mypackage/TestClass_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/mypackage/TestClass_result.js
new file mode 100644
index 0000000..2342052
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/mypackage/TestClass_result.js
@@ -0,0 +1,89 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from mypackage/TestClass.as
+ * mypackage.TestClass
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('mypackage.TestClass');
+
+goog.require('otherpackage.Event');
+
+
+
+/**
+ * @constructor
+ */
+mypackage.TestClass = function() {
+
+this.event1 = new Event();
+this.event2 = new otherpackage.Event();
+};
+
+
+/**
+ * @private
+ * @type {Event}
+ */
+mypackage.TestClass.prototype.event1;
+
+
+/**
+ * @private
+ * @type {otherpackage.Event}
+ */
+mypackage.TestClass.prototype.event2;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+mypackage.TestClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'TestClass', qName: 'mypackage.TestClass'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('mypackage.TestClass', mypackage.TestClass);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+mypackage.TestClass.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'TestClass': { type: '', declaredBy: 'mypackage.TestClass'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/otherpackage/Event.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/otherpackage/Event.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/otherpackage/Event.as
new file mode 100644
index 0000000..c3aebf5
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/otherpackage/Event.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 otherpackage
+{
+  public class Event
+  {
+    public function Event() 
+    {
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/otherpackage/Event_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/otherpackage/Event_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/otherpackage/Event_result.js
new file mode 100644
index 0000000..b033e7c
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_use_window/otherpackage/Event_result.js
@@ -0,0 +1,70 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from otherpackage/Event.as
+ * otherpackage.Event
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('otherpackage.Event');
+
+
+
+/**
+ * @constructor
+ */
+otherpackage.Event = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+otherpackage.Event.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Event', qName: 'otherpackage.Event'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('otherpackage.Event', otherpackage.Event);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+otherpackage.Event.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'Event': { type: '', declaredBy: 'otherpackage.Event'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/super/Base.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/super/Base.as b/compiler-jx/src/test/resources/flexjs/projects/super/Base.as
new file mode 100644
index 0000000..2e8ed8f
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/super/Base.as
@@ -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
+{
+	import Super;
+
+  public class Base extends Super
+  {
+    public function Base() 
+    {
+      super();
+    }; 
+
+    override public function get text():String 
+    {
+      return "A" + super.text;
+    };
+  
+    override public function set text(value:String):void 
+    {
+      if (value != super.text)
+      {
+        super.text = "B" + value;
+      }
+    };
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/super/Base_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/super/Base_result.js b/compiler-jx/src/test/resources/flexjs/projects/super/Base_result.js
new file mode 100644
index 0000000..1306674
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/super/Base_result.js
@@ -0,0 +1,90 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Base
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Base');
+
+goog.require('Super');
+goog.require('org.apache.flex.utils.Language');
+
+
+
+/**
+ * @constructor
+ * @extends {Super}
+ */
+Base = function() {
+  Base.base(this, 'constructor');
+};
+goog.inherits(Base, Super);
+
+
+Object.defineProperties(Base.prototype, /** @lends {Base.prototype} */ {
+/** @export */
+text: {
+get: /** @this {Base} */ function() {
+  return "A" + org.apache.flex.utils.Language.superGetter(Base, this, 'text');
+},
+set: /** @this {Base} */ function(value) {
+  if (value != org.apache.flex.utils.Language.superGetter(Base, this, 'text')) {
+    org.apache.flex.utils.Language.superSetter(Base, this, 'text', "B" + value);
+  }
+}}}
+);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Base.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Base', qName: 'Base'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Base', Base);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Base.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+        'text': { type: 'String', declaredBy: 'Base'}
+      };
+    },
+    methods: function () {
+      return {
+        'Base': { type: '', declaredBy: 'Base'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/super/Super.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/super/Super.as b/compiler-jx/src/test/resources/flexjs/projects/super/Super.as
new file mode 100644
index 0000000..76c1d7a
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/super/Super.as
@@ -0,0 +1,40 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+  public class Super
+  {
+    public function Super() {}; 
+
+    private var _text:String = '';
+  
+    public function get text():String 
+    {
+      return _text;
+    };
+  
+    public function set text(value:String):void 
+    {
+      if (value != _text)
+      {
+        _text = value;
+      }
+    };
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/super/Super_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/super/Super_result.js b/compiler-jx/src/test/resources/flexjs/projects/super/Super_result.js
new file mode 100644
index 0000000..665c502
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/super/Super_result.js
@@ -0,0 +1,91 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Super
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Super');
+
+
+
+/**
+ * @constructor
+ */
+Super = function() {
+};
+
+
+/**
+ * @private
+ * @type {string}
+ */
+Super.prototype._text = '';
+
+
+Object.defineProperties(Super.prototype, /** @lends {Super.prototype} */ {
+/** @export */
+text: {
+get: /** @this {Super} */ function() {
+  return this._text;
+},
+set: /** @this {Super} */ function(value) {
+  if (value != this._text) {
+    this._text = value;
+  }
+}}}
+);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Super.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Super', qName: 'Super'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Super', Super);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Super.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+        'text': { type: 'String', declaredBy: 'Super'}
+      };
+    },
+    methods: function () {
+      return {
+        'Super': { type: '', declaredBy: 'Super'}
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/xml_requires/XMLRequire.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/xml_requires/XMLRequire.as b/compiler-jx/src/test/resources/flexjs/projects/xml_requires/XMLRequire.as
new file mode 100644
index 0000000..4a997c9
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/xml_requires/XMLRequire.as
@@ -0,0 +1,30 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+	
+	public class XMLRequire
+	{
+		public function XMLRequire() 
+        {
+            var myXML:XML = <node />;		
+        }		
+	}
+	
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/xml_requires/XMLRequire_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/xml_requires/XMLRequire_result.js b/compiler-jx/src/test/resources/flexjs/projects/xml_requires/XMLRequire_result.js
new file mode 100644
index 0000000..d6affbe
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/xml_requires/XMLRequire_result.js
@@ -0,0 +1,74 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * XMLRequire
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('XMLRequire');
+
+goog.require('XML');
+
+
+
+
+
+/**
+ * @constructor
+ */
+XMLRequire = function() {
+  var /** @type {XML} */ myXML = new XML( '<node />') ;
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+XMLRequire.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'XMLRequire', qName: 'XMLRequire'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('XMLRequire', XMLRequire);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+XMLRequire.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'XMLRequire': { type: '', declaredBy: 'XMLRequire'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/call-super.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/files/call-super.as b/compiler-jx/src/test/resources/goog/files/call-super.as
new file mode 100644
index 0000000..3b07ead
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/files/call-super.as
@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+
+import flash.events.IEventDispatcher;
+
+import goog.events.EventTarget;
+
+public dynamic class A extends EventTarget implements IEventDispatcher
+{
+	public function A(z:String)
+	{
+		super(z);
+	}
+	
+	public function hasSuperCall(a:String, b:Number):String
+	{
+		super.hasSuperCall(a, b, 100);
+		
+		var result:String = myRegularFunctionCall(-1);
+		
+		return result;
+	}
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/call-super_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/files/call-super_result.js b/compiler-jx/src/test/resources/goog/files/call-super_result.js
new file mode 100644
index 0000000..f9d270f
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/files/call-super_result.js
@@ -0,0 +1,41 @@
+/**
+ * Licensed 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.
+ */
+goog.provide('org.apache.flex.A');
+
+goog.require('flash.events.IEventDispatcher');
+goog.require('goog.events.EventTarget');
+
+/**
+ * @constructor
+ * @extends {goog.events.EventTarget}
+ * @implements {flash.events.IEventDispatcher}
+ * @param {string} z
+ */
+org.apache.flex.A = function(z) {
+	var self = this;
+	org.apache.flex.A.base(this, 'constructor', z);
+};
+goog.inherits(org.apache.flex.A, goog.events.EventTarget);
+
+/**
+ * @param {string} a
+ * @param {number} b
+ * @return {string}
+ */
+org.apache.flex.A.prototype.hasSuperCall = function(a, b) {
+	var self = this;
+	org.apache.flex.A.base(this, 'hasSuperCall', a, b, 100);
+	var /** @type {string} */ result = myRegularFunctionCall(-1);
+	return result;
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/get-set.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/files/get-set.as b/compiler-jx/src/test/resources/goog/files/get-set.as
new file mode 100644
index 0000000..fce44c4
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/files/get-set.as
@@ -0,0 +1,40 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+
+public class A
+{
+
+	public function A() {}
+
+	private var _a:int = -1;
+	
+	public function get a():int
+	{
+		return -1;
+	}
+
+	public function set a(value:int):void
+	{
+		_a = value;
+	}
+	
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/get-set_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/files/get-set_result.js b/compiler-jx/src/test/resources/goog/files/get-set_result.js
new file mode 100644
index 0000000..5a422a1
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/files/get-set_result.js
@@ -0,0 +1,49 @@
+/**
+ * Licensed 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.
+ */
+goog.provide('org.apache.flex.A');
+
+/**
+ * @constructor
+ */
+org.apache.flex.A = function() {
+};
+
+/**
+ * @private
+ * @type {number}
+ */
+org.apache.flex.A.prototype._a = -1;
+
+/**
+ * @type {number}
+ */
+org.apache.flex.A.prototype.a;
+
+Object.defineProperty(
+	org.apache.flex.A.prototype, 
+	'a', 
+	{get:function() {
+		var self = this;
+		return -1;
+	}, configurable:true}
+);
+
+Object.defineProperty(
+	org.apache.flex.A.prototype, 
+	'a', 
+	{set:function(value) {
+		var self = this;
+		self._a = value;
+	}, configurable:true}
+);


[19/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/MXMLTestBase.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/MXMLTestBase.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/MXMLTestBase.java
new file mode 100644
index 0000000..eee073c
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/MXMLTestBase.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.internal.test;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.driver.mxml.MXMLBackend;
+import org.apache.flex.compiler.internal.mxml.MXMLNamespaceMapping;
+import org.apache.flex.compiler.mxml.IMXMLNamespaceMapping;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLNode;
+import org.apache.flex.utils.ITestAdapter;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.Ignore;
+
+@Ignore
+public class MXMLTestBase extends TestBase
+{
+
+    protected ITestAdapter testAdapter;
+
+    @Override
+    public void setUp()
+    {
+        super.setUp();
+
+        testAdapter = TestAdapterFactory.getTestAdapter();
+
+        asEmitter = backend.createEmitter(writer);
+        mxmlEmitter = backend.createMXMLEmitter(writer);
+
+        asBlockWalker = backend.createWalker(project, errors, asEmitter);
+        mxmlBlockWalker = backend.createMXMLWalker(project, errors,
+                mxmlEmitter, asEmitter, asBlockWalker);
+    }
+
+    @Override
+    protected void addLibraries(List<File> libraries)
+    {
+        libraries.addAll(testAdapter.getLibraries(true));
+
+        super.addLibraries(libraries);
+    }
+
+    @Override
+    protected void addNamespaceMappings(
+            List<IMXMLNamespaceMapping> namespaceMappings)
+    {
+        namespaceMappings.add(new MXMLNamespaceMapping(
+                "http://ns.adobe.com/mxml/2009",
+                testAdapter.getFlexManifestPath("mxml-2009")));
+        namespaceMappings.add(new MXMLNamespaceMapping(
+                "library://ns.adobe.com/flex/mx",
+                testAdapter.getFlexManifestPath("mx")));
+        namespaceMappings.add(new MXMLNamespaceMapping(
+                "library://ns.adobe.com/flex/spark",
+                testAdapter.getFlexManifestPath("spark")));
+
+        super.addNamespaceMappings(namespaceMappings);
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new MXMLBackend();
+    }
+
+    //--------------------------------------------------------------------------
+    // Node "factory"
+    //--------------------------------------------------------------------------
+
+    public static final int WRAP_LEVEL_DOCUMENT = 1;
+    public static final int WRAP_LEVEL_NODE = 2;
+
+    protected IMXMLNode getNode(String code, Class<? extends IMXMLNode> type,
+            int wrapLevel)
+    {
+        if (wrapLevel >= WRAP_LEVEL_NODE)
+            code = "<s:Button " + code + "></s:Button>";
+
+        if (wrapLevel >= WRAP_LEVEL_DOCUMENT)
+            code = ""
+                    + "<s:Application xmlns:fx=\"http://ns.adobe.com/mxml/2009\""
+                    + " xmlns:s=\"library://ns.adobe.com/flex/spark\""
+                    + " xmlns:mx=\"library://ns.adobe.com/flex/mx\">" + code
+                    + "</s:Application>";
+
+        IMXMLFileNode node = compileMXML(code);
+
+        if (wrapLevel >= WRAP_LEVEL_NODE) // for now: attributes
+        {
+            IMXMLNode pnode = findFirstDescendantOfType(node, type);
+
+            IMXMLNode cnode = findFirstDescendantOfType(pnode, type);
+
+            return cnode;
+        }
+        else
+        {
+            return findFirstDescendantOfType(node, type);
+        }
+    }
+
+    protected IMXMLNode findFirstDescendantOfType(IMXMLNode node,
+            Class<? extends IMXMLNode> nodeType)
+    {
+
+        int n = node.getChildCount();
+        for (int i = 0; i < n; i++)
+        {
+            IMXMLNode child = (IMXMLNode) node.getChild(i);
+            if (nodeType.isInstance(child))
+                return child;
+
+            IMXMLNode found = findFirstDescendantOfType(child,
+                    nodeType);
+            if (found != null)
+                return found;
+        }
+
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/SourceMapTestBase.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/SourceMapTestBase.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/SourceMapTestBase.java
new file mode 100644
index 0000000..ac58f1c
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/SourceMapTestBase.java
@@ -0,0 +1,55 @@
+package org.apache.flex.compiler.internal.test;
+
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.tree.as.IASNode;
+
+import com.google.debugging.sourcemap.FilePosition;
+import static org.junit.Assert.assertTrue;
+
+public class SourceMapTestBase extends ASTestBase
+{
+    protected IJSEmitter jsEmitter;
+    
+    @Override
+    public void setUp()
+    {
+        super.setUp();
+
+        jsEmitter = (IJSEmitter) asEmitter;
+    }
+
+    protected void assertMapping(IASNode node, int nodeStartLine, int nodeStartColumn,
+        int outStartLine, int outStartColumn, int outEndLine, int outEndColumn)
+    {
+        int sourceStartLine = nodeStartLine + node.getLine();
+        int sourceStartColumn = nodeStartColumn;
+        if (nodeStartLine == 0)
+        {
+            sourceStartColumn += node.getColumn();
+        }
+        boolean foundMapping = false;
+        List<IJSEmitter.SourceMapMapping> mappings = jsEmitter.getSourceMapMappings();
+        for (IJSEmitter.SourceMapMapping mapping : mappings)
+        {
+            FilePosition sourcePosition = mapping.sourceStartPosition;
+            FilePosition startPosition = mapping.destStartPosition;
+            FilePosition endPosition = mapping.destEndPosition;
+            if (sourcePosition.getLine() == sourceStartLine
+                    && sourcePosition.getColumn() == sourceStartColumn
+                    && startPosition.getLine() == outStartLine
+                    && startPosition.getColumn() == outStartColumn
+                    && endPosition.getLine() == outEndLine
+                    && endPosition.getColumn() == outEndColumn)
+            {
+                foundMapping = true;
+                break;
+            }
+        }
+        assertTrue("Mapping not found for node " + node.getNodeID() + ". Expected "
+                + "source: (" + nodeStartLine + ", " + nodeStartColumn + "), dest: (" + outStartLine + ", " + outStartColumn + ") to (" + outEndLine + ", " + outEndColumn + ")",
+                foundMapping);
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/TestBase.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/TestBase.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/TestBase.java
new file mode 100644
index 0000000..64a73f7
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/TestBase.java
@@ -0,0 +1,678 @@
+/*
+ *
+ *  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.internal.test;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.as.ASFilterWriter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.projects.FlexProject;
+import org.apache.flex.compiler.internal.projects.FlexProjectConfigurator;
+import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.internal.tree.as.FunctionNode;
+import org.apache.flex.compiler.internal.tree.as.ImportNode;
+import org.apache.flex.compiler.internal.workspaces.Workspace;
+import org.apache.flex.compiler.mxml.IMXMLNamespaceMapping;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.utils.EnvProperties;
+import org.apache.flex.compiler.visitor.as.IASBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.ITestAdapter;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+
+@Ignore
+public class TestBase implements ITestBase
+{
+    private static ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
+
+    protected List<ICompilerProblem> errors;
+
+    protected static EnvProperties env = EnvProperties.initiate();
+
+    protected static Workspace workspace = new Workspace();
+    protected FlexProject project;
+
+    protected IBackend backend;
+    protected ASFilterWriter writer;
+
+    protected IASEmitter asEmitter;
+    protected IMXMLEmitter mxmlEmitter;
+
+    protected IASBlockWalker asBlockWalker;
+    protected IMXMLBlockWalker mxmlBlockWalker;
+
+    protected String inputFileExtension;
+
+    protected String mCode;
+
+    protected File tempDir;
+
+    private List<File> sourcePaths = new ArrayList<File>();
+    private List<File> libraries = new ArrayList<File>();
+    private List<IMXMLNamespaceMapping> namespaceMappings = new ArrayList<IMXMLNamespaceMapping>();
+
+    @Before
+    public void setUp()
+    {
+        assertNotNull("Environment variable FLEX_HOME is not set", env.SDK);
+        assertNotNull("Environment variable PLAYERGLOBAL_HOME is not set",
+                env.FPSDK);
+
+        errors = new ArrayList<ICompilerProblem>();
+
+        if (project == null)
+        {
+        	project = new FlexProject(workspace);
+        	project.setProxyBaseClass("flash.utils.Proxy");
+        }
+        project.setProblems(errors);
+        FlexProjectConfigurator.configure(project);
+
+        backend = createBackend();
+        writer = backend.createWriterBuffer(project);
+
+        try
+        {
+            ISourceFileHandler sfh = backend.getSourceFileHandlerInstance();
+            inputFileExtension = "." + sfh.getExtensions()[0];
+        }
+        catch (Exception e)
+        {
+            inputFileExtension = ".as";
+        }
+
+        sourcePaths = new ArrayList<File>();
+        libraries = new ArrayList<File>();
+        namespaceMappings = new ArrayList<IMXMLNamespaceMapping>();
+
+        tempDir = new File(TestAdapterFactory.getTestAdapter().getTempDir()); // ensure this exists
+    }
+
+    @After
+    public void tearDown()
+    {
+        backend = null;
+        writer = null;
+    }
+
+    protected IBackend createBackend()
+    {
+        return null;
+    }
+
+    protected void assertOut(String code, boolean keepMetadata)
+    {
+    	mCode = removeGeneratedString(writer.toString());
+    	if (!keepMetadata)
+    		mCode = removeMetadata(mCode);
+        //System.out.println(mCode);
+        assertThat(mCode, is(code));
+    }
+    
+    protected void assertOut(String code)
+    {
+        assertOut(code, false);
+    }
+    
+    protected void assertOutWithMetadata(String code)
+    {
+        assertOut(code, true);
+    }
+    
+    protected String removeMetadata(String code)
+    {
+    	int c = code.indexOf("\n\n\n/**\n * Metadata");
+    	if (c != -1)
+    		return code.substring(0, c);
+    	return code;
+    }
+
+    protected String removeGeneratedString(String code)
+    {
+    	int c = code.indexOf(" * Generated by Apache Flex Cross-Compiler");
+    	if (c != -1)
+    	{
+    		int c2 = code.indexOf("\n", c);
+    		String newString = code.substring(0, c);
+    		newString += code.substring(c2 + 1);
+    		return newString;
+    	}
+    	return code;
+    }
+    
+    @Override
+    public String toString()
+    {
+        return writer.toString();
+    }
+
+    protected IFileNode compileAS(String input)
+    {
+        return compileAS(input, false, "");
+    }
+
+    protected IFileNode compileAS(String input, boolean isFileName,
+            String inputDir)
+    {
+        return compileAS(input, isFileName, inputDir, true);
+    }
+
+    protected IFileNode compileAS(String input, boolean isFileName,
+            String inputDir, boolean useTempFile)
+    {
+        return (IFileNode) compile(input, isFileName, inputDir, useTempFile);
+    }
+
+    protected IASNode compile(String input, boolean isFileName,
+            String inputDir, boolean useTempFile)
+    {
+        File tempFile = (useTempFile) ? writeCodeToTempFile(input, isFileName, inputDir) :
+                new File(inputDir + File.separator + input + inputFileExtension);
+
+        addDependencies();
+
+        String normalizedMainFileName = FilenameNormalization
+                .normalize(tempFile.getAbsolutePath());
+
+        Collection<ICompilationUnit> mainFileCompilationUnits = workspace
+                .getCompilationUnits(normalizedMainFileName, project);
+
+        ICompilationUnit cu = null;
+        for (ICompilationUnit cu2 : mainFileCompilationUnits)
+        {
+            if (cu2 != null)
+                cu = cu2;
+        }
+
+        IASNode fileNode = null;
+        try
+        {
+            fileNode = cu.getSyntaxTreeRequest().get().getAST();
+        }
+        catch (InterruptedException e)
+        {
+            e.printStackTrace();
+        }
+
+        return fileNode;
+    }
+
+    protected List<String> compileProject(String inputFileName,
+            String inputDirName) 
+    {
+    	return compileProject(inputFileName, inputDirName, new StringBuilder(), true);
+    }
+    
+    protected List<String> compileProject(String inputFileName,
+            String inputDirName, StringBuilder sb, boolean ignoreErrors) 
+    {
+        List<String> compiledFileNames = new ArrayList<String>();
+
+        String mainFileName = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                inputDirName + "/" + inputFileName + inputFileExtension).getPath();
+
+        addDependencies();
+
+        ICompilationUnit mainCU = Iterables
+                .getOnlyElement(workspace.getCompilationUnits(
+                        FilenameNormalization.normalize(mainFileName), project));
+        
+        if (project instanceof FlexJSProject)
+            ((FlexJSProject) project).mainCU = mainCU;
+        
+        Configurator projectConfigurator = backend.createConfigurator();
+
+        JSTarget target = (JSTarget) backend.createTarget(project,
+                projectConfigurator.getTargetSettings(null), null);
+
+        ArrayList<ICompilerProblem> errors = new ArrayList<ICompilerProblem>();
+        target.build(mainCU, errors);
+
+        if (!ignoreErrors && errors.size() > 0)
+        {
+        	for (ICompilerProblem error : errors)
+        	{
+        		String fn = error.getSourcePath();
+                if(fn != null) {
+                    int c = fn.indexOf(testAdapter.getUnitTestBaseDir().getPath());
+                    fn = fn.substring(c);
+                    sb.append(fn);
+                    sb.append("(" + error.getLine() + ":" + error.getColumn() + ")\n");
+                    sb.append(error.toString() + "\n");
+                }
+        	}
+        	System.out.println(sb.toString());
+        	return compiledFileNames;
+        }
+        List<ICompilationUnit> reachableCompilationUnits = project
+                .getReachableCompilationUnitsInSWFOrder(ImmutableSet.of(mainCU));
+        for (final ICompilationUnit cu : reachableCompilationUnits)
+        {
+            try
+            {
+                ICompilationUnit.UnitType cuType = cu.getCompilationUnitType();
+
+                if (cuType == ICompilationUnit.UnitType.AS_UNIT
+                        || cuType == ICompilationUnit.UnitType.MXML_UNIT)
+                {
+                    File outputRootDir = new File(
+                            FilenameNormalization.normalize(tempDir
+                                    + File.separator + inputDirName));
+
+                    String qname = cu.getQualifiedNames().get(0);
+
+                    compiledFileNames.add(qname.replace(".", "/"));
+
+                    final File outputClassFile = getOutputClassFile(qname
+                            + "_output", outputRootDir);
+
+                    ASFilterWriter writer = backend.createWriterBuffer(project);
+                    IASEmitter emitter = backend.createEmitter(writer);
+                    IASBlockWalker walker = backend.createWalker(project,
+                            errors, emitter);
+
+                    walker.visitCompilationUnit(cu);
+
+                    //System.out.println(writer.toString());
+
+                    BufferedOutputStream out = new BufferedOutputStream(
+                            new FileOutputStream(outputClassFile));
+
+                    out.write(emitter.postProcess(writer.toString()).getBytes());
+                    out.flush();
+                    out.close();
+                }
+            }
+            catch (Exception e)
+            {
+                //System.out.println(e.getMessage());
+            }
+        }
+
+        File outputRootDir = new File(
+                FilenameNormalization.normalize(tempDir
+                        + File.separator + inputDirName));
+        String qname;
+		try {
+			qname = mainCU.getQualifiedNames().get(0);
+	        final File outputClassFile = getOutputClassFile(qname
+	                + "_output", outputRootDir);
+	        appendLanguageAndXML(outputClassFile.getAbsolutePath(), qname);
+		} catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+        return compiledFileNames;
+    }
+
+    protected void writeFile(String path, String content, boolean append)
+    throws IOException
+	{
+		File tgtFile = new File(path);
+		
+		if (!tgtFile.exists())
+		    tgtFile.createNewFile();
+		
+		FileWriter fw = new FileWriter(tgtFile, append);
+		fw.write(content);
+		fw.close();
+	}
+    
+    private void appendLanguageAndXML(String path, String projectName) throws IOException
+    {
+        StringBuilder appendString = new StringBuilder();
+        appendString.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+        appendString.append(ASEmitterTokens.PAREN_OPEN.getToken());
+        appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+        appendString.append(JSFlexJSEmitterTokens.LANGUAGE_QNAME.getToken());
+        appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+        appendString.append(ASEmitterTokens.PAREN_CLOSE.getToken());
+        appendString.append(ASEmitterTokens.SEMICOLON.getToken());
+        appendString.append("\n");
+
+        String fileData = readCode(new File(path));
+        int reqidx = fileData.indexOf(appendString.toString());
+	    if (reqidx == -1 && project instanceof FlexJSProject && ((FlexJSProject)project).needLanguage)
+        {
+	    	boolean afterProvide = false;
+            reqidx = fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+            if (reqidx == -1)
+            {
+            	afterProvide = true;
+                reqidx = fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_PROVIDE.getToken());
+            }
+            reqidx = fileData.indexOf(";", reqidx);
+            String after = fileData.substring(reqidx + 1);
+            String before = fileData.substring(0, reqidx + 1);
+            if (afterProvide)
+            	before += "\n";
+            String s = before + "\n" + appendString.toString() + after;
+            writeFile(path, s, false);
+        }
+        
+        StringBuilder appendStringXML = new StringBuilder();
+        appendStringXML.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+        appendStringXML.append(ASEmitterTokens.PAREN_OPEN.getToken());
+        appendStringXML.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+        appendStringXML.append(IASLanguageConstants.XML);
+        appendStringXML.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+        appendStringXML.append(ASEmitterTokens.PAREN_CLOSE.getToken());
+        appendStringXML.append(ASEmitterTokens.SEMICOLON.getToken());
+        appendStringXML.append("\n");
+
+        if (project instanceof FlexJSProject && ((FlexJSProject)project).needXML)
+        {
+	        fileData = readCode(new File(path));
+	        reqidx = fileData.indexOf(appendStringXML.toString());
+	        if (reqidx == -1)
+	        {
+		    	boolean afterProvide = false;
+	            reqidx = fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+	            if (reqidx == -1)
+	            {
+	            	afterProvide = true;
+	                reqidx = fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_PROVIDE.getToken());
+	            }
+	            reqidx = fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+	            if (reqidx == -1)
+	                reqidx = fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_PROVIDE.getToken());
+	            reqidx = fileData.indexOf(";", reqidx);
+	            String after = fileData.substring(reqidx + 1);
+	            String before = fileData.substring(0, reqidx + 1);
+	            if (afterProvide)
+	            	before += "\n";
+	            String s = before + "\n" + appendStringXML.toString() + after;
+	            writeFile(path, s, false);
+	        }
+        }
+    }
+
+	protected String readCode(File file)
+	{
+	    String code = "";
+	    try
+	    {
+	        BufferedReader in = new BufferedReader(new InputStreamReader(
+	                new FileInputStream(file), "UTF8"));
+	
+	        String line = in.readLine();
+	
+	        while (line != null)
+	        {
+	            code += line + "\n";
+	            line = in.readLine();
+	        }
+	        code = code.substring(0, code.length() - 1);
+	
+	        in.close();
+	    }
+	    catch (Exception e)
+	    {
+	        // nothing to see, move along...
+	    }
+	
+	    return code;
+	}
+
+    protected File getOutputClassFile(String qname, File outputFolder)
+    {
+        String[] cname = qname.split("\\.");
+        String sdirPath = outputFolder + File.separator;
+        if (cname.length > 0)
+        {
+            for (int i = 0, n = cname.length - 1; i < n; i++)
+            {
+                sdirPath += cname[i] + File.separator;
+            }
+
+            File sdir = new File(sdirPath);
+            if (!sdir.exists())
+                sdir.mkdirs();
+
+            qname = cname[cname.length - 1];
+        }
+
+        return new File(sdirPath + qname + "." + backend.getOutputExtension());
+    }
+
+    protected IMXMLFileNode compileMXML(String input)
+    {
+        return compileMXML(input, false, "");
+    }
+
+    protected IMXMLFileNode compileMXML(String input, boolean isFileName,
+            String inputDir)
+    {
+        return compileMXML(input, isFileName, inputDir, true);
+    }
+
+    protected IMXMLFileNode compileMXML(String input, boolean isFileName,
+            String inputDir, boolean useTempFile)
+    {
+        return (IMXMLFileNode) compile(input, isFileName, inputDir, useTempFile);
+    }
+
+    protected File writeCodeToTempFile(String input, boolean isFileName,
+            String inputDir)
+    {
+        File tempASFile = null;
+        try
+        {
+            String tempFileName = (isFileName) ? input : getClass()
+                    .getSimpleName();
+
+            tempASFile = File.createTempFile(tempFileName, inputFileExtension,
+                    new File(TestAdapterFactory.getTestAdapter().getTempDir()));
+            tempASFile.deleteOnExit();
+
+            String code = "";
+            if (!isFileName)
+            {
+                code = input;
+            }
+            else
+            {
+                code = getCodeFromFile(input, false, inputDir);
+            }
+
+            BufferedWriter out = new BufferedWriter(new FileWriter(tempASFile));
+            out.write(code);
+            out.close();
+        }
+        catch (IOException e1)
+        {
+            e1.printStackTrace();
+        }
+
+        return tempASFile;
+    }
+
+    protected void writeResultToFile(String result, String fileName)
+    {
+        BufferedWriter writer = null;
+        try
+        {
+            writer = new BufferedWriter(new OutputStreamWriter(
+                    new FileOutputStream(new File(tempDir, fileName + ".js")),
+                    "utf-8"));
+            writer.write(result);
+        }
+        catch (IOException e1)
+        {
+            e1.printStackTrace();
+        }
+        finally
+        {
+            try
+            {
+                writer.close();
+            }
+            catch (Exception ex)
+            {
+            }
+        }
+    }
+
+    /**
+     * Overridable setup of dependencies, default adds source, libraries and
+     * namepsaces.
+     * <p>
+     * The test will then set the dependencies on the current
+     * {@link ICompilerProject}.
+     */
+    protected void addDependencies()
+    {
+        addSourcePaths(sourcePaths);
+        addLibraries(libraries);
+        addNamespaceMappings(namespaceMappings);
+
+        project.setSourcePath(sourcePaths);
+        project.setLibraries(libraries);
+        project.setNamespaceMappings(namespaceMappings);
+    }
+
+    protected void addLibraries(List<File> libraries)
+    {
+    }
+
+    protected void addSourcePaths(List<File> sourcePaths)
+    {
+        sourcePaths.add(tempDir);
+    }
+
+    protected void addNamespaceMappings(
+            List<IMXMLNamespaceMapping> namespaceMappings)
+    {
+    }
+
+    protected String getCodeFromFile(String fileName, boolean isJS,
+            String sourceDir)
+    {
+        File testFile = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                sourceDir + "/" + fileName
+                        + (isJS ? ".js" : inputFileExtension));
+
+        return readCodeFile(testFile);
+    }
+
+    protected String readCodeFile(File file)
+    {
+        boolean isResult = file.getName().contains("_result") || file.getName().equals("output.js");
+        String code = "";
+        try
+        {
+            BufferedReader in = new BufferedReader(new InputStreamReader(
+                    new FileInputStream(file), "UTF8"));
+
+            String line = in.readLine();
+            if (line.contains("/**") && isResult)
+            {
+                // eat opening comment which should be apache header
+                while (line != null)
+                {
+                    line = in.readLine();
+                    if (line.contains("*/"))
+                    {
+                        line = in.readLine();
+                        break;
+                    }
+                }
+            }
+            while (line != null)
+            {
+                code += line + "\n";
+                line = in.readLine();
+            }
+            code = code.substring(0, code.length() - 1);
+            code = removeGeneratedString(code);
+
+            in.close();
+        }
+        catch (Exception e)
+        {
+        }
+        return code;
+    }
+
+    protected IASNode findFirstDescendantOfType(IASNode node,
+            Class<? extends IASNode> nodeType)
+    {
+        int n = node.getChildCount();
+        for (int i = 0; i < n; i++)
+        {
+            IASNode child = node.getChild(i);
+            if (child instanceof ImportNode)
+                continue;   // not interested in these and they have BinaryOps inside
+            if (child instanceof FunctionNode)
+            {
+                ((FunctionNode) child).parseFunctionBody(errors);
+            }
+            if (nodeType.isInstance(child))
+                return child;
+
+            IASNode found = findFirstDescendantOfType(child, nodeType);
+            if (found != null)
+                return found;
+        }
+
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/VF2JSMXMLTestBase.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/VF2JSMXMLTestBase.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/VF2JSMXMLTestBase.java
new file mode 100644
index 0000000..a421d5e
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/VF2JSMXMLTestBase.java
@@ -0,0 +1,219 @@
+/*
+ *
+ *  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.internal.test;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.ASFilterWriter;
+import org.apache.flex.compiler.internal.driver.mxml.vf2js.MXMLVF2JSBackend;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.Ignore;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+
+@Ignore
+public class VF2JSMXMLTestBase extends MXMLTestBase
+{
+
+    @Override
+    public void setUp()
+    {
+    	project = new FlexJSProject(workspace);
+    	
+        super.setUp();
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new MXMLVF2JSBackend();
+    }
+
+
+    @Override
+    protected List<String> compileProject(String inputFileName,
+            String inputDirName)
+    {
+        List<String> compiledFileNames = new ArrayList<String>();
+
+        String mainFileName = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                inputDirName + "/" + inputFileName + inputFileExtension).getPath();
+
+        addDependencies();
+
+        String normalizedFileName = FilenameNormalization.normalize(
+                mainFileName);
+        Collection<ICompilationUnit> compilationUnits = 
+                workspace.getCompilationUnits(normalizedFileName, project);
+        ICompilationUnit mainCU = Iterables.getOnlyElement(
+                compilationUnits);
+        
+        if (project instanceof FlexJSProject)
+            ((FlexJSProject) project).mainCU = mainCU;
+        
+        Configurator projectConfigurator = backend.createConfigurator();
+
+        JSTarget target = (JSTarget) backend.createTarget(project,
+                projectConfigurator.getTargetSettings(null), null);
+
+        target.build(mainCU, new ArrayList<ICompilerProblem>());
+
+        List<ICompilationUnit> reachableCompilationUnits = project
+                .getReachableCompilationUnitsInSWFOrder(ImmutableSet.of(mainCU));
+        for (final ICompilationUnit cu : reachableCompilationUnits)
+        {
+            ICompilationUnit.UnitType cuType = cu.getCompilationUnitType();
+
+            if (cuType == ICompilationUnit.UnitType.AS_UNIT
+                    || cuType == ICompilationUnit.UnitType.MXML_UNIT)
+            {
+                File outputRootDir = new File(
+                        FilenameNormalization.normalize(tempDir
+                                + File.separator + inputDirName));
+
+                String qname = "";
+                try
+                {
+                    qname = cu.getQualifiedNames().get(0);
+                }
+                catch (InterruptedException error)
+                {
+                    System.out.println(error);
+                }
+
+                compiledFileNames.add(qname.replace(".", "/"));
+
+                final File outputClassFile = getOutputClassFile(qname
+                        + "_output", outputRootDir);
+
+                ASFilterWriter outputWriter = backend.createWriterBuffer(project);
+
+                if (cuType == ICompilationUnit.UnitType.AS_UNIT)
+                {
+                    asEmitter = backend.createEmitter(outputWriter);
+                    asBlockWalker = backend.createWalker(project, errors, asEmitter);
+
+                	asBlockWalker.visitCompilationUnit(cu);
+                }
+                else
+                {
+                    mxmlEmitter = backend.createMXMLEmitter(outputWriter);
+                    
+                    mxmlBlockWalker = backend.createMXMLWalker(project, errors,
+                            mxmlEmitter, asEmitter, asBlockWalker);
+
+                    mxmlBlockWalker.visitCompilationUnit(cu);
+                }
+                
+                //System.out.println(outputWriter.toString());
+
+                try
+                {
+                    BufferedOutputStream out = new BufferedOutputStream(
+                            new FileOutputStream(outputClassFile));
+
+                    out.write(outputWriter.toString().getBytes());
+                    out.flush();
+                    out.close();
+                }
+                catch (Exception error)
+                {
+                    System.out.println(error);
+                }
+                
+                outputWriter = null;
+            }
+        }
+
+        return compiledFileNames;
+    }
+
+    //--------------------------------------------------------------------------
+    // Node "factory"
+    //--------------------------------------------------------------------------
+
+    public static final int WRAP_LEVEL_DOCUMENT = 1;
+    public static final int WRAP_LEVEL_NODE = 2;
+
+    protected IMXMLNode getNode(String code, Class<? extends IMXMLNode> type,
+            int wrapLevel)
+    {
+        if (wrapLevel >= WRAP_LEVEL_NODE)
+            code = "<s:Button " + code + "></s:Button>";
+
+        if (wrapLevel >= WRAP_LEVEL_DOCUMENT)
+            code = ""
+                    + "<s:Application xmlns:fx=\"http://ns.adobe.com/mxml/2009\""
+                    + "               xmlns:s=\"library://ns.adobe.com/flex/spark\"" 
+                    + "               xmlns:mx=\"library://ns.adobe.com/flex/mx\">\n"
+                    + code + "\n"
+                    + "</s:Application>";
+        
+        IMXMLFileNode node = compileMXML(code);
+
+        if (wrapLevel >= WRAP_LEVEL_NODE) // for now: attributes
+        {
+            IMXMLNode pnode = findFirstDescendantOfType(node, type);
+
+            IMXMLNode cnode = findFirstDescendantOfType(pnode, type);
+
+            return cnode;
+        }
+        else
+        {
+            return findFirstDescendantOfType(node, type);
+        }
+    }
+
+    protected IMXMLNode findFirstDescendantOfType(IMXMLNode node,
+            Class<? extends IMXMLNode> nodeType)
+    {
+
+        int n = node.getChildCount();
+        for (int i = 0; i < n; i++)
+        {
+            IMXMLNode child = (IMXMLNode) node.getChild(i);
+            if (nodeType.isInstance(child))
+                return child;
+
+            IMXMLNode found = findFirstDescendantOfType(child,
+                    nodeType);
+            if (found != null)
+                return found;
+        }
+
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/VF2JSTestBase.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/VF2JSTestBase.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/VF2JSTestBase.java
new file mode 100644
index 0000000..f6cbf58
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/VF2JSTestBase.java
@@ -0,0 +1,238 @@
+/*
+ *
+ *  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.internal.test;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.ASFilterWriter;
+import org.apache.flex.compiler.internal.driver.js.vf2js.VF2JSBackend;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.ITestAdapter;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.Ignore;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+
+@Ignore
+public class VF2JSTestBase extends MXMLTestBase
+{
+    private static ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
+
+    @Override
+    public void setUp()
+    {
+    	project = new FlexJSProject(workspace);
+
+    	super.setUp();
+    }
+
+    @Override
+    public void tearDown()
+    {
+        asEmitter = null;
+        asBlockWalker = null;
+        mxmlEmitter = null;
+        mxmlBlockWalker = null;
+        
+        super.tearDown();
+    }
+
+    @Override
+    protected void addSourcePaths(List<File> sourcePaths)
+    {
+        //sourcePaths.add(new File(FilenameNormalization.normalize("")));
+
+        super.addSourcePaths(sourcePaths);
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new VF2JSBackend();
+    }
+
+    @Override
+    protected List<String> compileProject(String inputFileName,
+            String inputDirName)
+    {
+        List<String> compiledFileNames = new ArrayList<String>();
+
+        String mainFileName = new File(testAdapter.getUnitTestBaseDir(),
+                inputDirName + "/" + inputFileName + inputFileExtension).getPath();
+
+        addDependencies();
+
+        String normalizedFileName = FilenameNormalization.normalize(
+                mainFileName);
+        Collection<ICompilationUnit> compilationUnits = 
+                workspace.getCompilationUnits(normalizedFileName, project);
+        ICompilationUnit mainCU = Iterables.getOnlyElement(
+                compilationUnits);
+        
+        if (project instanceof FlexJSProject)
+            ((FlexJSProject) project).mainCU = mainCU;
+        
+        Configurator projectConfigurator = backend.createConfigurator();
+
+        JSTarget target = (JSTarget) backend.createTarget(project,
+                projectConfigurator.getTargetSettings(null), null);
+
+        target.build(mainCU, new ArrayList<ICompilerProblem>());
+
+        List<ICompilationUnit> reachableCompilationUnits = project
+                .getReachableCompilationUnitsInSWFOrder(ImmutableSet.of(mainCU));
+        for (final ICompilationUnit cu : reachableCompilationUnits)
+        {
+            ICompilationUnit.UnitType cuType = cu.getCompilationUnitType();
+
+            if (cuType == ICompilationUnit.UnitType.AS_UNIT
+                    || cuType == ICompilationUnit.UnitType.MXML_UNIT)
+            {
+                File outputRootDir = new File(
+                        FilenameNormalization.normalize(tempDir
+                                + File.separator + inputDirName));
+
+                String qname = "";
+                try
+                {
+                    qname = cu.getQualifiedNames().get(0);
+                }
+                catch (InterruptedException error)
+                {
+                    System.out.println(error);
+                }
+
+                compiledFileNames.add(qname.replace(".", "/"));
+
+                final File outputClassFile = getOutputClassFile(qname
+                        + "_output", outputRootDir);
+
+                ASFilterWriter outputWriter = backend.createWriterBuffer(project);
+
+                //asEmitter = backend.createEmitter(outputWriter);
+                //asBlockWalker = backend.createWalker(project, errors, asEmitter);
+
+                if (cuType == ICompilationUnit.UnitType.AS_UNIT)
+                {
+                    asBlockWalker.visitCompilationUnit(cu);
+                }
+                else
+                {
+                    //mxmlEmitter = backend.createMXMLEmitter(outputWriter);
+                    
+                    //mxmlBlockWalker = backend.createMXMLWalker(project, errors,
+                    //        mxmlEmitter, asEmitter, asBlockWalker);
+
+                    mxmlBlockWalker.visitCompilationUnit(cu);
+                }
+                
+                System.out.println(outputWriter.toString());
+
+                try
+                {
+                    BufferedOutputStream out = new BufferedOutputStream(
+                            new FileOutputStream(outputClassFile));
+
+                    out.write(outputWriter.toString().getBytes());
+                    out.flush();
+                    out.close();
+                }
+                catch (Exception error)
+                {
+                    System.out.println(error);
+                }
+                
+                outputWriter = null;
+            }
+        }
+
+        return compiledFileNames;
+    }
+
+    //--------------------------------------------------------------------------
+    // Node "factory"
+    //--------------------------------------------------------------------------
+
+    public static final int WRAP_LEVEL_DOCUMENT = 1;
+    public static final int WRAP_LEVEL_NODE = 2;
+
+    protected IMXMLNode getNode(String code, Class<? extends IMXMLNode> type,
+            int wrapLevel)
+    {
+        if (wrapLevel >= WRAP_LEVEL_NODE)
+            code = "<s:Button " + code + "></s:Button>";
+
+        if (wrapLevel >= WRAP_LEVEL_DOCUMENT)
+            code = ""
+                    + "<s:Application xmlns:fx=\"http://ns.adobe.com/mxml/2009\""
+                    + "               xmlns:s=\"library://ns.adobe.com/flex/spark\"" 
+                    + "               xmlns:mx=\"library://ns.adobe.com/flex/mx\">\n"
+                    + code + "\n"
+                    + "</s:Application>";
+        
+        IMXMLFileNode node = compileMXML(code);
+
+        if (wrapLevel >= WRAP_LEVEL_NODE) // for now: attributes
+        {
+            IMXMLNode pnode = findFirstDescendantOfType(node, type);
+
+            IMXMLNode cnode = findFirstDescendantOfType(pnode, type);
+
+            return cnode;
+        }
+        else
+        {
+            return findFirstDescendantOfType(node, type);
+        }
+    }
+
+    protected IMXMLNode findFirstDescendantOfType(IMXMLNode node,
+            Class<? extends IMXMLNode> nodeType)
+    {
+
+        int n = node.getChildCount();
+        for (int i = 0; i < n; i++)
+        {
+            IMXMLNode child = (IMXMLNode) node.getChild(i);
+            if (nodeType.isInstance(child))
+                return child;
+
+            IMXMLNode found = findFirstDescendantOfType(child,
+                    nodeType);
+            if (found != null)
+                return found;
+        }
+
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/utils/EnvProperties.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/utils/EnvProperties.java b/compiler-jx/src/test/java/org/apache/flex/utils/EnvProperties.java
new file mode 100644
index 0000000..97d4835
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/utils/EnvProperties.java
@@ -0,0 +1,149 @@
+/*
+ *
+ *  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.utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Properties;
+
+
+/**
+ *  EnvProperties checks in following order for a value.
+ *
+ *  1) unittest.properties
+ *  2) environment variables
+ *  3) for key FLEX_HOME & PLAYERGLOBAL_HOME sets a default value.
+ */
+public class EnvProperties {
+
+    /**
+     * FLEX_HOME
+     */
+    public String SDK;
+
+    /**
+     * TLF_HOME
+     */
+    public String TLF;
+
+    /**
+     * PLAYERGLOBAL_HOME
+     */
+    public String FPSDK;
+
+    /**
+     * AIR_HOME
+     */
+    public String AIRSDK;
+
+    /**
+     * FLASHPLAYER_DEBUGGER
+     */
+    public String FDBG;
+
+    /**
+     * ASJS_HOME
+     */
+    public String ASJS;
+
+    /**
+     * PLAYERGLOBAL_VERSION
+     */
+    public String FPVER;
+
+
+    private static EnvProperties env;
+
+    public static EnvProperties initiate() {
+        if(env == null) {
+            env = new EnvProperties();
+            env.setup();
+        }
+        return env;
+    }
+
+    private void setup()
+    {
+        String prefix = "";
+        Properties p = new Properties();
+        String envFileName = FilenameNormalization.normalize("../env.properties");
+        try {
+            File f = new File(envFileName);
+            if (f.exists())
+            {
+                p.load(new FileInputStream( f ));
+                prefix = "env.";
+            }
+        } catch (FileNotFoundException e) {
+            System.out.println(envFileName + " not found");
+            try {
+                File f = new File("unittest.properties");
+                p.load(new FileInputStream( f ));
+            } catch (FileNotFoundException e1) {
+                System.out.println("unittest.properties not found");
+            } catch (IOException e1) {
+                // Ignore
+            }
+        } catch (IOException e) {
+            // Ignore
+        }
+
+        SDK = p.getProperty(prefix + "FLEX_HOME", System.getenv("FLEX_HOME"));
+        if(SDK == null)
+        {
+            SDK = FilenameNormalization.normalize("../../flex-sdk");
+            File mxmlc = new File(SDK + "/lib/mxmlc.jar");
+            if (!mxmlc.exists())
+                SDK = FilenameNormalization.normalize("../compiler/generated/dist/sdk");
+        }
+        System.out.println("environment property - FLEX_HOME = " + SDK);
+
+        FPSDK = p.getProperty(prefix + "PLAYERGLOBAL_HOME", System.getenv("PLAYERGLOBAL_HOME"));
+        if(FPSDK == null)
+            FPSDK = FilenameNormalization.normalize("../compiler/generated/dist/sdk/frameworks/libs/player");
+        System.out.println("environment property - PLAYERGLOBAL_HOME = " + FPSDK);
+
+        FPVER = p.getProperty(prefix + "PLAYERGLOBAL_VERSION", System.getenv("PLAYERGLOBAL_VERSION"));
+        if (FPVER == null)
+            FPVER = "11.1";
+        System.out.println("environment property - PLAYERGLOBAL_VERSION = " + FPVER);
+
+        TLF = p.getProperty(prefix + "TLF_HOME", System.getenv("TLF_HOME"));
+        if (TLF == null)
+        {
+            TLF = FilenameNormalization.normalize("../../flex-tlf");
+        }
+        System.out.println("environment property - TLF_HOME = " + TLF);
+
+        AIRSDK = p.getProperty(prefix + "AIR_HOME", System.getenv("AIR_HOME"));
+        System.out.println("environment property - AIR_HOME = " + AIRSDK);
+
+        FDBG = p.getProperty(prefix + "FLASHPLAYER_DEBUGGER", System.getenv("FLASHPLAYER_DEBUGGER"));
+        System.out.println("environment property - FLASHPLAYER_DEBUGGER = " + FDBG);
+
+        ASJS = p.getProperty(prefix + "ASJS_HOME", System.getenv("ASJS_HOME"));
+        if (ASJS == null)
+            ASJS = FilenameNormalization.normalize("../../flex-asjs");
+        System.out.println("environment property - ASJS_HOME = " + ASJS);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/amd/simple-project/src/HelloWorld.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/amd/simple-project/src/HelloWorld.as b/compiler-jx/src/test/resources/amd/simple-project/src/HelloWorld.as
new file mode 100644
index 0000000..a8464e6
--- /dev/null
+++ b/compiler-jx/src/test/resources/amd/simple-project/src/HelloWorld.as
@@ -0,0 +1,55 @@
+/*
+ *
+ *  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 {
+
+import com.acme.A;
+import com.acme.B;
+import com.acme.I;
+import com.acme.sub.IOther;
+import com.acme.sub.ISub;
+
+//noinspection JSUnusedGlobalSymbols
+public class HelloWorld {
+
+  //noinspection JSUnusedGlobalSymbols
+  public function HelloWorld() {
+    trace(B.now);
+    trace(B.nowPlusOne());
+
+    var b:B = new B('hello ');
+    trace("b = new B('hello '):", b);
+    trace("b.foo(3):", b.foo(3));
+    trace("b.baz():", b.baz());
+    trace("b is A:", b is A);
+    trace("b is B:", b is B);
+    trace("b is I:", b is I);
+    trace("b is ISub:", b is ISub);
+    trace("b is IOther:", b is IOther);
+
+    var a:A = new A('123');
+    trace("a = new A('123'):", a);
+    trace("a is A:", a is A);
+    trace("a is B:", a is B);
+    trace("a is I:", a is I);
+    trace("a is ISub:", a is ISub);
+    trace("a is IOther:", a is IOther);
+  }
+}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/A.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/A.as b/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/A.as
new file mode 100644
index 0000000..a6ca41e
--- /dev/null
+++ b/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/A.as
@@ -0,0 +1,57 @@
+/*
+ *
+ *  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 com.acme {
+public class A implements I {
+  
+  public function A(msg:String) {
+    this.msg = msg;
+  }
+
+  private var _msg:int;
+
+  public function get msg():String {
+    return String(this._msg);
+  }
+
+  trace("Class A is initialized!");
+
+  public function set msg(value:String):void {
+    this._msg = parseInt(value, 10);
+  }
+
+  private function secret(n) {
+    return msg + n;
+  }
+
+  public function foo(x) {
+    return this.secret(A.bar(x));
+  }
+
+  public function baz() {
+    var tmp = this.secret;
+    return tmp("-bound");
+  }
+
+  public static function bar(x) {
+    return x + 1;
+  }
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/B.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/B.as b/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/B.as
new file mode 100644
index 0000000..eac2c60
--- /dev/null
+++ b/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/B.as
@@ -0,0 +1,47 @@
+/*
+ *
+ *  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 com.acme {
+import com.acme.sub.IOther;
+import com.acme.sub.ISub;
+
+public class B extends A implements IOther, ISub {
+
+  public static function nowPlusOne() {
+    return new Date(B.now.getTime() + 60*60*1000);
+  }
+
+  public function B(msg, count) {
+    super(msg);
+    this.count = count;
+    trace("now: " + B.now);
+  }
+
+  public var count = 0;
+
+  public var barfoo = A.bar(3);
+
+  public override function foo(x) {
+    return super.foo(x + 2) + "-sub";
+  }
+
+  public static var now = new Date();
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/I.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/I.as b/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/I.as
new file mode 100644
index 0000000..4766279
--- /dev/null
+++ b/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/I.as
@@ -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.
+ *
+ */
+
+package com.acme {
+public interface I {
+
+  function get msg():String;
+
+}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/sub/IOther.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/sub/IOther.as b/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/sub/IOther.as
new file mode 100644
index 0000000..e211130
--- /dev/null
+++ b/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/sub/IOther.as
@@ -0,0 +1,25 @@
+/*
+ *
+ *  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 com.acme.sub {
+
+public interface IOther {
+
+}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/sub/ISub.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/sub/ISub.as b/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/sub/ISub.as
new file mode 100644
index 0000000..6259ce6
--- /dev/null
+++ b/compiler-jx/src/test/resources/amd/simple-project/src/com/acme/sub/ISub.as
@@ -0,0 +1,28 @@
+/*
+ *
+ *  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 com.acme.sub {
+import com.acme.I;
+
+public interface ISub extends I {
+
+  function foo(x);
+
+}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/externals/app1/as_src/Main.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/externals/app1/as_src/Main.as b/compiler-jx/src/test/resources/externals/app1/as_src/Main.as
new file mode 100644
index 0000000..3c5095a
--- /dev/null
+++ b/compiler-jx/src/test/resources/externals/app1/as_src/Main.as
@@ -0,0 +1,34 @@
+/*
+ *
+ *  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
+{
+public class Main
+{
+	public function start():void
+	{
+		var button:Element = document.createElement("button");
+        button.onclick = function ():void {
+            alert("Hello browser from FalconJX!");
+        };
+        button.textContent = "Say Hello";
+        document.body.appendChild(button);
+	}
+}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/externals_unit_tests/annotation_enum.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/externals_unit_tests/annotation_enum.js b/compiler-jx/src/test/resources/externals_unit_tests/annotation_enum.js
new file mode 100644
index 0000000..1b578cd
--- /dev/null
+++ b/compiler-jx/src/test/resources/externals_unit_tests/annotation_enum.js
@@ -0,0 +1,61 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+/**
+ * @enum {string}
+ * @see http://dev.w3.org/csswg/css-font-loading/#enumdef-fontfaceloadstatus
+ */
+var FontFaceLoadStatus = {
+ ERROR: 'error',
+ LOADED: 'loaded',
+ LOADING: 'loading',
+ UNLOADED: 'unloaded'
+};
+
+/**
+ * @enum
+ * @see http://dev.w3.org/csswg/css-font-loading/#enumdef-fontfacesetloadstatus
+ */
+var FontFaceSetLoadStatus = {
+ FOO_LOADED: 'loaded',
+ FOO_LOADING: 'loading'
+};
+
+/** @const */
+var foo = {};
+/** @const */
+foo.bar = {};
+/** @const */
+foo.bar.baz = {};
+
+/**
+ * @enum
+ */
+foo.bar.baz.QualifiedEnum = {
+ One: '1',
+ Two: '2'
+};
+
+
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/externals_unit_tests/constructor_members.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/externals_unit_tests/constructor_members.js b/compiler-jx/src/test/resources/externals_unit_tests/constructor_members.js
new file mode 100644
index 0000000..fef6730
--- /dev/null
+++ b/compiler-jx/src/test/resources/externals_unit_tests/constructor_members.js
@@ -0,0 +1,57 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+// define class
+/**
+ * @constructor
+ * @param {number} y
+ * @param {*=} opt_separator
+ * @param {...*} var_args
+ */
+function Foo(arg1, opt_arg2, var_args) {}
+
+// property
+/**
+ * @type {Function}
+ */
+Foo.prototype.bar;
+
+// global variable instance
+/**
+ * @type {!Foo}
+ */
+var foo;
+
+// method with arg and no return
+/**
+ * @param {string} arg1
+ */
+Foo.prototype.method1 = function(arg1) {};
+
+// method with arg and return
+/**
+ * @param {string} arg1
+ * @return {boolean}
+ */
+Foo.prototype.method2 = function(arg1) {};
+
+/**
+ * @const
+ */
+var bar;

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/externals_unit_tests/constructor_params.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/externals_unit_tests/constructor_params.js b/compiler-jx/src/test/resources/externals_unit_tests/constructor_params.js
new file mode 100644
index 0000000..2e8d7eb
--- /dev/null
+++ b/compiler-jx/src/test/resources/externals_unit_tests/constructor_params.js
@@ -0,0 +1,81 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+/**
+ * A constructor with no args.
+ *
+ * @constructor
+ */
+function FooNoArgs() {}
+
+/**
+ * A constructor with arg and opt arg.
+ *
+ * @constructor
+ * @param {number} arg1
+ * @param {*=} opt_arg2
+ */
+function FooOptArgs(arg1, opt_arg2) {}
+
+/**
+ * A constructor with arg and var args.
+ *
+ * @constructor
+ * @param {number} arg1
+ * @param {...*} var_args
+ */
+function FooVarArgs(arg1, var_args) {}
+
+/**
+ * A constructor with arg, opt arg and var args.
+ *
+ * @constructor
+ * @param {number} arg1 The arg 1.
+ * @param {*=} opt_arg2 The arg  that is
+ * wrapped by another
+ * line in the comment.
+ * @param {...*} var_args A var agr param.
+ * @see http://foo.bar.com
+ * @returns {FooVarArgs} Another instance.
+ */
+function FooOptVarArgs(arg1, opt_arg2, var_args) {}
+
+/**
+ * A constructor with no args.
+ *
+ * @constructor
+ */
+AssignFooNoArgs = function () {};
+
+/**
+ * A constructor with no args.
+ *
+ * @constructor
+ */
+var VarAssignFooNoArgs = function () {};
+
+/**
+ * @const
+ */
+var FinalClass = {};
+
+/**
+ * A static method.
+ */
+FinalClass.bar = function () {};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/externals_unit_tests/imports/import_constructor_signatures.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/externals_unit_tests/imports/import_constructor_signatures.js b/compiler-jx/src/test/resources/externals_unit_tests/imports/import_constructor_signatures.js
new file mode 100644
index 0000000..9f80e7e
--- /dev/null
+++ b/compiler-jx/src/test/resources/externals_unit_tests/imports/import_constructor_signatures.js
@@ -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.
+ *
+ */
+
+
+/**
+ * @constructor
+ * @param {foo.Qux|foo.Bar} qux
+ * @param {foo.Bar} bar
+ * @param {number} value
+ * @param {foo.Baz?} baz
+ */
+ImportConstructorSignature = function(qux, bar, value, baz) {};
+
+/**
+ * @constructor
+ */
+foo.Bar = function() {};
+
+/**
+ * @constructor
+ */
+foo.Baz = function() {};
+
+/**
+ * @constructor
+ */
+foo.Qux = function() {};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/externals_unit_tests/imports/import_functions.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/externals_unit_tests/imports/import_functions.js b/compiler-jx/src/test/resources/externals_unit_tests/imports/import_functions.js
new file mode 100644
index 0000000..b6c170b
--- /dev/null
+++ b/compiler-jx/src/test/resources/externals_unit_tests/imports/import_functions.js
@@ -0,0 +1,47 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+
+/**
+ * @param {foo.Bar} bar
+ * @param {foo.Baz} baz
+ * @param {Quux} quux
+ * @return {!foo.Qux}
+ */
+function ImportFunction(bar, baz, quux) {}
+
+/**
+ * @constructor
+ */
+Quux = function() {};
+
+/**
+ * @constructor
+ */
+foo.Bar = function() {};
+
+/**
+ * @constructor
+ */
+foo.Baz = function() {};
+
+/**
+ * @constructor
+ */
+foo.Qux = function() {};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/externals_unit_tests/imports/import_interfaces.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/externals_unit_tests/imports/import_interfaces.js b/compiler-jx/src/test/resources/externals_unit_tests/imports/import_interfaces.js
new file mode 100644
index 0000000..97a711f
--- /dev/null
+++ b/compiler-jx/src/test/resources/externals_unit_tests/imports/import_interfaces.js
@@ -0,0 +1,49 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+/**
+ * @constructor
+ * @implements {Qux}
+ * @implements {API.Foo}
+ */
+ImportInterfaces = function() {};
+
+
+/**
+ * @interface
+ */
+Qux = function() {};
+
+/**
+ * @interface
+ * @extends {Qux}
+ * @extends {API.Bar}
+ * @extends {API.foo.Baz}
+ */
+API.Foo = function() {};
+
+/**
+ * @interface
+ */
+API.Bar = function() {};
+
+/**
+ * @interface
+ */
+API.foo.Baz = function() {};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/externals_unit_tests/imports/import_method_signatures.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/externals_unit_tests/imports/import_method_signatures.js b/compiler-jx/src/test/resources/externals_unit_tests/imports/import_method_signatures.js
new file mode 100644
index 0000000..6524dc5
--- /dev/null
+++ b/compiler-jx/src/test/resources/externals_unit_tests/imports/import_method_signatures.js
@@ -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.
+ *
+ */
+
+/**
+ * @constructor
+ */
+ImportMethodSignature = function() {};
+
+/**
+ * @param {foo.Quux|foo.Bar} bar
+ * @param {number} value
+ * @param {foo.Baz?} baz
+ */
+ImportMethodSignature.myMethod = function(bar, value, baz) {};
+
+/**
+ * @param {foo.Bar} bar
+ * @param {number} value
+ * @param {foo.Baz?} baz
+ * @return {foo.Qux}
+ */
+ImportMethodSignature.prototype.myMethodWithReturnType = function(bar, value, baz) {};
+
+/**
+ * @param {foo.Bar} bar
+ * @param {number} value
+ * @param {foo.Baz?} baz
+ * @return {foo.Quuux|foo.Bar}
+ */
+ImportMethodSignature.myMethodWithUnionReturnType = function(bar, value, baz) {};
+
+/**
+ * @constructor
+ */
+foo.Bar = function() {};
+
+/**
+ * @constructor
+ */
+foo.Baz = function() {};
+
+/**
+ * @constructor
+ */
+foo.Qux = function() {};
+
+/**
+ * @constructor
+ */
+foo.Quux = function() {};
+
+/**
+ * @constructor
+ */
+foo.Quuux = function() {};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/externals_unit_tests/imports/import_superclasses.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/externals_unit_tests/imports/import_superclasses.js b/compiler-jx/src/test/resources/externals_unit_tests/imports/import_superclasses.js
new file mode 100644
index 0000000..1a549d7
--- /dev/null
+++ b/compiler-jx/src/test/resources/externals_unit_tests/imports/import_superclasses.js
@@ -0,0 +1,46 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+/**
+ * @constructor
+ * @extends {Qux}
+ */
+ImportSuperClass1 = function() {};
+
+/**
+ * @constructor
+ * @extends {BASE.Foo}
+ */
+ImportSuperClass2 = function() {};
+
+/**
+ * @constructor
+ */
+Qux = function() {};
+
+/**
+ * @constructor
+ * @extends {BASE.Bar}
+ */
+BASE.Foo = function() {};
+
+/**
+ * @constructor
+ */
+BASE.Bar = function() {};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/externals_unit_tests/package_namespace.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/externals_unit_tests/package_namespace.js b/compiler-jx/src/test/resources/externals_unit_tests/package_namespace.js
new file mode 100644
index 0000000..3ea2fbf
--- /dev/null
+++ b/compiler-jx/src/test/resources/externals_unit_tests/package_namespace.js
@@ -0,0 +1,48 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+/**
+ * @constructor
+ */
+Foo = function () {};
+
+/**
+ * @const
+ */
+var foo = {};
+
+/**
+ * @const
+ */
+foo.bar = {};
+
+ /**
+  * @constructor
+  */
+foo.bar.Baz = function () {};
+
+/**
+ * @constructor
+ */
+function Goo () {}
+
+/**
+ * @typedef {Foo}
+ */
+var ATypeDef;

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/externals_unit_tests/type_inheritence.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/externals_unit_tests/type_inheritence.js b/compiler-jx/src/test/resources/externals_unit_tests/type_inheritence.js
new file mode 100644
index 0000000..f9ebe8e
--- /dev/null
+++ b/compiler-jx/src/test/resources/externals_unit_tests/type_inheritence.js
@@ -0,0 +1,62 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+// type logic uses Object as the top of the tree
+/**
+ * @constructor
+ */
+function Object() {}
+
+/**
+ * @interface
+ */
+function EventTarget() {}
+
+/**
+ * @param {string} type
+ * @param {EventListener|function(!Event):(boolean|undefined)} listener
+ * @param {boolean} useCapture
+ * @return {undefined}
+ */
+EventTarget.prototype.addEventListener = function(type, listener, useCapture) {};
+
+/**
+ * @constructor
+ * @implements {EventTarget}
+ */
+function Foo () {}
+
+/**
+ * @param {boolean=} opt_useCapture
+ * @override
+ */
+Foo.prototype.addEventListener = function(type, listener, opt_useCapture) {};
+
+/**
+ * @constructor
+ * @extends {Foo}
+ */
+function Bar () {}
+
+
+/**
+ * @constructor
+ * @extends {Bar}
+ */
+function Baz () {}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/externals_unit_tests/types_param.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/externals_unit_tests/types_param.js b/compiler-jx/src/test/resources/externals_unit_tests/types_param.js
new file mode 100644
index 0000000..76cfe03
--- /dev/null
+++ b/compiler-jx/src/test/resources/externals_unit_tests/types_param.js
@@ -0,0 +1,82 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+ 
+/**
+ * @const
+ */
+var foo = {};
+
+/**
+ * @const
+ */
+foo.bar = {};
+
+ /**
+  * @constructor
+  */
+foo.bar.Baz = function () {};
+ 
+ /**
+  * @constructor
+  */
+function Foo () {}
+
+/**
+ * @param {string} arg1
+ */
+Foo.test1 = function (arg1) {};
+
+/**
+ * @param {foo.bar.Baz} arg1
+ */
+Foo.test2 = function (arg1) {};
+
+/**
+ * @param {{myNum: number, myObject}} arg1
+ */
+Foo.test3 = function (arg1) {};
+
+/**
+ * @param {?number} arg1
+ */
+Foo.test4 = function (arg1) {};
+
+/**
+ * @param {!Object} arg1
+ */
+Foo.test5 = function (arg1) {};
+
+/**
+ * @param {function(string, boolean)} arg1
+ */
+Foo.test6 = function (arg1) {};
+
+
+
+
+
+
+
+
+
+
+
+
+


[40/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
new file mode 100644
index 0000000..6e5cc75
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
@@ -0,0 +1,504 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
+import org.apache.flex.compiler.internal.tree.as.UnaryOperatorAtNode;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.utils.ASNodeUtils;
+
+public class BinaryOperatorEmitter extends JSSubEmitter implements
+        ISubEmitter<IBinaryOperatorNode>
+{
+
+    public BinaryOperatorEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IBinaryOperatorNode node)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+
+        ASTNodeID id = node.getNodeID();
+        /*
+        if (id == ASTNodeID.Op_InID
+                || id == ASTNodeID.Op_LogicalAndAssignID
+                || id == ASTNodeID.Op_LogicalOrAssignID)
+        {
+            super.emitBinaryOperator(node);
+        }
+        else */if (id == ASTNodeID.Op_IsID || id == ASTNodeID.Op_AsID)
+        {
+            fjs.emitIsAs(node, node.getLeftOperandNode(), node.getRightOperandNode(),
+                    id, false);
+        }
+        else if (id == ASTNodeID.Op_InstanceOfID)
+        {
+            getWalker().walk(node.getLeftOperandNode());
+
+            startMapping(node, node.getLeftOperandNode());
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.INSTANCEOF);
+            endMapping(node);
+
+            IDefinition dnode = (node.getRightOperandNode())
+                    .resolve(getProject());
+            if (dnode != null)
+                write(getEmitter()
+                        .formatQualifiedName(dnode.getQualifiedName()));
+            else
+                getWalker().walk(node.getRightOperandNode());
+        }
+        else
+        {
+            IExpressionNode leftSide = node.getLeftOperandNode();
+            if (leftSide.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+            {
+                IASNode lnode = leftSide.getChild(0);
+                IASNode rnode = leftSide.getChild(1);
+                IDefinition rnodeDef = (rnode instanceof IIdentifierNode) ? 
+                		((IIdentifierNode) rnode).resolve(getWalker().getProject()) :
+                		null;
+                if (lnode.getNodeID() == ASTNodeID.SuperID
+                        && rnodeDef instanceof AccessorDefinition)
+                {
+                    String op = node.getOperator().getOperatorText();
+                    boolean isAssignment = op.contains("=")
+                            && !op.contains("==")
+                            && !(op.startsWith("<") || op.startsWith(">") || op
+                                    .startsWith("!"));
+                    if (isAssignment)
+                    {
+                        ICompilerProject project = this.getProject();
+                        if (project instanceof FlexJSProject)
+                        	((FlexJSProject)project).needLanguage = true;
+                        
+                        write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+                        write(ASEmitterTokens.MEMBER_ACCESS);
+                        write(JSFlexJSEmitterTokens.SUPERSETTER);
+                        write(ASEmitterTokens.PAREN_OPEN);
+                        IClassNode cnode = (IClassNode) node
+                                .getAncestorOfType(IClassNode.class);
+                        write(getEmitter().formatQualifiedName(
+                                cnode.getQualifiedName()));
+                        writeToken(ASEmitterTokens.COMMA);
+                        write(ASEmitterTokens.THIS);
+                        writeToken(ASEmitterTokens.COMMA);
+                        write(ASEmitterTokens.SINGLE_QUOTE);
+                        write(rnodeDef.getBaseName());
+                        write(ASEmitterTokens.SINGLE_QUOTE);
+                        writeToken(ASEmitterTokens.COMMA);
+
+                        if (op.length() > 1) // += and things like that
+                        {
+                            write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+                            write(ASEmitterTokens.MEMBER_ACCESS);
+                            write(JSFlexJSEmitterTokens.SUPERSETTER);
+                            write(ASEmitterTokens.PAREN_OPEN);
+                            write(getEmitter().formatQualifiedName(
+                                    cnode.getQualifiedName()));
+                            writeToken(ASEmitterTokens.COMMA);
+                            write(ASEmitterTokens.THIS);
+                            writeToken(ASEmitterTokens.COMMA);
+                            write(ASEmitterTokens.SINGLE_QUOTE);
+                            write(rnodeDef.getBaseName());
+                            write(ASEmitterTokens.SINGLE_QUOTE);
+                            write(ASEmitterTokens.PAREN_CLOSE);
+                            write(op.substring(0, 1));
+                        }
+
+                        getWalker().walk(node.getRightOperandNode());
+                        write(ASEmitterTokens.PAREN_CLOSE);
+                        return;
+                    }
+                }
+                else if (((JSFlexJSEmitter)getEmitter()).isXMLList((MemberAccessExpressionNode)leftSide))
+                {
+                	MemberAccessExpressionNode xmlNode = (MemberAccessExpressionNode)leftSide;
+                	if (node.getNodeID() == ASTNodeID.Op_AssignId)
+                	{
+	                    getWalker().walk(xmlNode.getLeftOperandNode());
+	                    IExpressionNode rightSide = xmlNode.getRightOperandNode();
+	                    if (rightSide instanceof UnaryOperatorAtNode)
+	                    {
+		                    write(".setAttribute('");
+		                    getWalker().walk(((UnaryOperatorAtNode)rightSide).getChild(0));
+	                    }
+	                    else
+	                    {
+		                    write(".setChild('");
+		                    getWalker().walk(rightSide);
+	                    }
+	                    write("', ");
+	                    getWalker().walk(node.getRightOperandNode());
+	                    write(ASEmitterTokens.PAREN_CLOSE);
+	                    return;
+                	}
+                	else if (node.getNodeID() == ASTNodeID.Op_AddAssignID)
+                	{
+	                    getWalker().walk(xmlNode);
+	                    write(".concat(");
+	                    getWalker().walk(node.getRightOperandNode());
+	                    write(ASEmitterTokens.PAREN_CLOSE);
+	                    return;
+                	}
+                	else if (node.getNodeID() == ASTNodeID.Op_AddID)
+                	{
+	                    getWalker().walk(xmlNode);
+	                    write(".copy().concat(");
+	                    getWalker().walk(node.getRightOperandNode());
+	                    write(ASEmitterTokens.PAREN_CLOSE);
+	                    return;
+                	}
+                }
+                else if (((JSFlexJSEmitter)getEmitter()).isProxy((MemberAccessExpressionNode)leftSide))
+                {
+                	MemberAccessExpressionNode proxyNode = (MemberAccessExpressionNode)leftSide;
+                	if (node.getNodeID() == ASTNodeID.Op_AssignId)
+                	{
+	                    getWalker().walk(proxyNode.getLeftOperandNode());
+	                    IExpressionNode rightSide = proxyNode.getRightOperandNode();
+	                    write(".setProperty('");
+	                    getWalker().walk(rightSide);
+	                    write("', ");
+	                    getWalker().walk(node.getRightOperandNode());
+	                    write(ASEmitterTokens.PAREN_CLOSE);
+	                    return;
+                	}
+                	else if (node.getNodeID() == ASTNodeID.Op_AddAssignID)
+                	{
+	                    IExpressionNode rightSide = proxyNode.getRightOperandNode();
+	                    getWalker().walk(proxyNode.getLeftOperandNode());
+	                    write(".setProperty('");
+	                    getWalker().walk(rightSide);
+	                    write("', ");
+	                    getWalker().walk(proxyNode.getLeftOperandNode());
+	                    write(".getProperty(");
+	                    write(ASEmitterTokens.SINGLE_QUOTE);
+	                    getWalker().walk(rightSide);
+	                    write(ASEmitterTokens.SINGLE_QUOTE);
+	                    write(ASEmitterTokens.PAREN_CLOSE);
+	                    write(" + ");
+	                    getWalker().walk(node.getRightOperandNode());
+	                    write(ASEmitterTokens.PAREN_CLOSE);
+	                    return;
+                	}
+                }
+                else if (((JSFlexJSEmitter)getEmitter()).isDateProperty((MemberAccessExpressionNode)leftSide))
+                {
+                	specialCaseDate(node, (MemberAccessExpressionNode)leftSide);
+                    return;
+                }
+            }
+
+            super_emitBinaryOperator(node);
+            /*
+            IExpressionNode leftSide = node.getLeftOperandNode();
+
+            IExpressionNode property = null;
+            int leftSideChildCount = leftSide.getChildCount();
+            if (leftSideChildCount > 0)
+            {
+                IASNode childNode = leftSide.getChild(leftSideChildCount - 1);
+                if (childNode instanceof IExpressionNode)
+                    property = (IExpressionNode) childNode;
+                else
+                    property = leftSide;
+            }
+            else
+                property = leftSide;
+
+            IDefinition def = null;
+            if (property instanceof IIdentifierNode)
+                def = ((IIdentifierNode) property).resolve(getWalker()
+                        .getProject());
+
+            boolean isSuper = false;
+            if (leftSide.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+            {
+                IASNode cnode = leftSide.getChild(0);
+                ASTNodeID cId = cnode.getNodeID();
+
+                isSuper = cId == ASTNodeID.SuperID;
+            }
+
+            String op = node.getOperator().getOperatorText();
+            boolean isAssignment = op.contains("=") && !op.contains("==") && 
+                                                    !(op.startsWith("<") || 
+                                                            op.startsWith(">") || 
+                                                            op.startsWith("!"));
+
+            if (def instanceof AccessorDefinition && isAssignment)
+            {
+                // this will make the set_foo call
+                getWalker().walk(leftSide);
+            }
+            else if (isSuper) 
+            {
+                emitSuperCall(node, "");
+            }
+            else
+            {
+                if (ASNodeUtils.hasParenOpen(node))
+                    write(ASEmitterTokens.PAREN_OPEN);
+
+                getWalker().walk(leftSide);
+
+                if (node.getNodeID() != ASTNodeID.Op_CommaID)
+                    write(ASEmitterTokens.SPACE);
+
+                writeToken(node.getOperator().getOperatorText());
+
+                getWalker().walk(node.getRightOperandNode());
+
+                if (ASNodeUtils.hasParenClose(node))
+                    write(ASEmitterTokens.PAREN_CLOSE);
+            }
+            */
+        }
+    }
+
+    private void super_emitBinaryOperator(IBinaryOperatorNode node)
+    {
+        if (ASNodeUtils.hasParenOpen(node))
+            write(ASEmitterTokens.PAREN_OPEN);
+
+        ASTNodeID id = node.getNodeID();
+
+        if (id == ASTNodeID.Op_IsID)
+        {
+            write(ASEmitterTokens.IS);
+            write(ASEmitterTokens.PAREN_OPEN);
+            getWalker().walk(node.getLeftOperandNode());
+            writeToken(ASEmitterTokens.COMMA);
+            getWalker().walk(node.getRightOperandNode());
+            write(ASEmitterTokens.PAREN_CLOSE);
+        }
+        else if (id == ASTNodeID.Op_AsID)
+        {
+            // (is(a, b) ? a : null)
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(ASEmitterTokens.IS);
+            write(ASEmitterTokens.PAREN_OPEN);
+            getWalker().walk(node.getLeftOperandNode());
+            writeToken(ASEmitterTokens.COMMA);
+            getWalker().walk(node.getRightOperandNode());
+            writeToken(ASEmitterTokens.PAREN_CLOSE);
+            writeToken(ASEmitterTokens.TERNARY);
+            getWalker().walk(node.getLeftOperandNode());
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.COLON);
+            write(ASEmitterTokens.NULL);
+            write(ASEmitterTokens.PAREN_CLOSE);
+        }
+        else
+        {
+            getWalker().walk(node.getLeftOperandNode());
+
+            startMapping(node, node.getLeftOperandNode());
+            
+            if (id != ASTNodeID.Op_CommaID)
+                write(ASEmitterTokens.SPACE);
+
+            // (erikdebruin) rewrite 'a &&= b' to 'a = a && b'
+            if (id == ASTNodeID.Op_LogicalAndAssignID
+                    || id == ASTNodeID.Op_LogicalOrAssignID)
+            {
+                IIdentifierNode lnode = (IIdentifierNode) node
+                        .getLeftOperandNode();
+
+                writeToken(ASEmitterTokens.EQUAL);
+                endMapping(node);
+                write(lnode.getName());
+
+                startMapping(node, node.getLeftOperandNode());
+                write(ASEmitterTokens.SPACE);
+                write((id == ASTNodeID.Op_LogicalAndAssignID) ? ASEmitterTokens.LOGICAL_AND
+                        : ASEmitterTokens.LOGICAL_OR);
+            }
+            else
+            {
+                write(node.getOperator().getOperatorText());
+            }
+
+            write(ASEmitterTokens.SPACE);
+            endMapping(node);
+
+            /*
+            IDefinition definition = node.getRightOperandNode().resolve(getProject());
+        	if (definition instanceof FunctionDefinition &&
+        			(!(definition instanceof AccessorDefinition)))
+        	{
+        	}
+        	else */
+        		getWalker().walk(node.getRightOperandNode());
+                if (node.getNodeID() == ASTNodeID.Op_InID &&
+                        ((JSFlexJSEmitter)getEmitter()).isXML(node.getRightOperandNode()))
+                {
+                	write(".elementNames()");
+                }   
+                else if (node.getNodeID() == ASTNodeID.Op_InID &&
+                        ((JSFlexJSEmitter)getEmitter()).isProxy(node.getRightOperandNode()))
+                {
+                	write(".propertyNames()");
+                }   
+        }
+
+        if (ASNodeUtils.hasParenOpen(node))
+            write(ASEmitterTokens.PAREN_CLOSE);
+    }
+    
+    private enum DateProperties
+    {
+    	FULLYEAR("fullYear", "setFullYear"),
+    	MONTH("month", "setMonth"),
+    	DATE("date", "setDate"),
+    	FULLYEARUTC("fullYearUTC", "setUTCFullYear"),
+    	MONTHUTC("monthUTC", "setUTCMonth"),
+    	DATEUTC("dateUTC", "setUTCDate"),
+    	HOURS("hours", "setHours"),
+    	MINUTES("minutes", "setMinutes"),
+    	SECONDS("seconds", "setSeconds"),
+    	MILLISECONDS("milliseconds", "setMilliseconds"),
+    	HOURSUTC("hoursUTC", "setUTCHours"),
+    	MINUTESUTC("minutesUTC", "setUTCMinutes"),
+    	SECONDSUTC("secondsUTC", "setUTCSeconds"),
+    	MILLISECONDSUTC("millisecondsUTC", "setUTCMilliseconds");
+    	
+    	DateProperties(String value, String functionName)
+    	{
+    		this.value = value;
+    		this.functionName = functionName;
+    	}
+    	
+    	private String value;
+    	private String functionName;
+    	
+    	public String getFunctionName()
+    	{
+    		return functionName;
+    	}
+    }
+    
+    void specialCaseDate(IBinaryOperatorNode node, MemberAccessExpressionNode leftSide)
+    {
+    	MemberAccessExpressionNode dateNode = (MemberAccessExpressionNode)leftSide;
+        IIdentifierNode rightSide = (IIdentifierNode)dateNode.getRightOperandNode();
+        getWalker().walk(dateNode.getLeftOperandNode());
+        String rightName = rightSide.getName();
+        DateProperties prop = DateProperties.valueOf(rightName.toUpperCase());
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        write(prop.getFunctionName());
+        write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(node.getRightOperandNode());
+        switch (prop)
+        {
+        case FULLYEAR:
+        	write(ASEmitterTokens.COMMA);
+        	write(ASEmitterTokens.SPACE);
+            getWalker().walk(dateNode.getLeftOperandNode());
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write("getMonth()");
+            // fall through
+        case MONTH:
+        	write(ASEmitterTokens.COMMA);
+        	write(ASEmitterTokens.SPACE);
+            getWalker().walk(dateNode.getLeftOperandNode());
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write("getDate()");
+            break;
+        case FULLYEARUTC:
+        	write(ASEmitterTokens.COMMA);
+        	write(ASEmitterTokens.SPACE);
+            getWalker().walk(dateNode.getLeftOperandNode());
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write("getMonthUTC()");
+            // fall through
+        case MONTHUTC:
+        	write(ASEmitterTokens.COMMA);
+        	write(ASEmitterTokens.SPACE);
+            getWalker().walk(dateNode.getLeftOperandNode());
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write("getDateUTC()");
+            break;
+        case HOURS:
+        	write(ASEmitterTokens.COMMA);
+        	write(ASEmitterTokens.SPACE);
+            getWalker().walk(dateNode.getLeftOperandNode());
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write("getMinutes()");
+            // fall through
+        case MINUTES:
+        	write(ASEmitterTokens.COMMA);
+        	write(ASEmitterTokens.SPACE);
+            getWalker().walk(dateNode.getLeftOperandNode());
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write("getSeconds()");
+            // fall through
+        case SECONDS:
+        	write(ASEmitterTokens.COMMA);
+        	write(ASEmitterTokens.SPACE);
+            getWalker().walk(dateNode.getLeftOperandNode());
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write("getMilliseconds()");
+            break;
+        case HOURSUTC:
+        	write(ASEmitterTokens.COMMA);
+        	write(ASEmitterTokens.SPACE);
+            getWalker().walk(dateNode.getLeftOperandNode());
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write("getUTCMinutes()");
+            // fall through
+        case MINUTESUTC:
+        	write(ASEmitterTokens.COMMA);
+        	write(ASEmitterTokens.SPACE);
+            getWalker().walk(dateNode.getLeftOperandNode());
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write("getUTCSeconds()");
+            // fall through
+        case SECONDSUTC:
+        	write(ASEmitterTokens.COMMA);
+        	write(ASEmitterTokens.SPACE);
+            getWalker().walk(dateNode.getLeftOperandNode());
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write("getUTCMilliseconds()");
+            break;
+        }
+        write(ASEmitterTokens.PAREN_CLOSE);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java
new file mode 100644
index 0000000..c8cbec0
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BindableEmitter.java
@@ -0,0 +1,129 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+
+public class BindableEmitter extends JSSubEmitter implements
+        ISubEmitter<IClassDefinition>
+{
+    public BindableEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IClassDefinition definition)
+    {
+        if (getModel().hasBindableVars())
+        {
+            write(JSGoogEmitterTokens.OBJECT);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSEmitterTokens.DEFINE_PROPERTIES);
+            write(ASEmitterTokens.PAREN_OPEN);
+            String qname = definition.getQualifiedName();
+            write(getEmitter().formatQualifiedName(qname));
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSEmitterTokens.PROTOTYPE);
+            write(ASEmitterTokens.COMMA);
+            write(ASEmitterTokens.SPACE);
+            write("/** @lends {" + getEmitter().formatQualifiedName(qname)
+                    + ".prototype} */ ");
+            writeNewline(ASEmitterTokens.BLOCK_OPEN);
+
+            boolean firstTime = true;
+            for (String varName : getModel().getBindableVars())
+            {
+                if (firstTime)
+                    firstTime = false;
+                else
+                    write(ASEmitterTokens.COMMA);
+
+                emitBindableVarDefineProperty(varName, definition);
+            }
+            writeNewline(ASEmitterTokens.BLOCK_CLOSE);
+            write(ASEmitterTokens.PAREN_CLOSE);
+            write(ASEmitterTokens.SEMICOLON);
+        }
+    }
+
+    private void emitBindableVarDefineProperty(String name,
+            IClassDefinition cdef)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+
+        // 'PropName': {
+        writeNewline("/** @export */");
+        writeNewline(name + ASEmitterTokens.COLON.getToken()
+                + ASEmitterTokens.SPACE.getToken()
+                + ASEmitterTokens.BLOCK_OPEN.getToken());
+        indentPush();
+        writeNewline("/** @this {"
+                + fjs.formatQualifiedName(cdef.getQualifiedName()) + "} */");
+        writeNewline(ASEmitterTokens.GET.getToken()
+                + ASEmitterTokens.COLON.getToken()
+                + ASEmitterTokens.SPACE.getToken()
+                + ASEmitterTokens.FUNCTION.getToken()
+                + ASEmitterTokens.PAREN_OPEN.getToken()
+                + ASEmitterTokens.PAREN_CLOSE.getToken()
+                + ASEmitterTokens.SPACE.getToken()
+                + ASEmitterTokens.BLOCK_OPEN.getToken());
+        writeNewline(ASEmitterTokens.RETURN.getToken()
+                + ASEmitterTokens.SPACE.getToken()
+                + ASEmitterTokens.THIS.getToken()
+                + ASEmitterTokens.MEMBER_ACCESS.getToken() + name + "_"
+                + ASEmitterTokens.SEMICOLON.getToken());
+        indentPop();
+        writeNewline(ASEmitterTokens.BLOCK_CLOSE.getToken()
+                + ASEmitterTokens.COMMA.getToken());
+        writeNewline();
+        writeNewline("/** @this {"
+                + fjs.formatQualifiedName(cdef.getQualifiedName()) + "} */");
+        writeNewline(ASEmitterTokens.SET.getToken()
+                + ASEmitterTokens.COLON.getToken()
+                + ASEmitterTokens.SPACE.getToken()
+                + ASEmitterTokens.FUNCTION.getToken()
+                + ASEmitterTokens.PAREN_OPEN.getToken() + "value"
+                + ASEmitterTokens.PAREN_CLOSE.getToken()
+                + ASEmitterTokens.SPACE.getToken()
+                + ASEmitterTokens.BLOCK_OPEN.getToken());
+        writeNewline("if (value != " + ASEmitterTokens.THIS.getToken()
+                + ASEmitterTokens.MEMBER_ACCESS.getToken() + name + "_) {");
+        writeNewline("    var oldValue = " + ASEmitterTokens.THIS.getToken()
+                + ASEmitterTokens.MEMBER_ACCESS.getToken() + name + "_"
+                + ASEmitterTokens.SEMICOLON.getToken());
+        writeNewline("    " + ASEmitterTokens.THIS.getToken()
+                + ASEmitterTokens.MEMBER_ACCESS.getToken() + name
+                + "_ = value;");
+        writeNewline("    this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(");
+        writeNewline("         this, \"" + name + "\", oldValue, value));");
+        writeNewline("}");
+        write(ASEmitterTokens.BLOCK_CLOSE.getToken());
+        write(ASEmitterTokens.BLOCK_CLOSE.getToken());
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
new file mode 100644
index 0000000..fe0bc7e
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
@@ -0,0 +1,182 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.asdoc.flexjs.ASDocComment;
+import org.apache.flex.compiler.clients.MXMLJSC;
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.utils.DocEmitterUtils;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IAccessorNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+
+public class ClassEmitter extends JSSubEmitter implements
+        ISubEmitter<IClassNode>
+{
+
+    public ClassEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IClassNode node)
+    {
+        getModel().pushClass(node.getDefinition());
+
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+        
+        getEmitter().pushSourceMapName(node);
+
+        ASDocComment asDoc = (ASDocComment) node.getASDocComment();
+        if (asDoc != null && MXMLJSC.keepASDoc)
+            DocEmitterUtils.loadImportIgnores(fjs, asDoc.commentNoEnd());
+
+        IClassDefinition definition = node.getDefinition();
+
+        IFunctionDefinition ctorDefinition = definition.getConstructor();
+
+        // Static-only (Singleton) classes may not have a constructor
+        if (ctorDefinition != null)
+        {
+            IFunctionNode ctorNode = (IFunctionNode) ctorDefinition.getNode();
+            if (ctorNode != null)
+            {
+                // constructor
+                getEmitter().emitMethod(ctorNode);
+                write(ASEmitterTokens.SEMICOLON);
+            }
+            else
+            {
+                String qname = definition.getQualifiedName();
+                if (qname != null && !qname.equals(""))
+                {
+                    write(getEmitter().formatQualifiedName(qname));
+                    write(ASEmitterTokens.SPACE);
+                    writeToken(ASEmitterTokens.EQUAL);
+                    write(ASEmitterTokens.FUNCTION);
+                    write(ASEmitterTokens.PAREN_OPEN);
+                    write(ASEmitterTokens.PAREN_CLOSE);
+                    write(ASEmitterTokens.SPACE);
+                    write(ASEmitterTokens.BLOCK_OPEN);
+                    writeNewline();
+                    fjs.emitComplexInitializers(node);
+                    write(ASEmitterTokens.BLOCK_CLOSE);
+                    write(ASEmitterTokens.SEMICOLON);
+                }
+            }
+        }
+
+        IDefinitionNode[] dnodes = node.getAllMemberNodes();
+        for (IDefinitionNode dnode : dnodes)
+        {
+            if (dnode.getNodeID() == ASTNodeID.VariableID)
+            {
+                writeNewline();
+                writeNewline();
+                writeNewline();
+                getEmitter().emitField((IVariableNode) dnode);
+                startMapping(dnode, dnode);
+                write(ASEmitterTokens.SEMICOLON);
+                endMapping(dnode);
+            }
+            else if (dnode.getNodeID() == ASTNodeID.FunctionID)
+            {
+                if (!((IFunctionNode) dnode).isConstructor())
+                {
+                    writeNewline();
+                    writeNewline();
+                    writeNewline();
+                    getEmitter().emitMethod((IFunctionNode) dnode);
+                    write(ASEmitterTokens.SEMICOLON);
+                }
+            }
+            else if (dnode.getNodeID() == ASTNodeID.GetterID
+                    || dnode.getNodeID() == ASTNodeID.SetterID)
+            {
+                //writeNewline();
+                //writeNewline();
+                //writeNewline();
+                fjs.emitAccessors((IAccessorNode) dnode);
+                //this shouldn't write anything, just set up
+                //a data structure for emitASGettersAndSetters
+                //write(ASEmitterTokens.SEMICOLON);
+            }
+            else if (dnode.getNodeID() == ASTNodeID.BindableVariableID)
+            {
+                writeNewline();
+                writeNewline();
+                writeNewline();
+                getEmitter().emitField((IVariableNode) dnode);
+                startMapping(dnode, dnode);
+                write(ASEmitterTokens.SEMICOLON);
+                endMapping(dnode);
+            }
+        }
+
+        fjs.getBindableEmitter().emit(definition);
+        fjs.getAccessorEmitter().emit(definition);
+        
+        fjs.getPackageFooterEmitter().emitClassInfo(node);
+
+        getEmitter().popSourceMapName();
+        getModel().popClass();
+    }
+    
+    public void emitComplexInitializers(IClassNode node)
+    {
+    	boolean wroteOne = false;
+        IDefinitionNode[] dnodes = node.getAllMemberNodes();
+        for (IDefinitionNode dnode : dnodes)
+        {
+            if (dnode.getNodeID() == ASTNodeID.VariableID)
+            {
+            	IVariableNode varnode = ((IVariableNode)dnode);
+                IExpressionNode vnode = varnode.getAssignedValueNode();
+                if (vnode != null && (!(dnode.getDefinition().isStatic() || EmitterUtils.isScalar(vnode))))
+                {
+                    writeNewline();
+                    write(ASEmitterTokens.THIS);
+                    write(ASEmitterTokens.MEMBER_ACCESS);
+                    write(dnode.getName());
+                    write(ASEmitterTokens.SPACE);
+                    writeToken(ASEmitterTokens.EQUAL);
+                    getEmitter().getWalker().walk(vnode);
+                    write(ASEmitterTokens.SEMICOLON);
+                    wroteOne = true;
+                }
+            }
+        }    
+        if (wroteOne)
+        	writeNewline();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/DefinePropertyFunctionEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/DefinePropertyFunctionEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/DefinePropertyFunctionEmitter.java
new file mode 100644
index 0000000..f267cff
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/DefinePropertyFunctionEmitter.java
@@ -0,0 +1,120 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.common.IMetaInfo;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.tree.as.SetterNode;
+import org.apache.flex.compiler.tree.as.IAccessorNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+
+public class DefinePropertyFunctionEmitter extends JSSubEmitter implements
+        ISubEmitter<IAccessorNode>
+{
+
+    public DefinePropertyFunctionEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IAccessorNode node)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+
+        boolean isBindableSetter = false;
+        if (node instanceof SetterNode)
+        {
+            IMetaInfo[] metaInfos = null;
+            metaInfos = node.getMetaInfos();
+            for (IMetaInfo metaInfo : metaInfos)
+            {
+                String name = metaInfo.getTagName();
+                if (name.equals("Bindable")
+                        && metaInfo.getAllAttributes().length == 0)
+                {
+                    isBindableSetter = true;
+                    break;
+                }
+            }
+        }
+        if (isBindableSetter)
+        {
+            //write(ASEmitterTokens.FUNCTION);
+            //emitParameters(node.getParametersContainerNode());
+            write(ASEmitterTokens.SPACE);
+            writeNewline(ASEmitterTokens.BLOCK_OPEN);
+
+            write(ASEmitterTokens.VAR);
+            write(ASEmitterTokens.SPACE);
+            write("oldValue");
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.EQUAL);
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.THIS);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(node.getName());
+            //write(ASEmitterTokens.PAREN_OPEN);
+            //write(ASEmitterTokens.PAREN_CLOSE);
+            writeNewline(ASEmitterTokens.SEMICOLON);
+
+            // add change check
+            write(ASEmitterTokens.IF);
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.PAREN_OPEN);
+            write("oldValue");
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.STRICT_EQUAL);
+            write(ASEmitterTokens.SPACE);
+            IParameterNode[] params = node.getParameterNodes();
+            write(params[0].getName());
+            write(ASEmitterTokens.PAREN_CLOSE);
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.RETURN);
+            writeNewline(ASEmitterTokens.SEMICOLON);
+
+            write(ASEmitterTokens.THIS);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write("__bindingWrappedSetter__" + node.getName());
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(params[0].getName());
+            write(ASEmitterTokens.PAREN_CLOSE);
+            writeNewline(ASEmitterTokens.SEMICOLON);
+
+            // add dispatch of change event
+            writeNewline("    this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(");
+            writeNewline("         this, \"" + node.getName()
+                    + "\", oldValue, " + params[0].getName() + "));");
+            write(ASEmitterTokens.BLOCK_CLOSE);
+            //writeNewline(ASEmitterTokens.SEMICOLON);
+            writeNewline();
+            writeNewline();
+        }
+        else
+        {
+            fjs.emitMethodScope(node.getScopedNode());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/DoWhileLoopEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/DoWhileLoopEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/DoWhileLoopEmitter.java
new file mode 100644
index 0000000..e087bcd
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/DoWhileLoopEmitter.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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IWhileLoopNode;
+
+public class DoWhileLoopEmitter extends JSSubEmitter implements
+        ISubEmitter<IWhileLoopNode>
+{
+    public DoWhileLoopEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IWhileLoopNode node)
+    {
+        IContainerNode cnode = (IContainerNode) node.getChild(0);
+
+        startMapping(node);
+        write(ASEmitterTokens.DO);
+        if (!EmitterUtils.isImplicit(cnode))
+            write(ASEmitterTokens.SPACE);
+        endMapping(node);
+
+        IASNode statementContents = node.getStatementContentsNode();
+        getWalker().walk(statementContents);
+
+        IASNode conditionalExpressionNode = node.getConditionalExpressionNode();
+        startMapping(node, statementContents);
+        if (!EmitterUtils.isImplicit(cnode))
+            write(ASEmitterTokens.SPACE);
+        else
+            writeNewline(); // TODO (mschmalle) there is something wrong here, block should NL
+        write(ASEmitterTokens.WHILE);
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        endMapping(node);
+
+        getWalker().walk(conditionalExpressionNode);
+
+        startMapping(node, conditionalExpressionNode);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        write(ASEmitterTokens.SEMICOLON);
+        endMapping(node);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java
new file mode 100644
index 0000000..f02d298
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/DynamicAccessEmitter.java
@@ -0,0 +1,54 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+
+public class DynamicAccessEmitter extends JSSubEmitter implements
+        ISubEmitter<IDynamicAccessNode>
+{
+    public DynamicAccessEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IDynamicAccessNode node)
+    {
+        IExpressionNode leftOperandNode = node.getLeftOperandNode();
+        getWalker().walk(leftOperandNode);
+
+        startMapping(node, leftOperandNode);
+        write(ASEmitterTokens.SQUARE_OPEN);
+        endMapping(node);
+
+        IExpressionNode rightOperandNode = node.getRightOperandNode();
+        getWalker().walk(rightOperandNode);
+
+        startMapping(node, rightOperandNode);
+        write(ASEmitterTokens.SQUARE_CLOSE);
+        endMapping(node);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/FieldEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/FieldEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/FieldEmitter.java
new file mode 100644
index 0000000..402751f
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/FieldEmitter.java
@@ -0,0 +1,131 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.codegen.js.goog.IJSGoogDocEmitter;
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.common.ModifiersSet;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IVariableDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.tree.as.ChainedVariableNode;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+
+public class FieldEmitter extends JSSubEmitter implements
+        ISubEmitter<IVariableNode>
+{
+    public FieldEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IVariableNode node)
+    {
+        IDefinition definition = EmitterUtils.getClassDefinition(node);
+
+        IDefinition def = null;
+        IExpressionNode enode = node.getVariableTypeNode();//getAssignedValueNode();
+        if (enode != null)
+        {
+            def = enode.resolveType(getProject());
+        }
+        
+        // TODO (mschmalle)
+        if (getEmitter().getDocEmitter() instanceof IJSGoogDocEmitter)
+        {
+            ((IJSGoogDocEmitter) getEmitter().getDocEmitter()).emitFieldDoc(node, def, getProject());
+        }
+
+        IDefinition ndef = node.getDefinition();
+
+        String root = "";
+        IVariableDefinition.VariableClassification classification = node.getVariableClassification();
+        boolean isPackageOrFileMember = classification == IVariableDefinition.VariableClassification.PACKAGE_MEMBER ||
+                classification == IVariableDefinition.VariableClassification.FILE_MEMBER;
+        if (isPackageOrFileMember)
+        {
+            write(getEmitter().formatQualifiedName(node.getQualifiedName()));
+        }
+        else
+        {
+            ModifiersSet modifierSet = ndef.getModifiers();
+            if (modifierSet != null && !modifierSet.hasModifier(ASModifier.STATIC))
+            {
+                root = JSEmitterTokens.PROTOTYPE.getToken();
+                root += ASEmitterTokens.MEMBER_ACCESS.getToken();
+            }
+            
+            if (definition == null)
+                definition = ndef.getContainingScope().getDefinition();
+
+            startMapping(node.getNameExpressionNode());
+            write(getEmitter().formatQualifiedName(definition.getQualifiedName())
+                    + ASEmitterTokens.MEMBER_ACCESS.getToken() + root);
+            write(node.getName());
+            endMapping(node.getNameExpressionNode());
+        }
+
+        if (node.getNodeID() == ASTNodeID.BindableVariableID)
+        {
+        	// add an underscore to convert this var to be the
+        	// backing var for the get/set pair that will be generated later.
+        	write("_");
+        }
+        IExpressionNode vnode = node.getAssignedValueNode();
+        if (vnode != null &&
+                (ndef.isStatic() || EmitterUtils.isScalar(vnode) || isPackageOrFileMember))
+        {
+            startMapping(node);
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            endMapping(node);
+            getEmitter().getWalker().walk(vnode);
+        }
+
+        if (!(node instanceof ChainedVariableNode))
+        {
+            int len = node.getChildCount();
+            for (int i = 0; i < len; i++)
+            {
+                IASNode child = node.getChild(i);
+                if (child instanceof ChainedVariableNode)
+                {
+                    writeNewline(ASEmitterTokens.SEMICOLON);
+                    writeNewline();
+                    getEmitter().emitField((IVariableNode) child);
+                }
+            }
+        }
+        if (node.getNodeID() == ASTNodeID.BindableVariableID)
+        {
+            getModel().getBindableVars().add(node.getName());
+        }
+    }
+    
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ForEachEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ForEachEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ForEachEmitter.java
new file mode 100644
index 0000000..501f5ae
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ForEachEmitter.java
@@ -0,0 +1,157 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
+import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
+import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IVariableExpressionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+
+public class ForEachEmitter extends JSSubEmitter implements
+        ISubEmitter<IForLoopNode>
+{
+
+    public ForEachEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IForLoopNode node)
+    {
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) node
+                .getConditionalsContainerNode().getChild(0);
+        IASNode childNode = bnode.getChild(0);
+
+        final String iterName = getModel().getCurrentForeachName();
+        getModel().incForeachLoopCount();
+        final String targetName = iterName + "_target";
+        
+        write(ASEmitterTokens.VAR);
+        write(ASEmitterTokens.SPACE);
+        write(targetName);
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.EQUAL);
+        write(ASEmitterTokens.SPACE);
+        IASNode obj = bnode.getChild(1);
+        getWalker().walk(obj);
+        write(ASEmitterTokens.SEMICOLON);
+        writeNewline();
+
+        if (node.getParent().getNodeID() == ASTNodeID.BlockID &&
+        		node.getParent().getParent().getNodeID() == ASTNodeID.LabledStatementID)
+        {
+        	// emit label here
+        	LabeledStatementNode labelNode = (LabeledStatementNode)node.getParent().getParent();
+            writeToken(labelNode.getLabel());
+            writeToken(ASEmitterTokens.COLON);
+
+        }
+        write(ASEmitterTokens.FOR);
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(ASEmitterTokens.VAR);
+        write(ASEmitterTokens.SPACE);
+        write(iterName);
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.IN);
+        write(ASEmitterTokens.SPACE);
+        write(targetName);
+        boolean isXML = false;
+        boolean isProxy = false;
+        if (obj.getNodeID() == ASTNodeID.IdentifierID)
+        {
+        	if (((JSFlexJSEmitter)getEmitter()).isXML((IdentifierNode)obj))
+        	{
+        		write(".elementNames()");
+        		isXML = true;
+        	}
+            if (((JSFlexJSEmitter)getEmitter()).isProxy((IdentifierNode)obj))
+            {
+                write(".propertyNames()");
+                isProxy = true;
+            }
+        }
+        else if (obj.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+        {
+            if (((JSFlexJSEmitter)getEmitter()).isXMLList((MemberAccessExpressionNode)obj))
+            {
+                write(".elementNames()");
+                isXML = true;
+            }
+            if (((JSFlexJSEmitter)getEmitter()).isProxy((MemberAccessExpressionNode)obj))
+            {
+                write(".propertyNames()");
+                isXML = true;
+            }
+        }
+        writeToken(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline();
+        write(ASEmitterTokens.BLOCK_OPEN);
+        writeNewline();
+        if (childNode instanceof IVariableExpressionNode)
+        {
+            write(ASEmitterTokens.VAR);
+            write(ASEmitterTokens.SPACE);
+            write(((IVariableNode) childNode.getChild(0)).getName());
+        }
+        else
+            write(((IIdentifierNode) childNode).getName());
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.EQUAL);
+        write(ASEmitterTokens.SPACE);
+        write(targetName);
+        if (isXML)
+        {
+        	write(".child(");
+        	write(iterName);
+        	write(")");
+        }
+        else if (isProxy)
+        {
+            write(".getProperty(");
+            write(iterName);
+            write(")");
+        }
+        else
+        {
+	        write(ASEmitterTokens.SQUARE_OPEN);
+	        write(iterName);
+	        write(ASEmitterTokens.SQUARE_CLOSE);
+        }
+        write(ASEmitterTokens.SEMICOLON);
+        writeNewline();
+        getWalker().walk(node.getStatementContentsNode());
+        write(ASEmitterTokens.BLOCK_CLOSE);
+        writeNewline();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ForLoopEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ForLoopEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ForLoopEmitter.java
new file mode 100644
index 0000000..567b029
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ForLoopEmitter.java
@@ -0,0 +1,99 @@
+package org.apache.flex.compiler.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+
+public class ForLoopEmitter extends JSSubEmitter implements
+        ISubEmitter<IForLoopNode>
+{
+    public ForLoopEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IForLoopNode node)
+    {
+        IContainerNode xnode = (IContainerNode) node.getChild(1);
+
+        startMapping(node);
+        writeToken(ASEmitterTokens.FOR);
+        write(ASEmitterTokens.PAREN_OPEN);
+        endMapping(node);
+
+        IContainerNode cnode = node.getConditionalsContainerNode();
+        final IASNode node0 = cnode.getChild(0);
+        if (node0.getNodeID() == ASTNodeID.Op_InID)
+        {
+            //for(in)
+            getWalker().walk(cnode.getChild(0));
+        }
+        else //for(;;)
+        {
+            emitForStatements(cnode);
+        }
+
+        startMapping(node, cnode);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        if (!EmitterUtils.isImplicit(xnode))
+            write(ASEmitterTokens.SPACE);
+        endMapping(node);
+
+        getWalker().walk(node.getStatementContentsNode());
+    }
+
+    protected void emitForStatements(IContainerNode node)
+    {
+        final IASNode node0 = node.getChild(0);
+        final IASNode node1 = node.getChild(1);
+        final IASNode node2 = node.getChild(2);
+
+        int column = node.getColumn();
+        // initializer
+        if (node0 != null)
+        {
+            getWalker().walk(node0);
+
+            if (node1.getNodeID() != ASTNodeID.NilID)
+            {
+                column += node0.getAbsoluteEnd() - node0.getAbsoluteStart();
+            }
+            startMapping(node, node.getLine(), column);
+            write(ASEmitterTokens.SEMICOLON);
+            column++;
+            if (node1.getNodeID() != ASTNodeID.NilID)
+            {
+                write(ASEmitterTokens.SPACE);
+                column++;
+            }
+            endMapping(node);
+        }
+        // condition or target
+        if (node1 != null)
+        {
+            getWalker().walk(node1);
+            
+            if (node1.getNodeID() != ASTNodeID.NilID)
+            {
+                column += node1.getAbsoluteEnd() - node1.getAbsoluteStart();
+            }
+            startMapping(node, node.getLine(), column);
+            write(ASEmitterTokens.SEMICOLON);
+            if (node2.getNodeID() != ASTNodeID.NilID)
+                write(ASEmitterTokens.SPACE);
+            endMapping(node);
+        }
+        // iterator
+        if (node2 != null)
+        {
+            getWalker().walk(node2);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallArgumentsEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallArgumentsEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallArgumentsEmitter.java
new file mode 100644
index 0000000..f875e92
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallArgumentsEmitter.java
@@ -0,0 +1,64 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+
+public class FunctionCallArgumentsEmitter extends JSSubEmitter implements
+        ISubEmitter<IContainerNode>
+{
+    public FunctionCallArgumentsEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IContainerNode node)
+    {
+        startMapping(node);
+        write(ASEmitterTokens.PAREN_OPEN);
+        endMapping(node);
+
+        int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            IExpressionNode argumentNode = (IExpressionNode) node.getChild(i);
+            getWalker().walk(argumentNode);
+            if (i < len - 1)
+            {
+                //we're mapping the comma to the container, but we use the
+                //parameter line/column in case the comma is not on the same
+                //line as the opening (
+                startMapping(node, argumentNode);
+                writeToken(ASEmitterTokens.COMMA);
+                endMapping(node);
+            }
+        }
+
+        startMapping(node, node.getLine(), node.getColumn() + node.getAbsoluteEnd() - node.getAbsoluteStart() - 1);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        endMapping(node);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
new file mode 100644
index 0000000..043daa8
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
@@ -0,0 +1,200 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.IASGlobalFunctionConstants;
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSessionModel;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.definitions.AppliedVectorDefinition;
+import org.apache.flex.compiler.internal.definitions.ClassDefinition;
+import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.tree.as.ContainerNode;
+import org.apache.flex.compiler.internal.tree.as.VectorLiteralNode;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.utils.NativeUtils;
+
+public class FunctionCallEmitter extends JSSubEmitter implements ISubEmitter<IFunctionCallNode>
+{
+
+    public FunctionCallEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IFunctionCallNode node)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+
+        IASNode cnode = node.getChild(0);
+
+        if (cnode.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+            cnode = cnode.getChild(0);
+
+        ASTNodeID id = cnode.getNodeID();
+        if (id != ASTNodeID.SuperID)
+        {
+            IDefinition def = null;
+
+            boolean isClassCast = false;
+
+            if (node.isNewExpression())
+            {
+                if (!(node.getChild(1) instanceof VectorLiteralNode))
+                {
+                    startMapping(node.getNewKeywordNode());
+                    writeToken(ASEmitterTokens.NEW);
+                    endMapping(node.getNewKeywordNode());
+                }
+                else
+                {
+                    VectorLiteralNode vectorLiteralNode = (VectorLiteralNode) node.getChild(1);
+                    write("[");
+                    ContainerNode contentsNode = vectorLiteralNode.getContentsNode();
+                    int len = contentsNode.getChildCount();
+                    for (int i = 0; i < len; i++)
+                    {
+                        getWalker().walk(contentsNode.getChild(i));
+                        if (i < len - 1)
+                        {
+                            writeToken(ASEmitterTokens.COMMA);
+                        }
+                    }
+                    write("]");
+                    return;
+                }
+            }
+            else
+            {
+                def = node.getNameNode().resolve(getProject());
+
+                isClassCast = (def instanceof ClassDefinition || def instanceof InterfaceDefinition)
+                        && !(NativeUtils.isJSNative(def.getBaseName()));
+            }
+
+            if (node.isNewExpression())
+            {
+                def = node.resolveCalledExpression(getProject());
+                IExpressionNode nameNode = node.getNameNode();
+                // all new calls to a class should be fully qualified names
+                if (def instanceof ClassDefinition)
+                {
+                    startMapping(nameNode);
+                    write(getEmitter().formatQualifiedName(def.getQualifiedName()));
+                    endMapping(nameNode);
+                }
+                else
+                {
+                    // wrap "new someFunctionCall(args)" in parens so the
+                    // function call gets parsed and evaluated before new
+                    // otherwise it just looks like any other "new function"
+                    // in JS.
+                    if (nameNode.hasParenthesis())
+                        write(ASEmitterTokens.PAREN_OPEN);                        
+                    // I think we still need this for "new someVarOfTypeClass"
+                    getEmitter().getWalker().walk(nameNode);
+                    if (nameNode.hasParenthesis())
+                        write(ASEmitterTokens.PAREN_CLOSE);                        
+                }
+                
+                getEmitter().emitArguments(node.getArgumentsNode());
+            }
+            else if (!isClassCast)
+            {
+                if (def != null)
+                {
+                    boolean isInt = def.getBaseName().equals(IASGlobalFunctionConstants._int);
+                    if (isInt || def.getBaseName().equals(IASGlobalFunctionConstants.trace)
+                            || def.getBaseName().equals(IASGlobalFunctionConstants.uint))
+                    {
+                        ICompilerProject project = this.getProject();
+                        if (project instanceof FlexJSProject)
+                            ((FlexJSProject) project).needLanguage = true;
+                        startMapping(node.getNameNode());
+                        write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+                        write(ASEmitterTokens.MEMBER_ACCESS);
+                        if (isInt)
+                            write(JSFlexJSEmitterTokens.UNDERSCORE);
+                        endMapping(node.getNameNode());
+                    }
+                    else if (def != null && def.getBaseName().equals("sortOn"))
+                	{
+                		if (def.getParent() != null &&
+                    		def.getParent().getQualifiedName().equals("Array"))
+                		{
+                            ICompilerProject project = this.getProject();
+                            if (project instanceof FlexJSProject)
+                                ((FlexJSProject) project).needLanguage = true;
+                            write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+                            write(ASEmitterTokens.MEMBER_ACCESS);
+                            write("sortOn");
+                            IContainerNode newArgs = EmitterUtils.insertArgumentsBefore(node.getArgumentsNode(), cnode);
+                            fjs.emitArguments(newArgs);
+                            return;
+            			}
+            		}
+
+                    else if (def instanceof AppliedVectorDefinition)
+                    {
+                        IExpressionNode[] argumentNodes = node.getArgumentNodes();
+                        int len = argumentNodes.length;
+                        for (int i = 0; i < len; i++)
+                        {
+                            IExpressionNode argumentNode = argumentNodes[i];
+                            getWalker().walk(argumentNode);
+                            if(i < len - 1)
+                            {
+                                write(", ");
+                            }
+                        }
+                        write(".slice()");
+                        return;
+                    }
+                }
+            	getWalker().walk(node.getNameNode());
+
+                getEmitter().emitArguments(node.getArgumentsNode());
+            }
+            else //function-style cast
+            {
+                fjs.emitIsAs(node, node.getArgumentNodes()[0], node.getNameNode(), ASTNodeID.Op_AsID, true);
+            }
+        }
+        else
+        {
+            fjs.emitSuperCall(node, JSSessionModel.SUPER_FUNCTION_CALL);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
new file mode 100644
index 0000000..0d91fcf
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/IdentifierEmitter.java
@@ -0,0 +1,257 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition.FunctionClassification;
+import org.apache.flex.compiler.definitions.IVariableDefinition;
+import org.apache.flex.compiler.definitions.IVariableDefinition.VariableClassification;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
+import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
+import org.apache.flex.compiler.internal.definitions.TypeDefinitionBase;
+import org.apache.flex.compiler.internal.tree.as.NonResolvingIdentifierNode;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IFunctionObjectNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.utils.NativeUtils;
+
+public class IdentifierEmitter extends JSSubEmitter implements
+        ISubEmitter<IIdentifierNode>
+{
+
+    public IdentifierEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IIdentifierNode node)
+    {
+    	if (node instanceof NonResolvingIdentifierNode)
+    	{
+            startMapping(node);
+    		write(node.getName());
+            endMapping(node);
+    		return;
+    	}
+        IDefinition nodeDef = ((IIdentifierNode) node).resolve(getProject());
+
+        IASNode parentNode = node.getParent();
+        ASTNodeID parentNodeId = parentNode.getNodeID();
+
+        boolean identifierIsAccessorFunction = nodeDef instanceof AccessorDefinition;
+        boolean identifierIsPlainFunction = nodeDef instanceof FunctionDefinition
+                && !identifierIsAccessorFunction;
+        boolean emitName = true;
+
+        if (nodeDef != null && nodeDef.isStatic())
+        {
+            String sname = nodeDef.getParent().getQualifiedName();
+            if (sname.equals("Array"))
+            {
+            	String baseName = nodeDef.getBaseName();
+            	if (baseName.equals("CASEINSENSITIVE"))
+            	{
+            		write("1");
+            		return;
+            	}
+            	else if (baseName.equals("DESCENDING"))
+            	{
+            		write("2");
+            		return;
+            	}
+            	else if (baseName.equals("UNIQUESORT"))
+            	{
+            		write("4");
+            		return;
+            	}
+            	else if (baseName.equals("RETURNINDEXEDARRAY"))
+            	{
+            		write("8");
+            		return;
+            	}
+            	else if (baseName.equals("NUMERIC"))
+            	{
+            		write("16");
+            		return;
+            	}
+            }
+            else if (sname.equals("int"))
+            {
+            	String baseName = nodeDef.getBaseName();
+            	if (baseName.equals("MAX_VALUE"))
+            	{
+            		write("2147483648");
+            		return;
+            	}
+            	else if (baseName.equals("MIN_VALUE"))
+            	{
+            		write("-2147483648");
+            		return;
+            	}            	
+            }
+            else if (sname.equals("uint"))
+            {
+            	String baseName = nodeDef.getBaseName();
+            	if (baseName.equals("MAX_VALUE"))
+            	{
+            		write("4294967295");
+            		return;
+            	}
+            	else if (baseName.equals("MIN_VALUE"))
+            	{
+            		write("0");
+            		return;
+            	}            	
+            }
+            if (sname.length() > 0)
+            {
+                write(getEmitter().formatQualifiedName(sname));
+                write(ASEmitterTokens.MEMBER_ACCESS);
+            }
+        }
+        else if (!NativeUtils.isNative(node.getName()))
+        {
+            boolean identifierIsLocalOrInstanceFunctionAsValue = false;
+            if (identifierIsPlainFunction)
+            {
+                FunctionClassification fc = ((FunctionDefinition)nodeDef).getFunctionClassification();
+                identifierIsLocalOrInstanceFunctionAsValue =
+                        (fc == FunctionClassification.LOCAL || fc == FunctionClassification.CLASS_MEMBER) &&
+                                // not a value if parent is a function call or member access expression
+                                (!(parentNodeId == ASTNodeID.MemberAccessExpressionID || parentNodeId == ASTNodeID.FunctionCallID));
+
+            }
+            // an instance method as a parameter or
+            // a local function
+            boolean generateClosure = (parentNodeId == ASTNodeID.ContainerID
+                    && identifierIsPlainFunction && ((FunctionDefinition) nodeDef)
+                    .getFunctionClassification() == FunctionClassification.CLASS_MEMBER)
+                    || identifierIsLocalOrInstanceFunctionAsValue;
+
+            if (generateClosure)
+            {
+                getEmitter().emitClosureStart();
+            }
+
+            if (EmitterUtils.writeThis(getProject(), getModel(), node))
+            {
+                IFunctionObjectNode functionObjectNode = (IFunctionObjectNode) node
+                        .getParent().getAncestorOfType(
+                                IFunctionObjectNode.class);
+
+                if (functionObjectNode != null)
+                    write(JSGoogEmitterTokens.SELF);
+                else
+                    write(ASEmitterTokens.THIS);
+
+                write(ASEmitterTokens.MEMBER_ACCESS);
+            }
+
+            if (generateClosure)
+            {
+                write(node.getName());
+
+                writeToken(ASEmitterTokens.COMMA);
+                write(ASEmitterTokens.THIS);
+                getEmitter().emitClosureEnd(node);
+                emitName = false;
+            }
+        }
+
+        //IDefinition parentDef = (nodeDef != null) ? nodeDef.getParent() : null;
+        //boolean isNative = (parentDef != null)
+        //        && NativeUtils.isNative(parentDef.getBaseName());
+        if (emitName)
+        {
+            if (nodeDef != null)
+            {
+                // this can be optimized but this way lets
+                // us breakpoint on the node.getName() to make
+                // sure it is ok to always use the short name in an MAE
+                String qname = nodeDef.getQualifiedName();
+                boolean isPackageOrFileMember = false;
+                if (nodeDef instanceof IVariableDefinition)
+                {
+                    IVariableDefinition variable = (IVariableDefinition) nodeDef;
+                    VariableClassification classification = variable.getVariableClassification();
+                    if (classification == VariableClassification.PACKAGE_MEMBER ||
+                            classification == VariableClassification.FILE_MEMBER)
+                    {
+                        isPackageOrFileMember = true;
+                    }
+                }
+                else if (nodeDef instanceof IFunctionDefinition)
+                {
+                    IFunctionDefinition func = (IFunctionDefinition) nodeDef;
+                    FunctionClassification classification = func.getFunctionClassification();
+                    if (classification == FunctionClassification.PACKAGE_MEMBER ||
+                            classification == FunctionClassification.FILE_MEMBER)
+                    {
+                        isPackageOrFileMember = true;
+                    }
+                }
+                boolean needsFormattedName = false;
+                if (isPackageOrFileMember && parentNodeId == ASTNodeID.MemberAccessExpressionID)
+                {
+                    IMemberAccessExpressionNode parentMemberAccessNode = (IMemberAccessExpressionNode) parentNode;
+                    //if the package or file member isn't on the left side of a
+                    //member access expression, it shouldn't be fully qualified
+                    needsFormattedName = parentMemberAccessNode.getLeftOperandNode() == node;
+                }
+                startMapping(node);
+                if (parentNodeId == ASTNodeID.MemberAccessExpressionID)
+                {
+                    if (needsFormattedName)
+                    {
+                        write(getEmitter().formatQualifiedName(qname));
+                    }
+                    else
+                    {
+                        write(node.getName());
+                    }
+                }
+                else if (isPackageOrFileMember)
+                    write(getEmitter().formatQualifiedName(qname));
+                else if (nodeDef instanceof TypeDefinitionBase)
+                    write(getEmitter().formatQualifiedName(qname));
+                else
+                    write(qname);
+                endMapping(node);
+            }
+            else
+            {
+                startMapping(node);
+                write(node.getName());
+                endMapping(node);
+            }
+        }
+    }
+
+}


[50/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/FalconJXFormat.xml
----------------------------------------------------------------------
diff --git a/FalconJXFormat.xml b/FalconJXFormat.xml
deleted file mode 100644
index 5d4e5ca..0000000
--- a/FalconJXFormat.xml
+++ /dev/null
@@ -1,295 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<profiles version="12">
-<profile kind="CodeFormatterProfile" name="FalconFormat" version="12">
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="48"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="120"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
-<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="120"/>
-<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="48"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
-</profile>
-</profiles>

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/build.properties
----------------------------------------------------------------------
diff --git a/build.properties b/build.properties
deleted file mode 100644
index e5f94e9..0000000
--- a/build.properties
+++ /dev/null
@@ -1,40 +0,0 @@
-################################################################################
-##
-##  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.
-##
-################################################################################
-
-release.version = 0.7.0
-
-generated.by.match=/\\*\\*. \\* Generated by Apache Flex Cross-Compiler
-generated.by.comment=/**\n\
-\ * Generated by Apache Flex Cross-Compiler
-
-asfheader=/**\n\
-\ * Licensed under the Apache License, Version 2.0 (the 'License');\n\
-\ * you may not use this file except in compliance with the License.\n\
-\ * You may obtain a copy of the License at\n\
-\ *\n\
-\ *     http://www.apache.org/licenses/LICENSE-2.0\n\
-\ *\n\
-\ * Unless required by applicable law or agreed to in writing, software\n\
-\ * distributed under the License is distributed on an 'AS IS' BASIS,\n\
-\ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\
-\ * See the License for the specific language governing permissions and\n\
-\ * limitations under the License.\n\
-\ */\n
-
-

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
deleted file mode 100644
index 731a6c8..0000000
--- a/build.xml
+++ /dev/null
@@ -1,1175 +0,0 @@
-<?xml version="1.0" ?>
-
-<!--
-
-  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.
-
--->
-
-<project name="falcon" default="main" basedir=".">
-
-    <property file="${basedir}/env.properties"/>
-    <property environment="env"/>
-    <property file="${basedir}/local.properties"/>
-    <property file="${basedir}/build.properties"/>
-
-    <property name="kit.prefix" value="apache-flex-falcon-${release.version}"/>
-    <property name="kit.jx.prefix" value="apache-flex-falconjx-${release.version}"/>
-    <property name="source.kit" value="${kit.prefix}-src"/>
-    <property name="binary.kit" value="${kit.prefix}-bin"/>
-    <property name="source.jx.kit" value="${kit.jx.prefix}-src"/>
-    <property name="binary.jx.kit" value="${kit.jx.prefix}-bin"/>
-
-    <!--
-     Optional jars but should be in place for a real release build.
-     
-     For <grep> put AntelopeTasks_*.jar in this path.
-     See version-update.
-     
-     For <rat> apache-rat-0.8.jar and apache-rat-tasks-0.8.jar should be in classpath.
-     See rat-check.
-     -->
-    <path id="anttask.classpath">
-        <fileset dir="${env.ANT_HOME}/lib">
-            <include name="**/AntelopeTasks_*.jar"/>
-            <include name="**/apache-rat*.jar"/>
-        </fileset>
-        <fileset dir="${user.home}">
-            <include name=".ant/lib/**/AntelopeTasks_*.jar"/>
-            <include name=".ant/lib/**/apache-rat*.jar"/>
-        </fileset>
-    </path>
-
-    <target name="javadoc" description="Builds Falcon's Javadoc at generated/javadoc.">
-        <!--<ant dir="compiler" target="javadoc"/>-->
-    </target>
-
-    <target name="eclipse" description="Prepares or updates Falcon's project(s) for use in Eclipse. This takes care of generating Java files for lexers, parsers, and BURMs.">
-        <ant dir="compiler" target="eclipse"/>
-        <ant dir="compiler.tests" target="eclipse"/>
-    </target>
-
-    <target name="sdk" description="Produces an SDK at generated/dist/sdk containing both Falcon and the legacy compiler.">
-        <ant dir="compiler" target="sdk"/>
-    </target>
-
-    <target name="main" depends="sdk, javadoc, tests" description="Default target - Builds a Falcon SDK, builds Falcon Javadoc, and runs tests."/>
-
-    <target name="all" depends="main, jx, oem, debugger" description="Builds Falcon, then FalconJX"/>
-
-    <target name="jx" depends="compiler.jx, extern.swcs, compiler.jx.tests" description="Builds FalconJX" />
-    
-    <target name="oem" depends="compiler.oem" description="Builds FB Integration JAR" />
-
-    <target name="compiler.binary.release" >
-        <ant dir="compiler" target="release-binaries" />
-    </target>
-    
-    <target name="tests" description="Runs the tests." unless="skip.compiler.tests">
-        <ant dir="compiler.tests" target="main"/>
-    </target>
-
-    <target name="compiler.oem" depends="compiler.jx, swfutils" description="Builds FB Integration JAR">
-        <ant dir="flex-compiler-oem" target="main"/>
-    </target>
-
-    <target name="debugger" depends="swfutils" description="Builds FDB JAR">
-        <ant dir="debugger" target="jar"/>
-    </target>
-
-    <target name="swfutils_copy" unless="swfutils.bundled"
-        description="Copies a subset of files from swfutils.jar into the swfutils folder so flex-compiler-oem and the debugger can use them">
-        <mkdir dir="swfutils" />
-        <mkdir dir="swfutils/src" />
-        <mkdir dir="swfutils/classes" />
-        <copy todir="swfutils/src" >
-            <fileset dir="${FLEX_SDK_HOME}/modules/swfutils/src">
-                <include name="java/flash/localization/**"/>
-                <include name="java/flash/swf/Movie.java"/>
-                <include name="java/flash/swf/actions/**"/>
-                <include name="java/flash/swf/Action.java"/>
-                <include name="java/flash/swf/ActionConstants.java"/>
-                <include name="java/flash/swf/ActionDecoder.java"/>
-                <include name="java/flash/swf/ActionFactory.java"/>
-                <include name="java/flash/swf/ActionHandler.java"/>
-                <include name="java/flash/swf/CompressionLevel.java"/>
-                <include name="java/flash/swf/debug/**"/>
-                <include name="java/flash/swf/DebugDecoder.java"/>
-                <include name="java/flash/swf/DebugHandler.java"/>
-                <include name="java/flash/swf/DebugTags.java"/>
-                <include name="java/flash/swf/Dictionary.java"/>
-                <include name="java/flash/swf/Frame.java"/>
-                <include name="java/flash/swf/Header.java"/>
-                <include name="java/flash/swf/MovieMetaData.java"/>
-                <include name="java/flash/swf/RandomAccessBuffer.java"/>
-                <include name="java/flash/swf/SwfDecoder.java"/>
-                <include name="java/flash/swf/SwfEncoder.java"/>
-                <include name="java/flash/swf/SwfFormatException.java"/>
-                <include name="java/flash/swf/Tag.java"/>
-                <include name="java/flash/swf/TagDecoder.java"/>
-                <include name="java/flash/swf/TagHandler.java"/>
-                <include name="java/flash/swf/TagValues.java"/>
-                <include name="java/flash/swf/tags/**"/>
-                <include name="java/flash/swf/tools/Disassembler.java"/>
-<!--                <include name="java/flash/swf/tags/EnableDebugger.java"/>
-                <include name="java/flash/swf/tags/DefineShape.java"/>
-                <include name="java/flash/swf/tags/DefineTag.java"/>
-                <include name="java/flash/swf/tags/GenericTag.java"/>
-                <include name="java/flash/swf/tags/ScriptLimits.java"/>
-                <include name="java/flash/swf/tags/SetBackgroundColor.java"/>
-                <include name="java/flash/swf/tags/ShowFrame.java"/>
-                <include name="java/flash/swf/tags/FileAttributes.java"/>
-                <include name="java/flash/swf/tags/EnableTelemetry.java"/>
-                <include name="java/flash/swf/tags/ProductInfo.java"/>
-                <include name="java/flash/swf/tags/Metadata.java"/>
-                <include name="java/flash/swf/tags/DefineSceneAndFrameLabelData.java"/>
-                <include name="java/flash/swf/types/FlashUUID.java"/>
-                <include name="java/flash/swf/types/Rect.java"/>
- -->
-                <include name="java/flash/swf/types/**"/>
-                <include name="java/flash/util/ExceptionUtil.java"/>
-                <include name="java/flash/util/FieldFormat.java"/>
-                <include name="java/flash/util/FileUtils.java"/>
-                <include name="java/flash/util/IntMap.java"/>
-                <include name="java/flash/util/Trace.java"/>
-            </fileset>
-        </copy>
-    </target>
-    
-    <target name="swfutils" depends="swfutils_check,check-flex-home,swfutils_copy"
-        description="Builds swfutils.jar">
-        <mkdir dir="swfutils" />
-        <mkdir dir="swfutils/src" />
-        <mkdir dir="swfutils/classes" />
-        <property name="javac.src" value="1.6"/>
-        <javac includes="**/*.java" destdir="${basedir}/swfutils/classes"
-            source="${javac.src}" target="${javac.src}">
-            <src path="${basedir}/swfutils/src" />
-        </javac>
-        <mkdir dir="${basedir}/swfutils/classes/META-INF"/>
-        <copy file="${basedir}/LICENSE.base" tofile="${basedir}/swfutils/classes/META-INF/LICENSE"/>
-        <copy file="${basedir}/NOTICE.swfutils" tofile="${basedir}/swfutils/classes/META-INF/NOTICE"/>
-        <jar destfile="${basedir}/compiler/generated/dist/sdk/lib/swfutils.jar" basedir="${basedir}/swfutils/classes" includes="**/*.class **/*.properties **/*.txt">
-            <include name="META-INF/LICENSE"/>
-            <include name="META-INF/NOTICE"/>
-            <manifest>
-                <attribute name="Sealed" value="${manifest.sealed}" />
-                <attribute name="Implementation-Title" value="${manifest.Implementation-Title}" />
-                <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}" />
-                <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}" />
-            </manifest>
-        </jar>
-    </target>
-    
-    <target name="swfutils_check" description="determine if we have bundled swfutils source">
-        <available file="swfutils"
-            type="dir"
-            property="swfutils.bundled"
-            value="true" />
-            <!-- set this to skip FLEX_HOME check -->
-            <available file="swfutils"
-            type="dir"
-            property="mxmlc.jar.exists"
-            value="true" />
-    </target>
-    
-    <target name="compiler.jx" description="Builds FalconJX.">
-        <ant dir="compiler.jx" target="main"/>
-    </target>
-
-    <target name="compiler.jx.tests" description="Runs the tests." unless="skip.compiler.jx.tests">
-        <ant dir="compiler.jx.tests" target="main"/>
-    </target>
-
-    <target name="copyLastSuccessfulBuild" description="Copies last flex-asjs build.">
-        <ant dir="compiler.jx.tests" target="copyLastSuccessfulBuild"/>
-    </target>
-    
-    <target name="clean" description="Cleans the build output but leaves any downloaded JARs.">
-        <ant dir="compiler" target="clean"/>
-        <ant dir="compiler.tests" target="clean"/>
-    </target>
-
-    <target name="clean-all" description="Cleans the build output but leaves any downloaded JARs.">
-        <ant dir="compiler" target="clean"/>
-        <ant dir="compiler.tests" target="clean"/>
-        <ant dir="compiler.jx" target="clean"/>
-        <ant dir="compiler.jx.tests" target="clean"/>
-        <ant dir="flex-compiler-oem" target="clean"/>
-        <ant dir="debugger" target="clean"/>
-        <antcall target="extern.swcs.clean"/>
-    </target>
-
-    <target name="wipe" description="Wipes out everything that didn't come from Git.">
-        <ant dir="compiler" target="wipe"/>
-        <ant dir="compiler.tests" target="wipe"/>
-    </target>
-    
-    <target name="wipe-all" description="Wipes out everything that didn't come from Git.">
-        <ant dir="compiler" target="wipe"/>
-        <ant dir="compiler.tests" target="wipe"/>
-		<ant dir="compiler.jx" target="super-clean"/>
-        <ant dir="compiler.jx.tests" target="wipe"/>
-        <ant dir="flex-compiler-oem" target="wipe"/>
-        <ant dir="debugger" target="clean"/>
-        <delete dir="${basedir}/swfutils" failonerror="false" includeEmptyDirs="true"/>
-        <delete dir="${basedir}/out" failonerror="false" includeEmptyDirs="true"/>
-        <delete dir="${basedir}/temp" failonerror="false" includeEmptyDirs="true"/>
-        <antcall target="extern.swcs.wipe"/>
-    </target>
-
-    <target name="maven-artifacts" description="Installs Falcon artifacts to a local maven repository">
-        <ant dir="compiler" target="maven-artifacts"/>
-    </target>
-
-    <target name="check-flex-home" unless="mxmlc.jar.exists"
-        description="Check FLEX_HOME for both a directory and an exe file">
-        
-        <echo message="FLEX_HOME is ${env.FLEX_HOME}"/>
-        
-        <available file="${env.FLEX_HOME}"
-        type="dir"
-        property="FLEX_SDK_HOME"
-        value="${env.FLEX_HOME}" />
-        
-        <available file="${basedir}/../flex-sdk"
-        type="dir"
-        property="FLEX_SDK_HOME"
-        value="${basedir}/../flex-sdk" />
-        
-        <fail message="The environment variable FLEX_HOME is not set to a directory"
-        unless="FLEX_SDK_HOME"/>
-        
-        <condition property="mxmlc.jar.exists">
-            <available file="${FLEX_SDK_HOME}/lib/mxmlc.jar" type="file"/>
-        </condition>
-        
-        <fail message="The directory ${FLEX_SDK_HOME} does not contain mxmlc.jar"
-        unless="mxmlc.jar.exists"/>
-    </target>
-
-    <!--
-     Can set build.additional-packages to build additional-packages as part of a release.
-     This does not build the docs.  Use doc-packages or asdoc-packages.
-     -->
-    <target name="release"
-        depends="source-release,binary-release,rat-check"
-        description="Creates source and binary kits for Apache Falcon and FalconJX."/>
-        
-    <target name="source-release"
-        depends="wipe-all,check-flex-home,swfutils,source-package"
-        description="Packages the source release kit which is the official Apache release."/>
-        
-    <target name="binary-release"
-        depends="setup-binary-release,compiler.binary.release,compiler.jx,extern.swcs,compiler.oem,debugger,binary-package,javadoc"
-        description="Builds and packages the binary kit which is provided as a convenience."/>
-        
-    <!--
-        Package up the Apache Flex sources.  Do not include empty directories.
-                                                                                       
-        Note: even if cleaned, this will package up unversioned files that happen
-        to be in the tree.
-                                                                                       
-        FixMe: clean needs to clean - add code to detect unversioned files
-    -->
-    <target name="source-package" depends="stage-source,source-package-zip,source-package-tgz,stage-source-jx,source-package-jx-zip,source-package-jx-tgz"
-        description="Package source files required to build in zip and tar-gzip file">
-    </target>
-        
-    <!--
-     Packages the source distribution with ZIP.
-     -->
-    <target name="source-package-zip" unless="no.zip">
-        <mkdir dir="${basedir}/out"/>
-        <zip destfile="${basedir}/out/${source.kit}.zip" basedir="${basedir}/temp"/>
-    </target>
-        
-    <!--
-     Packages the source distribution with TAR-GZIP.
-     -->
-    <target name="source-package-tgz" unless="no.zip">
-        <tar-gzip name="${source.kit}" />
-    </target>
-
-    <!--
-     Packages the source distribution with ZIP.
-     -->
-    <target name="source-package-jx-zip" unless="no.zip">
-        <mkdir dir="${basedir}/out"/>
-        <zip destfile="${basedir}/out/${source.jx.kit}.zip" basedir="${basedir}/temp"/>
-    </target>
-
-    <!--
-     Packages the source distribution with TAR-GZIP.
-     -->
-    <target name="source-package-jx-tgz" unless="no.zip">
-        <tar-gzip name="${source.jx.kit}" />
-    </target>
-
-    <target name="stage-source"
-        description="Package source files required to build in zip file" >
-        <antcall target="clean-temp"/>
-
-        <copy todir="${basedir}/temp" includeEmptyDirs="false">
-            <fileset dir="${basedir}">
-                <include name="build.xml"/>
-                <include name="build.properties"/>
-                <include name="env-template.properties"/>
-                <include name="README"/>
-                <include name="LICENSE"/>
-                <include name="LICENSE.base"/>
-                <include name="NOTICE"/>
-                <include name="NOTICE.base"/>
-                <include name="NOTICE.fdb"/>
-                <include name="NOTICE.oem"/>
-                <include name="NOTICE.swfutils"/>
-                <include name="RELEASE_NOTES"/>
-                <include name="installer.xml"/>
-                <include name="installer.properties/**"/>
-            </fileset>
-        </copy>
-        
-        <!-- compiler -->
-        <antcall target="stage-compiler"/>
-        
-        <!-- compiler.tests -->
-        <antcall target="stage-compiler.tests"/>
-        
-        <!-- compiler -->
-        <antcall target="stage-fb-integration"/>
-        
-        <!-- externs -->
-        <antcall target="stage-externs"/>
-        
-        <!-- copy the flex-sdk files that go in bin-legacy -->
-        <ant dir="compiler" target="stage.sdk" />
-        <mkdir dir="${basedir}/temp/compiler/generated/dist/sdk" />
-        <copy todir="${basedir}/temp/compiler/generated/dist/sdk">
-            <fileset dir="${basedir}/compiler/generated/dist/sdk">
-                <include name="**/**"/>
-                <exclude name="**/*.jar"/>
-                <exclude name="env.properties"/>
-            </fileset>
-        </copy>
-        
-        <!--
-         Source files have Windows line endings.  Most UNIX editors can handle
-         either type of line endings but the converse is often not true.
-         -->
-        <fixcrlf srcdir="${basedir}/temp" eol="crlf" fixlast="false">
-            <exclude name="compiler/generated/dist/sdk/bin/**"/>
-            <exclude name="compiler/generated/dist/sdk/bin-legacy/**"/>
-            <exclude name="compiler/commandline/**"/>
-            <exclude name="**/assets/**"/>
-            <exclude name="**/*.fla"/>
-            <exclude name="**/*.flv"/>
-            <exclude name="**/*.gif"/>
-            <exclude name="**/*.jar"/>
-            <exclude name="**/*.jpg"/>
-            <exclude name="**/*.mp3"/>
-            <exclude name="**/*.pbj"/>
-            <exclude name="**/*.png"/>
-            <exclude name="**/*.sh"/>
-            <exclude name="**/*.swf"/>
-        </fixcrlf>
-        <fixcrlf srcdir="${basedir}/temp/compiler/commandline" eol="crlf" fixlast="false">
-            <include name="**.bat"/>
-        </fixcrlf>
-        
-        <!-- 
-         Unix shell scripts need the correct line endings. 
-         -->
-        <fixcrlf srcdir="${basedir}/temp" eol="unix" fixlast="false">  
-            <include name="**.sh"/>
-            <exclude name="compiler/generated/dist/sdk/bin/**"/>
-            <exclude name="compiler/generated/dist/sdk/bin-legacy/**"/>
-        </fixcrlf>
-    </target>
-
-    <target name="stage-compiler">
-        <copy todir="${basedir}/temp/compiler" includeEmptyDirs="false">
-            <fileset dir="${basedir}/compiler">
-                <include name="**"/>
-                <exclude name=".classpath" />
-                <exclude name=".project" />
-                <exclude name=".settings/**" />
-                <exclude name="dist/**"/>
-                <exclude name="generated/**"/>
-                <exclude name="in/**"/>
-                <exclude name="lib/**"/>
-            </fileset>
-        </copy>
-        
-        <tstamp>
-            <format property="build.number.date" pattern="yyyyMMdd" />
-        </tstamp>
-        <property name="build.version" value="${release.version}.${build.number.date}" />
-        
-        <!-- Update all Version.as files in the kit frameworks directory with build.number -->
-        <!--<antcall target="version-update"/>-->
-    </target>
-
-    <target name="stage-fb-integration">
-        <copy todir="${basedir}/temp/debugger" includeEmptyDirs="false">
-            <fileset dir="${basedir}/debugger">
-                <include name="**"/>
-                <exclude name=".classpath" />
-                <exclude name=".project" />
-                <exclude name=".settings/**" />
-                <exclude name="bin/**"/>
-            </fileset>
-        </copy>
-        <copy todir="${basedir}/temp/flex-compiler-oem" includeEmptyDirs="false">
-            <fileset dir="${basedir}/flex-compiler-oem">
-                <include name="**"/>
-                <exclude name=".classpath" />
-                <exclude name=".project" />
-                <exclude name=".settings/**" />
-                <exclude name="bin/**"/>
-            </fileset>
-        </copy>
-        <mkdir dir="${basedir}/temp/swfutils" />
-        <copy todir="${basedir}/temp/swfutils" includeEmptyDirs="false">
-            <fileset dir="${basedir}/swfutils">
-                <include name="**"/>
-                <exclude name=".classpath" />
-                <exclude name=".project" />
-                <exclude name=".settings/**" />
-                <exclude name="unittest.properties" />
-                <exclude name="classes/**"/>
-                <exclude name="lib/**"/>
-                <exclude name="results/**"/>
-                <exclude name="temp/**"/>
-                <exclude name="test/classes/**"/>
-            </fileset>
-        </copy>
-    </target>
-
-    <target name="stage-externs">
-        <copy todir="${basedir}/temp/externs" includeEmptyDirs="false">
-            <fileset dir="${basedir}/externs">
-                <include name="**/*.xml"/>
-                <include name="**/missing.js"/>
-                <include name="js/src/**"/>
-                <include name="cordova/externs/**"/>
-            </fileset>
-        </copy>
-    </target>
-    
-    <target name="stage-compiler.tests">
-        <copy todir="${basedir}/temp/compiler.tests" includeEmptyDirs="false">
-            <fileset dir="${basedir}/compiler.tests">
-                <include name="**"/>
-                <exclude name=".classpath" />
-                <exclude name=".project" />
-                <exclude name="unittest.properties" />
-                <exclude name="classes/**"/>
-                <exclude name="lib/**"/>
-                <exclude name="results/**"/>
-                <exclude name="temp/**"/>
-            </fileset>
-        </copy>
-    </target>
-
-    <target name="stage-source-jx"
-        description="Package jx source files with other falcon files required to build in zip file" >
-        
-        <copy tofile="${basedir}/temp/LICENSE" file="${basedir}/LICENSE.jx" overwrite="true"/>
-        <copy todir="${basedir}/temp" >
-            <fileset dir="${basedir}">
-                <include name="README_JX"/>
-                <include name="RELEASE_NOTES_JX"/>
-                <include name="LICENSE.jx"/>
-                <include name="LICENSE.jx.bin"/>
-                <include name="NOTICE.jx"/>
-            </fileset>
-        </copy>
-        
-        <copy todir="${basedir}/temp/compiler.jx" includeEmptyDirs="false">
-            <fileset dir="${basedir}/compiler.jx">
-                <include name="**"/>
-                <exclude name=".classpath" />
-                <exclude name=".project" />
-                <exclude name=".settings/**" />
-                <exclude name="classes/**"/>
-                <exclude name="in/**"/>
-                <exclude name="lib/**"/>
-            </fileset>
-        </copy>
-        
-        <copy todir="${basedir}/temp/compiler.jx.tests" includeEmptyDirs="false">
-            <fileset dir="${basedir}/compiler.jx.tests">
-                <include name="**"/>
-                <exclude name=".classpath" />
-                <exclude name=".project" />
-                <exclude name=".settings/**" />
-                <exclude name="unittest.properties" />
-                <exclude name="classes/**"/>
-                <exclude name="lib/**"/>
-                <exclude name="results/**"/>
-                <exclude name="temp/**"/>
-            </fileset>
-        </copy>
-
-        <!-- these files are hand-ported -->
-        <mkdir dir="${basedir}/temp/externs/GCL/src"/>
-        <copy todir="${basedir}/temp/externs/GCL/src">
-            <fileset dir="${basedir}/externs/GCL/src">
-                <include name="**/**"/>
-            </fileset>
-        </copy>
-        <mkdir dir="${basedir}/temp/externs/node/externs"/>
-        <copy todir="${basedir}/temp/externs/node/externs">
-            <fileset dir="${basedir}/externs/node/externs">
-                <include name="**/**"/>
-            </fileset>
-        </copy>
-
-        <!--
-         Source files have Windows line endings.  Most UNIX editors can handle
-         either type of line endings but the converse is often not true.
-         -->
-        <fixcrlf srcdir="${basedir}/temp" eol="crlf" fixlast="false">
-            <exclude name="compiler/generated/dist/sdk/bin/**"/>
-            <exclude name="compiler/generated/dist/sdk/bin-legacy/**"/>
-            <exclude name="compiler/commandline/**"/>
-            <exclude name="compiler.jx/bin/**"/>
-            <exclude name="**/assets/**"/>
-            <exclude name="**/*.fla"/>
-            <exclude name="**/*.flv"/>
-            <exclude name="**/*.gif"/>
-            <exclude name="**/*.jar"/>
-            <exclude name="**/*.jpg"/>
-            <exclude name="**/*.mp3"/>
-            <exclude name="**/*.pbj"/>
-            <exclude name="**/*.png"/>
-            <exclude name="**/*.sh"/>
-            <exclude name="**/*.swf"/>
-        </fixcrlf>
-        <fixcrlf srcdir="${basedir}/temp/compiler/commandline" eol="crlf" fixlast="false">
-            <include name="**.bat"/>
-        </fixcrlf>
-        <fixcrlf srcdir="${basedir}/temp/compiler.jx/bin" eol="crlf" fixlast="false">
-            <include name="**.bat"/>
-        </fixcrlf>
-        <chmod dir="${basedir}/temp/compiler/commandline" excludes="**/*.bat" perm="+x" />
-        <chmod dir="${basedir}/temp/compiler.jx/bin" excludes="**/*.bat" perm="+x" />
-        
-        <!--
-         Unix shell scripts need the correct line endings.
-         -->
-        <fixcrlf srcdir="${basedir}/temp" eol="unix" fixlast="false">
-            <include name="**.sh"/>
-            <exclude name="compiler/generated/dist/sdk/bin/**"/>
-            <exclude name="compiler/generated/dist/sdk/bin-legacy/**"/>
-        </fixcrlf>
-    </target>
-
-    <target name="setup-binary-release" depends="wipe-all"
-        description="Set properties needed to turn on features for release sdk">
-	    <!--
-         For a release build, download everything fresh.
-         Build changes to the downloads, might not be caught by the refresh logic.
-         thirdparty-clean should leave this directory empty but just in case...
-         -->
-	    <delete dir="${basedir}/in" failonerror="false" includeEmptyDirs="true" />
-        
-    </target>
-    
-    <target name="extern.swcs" depends="externc.js.swc, externc.cordova.swc, externc.jquery.swc, externc.jasmine.swc, externc.GCL.swc, externc.createjs.swc, externc.google_maps.swc, externc.node.swc" />
-    <target name="extern.swcs.clean" depends="externc.js.swc.clean, externc.cordova.swc.clean, externc.jquery.swc.clean, externc.jasmine.swc.clean, externc.GCL.swc.clean, externc.createjs.swc.clean, externc.google_maps.swc.clean, externc.node.swc.clean" />
-    <target name="extern.swcs.wipe" depends="extern.swcs.clean" >
-        <delete failonerror="false" includeEmptyDirs="true" >
-            <fileset dir="${basedir}/externs/js">
-                <include name="**/*.js"/>
-                <exclude name="missing.js"/>
-            </fileset>
-        </delete>
-        <delete failonerror="false" includeEmptyDirs="true" >
-            <fileset dir="${basedir}/externs/jquery">
-                <include name="**/*.js"/>
-            </fileset>
-        </delete>
-        <delete failonerror="false" includeEmptyDirs="true" >
-            <fileset dir="${basedir}/externs/jasmine">
-                <include name="**/*.js"/>
-            </fileset>
-        </delete>
-        <!-- GCL externs are hand modified so are in Git
-        <delete failonerror="false" includeEmptyDirs="true" >
-            <fileset dir="${basedir}/externs/GCL">
-                <include name="**/*.js"/>
-            </fileset>
-        </delete>-->
-    </target>
-    
-    <target name="externc.js.swc.clean" >
-        <delete dir="${basedir}/externs/js/out" failonerror="false" includeEmptyDirs="true"/>
-    </target>
-    <target name="externc.cordova.swc.clean" >
-        <delete dir="${basedir}/externs/cordova/out" failonerror="false" includeEmptyDirs="true"/>
-    </target>
-    <target name="externc.jquery.swc.clean" >
-        <delete dir="${basedir}/externs/jquery/out" failonerror="false" includeEmptyDirs="true"/>
-    </target>
-    <target name="externc.jasmine.swc.clean" >
-        <delete dir="${basedir}/externs/jasmine/out" failonerror="false" includeEmptyDirs="true"/>
-    </target>
-    <target name="externc.GCL.swc.clean" >
-        <delete dir="${basedir}/externs/GCL/out" failonerror="false" includeEmptyDirs="true"/>
-    </target>
-    <target name="externc.createjs.swc.clean" >
-        <delete dir="${basedir}/externs/createjs/out" failonerror="false" includeEmptyDirs="true"/>
-    </target>
-    <target name="externc.google_maps.swc.clean" >
-        <delete dir="${basedir}/externs/google_maps/out" failonerror="false" includeEmptyDirs="true"/>
-    </target>
-    <target name="externc.node.swc.clean" >
-        <delete dir="${basedir}/externs/node/out" failonerror="false" includeEmptyDirs="true"/>
-    </target>
-    
-    <target name="externc.js.swc" >
-    	<!-- preprocessing .js files -->
-        <replaceregexp file="${basedir}/externs/js/externs/svg.js" match="@type \{function\(new:.*" replace="" flags="g" />
-        <replaceregexp file="${basedir}/externs/js/externs/svg.js" match="Window\.prototype\..*" replace="" flags="g" />
-        <replace file="${basedir}/externs/js/externs/svg.js" token="EventListener|(function(Event)" value="EventListener|(function(!Event)" />
-        <replaceregexp file="${basedir}/externs/js/externs/es3.js" match="(The constructor of the current object(?:(?!\*/).)*?)@type \{Function\}((?:(?!\*/).)*?\*/[\r\n]+Object\.prototype\.constructor)([^;]*?);" replace="\1@type {Class}\2;" flags="s" />
-        <replaceregexp file="${basedir}/externs/js/externs/es3.js" match="(Transposes the elements of an array in place(?:(?!\*/).)*?[\r\n]+ \*)([\r\n]+)( \* @this)" replace="\1\2 * @return {!Array&lt;?&gt;}\2\3" flags="s" />
-        <replaceregexp file="${basedir}/externs/js/externs/es3.js" match="(Sorts the elements of an array in place(?:(?!\*/).)*?[\r\n]+ \*)([\r\n]+)( \* @param)" replace="\1\2 * @return {!Array&lt;?&gt;}\2\3" flags="s" />
-        
-    	<java jar="${basedir}/compiler.jx/lib/externc.jar" fork="true"
-            failonerror="false">
-            <arg value="+flexlib=externs" />
-            <arg value="-debug" />
-            <arg value="-load-config=externs/js/js-compile-config.xml" />
-        </java>
-        
-    	<copy file="${basedir}/externs/js/src/AS3.as" tofile="${basedir}/externs/js/out/as/classes/AS3.as" />
-        <mkdir dir="${basedir}/externs/js/out/as/classes/__AS3__/vec" />
-        <copy file="${basedir}/externs/js/src/Vector.as" tofile="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector.as" />
-        <copy file="${basedir}/externs/js/src/Vector-template.as" tofile="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$object.as" />
-        <replace file="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$object.as" >
-            <replacefilter token="$t" value="$object" />
-            <replacefilter token=":T" value=":Object" />
-        </replace>
-        <copy file="${basedir}/externs/js/src/Vector-template.as" tofile="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$double.as" />
-        <replace file="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$double.as" >
-            <replacefilter token="$t" value="$double" />
-            <replacefilter token=":T" value=":Number" />
-        </replace>
-        <copy file="${basedir}/externs/js/src/Vector-template.as" tofile="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$int.as" />
-        <replace file="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$int.as" >
-            <replacefilter token="$t" value="$int" />
-            <replacefilter token=":T" value=":int" />
-        </replace>
-        <copy file="${basedir}/externs/js/src/Vector-template.as" tofile="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$uint.as" />
-        <replace file="${basedir}/externs/js/out/as/classes/__AS3__/vec/Vector$uint.as" >
-            <replacefilter token="$t" value="$uint" />
-            <replacefilter token=":T" value=":uint" />
-        </replace>
-        <replace file="${basedir}/externs/js/out/as/functions/parseInt.as" >
-            <replacefilter token="base:Number)" value="base:Number = 10)" />
-        </replace>
-        
-    	<java jar="${basedir}/compiler/generated/dist/sdk/lib/falcon-compc.jar" fork="true"
-            failonerror="true">
-            <arg value="+flexlib=externs" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/js/compile-config.xml" />
-            <arg value="-output=${basedir}/externs/js/out/bin/js.swc" />
-        </java>
-    </target>
-
-    <target name="externc.cordova.swc" >
-        <java jar="${basedir}/compiler.jx/lib/externc.jar" fork="true"
-              failonerror="false">
-            <arg value="+flexlib=externs" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/cordova/cordova-compile-config.xml" />
-        </java>
-        <java jar="${basedir}/compiler/generated/dist/sdk/lib/falcon-compc.jar" fork="true"
-              failonerror="true">
-            <arg value="+flexlib=externs/frameworks" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/cordova/compile-config.xml" />
-            <arg value="-output=${basedir}/externs/cordova/out/bin/cordova.swc" />
-        </java>
-    </target>
-
-    <target name="externc.jquery.swc" >
-        <java jar="${basedir}/compiler.jx/lib/externc.jar" fork="true"
-              failonerror="false">
-            <arg value="+flexlib=externs" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/jquery/jquery-compile-config.xml" />
-        </java>
-        <java jar="${basedir}/compiler/generated/dist/sdk/lib/falcon-compc.jar" fork="true"
-              failonerror="true">
-            <arg value="+flexlib=externs/frameworks" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/jquery/compile-config.xml" />
-            <arg value="-output=${basedir}/externs/jquery/out/bin/jquery-1.9.swc" />
-        </java>
-    </target>
-
-    <target name="externc.jasmine.swc" >
-        <java jar="${basedir}/compiler.jx/lib/externc.jar" fork="true"
-              failonerror="false">
-            <arg value="+flexlib=externs" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/jasmine/jasmine-compile-config.xml" />
-        </java>
-        <java jar="${basedir}/compiler/generated/dist/sdk/lib/falcon-compc.jar" fork="true"
-              failonerror="true">
-            <arg value="+flexlib=externs" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/jasmine/compile-config.xml" />
-            <arg value="-output=${basedir}/externs/jasmine/out/bin/jasmine-2.0.swc" />
-        </java>
-    </target>
-    
-    <target name="externc.GCL.swc" >
-        <java jar="${basedir}/compiler.jx/lib/externc.jar" fork="true"
-            failonerror="false">
-            <arg value="+flexlib=externs/frameworks" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/GCL/GCL-compile-config.xml" />
-        </java>
-        <java jar="${basedir}/compiler/generated/dist/sdk/lib/falcon-compc.jar" fork="true"
-            failonerror="true">
-            <arg value="+flexlib=externs/frameworks" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/GCL/compile-config.xml" />
-            <arg value="-output=${basedir}/externs/GCL/out/bin/GCL.swc" />
-        </java>
-    </target>
-    
-    <target name="externc.createjs.swc" >
-        <ant dir="${basedir}/externs/createjs" />
-        <java jar="${basedir}/compiler.jx/lib/externc.jar" fork="true"
-            failonerror="false">
-            <arg value="+flexlib=externs" />
-            <arg value="-debug" />
-            <arg value="-js-root=${basedir}/externs/createjs/out/externs" />
-            <arg value="-load-config=${basedir}/externs/createjs/createjs-compile-config.xml" />
-        </java>
-        <java jar="${basedir}/compiler.jx/lib/externc.jar" fork="true"
-            failonerror="false">
-            <arg value="+flexlib=externs" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/createjs/createjs-compile-config.xml" />
-        </java>
-        <java jar="${basedir}/compiler/generated/dist/sdk/lib/falcon-compc.jar" fork="true"
-            failonerror="true">
-            <arg value="+flexlib=externs/frameworks" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/createjs/compile-config.xml" />
-            <arg value="-output=${basedir}/externs/createjs/out/bin/createjs.swc" />
-        </java>
-    </target>
-    
-    <target name="externc.google_maps.swc" >
-        <ant dir="${basedir}/externs/google_maps" />
-        <java jar="${basedir}/compiler.jx/lib/externc.jar" fork="true"
-            failonerror="false">
-            <arg value="+flexlib=externs" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/google_maps/google_maps-compile-config.xml" />
-        </java>
-        <java jar="${basedir}/compiler/generated/dist/sdk/lib/falcon-compc.jar" fork="true"
-            failonerror="true">
-            <arg value="+flexlib=externs/frameworks" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/google_maps/compile-config.xml" />
-            <arg value="-output=${basedir}/externs/google_maps/out/bin/google_maps.swc" />
-        </java>
-    </target>
-    
-    <target name="externc.node.swc" >
-        <java jar="${basedir}/compiler.jx/lib/externc.jar" fork="true"
-            failonerror="false">
-            <arg value="+flexlib=externs/frameworks" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/node/node-compile-config.xml" />
-        </java>
-        <java jar="${basedir}/compiler/generated/dist/sdk/lib/falcon-compc.jar" fork="true"
-            failonerror="true">
-            <arg value="+flexlib=externs/frameworks" />
-            <arg value="-debug" />
-            <arg value="-load-config=${basedir}/externs/node/compile-config.xml" />
-            <arg value="-output=${basedir}/externs/node/out/bin/node.swc" />
-        </java>
-    </target>
-    
-    <target name="binary-package"
-        description="Package binary files in zip and tar-gzip file.">
-        
-        <antcall target="stage-source"/>
-        
-        <!-- these files are in addition to the remaining source files -->
-        
-        <!-- copy the flex-sdk files that go in generated/dist/sdk -->
-        <ant dir="compiler" target="copy.sdk" />
-        
-        <!-- generated -->
-        <copy todir="${basedir}/temp/compiler/generated/dist/sdk">
-            <fileset dir="${basedir}/compiler/generated/dist/sdk">
-                <include name="**"/>
-                <exclude name="lib/external/**"/>
-                <exclude name="**/env.properties"/>
-            </fileset>
-        </copy>
-        
-        <fixcrlf srcdir="${basedir}/temp/compiler/generated/dist/sdk/bin" eol="unix" fixlast="false">
-            <include name="aasdoc"/>
-            <include name="acompc"/>
-            <include name="adl"/>
-            <include name="amxmlc"/>
-            <include name="asc"/>
-            <include name="asdoc"/>
-            <include name="compc"/>
-            <include name="copylocale"/>
-            <include name="digest"/>
-            <include name="fcsh"/>
-            <include name="fdb"/>
-            <include name="fontswf"/>
-            <include name="mxmlc"/>
-            <include name="optimizer"/>
-            <include name="swcdepends"/>
-            <include name="swfdump"/>
-        </fixcrlf>
-        
-        <fixcrlf srcdir="${basedir}/temp/compiler/generated/dist/sdk/bin-legacy" eol="unix" fixlast="false">
-            <include name="aasdoc"/>
-            <include name="acompc"/>
-            <include name="adl"/>
-            <include name="amxmlc"/>
-            <include name="asc"/>
-            <include name="asdoc"/>
-            <include name="compc"/>
-            <include name="copylocale"/>
-            <include name="digest"/>
-            <include name="fcsh"/>
-            <include name="fdb"/>
-            <include name="fontswf"/>
-            <include name="mxmlc"/>
-            <include name="optimizer"/>
-            <include name="swcdepends"/>
-            <include name="swfdump"/>
-        </fixcrlf>
-
-        <chmod dir="${basedir}/temp/compiler/generated/dist/sdk/bin" excludes="**/*.bat" perm="+x" />
-        <chmod dir="${basedir}/temp/compiler/generated/dist/sdk/bin-legacy" excludes="**/*.bat" perm="+x" />
-
-        <antcall target="binary-package-zip"/>
-        <antcall target="binary-package-tgz"/>
-        
-        <antcall target="stage-source-jx" />
-        
-        <!-- concat the license file with the binary license file for the 3rd party deps -->
-        <delete file="${basedir}/temp/LICENSE" />
-        <concat destfile="${basedir}/temp/LICENSE">
-            <filelist dir="${basedir}" files="LICENSE.jx,LICENSE.jx.bin"/>
-        </concat>
-        
-        <!-- generated -->
-        <mkdir dir="${basedir}/temp/js"/>
-        <copy todir="${basedir}/temp/js">
-            <fileset dir="${basedir}/compiler.jx">
-                <include name="bin/**"/>
-                <include name="lib/**"/>
-                <exclude name="lib/commons-io**"/>
-                <exclude name="lib/flex-tool**"/>
-                <exclude name="lib/google/**"/>
-                <exclude name="lib/args4j**"/>
-                <exclude name="lib/guava**"/>
-                <exclude name="lib/org.json**"/>
-            </fileset>
-        </copy>
-        
-        <!-- generated -->
-        <mkdir dir="${basedir}/temp/js/libs"/>
-        <copy tofile="${basedir}/temp/js/libs/js.swc" file="${basedir}/externs/js/out/bin/js.swc" />
-        <copy tofile="${basedir}/temp/js/libs/cordova.swc" file="${basedir}/externs/cordova/out/bin/cordova.swc" />
-        <copy tofile="${basedir}/temp/js/libs/createjs.swc" file="${basedir}/externs/createjs/out/bin/createjs.swc" />
-        <copy tofile="${basedir}/temp/js/libs/google_maps.swc" file="${basedir}/externs/google_maps/out/bin/google_maps.swc" />
-        <copy tofile="${basedir}/temp/js/libs/jasmine.swc" file="${basedir}/externs/jasmine/out/bin/jasmine-2.0.swc" />
-        <copy tofile="${basedir}/temp/js/libs/jquery.swc" file="${basedir}/externs/jquery/out/bin/jquery-1.9.swc" />
-        <copy tofile="${basedir}/temp/js/libs/GCL.swc" file="${basedir}/externs/GCL/out/bin/GCL.swc" />
-        <copy tofile="${basedir}/temp/js/libs/node.swc" file="${basedir}/externs/node/out/bin/node.swc" />
-        
-        <!-- generated -->
-        <mkdir dir="${basedir}/temp/externs"/>
-        <copy todir="${basedir}/temp/externs">
-            <fileset dir="${basedir}/externs">
-                <include name="**/**"/>
-                <exclude name="**/*.swc"/>
-                <exclude name="**/*.as"/>
-                <exclude name="GCL/externs/**"/>
-                <exclude name="createjs/out/**"/>
-                <exclude name="createjs/in/**"/>
-            </fileset>
-        </copy>
-        
-        <!-- for FalconJX, remove the legacy folders -->
-        <delete dir="${basedir}/temp/compiler/generated/dist/sdk/lib-legacy" failonerror="false" />
-        <delete dir="${basedir}/temp/compiler/generated/dist/sdk/bin-legacy" failonerror="false" />
-        <delete dir="${basedir}/temp/compiler/generated/dist/sdk/lib/external" failonerror="false" />
-        <delete dir="${basedir}/temp/compiler/generated/dist/sdk/frameworks" failonerror="false" />
-        
-        <antcall target="binary-package-jx-zip"/>
-        <antcall target="binary-package-jx-tgz"/>
-        
-        <copy todir="${basedir}/out">
-            <fileset dir="${basedir}">
-                <include name="apache-flex-falcon-installer-config.xml"/>
-                <include name="apache-flex-falconjx-installer-config.xml"/>
-            </fileset>
-        </copy>
-    </target>
-
-    <!--
-     Packages the binary distribution with ZIP.
-     -->
-    <target name="binary-package-zip" unless="no.zip">
-        <mkdir dir="${basedir}/out"/>
-        <zip destfile="${basedir}/out/${binary.kit}.zip" basedir="${basedir}/temp"/>
-    </target>
-
-    <!--
-     Packages the binary distribution with TAR-GZIP.
-     -->
-    <target name="binary-package-tgz" unless="no.zip">
-        <tar-gzip name="${binary.kit}" />
-    </target>
-
-    <!--
-     Packages the binary distribution with ZIP.
-     -->
-    <target name="binary-package-jx-zip" unless="no.zip">
-        <mkdir dir="${basedir}/out"/>
-        <zip destfile="${basedir}/out/${binary.jx.kit}.zip" basedir="${basedir}/temp"/>
-    </target>
-
-    <!--
-     Packages the binary distribution with TAR-GZIP.
-     -->
-    <target name="binary-package-jx-tgz" unless="no.zip">
-        <tar-gzip name="${binary.jx.kit}" />
-    </target>
-
-    <!--
-     tar with gzip compression, the temp directory and put it in the out directory.
-     The shell scripts in the bin directory (no extension) and other .sh files have
-     mode set to execute.
-     
-     name - the basename name of the kit in out directory, without the .tar.gz extension
-     -->
-    <macrodef name="tar-gzip">
-        <attribute name="name"/>
-        <sequential>
-            <mkdir dir="${basedir}/out"/>
-            <tar destfile="${basedir}/out/@{name}.tar.gz"
-                compression="gzip"
-                longfile="gnu">
-                <tarfileset dir="${basedir}/temp" prefix="@{name}">
-                    <include name="**" />
-                    <exclude name="bin/**" />
-                    <exclude name="**/*.sh" />
-                </tarfileset>
-                <tarfileset dir="${basedir}/temp" prefix="@{name}">
-                    <include name="bin/*.bat" />
-                </tarfileset>
-                <tarfileset dir="${basedir}/temp" prefix="@{name}" mode="755">
-                    <include name="bin/*" />
-                    <include name="**/*.sh" />
-                    <exclude name="bin/*.bat" />
-                </tarfileset>
-            </tar>
-        </sequential>
-    </macrodef>
-
-    <!--
-     Run the Apache Rat audit tool against the source in the source kit.
-     The report is written to rat.report.
-     
-     To check a subset of files run with -Drat.dir=<dir>.
-     
-     You need to place apache-rat-tasks-0.8.jar and apache-rat-0.8.jar in the
-     anttask.classpath in order to do this.  If the jar isn't found, the report
-     will not be generated.
-     -->
-    <target name="rat-check" depends="rat-taskdef" if="have.rattasks"
-        description="Report on licenses in source kit.">
-        
-        <property name="rat.dir" value="${basedir}/temp"/>
-        <antcall target="rat-unzip" />
-        
-        <property name="rat.report" value="${basedir}/rat.report"/>
-        <echo message="Checking files at ${rat.dir}, report is ${rat.report}"/>
-        
-        <rat:report xmlns:rat="antlib:org.apache.rat.anttasks" reportFile="${rat.report}">
-            <fileset dir="${rat.dir}">
-                <!--          Start of binary files           -->
-                <!-- exclude media (png, gif, jpg, mp3, flv) -->
-                <exclude name="**/*.png"/>
-                <exclude name="**/*.gif"/>
-                <exclude name="**/*.jpg"/>
-                <exclude name="**/*.mp3"/>
-                <exclude name="**/*.flv"/>
-                <exclude name="**/org.apache.flex.tools.FlexToolGroup"/>
-                <exclude name="debugger/META-INF/MANIFEST.MF"/>
-                <exclude name="LICENSE.jx.bin"/>
-                <exclude name="README_JX"/>
-                <exclude name="RELEASE_NOTES_JX"/>
-                <exclude name="NOTICE.jx"/>
-                <exclude name="NOTICE.base"/>
-                <exclude name="NOTICE.fdb"/>
-                <exclude name="NOTICE.oem"/>
-                <exclude name="NOTICE.swfutils"/>
-            </fileset>
-        </rat:report>
-    </target>
-
-    <target name="rat-unzip" unless="no.zip">
-        <antcall target="clean-temp" />
-        <unzip src="${basedir}/out/${source.jx.kit}.zip" dest="${rat.dir}"/>
-    </target>
-
-    <target name="rat-taskdef" description="Rat taskdef">
-        <available property="have.rattasks"
-        resource="org/apache/rat/anttasks/antlib.xml"
-        classpathref="anttask.classpath"/>
-        
-        <antcall target="have-rattasks"/>
-        <antcall target="no-rattasks"/>
-    </target>
-
-    <target name="have-rattasks" if="have.rattasks">
-        <typedef resource="org/apache/rat/anttasks/antlib.xml"
-        uri="antlib:org.apache.rat.anttasks"
-        classpathref="anttask.classpath"/>
-    </target>
-
-    <target name="no-rattasks" unless="have.rattasks">
-        <echo message="Rat report not generated."/>
-        <echo message="rat jars (apache-rat-*.jar, apache-rat-tasks-*.jar)"/>
-        <echo message="not found in anttask.classpath"/>
-    </target>
-
-    <target name="clean-temp" unless="noclean.temp">
-        <delete dir="${basedir}/temp" failonerror="false" includeEmptyDirs="true"/>
-    </target>
-
-    <target name="create-md5" >
-        <echo message="Generating MD5 hashes for release artifacts"/>
-        <checksum algorithm="md5" file="${basedir}/out/${binary.kit}.tar.gz" forceOverwrite="yes"/>
-        <checksum algorithm="md5" file="${basedir}/out/${binary.kit}.zip" forceOverwrite="yes"/>
-        <checksum algorithm="md5" file="${basedir}/out/${source.kit}.tar.gz" forceOverwrite="yes"/>
-        <checksum algorithm="md5" file="${basedir}/out/${source.kit}.zip" forceOverwrite="yes"/>
-        <checksum algorithm="md5" file="${basedir}/out/${binary.jx.kit}.tar.gz" forceOverwrite="yes"/>
-        <checksum algorithm="md5" file="${basedir}/out/${binary.jx.kit}.zip" forceOverwrite="yes"/>
-        <checksum algorithm="md5" file="${basedir}/out/${source.jx.kit}.tar.gz" forceOverwrite="yes"/>
-        <checksum algorithm="md5" file="${basedir}/out/${source.jx.kit}.zip" forceOverwrite="yes"/>
-    </target>
-
-    <target name="sign" >
-        <exec executable="gpg">
-            <arg value="--armor" />
-            <arg value="--output" />
-            <arg value="${basedir}/out/${source.kit}.zip.asc" />
-            <arg value="--detach-sig" />
-            <arg value="${basedir}/out/${source.kit}.zip" />
-        </exec>
-        
-        <exec executable="gpg">
-            <arg value="--armor" />
-            <arg value="--output" />
-            <arg value="${basedir}/out/${source.kit}.tar.gz.asc" />
-            <arg value="--detach-sig" />
-            <arg value="${basedir}/out/${source.kit}.tar.gz" />
-        </exec>
-        
-        <exec executable="gpg">
-            <arg value="--armor" />
-            <arg value="--output" />
-            <arg value="${basedir}/out/${binary.kit}.zip.asc" />
-            <arg value="--detach-sig" />
-            <arg value="${basedir}/out/${binary.kit}.zip" />
-        </exec>
-        
-        <exec executable="gpg">
-            <arg value="--armor" />
-            <arg value="--output" />
-            <arg value="${basedir}/out/${binary.kit}.tar.gz.asc" />
-            <arg value="--detach-sig" />
-            <arg value="${basedir}/out/${binary.kit}.tar.gz" />
-        </exec>
-        
-        <exec executable="gpg">
-            <arg value="--armor" />
-            <arg value="--output" />
-            <arg value="${basedir}/out/${source.jx.kit}.zip.asc" />
-            <arg value="--detach-sig" />
-            <arg value="${basedir}/out/${source.jx.kit}.zip" />
-        </exec>
-        
-        <exec executable="gpg">
-            <arg value="--armor" />
-            <arg value="--output" />
-            <arg value="${basedir}/out/${source.jx.kit}.tar.gz.asc" />
-            <arg value="--detach-sig" />
-            <arg value="${basedir}/out/${source.jx.kit}.tar.gz" />
-        </exec>
-        
-        <exec executable="gpg">
-            <arg value="--armor" />
-            <arg value="--output" />
-            <arg value="${basedir}/out/${binary.jx.kit}.zip.asc" />
-            <arg value="--detach-sig" />
-            <arg value="${basedir}/out/${binary.jx.kit}.zip" />
-        </exec>
-        
-        <exec executable="gpg">
-            <arg value="--armor" />
-            <arg value="--output" />
-            <arg value="${basedir}/out/${binary.jx.kit}.tar.gz.asc" />
-            <arg value="--detach-sig" />
-            <arg value="${basedir}/out/${binary.jx.kit}.tar.gz" />
-        </exec>
-    </target>
-
-    <!-- may not work on windows -->
-    <target name="inject-asf-header" >
-        <replaceregexp match="${generated.by.match}"
-            replace="${asfheader}${generated.by.comment}"
-            byline="false"
-            flags="s">
-            <fileset dir="${basedir}/temp">
-                <include name="**/*.js" />
-            </fileset>
-        </replaceregexp>
-    </target>
-
-    <target name="sdk.dependent.tests" >
-        <ant dir="compiler.tests" target="sdk.dependent.tests" />
-        <ant dir="compiler.jx.tests" target="integration.tests.sdk" />
-    </target>
-    <target name="flexjs.dependent.tests" >
-        <ant dir="compiler.jx.tests" target="integration.tests.asjs" />
-    </target>
-
-</project>


[37/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSDocEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSDocEmitter.java
new file mode 100644
index 0000000..3147c20
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSDocEmitter.java
@@ -0,0 +1,270 @@
+/*
+ *
+ *  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.internal.codegen.js.vf2js;
+
+import org.apache.flex.compiler.asdoc.flexjs.ASDocComment;
+import org.apache.flex.compiler.clients.MXMLJSC;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.common.DependencyType;
+import org.apache.flex.compiler.constants.IASKeywordConstants;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.definitions.references.IReference;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogDocEmitter;
+import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
+import org.apache.flex.compiler.internal.scopes.ASScope;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+
+public class JSVF2JSDocEmitter extends JSGoogDocEmitter
+{
+
+    public JSVF2JSDocEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emitMethodDoc(IFunctionNode node, ICompilerProject project)
+    {
+        IClassDefinition classDefinition = resolveClassDefinition(node);
+
+        ASDocComment asDoc = (ASDocComment) node.getASDocComment();
+        
+        if (node instanceof IFunctionNode)
+        {
+            boolean hasDoc = false;
+
+            if (node.isConstructor())
+            {
+                if (asDoc != null && MXMLJSC.keepASDoc)
+                    write(asDoc.commentNoEnd());
+                else
+                    begin();
+                hasDoc = true;
+
+                emitJSDocLine(JSEmitterTokens.CONSTRUCTOR);
+
+                IClassDefinition parent = (IClassDefinition) node
+                        .getDefinition().getParent();
+                IClassDefinition superClass = parent.resolveBaseClass(project);
+                String qname = (superClass != null) ? superClass.getQualifiedName() : null;
+
+                if (superClass != null
+                        && !qname.equals(IASLanguageConstants.Object))
+                    emitExtends(superClass, superClass.getPackageName());
+
+                IReference[] references = classDefinition
+                        .getImplementedInterfaceReferences();
+                for (IReference iReference : references)
+                {
+                    ITypeDefinition type = (ITypeDefinition) iReference
+                            .resolve(project, (ASScope) classDefinition
+                                    .getContainingScope(),
+                                    DependencyType.INHERITANCE, true);
+                    if (type == null)
+                    	System.out.println(iReference.getDisplayString() + " not resolved in " + classDefinition.getQualifiedName());
+                    emitImplements(type, type.getPackageName());
+                }
+            }
+            else
+            {
+                String ns = node.getNamespace();
+                if (ns != null)
+                {
+                    if (asDoc != null && MXMLJSC.keepASDoc)
+                        write(asDoc.commentNoEnd());
+                    else
+                        begin();
+                    emitMethodAccess(node);
+                    hasDoc = true;
+                }
+            }
+
+            // @param
+            IParameterNode[] parameters = node.getParameterNodes();
+            for (IParameterNode pnode : parameters)
+            {
+                if (!hasDoc)
+                {
+                    if (asDoc != null && MXMLJSC.keepASDoc)
+                        write(asDoc.commentNoEnd());
+                    else
+                        begin();
+                    emitMethodAccess(node);
+                    hasDoc = true;
+                }
+
+                IExpressionNode enode = pnode.getNameExpressionNode();
+
+                // ToDo (erikdebruin): add VF2JS conditional -> only use check during full SDK compilation
+                ITypeDefinition tdef = enode.resolveType(project);
+                if (tdef == null)
+                    continue;
+                
+                emitParam(pnode, tdef.getPackageName());
+            }
+
+            if (!node.isConstructor())
+            {
+                // @return
+                String returnType = node.getReturnType();
+                if (returnType != ""
+                        && returnType != ASEmitterTokens.VOID.getToken())
+                {
+                    if (!hasDoc)
+                    {
+                        if (asDoc != null && MXMLJSC.keepASDoc)
+                            write(asDoc.commentNoEnd());
+                        else
+                            begin();
+                        emitMethodAccess(node);
+                        hasDoc = true;
+                    }
+
+                    ITypeDefinition tdef = ((IFunctionDefinition)node.getDefinition())
+                            .resolveReturnType(project);
+
+                    String packageName = "";
+                    if (tdef instanceof InterfaceDefinition)
+                        packageName = tdef.getPackageName();
+                    else
+                        packageName = node.getPackageName();
+                    
+                    emitReturn(node, packageName);
+                }
+
+                // @override
+                Boolean override = node.hasModifier(ASModifier.OVERRIDE);
+                if (override)
+                {
+                    if (!hasDoc)
+                    {
+                        if (asDoc != null && MXMLJSC.keepASDoc)
+                            write(asDoc.commentNoEnd());
+                        else
+                            begin();
+                        emitMethodAccess(node);
+                        hasDoc = true;
+                    }
+
+                    emitOverride(node);
+                }
+            }
+
+            if (hasDoc)
+                end();
+        }
+    }
+    
+    @Override
+    public void emitVarDoc(IVariableNode node, IDefinition def, ICompilerProject project)
+    {
+        String packageName = "";
+        if (def != null)
+            packageName = def.getPackageName();
+
+        if (!node.isConst())
+        {
+            IDefinition ndef = node.getDefinition();
+            if (emitter != null && emitter instanceof JSVF2JSEmitter)
+            {
+                if (project != null)
+                {
+                    packageName = ((ITypeDefinition)ndef.resolveType(project))
+                            .getPackageName();
+                }
+            }
+        }
+        
+        emitTypeShort(node, packageName);
+    }
+
+    
+    public void emitInterfaceMemberDoc(IDefinitionNode node, ICompilerProject project)
+    {
+        boolean hasDoc = false;
+        
+        ASDocComment asDoc = (ASDocComment) ((IFunctionNode) node).getASDocComment();
+        
+        String returnType = ((IFunctionNode) node).getReturnType();
+        if (returnType != ""
+                && returnType != ASEmitterTokens.VOID.getToken()) // has return
+        {
+            if (asDoc != null && MXMLJSC.keepASDoc)
+                write(asDoc.commentNoEnd());
+            else
+                begin();
+            hasDoc = true;
+
+            ITypeDefinition tdef = ((IFunctionDefinition)node.getDefinition())
+                    .resolveReturnType(project);
+
+            emitReturn((IFunctionNode) node, tdef.getPackageName());
+        }
+
+        IParameterNode[] parameters = ((IFunctionNode) node).getParameterNodes();
+        for (IParameterNode pnode : parameters)
+        {
+            if (!hasDoc)
+            {
+                if (asDoc != null && MXMLJSC.keepASDoc)
+                    write(asDoc.commentNoEnd());
+                else
+                    begin();
+                hasDoc = true;
+            }
+
+            IExpressionNode enode = pnode.getNameExpressionNode();
+            emitParam(pnode, enode.resolveType(project).getPackageName());
+        }
+
+        if (hasDoc)
+            end();
+    }
+
+    @Override
+    public void emitMethodAccess(IFunctionNode node)
+    {
+        String ns = node.getNamespace();
+        if (ns == IASKeywordConstants.PRIVATE)
+        {
+            emitPrivate(node);
+        }
+        else if (ns == IASKeywordConstants.PROTECTED)
+        {
+            emitProtected(node);
+        }
+        else if (ns == IASKeywordConstants.PUBLIC)
+        {
+            emitPublic(node);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java
new file mode 100644
index 0000000..4f9d5f2
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java
@@ -0,0 +1,1950 @@
+/*
+ *
+ *  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.internal.codegen.js.vf2js;
+
+import java.io.FilterWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.flex.compiler.codegen.IASGlobalFunctionConstants;
+import org.apache.flex.compiler.codegen.js.goog.IJSGoogDocEmitter;
+import org.apache.flex.compiler.codegen.js.vf2js.IJSVF2JSEmitter;
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.common.ModifiersSet;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition.FunctionClassification;
+import org.apache.flex.compiler.definitions.INamespaceDefinition;
+import org.apache.flex.compiler.definitions.IPackageDefinition;
+import org.apache.flex.compiler.definitions.IParameterDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSessionModel;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitter;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
+import org.apache.flex.compiler.internal.definitions.ClassDefinition;
+import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
+import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
+import org.apache.flex.compiler.internal.definitions.ParameterDefinition;
+import org.apache.flex.compiler.internal.definitions.VariableDefinition;
+import org.apache.flex.compiler.internal.projects.CompilerProject;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.scopes.ASProjectScope;
+import org.apache.flex.compiler.internal.scopes.PackageScope;
+import org.apache.flex.compiler.internal.scopes.TypeScope;
+import org.apache.flex.compiler.internal.tree.as.BinaryOperatorAssignmentNode;
+import org.apache.flex.compiler.internal.tree.as.ChainedVariableNode;
+import org.apache.flex.compiler.internal.tree.as.FunctionCallNode;
+import org.apache.flex.compiler.internal.tree.as.FunctionNode;
+import org.apache.flex.compiler.internal.tree.as.NonResolvingIdentifierNode;
+import org.apache.flex.compiler.internal.tree.as.ParameterNode;
+import org.apache.flex.compiler.internal.tree.as.RegExpLiteralNode;
+import org.apache.flex.compiler.internal.tree.as.UnaryOperatorAtNode;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.scopes.IASScope;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IAccessorNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IEmbedNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.IKeywordNode;
+import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
+import org.apache.flex.compiler.tree.as.ILiteralNode;
+import org.apache.flex.compiler.tree.as.ILiteralNode.LiteralType;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.apache.flex.compiler.tree.as.ITypeNode;
+import org.apache.flex.compiler.tree.as.ITypedExpressionNode;
+import org.apache.flex.compiler.tree.as.IVariableExpressionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.utils.ASNodeUtils;
+import org.apache.flex.compiler.utils.NativeUtils;
+
+/**
+ * Concrete implementation of the 'vf2js' JavaScript production.
+ * 
+ * @author Erik de Bruin
+ */
+public class JSVF2JSEmitter extends JSGoogEmitter implements IJSVF2JSEmitter
+{
+
+    public JSVF2JSEmitter(FilterWriter out)
+    {
+        super(out);
+    }
+
+    @Override
+    protected String getIndent(int numIndent)
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < numIndent; i++)
+            sb.append(JSFlexJSEmitterTokens.INDENT.getToken());
+        return sb.toString();
+    }
+
+    @Override
+    protected void emitMemberName(IDefinitionNode node)
+    {
+        write(node.getName());
+    }
+
+    @Override
+    public void emitClass(IClassNode node)
+    {
+        IClassDefinition definition = node.getDefinition();
+        getModel().setCurrentClass(definition);
+
+        project = getWalker().getProject();
+
+        IFunctionDefinition ctorDefinition = definition.getConstructor();
+
+        // Static-only (Singleton) classes may not have a constructor
+        if (ctorDefinition != null)
+        {
+            IFunctionNode ctorNode = (IFunctionNode) ctorDefinition.getNode();
+            if (ctorNode != null)
+            {
+                // constructor
+                emitMethod(ctorNode);
+                write(ASEmitterTokens.SEMICOLON);
+            }
+            else
+            {
+                String qname = parseQualifiedName(definition);
+                if (qname != null && !qname.equals(""))
+                {
+                    write(qname);
+                    write(ASEmitterTokens.SPACE);
+                    writeToken(ASEmitterTokens.EQUAL);
+                    write(ASEmitterTokens.FUNCTION);
+                    write(ASEmitterTokens.PAREN_OPEN);
+                    write(ASEmitterTokens.PAREN_CLOSE);
+                    write(ASEmitterTokens.SPACE);
+                    write(ASEmitterTokens.BLOCK_OPEN);
+                    writeNewline();
+                    write(ASEmitterTokens.BLOCK_CLOSE);
+                    write(ASEmitterTokens.SEMICOLON);
+                }
+            }
+        }
+
+        IDefinitionNode[] dnodes = node.getAllMemberNodes();
+        for (IDefinitionNode dnode : dnodes)
+        {
+            if (dnode.getNodeID() == ASTNodeID.VariableID)
+            {
+                writeNewline();
+                writeNewline();
+                writeNewline();
+                emitField((IVariableNode) dnode);
+                write(ASEmitterTokens.SEMICOLON);
+            }
+            else if (dnode.getNodeID() == ASTNodeID.FunctionID)
+            {
+                if (!((IFunctionNode) dnode).isConstructor())
+                {
+                    writeNewline();
+                    writeNewline();
+                    writeNewline();
+                    emitMethod((IFunctionNode) dnode);
+                    write(ASEmitterTokens.SEMICOLON);
+                }
+            }
+            else if (dnode.getNodeID() == ASTNodeID.GetterID
+                    || dnode.getNodeID() == ASTNodeID.SetterID)
+            {
+                writeNewline();
+                writeNewline();
+                writeNewline();
+                emitAccessors((IAccessorNode) dnode);
+                write(ASEmitterTokens.SEMICOLON);
+            }
+        }
+    }
+
+    @Override
+    public void emitInterface(IInterfaceNode node)
+    {
+        ICompilerProject project = getWalker().getProject();
+
+        getDocEmitter().emitInterfaceDoc(node, project);
+
+        String qname = parseQualifiedName(node);
+        if (qname != null && !qname.equals(""))
+        {
+            write(qname);
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            write(ASEmitterTokens.FUNCTION);
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(ASEmitterTokens.PAREN_CLOSE);
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.BLOCK_OPEN);
+            writeNewline();
+            write(ASEmitterTokens.BLOCK_CLOSE);
+            write(ASEmitterTokens.SEMICOLON);
+        }
+
+        final IDefinitionNode[] members = node.getAllMemberDefinitionNodes();
+        for (IDefinitionNode mnode : members)
+        {
+            boolean isAccessor = mnode.getNodeID() == ASTNodeID.GetterID
+                    || mnode.getNodeID() == ASTNodeID.SetterID;
+
+            writeNewline();
+            writeNewline();
+            writeNewline();
+
+            getDocEmitter().emitInterfaceMemberDoc(mnode, project);
+
+            write(qname);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSEmitterTokens.PROTOTYPE);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            if (isAccessor)
+            {
+                writeGetSetPrefix(mnode.getNodeID() == ASTNodeID.GetterID);
+            }
+            write(parseQualifiedName(mnode));
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            write(ASEmitterTokens.FUNCTION);
+            emitParameters(((IFunctionNode) mnode).getParametersContainerNode());
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.BLOCK_OPEN);
+            write(ASEmitterTokens.BLOCK_CLOSE);
+            write(ASEmitterTokens.SEMICOLON);
+        }
+    }
+
+    @Override
+    public void emitFunctionBlockHeader(IFunctionNode node)
+    {
+        IDefinition def = node.getDefinition();
+        boolean isStatic = false;
+        if (def != null && def.isStatic())
+            isStatic = true;
+        boolean isLocal = false;
+        if (node.getFunctionClassification() == IFunctionDefinition.FunctionClassification.LOCAL)
+            isLocal = true;
+        if (EmitterUtils.hasBody(node) && !isStatic && !isLocal)
+            emitSelfReference(node);
+
+        emitRestParameterCodeBlock(node);
+
+        emitDefaultParameterCodeBlock(node);
+
+        if (node.isConstructor())
+        {
+            emitVarNonLiteralAssignments();
+        }
+
+        if (node.isConstructor() && hasSuperClass(node)
+                && !EmitterUtils.hasSuperCall(node.getScopedNode()))
+            emitSuperCall(node, JSSessionModel.CONSTRUCTOR_FULL);
+    }
+
+    private void emitVarNonLiteralAssignments()
+    {
+        // (erikdebruin): If the initial value of a variable is set using
+        //                a method, JS needs this initialization to be done
+        //                in the constructor
+        IClassNode cdnode = (IClassNode) getModel().getCurrentClass().getNode();
+        IDefinitionNode[] dnodes = cdnode.getAllMemberNodes();
+        for (IDefinitionNode dnode : dnodes)
+        {
+            if (dnode.getNodeID() == ASTNodeID.VariableID)
+            {
+                IVariableNode vnode = (IVariableNode) dnode;
+                IExpressionNode avnode = vnode.getAssignedValueNode();
+                if (avnode != null && !(avnode instanceof ILiteralNode)
+                        && !(avnode instanceof IEmbedNode))
+                {
+                    writeNewline("", true);
+                    if (vnode.hasModifier(ASModifier.STATIC))
+                    {
+                        write(parseQualifiedName(cdnode));
+                    }
+                    else
+                    {
+                        write(ASEmitterTokens.THIS);
+                    }
+                    write(ASEmitterTokens.MEMBER_ACCESS);
+                    writeToken(vnode.getName());
+                    writeToken(ASEmitterTokens.EQUAL);
+                    getWalker().walk(avnode);
+                    indentPop();
+                    writeNewline(ASEmitterTokens.SEMICOLON);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void emitVarDeclaration(IVariableNode node)
+    {
+        if (!(node instanceof ChainedVariableNode))
+        {
+            // (erikdebruin): check for 'var i:int = 0, j:int = 0' containers
+            IASNode pnode = node.getParent();
+            if (!(pnode instanceof IVariableExpressionNode)
+                    || node.getChild(0) instanceof IKeywordNode)
+            {
+                emitMemberKeyword(node);
+            }
+        }
+
+        IExpressionNode avnode = node.getAssignedValueNode();
+        if (avnode != null)
+        {
+            IDefinition def = avnode.resolveType(getWalker().getProject());
+
+            String opcode = avnode.getNodeID().getParaphrase();
+            if (opcode != "AnonymousFunction")
+                getDocEmitter().emitVarDoc(node, def, getWalker().getProject());
+        }
+        else
+        {
+            getDocEmitter().emitVarDoc(node, null, getWalker().getProject());
+        }
+
+        emitDeclarationName(node);
+        if (avnode != null && !(avnode instanceof IEmbedNode))
+        {
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            emitAssignedValue(avnode);
+        }
+
+        if (!(node instanceof ChainedVariableNode))
+        {
+            // check for chained variables
+            int len = node.getChildCount();
+            for (int i = 0; i < len; i++)
+            {
+                IASNode child = node.getChild(i);
+                if (child instanceof ChainedVariableNode)
+                {
+                    writeToken(ASEmitterTokens.COMMA);
+                    emitVarDeclaration((IVariableNode) child);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void emitMemberKeyword(IDefinitionNode node)
+    {
+        if (node instanceof IFunctionNode)
+        {
+            writeToken(ASEmitterTokens.FUNCTION);
+        }
+        else if (node instanceof IVariableNode)
+        {
+            writeToken(ASEmitterTokens.VAR);
+        }
+    }
+
+    @Override
+    public void emitField(IVariableNode node)
+    {
+        IDefinition definition = EmitterUtils.getClassDefinition(node);
+
+        IDefinition def = null;
+        IExpressionNode enode = node.getVariableTypeNode();//getAssignedValueNode();
+        if (enode != null)
+        {
+            if (project == null)
+                project = getWalker().getProject();
+
+            def = enode.resolveType(project);
+        }
+
+        getDocEmitter().emitFieldDoc(node, def, project);
+
+        IDefinition ndef = node.getDefinition();
+
+        ModifiersSet modifierSet = ndef.getModifiers();
+        String root = "";
+        if (modifierSet != null && !modifierSet.hasModifier(ASModifier.STATIC))
+        {
+            root = JSEmitterTokens.PROTOTYPE.getToken();
+            root += ASEmitterTokens.MEMBER_ACCESS.getToken();
+        }
+
+        if (definition == null)
+            definition = ndef.getContainingScope().getDefinition();
+
+        write(parseQualifiedName(definition)
+                + ASEmitterTokens.MEMBER_ACCESS.getToken() + root
+                + node.getName());
+
+        IExpressionNode vnode = node.getAssignedValueNode();
+        if (vnode != null && vnode instanceof ILiteralNode)
+        {
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            getWalker().walk(vnode);
+        }
+
+        if (!(node instanceof ChainedVariableNode))
+        {
+            int len = node.getChildCount();
+            for (int i = 0; i < len; i++)
+            {
+                IASNode child = node.getChild(i);
+                if (child instanceof ChainedVariableNode)
+                {
+                    writeNewline(ASEmitterTokens.SEMICOLON);
+                    writeNewline();
+                    emitField((IVariableNode) child);
+                }
+            }
+        }
+        if (node.getNodeID() == ASTNodeID.BindableVariableID)
+        {
+            // [Bindable]
+            writeNewline(ASEmitterTokens.SEMICOLON.getToken());
+            writeNewline();
+            writeNewline("/**");
+            writeNewline("@export");
+            writeNewline(" */");
+            writeNewline(parseQualifiedName(definition)
+                    + ASEmitterTokens.MEMBER_ACCESS.getToken() + root + "get_"
+                    + node.getName() + ASEmitterTokens.SPACE.getToken()
+                    + ASEmitterTokens.EQUAL.getToken()
+                    + ASEmitterTokens.SPACE.getToken()
+                    + ASEmitterTokens.FUNCTION.getToken()
+                    + ASEmitterTokens.PAREN_OPEN.getToken()
+                    + ASEmitterTokens.PAREN_CLOSE.getToken()
+                    + ASEmitterTokens.SPACE.getToken()
+                    + ASEmitterTokens.BLOCK_OPEN.getToken());
+            writeNewline(ASEmitterTokens.RETURN.getToken()
+                    + ASEmitterTokens.SPACE.getToken()
+                    + ASEmitterTokens.THIS.getToken()
+                    + ASEmitterTokens.MEMBER_ACCESS.getToken() + node.getName()
+                    + ASEmitterTokens.SEMICOLON.getToken());
+            writeNewline(ASEmitterTokens.BLOCK_CLOSE.getToken()
+                    + ASEmitterTokens.SEMICOLON.getToken());
+            writeNewline();
+            writeNewline("/**");
+            writeNewline("@export");
+            writeNewline(" */");
+            writeNewline(parseQualifiedName(definition)
+                    + ASEmitterTokens.MEMBER_ACCESS.getToken() + root + "set_"
+                    + node.getName() + ASEmitterTokens.SPACE.getToken()
+                    + ASEmitterTokens.EQUAL.getToken()
+                    + ASEmitterTokens.SPACE.getToken()
+                    + ASEmitterTokens.FUNCTION.getToken()
+                    + ASEmitterTokens.PAREN_OPEN.getToken() + "value"
+                    + ASEmitterTokens.PAREN_CLOSE.getToken()
+                    + ASEmitterTokens.SPACE.getToken()
+                    + ASEmitterTokens.BLOCK_OPEN.getToken());
+            writeNewline("if (value != " + ASEmitterTokens.THIS.getToken()
+                    + ASEmitterTokens.MEMBER_ACCESS.getToken() + node.getName()
+                    + ") {");
+            writeNewline("    var oldValue = "
+                    + ASEmitterTokens.THIS.getToken()
+                    + ASEmitterTokens.MEMBER_ACCESS.getToken() + node.getName()
+                    + ASEmitterTokens.SEMICOLON.getToken());
+            writeNewline("    " + ASEmitterTokens.THIS.getToken()
+                    + ASEmitterTokens.MEMBER_ACCESS.getToken() + node.getName()
+                    + " = value;");
+            writeNewline("    this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(");
+            writeNewline("         this, \"" + node.getName()
+                    + "\", oldValue, value));");
+            writeNewline("}");
+            write(ASEmitterTokens.BLOCK_CLOSE.getToken());
+
+        }
+    }
+
+    @Override
+    public void emitAccessors(IAccessorNode node)
+    {
+        if (node.getNodeID() == ASTNodeID.GetterID)
+        {
+            emitGetAccessor((IGetterNode) node);
+        }
+        else if (node.getNodeID() == ASTNodeID.SetterID)
+        {
+            emitSetAccessor((ISetterNode) node);
+        }
+    }
+
+    @Override
+    public void emitMethod(IFunctionNode node)
+    {
+        FunctionNode fn = (FunctionNode) node;
+        fn.parseFunctionBody(getProblems());
+
+        ICompilerProject project = getWalker().getProject();
+
+        getDocEmitter().emitMethodDoc(node, project);
+
+        boolean isConstructor = node.isConstructor();
+
+        String qname = parseQualifiedName(getTypeDefinition(node));
+        if (qname != null && !qname.equals(""))
+        {
+            write(qname);
+            if (!isConstructor)
+            {
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                if (!fn.hasModifier(ASModifier.STATIC))
+                {
+                    write(JSEmitterTokens.PROTOTYPE);
+                    write(ASEmitterTokens.MEMBER_ACCESS);
+                }
+            }
+        }
+
+        if (!isConstructor)
+            emitMemberName(node);
+
+        write(ASEmitterTokens.SPACE);
+        writeToken(ASEmitterTokens.EQUAL);
+        write(ASEmitterTokens.FUNCTION);
+
+        emitParameters(node.getParametersContainerNode());
+
+        boolean hasSuperClass = hasSuperClass(node);
+
+        if (isConstructor && node.getScopedNode().getChildCount() == 0)
+        {
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.BLOCK_OPEN);
+            emitVarNonLiteralAssignments();
+            if (hasSuperClass)
+            {
+                emitSuperCall(node, JSSessionModel.CONSTRUCTOR_EMPTY);
+                writeNewline();
+            }
+            write(ASEmitterTokens.BLOCK_CLOSE);
+        }
+
+        if (!isConstructor || node.getScopedNode().getChildCount() > 0)
+            emitMethodScope(node.getScopedNode());
+
+        if (isConstructor && hasSuperClass)
+        {
+            writeNewline(ASEmitterTokens.SEMICOLON);
+            write(JSGoogEmitterTokens.GOOG_INHERITS);
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(qname);
+            writeToken(ASEmitterTokens.COMMA);
+            String sname = parseQualifiedName(getSuperClassDefinition(node,
+                    project));
+            if (sname.equals(IASLanguageConstants.Object))
+                sname = IASLanguageConstants.Class;
+            write(sname);
+            write(ASEmitterTokens.PAREN_CLOSE);
+        }
+    }
+
+    protected boolean hasSuperClass(IDefinitionNode node)
+    {
+        ICompilerProject project = getWalker().getProject();
+        IClassDefinition superClassDefinition = getSuperClassDefinition(node,
+                project);
+
+        if (superClassDefinition == null)
+            return false;
+
+        String qname = parseQualifiedName(superClassDefinition);
+
+        // ToDo (erikdebruin): need this to get the JS version of the SDK in 
+        //                     shape?
+        boolean useClassAsSuperClass = !qname
+                .equals(IASLanguageConstants.Object);
+        if (!useClassAsSuperClass)
+        {
+            if (parseQualifiedName(node).equals("mx.core.EmbeddedFontRegistry")
+                    || parseQualifiedName(node).equals(
+                            "mx.managers.HistoryManagerImpl")
+                    || parseQualifiedName(node).equals(
+                            "mx.core.TextFieldFactory"))
+            {
+                useClassAsSuperClass = true;
+            }
+        }
+
+        return superClassDefinition != null && useClassAsSuperClass;
+    }
+
+    @Override
+    public void emitFunctionCall(IFunctionCallNode node)
+    {
+        IASNode cnode = node.getChild(0);
+
+        if (cnode.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+            cnode = cnode.getChild(0);
+
+        ASTNodeID id = cnode.getNodeID();
+        if (id != ASTNodeID.SuperID)
+        {
+            ICompilerProject project = null;
+            IDefinition def = null;
+
+            boolean isClassCast = false;
+
+            if (node.isNewExpression())
+            {
+                writeToken(ASEmitterTokens.NEW);
+            }
+            else
+            {
+                if (project == null)
+                    project = getWalker().getProject();
+
+                def = node.getNameNode().resolve(project);
+
+                isClassCast = (def instanceof ClassDefinition || def instanceof InterfaceDefinition)
+                        && !(NativeUtils.isJSNative(def.getBaseName()));
+            }
+
+            if (node.isNewExpression())
+            {
+                if (project == null)
+                    project = getWalker().getProject();
+
+                def = node.resolveCalledExpression(project);
+                // all new calls to a class should be fully qualified names
+                if (def instanceof ClassDefinition)
+                    write(parseQualifiedName(def));
+                else
+                    // I think we still need this for "new someVarOfTypeClass"
+                    getWalker().walk(node.getNameNode());
+                emitArguments(node.getArgumentsNode());
+            }
+            else if (!isClassCast)
+            {
+                if (def != null)
+                {
+                    boolean isInt = def.getBaseName().equals(
+                            IASGlobalFunctionConstants._int);
+                    if (isInt
+                            || def.getBaseName().equals(
+                                    IASGlobalFunctionConstants.trace)
+                            || def.getBaseName().equals(
+                                    IASGlobalFunctionConstants.uint))
+                    {
+                        write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+                        write(ASEmitterTokens.MEMBER_ACCESS);
+                        if (isInt)
+                            write(JSFlexJSEmitterTokens.UNDERSCORE);
+                    }
+                }
+                getWalker().walk(node.getNameNode());
+                emitArguments(node.getArgumentsNode());
+            }
+            else
+            {
+                emitIsAs(node.getArgumentNodes()[0], node.getNameNode(),
+                        ASTNodeID.Op_AsID, true);
+            }
+        }
+        else
+        {
+            emitSuperCall(node, JSSessionModel.SUPER_FUNCTION_CALL);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    protected void emitSelfReference(IFunctionNode node)
+    {
+        // we don't want 'var self = this;' in FlexJS
+    }
+
+    private boolean writeThis(IIdentifierNode node)
+    {
+        if (node instanceof NonResolvingIdentifierNode)
+            return false;
+
+        IClassNode classNode = (IClassNode) node
+                .getAncestorOfType(IClassNode.class);
+
+        IDefinition nodeDef = node.resolve(project);
+
+        IASNode parentNode = node.getParent();
+        ASTNodeID parentNodeId = parentNode.getNodeID();
+
+        IASNode firstChild = parentNode.getChild(0);
+        IClassDefinition thisClass = getModel().getCurrentClass();
+
+        boolean identifierIsMemberAccess = parentNodeId == ASTNodeID.MemberAccessExpressionID;
+
+        if (classNode == null) // script in MXML and AS interface definitions
+        {
+            if (nodeDef instanceof ParameterDefinition)
+                return false;
+
+            if (nodeDef instanceof VariableDefinition)
+            {
+                IDefinition pdef = ((VariableDefinition) nodeDef).getParent();
+
+                if (thisClass == null || !isSameClass(pdef, thisClass, project))
+                    return false;
+
+                if (identifierIsMemberAccess)
+                    return node == firstChild;
+
+                return parentNodeId == ASTNodeID.ContainerID
+                        || !(parentNode instanceof ParameterNode);
+            }
+            else if (nodeDef instanceof AccessorDefinition)
+            {
+                IDefinition pdef = ((AccessorDefinition) nodeDef).getParent();
+
+                if (thisClass == null || !isSameClass(pdef, thisClass, project))
+                    return false;
+
+                if (identifierIsMemberAccess)
+                    return node == firstChild;
+
+                return true;
+            }
+            else if (parentNodeId == ASTNodeID.ContainerID
+                    && nodeDef instanceof FunctionDefinition)
+            {
+                return ((FunctionDefinition) nodeDef)
+                        .getFunctionClassification() == FunctionClassification.CLASS_MEMBER; // for 'goog.bind'
+            }
+            else
+            {
+                return parentNodeId == ASTNodeID.FunctionCallID
+                        && !(nodeDef instanceof AccessorDefinition)
+                        && !identifierIsMemberAccess;
+            }
+        }
+        else
+        {
+            if (nodeDef != null && !nodeDef.isInternal()
+                    && isClassMember(nodeDef, classNode))
+            {
+                if (identifierIsMemberAccess)
+                {
+                    if (parentNode.getNodeID() == ASTNodeID.MemberAccessExpressionID
+                            && parentNode.getChild(0).getNodeID() == ASTNodeID.SuperID
+                            && !isSuperCallForOverride(node))
+                    {
+                        return true;
+                    }
+
+                    return node == firstChild;
+                }
+                else
+                {
+                    boolean identifierIsLocalFunction = nodeDef instanceof FunctionDefinition
+                            && !(nodeDef instanceof AccessorDefinition)
+                            && ((FunctionDefinition) nodeDef)
+                                    .getFunctionClassification() == IFunctionDefinition.FunctionClassification.LOCAL;
+
+                    if (nodeDef instanceof IParameterDefinition)
+                        return false;
+
+                    return !identifierIsLocalFunction;
+                }
+            }
+        }
+
+        return false;
+    }
+
+    private boolean isClassMember(IDefinition nodeDef, IClassNode classNode)
+    {
+        TypeScope cscope = (TypeScope) classNode.getDefinition()
+                .getContainedScope();
+
+        Set<INamespaceDefinition> nsSet = cscope.getNamespaceSet(project);
+        Collection<IDefinition> defs = new HashSet<IDefinition>();
+
+        cscope.getAllPropertiesForMemberAccess((CompilerProject) project, defs,
+                nsSet);
+
+        Iterator<IDefinition> visiblePropertiesIterator = defs.iterator();
+        while (visiblePropertiesIterator.hasNext())
+        {
+            if (parseQualifiedName(nodeDef).equals(
+                    parseQualifiedName(visiblePropertiesIterator.next())))
+                return true;
+        }
+
+        return false;
+    }
+
+    private boolean isSameClass(IDefinition pdef, IDefinition thisClass,
+            ICompilerProject project)
+    {
+        if (pdef == thisClass)
+            return true;
+
+        IDefinition cdef = ((ClassDefinition) thisClass)
+                .resolveBaseClass(project);
+        while (cdef != null)
+        {
+            // needs to be a loop
+            if (cdef == pdef)
+                return true;
+            cdef = ((ClassDefinition) cdef).resolveBaseClass(project);
+        }
+        return false;
+    }
+
+    @Override
+    public void emitIdentifier(IIdentifierNode node)
+    {
+        if (project == null)
+            project = getWalker().getProject();
+
+        IDefinition nodeDef = node.resolve(project);
+
+        IASNode parentNode = node.getParent();
+        ASTNodeID parentNodeId = parentNode.getNodeID();
+
+        boolean identifierIsAccessorFunction = nodeDef instanceof AccessorDefinition;
+        boolean identifierIsPlainFunction = nodeDef instanceof FunctionDefinition
+                && !identifierIsAccessorFunction;
+
+        boolean emitName = true;
+
+        if (nodeDef != null && nodeDef.isStatic()
+                && nodeDef.getParent() != null)
+        {
+            String sname = parseQualifiedName(nodeDef.getParent());
+            if (sname.length() > 0)
+            {
+                write(sname);
+                write(ASEmitterTokens.MEMBER_ACCESS);
+            }
+        }
+        else if (!NativeUtils.isNative(node.getName()))
+        {
+            // an instance method as a parameter or
+            // a local function
+            boolean useGoogBind = (parentNodeId == ASTNodeID.ContainerID
+                    && identifierIsPlainFunction && ((FunctionDefinition) nodeDef)
+                    .getFunctionClassification() == FunctionClassification.CLASS_MEMBER)
+                    || (identifierIsPlainFunction && ((FunctionDefinition) nodeDef)
+                            .getFunctionClassification() == FunctionClassification.LOCAL);
+
+            if (useGoogBind)
+            {
+                write(JSGoogEmitterTokens.GOOG_BIND);
+                write(ASEmitterTokens.PAREN_OPEN);
+            }
+
+            if (writeThis(node))
+            {
+                write(ASEmitterTokens.THIS);
+
+                write(ASEmitterTokens.MEMBER_ACCESS);
+            }
+
+            if (useGoogBind)
+            {
+                write(node.getName());
+
+                writeToken(ASEmitterTokens.COMMA);
+                write(ASEmitterTokens.THIS);
+                write(ASEmitterTokens.PAREN_CLOSE);
+
+                emitName = false;
+            }
+        }
+
+        IDefinition parentDef = (nodeDef != null) ? nodeDef.getParent() : null;
+        boolean isNative = (parentDef != null)
+                && NativeUtils.isNative(parentDef.getBaseName());
+        if ((identifierIsAccessorFunction && !isNative)
+                || (nodeDef instanceof VariableDefinition && ((VariableDefinition) nodeDef)
+                        .isBindable()))
+        {
+            IASNode anode = node
+                    .getAncestorOfType(BinaryOperatorAssignmentNode.class);
+
+            boolean isAssignment = false;
+            if (anode != null)
+            {
+                IASNode leftNode = anode.getChild(0);
+                if (anode == parentNode)
+                {
+                    if (node == leftNode)
+                        isAssignment = true;
+                }
+                else
+                {
+                    IASNode pnode = parentNode;
+                    IASNode thisNode = node;
+                    while (anode != pnode)
+                    {
+                        if (pnode instanceof IMemberAccessExpressionNode)
+                        {
+                            if (thisNode != pnode.getChild(1))
+                            {
+                                // can't be an assignment because 
+                                // we're on the left side of a memberaccessexpression
+                                break;
+                            }
+                        }
+                        if (pnode == leftNode)
+                        {
+                            isAssignment = true;
+                        }
+                        thisNode = pnode;
+                        pnode = pnode.getParent();
+                    }
+                }
+                String op = ((IBinaryOperatorNode) anode).getOperator()
+                        .getOperatorText();
+                if (op.contains("==") || !op.contains("="))
+                    isAssignment = false;
+            }
+
+            if (parentNode.getNodeID() == ASTNodeID.MemberAccessExpressionID
+                    && parentNode.getChild(0).getNodeID() == ASTNodeID.SuperID
+                    && isSuperCallForOverride(node))
+            {
+                IClassNode cnode = (IClassNode) node
+                        .getAncestorOfType(IClassNode.class);
+
+                // ToDo (erikdebruin): add VF2JS conditional -> only use check during full SDK compilation
+                if (cnode == null)
+                    return;
+
+                write(parseQualifiedName(cnode));
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                write(JSGoogEmitterTokens.GOOG_BASE);
+                write(ASEmitterTokens.PAREN_OPEN);
+                write(ASEmitterTokens.THIS);
+                writeToken(ASEmitterTokens.COMMA);
+                write(ASEmitterTokens.SINGLE_QUOTE);
+                writeGetSetPrefix(!isAssignment);
+                write(parseQualifiedName(nodeDef));
+                write(ASEmitterTokens.SINGLE_QUOTE);
+                if (isAssignment)
+                {
+                    writeToken(ASEmitterTokens.COMMA);
+                }
+            }
+            else if (node instanceof NonResolvingIdentifierNode)
+            {
+                write(node.getName());
+            }
+            else
+            {
+                writeGetSetPrefix(!isAssignment);
+                write(node.getName());
+                write(ASEmitterTokens.PAREN_OPEN);
+            }
+
+            if (anode != null && isAssignment)
+            {
+                getWalker().walk(
+                        ((BinaryOperatorAssignmentNode) anode)
+                                .getRightOperandNode());
+            }
+
+            if (!(node instanceof NonResolvingIdentifierNode))
+                write(ASEmitterTokens.PAREN_CLOSE);
+        }
+        else if (emitName)
+        {
+            if (nodeDef != null)
+                write(parseQualifiedName(nodeDef));
+            else
+                write(node.getName());
+        }
+    }
+
+    private boolean isSuperCallForOverride(IIdentifierNode node)
+    {
+        IFunctionNode pfnode = (IFunctionNode) node
+                .getAncestorOfType(FunctionNode.class);
+
+        if (pfnode == null)
+            return false;
+
+        return pfnode.getName().equals(node.getName());
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    protected void emitSuperCall(IASNode node, String type)
+    {
+        IFunctionNode fnode = (node instanceof IFunctionNode) ? (IFunctionNode) node
+                : null;
+        IFunctionCallNode fcnode = (node instanceof IFunctionCallNode) ? (FunctionCallNode) node
+                : null;
+
+        if (type == JSSessionModel.CONSTRUCTOR_EMPTY)
+        {
+            indentPush();
+            writeNewline();
+            indentPop();
+        }
+        else if (type == JSSessionModel.SUPER_FUNCTION_CALL)
+        {
+            if (fnode == null)
+                fnode = (IFunctionNode) fcnode
+                        .getAncestorOfType(IFunctionNode.class);
+        }
+
+        if (fnode != null && fnode.isConstructor() && !hasSuperClass(fnode))
+            return;
+
+        IClassNode cnode = (IClassNode) node
+                .getAncestorOfType(IClassNode.class);
+
+        if (cnode == null)
+            return;
+
+        // (erikdebruin): Catch when a 'super' call does NOT match the enclosing
+        //                function call. The GCC only allows '.base()' calls
+        //                to matching super methods, so we need to use 
+        //                'goog.base' for these ...
+        boolean isCallToOtherSuperMethod = false;
+        try
+        {
+            IExpressionNode d = fcnode.getNameNode();
+            if (d != null && d instanceof IMemberAccessExpressionNode)
+            {
+                IIdentifierNode b = (IIdentifierNode) ((IMemberAccessExpressionNode) d)
+                        .getRightOperandNode();
+
+                isCallToOtherSuperMethod = b != null
+                        && !b.getName().equals(fnode.getName());
+            }
+        }
+        catch (Exception e)
+        { /* Eat it! */
+        }
+
+        if (isCallToOtherSuperMethod)
+        {
+            write(ASEmitterTokens.THIS);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSGoogEmitterTokens.SUPERCLASS);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+        }
+        else
+        {
+            write(parseQualifiedName(cnode));
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSGoogEmitterTokens.GOOG_BASE);
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(ASEmitterTokens.THIS);
+        }
+
+        if (fnode != null && fnode.isConstructor())
+        {
+            writeToken(ASEmitterTokens.COMMA);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+            write(JSGoogEmitterTokens.GOOG_CONSTRUCTOR);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+        }
+
+        if (fnode != null && !fnode.isConstructor())
+        {
+            if (!isCallToOtherSuperMethod)
+            {
+                writeToken(ASEmitterTokens.COMMA);
+                write(ASEmitterTokens.SINGLE_QUOTE);
+            }
+
+            if (fnode.getNodeID() == ASTNodeID.GetterID
+                    || fnode.getNodeID() == ASTNodeID.SetterID)
+                writeGetSetPrefix(fnode.getNodeID() == ASTNodeID.GetterID);
+
+            // (erikdebruin): write(fnode.getName());
+            IMemberAccessExpressionNode aenode = (IMemberAccessExpressionNode) fcnode
+                    .getNameNode();
+            write(((IIdentifierNode) aenode.getRightOperandNode()).getName());
+
+            if (!isCallToOtherSuperMethod)
+            {
+                write(ASEmitterTokens.SINGLE_QUOTE);
+            }
+            else
+            {
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                write(JSGoogEmitterTokens.GOOG_CALL);
+                write(ASEmitterTokens.PAREN_OPEN);
+                write(ASEmitterTokens.THIS);
+            }
+        }
+
+        IASNode[] anodes = null;
+        boolean writeArguments = false;
+        if (fcnode != null)
+        {
+            anodes = fcnode.getArgumentNodes();
+
+            writeArguments = anodes.length > 0;
+        }
+        else if (fnode != null && fnode.isConstructor())
+        {
+            anodes = fnode.getParameterNodes();
+
+            writeArguments = (anodes != null && anodes.length > 0);
+        }
+        else if (fnode == null && node instanceof BinaryOperatorAssignmentNode)
+        {
+            BinaryOperatorAssignmentNode bnode = (BinaryOperatorAssignmentNode) node;
+
+            IFunctionNode pnode = (IFunctionNode) bnode
+                    .getAncestorOfType(IFunctionNode.class);
+
+            if (pnode.getNodeID() == ASTNodeID.SetterID)
+            {
+                writeToken(ASEmitterTokens.COMMA);
+                write(ASEmitterTokens.SINGLE_QUOTE);
+                writeGetSetPrefix(false);
+                getWalker().walk(bnode.getLeftOperandNode());
+                write(ASEmitterTokens.SINGLE_QUOTE);
+                writeToken(ASEmitterTokens.COMMA);
+                getWalker().walk(bnode.getRightOperandNode());
+            }
+        }
+
+        if (writeArguments)
+        {
+            int len = anodes.length;
+            for (int i = 0; i < len; i++)
+            {
+                writeToken(ASEmitterTokens.COMMA);
+
+                getWalker().walk(anodes[i]);
+            }
+        }
+
+        write(ASEmitterTokens.PAREN_CLOSE);
+
+        if (type == JSSessionModel.CONSTRUCTOR_FULL)
+        {
+            write(ASEmitterTokens.SEMICOLON);
+            writeNewline();
+        }
+        else if (type == JSSessionModel.CONSTRUCTOR_EMPTY)
+        {
+            write(ASEmitterTokens.SEMICOLON);
+        }
+    }
+
+    @Override
+    protected void emitDefaultParameterCodeBlock(IFunctionNode node)
+    {
+        IParameterNode[] pnodes = node.getParameterNodes();
+        if (pnodes.length == 0)
+            return;
+
+        Map<Integer, IParameterNode> defaults = EmitterUtils
+                .getDefaults(pnodes);
+
+        if (defaults != null)
+        {
+            final StringBuilder code = new StringBuilder();
+
+            if (!EmitterUtils.hasBody(node))
+            {
+                indentPush();
+                write(JSFlexJSEmitterTokens.INDENT);
+            }
+
+            List<IParameterNode> parameters = new ArrayList<IParameterNode>(
+                    defaults.values());
+
+            for (int i = 0, n = parameters.size(); i < n; i++)
+            {
+                IParameterNode pnode = parameters.get(i);
+
+                if (pnode != null)
+                {
+                    code.setLength(0);
+
+                    /* x = typeof y !== 'undefined' ? y : z;\n */
+                    code.append(pnode.getName());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.EQUAL.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.TYPEOF.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(pnode.getName());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.STRICT_NOT_EQUAL.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+                    code.append(ASEmitterTokens.UNDEFINED.getToken());
+                    code.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.TERNARY.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(pnode.getName());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.COLON.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(pnode.getDefaultValue());
+                    code.append(ASEmitterTokens.SEMICOLON.getToken());
+
+                    write(code.toString());
+
+                    if (i == n - 1 && !EmitterUtils.hasBody(node))
+                        indentPop();
+
+                    writeNewline();
+                }
+            }
+        }
+    }
+
+    @Override
+    public void emitBinaryOperator(IBinaryOperatorNode node)
+    {
+        ASTNodeID id = node.getNodeID();
+        if (id == ASTNodeID.Op_InID || id == ASTNodeID.Op_LogicalAndAssignID
+                || id == ASTNodeID.Op_LogicalOrAssignID)
+        {
+            super.emitBinaryOperator(node);
+        }
+        else if (id == ASTNodeID.Op_IsID || id == ASTNodeID.Op_AsID)
+        {
+            emitIsAs(node.getLeftOperandNode(), node.getRightOperandNode(), id,
+                    false);
+        }
+        else if (id == ASTNodeID.Op_InstanceOfID)
+        {
+            getWalker().walk(node.getLeftOperandNode());
+
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.INSTANCEOF);
+
+            IDefinition dnode = (node.getRightOperandNode()).resolve(project);
+            if (dnode != null)
+                write(parseQualifiedName(dnode));
+            else
+                getWalker().walk(node.getRightOperandNode());
+        }
+        else
+        {
+            IExpressionNode leftSide = node.getLeftOperandNode();
+
+            IExpressionNode property = null;
+            int leftSideChildCount = leftSide.getChildCount();
+            if (leftSideChildCount > 0)
+            {
+                IASNode childNode = leftSide.getChild(leftSideChildCount - 1);
+                if (childNode instanceof IExpressionNode)
+                    property = (IExpressionNode) childNode;
+                else
+                    property = leftSide;
+            }
+            else
+                property = leftSide;
+
+            IDefinition def = null;
+            if (property instanceof IIdentifierNode)
+                def = ((IIdentifierNode) property).resolve(getWalker()
+                        .getProject());
+
+            boolean isSuper = false;
+            if (leftSide.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+            {
+                IASNode cnode = leftSide.getChild(0);
+                ASTNodeID cId = cnode.getNodeID();
+
+                isSuper = cId == ASTNodeID.SuperID;
+            }
+
+            String op = node.getOperator().getOperatorText();
+            boolean isAssignment = !(op.contains("==") || !op.contains("="));
+
+            if (def instanceof AccessorDefinition && isAssignment)
+            {
+                getWalker().walk(leftSide);
+            }
+            else if (isSuper)
+            {
+                emitSuperCall(node, "");
+            }
+            else
+            {
+                if (ASNodeUtils.hasParenOpen(node))
+                    write(ASEmitterTokens.PAREN_OPEN);
+
+                getWalker().walk(leftSide);
+
+                if (node.getNodeID() != ASTNodeID.Op_CommaID)
+                    write(ASEmitterTokens.SPACE);
+
+                writeToken(node.getOperator().getOperatorText());
+
+                getWalker().walk(node.getRightOperandNode());
+
+                if (ASNodeUtils.hasParenClose(node))
+                    write(ASEmitterTokens.PAREN_CLOSE);
+            }
+        }
+    }
+
+    private void emitIsAs(IExpressionNode left, IExpressionNode right,
+            ASTNodeID id, boolean coercion)
+    {
+        write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        if (id == ASTNodeID.Op_IsID)
+            write(ASEmitterTokens.IS);
+        else
+            write(ASEmitterTokens.AS);
+        write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(left);
+        writeToken(ASEmitterTokens.COMMA);
+
+        IDefinition dnode = (right).resolve(project);
+        if (dnode != null)
+            write(parseQualifiedName(dnode));
+        else
+            getWalker().walk(right);
+
+        if (coercion)
+        {
+            writeToken(ASEmitterTokens.COMMA);
+            write(ASEmitterTokens.TRUE);
+        }
+
+        write(ASEmitterTokens.PAREN_CLOSE);
+    }
+
+    @Override
+    public void emitMemberAccessExpression(IMemberAccessExpressionNode node)
+    {
+        IASNode leftNode = node.getLeftOperandNode();
+        IASNode rightNode = node.getRightOperandNode();
+
+        if (project == null)
+            project = getWalker().getProject();
+
+        IDefinition def = node.resolve(project);
+        boolean isStatic = false;
+        if (def != null && def.isStatic())
+            isStatic = true;
+
+        boolean continueWalk = true;
+        if (!isStatic)
+        {
+            if (!(leftNode instanceof ILanguageIdentifierNode && ((ILanguageIdentifierNode) leftNode)
+                    .getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.THIS))
+            {
+                if (rightNode instanceof UnaryOperatorAtNode)
+                {
+                    // ToDo (erikdebruin): properly handle E4X
+
+                    write(ASEmitterTokens.THIS);
+                    write(ASEmitterTokens.MEMBER_ACCESS);
+                    getWalker().walk(node.getLeftOperandNode());
+                    write(ASEmitterTokens.SQUARE_OPEN);
+                    write(ASEmitterTokens.SINGLE_QUOTE);
+                    write("E4XOperator");
+                    write(ASEmitterTokens.SINGLE_QUOTE);
+                    write(ASEmitterTokens.SQUARE_CLOSE);
+                    continueWalk = false;
+                }
+                else if (node.getNodeID() == ASTNodeID.Op_DescendantsID)
+                {
+                    // ToDo (erikdebruin): properly handle E4X
+
+                    write(ASEmitterTokens.THIS);
+                    write(ASEmitterTokens.MEMBER_ACCESS);
+                    getWalker().walk(node.getLeftOperandNode());
+                    write(ASEmitterTokens.SQUARE_OPEN);
+                    write(ASEmitterTokens.SINGLE_QUOTE);
+                    write("E4XSelector");
+                    write(ASEmitterTokens.SINGLE_QUOTE);
+                    write(ASEmitterTokens.SQUARE_CLOSE);
+                    continueWalk = false;
+                }
+                else if (leftNode.getNodeID() != ASTNodeID.SuperID)
+                {
+                    getWalker().walk(node.getLeftOperandNode());
+                    write(node.getOperator().getOperatorText());
+                }
+            }
+            else
+            {
+                write(ASEmitterTokens.THIS);
+                write(node.getOperator().getOperatorText());
+            }
+
+        }
+
+        if (continueWalk)
+            getWalker().walk(node.getRightOperandNode());
+    }
+
+    private static ITypeDefinition getTypeDefinition(IDefinitionNode node)
+    {
+        ITypeNode tnode = (ITypeNode) node.getAncestorOfType(ITypeNode.class);
+        return (ITypeDefinition) tnode.getDefinition();
+    }
+
+    private static IClassDefinition getSuperClassDefinition(
+            IDefinitionNode node, ICompilerProject project)
+    {
+        IClassDefinition parent = (IClassDefinition) node.getDefinition()
+                .getParent();
+        IClassDefinition superClass = parent.resolveBaseClass(project);
+        return superClass;
+    }
+
+    @Override
+    protected void emitObjectDefineProperty(IAccessorNode node)
+    {
+        FunctionNode fn = (FunctionNode) node;
+        fn.parseFunctionBody(getProblems());
+
+        IFunctionDefinition definition = node.getDefinition();
+        ITypeDefinition type = (ITypeDefinition) definition.getParent();
+
+        // ToDo (erikdebruin): add VF2JS conditional -> only use check during full SDK compilation
+        if (type == null)
+            return;
+
+        if (project == null)
+            project = getWalker().getProject();
+
+        getDocEmitter().emitMethodDoc(fn, project);
+        write(parseQualifiedName(type));
+        if (!node.hasModifier(ASModifier.STATIC))
+        {
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSEmitterTokens.PROTOTYPE);
+        }
+
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        writeGetSetPrefix(node instanceof IGetterNode);
+        writeToken(node.getName());
+        writeToken(ASEmitterTokens.EQUAL);
+        write(ASEmitterTokens.FUNCTION);
+        emitParameters(node.getParametersContainerNode());
+        //writeNewline();
+        emitMethodScope(node.getScopedNode());
+    }
+
+    private void writeGetSetPrefix(boolean isGet)
+    {
+        if (isGet)
+            write(ASEmitterTokens.GET);
+        else
+            write(ASEmitterTokens.SET);
+        write("_");
+    }
+
+    @Override
+    public IJSGoogDocEmitter getDocEmitter()
+    {
+        return new JSVF2JSDocEmitter(this);
+    }
+
+    @Override
+    public void emitPackageHeader(IPackageDefinition definition)
+    {
+        IASScope containedScope = definition.getContainedScope();
+        ITypeDefinition type = findType(containedScope.getAllLocalDefinitions());
+        if (type == null)
+            return;
+
+        writeNewline("/**");
+        writeNewline(" * " + parseQualifiedName(type));
+        writeNewline(" *");
+        writeNewline(" * @fileoverview");
+        writeNewline(" *");
+        writeNewline(" * @suppress {checkTypes}");
+        writeNewline(" */");
+        writeNewline();
+
+        /* goog.provide('x');\n\n */
+        write(JSGoogEmitterTokens.GOOG_PROVIDE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(parseQualifiedName(type));
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline(ASEmitterTokens.SEMICOLON);
+        writeNewline();
+    }
+
+    @Override
+    public void emitPackageHeaderContents(IPackageDefinition definition)
+    {
+        PackageScope containedScope = (PackageScope) definition
+                .getContainedScope();
+
+        ITypeDefinition type = findType(containedScope.getAllLocalDefinitions());
+        if (type == null)
+            return;
+
+        if (project == null)
+            project = getWalker().getProject();
+
+        FlexJSProject flexProject = (FlexJSProject) project;
+        ASProjectScope projectScope = flexProject.getScope();
+        ICompilationUnit cu = projectScope
+                .getCompilationUnitForDefinition(type);
+        ArrayList<String> requiresList = flexProject.getRequires(cu);
+        ArrayList<String> interfacesList = flexProject.getInterfaces(cu);
+
+        String cname = parseQualifiedName(type);
+        ArrayList<String> writtenInstances = new ArrayList<String>();
+        writtenInstances.add(cname); // make sure we don't add ourselves
+
+        boolean emitsRequires = false;
+        if (requiresList != null)
+        {
+            Collections.sort(requiresList);
+            for (String imp : requiresList)
+            {
+                if (imp.indexOf(JSGoogEmitterTokens.AS3.getToken()) != -1)
+                    continue;
+
+                if (imp.equals(cname))
+                    continue;
+
+                if (NativeUtils.isNative(imp))
+                    continue;
+
+                if (writtenInstances.indexOf(imp) == -1)
+                {
+
+                    /* goog.require('x');\n */
+                    write(JSGoogEmitterTokens.GOOG_REQUIRE);
+                    write(ASEmitterTokens.PAREN_OPEN);
+                    write(ASEmitterTokens.SINGLE_QUOTE);
+                    write(imp);
+                    write(ASEmitterTokens.SINGLE_QUOTE);
+                    write(ASEmitterTokens.PAREN_CLOSE);
+                    writeNewline(ASEmitterTokens.SEMICOLON);
+
+                    writtenInstances.add(imp);
+
+                    emitsRequires = true;
+                }
+            }
+        }
+
+        boolean emitsInterfaces = false;
+        if (interfacesList != null)
+        {
+            Collections.sort(interfacesList);
+            for (String imp : interfacesList)
+            {
+                write(JSGoogEmitterTokens.GOOG_REQUIRE);
+                write(ASEmitterTokens.PAREN_OPEN);
+                write(ASEmitterTokens.SINGLE_QUOTE);
+                write(imp);
+                write(ASEmitterTokens.SINGLE_QUOTE);
+                write(ASEmitterTokens.PAREN_CLOSE);
+                writeNewline(ASEmitterTokens.SEMICOLON);
+
+                emitsInterfaces = true;
+            }
+        }
+
+        // erikdebruin: Add missing language feature support, with e.g. 'is' and 
+        //              'as' operators. We don't need to worry about requiring
+        //              this in every project: ADVANCED_OPTIMISATIONS will NOT
+        //              include any of the code if it is not used in the project.
+        boolean isMainCU = flexProject.mainCU != null
+                && cu.getName().equals(flexProject.mainCU.getName());
+        if (isMainCU)
+        {
+            write(JSGoogEmitterTokens.GOOG_REQUIRE);
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+            write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+            write(ASEmitterTokens.PAREN_CLOSE);
+            writeNewline(ASEmitterTokens.SEMICOLON);
+        }
+
+        if (emitsRequires || emitsInterfaces || isMainCU)
+        {
+            writeNewline();
+        }
+
+        writeNewline();
+        writeNewline();
+    }
+
+    @Override
+    public void emitPackageFooter(IPackageDefinition definition)
+    {
+        IASScope containedScope = definition.getContainedScope();
+        ITypeDefinition type = findType(containedScope.getAllLocalDefinitions());
+        if (type == null)
+            return;
+
+        ITypeNode tnode = findTypeNode(definition.getNode());
+        if (tnode != null)
+        {
+            /*
+             * Metadata
+             * 
+             * @type {Object.<string, Array.<Object>>}
+             */
+            writeNewline();
+            writeNewline();
+            writeNewline();
+            getDocEmitter().begin();
+            writeNewline(" * Metadata");
+            writeNewline(" *");
+            writeNewline(" * @type {Object.<string, Array.<Object>>}");
+            getDocEmitter().end();
+
+            // a.B.prototype.AFJS_CLASS_INFO = {  };
+            write(parseQualifiedName(type));
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSEmitterTokens.PROTOTYPE);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            writeToken(JSFlexJSEmitterTokens.FLEXJS_CLASS_INFO);
+            writeToken(ASEmitterTokens.EQUAL);
+            writeToken(ASEmitterTokens.BLOCK_OPEN);
+
+            // names: [{ name: '', qName: '' }]
+            write(JSFlexJSEmitterTokens.NAMES);
+            writeToken(ASEmitterTokens.COLON);
+            write(ASEmitterTokens.SQUARE_OPEN);
+            writeToken(ASEmitterTokens.BLOCK_OPEN);
+            write(JSFlexJSEmitterTokens.NAME);
+            writeToken(ASEmitterTokens.COLON);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+            write(tnode.getName());
+            write(ASEmitterTokens.SINGLE_QUOTE);
+            writeToken(ASEmitterTokens.COMMA);
+            write(JSFlexJSEmitterTokens.QNAME);
+            writeToken(ASEmitterTokens.COLON);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+            write(parseQualifiedName(tnode));
+            write(ASEmitterTokens.SINGLE_QUOTE);
+            write(ASEmitterTokens.BLOCK_CLOSE);
+            write(ASEmitterTokens.SQUARE_CLOSE);
+
+            IExpressionNode[] enodes;
+            if (tnode instanceof IClassNode)
+                enodes = ((IClassNode) tnode).getImplementedInterfaceNodes();
+            else
+                enodes = ((IInterfaceNode) tnode).getExtendedInterfaceNodes();
+
+            if (enodes.length > 0)
+            {
+                writeToken(ASEmitterTokens.COMMA);
+
+                // interfaces: [a.IC, a.ID]
+                write(JSFlexJSEmitterTokens.INTERFACES);
+                writeToken(ASEmitterTokens.COLON);
+                write(ASEmitterTokens.SQUARE_OPEN);
+                int i = 0;
+                for (IExpressionNode enode : enodes)
+                {
+                    write(parseQualifiedName(enode.resolve(project)));
+                    if (i < enodes.length - 1)
+                        writeToken(ASEmitterTokens.COMMA);
+                    i++;
+                }
+                write(ASEmitterTokens.SQUARE_CLOSE);
+            }
+
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.BLOCK_CLOSE);
+            writeNewline(ASEmitterTokens.SEMICOLON);
+        }
+    }
+
+    private int foreachLoopCounter = 0;
+
+    @Override
+    public void emitForEachLoop(IForLoopNode node)
+    {
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) node
+                .getConditionalsContainerNode().getChild(0);
+        IASNode childNode = bnode.getChild(0);
+
+        String iterName = "foreachiter"
+                + new Integer(foreachLoopCounter).toString();
+        foreachLoopCounter++;
+
+        write(ASEmitterTokens.FOR);
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(ASEmitterTokens.VAR);
+        write(ASEmitterTokens.SPACE);
+        write(iterName);
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.IN);
+        write(ASEmitterTokens.SPACE);
+        getWalker().walk(bnode.getChild(1));
+        writeToken(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline();
+        write(ASEmitterTokens.BLOCK_OPEN);
+        writeNewline();
+        if (childNode instanceof IVariableExpressionNode)
+        {
+            write(ASEmitterTokens.VAR);
+            write(ASEmitterTokens.SPACE);
+            write(((IVariableNode) childNode.getChild(0)).getName());
+        }
+        else
+            write(((IIdentifierNode) childNode).getName());
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.EQUAL);
+        write(ASEmitterTokens.SPACE);
+        getWalker().walk(bnode.getChild(1));
+        write(ASEmitterTokens.SQUARE_OPEN);
+        write(iterName);
+        write(ASEmitterTokens.SQUARE_CLOSE);
+        write(ASEmitterTokens.SEMICOLON);
+        writeNewline();
+        getWalker().walk(node.getStatementContentsNode());
+        write(ASEmitterTokens.BLOCK_CLOSE);
+        writeNewline();
+
+    }
+
+    /*
+    @Override
+    public void emitForEachLoop(IForLoopNode node)
+    {
+        IContainerNode xnode = (IContainerNode) node.getChild(1);
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) node
+                .getConditionalsContainerNode().getChild(0);
+        IASNode childNode = bnode.getChild(0);
+
+        write(ASEmitterTokens.TRY);
+        write(ASEmitterTokens.BLOCK_OPEN);
+        writeNewline();
+        
+        write(JSGoogEmitterTokens.GOOG_ARRAY_FOREACH);
+        write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(bnode.getChild(1));
+        writeToken(ASEmitterTokens.COMMA);
+        writeToken(ASEmitterTokens.FUNCTION);
+        write(ASEmitterTokens.PAREN_OPEN);
+        if (childNode instanceof IVariableExpressionNode)
+        	write(((IVariableNode) childNode.getChild(0)).getName());
+        else
+        	write(((IIdentifierNode) childNode).getName());
+        writeToken(ASEmitterTokens.PAREN_CLOSE);
+        if (isImplicit(xnode))
+            write(ASEmitterTokens.BLOCK_OPEN);
+        getWalker().walk(node.getStatementContentsNode());
+        if (isImplicit(xnode))
+        {
+            writeNewline();
+            write(ASEmitterTokens.BLOCK_CLOSE);
+        }
+        write(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline();
+        write(ASEmitterTokens.BLOCK_CLOSE);
+        writeNewline();
+        write(ASEmitterTokens.CATCH);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write("foreachbreakerror");
+        write(ASEmitterTokens.PAREN_CLOSE);
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.BLOCK_OPEN);
+        write(ASEmitterTokens.BLOCK_CLOSE);
+        writeNewline();
+        
+    }
+
+    @Override
+    public void emitIterationFlow(IIterationFlowNode node)
+    {
+    	// look for break in foreach and throw error instead
+    	if (node.getKind() == IIterationFlowNode.IterationFlowKind.BREAK)
+    	{
+    		IASNode pNode = node.getParent();
+    		while (pNode != null)
+    		{
+    			ASTNodeID id = pNode.getNodeID();
+    			if (id == ASTNodeID.ForEachLoopID)
+    			{
+    				write(ASEmitterTokens.THROW);
+    				write(ASEmitterTokens.SPACE);
+    				write(ASEmitterTokens.NEW);
+    				write(ASEmitterTokens.SPACE);
+    				write(JSGoogEmitterTokens.ERROR);
+    				write(ASEmitterTokens.PAREN_OPEN);
+    				write(ASEmitterTokens.PAREN_CLOSE);
+    				write(ASEmitterTokens.SEMICOLON);
+    				return;
+    			}
+    			else if (id == ASTNodeID.ForLoopID ||
+    					id == ASTNodeID.DoWhileLoopID ||
+    					id == ASTNodeID.WhileLoopID)
+    				break;
+    			pNode = pNode.getParent();
+    		}
+    	}
+        write(node.getKind().toString().toLowerCase());
+        IIdentifierNode lnode = node.getLabelNode();
+        if (lnode != null)
+        {
+            write(ASEmitterTokens.SPACE);
+            getWalker().walk(lnode);
+        }
+    }
+    */
+
+    @Override
+    public void emitTypedExpression(ITypedExpressionNode node)
+    {
+        write(JSGoogEmitterTokens.ARRAY);
+    }
+
+    @Override
+    public void emitLiteral(ILiteralNode node)
+    {
+        boolean isWritten = false;
+
+        String s = node.getValue(true);
+        if (!(node instanceof RegExpLiteralNode))
+        {
+            if (node.getLiteralType() == LiteralType.XML)
+            {
+                // ToDo (erikdebruin): VF2JS -> handle XML output properly...
+
+                write("'" + s + "'");
+
+                isWritten = true;
+            }
+            s = s.replaceAll("\n", "__NEWLINE_PLACEHOLDER__");
+            s = s.replaceAll("\r", "__CR_PLACEHOLDER__");
+            s = s.replaceAll("\t", "__TAB_PLACEHOLDER__");
+            s = s.replaceAll("\f", "__FORMFEED_PLACEHOLDER__");
+            s = s.replaceAll("\b", "__BACKSPACE_PLACEHOLDER__");
+            s = s.replaceAll("\\\\\"", "__QUOTE_PLACEHOLDER__");
+            s = s.replaceAll("\\\\", "__ESCAPE_PLACEHOLDER__");
+            //s = "\'" + s.replaceAll("\'", "\\\\\'") + "\'";
+            s = s.replaceAll("__ESCAPE_PLACEHOLDER__", "\\\\\\\\");
+            s = s.replaceAll("__QUOTE_PLACEHOLDER__", "\\\\\"");
+            s = s.replaceAll("__BACKSPACE_PLACEHOLDER__", "\\\\b");
+            s = s.replaceAll("__FORMFEED_PLACEHOLDER__", "\\\\f");
+            s = s.replaceAll("__TAB_PLACEHOLDER__", "\\\\t");
+            s = s.replaceAll("__CR_PLACEHOLDER__", "\\\\r");
+            s = s.replaceAll("__NEWLINE_PLACEHOLDER__", "\\\\n");
+
+            Character c = s.charAt(0);
+            if (c.equals('"'))
+            {
+                s = s.substring(1, s.length() - 1);
+                s = s.replaceAll("\"", "\\\\\"");
+                s = "\"" + s + "\"";
+            }
+            if (s.length() == 3)
+            {
+                c = s.charAt(1);
+                if (c.equals('\\'))
+                {
+                    s = "\"\\\\\"";
+                }
+            }
+        }
+
+        if (!isWritten)
+        {
+            write(s);
+        }
+    }
+
+    @Override
+    public void emitE4XFilter(IMemberAccessExpressionNode node)
+    {
+        // ToDo (erikdebruin): implement E4X replacement !?!
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write("E4XFilter");
+        write(ASEmitterTokens.SINGLE_QUOTE);
+    }
+
+    @Override
+    public void emitContainer(IContainerNode node)
+    {
+        int nodeCount = node.getChildCount();
+        for (int i = 0; i < nodeCount; i++)
+        {
+            getWalker().walk(node.getChild(i));
+
+            if (i < nodeCount - 1)
+                writeToken(ASEmitterTokens.COMMA);
+        }
+    }
+
+    private String parseQualifiedName(IDefinitionNode def)
+    {
+        return parseQualifiedNameString(def.getQualifiedName());
+    }
+
+    private String parseQualifiedName(IDefinition def)
+    {
+        return parseQualifiedNameString(def.getQualifiedName());
+    }
+
+    private String parseQualifiedNameString(String qNameString)
+    {
+        // ToDo (erikdebruin): Ugly hacks for VF2JS ...
+        if (qNameString.equals(IASLanguageConstants._int))
+        {
+            qNameString = qNameString.toUpperCase();
+        }
+
+        if (qNameString.equals("byte"))
+        {
+            qNameString = "$" + qNameString;
+        }
+
+        return qNameString;
+    }
+
+}


[23/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSPackage.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSPackage.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSPackage.java
new file mode 100644
index 0000000..e6ab1e4
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSPackage.java
@@ -0,0 +1,1177 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import java.util.ArrayList;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogPackage;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestFlexJSPackage extends TestGoogPackage
+{
+    @Override
+    public void setUp()
+    {
+    	project = new FlexJSProject(workspace);
+    	JSGoogConfiguration config = new JSGoogConfiguration();
+    	ArrayList<String> values = new ArrayList<String>();
+    	values.add("Event");
+    	config.setCompilerKeepAs3Metadata(null, values);
+    	((FlexJSProject)project).config = config;
+        super.setUp();
+    }
+    
+    @Override
+    @Test
+    public void testPackageSimple_Class()
+    {
+        // does JS need a implicit constructor function? ... always?
+        // All class nodes in AST get either an implicit or explicit constructor
+        // this is an implicit and the way I have the before/after handler working
+        // with block disallows implicit blocks from getting { }
+
+        // (erikdebruin) the constuctor IS the class definition, in 'goog' JS,
+        //               therefor we need to write out implicit constructors 
+        //               (if I understand the term correctly)
+
+        IFileNode node = compileAS("package {public class A{}}");
+        asBlockWalker.visitFile(node);
+        assertOutWithMetadata("/**\n" +
+        		" * A\n" +
+        		" *\n" +
+        		" * @fileoverview\n" +
+        		" *\n" +
+        		" * @suppress {checkTypes|accessControls}\n" +
+        		" */\n" +
+        		"\n" +
+        		"goog.provide('A');\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @constructor\n" +
+        		" */\n" +
+        		"A = function() {\n" +
+        		"};\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Metadata\n" +
+        		" *\n" +
+        		" * @type {Object.<string, Array.<Object>>}\n" +
+        		" */\n" +
+        		"A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'A'}] };\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('A', A);\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"A.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    }\n" + 
+        		"  };\n" +
+        		"};\n");
+    }
+
+    @Override
+    @Test
+    public void testPackageQualified_Class()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {public class A{}}");
+        asBlockWalker.visitFile(node);
+        assertOutWithMetadata("/**\n" +
+        		" * foo.bar.baz.A\n" +
+        		" *\n" +
+        		" * @fileoverview\n" +
+        		" *\n" +
+        		" * @suppress {checkTypes|accessControls}\n" +
+        		" */\n" +
+        		"\n" +
+        		"goog.provide('foo.bar.baz.A');\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @constructor\n" +
+        		" */\n" +
+        		"foo.bar.baz.A = function() {\n" +
+        		"};\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Metadata\n" +
+        		" *\n" +
+        		" * @type {Object.<string, Array.<Object>>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'foo.bar.baz.A'}] };\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('foo.bar.baz.A', foo.bar.baz.A);\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    }\n" + 
+        		"  };\n" +
+        		"};\n");
+    }
+
+    @Override
+    @Test
+    public void testPackageQualified_ClassBody()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {public class A{public function A(){}}}");
+        asBlockWalker.visitFile(node);
+        assertOutWithMetadata("/**\n" +
+        		" * foo.bar.baz.A\n" +
+        		" *\n" +
+        		" * @fileoverview\n" +
+        		" *\n" +
+        		" * @suppress {checkTypes|accessControls}\n" +
+        		" */\n" +
+        		"\n" +
+        		"goog.provide('foo.bar.baz.A');\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @constructor\n" +
+        		" */\n" +
+        		"foo.bar.baz.A = function() {\n" +
+        		"};\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Metadata\n" +
+        		" *\n" +
+        		" * @type {Object.<string, Array.<Object>>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'foo.bar.baz.A'}] };\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('foo.bar.baz.A', foo.bar.baz.A);\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"        'A': { type: '', declaredBy: 'foo.bar.baz.A'}\n" +
+        		"      };\n" +
+        		"    }\n" + 
+        		"  };\n" +
+        		"};\n");
+    }
+
+    @Override
+    @Test
+    public void testPackageQualified_ClassBodyMethodContents()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {public class A{public function A(){if (a){for (var i:Object in obj){doit();}}}}}");
+        asBlockWalker.visitFile(node);
+        assertOutWithMetadata("/**\n" +
+        		" * foo.bar.baz.A\n" +
+        		" *\n" +
+        		" * @fileoverview\n" +
+        		" *\n" +
+        		" * @suppress {checkTypes|accessControls}\n" +
+        		" */\n" +
+        		"\n" +
+        		"goog.provide('foo.bar.baz.A');\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @constructor\n" +
+        		" */\n" +
+        		"foo.bar.baz.A = function() {\n" +
+        		"  if (a) {\n" +
+        		"    for (var /** @type {Object} */ i in obj) {\n" +
+        		"      doit();\n" +
+        		"    }\n" +
+        		"  }\n" +
+        		"};\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Metadata\n" +
+        		" *\n" +
+        		" * @type {Object.<string, Array.<Object>>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'foo.bar.baz.A'}] };\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('foo.bar.baz.A', foo.bar.baz.A);\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"        'A': { type: '', declaredBy: 'foo.bar.baz.A'}\n" +
+        		"      };\n" +
+        		"    }\n" + 
+        		"  };\n" +
+        		"};\n");
+    }
+
+    @Test
+    public void testPackageQualified_ClassBodyMetaData()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {[Event(name='add', type='mx.events.FlexEvent')]\npublic class A{public function A(){}}}");
+        asBlockWalker.visitFile(node);
+        assertOutWithMetadata("/**\n" +
+        		" * foo.bar.baz.A\n" +
+        		" *\n" +
+        		" * @fileoverview\n" +
+        		" *\n" +
+        		" * @suppress {checkTypes|accessControls}\n" +
+        		" */\n" +
+        		"\n" +
+        		"goog.provide('foo.bar.baz.A');\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @constructor\n" +
+        		" */\n" +
+        		"foo.bar.baz.A = function() {\n" +
+        		"};\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Metadata\n" +
+        		" *\n" +
+        		" * @type {Object.<string, Array.<Object>>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'foo.bar.baz.A'}] };\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('foo.bar.baz.A', foo.bar.baz.A);\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"        'A': { type: '', declaredBy: 'foo.bar.baz.A'}\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    metadata: function () { return [ { name: 'Event', args: [ { key: 'name', value: 'add'}, { key: 'type', value: 'mx.events.FlexEvent'}]}]; }\n" +
+        		"  };\n" +
+        		"};\n");
+    }
+
+    @Test
+    public void testPackageQualified_ClassAndInternalClass()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {\n" + 
+        							  "public class A {\n" +
+        							  "public function A(){\n" +
+        							      "var internalClass:InternalClass = new InternalClass();\n" +
+        							  "}}}\n" +
+        							  "class InternalClass {\n" +
+        							      "public function InternalClass(){}\n" +
+        							  "}");
+        asBlockWalker.visitFile(node);
+        assertOutWithMetadata("/**\n" +
+        		  " * foo.bar.baz.A\n" +
+        		  " *\n" +
+        		  " * @fileoverview\n" +
+        		  " *\n" +
+        		  " * @suppress {checkTypes|accessControls}\n" +
+        		  " */\n" +
+        		  "\n" +
+        		  "goog.provide('foo.bar.baz.A');\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * @constructor\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A = function() {\n" +
+        		  "  var /** @type {foo.bar.baz.A.InternalClass} */ internalClass = new foo.bar.baz.A.InternalClass();\n" +
+        		  "};\n" +
+        		  "\n" +
+        		  "\n/" +
+        		  "**\n" +
+        		  " * Metadata\n" +
+        		  " *\n" +
+        		  " * @type {Object.<string, Array.<Object>>}\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'foo.bar.baz.A'}] };\n" +
+          		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('foo.bar.baz.A', foo.bar.baz.A);\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"        'A': { type: '', declaredBy: 'foo.bar.baz.A'}\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * @constructor\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.InternalClass = function() {\n" +
+        		  "};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * Metadata\n" +
+        		  " *\n" +
+        		  " * @type {Object.<string, Array.<Object>>}\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.InternalClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'InternalClass', qName: 'foo.bar.baz.A.InternalClass'}] };\n" +
+            		"\n" +
+            		"\n" +
+            		"/**\n" +
+            		" * Prevent renaming of class. Needed for reflection.\n" +
+            		" */\n" +
+            		"goog.exportSymbol('foo.bar.baz.A.InternalClass', foo.bar.baz.A.InternalClass);\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.InternalClass.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"        'InternalClass': { type: '', declaredBy: 'foo.bar.baz.A.InternalClass'}\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n");
+    }
+
+	@Test
+	public void testPackageQualified_ClassAndInternalFunction()
+	{
+		IFileNode node = compileAS("package foo.bar.baz {\n" +
+				"public class A {\n" +
+				"public function A(){\n" +
+				"internalFunction();\n" +
+				"}}}\n" +
+				"function internalFunction(){}");
+		asBlockWalker.visitFile(node);
+		assertOutWithMetadata("/**\n" +
+				" * foo.bar.baz.A\n" +
+				" *\n" +
+				" * @fileoverview\n" +
+				" *\n" +
+				" * @suppress {checkTypes|accessControls}\n" +
+				" */\n" +
+				"\n" +
+				"goog.provide('foo.bar.baz.A');\n" +
+				"\n" +
+				"\n" +
+				"\n" +
+				"/**\n" +
+				" * @constructor\n" +
+				" */\n" +
+				"foo.bar.baz.A = function() {\n" +
+				"  foo.bar.baz.A.internalFunction();\n" +
+				"};\n" +
+				"\n" +
+				"\n/" +
+				"**\n" +
+				" * Metadata\n" +
+				" *\n" +
+				" * @type {Object.<string, Array.<Object>>}\n" +
+				" */\n" +
+				"foo.bar.baz.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'foo.bar.baz.A'}] };\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('foo.bar.baz.A', foo.bar.baz.A);\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"        'A': { type: '', declaredBy: 'foo.bar.baz.A'}\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n" +
+				"\n" +
+				"\n" +
+				"\n" +
+				"foo.bar.baz.A.internalFunction = function() {\n" +
+				"}");
+	}
+
+	@Test
+	public void testPackageQualified_ClassAndInternalVariable()
+	{
+		IFileNode node = compileAS("package foo.bar.baz {\n" +
+				"public class A {\n" +
+				"public function A(){\n" +
+				"internalVar = 3;\n" +
+				"}}}\n" +
+				"var internalVar:Number = 2;");
+		asBlockWalker.visitFile(node);
+		assertOutWithMetadata("/**\n" +
+				" * foo.bar.baz.A\n" +
+				" *\n" +
+				" * @fileoverview\n" +
+				" *\n" +
+				" * @suppress {checkTypes|accessControls}\n" +
+				" */\n" +
+				"\n" +
+				"goog.provide('foo.bar.baz.A');\n" +
+				"\n" +
+				"\n" +
+				"\n" +
+				"/**\n" +
+				" * @constructor\n" +
+				" */\n" +
+				"foo.bar.baz.A = function() {\n" +
+				"  foo.bar.baz.A.internalVar = 3;\n" +
+				"};\n" +
+				"\n" +
+				"\n/" +
+				"**\n" +
+				" * Metadata\n" +
+				" *\n" +
+				" * @type {Object.<string, Array.<Object>>}\n" +
+				" */\n" +
+				"foo.bar.baz.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'foo.bar.baz.A'}] };\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('foo.bar.baz.A', foo.bar.baz.A);\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"        'A': { type: '', declaredBy: 'foo.bar.baz.A'}\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n" +
+				"\n" +
+				"\n" +
+				"\n" +
+				"/**\n" +
+				" * @export\n" +
+				" * @type {number}\n" +
+				" */\n" +
+				"foo.bar.baz.A.internalVar = 2");
+	}
+
+    @Test
+    public void testPackageQualified_ClassAndInternalClassMethods()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {\n" + 
+        							  "public class A {\n" +
+        							  "public function A(){\n" +
+        							      "var internalClass:InternalClass = new InternalClass();\n" +
+        							      "var myString:String = InternalClass.someString;\n" +
+        							      "myString = InternalClass.someStaticFunction();\n" +
+        							      "myString = internalClass.someMethod();\n" +
+        							  "}}}\n" +
+        							  "class InternalClass {\n" +
+        							      "public function InternalClass(){\n" +
+        							      "}\n" +
+       							          "public static var someString:String = \"foo\";\n" +
+    							          "public static function someStaticFunction():String { return \"bar\";}\n" +
+    							          "public function someMethod():String { return \"baz\";}\n" +
+        							  "}");
+        asBlockWalker.visitFile(node);
+        assertOutWithMetadata("/**\n" +
+        		  " * foo.bar.baz.A\n" +
+        		  " *\n" +
+        		  " * @fileoverview\n" +
+        		  " *\n" +
+        		  " * @suppress {checkTypes|accessControls}\n" +
+        		  " */\n" +
+        		  "\n" +
+        		  "goog.provide('foo.bar.baz.A');\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * @constructor\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A = function() {\n" +
+        		  "  var /** @type {foo.bar.baz.A.InternalClass} */ internalClass = new foo.bar.baz.A.InternalClass();\n" +
+        		  "  var /** @type {string} */ myString = foo.bar.baz.A.InternalClass.someString;\n" +
+        		  "  myString = foo.bar.baz.A.InternalClass.someStaticFunction();\n" +
+        		  "  myString = internalClass.someMethod();\n" +
+        		  "};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * Metadata\n" +
+        		  " *\n" +
+        		  " * @type {Object.<string, Array.<Object>>}\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'foo.bar.baz.A'}] };\n" +
+          		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('foo.bar.baz.A', foo.bar.baz.A);\n" +
+            		"\n" +
+            		"\n" +
+            		"\n" +
+            		"/**\n" +
+            		" * Reflection\n" +
+            		" *\n" +
+            		" * @return {Object.<string, Function>}\n" +
+            		" */\n" +
+            		"foo.bar.baz.A.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+            		"  return {\n" +
+            		"    variables: function () {\n" +
+            		"      return {\n" +
+            		"      };\n" + 
+            		"    },\n" +
+            		"    accessors: function () {\n" +
+            		"      return {\n" +
+            		"      };\n" +
+            		"    },\n" +
+            		"    methods: function () {\n" +
+            		"      return {\n" +
+            		"        'A': { type: '', declaredBy: 'foo.bar.baz.A'}\n" +
+            		"      };\n" +
+            		"    }\n" +
+            		"  };\n" +
+            		"};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * @constructor\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.InternalClass = function() {\n" +
+        		  "};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * @export\n" +
+        		  " * @type {string}\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.InternalClass.someString = \"foo\";\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * @export\n" +
+        		  " * @return {string}\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.InternalClass.someStaticFunction = function() {\n" +
+        		  "  return \"bar\";\n" +
+        		  "};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * @export\n" +
+        		  " * @return {string}\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.InternalClass.prototype.someMethod = function() {\n" +
+        		  "  return \"baz\";\n" +
+        		  "};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * Metadata\n" +
+        		  " *\n" +
+        		  " * @type {Object.<string, Array.<Object>>}\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.InternalClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'InternalClass', qName: 'foo.bar.baz.A.InternalClass'}] };\n" +
+          		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('foo.bar.baz.A.InternalClass', foo.bar.baz.A.InternalClass);\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.InternalClass.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"        'InternalClass': { type: '', declaredBy: 'foo.bar.baz.A.InternalClass'},\n" +
+        		"        'someMethod': { type: 'String', declaredBy: 'foo.bar.baz.A.InternalClass'}\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n");
+    }
+    
+    @Test
+    public void testPackageQualified_ClassAndInternalGettersAndSetters()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {\n" + 
+        							  "public class A {\n" +
+        							  "public function A(){\n" +
+        							      "var internalClass:InternalClass = new InternalClass();\n" +
+        							      "myString = internalClass.someString;\n" +
+        							      "internalClass.someString = myString;\n" +
+        							  "}\n" +
+        							  "public function get myString():String {\n" +
+        							  "    return null;\n" +
+        							  "}\n" +
+        							  "public function set myString(value:String):void {}\n" +
+        							  "}}\n" +
+        							  "class InternalClass {\n" +
+        							      "public function InternalClass(){\n" +
+        							      "}\n" +
+       							          "public function get someString():String {\n" +
+       							          "    return null;\n" +
+       							          "}\n" +
+    							          "public function set someString(value:String):void {}\n" +
+        							  "}");
+        asBlockWalker.visitFile(node);
+        assertOutWithMetadata("/**\n" +
+        		  " * foo.bar.baz.A\n" +
+        		  " *\n" +
+        		  " * @fileoverview\n" +
+        		  " *\n" +
+        		  " * @suppress {checkTypes|accessControls}\n" +
+        		  " */\n" +
+        		  "\n" +
+        		  "goog.provide('foo.bar.baz.A');\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * @constructor\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A = function() {\n" +
+        		  "  var /** @type {foo.bar.baz.A.InternalClass} */ internalClass = new foo.bar.baz.A.InternalClass();\n" +
+        		  "  this.myString = internalClass.someString;\n" +
+        		  "  internalClass.someString = this.myString;\n" +
+        		  "};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "Object.defineProperties(foo.bar.baz.A.prototype, /** @lends {foo.bar.baz.A.prototype} */ {\n" +
+                  "/** @export */\n" +
+                  "myString: {\n" +
+                  "get: /** @this {foo.bar.baz.A} */ function() {\n" +
+                  "  return null;\n" +
+                  "},\n" +
+                  "set: /** @this {foo.bar.baz.A} */ function(value) {\n" +
+                  "}}}\n" +
+                  ");\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * Metadata\n" +
+        		  " *\n" +
+        		  " * @type {Object.<string, Array.<Object>>}\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'foo.bar.baz.A'}] };\n" +
+          		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('foo.bar.baz.A', foo.bar.baz.A);\n" +
+            		"\n" +
+            		"\n" +
+            		"\n" +
+            		"/**\n" +
+            		" * Reflection\n" +
+            		" *\n" +
+            		" * @return {Object.<string, Function>}\n" +
+            		" */\n" +
+            		"foo.bar.baz.A.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+            		"  return {\n" +
+            		"    variables: function () {\n" +
+            		"      return {\n" +
+            		"      };\n" + 
+            		"    },\n" +
+            		"    accessors: function () {\n" +
+            		"      return {\n" +
+            		"        'myString': { type: 'String', declaredBy: 'foo.bar.baz.A'}\n" +
+            		"      };\n" +
+            		"    },\n" +
+            		"    methods: function () {\n" +
+            		"      return {\n" +
+            		"        'A': { type: '', declaredBy: 'foo.bar.baz.A'}\n" +
+            		"      };\n" +
+            		"    }\n" +
+            		"  };\n" +
+            		"};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * @constructor\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.InternalClass = function() {\n" +
+        		  "};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "Object.defineProperties(foo.bar.baz.A.InternalClass.prototype, /** @lends {foo.bar.baz.A.InternalClass.prototype} */ {\n" +
+                  "/** @export */\n" +
+                  "someString: {\n" +
+                  "get: /** @this {foo.bar.baz.A.InternalClass} */ function() {\n" +
+                  "  return null;\n" +
+                  "},\n" +
+                  "set: /** @this {foo.bar.baz.A.InternalClass} */ function(value) {\n" +
+                  "}}}\n" +
+                  ");\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * Metadata\n" +
+        		  " *\n" +
+        		  " * @type {Object.<string, Array.<Object>>}\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.InternalClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'InternalClass', qName: 'foo.bar.baz.A.InternalClass'}] };\n" +
+          		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('foo.bar.baz.A.InternalClass', foo.bar.baz.A.InternalClass);\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.InternalClass.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"        'someString': { type: 'String', declaredBy: 'foo.bar.baz.A.InternalClass'}\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"        'InternalClass': { type: '', declaredBy: 'foo.bar.baz.A.InternalClass'}\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n");
+    }
+    
+    @Test
+    public void testPackageQualified_ClassAndInternalFLEXJS_CLASS_INFO()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {\n" + 
+        							  "public class A {\n" +
+        							  "public function A(){\n" +
+        							      "var internalClass:ITestInterface = new InternalClass() as ITestInterface;\n" +
+        							      "internalClass.test();\n" +
+        							  "}\n" +
+        							  "}}\n" +
+        							  "interface ITestInterface {\n" +
+        							  "function test():void;\n" +
+        							  "}\n" +
+        							  "class InternalClass implements ITestInterface {\n" +
+        							      "public function InternalClass(){\n" +
+        							      "}\n" +
+       							          "public function test():void {}\n" +
+        							  "}");
+        asBlockWalker.visitFile(node);
+        assertOutWithMetadata("/**\n" +
+        		  " * foo.bar.baz.A\n" +
+        		  " *\n" +
+        		  " * @fileoverview\n" +
+        		  " *\n" +
+        		  " * @suppress {checkTypes|accessControls}\n" +
+        		  " */\n" +
+        		  "\n" +
+        		  "goog.provide('foo.bar.baz.A');\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * @constructor\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A = function() {\n" +
+        		  "  var /** @type {foo.bar.baz.A.ITestInterface} */ internalClass = org.apache.flex.utils.Language.as(new foo.bar.baz.A.InternalClass(), foo.bar.baz.A.ITestInterface);\n" +
+        		  "  internalClass.test();\n" +
+        		  "};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * Metadata\n" +
+        		  " *\n" +
+        		  " * @type {Object.<string, Array.<Object>>}\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'foo.bar.baz.A'}] };\n" +
+          		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('foo.bar.baz.A', foo.bar.baz.A);\n" +
+            		"\n" +
+            		"\n" +
+            		"\n" +
+            		"/**\n" +
+            		" * Reflection\n" +
+            		" *\n" +
+            		" * @return {Object.<string, Function>}\n" +
+            		" */\n" +
+            		"foo.bar.baz.A.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+            		"  return {\n" +
+            		"    variables: function () {\n" +
+            		"      return {\n" +
+            		"      };\n" + 
+            		"    },\n" +
+            		"    accessors: function () {\n" +
+            		"      return {\n" +
+            		"      };\n" +
+            		"    },\n" +
+            		"    methods: function () {\n" +
+            		"      return {\n" +
+            		"        'A': { type: '', declaredBy: 'foo.bar.baz.A'}\n" +
+            		"      };\n" +
+            		"    }\n" +
+            		"  };\n" +
+            		"};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * @interface\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.ITestInterface = function() {\n" +
+        		  "};\n" +
+        		  "foo.bar.baz.A.ITestInterface.prototype.test = function() {\n" +
+        		  "};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * Metadata\n" +
+        		  " *\n" +
+        		  " * @type {Object.<string, Array.<Object>>}\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.ITestInterface.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'ITestInterface', qName: 'foo.bar.baz.A.ITestInterface'}] };\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"foo.bar.baz.A.ITestInterface.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"        'test': { type: 'void', declaredBy: 'foo.bar.baz.A.ITestInterface'}\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * @constructor\n" +
+        		  " * @implements {foo.bar.baz.A.ITestInterface}\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.InternalClass = function() {\n" +
+        		  "};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * @export\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.InternalClass.prototype.test = function() {\n" +
+        		  "};\n" +
+        		  "\n" +
+        		  "\n" +
+        		  "/**\n" +
+        		  " * Metadata\n" +
+        		  " *\n" +
+        		  " * @type {Object.<string, Array.<Object>>}\n" +
+        		  " */\n" +
+        		  "foo.bar.baz.A.InternalClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'InternalClass', qName: 'foo.bar.baz.A.InternalClass'}], interfaces: [foo.bar.baz.A.ITestInterface] };\n" +
+          		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('foo.bar.baz.A.InternalClass', foo.bar.baz.A.InternalClass);\n" +
+            		"\n" +
+            		"\n" +
+            		"\n" +
+            		"/**\n" +
+            		" * Reflection\n" +
+            		" *\n" +
+            		" * @return {Object.<string, Function>}\n" +
+            		" */\n" +
+            		"foo.bar.baz.A.InternalClass.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+            		"  return {\n" +
+            		"    variables: function () {\n" +
+            		"      return {\n" +
+            		"      };\n" + 
+            		"    },\n" +
+            		"    accessors: function () {\n" +
+            		"      return {\n" +
+            		"      };\n" +
+            		"    },\n" +
+            		"    methods: function () {\n" +
+            		"      return {\n" +
+            		"        'InternalClass': { type: '', declaredBy: 'foo.bar.baz.A.InternalClass'},\n" +
+            		"        'test': { type: 'void', declaredBy: 'foo.bar.baz.A.InternalClass'}\n" +
+            		"      };\n" +
+            		"    }\n" +
+            		"  };\n" +
+            		"};\n"
+        		  );
+    }
+
+	@Test
+	public void testPackageSimple_Function()
+	{
+		IFileNode node = compileAS("package {public function A(){}}");
+		asBlockWalker.visitFile(node);
+		assertOutWithMetadata("/**\n * A\n *\n * @fileoverview\n *\n * @suppress {checkTypes|accessControls}\n */\n\ngoog.provide('A');\n\n\n\n/**\n * @export\n */\nA = function() {\n}");
+	}
+
+	@Test
+	public void testPackageQualified_Function()
+	{
+		IFileNode node = compileAS("package foo.bar.baz {public function A(){}}");
+		asBlockWalker.visitFile(node);
+		assertOutWithMetadata("/**\n * foo.bar.baz.A\n *\n * @fileoverview\n *\n * @suppress {checkTypes|accessControls}\n */\n\ngoog.provide('foo.bar.baz.A');\n\n\n\n/**\n * @export\n */\nfoo.bar.baz.A = function() {\n}");
+	}
+
+	@Test
+	public void testPackageSimple_Variable()
+	{
+		IFileNode node = compileAS("package {public var A:String = \"Hello\";");
+		asBlockWalker.visitFile(node);
+		assertOutWithMetadata("/**\n * A\n *\n * @fileoverview\n *\n * @suppress {checkTypes|accessControls}\n */\n\ngoog.provide('A');\n\n\n\n/**\n * @export\n * @type {string}\n */\nA = \"Hello\"");
+	}
+
+	@Test
+	public void testPackageQualified_Variable()
+	{
+		IFileNode node = compileAS("package foo.bar.baz {public var A:String = \"Hello\";");
+		asBlockWalker.visitFile(node);
+		assertOutWithMetadata("/**\n * foo.bar.baz.A\n *\n * @fileoverview\n *\n * @suppress {checkTypes|accessControls}\n */\n\ngoog.provide('foo.bar.baz.A');\n\n\n\n/**\n * @export\n * @type {string}\n */\nfoo.bar.baz.A = \"Hello\"");
+	}
+    
+    @Override
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
new file mode 100644
index 0000000..c057f92
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java
@@ -0,0 +1,339 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import junit.framework.Assert;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.exceptions.ConfigurationException;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogProject;
+import org.apache.flex.compiler.internal.config.TargetSettings;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.ITestAdapter;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid 'flexjs' JS code from an external
+ * project.
+ * 
+ * @author Erik de Bruin
+ */
+public class TestFlexJSProject extends TestGoogProject
+{
+    private static ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
+
+    private static String projectDirPath = "flexjs/projects";
+    private String sourcePath;
+    private Collection<String> externs = new ArrayList<String>();
+
+    @Override
+    public void setUp()
+    {
+        project = new FlexJSProject(workspace);
+        ((FlexJSProject)project).config = new JSGoogConfiguration();
+        super.setUp();
+    }
+    
+    @Ignore
+    @Test
+    public void test_imports()
+    {
+        // crude bypass to allow for successful inheritance
+    }
+
+    @Test
+    public void test_Test()
+    {
+        String testDirPath = projectDirPath + "/interfaces";
+
+        String fileName = "Test";
+
+        sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/interfaces").getPath();
+        
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Test
+    public void test_Super()
+    {
+        String testDirPath = projectDirPath + "/super";
+
+        String fileName = "Base";
+
+        sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/super").getPath();
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Test
+    public void test_InternalAndSamePackageRequires()
+    {
+        String testDirPath = projectDirPath + "/internal";
+
+        String fileName = "MainClass";
+
+        sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/internal").getPath();
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Test
+    public void test_IsItCircular()
+    {
+        String testDirPath = projectDirPath + "/circular";
+
+        String fileName = "Base";
+
+        sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/circular").getPath();
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Test
+    public void test_XMLRequires()
+    {
+        String testDirPath = projectDirPath + "/xml_requires";
+
+        String fileName = "XMLRequire";
+
+        sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/xml_requires").getPath();
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Test
+    public void test_Overrides()
+    {
+        String testDirPath = projectDirPath + "/overrides";
+
+        String fileName = "Test";
+
+        try {
+			((FlexJSProject)project).config.setCompilerAllowSubclassOverrides(null, true);
+		} catch (ConfigurationException e) {
+            Assert.fail(e.getMessage());
+		}
+        project.setTargetSettings(new TargetSettings(((FlexJSProject)project).config));
+        
+        sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/overrides").getPath();
+
+        StringBuilder sb = new StringBuilder();
+        List<String> compiledFileNames = compileProject(fileName, testDirPath, sb, false);
+
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+    
+    @Test
+    public void test_Bad_Overrides()
+    {
+        String testDirPath = projectDirPath + "/bad_overrides";
+
+        String fileName = "Test";
+
+        try {
+			((FlexJSProject)project).config.setCompilerAllowSubclassOverrides(null, true);
+		} catch (ConfigurationException e) {
+            Assert.fail(e.getMessage());
+		}
+        project.setTargetSettings(new TargetSettings(((FlexJSProject)project).config));
+        
+        sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/bad_overrides").getPath();
+
+        StringBuilder sb = new StringBuilder();
+        compileProject(fileName, testDirPath, sb, false);
+
+        String out = sb.toString();
+        out = out.replace("\\", "/");
+
+        String expected = testAdapter.getUnitTestBaseDir().getPath() + "/flexjs/projects/bad_overrides/Test.as(31:29)\n" +
+                "interface method someFunction in interface IA is implemented with an incompatible signature in class Test\n" +
+                testAdapter.getUnitTestBaseDir().getPath() + "/flexjs/projects/bad_overrides/Test.as(36:26)\n" +
+                "interface method someOtherFunction in interface IA is implemented with an incompatible signature in class Test\n" +
+                testAdapter.getUnitTestBaseDir().getPath() + "/flexjs/projects/bad_overrides/Test.as(31:29)\n" +
+                "Incompatible override.\n" +
+                testAdapter.getUnitTestBaseDir().getPath() + "/flexjs/projects/bad_overrides/Test.as(36:26)\n" +
+                "Incompatible override.\n";
+        assertThat(out, is(expected));
+    }
+    
+    @Test
+    public void test_PackageConflict_AmbiguousDefinition()
+    {
+        String testDirPath = projectDirPath + "/package_conflicts_ambiguous_definition";
+
+        String fileName = "AmbiguousDefinition";
+
+        externs.add("Event");
+
+        sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/package_conflicts_ambiguous_definition").getPath();
+
+        StringBuilder sb = new StringBuilder();
+        compileProject(fileName, testDirPath, sb, false);
+
+        externs.clear();
+
+        String out = sb.toString();
+        out = out.replace("\\", "/");
+
+        assertThat(out, is(testAdapter.getUnitTestBaseDir().getPath() +
+                "/flexjs/projects/package_conflicts_ambiguous_definition/mypackage/TestClass.as(29:20)\nAmbiguous reference to Event\n" +
+                testAdapter.getUnitTestBaseDir().getPath() +
+                "/flexjs/projects/package_conflicts_ambiguous_definition/mypackage/TestClass.as(30:41)\nAmbiguous reference to Event\n"));
+    }
+
+    @Test
+    public void test_PackageConflict_SamePackageAsConflict()
+    {
+        String testDirPath = projectDirPath + "/package_conflicts_same_package_as_conflict";
+
+        String fileName = "SamePackageAsConflict";
+
+        externs.add("Event");
+
+        sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/package_conflicts_same_package_as_conflict").getPath();
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        externs.clear();
+        
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Test
+    public void test_PackageConflict_DifferentPackageAsConflict()
+    {
+        String testDirPath = projectDirPath + "/package_conflicts_different_package_as_conflict";
+
+        String fileName = "DifferentPackageAsConflict";
+
+        externs.add("Event");
+
+        sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/package_conflicts_different_package_as_conflict").getPath();
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        externs.clear();
+        
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Test
+    public void test_PackageConflict_UseWindow()
+    {
+        String testDirPath = projectDirPath + "/package_conflicts_use_window";
+
+        String fileName = "UseWindow";
+
+        externs.add("Event");
+
+        sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/package_conflicts_use_window").getPath();
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        externs.clear();
+        
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Test
+    public void test_PackageConflict_NoConflictNoWindow()
+    {
+        String testDirPath = projectDirPath + "/package_conflicts_no_conflict_no_window";
+
+        String fileName = "NoConflictNoWindow";
+
+        externs.add("Event");
+
+        sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/package_conflicts_no_conflict_no_window").getPath();
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        externs.clear();
+        
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Test
+    public void test_PackageConflict_NoConflictUseWindow()
+    {
+        String testDirPath = projectDirPath + "/package_conflicts_no_conflict_use_window";
+
+        String fileName = "NoConflictUseWindow";
+
+        externs.add("Event");
+
+        sourcePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/package_conflicts_no_conflict_use_window").getPath();
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        externs.clear();
+        
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Override
+    protected void addSourcePaths(List<File> sourcePaths)
+    {
+        sourcePaths.add(new File(FilenameNormalization.normalize(sourcePath)));
+        ((FlexJSProject)project).unitTestExterns = externs;
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSStatements.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSStatements.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSStatements.java
new file mode 100644
index 0000000..f2022b3
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSStatements.java
@@ -0,0 +1,600 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogStatements;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IIfNode;
+import org.apache.flex.compiler.tree.as.ILiteralNode;
+import org.apache.flex.compiler.tree.as.ISwitchNode;
+import org.apache.flex.compiler.tree.as.ITryNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.tree.as.IWhileLoopNode;
+import org.apache.flex.compiler.tree.as.IWithNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestFlexJSStatements extends TestGoogStatements
+{
+    @Override
+    public void setUp()
+    {
+    	project = new FlexJSProject(workspace);
+        super.setUp();
+    }
+    
+    @Test
+    public void testObjectListeral_withPropertyNameMatchingConst()
+    {
+        ILiteralNode node = (ILiteralNode) getNode("static const myConst:int; function falconTest_a():Object { return { myConst : myConst } }",
+        		ILiteralNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitLiteral(node);
+        assertOut("{myConst:FalconTest_A.myConst}");
+    }
+    
+    @Test
+    public void testVarDeclaration_withTypeAssignedStringWithNewLine()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a:String = \"\\n\"",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {string} */ a = \"\\n\"");
+    }
+
+    //----------------------------------
+    // const declaration
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testConstDeclaration()
+    {
+        IVariableNode node = (IVariableNode) getNode("const a = 42;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("\n/**\n * @const\n * @type {*}\n */\nvar a = 42");
+    }
+
+    @Override
+    @Test
+    public void testConstDeclaration_withType()
+    {
+        IVariableNode node = (IVariableNode) getNode("const a:int = 42;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("\n/**\n * @const\n * @type {number}\n */\nvar a = 42");
+    }
+
+    @Override
+    @Test
+    public void testConstDeclaration_withList()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "const a:int = 4, b:int = 11, c:int = 42;", IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("\n/**\n * @const\n * @type {number}\n */\nvar a = 4, \n/**\n * @const\n * @type {number}\n */\nb = 11, \n/**\n * @const\n * @type {number}\n */\nc = 42");
+    }
+
+    //----------------------------------
+    // for () { }
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitFor_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int = 0; i < len; i++) { break; }",
+                IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {number} */ i = 0; i < len; i++) {\n  break;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitFor_1b()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int = 0; i < len; i++) break;", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {number} */ i = 0; i < len; i++)\n  break;");
+    }
+
+    @Override
+    @Test
+    public void testVisitForIn_1()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int in obj) { break; }", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {number} */ i in obj) {\n  break;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitForIn_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int in obj)  break; ", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {number} */ i in obj)\n  break;");
+    }
+
+    @Override
+    @Test
+    public void testVisitForEach_1()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for each(var i:int in obj) { break; }", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("var foreachiter0_target = obj;\nfor (var foreachiter0 in foreachiter0_target) \n{\nvar i = foreachiter0_target[foreachiter0];\n{\n  break;\n}}\n");
+    }
+
+    @Override
+    @Test
+    public void testVisitForEach_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for each(var i:int in obj)  break; ", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("var foreachiter0_target = obj;\nfor (var foreachiter0 in foreachiter0_target) \n{\nvar i = foreachiter0_target[foreachiter0];\n\n  break;}\n");
+    }
+
+    @Test
+    public void testVisitForEach_2()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for each(var i:int in obj.foo()) { break; }", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("var foreachiter0_target = obj.foo();\nfor (var foreachiter0 in foreachiter0_target) \n{\nvar i = foreachiter0_target[foreachiter0];\n{\n  break;\n}}\n");
+    }
+
+    @Test
+    public void testVisitForEach_HoistedVar()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "var i:int; for each(i in obj)  break; ", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("var foreachiter0_target = obj;\nfor (var foreachiter0 in foreachiter0_target) \n{\ni = foreachiter0_target[foreachiter0];\n\n  break;}\n");
+    }
+
+    //----------------------------------
+    // try {} catch () {} finally {}
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitTry_Catch()
+    {
+        ITryNode node = (ITryNode) getNode("try { a; } catch (e:Error) { b; }",
+                ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n  a;\n} catch (e) {\n  b;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitTry_Catch_Finally()
+    {
+        ITryNode node = (ITryNode) getNode(
+                "try { a; } catch (e:Error) { b; } finally { c; }",
+                ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n  a;\n} catch (e) {\n  b;\n} finally {\n  c;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitTry_Catch_Catch_Finally()
+    {
+        // TODO (erikdebruin) handle multiple 'catch' statements (FW in Wiki)
+        ITryNode node = (ITryNode) getNode(
+                "try { a; } catch (e:Error) { b; } catch (f:Error) { c; } finally { d; }",
+                ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n  a;\n} catch (e) {\n  b;\n} catch (f) {\n  c;\n} finally {\n  d;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitTry_CatchEmpty_FinallyEmpty_()
+    {
+        ITryNode node = (ITryNode) getNode(
+                "try { a; } catch (e:Error) {  } finally {  }", ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n  a;\n} catch (e) {\n} finally {\n}");
+    }
+
+    //----------------------------------
+    // switch {}
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitSwitch_1()
+    {
+        ISwitchNode node = (ISwitchNode) getNode("switch(i){case 1: break;}",
+                ISwitchNode.class);
+        asBlockWalker.visitSwitch(node);
+        assertOut("switch (i) {\n  case 1:\n    break;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitSwitch_1a()
+    {
+        ISwitchNode node = (ISwitchNode) getNode(
+                "switch(i){case 1: { break; }}", ISwitchNode.class);
+        asBlockWalker.visitSwitch(node);
+        // (erikdebruin) the code is valid without the extra braces, 
+        //               i.e. we're good, we "don't care"
+        assertOut("switch (i) {\n  case 1:\n    break;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitSwitch_2()
+    {
+        ISwitchNode node = (ISwitchNode) getNode(
+                "switch(i){case 1: break; default: return;}", ISwitchNode.class);
+        asBlockWalker.visitSwitch(node);
+        assertOut("switch (i) {\n  case 1:\n    break;\n  default:\n    return;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitSwitch_3()
+    {
+        ISwitchNode node = (ISwitchNode) getNode(
+                "switch(i){case 1: { var x:int = 42; break; }; case 2: { var y:int = 66; break; }}", ISwitchNode.class);
+        asBlockWalker.visitSwitch(node);
+        assertOut("switch (i) {\n  case 1:\n    var /** @type {number} */ x = 42;\n    break;\n  case 2:\n    var /** @type {number} */ y = 66;\n    break;\n}");
+    }
+
+    //----------------------------------
+    // if ()
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitIf_1()
+    {
+        IIfNode node = (IIfNode) getNode("if (a) b++;", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a)\n  b++;");
+    }
+
+    @Override
+    @Test
+    public void testVisitIf_2()
+    {
+        IIfNode node = (IIfNode) getNode("if (a) b++; else c++;", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a)\n  b++;\nelse\n  c++;");
+    }
+
+    @Override
+    @Test
+    public void testVisitIf_4()
+    {
+        IIfNode node = (IIfNode) getNode(
+                "if (a) b++; else if (c) d++; else if(e) --f;", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a)\n  b++;\nelse if (c)\n  d++;\nelse if (e)\n  --f;");
+    }
+
+    //----------------------------------
+    // if () { }
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitIf_1a()
+    {
+        IIfNode node = (IIfNode) getNode("if (a) { b++; }", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a) {\n  b++;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitIf_1b()
+    {
+        IIfNode node = (IIfNode) getNode("if (a) { b++; } else { c++; }",
+                IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a) {\n  b++;\n} else {\n  c++;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitIf_1c()
+    {
+        IIfNode node = (IIfNode) getNode(
+                "if (a) { b++; } else if (b) { c++; } else { d++; }",
+                IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a) {\n  b++;\n} else if (b) {\n  c++;\n} else {\n  d++;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitIf_3()
+    {
+        IIfNode node = (IIfNode) getNode(
+                "if (a) b++; else if (c) d++; else --e;", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a)\n  b++;\nelse if (c)\n  d++;\nelse\n  --e;");
+    }
+
+    //----------------------------------
+    // label : for () {}
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitFor_2()
+    {
+        IForLoopNode node = (IForLoopNode) getNode("for (;;) { break; }",
+                IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (;;) {\n  break;\n}");
+    }
+    
+    //----------------------------------
+    // while () { }
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitWhileLoop_1()
+    {
+        IWhileLoopNode node = (IWhileLoopNode) getNode(
+                "while(a > b){a++;--b;}", IWhileLoopNode.class);
+        asBlockWalker.visitWhileLoop(node);
+        assertOut("while (a > b) {\n  a++;\n  --b;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitWhileLoop_1a()
+    {
+        IWhileLoopNode node = (IWhileLoopNode) getNode("while(a > b) a++;",
+                IWhileLoopNode.class);
+        asBlockWalker.visitWhileLoop(node);
+        assertOut("while (a > b)\n  a++;");
+    }
+
+    //----------------------------------
+    // do {} while ()
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitWhileLoop_Do_1()
+    {
+        IWhileLoopNode node = (IWhileLoopNode) getNode(
+                "do {a++;--b;} while(a > b);", IWhileLoopNode.class);
+        asBlockWalker.visitWhileLoop(node);
+        assertOut("do {\n  a++;\n  --b;\n} while (a > b);");
+    }
+
+    @Override
+    @Test
+    public void testVisitWhileLoop_Do_1a()
+    {
+        IWhileLoopNode node = (IWhileLoopNode) getNode("do a++; while(a > b);",
+                IWhileLoopNode.class);
+        asBlockWalker.visitWhileLoop(node);
+        assertOut("do\n  a++;\nwhile (a > b);");
+    }
+
+    //----------------------------------
+    // label : for () {}
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitLabel_1()
+    {
+        LabeledStatementNode node = (LabeledStatementNode) getNode(
+                "foo: for each(var i:int in obj) { break foo; }",
+                LabeledStatementNode.class);
+        asBlockWalker.visitLabeledStatement(node);
+        assertOut("var foreachiter0_target = obj;\nfoo : for (var foreachiter0 in foreachiter0_target) \n{\nvar i = foreachiter0_target[foreachiter0];\n{\n  break foo;\n}}\n");
+    }
+
+    @Override
+    @Test
+    public void testVisitLabel_1a()
+    {
+        // TODO (mschmalle) LabelStatement messes up in finally{} block, something is wrong there
+        LabeledStatementNode node = (LabeledStatementNode) getNode(
+                "foo: for each(var i:int in obj) break foo;",
+                LabeledStatementNode.class);
+        asBlockWalker.visitLabeledStatement(node);
+        assertOut("var foreachiter0_target = obj;\nfoo : for (var foreachiter0 in foreachiter0_target) \n{\nvar i = foreachiter0_target[foreachiter0];\n\n  break foo;}\n");
+    }
+
+    //----------------------------------
+    // with () {}
+    //----------------------------------
+
+    @Test
+    public void testVisitWith()
+    {
+        IWithNode node = (IWithNode) getNode("with (a) { b; }", IWithNode.class);
+        asBlockWalker.visitWith(node);
+        assertOut("with (a) {\n  b;\n}");
+    }
+
+    @Test
+    public void testVisitWith_1a()
+    {
+        IWithNode node = (IWithNode) getNode("with (a) b;", IWithNode.class);
+        asBlockWalker.visitWith(node);
+        assertOut("with (a)\n  b;");
+    }
+
+    @Override
+    @Test
+    public void testVisit()
+    {
+        IFileNode node = (IFileNode) getNode(
+                "try { a; } catch (e:Error) { if (a) { if (b) { if (c) b; else if (f) a; else e; }} } finally {  }"
+                        + "if (d) for (var i:int = 0; i < len; i++) break;"
+                        + "if (a) { with (ab) { c(); } "
+                        + "do {a++;do a++; while(a > b);} while(c > d); }"
+                        + "if (b) { try { a; throw new Error('foo'); } catch (e:Error) { "
+                        + " switch(i){case 1: break; default: return;}"
+                        + " } finally { "
+                        + "  d;  var a:Object = function(foo:int, bar:String = 'goo'):int{return -1;};"
+                        + "  eee.dd; eee.dd; eee.dd; eee.dd;} }"
+                        + "foo: for each(var i:int in obj) break foo;",
+                IFileNode.class);
+        asBlockWalker.visitFile(node);
+        assertOutWithMetadata("/**\n" +
+        		              " * FalconTest_A\n" +
+        		              " *\n" +
+        		              " * @fileoverview\n" +
+        		              " *\n" +
+        		              " * @suppress {checkTypes|accessControls}\n" +
+        		              " */\n" +
+        		              "\n" +
+        		              "goog.provide('FalconTest_A');\n" +
+        		              "\n\n\n" +
+        		              "/**\n" +
+        		              " * @constructor\n" +
+        		              " */\n" +
+        		              "FalconTest_A = function() {\n" +
+        		              "};\n\n\n" +
+        		              "FalconTest_A.prototype.falconTest_a = function() {\n" +
+        		              "  var self = this;\n" +
+        		              "  var /** @type {Function} */ __localFn0__ = function(foo, bar) {\n" +
+            		          "    bar = typeof bar !== 'undefined' ? bar : 'goo';\n" +
+            		          "    return -1;\n" +
+            		          "  }\n" +
+            		          "  try {\n" +
+        		              "    a;\n" +
+        		              "  } catch (e) {\n" +
+        		              "    if (a) {\n" +
+        		              "      if (b) {\n" +
+        		              "        if (c)\n" +
+        		              "          b;\n" +
+        		              "        else if (f)\n" +
+        		              "          a;\n" +
+        		              "        else\n" +
+        		              "          e;\n" +
+        		              "      }\n" +
+        		              "    }\n" +
+        		              "  } finally {\n" +
+        		              "  }\n" +
+        		              "  if (d)\n" +
+        		              "    for (var /** @type {number} */ i = 0; i < len; i++)\n" +
+        		              "      break;\n" +
+        		              "  if (a) {\n" +
+        		              "    with (ab) {\n" +
+        		              "      c();\n" +
+        		              "    }\n" +
+        		              "    do {\n" +
+        		              "      a++;\n" +
+        		              "      do\n" +
+        		              "        a++;\n" +
+        		              "      while (a > b);\n" +
+        		              "    } while (c > d);\n" +
+        		              "  }\n" +
+        		              "  if (b) {\n" +
+        		              "    try {\n" +
+        		              "      a;\n" +
+        		              "      throw new Error('foo');\n" +
+        		              "    } catch (e) {\n" +
+        		              "      switch (i) {\n" +
+        		              "        case 1:\n" +
+        		              "          break;\n" +
+        		              "        default:\n" +
+        		              "          return;\n" +
+        		              "      }\n" +
+        		              "    } finally {\n" +
+        		              "      d;\n" +
+        		              "      var /** @type {Object} */ a = __localFn0__;\n" +
+        		              "      eee.dd;\n" +
+        		              "      eee.dd;\n" +
+        		              "      eee.dd;\n" +
+        		              "      eee.dd;\n" +
+        		              "    }\n" +
+        		              "  }\n" +
+        		              "  var foreachiter0_target = obj;\n" +
+        		              "  foo : for (var foreachiter0 in foreachiter0_target) \n" +
+        		              "  {\n" +
+        		              "  var i = foreachiter0_target[foreachiter0];\n" +
+        		              "  \n" +
+        		              "    break foo;}\n" +
+        		              "  ;\n};\n\n\n" +
+        		              "/**\n * Metadata\n" +
+        		              " *\n" +
+        		              " * @type {Object.<string, Array.<Object>>}\n" +
+        		              " */\n" +
+        		              "FalconTest_A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'FalconTest_A', qName: 'FalconTest_A'}] };\n" +
+        		          		"\n" +
+        		        		"\n" +
+        		        		"/**\n" +
+        		        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		        		" */\n" +
+        		        		"goog.exportSymbol('FalconTest_A', FalconTest_A);\n" +
+        		          		"\n" +
+        		        		"\n" +
+        		        		"\n" +
+        		        		"/**\n" +
+        		        		" * Reflection\n" +
+        		        		" *\n" +
+        		        		" * @return {Object.<string, Function>}\n" +
+        		        		" */\n" +
+        		        		"FalconTest_A.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		        		"return {\n" +
+        		        		"  variables: function () {\n" +
+        		        		"    return {\n" +
+        		        		"    };\n" + 
+        		        		"  },\n" +
+        		        		"  accessors: function () {\n" +
+        		        		"    return {\n" +
+        		        		"    };\n" +
+        		        		"  },\n" +
+        		        		"  methods: function () {\n" +
+        		        		"    return {\n" +
+        		        		"    };\n" +
+        		        		"  }\n" +
+        		        		"};\n" +
+        		        		"};\n");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogAccessorMembers.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogAccessorMembers.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogAccessorMembers.java
new file mode 100644
index 0000000..02965c0
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogAccessorMembers.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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.TestAccessorMembers;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid 'goog' JS code for Class Accessor
+ * members.
+ * 
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class TestGoogAccessorMembers extends TestAccessorMembers
+{
+    @Override
+    @Test
+    public void testGetAccessor()
+    {
+        IGetterNode node = (IGetterNode) getAccessor("function get foo():int{}");
+        asBlockWalker.visitGetter(node);
+        assertOut("Object.defineProperty(\n\tFalconTest_A.prototype, \n\t'foo', "
+                + "\n\t{get:function() {\n\t}, configurable:true}\n)");
+    }
+
+    @Test
+    public void testGetAccessor_withBody()
+    {
+        IGetterNode node = (IGetterNode) getAccessor("function get foo():int{return -1;}");
+        asBlockWalker.visitGetter(node);
+        assertOut("Object.defineProperty(\n\tFalconTest_A.prototype, \n\t'foo', "
+                + "\n\t{get:function() {\n\t\tvar self = this;\n\t\treturn -1;\n\t}, configurable:true}\n)");
+    }
+
+    @Override
+    @Test
+    public void testGetAccessor_withNamespace()
+    {
+        IGetterNode node = (IGetterNode) getAccessor("public function get foo():int{return -1;}");
+        asBlockWalker.visitGetter(node);
+        assertOut("Object.defineProperty(\n\tFalconTest_A.prototype, \n\t'foo', "
+                + "\n\t{get:function() {\n\t\tvar self = this;\n\t\treturn -1;\n\t}, configurable:true}\n)");
+    }
+
+    @Override
+    @Test
+    public void testGetAccessor_withNamespaceOverride()
+    {
+        // TODO (erikdebruin) need to figure out how to handle calls to 
+        //                    'super' since the JS getter is actually an 
+        //                    anonymous function... goog.bind or goog.partial?
+        IGetterNode node = (IGetterNode) getAccessor("public override function get foo():int{super.foo(); return -1;}");
+        asBlockWalker.visitGetter(node);
+        assertOut("Object.defineProperty(\n\tFalconTest_A.prototype, \n\t'foo', \n\t{get:function() {\n\t\tvar self = this;\n\t\tFalconTest_A.base(this, 'foo');\n\t\treturn -1;\n\t}, configurable:true}\n)");
+    }
+
+    @Override
+    @Test
+    public void testGetAccessor_withStatic()
+    {
+        IGetterNode node = (IGetterNode) getAccessor("public static function get foo():int{return -1;}");
+        asBlockWalker.visitGetter(node);
+        assertOut("Object.defineProperty(\n\tFalconTest_A, \n\t'foo', \n\t{get:function() {\n\t\treturn -1;\n\t}, configurable:true}\n)");
+    }
+
+    @Override
+    @Test
+    public void testSetAccessor()
+    {
+        ISetterNode node = (ISetterNode) getAccessor("function set foo(value:int):void{}");
+        asBlockWalker.visitSetter(node);
+        assertOut("Object.defineProperty(\n\tFalconTest_A.prototype, \n\t'foo', \n\t{set:function(value)"
+                + " {\n\t}, configurable:true}\n)");
+    }
+
+    @Test
+    public void testSetAccessor_withBody()
+    {
+        ISetterNode node = (ISetterNode) getAccessor("function set foo(value:int):void{trace('haai');}");
+        asBlockWalker.visitSetter(node);
+        assertOut("Object.defineProperty(\n\tFalconTest_A.prototype, \n\t'foo', "
+                + "\n\t{set:function(value) {\n\t\tvar self = this;\n\t\ttrace('haai');\n\t}, configurable:true}\n)");
+    }
+
+    @Override
+    @Test
+    public void testSetAccessor_withNamespace()
+    {
+        ISetterNode node = (ISetterNode) getAccessor("public function set foo(value:int):void{}");
+        asBlockWalker.visitSetter(node);
+        assertOut("Object.defineProperty(\n\tFalconTest_A.prototype, \n\t'foo', \n\t{set:function(value)"
+                + " {\n\t}, configurable:true}\n)");
+    }
+
+    @Override
+    @Test
+    public void testSetAccessor_withNamespaceOverride()
+    {
+        // TODO (erikdebruin) see: testGetAccessor_withNamespaceOverride
+        ISetterNode node = (ISetterNode) getAccessor("public override function set foo(value:int):void{super.foo();}");
+        asBlockWalker.visitSetter(node);
+        assertOut("Object.defineProperty(\n\tFalconTest_A.prototype, \n\t'foo', \n\t{set:function(value) {\n\t\tvar self = this;\n\t\tFalconTest_A.base(this, 'foo');\n\t}, configurable:true}\n)");
+    }
+
+    @Override
+    @Test
+    public void testSetAccessor_withStatic()
+    {
+        ISetterNode node = (ISetterNode) getAccessor("public static function set foo(value:int):void{}");
+        asBlockWalker.visitSetter(node);
+        assertOut("Object.defineProperty(\n\tFalconTest_A, \n\t'foo', \n\t{set:function(value) {\n\t}, configurable:true}\n)");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+}


[12/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_ja.properties
----------------------------------------------------------------------
diff --git a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_ja.properties b/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_ja.properties
deleted file mode 100644
index d8b62a5..0000000
--- a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_ja.properties
+++ /dev/null
@@ -1,282 +0,0 @@
-################################################################################
-##
-##  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.
-##
-################################################################################
-
-ABCGeneratorProblem=コードの生成中に、ABC ジェネレーターのサブシステムで内部エラーが発生しました : ${sourceFileName} : ${stackTrace}
-AccessorTypesMustMatchProblem=アクセッサーの型が一致している必要があります。
-AccessUndefinedMemberProblem=未定義である可能性が高いプロパティ ${memberName} に静的型 ${className} の参照を使用してアクセスしています。
-AccessUndefinedPropertyInPackageProblem=パッケージ ${packageName} 内の未定義のプロパティ ${propertyName} にアクセスしています。
-AccessUndefinedPropertyProblem=未定義である可能性が高いプロパティ ${propertyName} にアクセスしています。
-AmbiguousReferenceProblem=${property} へのあいまいな参照です
-AssignToConstProblem=定数として指定した変数への割り当てが無効です。
-AssignToFunctionProblem=関数 ${funcName} への割り当てが不正です。
-AssignToReadOnlyPropertyProblem=プロパティ ${name} は読み取り専用です。
-AttemptToDeleteFixedPropertyProblem=固定プロパティ ${name} を削除しようとしています。削除できるのは、動的に定義されたプロパティだけです。
-AttributesAreNotCallableProblem=属性は呼び出し可能ではありません。
-BadAccessInterfaceMemberProblem=インターフェイスのメンバーを public、private、protected または internal として宣言することはできません。
-BadCharacterProblem=予期しない文字エラーが発生しました : ここで「${errorText}」を使用することはできません
-BadSetterReturnTypeProblem=setter 定義の戻り値の型は未指定または void でなければなりません。
-BaseClassIsFinalProblem=基本クラスは ${finalStr} です。
-BURMDiagnosticForEachExpectedInProblem=「${k_in}」演算子を使用せずに「${k_each}」キーワードを指定することはできません
-BURMDiagnosticInvalidDecrementProblem=デクリメントのオペランドは参照でなければなりません。
-BURMDiagnosticNotAllowedHereProblem=ここで ${node} を使用することはできません
-BURMPatternMatchFailureProblem=${node} のコードを生成できません
-BURNDiagnosticInvalidIncrementProblem=インクリメントのオペランドは参照でなければなりません。
-CallUndefinedMethodProblem=未定義である可能性が高いメソッド ${methodName} の呼び出しです。
-CannotDeleteSuperDescendantsProblem=super の子孫を削除することはできません。
-CannotExtendClassProblem=インターフェイスが拡張できるのは別のインターフェイスのみです。${className} はクラスです。
-CannotExtendInterfaceProblem=${classStr} が拡張できるのは、${interfaceStr} ではなく別の ${classStr} のみです。
-CannotResolveConfigExpressionProblem=条件付きコンパイル定数を解決できません : 「${configName}」
-CircularTypeReferenceProblem=${className} で循環型参照が検出されました
-ClassesMappedToSameRemoteAliasProblem=クラス「${className}」の処理中に、リモートクラスのエイリアス「${alias}」への「${existingClassName}」のマッピングが見つかりました。Flex で、エイリアスが既に登録されているかどうかを確認するコードが生成されます。リモートデータを非直列化する場合、エイリアスは 1 つのクラスにのみマップできます。
-ClosureProblem=Closure error.
-CodegenInternalProblem=コードジェネレーターの内部エラーです : ${diagnostic}
-CompiledAsAComponentProblem=${className} は、直接参照されるモジュールまたはアプリケーションです。そのため、${className} およびそのすべての依存関係は ${mainDefinition} にリンクされます。この状況を回避するには、インターフェイスを使用することをお勧めします。
-ConfigurationFileNotFoundProblem=設定ファイルが見つかりません : ${file}
-ConfigurationProblem=設定エラーです : ${reason}。\n${location}
-ConflictingInheritedNameInNamespaceProblem=名前空間 ${nsName} の継承した定義 ${declName} にコンフリクトが存在します。
-ConflictingNameInNamespaceProblem=名前空間 ${nsName} の定義 ${declName} にコンフリクトが存在します。
-ConstructorCannotHaveReturnTypeProblem=コンストラクターは戻り値の型を指定できません
-ConstructorIsGetterSetterProblem=コンストラクターは getter メソッドまたは setter メソッド以外でなければなりません
-ConstructorIsStaticProblem=コンストラクター関数はインスタンスメソッドでなければなりません
-ConstructorMustBePublicProblem=コンストラクターは ${modifier} としてのみ宣言できます
-CountedForLoopInitializerProblem=シンタックスエラー : 右括弧の前にセミコロンが必要です。
-CSSCodeGenProblem=CSS コードジェネレーターのエラーです。理由 : 「${reason}」
-CSSEmbedAssetProblem=「${embed}」からアセットを埋め込むことはできません。
-CSSParserProblem=${reason}
-CSSUndefinedNamespacePrefixProblem=「${prefix}」は未定義の名前空間接頭辞です。
-CSSUndefinedTypeProblem=「${type}」は定義されていません。
-CSSUnknownDefaultNamespaceProblem=名前空間の接頭辞のない型セレクターでは、デフォルトの名前空間を定義する必要があります。${selectorText}
-CSSUnresolvedClassReferenceProblem=${qname} は定義されていません。
-CyclicalIncludesProblem=循環インクルードが ${file} に見つかりました
-DependencyNotCompatibleProblem=${swc} の依存関係 ${definition} には、サポートされている最小バージョンの ${swcMinimumVersion} が含まれています。これは互換性のあるバージョンである ${compatibilityVersion} よりも新しいバージョンです。
-DeprecatedConfigurationOptionProblem=${since} 以降、「${option}」は使用されなくなりました。「${replacement}」を使用してください
-DuplicateAttributeProblem=属性 ${attrStr} は複数回指定されています。
-DuplicateClassDefinitionProblem=クラスの定義が重複しています : ${className}。
-DuplicateConfigNameProblem=構成名前空間が重複しています : 「${configName}」
-DuplicateFunctionDefinitionProblem=関数の定義が重複しています : ${methodName}
-DuplicateInterfaceDefinitionProblem=インターフェイスの定義が重複しています : ${interfaceName}。
-DuplicateInterfaceProblem=${classStr} ${className} は ${interfaceStr} ${interfaceName} を複数回実装します。
-DuplicateLabelProblem=ラベルの定義が重複しています。
-DuplicateNamespaceDefinitionProblem=名前空間の定義が重複しています。
-DuplicateQNameInSourcePathProblem=${qName} は複数のファイルで定義されています : ${fileList} 
-DuplicateSkinStateProblem=SkinState「${name}」の宣言が重複しています
-DuplicateSourceFileProblem=インクルード元のリストで ${file} が複数回指定されています。
-DuplicateSourcePathProblem=ソースパスで ${directory} が複数回指定されています。
-DuplicateSwitchCaseProblem=代替の ${caseName} の切り替えが重複しています。
-DynamicNotOnClassProblem=${dynamicStr} 属性は ${classStr} 定義でのみ使用できます。
-EmbedAS2TagsModifiedProblem=${symbol} タグから AS2 のアクションが削除されました
-EmbedBadFontParameters=フォントのコード変換を行うには、「fontName」、および「source」、「systemFont」、「sourceList」のいずれかを指定する必要があります
-EmbedBadScalingGridTargetProblem=シンボル ${symbol} は Sprite 型ではないので拡大 / 縮小できませんでした
-EmbedCouldNotDetermineSampleFrameCountProblem=ファイル ${filename} のサンプルフレーム数を特定できませんでした
-EmbeddedFontShadowsDeviceFontProblem=埋め込みフォント「${alias}」によって、同じ名前のデバイスフォントをシャドウすることができます。fontName を使用すると、フォントのエイリアスを別の名前に指定できます
-EmbedExceptionWhileTranscodingProblem=コード変換中に例外が発生しました : ${exception}
-EmbedInitialValueProblem=Embed 変数に既存の値を指定することはできません。
-EmbedInvalidAttributeValueProblem=属性 ${attribute} の値 ${value} が無効です
-EmbedInvalidUnicodeRangeProblem=Unicode 範囲「${range}」が無効です
-EmbedMissingSymbolProblem=シンボル ${symbol} がファイル ${swf} に見つかりませんでした
-EmbedMovieScalingNoSymbolProblem=埋め込みムービーを拡大 / 縮小する場合はシンボルを指定してください
-EmbedMultipleMetaTagsProblem=変数で使用できる Embed メタデータタグは 1 つだけです
-EmbedNoSkinClassProblem=スキンアセットを埋め込む場合は、skinClass 属性を指定する必要があります
-EmbedNoSourceAttributeProblem=埋め込みにはソースファイル属性が必要です
-EmbedQualityRequiresCompressionProblem=圧縮が無効な場合は ${quality} を指定しないでください
-EmbedQualityValueProblem=${quality} 属性の値 ${value} が無効です。0.0 ~ 100.0 の値を指定する必要があります
-EmbedScalingGridProblem=scaleBottom、scaleLeft、scaleRight および scaleTop の各属性は一緒に指定する必要があります
-EmbedScalingGridValueProblem=属性 ${attr} の拡大 / 縮小の値 ${value} は 0 より大きい値にする必要があります
-EmbedSkinClassNotFoundProblem=クラス ${skinClass} が見つかりません
-EmbedSourceAttributeCouldNotBeReadProblem=埋め込み元ファイル ${filename} を読み取ることができませんでした
-EmbedSourceAttributeDoesNotExistProblem=埋め込み元ファイルが見つかりませんでした
-EmbedSourceFileNotFoundProblem=埋め込み元ファイルが見つかりません : ${file}
-EmbedTypeNotEmbeddableProblem=型 ${typeName} を埋め込むことができません
-EmbedUnableToBuildFontProblem=フォント「${fontName}」を作成できません
-EmbedUnableToReadSourceProblem=コード変換するソース「${source}」を読み取ることができません
-EmbedUnknownAttributeProblem=不明な属性です : ${attr}
-EmbedUnknownMimeTypeProblem=${mimeType} は処理されない MIME タイプです
-EmbedUnrecogniedFileTypeProblem=ファイル ${file} のタイプは、埋め込むことのできない不明なファイルタイプです
-EmbedUnsupportedAttributeProblem=属性 ${attribute} を次の MIME タイプで使用することはできません : ${mimeType}
-EmbedUnsupportedSamplingRateProblem=ファイル ${filename} では周波数 ${frequency} がサポートされていません
-FileNotFoundProblem=ファイルが見つかりません : ${file}
-FinalOutsideClassProblem=${finalStr} 属性は ${classStr} 内で定義されたメソッドでのみ使用できます。
-FunctionNotMarkedOverrideProblem=${overrideStr} に対応していない ${funcStr} をオーバーライドしています
-FunctionWithoutBodyProblem=関数にボディを含めることはできません。
-FXGCompilerProblem=FXG コンパイルエラーです : ${message}
-GetterCannotHaveParametersProblem=getter 定義にはパラメーターを使用できません。
-GlobalBindablePropertyProblem=[${bindableStr}] をグローバル変数または ${packageStr} 変数で使用することはできません
-HostComponentClassNotFoundProblem=[HostComponent] クラス「${className}」が見つかりません。
-HostComponentMustHaveTypeProblem=[HostComponent] は型名を指定する必要があります。
-IllegalAssignmentToClassProblem=クラス ${className} への割り当てが無効です。
-ImplicitCoercionToSubtypeProblem=静的型 ${baseType} の値が、関連しない可能性が高い型 ${subType} に暗黙で型変換されています。
-ImplicitCoercionToUnrelatedTypeProblem=型 ${actualType} の値が、関連しない型 ${expectedType} に暗黙で型変換されています。
-InaccessibleMethodReferenceProblem=アクセスできないメソッド ${methodName} へのアクセスを、静的型 ${className} の参照を使用して試行しました。
-InaccessiblePropertyReferenceProblem=アクセスできないプロパティ ${propertyName} へのアクセスを、静的型 ${className} の参照を使用して試行しました。
-IncompatibleDefaultValueProblem=互換性のない型 ${srcType} のデフォルト値です。${tgtType} が必要です。
-IncompatibleInterfaceMethodProblem=${namespaceStr} ${namespaceName} の ${interfStr} メソッド ${methodName} は、互換性のない署名を使用して ${classStr} ${className} に実装されています
-IncompatibleOverrideProblem=互換性のない ${overrideStr} です。
-InterfaceBindablePropertyProblem=[${bindableStr}] を ${interfStr} 定義内で使用することはできません。
-InterfaceCannotBeInstantiatedProblem=インターフェイスを新しい演算子でインスタンス化することはできません。
-InterfaceMethodWithBodyProblem=${interfaceStr} で定義されたメソッドにボディを含めることはできません。
-InterfaceModifierProblem=インターフェイスの属性 ${modifier} が無効です。
-InterfaceNamespaceAttributeProblem=インターフェイスのメソッドでは名前空間の属性が許可されていません。
-InternalCompilerProblem=内部コンパイルエラー
-InvalidABCByteCodeProblem=ABC バイトコードが無効です。
-InvalidBackgroundColorProblem=背景色が無効です : ${backgroundColor}
-InvalidDecrementOperandProblem=デクリメントのオペランドが無効です。
-InvalidEscapeSequenceProblem=「${badSequence}」は無効なエスケープシーケンスです
-InvalidForInInitializerProblem=シンタックスエラー : 無効な for-in 初期化子です。式は 1 つだけにしてください。
-InvalidIncrementOperandProblem=インクリメントのオペランドが無効です。
-InvalidLvalueProblem=割り当てのターゲットは参照値でなければなりません。
-InvalidNamespaceInitializerProblem=名前空間の初期化子は、リテラルストリングまたは別の名前空間でなければなりません。
-InvalidNamespaceProblem=ユーザー定義の名前空間の属性は、${classStr} 定義のトップレベルでのみ使用できます。
-InvalidOverrideProblem=${overrideStr} 属性は ${classStr} 内で定義されたメソッドでのみ使用できます。
-InvalidPrivateNamespaceAttrProblem=${privateStr} 属性は ${classStr} プロパティの定義でのみ使用できます。
-InvalidPrivateNamespaceProblem=${privateStr} は ${classStr} 内で名前空間としてのみ使用できます。
-InvalidProtectedNamespaceAttrProblem=${protectedStr} 属性は ${classStr} プロパティの定義でのみ使用できます。
-InvalidProtectedNamespaceProblem=${protectedStr} は ${classStr} 内で名前空間としてのみ使用できます。
-InvalidPublicNamespaceAttrProblem=${publicStr} 属性は ${packageStr} 内でのみ使用できます。
-InvalidPublicNamespaceProblem=${publicStr} は ${packageStr} 内で名前空間としてのみ使用できます。
-InvalidRestParameterDeclarationProblem=...rest パラメーター定義のキーワードの後に指定したパラメーターで使用できるのは、Array データ型のみです。
-InvalidSuperExpressionProblem=super 式はクラスインスタンスのメソッド内でのみ使用できます。
-InvalidSuperStatementProblem=super ステートメントはクラスインスタンスのコンストラクター内でのみ使用できます。
-JSDataClassMethodError=ERROR: DataClass classes must not declare methods. 
-JSInternalCompilerProblem=Internal compiler error: ${message}. 
-JSUnsupportedFeatureProblem=Unsupported feature: ${feature}. 
-JSWarnClassInitProblem=PERFORMANCE: Avoid loose class initialization statements. Consider using singletons instead.
-JSWarnClosureAdvancedOptimizationsProblem=WARNING: Optimizing with ADVANCED_OPTIMIZATIONS will fail because of accessing properties via unknown strings.
-JSWarnRuntimeNameLookupProblem=PERFORMANCE: Forced to emit expensive runtime name lookup. Consider using strict types instead of generic objects and avoiding dynamic classes.
-LocalBindablePropertyProblem=[${bindableStr}] を ${funcStr} 定義内で使用することはできません。
-LossyConversionProblem=無効な初期化 : 型 ${targetType} に変換するとデータが失われます。
-MethodCannotBeConstructorProblem=メソッドをコンストラクターとして使用することはできません。
-MissingBuiltinProblem=ビルトインタイプ ${builtinType} が見つかりません
-MissingCatchOrFinallyProblem=シンタックスエラー : catch 節または finally 節が必要です。
-MissingFactoryClassInFrameMetadataProblem=このコンパイルユニットの Frame メタデータには、設定済みのランタイム共有ライブラリをロードするための factoryClass が指定されていませんでした。ランタイム共有ライブラリを使用せずにコンパイルするには、-static-link-runtime-shared-libraries オプションを true に設定するか、-runtime-shared-libraries オプションを削除します。
-MissingRequirementConfigurationProblem=設定変数「${required}」が設定されていません
-MissingSignedDigestProblem=ライブラリ (${libraryPath}) の catalog.xml に署名済みのダイジェストが見つかりません。
-MissingSkinPartProblem=必要なスキンパーツ「${skinPartName}」が見つかりません。
-MissingSkinStateProblem=必要なスキンの状態「${skinStateName}」が見つかりません。
-MissingUnsignedDigestProblem=ライブラリ ${libraryPath} の catalog.xml に署名なしのダイジェストが見つかりません。
-MultipleConfigNamespaceDecorationsProblem=定義では構成名前空間の重複は許可されていません
-MultipleSwitchDefaultsProblem=switch には複数のデフォルトがありますが、デフォルトは 1 つでなければなりません。
-MXMLAttributeVersionProblem=「${name}」属性は MXML ${version} 以降でのみ使用できます。この属性は無視されます。
-MXMLClassNodeProblem=「${qname}」はクラスまたはインターフェイスを指定しません。これは無視されます。
-MXMLDatabindingSourceNotBindableProblem=データバインディングでは「${sourceName}」への割り当てを検出できません。
-MXMLDuplicateIDProblem=この ID は一意ではありません。この ID は無視されます。
-MXMLFinalClassProblem=「${qname}」は最終クラスなので、ルートタグとして使用することはできません。
-MXMLIncludeInAndExcludeFromProblem=この同じタグに「includeIn」属性と「excludeFrom」属性を指定することはできません。両方とも無視されます。
-MXMLIncompatibleArrayElementProblem=「${actualType}」型の配列エレメントは、「${propertyName}」プロパティに必要な「${expectedType}」の [ArrayElementType] と互換性がありません。
-MXMLIncompatibleVectorElementProblem=このエレメントは Vector 型と互換性がありません。このエレメントは無視されます。
-MXMLInvalidEntityProblem=不明なエンティティ「{entity}」が見つかりました。このエンティティは無視されます。
-MXMLInvalidIDProblem=この ID は無効な ActionScript 識別子です。この ID は無視されます。
-MXMLInvalidItemCreationPolicyProblem=itemCreationPolicy の有効な値は「immediate」または「deferred」です。この属性は無視されます。
-MXMLInvalidItemDestructionPolicyProblem=itemDestructionPolicy の有効な値は「auto」または「never」です。この属性は無視されます。
-MXMLInvalidPercentageProblem=「${property}」の初期化子 : 無効なパーセント式 : 「${text}」。
-MXMLInvalidTextForTypeProblem=「${text}」から「${type}」型の値を解析することはできません。
-MXMLInvalidVectorFixedAttributeProblem=「fixed」属性は「true」または「false」である必要があります。この属性は無視されます。
-MXMLInvalidVectorTypeAttributeProblem=「type」属性は既知のクラスを指定しません。この型は「*」と見なされます。
-MXMLMissingRootTagProblem=この MXML ファイルにルートタグが見つかりません。
-MXMLMissingVectorTypeAttributeProblem=<Vector> タグには「type」属性が必要です。この型は「*」と見なされます。
-MXMLNotAClassProblem=「${qname}」はクラスではありません。このタグは無視されます。
-MXMLOperationMissingNameProblem=操作には ${name} 属性が必要です。
-MXMLOtherLanguageNamespaceProblem=MXML ドキュメントで使用できる言語の名前空間は 1 つだけです。この属性は無視されます。
-MXMLOuterDocumentAlreadyDeclaredProblem=${outerDocument} という名前のプロパティは既に宣言されており、${fxComponent} タグの ${outerDocument} と競合します。
-MXMLPercentageNotAllowedProblem=「${property}」の初期化子 : ここでパーセントを使用することはできません : 「${text}」。
-MXMLPrivateAttributeProblem=この属性は、プライベート名前空間を使用するので無視されます。
-MXMLPrivateTagLocationProblem=<Private> タグは、ファイルのルートタグの最後の子タグである必要があります。このタグは無視されます。
-MXMLSemanticProblem=MXML のセマンティック解析中に内部エラーが発生しました
-MXMLUnexpectedAttributeProblem=この属性は無効です。この属性は無視されます。
-MXMLUnexpectedDatabindingProblem=このデータバインディング式は無効です。このデータバインディング式は無視されます。
-MXMLUnexpectedTagProblem=このタグは無効です。このタグは無視されます。
-MXMLUnexpectedTextProblem=このテキストは無効です。このテキストは無視されます。
-MXMLUnrecognizedCompilerDirectiveProblem=関数 ${functionName} は、認識されたコンパイル時ディレクティブではありません
-MXMLUnresolvedTagProblem=このタグを ActionScript クラスに解決できませんでした。このタグは無視されます。
-MXMLUnterminatedEntityProblem=終了していないエンティティが見つかりました。このエンティティは無視されます。
-MXMLXMLListMixedContentProblem=混合コンテンツをここで使用することはできません。
-MXMLXMLOnlyOneRootTagProblem=1 つのルートタグのみを使用できます
-MXMLXMLRequireContentProblem=XML コンテンツが必要です
-NamespaceInInterfaceProblem=インターフェイスでは名前空間の宣言が許可されていません。
-NativeMethodWithBodyProblem=ネイティブなメソッドにボディを含めることはできません。
-NativeNotOnFunctionProblem=${nativeStr} 属性は ${functionStr} 定義でのみ使用できます。
-NativeUsedInInterfaceProblem=${nativeStr} 属性を ${interfStr} 定義で使用することはできません。
-NativeVariableProblem=変数は ${nativeStr} 以外にしなければなりません。
-NestedGetterSetterProblem=アクセッサーを他の関数内にネストすることはできません。
-NestedPackageProblem=パッケージをネストすることはできません。
-NoCompilationUnitForDefinitionProblem=名前が「${qname}」のコンパイルユニットは見つかりませんでした。
-NoDefaultConstructorInBaseClassProblem=デフォルトのコンストラクターが基本クラス ${baseClass} に見つかりませんでした。
-NoDefinitionForSWCDependencyProblem=依存する定義 ${qname} が SWC ${swcFilename} に見つかりませんでした
-NoMainDefinitionProblem=「${qname}」という名前を持つ、外部から表示可能な定義は見つかりませんでした。
-NonConstantNamespaceProblem=名前空間の初期化子は、リテラルストリングまたは別の名前空間でなければなりません。
-NonConstantParamInitializerProblem=パラメーター初期化子が不明か、コンパイル時定数ではありません。
-NonDirectoryInSourcePathProblem=ソースパスに ${file} が指定されましたが、これはディレクトリではありません。
-NoScopesInABCCompilationUnitProblem=コンパイルユニットにスコープが見つかりません。
-OnlyOneHostComponentAllowedProblem=[HostComponent] は 1 つだけ許可されています。
-OverlappingSourcePathProblem=ソースパスエントリが重複しています : ${ancestor} は ${descendant} の祖先です
-OverrideFinalProblem=${finalStr} メソッドを再定義することはできません。
-OverrideNotFoundProblem=${overrideStr} としてマークされたメソッドは、別のメソッドをオーバーライドする必要があります。
-OverrideOutsideClassProblem=${overrideStr} 属性は ${classStr} プロパティの定義でのみ使用できます。
-PackageCannotBeUsedAsValueProblem=パッケージを値として使用することはできません : ${packageName}。
-ParserProblem=内部解析エラー
-PropertyIsWriteOnlyProblem=プロパティ ${name} は書き込み専用です。
-PrototypeInvalidAttributeProblem=プロトタイプの属性が無効です。
-RemovedConfigurationOptionProblem=「${option}」はサポートされなくなりました。今後は無効となります。
-RequiredParameterAfterOptionalProblem=必須パラメーターを任意パラメーターの後に指定することはできません。
-ResourceBundleMalformedEncodingProblem=指定されたストリングのエンコーディングの形式が正しくありません : ${string}
-ResourceBundleNoBundleParameterProblem=@Resource() にバンドルパラメーターが指定されていません
-ResourceBundleNoKeyParameterProblem=@Resource() にキーパラメーターが指定されていません
-ResourceBundleNotFoundForLocaleProblem=ロケール「${locale}」のリソースバンドル「${bundleName}」を解決できません
-ResourceBundleNotFoundProblem=リソースバンドル「${bundleName}」を解決できません
-RestParameterMustBeLastProblem=${rest} パラメーターは最後に使用する必要があります。
-ReturnCannotBeUsedInGlobalProblem=return ステートメントを global 初期化コードで使用することはできません。
-ReturnCannotBeUsedInPackageProblem=return ステートメントを package 初期化コードで使用することはできません。
-ReturnCannotBeUsedInStaticProblem=return ステートメントを static 初期化コードで使用することはできません。
-ReturnMustReturnValueProblem=関数は値を返しません。
-ReturnValueMustBeUndefinedProblem=戻り値は未定義でなければなりません。
-SemanticProblem=セマンティック解析中に内部エラーが発生しました
-SetterCannotHaveOptionalProblem=setter 定義には任意指定のパラメーターを使用できません。
-SetterMustHaveOneParameterProblem=setter 定義には 1 つのパラメーターが必要です。
-SkinPartsMustBePublicProblem=スキンパーツは public でなければなりません。
-StaticAndOverrideProblem=関数は ${staticStr} および ${overrideStr} の両方にすることはできません。
-StaticNamespaceDefinitionProblem=static 属性を ${namespaceKeyword} 定義で使用することはできません。
-StaticOutsideClassProblem=${staticStr} 属性は ${classStr} 内の定義でのみ使用できます。
-StrictUndefinedMethodProblem=未定義である可能性のあるメソッド ${methodName} を、静的型 ${className} の参照を使用して呼び出しました。
-SyntaxProblem=シンタックスエラー : ここで「${tokenText}」を使用することはできません
-ThisUsedInStaticFunctionProblem=静的メソッドで ${thisKeyword} キーワードを使用することはできません。このキーワードはインスタンスメソッド、関数クロージャおよびグローバルコードでのみ使用できます。
-TooFewFunctionParametersProblem=引数の数が正しくありません。${nParams} 個の引数が必要です
-TooManyFunctionParametersProblem=引数の数が正しくありません。${nParams} 個を超える引数を指定することはできません
-UnableToBuildReportProblem=レポートを作成できません : ${message}
-UnableToBuildSWFProblem=SWF ${file} を作成できません
-UnableToBuildSWFTagProblem=${name} の SWF タグを作成できません
-UnableToListFilesProblem=ディレクトリの内容を一覧表示できません : @{directory}
-UnboundMetadataProblem=メタデータが定義にバインドされませんでした
-UndefinedConfigNameProblem=条件付きコンパイル定数が定義されていません : 「${configName}」
-UndefinedConfigNamespaceProblem=構成名前空間が定義されていません : 「${configName}」
-UnexpectedExceptionProblem=予期しない例外「${exceptionName}」が発生しました。
-UnexpectedReturnProblem=ここで return ステートメントを使用することはできません。
-UnexpectedTokenProblem=シンタックスエラー : ${tokenKind} が必要ですが「${tokenText}」が指定されています
-UnfoundPropertyProblem=未定義のプロパティ ${property} へのアクセスです
-UnimplementedInterfaceMethodProblem=${namespaceStr} ${namespaceName} の ${interfStr} メソッド ${methodName} が ${classStr} ${className} によって実装されていません
-UnknownBreakTargetProblem=break ステートメントのターゲットが見つかりませんでした。
-UnknownContinueTargetProblem=continue ステートメントのターゲットが見つかりませんでした。
-UnknownInterfaceProblem=${interfaceStr} ${interfaceName} が見つかりませんでした。
-UnknownNamespaceProblem=${namespaceName} は不明な名前空間です。
-UnknownSuperclassProblem=基本クラス ${superclassName} の定義が見つかりませんでした。
-UnknownTypeProblem=型が見つからないか、コンパイル時定数ではありません : ${typeName}。
-UnresolvedClassReferenceProblem=定義 ${qname} が見つかりませんでした。
-UnresolvedNamespaceProblem=名前空間が見つからないか、コンパイル時定数ではありません。
-UnsupportedSourceFileProblem=${file} のタイプはサポートされていません : ${ext}
-VarInInterfaceProblem=${interfStr} では ${varStr} の宣言が許可されていません。
-VoidTypeProblem=${voidStr} は無効な型です。
-WrongSkinPartProblem=スキンパーツタイプ「${skinPartTypeName}」は「${hostSkinPartTypeName}」に割り当て可能である必要があります。

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_ko.properties
----------------------------------------------------------------------
diff --git a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_ko.properties b/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_ko.properties
deleted file mode 100644
index 8c9d11a..0000000
--- a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_ko.properties
+++ /dev/null
@@ -1,282 +0,0 @@
-################################################################################
-##
-##  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.
-##
-################################################################################
-
-ABCGeneratorProblem=${sourceFileName}에 대한 코드를 생성하는 동안 ABC 생성기 하위 시스템에서 내부 오류가 발생했습니다(${stackTrace}).
-AccessorTypesMustMatchProblem=접근자 유형이 일치해야 합니다.
-AccessUndefinedMemberProblem=정의되지 않았을 수도 있는 속성 ${memberName}을(를) 정적 유형 ${className}의 참조를 통해 액세스합니다.
-AccessUndefinedPropertyInPackageProblem=${packageName} 패키지에서 정의되지 않은 속성 ${propertyName}을(를) 액세스합니다.
-AccessUndefinedPropertyProblem=정의되지 않았을 수도 있는 속성 ${propertyName}을(를) 액세스합니다.
-AmbiguousReferenceProblem=${property}에 대한 참조가 모호합니다.
-AssignToConstProblem=상수로 지정된 변수에 대입이 잘못되었습니다.
-AssignToFunctionProblem=${funcName} 함수에 대한 대입이 잘못되었습니다.
-AssignToReadOnlyPropertyProblem=${name} 속성은 읽기 전용입니다.
-AttemptToDeleteFixedPropertyProblem=고정된 속성 ${name}을(를) 삭제하려고 합니다. 동적으로 정의된 속성만 삭제할 수 있습니다.
-AttributesAreNotCallableProblem=특성은 호출할 수 없습니다.
-BadAccessInterfaceMemberProblem=인터페이스는 public, private, protected 또는 internal로 선언될 수 없습니다.
-BadCharacterProblem=예기치 않은 문자 오류: '${errorText}'은(는) 여기에 사용할 수 없습니다.
-BadSetterReturnTypeProblem=setter 정의의 반환 유형은 지정되지 않거나 void여야 합니다.
-BaseClassIsFinalProblem=기본 클래스는 ${finalStr}입니다.
-BURMDiagnosticForEachExpectedInProblem='${k_each}' 키워드는 '${k_in}' 연산자와 함께 사용해야 합니다.
-BURMDiagnosticInvalidDecrementProblem=Decrement의 피연산자는 참조여야 합니다.
-BURMDiagnosticNotAllowedHereProblem=${node}은(는) 여기에 사용할 수 없습니다.
-BURMPatternMatchFailureProblem=${node}에 대한 코드를 생성할 수 없습니다.
-BURNDiagnosticInvalidIncrementProblem=Increment의 피연산자는 참조여야 합니다.
-CallUndefinedMethodProblem=정의되지 않았을 수도 있는 메서드 ${methodName}을(를) 호출합니다.
-CannotDeleteSuperDescendantsProblem=super 자손을 삭제할 수 없습니다.
-CannotExtendClassProblem=인터페이스는 다른 인터페이스만을 확장할 수 있지만 ${className}은(는) 클래스입니다.
-CannotExtendInterfaceProblem=${classStr}은(는) ${interfaceStr}이(가) 아닌 다른 ${classStr}만을 확장할 수 있습니다.
-CannotResolveConfigExpressionProblem=구성 상수를 확인할 수 없습니다('${configName}').
-CircularTypeReferenceProblem=${className}에서 순환 유형 참조가 감지되었습니다.
-ClassesMappedToSameRemoteAliasProblem='${className}' 클래스를 처리하는 동안 원격 클래스 별칭 '${alias}'에 대한 '${existingClassName}'의 매핑이 발견되었습니다. 이제 Flex에서는 별칭이 이미 등록되었는지를 확인하기 위해 코드를 생성합니다. 원격 데이터를 역직렬화하는 경우 별칭은 단일 클래스에만 매핑될 수 있습니다.
-ClosureProblem=Closure error.
-CodegenInternalProblem=코드 생성기 내부 오류: ${diagnostic}
-CompiledAsAComponentProblem=${className}은(는) 직접 참조되는 모듈 또는 응용 프로그램입니다. 이로 인해 ${className} 및 모든 종속 항목이 ${mainDefinition}과(와) 연결됩니다. 이를 방지하려면 인터페이스를 사용하는 것이 좋습니다.
-ConfigurationFileNotFoundProblem=구성 파일을 찾을 수 없습니다(${file}).
-ConfigurationProblem=구성 문제: ${reason}.\n${location}
-ConflictingInheritedNameInNamespaceProblem=${nsName} 네임스페이스에서 상속된 정의 ${declName}과(와) 충돌합니다.
-ConflictingNameInNamespaceProblem=${nsName} 네임스페이스에서 ${declName} 정의와 충돌합니다.
-ConstructorCannotHaveReturnTypeProblem=생성자는 반환 유형을 지정할 수 없습니다.
-ConstructorIsGetterSetterProblem=생성자는 getter 또는 setter 메서드가 될 수 없습니다
-ConstructorIsStaticProblem=생성자 함수는 인스턴스 메서드여야 합니다.
-ConstructorMustBePublicProblem=생성자는 ${modifier}(으)로만 선언될 수 있습니다.
-CountedForLoopInitializerProblem=구문 오류: 오른쪽 괄호 앞에 세미콜론이 있어야 합니다.
-CSSCodeGenProblem=CSS codegen 문제입니다. 이유: '${reason}'
-CSSEmbedAssetProblem='${embed}'의 에셋을 포함할 수 없습니다.
-CSSParserProblem=${reason}
-CSSUndefinedNamespacePrefixProblem=정의되지 않은 네임스페이스 접두어 '${prefix}'입니다.
-CSSUndefinedTypeProblem='${type}'이(가) 정의되지 않았습니다.
-CSSUnknownDefaultNamespaceProblem=네임스페이스 접두어 없이 유형 선택기를 사용하려면 기본 네임스페이스를 정의해야 합니다. ${selectorText}
-CSSUnresolvedClassReferenceProblem=${qname}이(가) 정의되지 않았습니다.
-CyclicalIncludesProblem=${file}에서 순환 포함이 발견되었습니다.
-DependencyNotCompatibleProblem=${swc}의 종속성 ${definition}에서 지원하는 최소 버전은 ${swcMinimumVersion}이며, 호환 버전인 ${compatibilityVersion}보다 높습니다.
-DeprecatedConfigurationOptionProblem='${option}'은(는) ${since} 이후 더 이상 사용되지 않습니다. '${replacement}'을(를) 사용하십시오.
-DuplicateAttributeProblem=${attrStr} 특성이 여러 번 지정되었습니다.
-DuplicateClassDefinitionProblem=중복된 클래스 정의: ${className}
-DuplicateConfigNameProblem=중복된 구성 네임스페이스: '${configName}'
-DuplicateFunctionDefinitionProblem=중복된 함수 정의: ${methodName}
-DuplicateInterfaceDefinitionProblem=중복된 인터페이스 정의: ${interfaceName}
-DuplicateInterfaceProblem=${classStr} ${className}이(가) ${interfaceStr} ${interfaceName}을(를) 여러 번 구현합니다.
-DuplicateLabelProblem=레이블 정의가 중복되었습니다.
-DuplicateNamespaceDefinitionProblem=네임스페이스 정의가 중복되었습니다.
-DuplicateQNameInSourcePathProblem=${qName}이(가) 여러 파일에 의해 정의됩니다. ${fileList} 
-DuplicateSkinStateProblem=스킨 상태 '${name}'의 선언이 중복되었습니다.
-DuplicateSourceFileProblem=${file}이(가) 포함 소스 목록에서 두 번 이상 지정되었습니다.
-DuplicateSourcePathProblem=${directory}이(가) 소스 경로에서 두 번 이상 지정되었습니다.
-DuplicateSwitchCaseProblem=스위치 대체 ${caseName}이(가) 중복되었습니다.
-DynamicNotOnClassProblem=${dynamicStr} 특성은 ${classStr} 정의에서만 사용할 수 있습니다.
-EmbedAS2TagsModifiedProblem=AS2 작업은 ${symbol} 태그에서 제거되었습니다.
-EmbedBadFontParameters=글꼴 코드 변환을 수행하려면 'fontName'과 'source', 'systemFont' 또는 'sourceList' 중 하나를 지정해야 합니다.
-EmbedBadScalingGridTargetProblem=${symbol} 심볼은 Sprite 유형이 아니므로 비율을 조정할 수 없습니다.
-EmbedCouldNotDetermineSampleFrameCountProblem=${filename} 파일에서 샘플 프레임 수를 확인할 수 없습니다.
-EmbeddedFontShadowsDeviceFontProblem=포함된 글꼴 '${alias}'은(는) 동일한 이름의 장치 글꼴을 차단할 수 있습니다. fontName을 사용하여 글꼴의 별칭을 다른 이름으로 지정하십시오.
-EmbedExceptionWhileTranscodingProblem=코드를 변환하는 동안 예외가 발생했습니다(${exception}).
-EmbedInitialValueProblem=Embed 변수에는 기존 값이 포함되어서는 안 됩니다.
-EmbedInvalidAttributeValueProblem=${value} 값은 ${attribute} 특성에 유효하지 않습니다.
-EmbedInvalidUnicodeRangeProblem=잘못된 유니코드 범위 '${range}'입니다.
-EmbedMissingSymbolProblem=${swf} 파일에서 ${symbol} 심볼을 찾을 수 없습니다.
-EmbedMovieScalingNoSymbolProblem=포함된 동영상의 비율을 조정할 때 심볼을 지정합니다.
-EmbedMultipleMetaTagsProblem=하나의 변수에는 Embed 메타데이터 태그가 하나만 포함될 수 있습니다.
-EmbedNoSkinClassProblem=스킨 에셋을 포함하는 경우 skinClass 특성을 지정해야 합니다.
-EmbedNoSourceAttributeProblem=Embed를 사용하려면 소스 파일 특성이 필요합니다.
-EmbedQualityRequiresCompressionProblem=압축을 사용하지 않는 경우 ${quality}를 지정하지 마십시오.
-EmbedQualityValueProblem=${value} 값은 ${quality} 특성에 유효하지 않습니다. 값은 0.0에서 100.0 사이여야 합니다.
-EmbedScalingGridProblem=scaleBottom, scaleLeft, scaleRight 및 scaleTop 특성은 함께 지정해야 합니다.
-EmbedScalingGridValueProblem=${attr} 특성의 비율 조정 값 ${value}은(는) 0보다 커야 합니다.
-EmbedSkinClassNotFoundProblem=${skinClass} 클래스를 찾을 수 없습니다
-EmbedSourceAttributeCouldNotBeReadProblem=포함 소스 파일 ${filename}을(를) 읽을 수 없습니다.
-EmbedSourceAttributeDoesNotExistProblem=포함 소스 파일을 찾을 수 없습니다.
-EmbedSourceFileNotFoundProblem=포함 소스 파일을 찾을 수 없습니다(${file}).
-EmbedTypeNotEmbeddableProblem=${typeName} 유형은 포함할 수 없습니다.
-EmbedUnableToBuildFontProblem=글꼴 '${fontName}'을(를) 작성할 수 없습니다.
-EmbedUnableToReadSourceProblem=코드 변환 소스 '${source}'을(를) 읽을 수 없습니다.
-EmbedUnknownAttributeProblem=알 수 없는 특성: ${attr}
-EmbedUnknownMimeTypeProblem=처리되지 않은 MIME 유형 ${mimeType}
-EmbedUnrecogniedFileTypeProblem=${file} 파일은 포함이 불가능한 알 수 없는 파일 유형입니다.
-EmbedUnsupportedAttributeProblem=${attribute} 특성은 ${mimeType} MIME 유형과 함께 사용할 수 없습니다.
-EmbedUnsupportedSamplingRateProblem=${frequency} 빈도는 ${filename} 파일에서 지원되지 않습니다.
-FileNotFoundProblem=파일을 찾을 수 없음: ${file}
-FinalOutsideClassProblem=${finalStr} 특성은 ${classStr}에서 정의된 메서드에서만 사용할 수 있습니다.
-FunctionNotMarkedOverrideProblem=${overrideStr}(으)로 표시되지 않은 ${funcStr}을(를) 재정의합니다.
-FunctionWithoutBodyProblem=함수에 본문이 없습니다.
-FXGCompilerProblem=FXG 컴파일 문제: ${message}
-GetterCannotHaveParametersProblem=getter 정의에는 매개 변수가 없어야 합니다.
-GlobalBindablePropertyProblem=[${bindableStr}]은(는) 전역 또는 ${packageStr} 변수에 사용할 수 없습니다.
-HostComponentClassNotFoundProblem=[HostComponent] 클래스 '${className}'을(를) 찾을 수 없습니다.
-HostComponentMustHaveTypeProblem=[HostComponent]은(는) 유형 이름을 지정해야 합니다.
-IllegalAssignmentToClassProblem=${className} 클래스에 대한 대입이 잘못되었습니다.
-ImplicitCoercionToSubtypeProblem=정적 유형 ${baseType}의 값을 관련되지 않았을 수도 있는 유형 ${subType}(으)로 암시적으로 강제 변환합니다.
-ImplicitCoercionToUnrelatedTypeProblem=${actualType} 유형의 값을 관련되지 않은 유형 ${expectedType}(으)로 암시적으로 강제 변환합니다.
-InaccessibleMethodReferenceProblem=액세스할 수 없는 메서드 ${methodName}을(를) 정적 유형 ${className}의 참조를 통해 액세스하려고 했습니다.
-InaccessiblePropertyReferenceProblem=액세스할 수 없는 속성 ${propertyName}을(를) 정적 유형 ${className}의 참조를 통해 액세스하려고 했습니다.
-IncompatibleDefaultValueProblem=${srcType} 유형의 호환되지 않는 기본값입니다. ${tgtType} 유형이어야 합니다.
-IncompatibleInterfaceMethodProblem=${namespaceStr} ${namespaceName}의 ${interfStr} 메서드 ${methodName}이(가) ${classStr} ${className}에서 호환되지 않는 서명으로 구현됩니다.
-IncompatibleOverrideProblem=호환되지 않는 ${overrideStr}입니다.
-InterfaceBindablePropertyProblem=[${bindableStr}]은(는) ${interfStr} 정의 내에서 사용할 수 없습니다.
-InterfaceCannotBeInstantiatedProblem=인터페이스는 새 연산자를 사용해서 인스턴스화할 수 없습니다.
-InterfaceMethodWithBodyProblem=${interfaceStr}에서 정의된 메서드는 본문을 가질 수 없습니다.
-InterfaceModifierProblem=인터페이스 특성 ${modifier}이(가) 유효하지 않습니다.
-InterfaceNamespaceAttributeProblem=네임스페이스 특성은 인터페이스 메서드에서 사용할 수 없습니다.
-InternalCompilerProblem=내부 컴파일러 오류
-InvalidABCByteCodeProblem=잘못된 ABC 바이트 코드입니다.
-InvalidBackgroundColorProblem=잘못된 배경색: ${backgroundColor}
-InvalidDecrementOperandProblem=Decrement 피연산자가 유효하지 않습니다.
-InvalidEscapeSequenceProblem='${badSequence}'은(는) 유효한 이스케이프 시퀀스가 아닙니다.
-InvalidForInInitializerProblem=구문 오류: for-in 이니셜라이저가 유효하지 않습니다. 1개의 표현식만 필요합니다.
-InvalidIncrementOperandProblem=Increment 피연산자가 유효하지 않습니다.
-InvalidLvalueProblem=대입 대상은 참조 값이어야 합니다.
-InvalidNamespaceInitializerProblem=네임스페이스 이니셜라이저는 리터럴 문자열이거나 다른 네임스페이스여야 합니다.
-InvalidNamespaceProblem=사용자 정의 네임스페이스 특성은 최상위 ${classStr} 정의에서만 사용할 수 있습니다.
-InvalidOverrideProblem=${overrideStr} 특성은 ${classStr}에서 정의된 메서드에서만 사용할 수 있습니다.
-InvalidPrivateNamespaceAttrProblem=${privateStr} 특성은 ${classStr} 속성 정의에서만 사용할 수 있습니다.
-InvalidPrivateNamespaceProblem=${privateStr}은(는) ${classStr} 내에서 네임스페이스로만 사용할 수 있습니다.
-InvalidProtectedNamespaceAttrProblem=${protectedStr} 특성은 ${classStr} 속성 정의에서만 사용할 수 있습니다.
-InvalidProtectedNamespaceProblem=${protectedStr}은(는) ${classStr} 내에서 네임스페이스로만 사용할 수 있습니다.
-InvalidPublicNamespaceAttrProblem=${publicStr} 특성은 ${packageStr} 내에서만 사용할 수 있습니다.
-InvalidPublicNamespaceProblem=${publicStr}은(는) ${packageStr} 내에서 네임스페이스로만 사용할 수 있습니다.
-InvalidRestParameterDeclarationProblem=...rest 매개 변수 정의 키워드 뒤에 지정된 매개 변수의 데이터 유형은 Array여야 합니다.
-InvalidSuperExpressionProblem=super 표현식은 클래스 인스턴스 메서드 내에서만 사용할 수 있습니다.
-InvalidSuperStatementProblem=super 문은 클래스 인스턴스 생성자 내에서만 사용할 수 있습니다.
-JSDataClassMethodError=ERROR: DataClass classes must not declare methods. 
-JSInternalCompilerProblem=Internal compiler error: ${message}. 
-JSUnsupportedFeatureProblem=Unsupported feature: ${feature}. 
-JSWarnClassInitProblem=PERFORMANCE: Avoid loose class initialization statements. Consider using singletons instead.
-JSWarnClosureAdvancedOptimizationsProblem=WARNING: Optimizing with ADVANCED_OPTIMIZATIONS will fail because of accessing properties via unknown strings.
-JSWarnRuntimeNameLookupProblem=PERFORMANCE: Forced to emit expensive runtime name lookup. Consider using strict types instead of generic objects and avoiding dynamic classes.
-LocalBindablePropertyProblem=[${bindableStr}]은(는) ${funcStr} 정의 내에서 사용할 수 없습니다.
-LossyConversionProblem=잘못된 초기화: ${targetType} 유형으로 변환하면 데이터가 손실됩니다.
-MethodCannotBeConstructorProblem=메서드는 생성자로 사용할 수 없습니다.
-MissingBuiltinProblem=기본 제공 유형 ${builtinType}이(가) 없습니다.
-MissingCatchOrFinallyProblem=구문 오류: catch 또는 finally 절이 있어야 합니다.
-MissingFactoryClassInFrameMetadataProblem=이 컴파일 단위에는 구성된 런타임 공유 라이브러리를 로드하기 위한 factoryClass가 Frame 메타데이터에 지정되지 않았습니다. 런타임 공유 라이브러리 없이 컴파일하려면 -static-link-runtime-shared-libraries 옵션을 true로 설정하거나 -runtime-shared-libraries 옵션을 제거하십시오.
-MissingRequirementConfigurationProblem=구성 변수 '${required}'이(가) 설정되지 않았습니다.
-MissingSignedDigestProblem=라이브러리(${libraryPath})의 catalog.xml에서 서명된 다이제스트를 찾을 수 없습니다.
-MissingSkinPartProblem=필수 스킨 부분 '${skinPartName}'이(가) 없습니다.
-MissingSkinStateProblem=필수 스킨 상태 '${skinStateName}'이(가) 없습니다.
-MissingUnsignedDigestProblem=라이브러리(${libraryPath})의 catalog.xml에서 서명되지 않은 다이제스트를 찾을 수 없습니다.
-MultipleConfigNamespaceDecorationsProblem=하나의 정의에서 config 네임스페이스가 중복되어서는 안 됩니다.
-MultipleSwitchDefaultsProblem=switch 문의 기본값이 두 개 이상입니다. 기본값은 한 개만 사용할 수 있습니다.
-MXMLAttributeVersionProblem='${name}' 특성은 MXML ${version} 이상에서만 사용할 수 있으므로 무시됩니다.
-MXMLClassNodeProblem='${qname}'은(는) 클래스 또는 인터페이스를 지정하지 않으므로 무시됩니다.
-MXMLDatabindingSourceNotBindableProblem=데이터 바인딩은 '${sourceName}'에 대한 대입을 감지할 수 없습니다.
-MXMLDuplicateIDProblem=이 ID는 고유한 ID가 아니므로 무시됩니다.
-MXMLFinalClassProblem='${qname}'은(는) final 클래스이며 루트 태그로 사용할 수 없습니다.
-MXMLIncludeInAndExcludeFromProblem='includeIn' 및 'excludeFrom' 특성은 이 동일한 태그에서 지정할 수 없으므로 둘 다 무시됩니다.
-MXMLIncompatibleArrayElementProblem='${actualType}' 유형의 배열 요소는 '${propertyName}' 속성에 대해 예상되는 '${expectedType}'의 [ArrayElementType]과(와) 호환되지 않습니다.
-MXMLIncompatibleVectorElementProblem=이 요소는 Vector 유형과 호환되지 않으므로 무시됩니다.
-MXMLInvalidEntityProblem=알 수 없는 엔터티 '{entity}'이(가) 발견되었으며 이 엔터티는 무시됩니다.
-MXMLInvalidIDProblem=이 ID는 유효한 ActionScript 식별자가 아니므로 무시됩니다.
-MXMLInvalidItemCreationPolicyProblem=itemCreationPolicy의 유효한 값은 'immediate' 또는 'deferred'이므로 이 특성은 무시됩니다.
-MXMLInvalidItemDestructionPolicyProblem=itemDestructionPolicy의 유효한 값은 'auto' 또는 'never'이므로 이 특성은 무시됩니다.
-MXMLInvalidPercentageProblem='${property}'에 대한 이니셜라이저: 백분율 표현식이 유효하지 않습니다('${text}').
-MXMLInvalidTextForTypeProblem='${text}'에서 '${type}' 유형의 값을 구문 분석할 수 없습니다.
-MXMLInvalidVectorFixedAttributeProblem='fixed' 특성은 'true' 또는 'false'여야 하므로 무시됩니다.
-MXMLInvalidVectorTypeAttributeProblem='type' 특성은 알려진 클래스를 지정하지 않으므로 유형이 '*'인 것으로 가정합니다.
-MXMLMissingRootTagProblem=이 MXML 파일에서 루트 태그를 찾을 수 없습니다.
-MXMLMissingVectorTypeAttributeProblem=<Vector> 태그에 'type' 특성이 필요하므로 유형이 '*'인 것으로 가정합니다.
-MXMLNotAClassProblem='${qname}'은(는) 클래스가 아니므로 이 태그는 무시됩니다.
-MXMLOperationMissingNameProblem=작업을 수행하려면 ${name} 특성이 필요합니다.
-MXMLOtherLanguageNamespaceProblem=MXML 문서에서는 언어 네임스페이스를 하나만 사용할 수 있으므로 이 특성은 무시됩니다.
-MXMLOuterDocumentAlreadyDeclaredProblem=${outerDocument} 속성이 이미 선언되었으므로 ${fxComponent} 태그의 ${outerDocument}와 충돌합니다.
-MXMLPercentageNotAllowedProblem='${property}'에 대한 이니셜라이저: 여기에는 백분율을 사용할 수 없습니다('${text}').
-MXMLPrivateAttributeProblem=이 특성은 private 네임스페이스를 사용하므로 무시됩니다.
-MXMLPrivateTagLocationProblem=<Private> 태그는 파일 루트 태그의 마지막 자식 태그여야 하므로 무시됩니다.
-MXMLSemanticProblem=MXML의 의미 분석을 수행하는 동안 내부 문제가 발생했습니다.
-MXMLUnexpectedAttributeProblem=이 특성은 예기치 않은 항목이므로 무시됩니다.
-MXMLUnexpectedDatabindingProblem=이 데이터 바인딩 표현식은 예기치 않은 항목이므로 무시됩니다.
-MXMLUnexpectedTagProblem=이 태그는 예기치 않은 항목이므로 무시됩니다.
-MXMLUnexpectedTextProblem=이 텍스트는 예기치 않은 항목이므로 무시됩니다.
-MXMLUnrecognizedCompilerDirectiveProblem=${functionName} 함수는 인식된 컴파일 타임 지시문이 아닙니다.
-MXMLUnresolvedTagProblem=이 태그는 ActionScript 클래스에 대해 확인할 수 없으므로 무시됩니다.
-MXMLUnterminatedEntityProblem=종결되지 않은 엔터티가 발견되었으며 이 엔터티는 무시됩니다.
-MXMLXMLListMixedContentProblem=여기에는 혼합된 내용을 사용할 수 없습니다.
-MXMLXMLOnlyOneRootTagProblem=루트 태그는 하나만 사용할 수 있습니다.
-MXMLXMLRequireContentProblem=XML 내용이 필요합니다.
-NamespaceInInterfaceProblem=인터페이스에서는 네임스페이스를 선언할 수 없습니다.
-NativeMethodWithBodyProblem=기본 메서드는 본문을 가질 수 없습니다.
-NativeNotOnFunctionProblem=${nativeStr} 특성은 ${functionStr} 정의에서만 사용할 수 있습니다.
-NativeUsedInInterfaceProblem=${nativeStr} 특성은 ${interfStr} 정의에서 사용할 수 없습니다.
-NativeVariableProblem=변수는 ${nativeStr}일 수 없습니다.
-NestedGetterSetterProblem=접근자는 다른 함수 내에서 중첩될 수 없습니다.
-NestedPackageProblem=패키지는 중첩될 수 없습니다.
-NoCompilationUnitForDefinitionProblem=이름이 '${qname}'인 컴파일 단위를 찾을 수 없습니다.
-NoDefaultConstructorInBaseClassProblem=기본 클래스 ${baseClass}에서 기본 생성자를 찾을 수 없습니다.
-NoDefinitionForSWCDependencyProblem=SWC ${swcFilename}에서 종속되는 정의 ${qname}을(를) 찾을 수 없습니다.
-NoMainDefinitionProblem=이름이 '${qname}'인 외부 표시 정의를 찾을 수 없습니다.
-NonConstantNamespaceProblem=네임스페이스 이니셜라이저는 리터럴 문자열이거나 다른 네임스페이스여야 합니다.
-NonConstantParamInitializerProblem=매개 변수 이니셜라이저가 알 수 없는 이니셜라이저이거나 컴파일 타임 상수가 아닙니다.
-NonDirectoryInSourcePathProblem=${file}은(는) 소스 경로에서 지정되었으며 디렉토리가 아닙니다.
-NoScopesInABCCompilationUnitProblem=컴파일 단위에서 범위를 찾을 수 없습니다.
-OnlyOneHostComponentAllowedProblem=[HostComponent]은(는) 하나만 사용할 수 있습니다.
-OverlappingSourcePathProblem=소스 경로 항목 겹침: ${ancestor}은(는) ${descendant}의 상위 항목입니다.
-OverrideFinalProblem=${finalStr} 메서드를 재정의할 수 없습니다.
-OverrideNotFoundProblem=${overrideStr}(으)로 표시된 메서드는 다른 메서드를 재정의해야 합니다.
-OverrideOutsideClassProblem=${overrideStr} 특성은 ${classStr} 속성 정의에서만 사용할 수 있습니다.
-PackageCannotBeUsedAsValueProblem=패키지는 값으로 사용할 수 없습니다(${packageName}).
-ParserProblem=내부 구문 분석 문제
-PropertyIsWriteOnlyProblem=${name} 속성은 쓰기 전용입니다.
-PrototypeInvalidAttributeProblem=프로토타입 특성이 유효하지 않습니다.
-RemovedConfigurationOptionProblem='${option}'은(는) 더 이상 지원되지 않으며 아무 효과도 없습니다.
-RequiredParameterAfterOptionalProblem=필수 매개 변수는 선택적 매개 변수 앞에 있어야 합니다.
-ResourceBundleMalformedEncodingProblem=지정된 문자열의 인코딩 형식이 잘못되었습니다(${string}).
-ResourceBundleNoBundleParameterProblem=@Resource()에 대해 지정된 번들 매개 변수가 없습니다.
-ResourceBundleNoKeyParameterProblem=@Resource()에 대해 지정된 키 매개 변수가 없습니다.
-ResourceBundleNotFoundForLocaleProblem=로캘 '${locale}'에 대한 리소스 번들 '${bundleName}'을(를) 확인할 수 없습니다.
-ResourceBundleNotFoundProblem=리소스 번들 '${bundleName}'을(를) 확인할 수 없습니다.
-RestParameterMustBeLastProblem=${rest} 매개 변수는 마지막에 와야 합니다.
-ReturnCannotBeUsedInGlobalProblem=return 문은 전역 초기화 코드에서 사용할 수 없습니다.
-ReturnCannotBeUsedInPackageProblem=return 문은 패키지 초기화 코드에서 사용할 수 없습니다.
-ReturnCannotBeUsedInStaticProblem=return 문은 정적 초기화 코드에서 사용할 수 없습니다.
-ReturnMustReturnValueProblem=함수가 값을 반환하지 않습니다.
-ReturnValueMustBeUndefinedProblem=반환값은 undefined여야 합니다.
-SemanticProblem=의미 분석을 수행하는 동안 내부 문제가 발생했습니다.
-SetterCannotHaveOptionalProblem=setter 정의에는 선택적 매개 변수가 있을 수 없습니다.
-SetterMustHaveOneParameterProblem=setter 정의에는 한 개의 매개 변수만 있어야 합니다.
-SkinPartsMustBePublicProblem=스킨 부분은 public이어야 합니다.
-StaticAndOverrideProblem=함수는 동시에 ${staticStr}이면서 ${overrideStr}일 수 없습니다.
-StaticNamespaceDefinitionProblem=static 특성은 ${namespaceKeyword} 정의에서 사용할 수 없습니다.
-StaticOutsideClassProblem=${staticStr} 특성은 ${classStr} 내의 정의에서만 사용할 수 있습니다.
-StrictUndefinedMethodProblem=정의되지 않았을 수도 있는 메서드 ${methodName}을(를) 정적 유형 ${className}의 참조를 통해 호출합니다.
-SyntaxProblem=구문 오류: '${tokenText}'은(는) 여기에 사용할 수 없습니다.
-ThisUsedInStaticFunctionProblem=${thisKeyword} 키워드는 정적 메서드에서 사용할 수 없으며 인스턴스 메서드, 함수 클로저 및 전역 코드에서만 사용할 수 있습니다.
-TooFewFunctionParametersProblem=인수 개수가 올바르지 않습니다. ${nParams}개가 필요합니다.
-TooManyFunctionParametersProblem=인수 개수가 올바르지 않습니다. ${nParams}개를 넘지 않아야 합니다.
-UnableToBuildReportProblem=보고서를 작성할 수 없음: ${message}
-UnableToBuildSWFProblem=SWF ${file}을(를) 작성할 수 없습니다.
-UnableToBuildSWFTagProblem=${name}에 대해 SWF 태그를 작성할 수 없습니다.
-UnableToListFilesProblem=디렉토리의 내용을 표시할 수 없음: @{directory}
-UnboundMetadataProblem=메타데이터가 정의에 바인딩되어 있지 않습니다.
-UndefinedConfigNameProblem=정의되지 않은 config 상수: '${configName}'
-UndefinedConfigNamespaceProblem=정의되지 않은 config 네임스페이스: '${configName}'
-UnexpectedExceptionProblem=예기치 않은 예외 '${exceptionName}'이(가) 발생했습니다.
-UnexpectedReturnProblem=return 문은 여기에 사용할 수 없습니다.
-UnexpectedTokenProblem=구문 오류: ${tokenKind}이(가) 필요하지만 '${tokenText}'을(를) 가져왔습니다.
-UnfoundPropertyProblem=정의되지 않은 속성 ${property} 액세스
-UnimplementedInterfaceMethodProblem=${namespaceStr} ${namespaceName}의 ${interfStr} 메서드 ${methodName}이(가) ${classStr} ${className}에 의해 구현되지 않습니다.
-UnknownBreakTargetProblem=break 문의 대상을 찾을 수 없습니다.
-UnknownContinueTargetProblem=continue 문의 대상을 찾을 수 없습니다.
-UnknownInterfaceProblem=${interfaceStr} ${interfaceName}을(를) 찾을 수 없습니다.
-UnknownNamespaceProblem=알 수 없는 네임스페이스 ${namespaceName}입니다.
-UnknownSuperclassProblem=기본 클래스 ${superclassName}의 정의를 찾을 수 없습니다.
-UnknownTypeProblem=유형이 없거나 컴파일 타임 상수가 아닙니다(${typeName}).
-UnresolvedClassReferenceProblem=${qname} 정의를 찾을 수 없습니다.
-UnresolvedNamespaceProblem=네임스페이스가 없거나 컴파일 타임 상수가 아닙니다.
-UnsupportedSourceFileProblem=${file}은(는) 지원되지 않는 유형입니다(${ext}).
-VarInInterfaceProblem=${varStr} 선언은 ${interfStr}에서 사용할 수 없습니다.
-VoidTypeProblem=${voidStr}은(는) 유효한 유형이 아닙니다.
-WrongSkinPartProblem=스킨 부분 유형 '${skinPartTypeName}'은(는) '${hostSkinPartTypeName}'에 대입할 수 있어야 합니다.


[10/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/clients/MXMLJSC.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/clients/MXMLJSC.java b/compiler.js/src/org/apache/flex/compiler/clients/MXMLJSC.java
deleted file mode 100644
index 1f8f070..0000000
--- a/compiler.js/src/org/apache/flex/compiler/clients/MXMLJSC.java
+++ /dev/null
@@ -1,1629 +0,0 @@
-/*
- *
- *  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.clients;
-
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.javascript.jscomp.*;
-import com.google.javascript.jscomp.Compiler;
-import org.apache.commons.io.FilenameUtils;
-import org.apache.commons.io.output.CountingOutputStream;
-import org.apache.flex.compiler.clients.problems.ProblemPrinter;
-import org.apache.flex.compiler.clients.problems.ProblemQuery;
-import org.apache.flex.compiler.clients.problems.WorkspaceProblemFormatter;
-import org.apache.flex.compiler.common.DependencyType;
-import org.apache.flex.compiler.common.VersionInfo;
-import org.apache.flex.compiler.config.*;
-import org.apache.flex.compiler.config.RSLSettings.RSLAndPolicyFileURLPair;
-import org.apache.flex.compiler.definitions.IDefinition;
-import org.apache.flex.compiler.exceptions.ConfigurationException;
-import org.apache.flex.compiler.exceptions.ConfigurationException.IOError;
-import org.apache.flex.compiler.exceptions.ConfigurationException.MustSpecifyTarget;
-import org.apache.flex.compiler.exceptions.ConfigurationException.OnlyOneSource;
-import org.apache.flex.compiler.filespecs.IFileSpecification;
-import org.apache.flex.compiler.internal.as.codegen.*;
-import org.apache.flex.compiler.internal.config.localization.LocalizationManager;
-import org.apache.flex.compiler.internal.definitions.ClassDefinition;
-import org.apache.flex.compiler.internal.driver.IBackend;
-import org.apache.flex.compiler.internal.driver.JSBackend;
-import org.apache.flex.compiler.internal.driver.JSTarget;
-import org.apache.flex.compiler.internal.graph.GoogDepsWriter;
-import org.apache.flex.compiler.internal.graph.GraphMLWriter;
-import org.apache.flex.compiler.internal.projects.*;
-import org.apache.flex.compiler.internal.projects.DefinitionPriority.BasePriority;
-import org.apache.flex.compiler.internal.resourcebundles.ResourceBundleUtils;
-import org.apache.flex.compiler.internal.scopes.ASProjectScope;
-import org.apache.flex.compiler.internal.scopes.ASProjectScope.DefinitionPromise;
-import org.apache.flex.compiler.internal.targets.LinkageChecker;
-import org.apache.flex.compiler.internal.targets.Target;
-import org.apache.flex.compiler.internal.tree.mxml.MXMLClassDefinitionNode;
-import org.apache.flex.compiler.internal.units.*;
-import org.apache.flex.compiler.internal.workspaces.Workspace;
-import org.apache.flex.compiler.problems.*;
-import org.apache.flex.compiler.projects.ICompilerProject;
-import org.apache.flex.compiler.targets.ISWFTarget;
-import org.apache.flex.compiler.targets.ITarget.TargetType;
-import org.apache.flex.compiler.targets.ITargetReport;
-import org.apache.flex.compiler.targets.ITargetSettings;
-import org.apache.flex.compiler.tree.as.IASNode;
-import org.apache.flex.compiler.units.ICompilationUnit;
-import org.apache.flex.compiler.units.ICompilationUnit.UnitType;
-import org.apache.flex.compiler.units.requests.IFileScopeRequestResult;
-import org.apache.flex.swc.ISWC;
-import org.apache.flex.swf.ISWF;
-import org.apache.flex.swf.io.ISWFWriter;
-import org.apache.flex.swf.types.Rect;
-import org.apache.flex.utils.ArgumentUtil;
-import org.apache.flex.utils.FilenameNormalization;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * The entry-point class for the FalconJS version of mxmlc.
- */
-public class MXMLJSC
-{
-    private static final String DEFAULT_VAR = "file-specs";
-    private static final String L10N_CONFIG_PREFIX = "flex2.configuration";
-    private static final int TWIPS_PER_PIXEL = 20;
-
-    /*
-     * Exit code enumerations.
-     */
-    static enum ExitCode
-    {
-        SUCCESS(0),
-        PRINT_HELP(1),
-        FAILED_WITH_PROBLEMS(2),
-        FAILED_WITH_EXCEPTIONS(3),
-        FAILED_WITH_CONFIG_PROBLEMS(4);
-
-        ExitCode(int code)
-        {
-            this.code = code;
-        }
-
-        final int code;
-    }
-
-    /**
-     * Java program entry point.
-     * 
-     * @param args command line arguments
-     */
-    public static void main(final String[] args)
-    {
-        long startTime = System.nanoTime();
-
-        final IBackend backend = new JSBackend();
-        final MXMLJSC mxmlc = new MXMLJSC(backend);
-        final Set<ICompilerProblem> problems = new HashSet<ICompilerProblem>();
-        final int exitCode = mxmlc.mainNoExit(args, problems, true);
-
-        long endTime = System.nanoTime();
-        JSSharedData.instance.stdout((endTime - startTime) / 1e9 + " seconds");
-
-        System.exit(exitCode);
-    }
-
-    public static int mainNoExit(final String[] args, List<ICompilerProblem> problemList)
-    {
-        final IBackend backend = new JSBackend();
-        final MXMLJSC mxmlc = new MXMLJSC(backend);
-        final Set<ICompilerProblem> problems = new HashSet<ICompilerProblem>();
-        final int exitCode = mxmlc.mainNoExit(args, problems, problemList == null);
-        if (problemList != null)
-            problemList.addAll(problems);
-        return exitCode;
-    }
-
-    public int mainNoExit(final String[] args, Set<ICompilerProblem> problems, Boolean printProblems)
-    {
-        int exitCode = -1;
-        try
-        {
-            exitCode = _mainNoExit(ArgumentUtil.fixArgs(args), problems);
-        }
-        catch (Exception e)
-        {
-            JSSharedData.instance.stderr(e.toString());
-        }
-        finally
-        {
-            if (problems != null && !problems.isEmpty())
-            {
-                if (printProblems)
-                {
-                    final WorkspaceProblemFormatter formatter = new WorkspaceProblemFormatter(workspace);
-                    final ProblemPrinter printer = new ProblemPrinter(formatter);
-                    printer.printProblems(problems);
-                }
-            }
-        }
-        return exitCode;
-    }
-
-    /**
-     * Entry point that doesn't call <code>System.exit()</code>. This is for
-     * unit testing.
-     * 
-     * @param args command line arguments
-     * @return exit code
-     */
-    private int _mainNoExit(final String[] args, Set<ICompilerProblem> outProblems)
-    {
-        ExitCode exitCode = ExitCode.SUCCESS;
-        try
-        {
-            final boolean continueCompilation = configure(args);
-
-            if (outProblems != null && !config.isVerbose())
-                JSSharedData.STDOUT = JSSharedData.STDERR = null;
-
-            if (continueCompilation)
-            {
-                compile();
-                if (problems.hasFilteredProblems())
-                    exitCode = ExitCode.FAILED_WITH_PROBLEMS;
-            }
-            else if (problems.hasFilteredProblems())
-            {
-                exitCode = ExitCode.FAILED_WITH_CONFIG_PROBLEMS;
-            }
-            else
-            {
-                exitCode = ExitCode.PRINT_HELP;
-            }
-        }
-        catch (Exception e)
-        {
-            if (outProblems == null)
-                JSSharedData.instance.stderr(e.getMessage());
-            else
-            {
-                final ICompilerProblem unexpectedExceptionProblem = new UnexpectedExceptionProblem(e);
-                problems.add(unexpectedExceptionProblem);
-            }
-            exitCode = ExitCode.FAILED_WITH_EXCEPTIONS;
-        }
-        finally
-        {
-            waitAndClose();
-
-            if (outProblems != null && problems.hasFilteredProblems())
-            {
-                for (ICompilerProblem problem : problems.getFilteredProblems())
-                {
-                    outProblems.add(problem);
-                }
-            }
-        }
-        return exitCode.code;
-    }
-
-    protected MXMLJSC(IBackend backend)
-    {
-        JSSharedData.backend = backend;
-        workspace = new Workspace();
-        project = new FlexJSProject(workspace);
-        MXMLClassDefinitionNode.GENERATED_ID_BASE = "$ID";
-        problems = new ProblemQuery();
-        JSSharedData.OUTPUT_EXTENSION = backend.getOutputExtension();
-        JSSharedData.workspace = workspace;
-        asFileHandler = backend.getSourceFileHandlerInstance();
-    }
-
-    protected Workspace workspace;
-    protected FlexProject project;
-    protected Configuration config;
-    protected ProblemQuery problems;
-    private ConfigurationBuffer configBuffer;
-
-    protected Configurator projectConfigurator;
-
-    protected ICompilationUnit mainCU;
-    protected JSTarget target;
-    private ITargetSettings targetSettings;
-    private ISWF swfTarget;
-
-    private Collection<ICompilationUnit> includedResourceBundleCompUnits;
-    protected ISourceFileHandler asFileHandler;
-
-    /**
-     * Print a message.
-     * 
-     * @param msg Message text.
-     */
-    public void println(final String msg)
-    {
-        JSSharedData.instance.stdout(msg);
-    }
-
-    /**
-     * Wait till the workspace to finish compilation and close.
-     */
-    protected void waitAndClose()
-    {
-        workspace.startIdleState();
-        try
-        {
-            workspace.close();
-        }
-        finally
-        {
-            workspace.endIdleState(Collections.<ICompilerProject, Set<ICompilationUnit>> emptyMap());
-        }
-    }
-
-    /**
-     * Force terminate the compilation process.
-     */
-    protected void close()
-    {
-        workspace.close();
-    }
-
-    /**
-     * Create a new Configurator. This method may be overridden to allow
-     * Configurator subclasses to be created that have custom configurations.
-     * 
-     * @return a new instance or subclass of {@link Configurator}.
-     */
-    protected Configurator createConfigurator()
-    {
-        return JSSharedData.backend.createConfigurator();
-    }
-
-    /**
-     * Load configurations from all the sources.
-     * 
-     * @param args command line arguments
-     * @return True if mxmlc should continue with compilation.
-     */
-    protected boolean configure(final String[] args)
-    {
-        project.getSourceCompilationUnitFactory().addHandler(asFileHandler);
-        CodeGeneratorManager.setFactory(JSGenerator.getABCGeneratorFactory());
-        projectConfigurator = createConfigurator();
-
-        try
-        {
-            // Print brief usage if no arguments provided.
-            if (args.length == 0)
-            {
-                final String usage = CommandLineConfigurator.brief(
-                        getProgramName(), DEFAULT_VAR, LocalizationManager.get(), L10N_CONFIG_PREFIX);
-                if (usage != null)
-                    println(usage);
-                return false;
-            }
-
-            projectConfigurator.setConfiguration(args, ICompilerSettingsConstants.FILE_SPECS_VAR);
-            projectConfigurator.applyToProject(project);
-            problems = new ProblemQuery(projectConfigurator.getCompilerProblemSettings());
-
-            // Get the configuration and configBuffer which are now initialized.
-            config = projectConfigurator.getConfiguration();
-            configBuffer = projectConfigurator.getConfigurationBuffer();
-            problems.addAll(projectConfigurator.getConfigurationProblems());
-
-            // Print version if "-version" is present.
-            if (configBuffer.getVar("version") != null) //$NON-NLS-1$
-            {
-                println(VersionInfo.buildMessage() + " (" + JSSharedData.COMPILER_VERSION + ")");
-                return false;
-            }
-
-            // Print help if "-help" is present.
-            final List<ConfigurationValue> helpVar = configBuffer.getVar("help"); //$NON-NLS-1$
-            if (helpVar != null)
-            {
-                processHelp(helpVar);
-                return false;
-            }
-
-            for (String fileName : projectConfigurator.getLoadedConfigurationFiles())
-            {
-                JSSharedData.instance.stdout("Loading configuration: " + fileName);
-            }
-
-            if (config.isVerbose())
-            {
-                for (final IFileSpecification themeFile : project.getThemeFiles())
-                {
-                    JSSharedData.instance.stdout(String.format("Found theme file %s", themeFile.getPath()));
-                }
-            }
-
-            // If we have configuration errors then exit before trying to 
-            // validate the target.
-            if (problems.hasErrors())
-                return false;
-
-            validateTargetFile();
-            return true;
-        }
-        catch (ConfigurationException e)
-        {
-            final ICompilerProblem problem = new ConfigurationProblem(e);
-            problems.add(problem);
-            return false;
-        }
-        catch (Exception e)
-        {
-            final ICompilerProblem problem = new ConfigurationProblem(null, -1, -1, -1, -1, e.getMessage());
-            problems.add(problem);
-            return false;
-        }
-        finally
-        {
-            // If we couldn't create a configuration, then create a default one
-            // so we can exit without throwing an exception.
-            if (config == null)
-            {
-                config = new Configuration();
-                configBuffer = new ConfigurationBuffer(Configuration.class, Configuration.getAliases());
-            }
-        }
-    }
-
-    /**
-     * Validate target file.
-     * 
-     * @throws MustSpecifyTarget
-     * @throws IOError
-     */
-    protected void validateTargetFile() throws ConfigurationException
-    {
-        if (mainCU instanceof ResourceModuleCompilationUnit)
-            return; //when compiling a Resource Module, no target file is defined.
-
-        final String targetFile = config.getTargetFile();
-        if (targetFile == null)
-            throw new ConfigurationException.MustSpecifyTarget(null, null, -1);
-
-        final File file = new File(targetFile);
-        if (!file.exists())
-            throw new ConfigurationException.IOError(targetFile);
-    }
-
-    /**
-     * Main body of this program. This method is called from the public static
-     * method's for this program.
-     * 
-     * @return true if compiler succeeds
-     * @throws IOException
-     * @throws InterruptedException
-     */
-    protected boolean compile()
-    {
-    	ArrayList<String> otherFiles = new ArrayList<String>();
-    	
-        boolean compilationSuccess = false;
-        try
-        {
-            setupJS();
-            if (!setupTargetFile())
-                return false;
-
-            if (config.isDumpAst())
-                dumpAST();
-
-            buildArtifact();
-
-            final File outputFile = new File(getOutputFilePath());
-            final File outputFolder = outputFile.getParentFile();
-            if (!outputFolder.exists())
-            {
-            	outputFolder.mkdirs();
-            }
-            
-            if (swfTarget != null)
-            {
-                Collection<ICompilerProblem> errors = new ArrayList<ICompilerProblem>();
-                Collection<ICompilerProblem> warnings = new ArrayList<ICompilerProblem>();
-                
-                // Don't create a swf if there are errors unless a 
-                // developer requested otherwise.
-                if (!config.getCreateTargetWithErrors())
-                {
-                    problems.getErrorsAndWarnings(errors, warnings);
-                    if (errors.size() > 0)
-                        return false;
-                }
-
-                final int swfSize = writeSWF(swfTarget, outputFile);
-
-                println(String.format("%d bytes written to %s", swfSize, outputFile.getCanonicalPath()));
-                
-                if (JSSharedData.OUTPUT_ISOLATED)
-                {
-                    List<ICompilationUnit> reachableCompilationUnits = project.getReachableCompilationUnitsInSWFOrder(ImmutableSet.of(mainCU));
-                    for (final ICompilationUnit cu : reachableCompilationUnits)
-                    {
-                    	if ((cu.getCompilationUnitType() == UnitType.AS_UNIT || 
-                    			cu.getCompilationUnitType() == UnitType.MXML_UNIT) && cu != mainCU)
-                    	{
-		                	final File outputClassFile = new File(outputFolder.getAbsolutePath() + File.separator + cu.getShortNames().get(0) + ".js");
-		                	System.out.println(outputClassFile.getAbsolutePath());
-		                	otherFiles.add(outputClassFile.getAbsolutePath());
-		                    final ISWFWriter swfWriter = JSSharedData.backend.createJSWriter(project, (List<ICompilerProblem>) errors, ImmutableSet.of(cu), false);
-		
-		                    if (swfWriter instanceof JSWriter)
-		                    {
-		                        final JSWriter writer = (JSWriter)swfWriter;
-		
-		                        final CountingOutputStream output =
-		                                new CountingOutputStream(new BufferedOutputStream(new FileOutputStream(outputClassFile)));
-		                        writer.writeTo(output);
-		                        output.flush();
-		                        output.close();
-		                        writer.close();
-		                    }
-	                    }
-                    }
-                }
-            }
-
-            dumpDependencyGraphIfNeeded();
-
-            generateGoogDepsIfNeeded(outputFile.getParentFile());
-            
-            compilationSuccess = true;
-            
-            if (JSSharedData.OPTIMIZE)
-            {
-            	compilationSuccess = closureCompile(outputFile, problems);
-            	if (compilationSuccess)
-            	{
-            		for (String fn : otherFiles)
-            		{
-            			File f = new File(fn);
-            			f.delete();
-            		}
-            	}
-            }
-            
-
-        }
-        catch (Exception e)
-        {
-            final ICompilerProblem problem = new InternalCompilerProblem(e);
-            problems.add(problem);
-        }
-        return compilationSuccess;
-    }
-
-    /**
-     * Setup theme files.
-     */
-    protected void setupThemeFiles()
-    {
-        project.setThemeFiles(toFileSpecifications(config.getCompilerThemeFiles(), workspace));
-
-        if (config.isVerbose())
-        {
-            for (final IFileSpecification themeFile : project.getThemeFiles())
-            {
-                verboseMessage(String.format("Found theme file %s", themeFile.getPath()));
-            }
-        }
-    }
-
-    /**
-     * Setup {@code -compatibility-version} level. Falcon only support Flex 3+.
-     */
-    protected void setupCompatibilityVersion()
-    {
-        final int compatibilityVersion = config.getCompilerMxmlCompatibilityVersion();
-        if (compatibilityVersion < Configuration.MXML_VERSION_3_0)
-            throw new UnsupportedOperationException("Unsupported compatibility version: " + config.getCompilerCompatibilityVersionString());
-        this.project.setCompatibilityVersion(
-                config.getCompilerMxmlMajorCompatibilityVersion(),
-                config.getCompilerMxmlMinorCompatibilityVersion(),
-                config.getCompilerMxmlRevisionCompatibilityVersion());
-    }
-
-    /**
-     * Parse all source files and dumpAST
-     * 
-     * @throws InterruptedException
-     */
-    private void dumpAST() throws InterruptedException
-    {
-        final List<String> astDump = new ArrayList<String>();
-        final ImmutableList<ICompilationUnit> compilationUnits = getReachableCompilationUnits();
-        for (final ICompilationUnit compilationUnit : compilationUnits)
-        {
-            final IASNode ast = compilationUnit.getSyntaxTreeRequest().get().getAST();
-            astDump.add(ast.toString());
-        }
-
-        println(Joiner.on("\n\n").join(astDump)); //$NON-NLS-1$
-    }
-
-    /**
-     * Build target artifact.
-     * 
-     * @throws InterruptedException threading error
-     * @throws IOException IO error
-     * @throws ConfigurationException
-     */
-    protected void buildArtifact() throws InterruptedException, IOException, ConfigurationException
-    {
-        swfTarget = buildSWFModel();
-    }
-
-    /**
-     * Build SWF model object and collect problems building SWF in
-     * {@link #problems}.
-     * 
-     * @return SWF model or null if SWF can't be built.
-     * @throws InterruptedException concurrency problem
-     * @throws ConfigurationException
-     * @throws FileNotFoundException
-     */
-    private ISWF buildSWFModel() throws InterruptedException, FileNotFoundException, ConfigurationException
-    {
-        final List<ICompilerProblem> problemsBuildingSWF =
-                new ArrayList<ICompilerProblem>();
-
-        final ISWF swf = buildSWF(project, config.getMainDefinition(), mainCU, problemsBuildingSWF);
-        problems.addAll(problemsBuildingSWF);
-        if (swf == null)
-        {
-            ICompilerProblem problem = new UnableToBuildSWFProblem(getOutputFilePath());
-            problems.add(problem);
-        }
-        else
-        {
-            swf.setFrameRate(config.getDefaultFrameRate());
-            final int swfWidth = config.getDefaultWidth() * TWIPS_PER_PIXEL;
-            final int swfHeight = config.getDefaultHeight() * TWIPS_PER_PIXEL;
-            swf.setFrameSize(new Rect(swfWidth, swfHeight));
-            swf.setVersion(config.getSwfVersion());
-            swf.setTopLevelClass(config.getMainDefinition());
-            swf.setUseAS3(true);
-        }
-
-        reportRequiredRSLs(target);
-
-        return swf;
-    }
-
-    private void reportRequiredRSLs(ISWFTarget target) throws FileNotFoundException, InterruptedException, ConfigurationException
-    {
-        // Report the required RSLs:
-        if (hasRSLs())
-        {
-            ITargetReport report = target.getTargetReport();
-
-            if (report == null)
-                return; // target must not have been built.
-
-            // TODO (dloverin): localize messages
-            JSSharedData.instance.stdout("Required RSLs:");
-
-            // loop thru the RSLs and print out the required RSLs.
-            for (RSLSettings rslSettings : report.getRequiredRSLs())
-            {
-                List<RSLAndPolicyFileURLPair> rslUrls = rslSettings.getRSLURLs();
-
-                switch (rslUrls.size())
-                {
-                    case 0:
-                        assert false; // One RSL URL is required.
-                        break;
-                    case 1:
-                        JSSharedData.instance.stdout("    " + rslUrls.get(0).getRSLURL());
-                        //ThreadLocalToolkit.log(new RequiredRSLUrl(rslUrls.get(0)));                    
-                        break;
-                    case 2:
-                        JSSharedData.instance.stdout("    " + rslUrls.get(0).getRSLURL() + " with 1 failover.");
-                        //ThreadLocalToolkit.log(new RequiredRSLUrlWithFailover(rslUrls.get(0)));
-                        break;
-                    default:
-                        JSSharedData.instance.stdout("    " + rslUrls.get(0).getRSLURL() + " with " + (rslUrls.size() - 1) + " failovers.");
-                        //                            ThreadLocalToolkit.log(new RequiredRSLUrlWithMultipleFailovers(
-                        //                                    rslUrls.get(0),
-                        //                                    rslUrls.size() - 1));
-                        break;
-                }
-
-            }
-
-            // All -runtime-shared-libraries are required
-            for (String rslUrl : targetSettings.getRuntimeSharedLibraries())
-            {
-                JSSharedData.instance.stdout("    " + rslUrl);
-                //ThreadLocalToolkit.log(new RequiredRSLUrl(rslUrls.get(0)));                    
-            }
-        }
-    }
-
-    private ITargetSettings getTargetSettings()
-    {
-        if (targetSettings == null)
-            targetSettings = projectConfigurator.getTargetSettings(TargetType.SWF);
-
-        return targetSettings;
-    }
-
-    private boolean hasRSLs() throws FileNotFoundException, InterruptedException, ConfigurationException
-    {
-        return (getTargetSettings().getRuntimeSharedLibraryPath().size() > 0) ||
-               (getTargetSettings().getRuntimeSharedLibraryPath().size() > 0);
-    }
-
-    /**
-     * Write out SWF file and return file size in bytes.
-     * 
-     * @param swf SWF model
-     * @param outputFile output SWF file handle
-     * @return SWF file size in bytes
-     * @throws FileNotFoundException error
-     * @throws IOException error
-     */
-    private int writeSWF(final ISWF swf, final File outputFile) throws FileNotFoundException, IOException
-    {
-        int swfSize = 0;
-        final List<ICompilerProblem> problemList = new ArrayList<ICompilerProblem>();
-        final ISWFWriter swfWriter = JSSharedData.backend.createSWFWriter(project, problemList, swf, false, config.debug());
-
-        if (swfWriter instanceof JSWriter)
-        {
-            final JSWriter writer = (JSWriter)swfWriter;
-
-            final CountingOutputStream output =
-                    new CountingOutputStream(new BufferedOutputStream(new FileOutputStream(outputFile)));
-            writer.writeTo(output);
-            output.flush();
-            output.close();
-            writer.close();
-            swfSize = output.getCount();
-        }
-
-        /*
-         * W#3047880 falconjs_cs6: internal compiler error generated with
-         * optimize enabled compiling as3_enumerate.fla and fails to release the
-         * JS file http://watsonexp.corp.adobe.com/#bug=3047880 This is part #3
-         * of the fix: The closure compiler throws RTEs on internal compiler
-         * errors, that don't get caught until they bubble up to MXMLJSC's
-         * scope. On their way out files remain unclosed and cause problems,
-         * because Flame cannot delete open files. We now get
-         * InternalCompilerProblems, which we need to transfer to our problem
-         * list.
-         */
-        problems.addAll(problemList);
-
-        return swfSize;
-    }
-
-    /**
-     * Computes the set of compilation units that root the dependency walk. The
-     * returned set of compilation units and their dependencies will be
-     * compiled.
-     * <p>
-     * This method can be overriden by sub-classes.
-     * 
-     * @return The set of rooted {@link ICompilationUnit}'s.
-     */
-    protected ImmutableSet<ICompilationUnit> getRootedCompilationUnits()
-    {
-        return ImmutableSet.of(mainCU);
-    }
-
-    /**
-     * @return All the reachable compilation units in this job.
-     */
-    protected ImmutableList<ICompilationUnit> getReachableCompilationUnits()
-    {
-        final Set<ICompilationUnit> root = getRootedCompilationUnits();
-        final List<ICompilationUnit> reachableCompilationUnitsInSWFOrder =
-                project.getReachableCompilationUnitsInSWFOrder(root);
-        final ImmutableList<ICompilationUnit> compilationUnits = ImmutableList.<ICompilationUnit> copyOf(reachableCompilationUnitsInSWFOrder);
-        return compilationUnits;
-    }
-
-    /**
-     * Mxmlc uses target file as the main compilation unit and derive the output
-     * SWF file name from this file.
-     * 
-     * @return true if successful, false otherwise.
-     * @throws OnlyOneSource
-     * @throws InterruptedException
-     */
-    protected boolean setupTargetFile() throws InterruptedException
-    {
-        final String mainFileName = config.getTargetFile();
-
-        if (mainFileName != null)
-        {
-            final String normalizedMainFileName = FilenameNormalization.normalize(mainFileName);
-
-            // Can not add a SourceHandler for *.css file because we don't want
-            // to create compilation units for CSS files on the source path.
-            if (mainFileName.toLowerCase().endsWith(".css")) //$NON-NLS-1$
-            {
-                mainCU = new StyleModuleCompilationUnit(
-                        project,
-                        workspace.getFileSpecification(normalizedMainFileName),
-                        BasePriority.SOURCE_LIST);
-                // TODO: Use CSS file name once CSS module runtime code is finalized. (scai)
-                config.setMainDefinition("CSSModule2Main"); //$NON-NLS-1$
-                project.addCompilationUnitsAndUpdateDefinitions(
-                        Collections.singleton(mainCU));
-            }
-            else
-            {
-                final SourceCompilationUnitFactory compilationUnitFactory =
-                        project.getSourceCompilationUnitFactory();
-
-                File normalizedMainFile = new File(normalizedMainFileName);
-                if (compilationUnitFactory.canCreateCompilationUnit(normalizedMainFile))
-                {
-                    project.addIncludeSourceFile(normalizedMainFile);
-
-                    // just using the basename is obviously wrong:
-                    // final String mainQName = FilenameUtils.getBaseName(normalizedMainFile);
-
-                    final List<String> sourcePath = config.getCompilerSourcePath();
-                    String mainQName = null;
-                    if (sourcePath != null && !sourcePath.isEmpty())
-                    {
-                        for (String path : sourcePath)
-                        {
-                            final String otherPath = new File(path).getAbsolutePath();
-                            if (mainFileName.startsWith(otherPath))
-                            {
-                                mainQName = mainFileName.substring(otherPath.length() + 1);
-                                mainQName = mainQName.replaceAll("\\\\", "/");
-                                mainQName = mainQName.replaceAll("\\/", ".");
-                                if (mainQName.endsWith(".as"))
-                                    mainQName = mainQName.substring(0, mainQName.length() - 3);
-                                break;
-                            }
-                        }
-                    }
-
-                    if (mainQName == null)
-                        mainQName = FilenameUtils.getBaseName(mainFileName);
-
-                    Collection<ICompilationUnit> mainFileCompilationUnits =
-                            workspace.getCompilationUnits(normalizedMainFileName, project);
-
-                    assert mainFileCompilationUnits.size() == 1;
-                    mainCU = Iterables.getOnlyElement(mainFileCompilationUnits);
-
-                    assert ((DefinitionPriority)mainCU.getDefinitionPriority()).getBasePriority() == DefinitionPriority.BasePriority.SOURCE_LIST;
-
-                    // Use main source file name as the root class name.
-                    config.setMainDefinition(mainQName);
-                }
-            }
-        }
-        else
-        {
-            final List<ICompilerProblem> resourceBundleProblems = new ArrayList<ICompilerProblem>();
-            Collection<ICompilationUnit> includedResourceBundles = target.getIncludedResourceBundlesCompilationUnits(resourceBundleProblems);
-            problems.addAll(resourceBundleProblems);
-
-            if (includedResourceBundles.size() > 0)
-            {
-                //This means that a Resource Module is requested to be built.
-                mainCU = new ResourceModuleCompilationUnit(project, "GeneratedResourceModule", //$NON-NLS-1$
-                        includedResourceBundles,
-                        BasePriority.SOURCE_LIST);
-                config.setMainDefinition("GeneratedResourceModule"); //$NON-NLS-1$
-                project.addCompilationUnitsAndUpdateDefinitions(
-                        Collections.singleton(mainCU));
-            }
-        }
-
-        Preconditions.checkNotNull(mainCU, "Main compilation unit can't be null"); //$NON-NLS-1$
-
-        /*
-         * final String mainFileName = new
-         * File(config.getTargetFile()).getAbsolutePath(); final
-         * SourceCompilationUnitFactory compilationUnitFactory =
-         * project.getSourceCompilationUnitFactory(); final File mainFile = new
-         * File(mainFileName); // just using the basename is obviously wrong: //
-         * final String mainQName = FilenameUtils.getBaseName(mainFileName);
-         * final List<String> sourcePath = config.getCompilerSourcePath();
-         * String mainQName = null; if( sourcePath != null &&
-         * !sourcePath.isEmpty() ) { for( String path : sourcePath ) { final
-         * String otherPath = new File(path).getAbsolutePath(); if(
-         * mainFileName.startsWith(otherPath) ) { mainQName =
-         * mainFileName.substring(otherPath.length() + 1); mainQName =
-         * mainQName.replaceAll("\\\\", "/"); mainQName =
-         * mainQName.replaceAll("\\/", "."); if( mainQName.endsWith(".as") )
-         * mainQName = mainQName.substring(0, mainQName.length() - 3); break; }
-         * } } if( mainQName == null ) mainQName =
-         * FilenameUtils.getBaseName(mainFileName); mainCU =
-         * compilationUnitFactory.createCompilationUnit( mainFile,
-         * DefinitionPriority.BasePriority.SOURCE_LIST, mainQName, null);
-         * Preconditions.checkNotNull(mainCU,
-         * "Main compilation unit can't be null");
-         * project.addCompilationUnitsAndUpdateDefinitions(
-         * Collections.singleton(mainCU)); // Use main source file name as the
-         * root class name. config.setMainDefinition(mainQName);
-         */
-
-        // target = (FlexSWFTarget)project.createSWFTarget(getTargetSettings(), null);
-        if (getTargetSettings() == null)
-            return false;
-
-        project.setTargetSettings(getTargetSettings());
-        target = (JSTarget)JSSharedData.backend.createSWFTarget(project, getTargetSettings(), null);
-
-        return true;
-    }
-
-    /**
-     * @return a list of resource bundle compilation units that are included
-     * into the build process by -include-resource-bundles compiler argument.
-     */
-    protected Collection<ICompilationUnit> getIncludedResourceBundlesCompUnits() throws InterruptedException
-    {
-        Collection<ICompilerProblem> bundleProblems = new ArrayList<ICompilerProblem>();
-        if (includedResourceBundleCompUnits == null)
-        {
-            includedResourceBundleCompUnits = new HashSet<ICompilationUnit>();
-
-            for (String bundleName : config.getIncludeResourceBundles())
-            {
-                includedResourceBundleCompUnits.addAll(ResourceBundleUtils.findCompilationUnits(bundleName, project, bundleProblems));
-                problems.addAll(bundleProblems);
-            }
-        }
-
-        return includedResourceBundleCompUnits;
-    }
-
-    /**
-     * Setup the source paths.
-     * 
-     * @throws InterruptedException
-     */
-    /**
-     * Setup the source paths.
-     * 
-     * @throws InterruptedException
-     */
-    protected void setupSourcePath() throws InterruptedException
-    {
-        project.setSourcePath(toFiles(config.getCompilerSourcePath()));
-    }
-
-    /**
-     * Setups the locale related settings.
-     */
-    protected void setupLocaleSettings()
-    {
-        project.setLocales(config.getCompilerLocales());
-        project.setLocaleDependentResources(config.getLocaleDependentSources());
-    }
-
-    /**
-     * Get the output file path. If {@code -output} is specified, use its value;
-     * otherwise, use the same base name as the target file.
-     * 
-     * @return output file path
-     */
-    private String getOutputFilePath()
-    {
-        if (config.getOutput() == null)
-        {
-            final String extension = "." + JSSharedData.OUTPUT_EXTENSION;
-            return FilenameUtils.removeExtension(config.getTargetFile()).concat(extension);
-        }
-        else
-            return config.getOutput();
-    }
-
-    private void verboseMessage(String s)
-    {
-        if (config.isVerbose())
-            println(s);
-    }
-
-    /**
-     * Convert file path strings to {@code File} objects. Null values are
-     * discarded.
-     * 
-     * @param fileSpecs file specifications
-     * @return List of File objects. No null values will be returned.
-     */
-    public static List<File> toFiles(final List<String> paths)
-    {
-        final List<File> result = new ArrayList<File>();
-        for (final String path : paths)
-        {
-            if (path != null)
-                result.add(new File(path));
-        }
-        return result;
-    }
-
-    /**
-     * Resolve a list of normalized paths to {@link IFileSpecification} objects
-     * from the given {@code workspace}.
-     * 
-     * @param paths A list of normalized paths.
-     * @param workspace Workspace.
-     * @return A list of file specifications.
-     */
-    public static List<IFileSpecification> toFileSpecifications(
-            final List<String> paths,
-            final Workspace workspace)
-    {
-        return Lists.transform(paths, new Function<String, IFileSpecification>()
-        {
-            @Override
-            public IFileSpecification apply(final String path)
-            {
-                return workspace.getFileSpecification(path);
-            }
-        });
-    }
-
-    /**
-     * Get my program name.
-     * 
-     * @return always "mxmlc".
-     */
-    protected String getProgramName()
-    {
-        return "mxmljsc"; //$NON-NLS-1$
-    }
-
-    /**
-     * Print detailed help information if -help is provided.
-     */
-    private void processHelp(final List<ConfigurationValue> helpVar)
-    {
-        final Set<String> keywords = new LinkedHashSet<String>();
-        for (final ConfigurationValue val : helpVar)
-        {
-            for (final Object element : val.getArgs())
-            {
-                String keyword = (String)element;
-                while (keyword.startsWith("-")) //$NON-NLS-1$
-                    keyword = keyword.substring(1);
-                keywords.add(keyword);
-            }
-        }
-
-        if (keywords.size() == 0)
-            keywords.add("help"); //$NON-NLS-1$
-
-        final String usages = CommandLineConfigurator.usage(
-                getProgramName(),
-                DEFAULT_VAR,
-                configBuffer,
-                keywords,
-                LocalizationManager.get(),
-                L10N_CONFIG_PREFIX);
-        println(usages);
-    }
-
-    /**
-     * "compc" subclass will override this method.
-     * 
-     * @return False if the client is not "compc".
-     */
-    protected boolean isCompc()
-    {
-        return false;
-    }
-
-    private void dumpDependencyGraphIfNeeded() throws IOException, InterruptedException, ConfigurationException
-    {
-        File dependencyGraphOutput = config.getDependencyGraphOutput();
-        if (dependencyGraphOutput != null)
-        {
-            LinkedList<ICompilerProblem> problemList = new LinkedList<ICompilerProblem>();
-            LinkageChecker linkageChecker = new LinkageChecker(project, getTargetSettings());
-            final Target.RootedCompilationUnits rootedCompilationUnits = target.getRootedCompilationUnits();
-            problems.addAll(rootedCompilationUnits.getProblems());
-            GraphMLWriter dependencyGraphWriter =
-                    new GraphMLWriter(project.getDependencyGraph(),
-                            rootedCompilationUnits.getUnits(), true,
-                            linkageChecker);
-            BufferedOutputStream graphStream = new BufferedOutputStream(new FileOutputStream(dependencyGraphOutput));
-            dependencyGraphWriter.writeToStream(graphStream, problemList);
-            problems.addAll(problemList);
-        }
-    }
-
-    // see http://blog.bolinfest.com/2009/11/calling-closure-compiler-from-java.html
-    private boolean closureCompile(File outputFile, ProblemQuery problems) throws IOException
-    {
-        /*
-         * <arg value="--compilation_level=ADVANCED_OPTIMIZATIONS"/> <arg value=
-         * "--externs=${falcon-sdk}/lib/google/closure-compiler/contrib/externs/jquery-1.5.js"
-         * /> <arg value=
-         * "--externs=${falcon-sdk}/lib/google/closure-compiler/contrib/externs/svg.js"
-         * /> <arg value=
-         * "--externs=${falcon-sdk}/lib/google/closure-compiler/contrib/externs/jsTestDriver.js"
-         * /> <arg value="--formatting=PRETTY_PRINT"/> <arg
-         * value="--js=${falcon-sdk}/frameworks/javascript/goog/base.js"/> <arg
-         * value="--js=${build.target.js}"/> <arg
-         * value="--js_output_file=${build.target.compiled.js}"/> <arg
-         * value="--create_source_map=${build.target.compiled.map}"/>
-         */
-        Compiler compiler = new Compiler();
-
-        CompilerOptions options = new CompilerOptions();
-
-        if (JSSharedData.CLOSURE_compilation_level.equals("ADVANCED_OPTIMIZATIONS"))
-            CompilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
-        else if (JSSharedData.CLOSURE_compilation_level.equals("WHITESPACE_ONLY"))
-            CompilationLevel.WHITESPACE_ONLY.setOptionsForCompilationLevel(options);
-        else
-            CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
-
-        final List<JSSourceFile> extern = CommandLineRunner.getDefaultExterns();
-
-        final List<JSSourceFile> input = new ArrayList<JSSourceFile>();
-		String googHome = System.getenv("GOOG_HOME");
-		if (googHome == null || googHome.length() == 0)
-			System.out.println("GOOG_HOME not defined.  Should point to goog folder containing base.js.");
-
-        input.add(JSSourceFile.fromFile(googHome + "/base.js"));
-
-        GoogDepsWriter dependencyGraphWriter =
-            new GoogDepsWriter(mainCU, outputFile.getParentFile());
-
-        ArrayList<String> files;
-		try {
-			files = dependencyGraphWriter.getListOfFiles();
-	        for (String fileName : files)
-	        {
-	            input.add(JSSourceFile.fromFile(fileName));
-	        }
-		} catch (InterruptedException e1) {
-			// TODO Auto-generated catch block
-			e1.printStackTrace();
-		}
-        
-        if (JSSharedData.CLOSURE_create_source_map != null)
-            options.sourceMapOutputPath = JSSharedData.CLOSURE_create_source_map;
-
-        if (JSSharedData.CLOSURE_formatting != null)
-        {
-            if (JSSharedData.CLOSURE_formatting.equals("PRETTY_PRINT"))
-                options.prettyPrint = true;
-            else if (JSSharedData.CLOSURE_formatting.equals("PRINT_INPUT_DELIMITER"))
-                options.prettyPrint = true;
-            else
-                throw new RuntimeException("Unknown formatting option: " + JSSharedData.CLOSURE_formatting);
-        }
-        else if (JSSharedData.DEBUG)
-        {
-            options.prettyPrint = true;
-        }
-
-        try
-        {
-            // compile() returns a Result, but it is not needed here.
-            compiler.compile(extern, input, options);
-
-            if (compiler.getErrorCount() == 0)
-            {
-                // The compiler is responsible for generating the compiled code; it is not
-                // accessible via the Result.
-                final String optimizedCode = compiler.toSource();
-                BufferedOutputStream outputbuffer;
-				try {
-					String mainName = mainCU.getShortNames().get(0);
-					File outputFolder = outputFile.getParentFile();
-					outputbuffer = new BufferedOutputStream(new FileOutputStream(outputFile));
-					outputbuffer.write(optimizedCode.getBytes());
-					outputbuffer.flush();
-					outputbuffer.close();
-					File htmlFile = new File(outputFolder.getAbsolutePath() + File.separator + mainName + ".example.html");
-					outputbuffer = new BufferedOutputStream(new FileOutputStream(htmlFile));
-					String html = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
-					html += "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
-					html += "<head>\n";
-					html += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n";
-					html += "<script type=\"text/javascript\" src=\"" + mainName + ".js" + "\" ></script>\n";
-					html += "<script type=\"text/javascript\">\n";
-					html += "    var app = new " + mainName + "();\n";
-					html += "</script>\n";
-					html += "<title>" + mainName + "</title>\n";
-					html += "</head>\n";
-					html += "<body onload=\"app.start()\">\n";
-					html += "</body>\n";
-					html += "</html>\n";
-					outputbuffer.write(html.getBytes());
-					outputbuffer.flush();
-					outputbuffer.close();
-				} catch (FileNotFoundException e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
-				} catch (IOException e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
-				} catch (InterruptedException e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
-				}
-            }
-            else if (problems != null)
-            {
-                final JSError[] errors = compiler.getErrors();
-                for (JSError err : errors)
-                    problems.add(new ClosureProblem(err));
-                
-                return false;
-            }
-        }
-
-        /*
-         * internal compiler error generated with optimize enabled compiling
-         * as3_enumerate.fla and fails to release the JS file
-         * http://watsonexp.corp.adobe.com/#bug=3047880 This is part #3 of the
-         * fix: The closure compiler throws RTEs on internal compiler errors,
-         * that don't get caught until they bubble up to MXMLJSC's scope. On
-         * their way out files remain unclosed and cause problems, because Flame
-         * cannot delete open files. The change below addresses this problem.
-         */
-        catch (RuntimeException rte)
-        {
-            if (problems != null)
-            {
-                final ICompilerProblem problem = new InternalCompilerProblem(rte);
-                problems.add(problem);
-                return false;
-            }
-        }
-        return true;
-    }
-    
-    private void generateGoogDepsIfNeeded(File outputFolder) throws IOException, InterruptedException, ConfigurationException
-    {
-    	final File depsOutput = new File(outputFolder.getAbsolutePath() + File.separator + mainCU.getShortNames().get(0) + "Deps.js");
-        if (!JSSharedData.OPTIMIZE)
-        {
-            GoogDepsWriter dependencyGraphWriter =
-                    new GoogDepsWriter(mainCU, outputFolder);
-            BufferedOutputStream graphStream = new BufferedOutputStream(new FileOutputStream(depsOutput));
-            dependencyGraphWriter.writeToStream(graphStream);
-            graphStream.flush();
-            graphStream.close();
-        }
-    }
-    
-    /**
-     * Get the current project.
-     * 
-     * @return project
-     */
-    protected FlexProject getProject()
-    {
-        return this.project;
-    }
-
-    /**
-     * sets up JavaScript specific options
-     * 
-     * @throws IOException
-     * @throws InterruptedException
-     */
-    protected void setupJS() throws IOException, InterruptedException
-    {
-        JSGeneratingReducer.validate();
-
-        JSSharedData.instance.reset();
-        project.getSourceCompilationUnitFactory().addHandler(asFileHandler);
-
-        if (isCompc())
-            JSSharedData.COMPILER_NAME = "COMPJSC";
-        else
-            JSSharedData.COMPILER_NAME = "MXMLJSC";
-
-        JSSharedData.instance.setVerbose(config.isVerbose());
-
-        JSSharedData.DEBUG = config.debug();
-        JSSharedData.OPTIMIZE = !config.debug() && config.optimize();
-
-        // workaround for Falcon bug: getCompilerLibraryPath() is not supported yet.
-        /*
-         * if( config.getCompilerLibraryPath() != null ) { final List<String>
-         * libs = config.getCompilerLibraryPath(); final File libPaths[] = new
-         * File[libs.size()]; int nthPath = 0; for( String lib: libs ) { if( lib
-         * == null ) throw JSSharedData.backend.createException(
-         * "Invalid swc path in -compiler.library-path"); final String pathname
-         * = lib; final File libPath = new File(pathname); libPaths[nthPath++] =
-         * libPath; if( JSSharedData.SDK_PATH == null &&
-         * libPath.getName().equals("browserglobal.swc")) { //
-         * ../sdk/frameworks/libs/browser/browserglobal.swc File sdkFolder =
-         * libPath.getParentFile(); if( sdkFolder != null ) { sdkFolder =
-         * sdkFolder.getParentFile(); if( sdkFolder != null ) { sdkFolder =
-         * sdkFolder.getParentFile(); if( sdkFolder != null ) { sdkFolder =
-         * sdkFolder.getParentFile(); if( sdkFolder != null )
-         * JSSharedData.SDK_PATH = sdkFolder.getAbsolutePath(); } } } } } //
-         * Setting the library path into the project // causes an ISWC to be
-         * built for each SWC on the library path. // It also causes an
-         * MXMLManifestManager to be built for the project // from the manifest
-         * info in the project's SWCs. project.setInternalLibraryPath(libPaths);
-         * }
-         */
-
-        final Set<ICompilationUnit> compilationUnits = new HashSet<ICompilationUnit>();
-
-        // workaround for Falcon bug: getCompilerIncludeLibraries() is not supported yet.
-        /*
-         * if( config.getCompilerIncludeLibraries() != null ) { // see
-         * LibraryPathManager.computeUnitsToAdd() for( String swcSpec:
-         * config.getCompilerIncludeLibraries() ) { final ISWCManager swcManager
-         * = project.getWorkspace().getSWCManager(); final String swcFilePath =
-         * swcSpec; final ISWC swc = swcManager.get(new File(swcFilePath));
-         * final boolean isExternal = true; for (final ISWCLibrary library :
-         * swc.getLibraries()) { for (final ISWCScript script :
-         * library.getScripts()) { // Multiple definition in a script share the
-         * same compilation unit // with the same ABC byte code block. final
-         * List<String> qnames = new
-         * ArrayList<String>(script.getDefinitions().size()); for (final String
-         * definitionQName : script.getDefinitions()) { final String defName =
-         * definitionQName.replace(":", "."); qnames.add(defName); //$NON-NLS-1$
-         * //$NON-NLS-2$ } final ICompilationUnit cu = new SWCCompilationUnit(
-         * project, swc, library, script, qnames, isExternal);
-         * compilationUnits.add(cu); } } } }
-         */
-
-        // add builtins
-        final File builtin = new File(JSSharedData.BUILT_IN);
-        if (builtin.canRead())
-        {
-            if (config.isVerbose())
-                JSSharedData.instance.stdout("[abc] found: " + builtin);
-            ABCCompilationUnit cu = new ABCCompilationUnit(project, builtin.getPath());
-            compilationUnits.add(cu);
-        }
-
-        if (!compilationUnits.isEmpty())
-        {
-            final List<ICompilationUnit> units = new LinkedList<ICompilationUnit>();
-            units.addAll(compilationUnits);
-            project.addCompilationUnitsAndUpdateDefinitions(units);
-
-            if (config.isVerbose())
-            {
-                for (final ISWC swc : project.getLibraries())
-                {
-                    JSSharedData.instance.stdout(String.format("[lib] found library %s", swc.getSWCFile().getPath()));
-                }
-            }
-        }
-
-        registerSWCs(project);
-    }
-
-    /**
-     * Replaces FlexApplicationProject::buildSWF()
-     * 
-     * @param applicationProject
-     * @param rootClassName
-     * @param problems
-     * @return
-     * @throws InterruptedException
-     */
-
-    private ISWF buildSWF(CompilerProject applicationProject, String rootClassName, ICompilationUnit mainCU, Collection<ICompilerProblem> problems) throws
-            InterruptedException, ConfigurationException, FileNotFoundException
-    {
-        Collection<ICompilerProblem> fatalProblems = applicationProject.getFatalProblems();
-        if (!fatalProblems.isEmpty())
-        {
-            problems.addAll(fatalProblems);
-            return null;
-        }
-
-        return target.build(mainCU, problems);
-    }
-
-    protected void verboseMessage(PrintStream strm, String s)
-    {
-        if (strm != null && config.isVerbose())
-            strm.println(s);
-    }
-
-    /**
-     * Scans JavaScript code for @requires tags and registers class
-     * dependencies.
-     * 
-     * @param cu current CompilationUnit
-     * @param classDef ClassDefinition of the JavaScript code
-     * @param jsCode JavaScript code of the ClassDefinition. private static void
-     * registerDependencies( ICompilationUnit cu, ClassDefinition classDef,
-     * String jsCode ) { final JSSharedData sharedData = JSSharedData.instance;
-     * final String requiresTag = "@requires"; // extract @requires class names
-     * and register dependencies. if( jsCode.contains(requiresTag) ) { final
-     * String line = jsCode.substring( jsCode.indexOf(requiresTag) +
-     * requiresTag.length() ); for( String part : line.split(requiresTag) ) {
-     * final String[] names = part.split("\\s+"); if( names.length > 1 ) { final
-     * String depClassName = names[1]; ASProjectScope projectScope =
-     * (ASProjectScope)cu.getProject().getScope(); IDefinition depClassDef =
-     * projectScope.findDefinitionByName(depClassName); if(depClassDef != null)
-     * { sharedData.addDependency(classDef, depClassDef); } } } } }
-     */
-
-    public static Boolean addDependency(ICompilationUnit cu, String className, DependencyType dt)
-    {
-        if (JSGeneratingReducer.isReservedDataType(className))
-            return false;
-
-        final ICompilationUnit fromCU = cu;
-        final CompilerProject compilerProject = (CompilerProject)cu.getProject();
-        final ASProjectScope projectScope = compilerProject.getScope();
-
-        final IDefinition classDef = projectScope.findDefinitionByName(className);
-        if (classDef == null)
-            return false;
-
-        final ICompilationUnit toCU = projectScope.getCompilationUnitForDefinition(classDef);
-        if (fromCU == toCU)
-            return false;
-
-        // sharedData.verboseMessage( "Adding dependency: " + className );
-        compilerProject.addDependency(fromCU, toCU, dt);
-        JSSharedData.instance.registerDefinition(classDef);
-        return true;
-    }
-
-    public static List<IDefinition> getDefinitions(ICompilationUnit cu, Boolean onlyClasses) throws InterruptedException
-    {
-        final List<IDefinition> classDefs = new ArrayList<IDefinition>();
-        // populate the IDefinition to ClassDefinition map
-        final List<IDefinition> defs = cu.getDefinitionPromises();
-        for (IDefinition def : defs)
-        {
-            if (def instanceof DefinitionPromise)
-            {
-                // see DefinitionPromise::getActualDefinition 
-                final String qname = def.getQualifiedName();
-                final IFileScopeRequestResult fileScopeRequestResult = cu.getFileScopeRequest().get();
-                def = fileScopeRequestResult.getMainDefinition(qname);
-            }
-
-            if (def != null && !onlyClasses || (def instanceof ClassDefinition))
-            {
-                classDefs.add(def);
-            }
-        }
-        return classDefs;
-    }
-
-    public static void registerSWCs(CompilerProject project) throws InterruptedException
-    {
-        final JSSharedData sharedData = JSSharedData.instance;
-
-        // collect all SWCCompilationUnit in swcUnits
-        final List<ICompilationUnit> swcUnits = new ArrayList<ICompilationUnit>();
-        for (ICompilationUnit cu : project.getCompilationUnits())
-        {
-            if (cu instanceof SWCCompilationUnit)
-                swcUnits.add(cu);
-
-            final List<IDefinition> defs = getDefinitions(cu, false);
-            for (IDefinition def : defs)
-            {
-                sharedData.registerDefinition(def);
-            }
-        }
-
-    }
-
-    protected String getFlexHomePath()
-    {
-        final String loadConfig = config.getLoadConfig();
-        if (loadConfig == null || loadConfig.isEmpty())
-            return null;
-        // throw new Error("Cannot find load configuration file: " + loadConfig.getPath() );
-
-        final File loadConfigFile = new File(loadConfig);
-        if (!loadConfigFile.isFile())
-            return null;
-        // throw new Error("Cannot find load configuration file: " + loadConfigFile.getAbsolutePath() );
-
-        final File frameworksFolder = new File(loadConfigFile.getParent());
-        if (!frameworksFolder.isDirectory())
-            return null;
-        // throw new Error("Cannot find framework folder: " + frameworksFolder.getAbsolutePath() );
-
-        final String flexHome = frameworksFolder.getParent();
-        if (flexHome == null || flexHome.isEmpty())
-            return null;
-        // throw new Error("Cannot find FLEX_HOME environment variable.");
-
-        return flexHome;
-    }
-
-    protected JSCommandLineConfiguration getConfiguration()
-    {
-        if (config instanceof JSCommandLineConfiguration)
-            return (JSCommandLineConfiguration)config;
-        return null;
-    }
-
-    public class ClosureProblem implements ICompilerProblem
-    {
-        private JSError m_error;
-
-        public ClosureProblem(JSError error)
-        {
-            m_error = error;
-        }
-
-        /**
-         * Returns a unique identifier for this type of problem.
-         * <p>
-         * Clients can use this identifier to look up, in a .properties file, a
-         * localized template string describing the problem. The template string
-         * can have named placeholders such as ${name} to be filled in, based on
-         * correspondingly-named fields in the problem instance.
-         * <p>
-         * Clients can also use this identifier to decide whether the problem is
-         * an error, a warning, or something else; for example, they might keep
-         * a list of error ids and a list of warning ids.
-         * <p>
-         * The unique identifier happens to be the fully-qualified classname of
-         * the problem class.
-         * 
-         * @return A unique identifier for the type of problem.
-         */
-        public String getID()
-        {
-            // Return the fully-qualified classname of the CompilerProblem subclass
-            // as a String to identify the type of problem that occurred.
-            return getClass().getName();
-        }
-
-        /**
-         * Gets the path of the file in which the problem occurred.
-         * 
-         * @return The path of the source file, or null if unknown.
-         */
-        public String getFilePath()
-        {
-            return m_error.sourceName;
-        }
-
-        /**
-         * Gets the offset within the source buffer at which the problem starts.
-         * 
-         * @return The starting offset, or -1 if unknown.
-         */
-        public int getStart()
-        {
-            return m_error.getCharno();
-        }
-
-        /**
-         * Gets the offset within the source buffer at which the problem ends.
-         * 
-         * @return The ending offset, or -1 if unknown.
-         */
-        public int getEnd()
-        {
-            return -1;
-        }
-
-        /**
-         * Gets the line number within the source buffer at which the problem
-         * starts. Line numbers start at 0, not 1.
-         * 
-         * @return The line number, or -1 if unknown.
-         */
-        public int getLine()
-        {
-            return m_error.lineNumber;
-        }
-
-        /**
-         * Gets the column number within the source buffer at which the problem
-         * starts. Column numbers start at 0, not 1.
-         * 
-         * @return The column number, of -1 if unknown.
-         */
-        public int getColumn()
-        {
-            return -1;
-        }
-
-        /**
-         * Returns a readable description of the problem, by substituting field
-         * values for named placeholders such as ${name} in the localized
-         * template.
-         * 
-         * @param template A localized template string describing the problem,
-         * determined by the client from the problem ID. If this parameter is
-         * null, an English template string, stored as the DESCRIPTION of the
-         * problem class, will be used.
-         * @return A readable description of the problem.
-         */
-        public String getDescription(String template)
-        {
-            return m_error.description;
-        }
-
-        /**
-         * Compares this problem to another problem by path, line, and column so
-         * that problems can be sorted.
-         */
-        final public int compareTo(final ICompilerProblem other)
-        {
-            if (getFilePath() != null && other.getSourcePath() != null)
-            {
-                final int pathCompare = getFilePath().compareTo(other.getSourcePath());
-                if (pathCompare != 0)
-                    return pathCompare;
-            }
-            else if (getFilePath() != null && other.getSourcePath() == null)
-            {
-                return 1;
-            }
-            else if (getFilePath() == null && other.getSourcePath() != null)
-            {
-                return -1;
-            }
-
-            if (getLine() < other.getLine())
-                return -1;
-            else if (getLine() > other.getLine())
-                return 1;
-
-            if (getColumn() < other.getColumn())
-                return -1;
-            else if (getColumn() > other.getColumn())
-                return 1;
-
-            return 0;
-        }
-
-        public int getAbsoluteEnd()
-        {
-            // TODO Auto-generated method stub
-            return 0;
-        }
-
-        public int getAbsoluteStart()
-        {
-            // TODO Auto-generated method stub
-            return 0;
-        }
-
-        public String getSourcePath()
-        {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/ABCGeneratingReducer.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/ABCGeneratingReducer.java b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/ABCGeneratingReducer.java
deleted file mode 100644
index 624d992..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/ABCGeneratingReducer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- *  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.internal.as.codegen;
-
-public class ABCGeneratingReducer extends JSGeneratingReducer
-{
-    public ABCGeneratingReducer()
-    {
-        super(JSSharedData.instance);
-    }
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSClassDirectiveProcessor.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSClassDirectiveProcessor.java b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSClassDirectiveProcessor.java
deleted file mode 100644
index ebf8998..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSClassDirectiveProcessor.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- *
- *  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.internal.as.codegen;
-
-import static org.apache.flex.abc.ABCConstants.*;
-
-import org.apache.flex.abc.ABCConstants;
-import org.apache.flex.abc.visitors.IABCVisitor;
-import org.apache.flex.abc.visitors.ITraitVisitor;
-import org.apache.flex.abc.visitors.ITraitsVisitor;
-import org.apache.flex.abc.semantics.MethodInfo;
-import org.apache.flex.abc.semantics.Name;
-import org.apache.flex.abc.semantics.Namespace;
-import org.apache.flex.abc.semantics.Trait;
-import org.apache.flex.abc.instructionlist.InstructionList;
-import org.apache.flex.compiler.common.ASModifier;
-import org.apache.flex.compiler.internal.as.codegen.ICodeGenerator.IConstantValue;
-import org.apache.flex.compiler.internal.definitions.ClassDefinition;
-import org.apache.flex.compiler.internal.definitions.DefinitionBase;
-import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
-import org.apache.flex.compiler.internal.definitions.NamespaceDefinition;
-import org.apache.flex.compiler.internal.semantics.SemanticUtils;
-import org.apache.flex.compiler.internal.tree.as.ClassNode;
-import org.apache.flex.compiler.internal.tree.as.FunctionNode;
-import org.apache.flex.compiler.internal.tree.as.NamespaceNode;
-import org.apache.flex.compiler.internal.tree.as.VariableNode;
-import org.apache.flex.compiler.problems.StaticNamespaceDefinitionProblem;
-import org.apache.flex.compiler.projects.ICompilerProject;
-import org.apache.flex.compiler.tree.as.IASNode;
-import org.apache.flex.compiler.tree.as.ICommonClassNode;
-
-/**
- * A ClassDirectiveProcessor generates an ABC class from a ClassNode and its
- * contents. JSClassDirectiveProcessor is derived from ClassDirectiveProcessor
- * and adds workarounds necessary for FalconJS. Ideally FalconJS should use
- * ClassDirectiveProcessor and retire JSClassDirectiveProcessor. This
- * implementation is part of FalconJS. For more details on FalconJS see
- * org.apache.flex.compiler.JSDriver.
- */
-@SuppressWarnings("nls")
-public class JSClassDirectiveProcessor extends ClassDirectiveProcessor
-{
-    JSGenerator m_generator;
-
-    /**
-     * Instructions to place in the class' initializer. Note that these are part
-     * of the class itself, as opposed to the above instructions which create
-     * the class at the global scope.
-     */
-    InstructionList looseInsns = new InstructionList();
-
-    /**
-     * Constructor. Initializes the ClassDirectiveProcessor and its associated
-     * AET data structures.
-     * 
-     * @param c - the class' AST.
-     * @param enclosing_scope - the immediately enclosing lexical scope.
-     * @param emitter - the active ABC emitter.
-     */
-    public JSClassDirectiveProcessor(JSGenerator generator, ClassNode c, LexicalScope enclosing_scope, IABCVisitor emitter)
-    {
-        this(generator, c, addDefinition(enclosing_scope.getProject(), c.getDefinition()), enclosing_scope, emitter);
-    }
-
-    private static ClassDefinition addDefinition(ICompilerProject project, ClassDefinition cdef)
-    {
-        JSSharedData.instance.registerDefinition(cdef);
-        return cdef;
-    }
-
-    /**
-     * Constructor. Initializes the ClassDirectiveProcessor and its associated
-     * AET data structures.
-     * 
-     * @param class_definition - the class' definition
-     * @param enclosing_scope - the immediately enclosing lexical scope.
-     * @param emitter - the active ABC emitter.
-     */
-    public JSClassDirectiveProcessor(JSGenerator generator, IASNode node, ClassDefinition class_definition, LexicalScope enclosing_scope, IABCVisitor emitter)
-    {
-        super((ICommonClassNode)node, class_definition, enclosing_scope, emitter);
-        m_generator = generator;
-
-        /*
-         * // add explicit dependencies. final ICompilerProject project =
-         * classScope.getProject(); final ClassDefinition superclassDefinition =
-         * class_definition.resolveBaseClass( new ASDefinitionCache(project),
-         * new RecursionGuard(), classScope.getProblems()); if(
-         * superclassDefinition != null )
-         * JSSharedData.instance.addDependency(class_definition,
-         * superclassDefinition);
-         */
-
-        generator.getReducer().setClassDefinition(enclosing_scope.getProject(), class_definition);
-    }
-
-    /**
-     * Finish the class' definition.
-     */
-    @Override
-    void finishClassDefinition()
-    {
-        //  Create the class' constructor function.
-        if (this.ctorFunction != null /* || !iinitInsns.isEmpty() */)
-        {
-            MethodInfo mi = m_generator.generateFunction(this.ctorFunction, classScope, this.iinitInsns);
-            if (mi != null)
-                this.iinfo.iInit = mi;
-
-            this.ctorFunction = null;
-            this.iinitInsns = new InstructionList();
-        }
-
-        // clear cinitInsns if there are no side effects
-        // by initializing the static members directly.
-        final String fullName = JSGeneratingReducer.createFullNameFromDefinition(classScope.getProject(), classDefinition);
-        if (!JSSharedData.instance.hasClassInit(fullName))
-            cinitInsns = new InstructionList();
-
-        // support for class inits 
-        // loose statement are now collected in looseInsns
-        if (!this.looseInsns.isEmpty())
-            cinitInsns.addAll(looseInsns);
-
-        // base class injects ABC if not empty and then NPEs.
-        // save our insns and give it an empty list then restore
-        InstructionList cinitHack = cinitInsns;
-        cinitInsns = new InstructionList();
-        super.finishClassDefinition();
-        cinitInsns = cinitHack;
-
-        m_generator.getReducer().setClassDefinition(null, null);
-    }
-
-    /**
-     * Declare a function. TODO: static vs. instance.
-     */
-    @Override
-    void declareFunction(FunctionNode func)
-    {
-        func.parseFunctionBody(classScope.getProblems());
-
-        boolean is_constructor = func.isConstructor();
-
-        functionSemanticChecks(func);
-
-        //  Save the constructor function until
-        //  we've seen all the instance variables
-        //  that might need initialization.
-        if (is_constructor)
-        {
-            this.ctorFunction = func;
-        }
-        else
-        {
-            MethodInfo mi = m_generator.generateFunction(func, classScope, null);
-            ITraitVisitor tv;
-
-            if (mi != null)
-            {
-                FunctionDefinition funcDef = func.getDefinition();
-                Name funcName = funcDef.getMName(classScope.getProject());
-
-                if (func.hasModifier(ASModifier.STATIC))
-                    tv = ctraits.visitMethodTrait(functionTraitKind(func, TRAIT_Method), funcName, 0, mi);
-                else
-                {
-                    tv = itraits.visitMethodTrait(functionTraitKind(func, TRAIT_Method), funcName, 0, mi);
-                    if (funcDef.getNamespaceReference() instanceof NamespaceDefinition.IProtectedNamespaceDefinition)
-                        this.iinfo.flags |= ABCConstants.CLASS_FLAG_protected;
-                }
-
-                this.classScope.processMetadata(tv, funcDef.getAllMetaTags());
-
-                if (func.hasModifier(ASModifier.FINAL))
-                    tv.visitAttribute(Trait.TRAIT_FINAL, Boolean.TRUE);
-                if (func.hasModifier(ASModifier.OVERRIDE))
-                    tv.visitAttribute(Trait.TRAIT_OVERRIDE, Boolean.TRUE);
-            }
-        }
-    }
-
-    /**
-     * Declare a variable. TODO: static vs. instance.
-     */
-    @Override
-    void declareVariable(VariableNode var)
-    {
-        verifyVariableModifiers(var);
-
-        DefinitionBase varDef = var.getDefinition();
-        m_generator.getReducer().startDeclareVariable(varDef);
-
-        boolean is_static = var.hasModifier(ASModifier.STATIC);
-        boolean is_const = SemanticUtils.isConst(var, classScope.getProject());
-        // simple initializers for public/protected vars go right on prototype.
-        // the rest (all private vars), all "complex" initializers (like array) get
-        // initialized in the constructor
-        boolean needs_constructor_init = true;
-        
-        //  generateConstantValue() returns null if no constant value
-        //  can be generated, and null is the correct value for "no value."
-        IConstantValue constantValue =  m_generator.generateConstantValue(var.getAssignedValueNode(), this.classScope.getProject());
-
-        //  initializer is null if no constant value
-        //  can be generated, and null is the correct value for "no value."
-        Object initializer = constantValue != null ? constantValue.getValue() : null;
-
-        ITraitVisitor tv = declareVariable(var, varDef, is_static, is_const, initializer);
-
-        this.classScope.processMetadata(tv, varDef.getAllMetaTags());
-
-        //  Generate variable initializers and append them to the 
-        //  proper initialization list.
-        if (var.getChildCount() > 1)
-        {
-            //  We need to put the correct traits visitor on the class'
-            //  LexicalScope; the BURM may encounter variable declarations
-            //  chained onto this one, and it will need the traits visitor to declare them.
-
-            //  Save the scope's current traits visitor (which should be null)
-            //  and restore it 
-            ITraitsVisitor saved_traits_visitor = this.classScope.traitsVisitor;
-            assert (saved_traits_visitor == null);
-            try
-            {
-                // the following line causes duplicate Traits.
-                // JSEmitter::emitTraits works around duplicate Traits by checking against
-                // a visitedTraits set.
-                this.classScope.traitsVisitor = (is_static) ? ctraits : itraits;
-                this.classScope.resetDebugInfo();
-                InstructionList init_expression = m_generator.generateInstructions(var, CmcJSEmitter.__statement_NT, this.classScope);
-                if (init_expression != null && !init_expression.isEmpty())
-                {
-                    // final JSEmitter emitter = (JSEmitter)this.classScope.getEmitter();
-                    final String str = JSGeneratingReducer.instructionListToString(init_expression, true);
-
-                    if (str.contains(" = "))
-                    {
-                        final String varInit = m_generator.getReducer().getVariableInitializer(varDef);
-                        if (varInit != null && !varInit.isEmpty())
-                        {
-                            // set the value of the slot trait.
-                            final String varName = varDef.getBaseName();
-                            for (Trait t : this.classScope.traitsVisitor.getTraits())
-                            {
-                                final byte kind = t.getKind();
-                                if (kind == TRAIT_Const || kind == TRAIT_Var)
-                                {
-                                	boolean is_private = false;
-                                    final Name name = t.getNameAttr(Trait.TRAIT_NAME);
-                                    Namespace ns = name.getSingleQualifier();
-                                    if (ns.getKind() == CONSTANT_PrivateNs)
-                                    	is_private = true;
-                                    if (name.getBaseName().equals(varName))
-                                    {
-                                        t.setAttr(Trait.SLOT_VALUE, varInit);
-                                        if (!is_private)
-                                        	needs_constructor_init = false;
-                                        break;
-                                    }
-                                }
-                            }
-
-                        }
-
-                        if (is_static)
-                        {
-                            // see finishClassDefinition.
-                            // We clear cinitInsns only if there are no side effects
-                            // by initializing the static members directly.
-                            // If varInit is null, or varInit is isEmpty() 
-                            // then we have side effects. 
-                            if (!init_expression.isEmpty())
-                                registerClassInit(var);
-
-                            cinitInsns.addAll(init_expression);
-                        }
-                        else if (needs_constructor_init)
-                            iinitInsns.addAll(init_expression);
-                    }
-                }
-            }
-            finally
-            {
-                this.classScope.traitsVisitor = saved_traits_visitor;
-            }
-        }
-
-        m_generator.getReducer().endDeclareVariable(varDef);
-    }
-
-    /**
-     * Ignore modifier nodes that are in the AST, but processed as attributes of
-     * the definition nodes. Other loose directives are processed as statements
-     * and added to the class' static init method.
-     */
-    @Override
-    void processDirective(IASNode n)
-    {
-        switch (n.getNodeID())
-        {
-
-            case StaticID:
-            case FinalID:
-            case OverrideID:
-            case UseID:
-                break;
-
-            case NamespaceID:
-            {
-                NamespaceNode ns = (NamespaceNode)n;
-
-                if (ns.hasModifier(ASModifier.STATIC))
-                {
-                    this.classScope.addProblem(new StaticNamespaceDefinitionProblem(ns));
-                }
-                else
-                {
-                    try
-                    {
-                        this.classScope.traitsVisitor = itraits;
-                        m_generator.generateInstructions(n, CmcEmitter.__statement_NT, this.classScope);
-                        // assert(stmt_insns == null);
-                    }
-                    finally
-                    {
-                        this.classScope.traitsVisitor = null;
-                    }
-                }
-                break;
-            }
-            default:
-            {
-                // support for class inits.
-                // loose statement are now collected in looseInsns
-                //  Handle a loose statement.
-                InstructionList stmt_insns = m_generator.generateInstructions(n, CmcJSEmitter.__statement_NT, this.classScope);
-                if (stmt_insns != null)
-                {
-                    if (looseInsns.size() == 0)
-                        registerClassInit(n);
-
-                    looseInsns.addAll(stmt_insns);
-                }
-                break;
-            }
-        }
-    }
-
-    private void registerClassInit(IASNode node)
-    {
-        final String fullName = JSGeneratingReducer.createFullNameFromDefinition(classScope.getProject(), classDefinition);
-        if (!fullName.equals(JSSharedData.JS_FRAMEWORK_NAME))
-        {
-            JSSharedData.instance.registerClassInit(fullName);
-            m_generator.getReducer().warnClassInitPerformance(node);
-            m_generator.getReducer().setNeedsSecondPass();
-        }
-    }
-}


[08/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSFlexUtils.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSFlexUtils.java b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSFlexUtils.java
deleted file mode 100644
index 356b19e..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSFlexUtils.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- *
- *  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.internal.as.codegen;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.flex.compiler.constants.IMetaAttributeConstants;
-import org.apache.flex.compiler.definitions.IClassDefinition;
-import org.apache.flex.compiler.definitions.IDefinition;
-import org.apache.flex.compiler.definitions.ITypeDefinition;
-import org.apache.flex.compiler.definitions.IVariableDefinition;
-import org.apache.flex.compiler.definitions.metadata.IMetaTag;
-import org.apache.flex.compiler.internal.legacy.ASDefinitionFilter;
-import org.apache.flex.compiler.internal.legacy.MemberedDefinitionUtils;
-import org.apache.flex.compiler.projects.ICompilerProject;
-
-/**
- * Utilities for Flex-oriented special cases in FalconJS compilation. Example:
- * handling the [SkinPart] metatag
- */
-public class JSFlexUtils
-{
-    /**
-     * Generates a JavaScript object literal (JSON string) representing the
-     * value that should be returned by the generated get_skinParts() method.
-     * The JSON object is a map from skin part id to a boolean indicating
-     * whether the part is required.
-     */
-    public static String generateGetSkinPartsJSON(IClassDefinition classDef, ICompilerProject project)
-    {
-        // Gather set of skin parts
-        Map<String, JSFlexUtils.SkinPartInfo> skinPartsInfo = JSFlexUtils.getSkinParts(classDef, project);
-
-        // Build the JSON string
-        StringBuilder partsObj = new StringBuilder();
-        partsObj.append("{ ");
-
-        // for each skin part...
-        boolean comma = false;
-        for (JSFlexUtils.SkinPartInfo skinPart : skinPartsInfo.values())
-        {
-            if (comma)
-                partsObj.append(", ");
-            else
-                comma = true;
-
-            partsObj.append(skinPart.name);
-            partsObj.append(": ");
-            partsObj.append(skinPart.required);
-        }
-
-        partsObj.append(" }");
-
-        return partsObj.toString();
-    }
-
-    /**
-     * Returns a map specifying the skin parts of the given class. The keys are
-     * the skin part ids, and the values are SkinPartInfo objects containing
-     * additional information about each part.
-     */
-    public static Map<String, SkinPartInfo> getSkinParts(IClassDefinition componentClass, ICompilerProject project)
-    {
-        // NOTE: derived from ModelUtils.getSkinPartsForType() in the Flash Builder codebase (in com.adobe.flexide.mxmlmodel plugin)
-
-        ASDefinitionFilter filter = new ASDefinitionFilter(ASDefinitionFilter.ClassificationValue.VARIABLES,
-                                                           ASDefinitionFilter.SearchScopeValue.INHERITED_MEMBERS,
-                                                           ASDefinitionFilter.AccessValue.ALL,
-                                                           componentClass);
-        IDefinition[] members = MemberedDefinitionUtils.getAllMembers(componentClass, project, filter);
-
-        HashMap<String, SkinPartInfo> map = new HashMap<String, SkinPartInfo>();
-
-        // For each variable declared in class...
-        for (IDefinition member : members)
-        {
-            IVariableDefinition variable = (IVariableDefinition)member;
-
-            // Is it tagged [SkinPart] ?
-            IMetaTag skinPartTag = variable.getMetaTagByName(IMetaAttributeConstants.ATTRIBUTE_SKIN_PART);
-            if (skinPartTag != null)
-            {
-                // Gather information about the skin part
-                String name = variable.getBaseName();
-                ITypeDefinition partType = variable.resolveType(project);
-                String asClass = partType != null ? partType.getQualifiedName() : null;
-                boolean required = parseRequired(skinPartTag);
-
-                SkinPartInfo info = new SkinPartInfo(name, asClass, required);
-
-                // Add to result
-                // Note: We get duplicates for [Bindable] variables because they generate getter/setter pairs
-                map.put(name, info);
-            }
-        }
-
-        return map;
-    }
-
-    private static boolean parseRequired(IMetaTag metaTag)
-    {
-        String requiredStr = metaTag.getAttributeValue(IMetaAttributeConstants.NAME_SKIN_PART_REQUIRED);
-        return requiredStr != null && requiredStr.length() > 0 &&
-               requiredStr.equals(IMetaAttributeConstants.VALUE_SKIN_PART_REQUIRED_TRUE);
-    }
-
-    /**
-     * Value object representing information about a skin part. Immutable. NOTE:
-     * derived from ModelUtils.SkinPartInfo in the Flash Builder codebase
-     */
-    public static class SkinPartInfo
-    {
-        /** Part name - this should be set as the ID in the skin. Not null. */
-        public final String name;
-
-        /**
-         * Type of the part, or null if the type could not be resolved on the
-         * classpath.
-         */
-        public final String asClass;
-
-        /** Does the metadata indicate that the part is required? */
-        public final boolean required;
-
-        public SkinPartInfo(String name, String asClass, boolean required)
-        {
-            assert name != null;
-            assert asClass != null;
-            this.name = name;
-            this.asClass = asClass;
-            this.required = required;
-        }
-    }
-}


[43/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/ExportWriter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/ExportWriter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/ExportWriter.java
new file mode 100644
index 0000000..92244db
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/ExportWriter.java
@@ -0,0 +1,230 @@
+/*
+ *
+ *  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.internal.codegen.js.amd;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+
+/**
+ * @author Michael Schmalle
+ */
+public class ExportWriter
+{
+    private static final String CLASSES_TYPES = "__CLASSES$TYPES__";
+
+    private static final String CLASSES_STRINGS = "__CLASSES$STRINGS__";
+
+    private static final String RUNTIME_TYPES = "__RUNTIME$TYPES__";
+
+    private static final String RUNTIME_STRINGS = "__RUNTIME$STRINGS__";
+
+    private final JSAMDEmitter emitter;
+
+    private List<Dependency> runtime = new ArrayList<Dependency>();
+
+    private List<Dependency> types = new ArrayList<Dependency>();
+
+    public ExportWriter(JSAMDEmitter emitter)
+    {
+        this.emitter = emitter;
+    }
+
+    public void queueExports(ITypeDefinition type, boolean outputString)
+    {
+        if (outputString)
+        {
+            emitter.write("[");
+            emitter.write("\"exports\"");
+        }
+
+        emitter.write(", ");
+
+        if (outputString)
+            emitter.write(RUNTIME_STRINGS);
+        else
+            emitter.write(RUNTIME_TYPES);
+
+        //emitter.write(", ");
+
+        if (outputString)
+            emitter.write(CLASSES_STRINGS);
+        else
+            emitter.write(CLASSES_TYPES);
+
+        if (outputString)
+        {
+            emitter.write("]");
+        }
+    }
+
+    public void writeExports(ITypeDefinition type, boolean outputString)
+    {
+        StringBuilder sb = new StringBuilder();
+
+        int i = 0;
+        int len = runtime.size();
+
+        for (Dependency dependency : runtime)
+        {
+            sb.append(dependency.output(outputString, "runtime", outputString));
+
+            if (i < len - 1)
+                sb.append(", ");
+            i++;
+        }
+
+        if (outputString)
+        {
+            int start = emitter.builder().indexOf(RUNTIME_STRINGS);
+            int end = start + RUNTIME_STRINGS.length();
+            emitter.builder().replace(start, end, sb.toString());
+        }
+        else
+        {
+            int start = emitter.builder().indexOf(RUNTIME_TYPES);
+            int end = start + RUNTIME_TYPES.length();
+            emitter.builder().replace(start, end, sb.toString());
+        }
+
+        sb = new StringBuilder();
+
+        i = 0;
+        len = types.size();
+        if (len > 0)
+            sb.append(", "); // trailing comma
+
+        for (Dependency dependency : types)
+        {
+            sb.append(dependency.output(outputString, "classes", outputString));
+
+            if (i < len - 1)
+                sb.append(", ");
+            i++;
+        }
+
+        if (outputString)
+        {
+            int start = emitter.builder().indexOf(CLASSES_STRINGS);
+            int end = start + CLASSES_STRINGS.length();
+            emitter.builder().replace(start, end, sb.toString());
+        }
+        else
+        {
+            int start = emitter.builder().indexOf(CLASSES_TYPES);
+            int end = start + CLASSES_TYPES.length();
+            emitter.builder().replace(start, end, sb.toString());
+        }
+    }
+
+    void addImports(ITypeDefinition type)
+    {
+        Collection<String> imports = new ArrayList<String>();
+        type.getContainedScope().getScopeNode().getAllImports(imports);
+        for (String imp : imports)
+        {
+            String name = toBaseName(imp);
+            if (!isExcludedImport(imp))
+                addDependency(name, imp, false, false);
+        }
+    }
+
+    void addFrameworkDependencies()
+    {
+        runtime.add(new Dependency("AS3", "AS3", false, false));
+    }
+
+    protected boolean isExcludedImport(String imp)
+    {
+        return imp.startsWith("__AS3__");
+    }
+
+    public void addDependency(String baseName, String qualifiedName,
+            boolean isNative, boolean isPlugin)
+    {
+        types.add(new Dependency(baseName, qualifiedName, isNative, isPlugin));
+    }
+
+    static String toBaseName(String name)
+    {
+        if (!name.contains("."))
+            return name;
+        final String basename = name.substring(name.lastIndexOf(".") + 1);
+        return basename;
+    }
+
+    static class Dependency
+    {
+        private final String baseName;
+
+        private final String qualifiedName;
+
+        public String getQualifiedName()
+        {
+            return qualifiedName;
+        }
+
+        private final boolean isNative;
+
+        public boolean isNative()
+        {
+            return isNative;
+        }
+
+        @SuppressWarnings("unused")
+        private final boolean isPlugin;
+
+        public Dependency(String baseName, String qualifiedName,
+                boolean isNative, boolean isPlugin)
+        {
+            this.baseName = baseName;
+            this.qualifiedName = qualifiedName;
+            this.isNative = isNative;
+            this.isPlugin = isPlugin;
+        }
+
+        @Override
+        public String toString()
+        {
+            return qualifiedName; // TODO (mschmalle|AMD) native
+        }
+
+        public String output(boolean outputString, String base,
+                boolean qualified)
+        {
+            StringBuilder sb = new StringBuilder();
+            if (outputString)
+            {
+                sb.append("\"" + base + "/"
+                        + qualifiedName.replaceAll("\\.", "/") + "\"");
+            }
+            else
+            {
+                if (qualified)
+                    sb.append(qualifiedName);
+                else
+                    sb.append(baseName);
+            }
+            return sb.toString();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDDocEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDDocEmitter.java
new file mode 100644
index 0000000..c79dd3d
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDDocEmitter.java
@@ -0,0 +1,37 @@
+/*
+ *
+ *  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.internal.codegen.js.amd;
+
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.codegen.js.amd.IJSAMDDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.JSDocEmitter;
+
+/**
+ * @author Michael Schmalle
+ */
+public class JSAMDDocEmitter extends JSDocEmitter implements IJSAMDDocEmitter
+{
+
+    public JSAMDDocEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDEmitter.java
new file mode 100644
index 0000000..fd19e42
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDEmitter.java
@@ -0,0 +1,971 @@
+/*
+ *
+ *  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.internal.codegen.js.amd;
+
+import java.io.FilterWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.flex.compiler.codegen.js.amd.IJSAMDDocEmitter;
+import org.apache.flex.compiler.codegen.js.amd.IJSAMDEmitter;
+import org.apache.flex.compiler.definitions.IAccessorDefinition;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IConstantDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.definitions.IInterfaceDefinition;
+import org.apache.flex.compiler.definitions.IPackageDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.definitions.IVariableDefinition;
+import org.apache.flex.compiler.definitions.references.IReference;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.definitions.ClassTraitsDefinition;
+import org.apache.flex.compiler.internal.tree.as.FunctionCallNode;
+import org.apache.flex.compiler.internal.tree.as.FunctionNode;
+import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.scopes.IASScope;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IAccessorNode;
+import org.apache.flex.compiler.tree.as.IBlockNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.apache.flex.compiler.tree.as.ITypeNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.utils.NativeUtils;
+
+/**
+ * Concrete implementation of the 'AMD' JavaScript production.
+ * 
+ * @author Michael Schmalle
+ */
+public class JSAMDEmitter extends JSEmitter implements IJSAMDEmitter
+{
+
+    private Map<String, IDefinitionNode> foundAccessors = new HashMap<String, IDefinitionNode>();
+
+    private int inheritenceLevel = -1;
+
+    private ExportWriter exportWriter;
+
+    private boolean initializingFieldsInConstructor;
+
+    private List<IDefinition> baseClassCalls = new ArrayList<IDefinition>();
+
+    StringBuilder builder()
+    {
+        return getBuilder();
+    }
+
+    IJSAMDDocEmitter getDoc()
+    {
+        return (IJSAMDDocEmitter) getDocEmitter();
+    }
+
+    public JSAMDEmitter(FilterWriter out)
+    {
+        super(out);
+
+        exportWriter = new ExportWriter(this);
+    }
+
+    @Override
+    public void emitPackageHeader(IPackageDefinition definition)
+    {
+        // TODO (mschmalle|AMD) this is a hack but I know no other way to do replacements in a Writer
+        setBufferWrite(true);
+
+        write(JSAMDEmitterTokens.DEFINE);
+        write(ASEmitterTokens.PAREN_OPEN);
+
+        IASScope containedScope = definition.getContainedScope();
+        ITypeDefinition type = findType(containedScope.getAllLocalDefinitions());
+        if (type == null)
+            return;
+
+        exportWriter.addFrameworkDependencies();
+        exportWriter.addImports(type);
+
+        exportWriter.queueExports(type, true);
+
+        writeToken(ASEmitterTokens.COMMA);
+    }
+
+    @Override
+    public void emitPackageHeaderContents(IPackageDefinition definition)
+    {
+        // nothing
+    }
+
+    @Override
+    public void emitPackageContents(IPackageDefinition definition)
+    {
+        IASScope containedScope = definition.getContainedScope();
+        ITypeDefinition type = findType(containedScope.getAllLocalDefinitions());
+        if (type == null)
+            return;
+
+        write("function($exports");
+
+        exportWriter.queueExports(type, false);
+
+        write(") {");
+        indentPush();
+        writeNewline();
+        write("\"use strict\"; ");
+        writeNewline();
+
+        ITypeNode tnode = findTypeNode(definition.getNode());
+        if (tnode != null)
+        {
+            getWalker().walk(tnode); // IClassNode | IInterfaceNode
+        }
+
+        indentPop();
+        writeNewline();
+        write("}"); // end returned function
+    }
+
+    @Override
+    public void emitPackageFooter(IPackageDefinition definition)
+    {
+        IASScope containedScope = definition.getContainedScope();
+        ITypeDefinition type = findType(containedScope.getAllLocalDefinitions());
+        if (type == null)
+            return;
+
+        exportWriter.writeExports(type, true);
+        exportWriter.writeExports(type, false);
+
+        write(");"); // end define()
+
+        // flush the buffer, writes the builder to out
+        flushBuilder();
+    }
+
+    private void emitConstructor(IFunctionNode node)
+    {
+        FunctionNode fn = (FunctionNode) node;
+        fn.parseFunctionBody(getProblems());
+
+        //IFunctionDefinition definition = node.getDefinition();
+
+        write("function ");
+        write(node.getName());
+        emitParameters(node.getParametersContainerNode());
+        if (!isImplicit((IContainerNode) node.getScopedNode()))
+        {
+            emitMethodScope(node.getScopedNode());
+        }
+        else
+        {
+            // we have a synthesized constructor, implict
+        }
+    }
+
+    @Override
+    public void emitInterface(IInterfaceNode node)
+    {
+        final IInterfaceDefinition definition = node.getDefinition();
+        final String interfaceName = definition.getBaseName();
+
+        write("AS3.interface_($exports, {");
+        indentPush();
+        writeNewline();
+
+        write("package_: \"");
+        write(definition.getPackageName());
+        write("\",");
+        writeNewline();
+
+        write("interface_: \"");
+        write(interfaceName);
+        write("\"");
+
+        IReference[] references = definition.getExtendedInterfaceReferences();
+        final int len = references.length;
+        if (len > 0)
+        {
+            writeNewline();
+            write("extends_: [");
+            indentPush();
+            writeNewline();
+            int i = 0;
+            for (IReference reference : references)
+            {
+                write(reference.getName());
+                if (i < len - 1)
+                {
+                    write(",");
+                    writeNewline();
+                }
+                i++;
+            }
+            indentPop();
+            writeNewline();
+            write("]");
+        }
+
+        indentPop();
+        writeNewline();
+        write("});"); // end compilation unit
+    }
+
+    @Override
+    public void emitClass(IClassNode node)
+    {
+        //ICompilerProject project = getWalker().getProject();
+
+        IClassDefinition definition = node.getDefinition();
+        getModel().setCurrentClass(definition);
+
+        final String className = definition.getBaseName();
+
+        write("AS3.compilationUnit($exports, function($primaryDeclaration){");
+        indentPush();
+        writeNewline();
+
+        // write constructor
+        emitConstructor((IFunctionNode) definition.getConstructor().getNode());
+        writeNewline();
+
+        // base class
+        IReference baseClassReference = definition.getBaseClassReference();
+        boolean hasSuper = baseClassReference != null
+                && !baseClassReference.getName().equals("Object");
+        if (hasSuper)
+        {
+            String baseName = baseClassReference.getName();
+            write("var Super = (" + baseName + "._ || " + baseName
+                    + "._$get());");
+            writeNewline();
+            write("var super$ = Super.prototype;");
+            writeNewline();
+        }
+
+        write("$primaryDeclaration(AS3.class_({");
+        indentPush();
+        writeNewline();
+
+        // write out package
+        write("package_: \"" + definition.getPackageName() + "\",");
+        writeNewline();
+        // write class
+        write("class_: \"" + definition.getBaseName() + "\",");
+        writeNewline();
+        if (hasSuper)
+        {
+            write("extends_: Super,");
+            writeNewline();
+        }
+
+        IReference[] references = definition
+                .getImplementedInterfaceReferences();
+        int len = references.length;
+
+        // write implements
+        write("implements_:");
+        write(" [");
+
+        if (len > 0)
+        {
+            indentPush();
+            writeNewline();
+        }
+
+        int i = 0;
+        for (IReference reference : references)
+        {
+            write(reference.getName());
+            exportWriter.addDependency(reference.getName(),
+                    reference.getDisplayString(), false, false);
+            if (i < len - 1)
+            {
+                write(",");
+                writeNewline();
+            }
+            i++;
+        }
+
+        if (len > 0)
+        {
+            indentPop();
+            writeNewline();
+        }
+
+        write("],");
+        writeNewline();
+
+        // write members
+        final IDefinitionNode[] members = node.getAllMemberNodes();
+
+        write("members: {");
+
+        indentPush();
+        writeNewline();
+
+        // constructor
+        write("constructor: " + className);
+        if (members.length > 0)
+        {
+            write(",");
+            writeNewline();
+        }
+
+        List<IDefinitionNode> instanceMembers = new ArrayList<IDefinitionNode>();
+        List<IDefinitionNode> staticMembers = new ArrayList<IDefinitionNode>();
+        List<IASNode> staticStatements = new ArrayList<IASNode>();
+
+        TempTools.fillInstanceMembers(members, instanceMembers);
+        TempTools.fillStaticMembers(members, staticMembers, true, false);
+        TempTools.fillStaticStatements(node, staticStatements, false);
+
+        len = instanceMembers.size();
+        i = 0;
+        for (IDefinitionNode mnode : instanceMembers)
+        {
+            if (mnode instanceof IAccessorNode)
+            {
+                if (foundAccessors.containsKey(mnode.getName()))
+                {
+                    len--;
+                    continue;
+                }
+
+                getWalker().walk(mnode);
+            }
+            else if (mnode instanceof IFunctionNode)
+            {
+                getWalker().walk(mnode);
+            }
+            else if (mnode instanceof IVariableNode)
+            {
+                getWalker().walk(mnode);
+            }
+            else
+            {
+                write(mnode.getName());
+            }
+
+            if (i < len - 1)
+            {
+                write(",");
+                writeNewline();
+            }
+            i++;
+        }
+
+        // base class super calls
+        len = baseClassCalls.size();
+        i = 0;
+        if (len > 0)
+        {
+            write(",");
+            writeNewline();
+        }
+
+        for (IDefinition baseCall : baseClassCalls)
+        {
+            write(baseCall.getBaseName() + "$" + inheritenceLevel + ": super$."
+                    + baseCall.getBaseName());
+
+            if (i < len - 1)
+            {
+                write(",");
+                writeNewline();
+            }
+        }
+
+        // end members
+        indentPop();
+        writeNewline();
+        write("},");
+        writeNewline();
+
+        len = staticMembers.size();
+
+        write("staticMembers: {");
+
+        indentPush();
+        writeNewline();
+
+        i = 0;
+        for (IDefinitionNode mnode : staticMembers)
+        {
+            if (mnode instanceof IAccessorNode)
+            {
+                // TODO (mschmalle|AMD) havn't taken care of static accessors
+                if (foundAccessors.containsKey(mnode.getName()))
+                    continue;
+
+                foundAccessors.put(mnode.getName(), mnode);
+
+                getWalker().walk(mnode);
+            }
+            else if (mnode instanceof IFunctionNode)
+            {
+                getWalker().walk(mnode);
+            }
+            else if (mnode instanceof IVariableNode)
+            {
+                getWalker().walk(mnode);
+            }
+
+            if (i < len - 1)
+            {
+                write(",");
+                writeNewline();
+            }
+            i++;
+        }
+        indentPop();
+        if (len > 0)
+            writeNewline();
+        write("}");
+
+        indentPop();
+        writeNewline();
+        write("}));");
+
+        // static statements
+        len = staticStatements.size();
+        if (len > 0)
+            writeNewline();
+
+        i = 0;
+        for (IASNode statement : staticStatements)
+        {
+            getWalker().walk(statement);
+            if (!(statement instanceof IBlockNode))
+                write(";");
+
+            if (i < len - 1)
+                writeNewline();
+
+            i++;
+        }
+
+        indentPop();
+        writeNewline();
+        write("});"); // end compilation unit
+
+    }
+
+    //--------------------------------------------------------------------------
+    // 
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitField(IVariableNode node)
+    {
+        IVariableDefinition definition = (IVariableDefinition) node
+                .getDefinition();
+
+        if (definition.isStatic())
+        {
+            IClassDefinition parent = (IClassDefinition) definition.getParent();
+            write(parent.getBaseName());
+            write(".");
+            write(definition.getBaseName());
+            write(" = ");
+            emitFieldInitialValue(node);
+            return;
+        }
+
+        String name = toPrivateName(definition);
+        write(name);
+        write(": ");
+        write("{");
+        indentPush();
+        writeNewline();
+        // field value
+        write("value:");
+        emitFieldInitialValue(node);
+        write(",");
+        writeNewline();
+        // writable
+        write("writable:");
+        write(!(definition instanceof IConstantDefinition) ? "true" : "false");
+        indentPop();
+        writeNewline();
+        write("}");
+    }
+
+    private void emitFieldInitialValue(IVariableNode node)
+    {
+        ICompilerProject project = getWalker().getProject();
+        IVariableDefinition definition = (IVariableDefinition) node
+                .getDefinition();
+
+        IExpressionNode valueNode = node.getAssignedValueNode();
+        if (valueNode != null)
+            getWalker().walk(valueNode);
+        else
+            write(TempTools.toInitialValue(definition, project));
+    }
+
+    @Override
+    public void emitGetAccessor(IGetterNode node)
+    {
+        if (foundAccessors.containsKey(node.getName()))
+            return;
+
+        foundAccessors.put(node.getName(), node);
+
+        ICompilerProject project = getWalker().getProject();
+        IAccessorDefinition getter = (IAccessorDefinition) node.getDefinition();
+        IAccessorDefinition setter = getter
+                .resolveCorrespondingAccessor(project);
+
+        emitGetterSetterPair(getter, setter);
+    }
+
+    @Override
+    public void emitSetAccessor(ISetterNode node)
+    {
+        if (foundAccessors.containsKey(node.getName()))
+            return;
+
+        foundAccessors.put(node.getName(), node);
+
+        ICompilerProject project = getWalker().getProject();
+        IAccessorDefinition setter = (IAccessorDefinition) node.getDefinition();
+        IAccessorDefinition getter = setter
+                .resolveCorrespondingAccessor(project);
+
+        emitGetterSetterPair(getter, setter);
+    }
+
+    private void emitGetterSetterPair(IAccessorDefinition getter,
+            IAccessorDefinition setter)
+    {
+        write(getter.getBaseName());
+        write(": {");
+        indentPush();
+        writeNewline();
+
+        if (getter != null)
+        {
+            emitAccessor("get", getter);
+        }
+        if (setter != null)
+        {
+            write(",");
+            writeNewline();
+            emitAccessor("set", setter);
+        }
+
+        indentPop();
+        writeNewline();
+        write("}");
+
+    }
+
+    protected void emitAccessor(String kind, IAccessorDefinition definition)
+    {
+        IFunctionNode fnode = definition.getFunctionNode();
+
+        FunctionNode fn = (FunctionNode) fnode;
+        fn.parseFunctionBody(new ArrayList<ICompilerProblem>());
+
+        write(kind + ": function ");
+        write(definition.getBaseName() + "$" + kind);
+        emitParameters(fnode.getParametersContainerNode());
+        emitMethodScope(fnode.getScopedNode());
+    }
+
+    @Override
+    public void emitMethod(IFunctionNode node)
+    {
+        if (node.isConstructor())
+        {
+            emitConstructor(node);
+            return;
+        }
+
+        FunctionNode fn = (FunctionNode) node;
+        fn.parseFunctionBody(new ArrayList<ICompilerProblem>());
+        IFunctionDefinition definition = node.getDefinition();
+
+        String name = toPrivateName(definition);
+        write(name);
+        write(":");
+        write(" function ");
+        write(node.getName());
+        emitParameters(node.getParametersContainerNode());
+        emitMethodScope(node.getScopedNode());
+    }
+
+    @Override
+    public void emitFunctionBlockHeader(IFunctionNode node)
+    {
+        IFunctionDefinition definition = node.getDefinition();
+
+        if (node.isConstructor())
+        {
+            initializingFieldsInConstructor = true;
+            IClassDefinition type = (IClassDefinition) definition
+                    .getAncestorOfType(IClassDefinition.class);
+            // emit public fields init values
+            List<IVariableDefinition> fields = TempTools.getFields(type, true);
+            for (IVariableDefinition field : fields)
+            {
+                if (TempTools.isVariableAParameter(field,
+                        definition.getParameters()))
+                    continue;
+                write("this.");
+                write(field.getBaseName());
+                write(" = ");
+                emitFieldInitialValue((IVariableNode) field.getNode());
+                write(";");
+                writeNewline();
+            }
+            initializingFieldsInConstructor = false;
+        }
+
+        emitDefaultParameterCodeBlock(node);
+    }
+
+    private void emitDefaultParameterCodeBlock(IFunctionNode node)
+    {
+        // TODO (mschmalle|AMD) test for ... rest 
+        // if default parameters exist, produce the init code
+        IParameterNode[] pnodes = node.getParameterNodes();
+        Map<Integer, IParameterNode> defaults = TempTools.getDefaults(pnodes);
+        if (pnodes.length == 0)
+            return;
+
+        if (defaults != null)
+        {
+            boolean hasBody = node.getScopedNode().getChildCount() > 0;
+
+            if (!hasBody)
+            {
+                indentPush();
+                write(ASEmitterTokens.INDENT);
+            }
+
+            final StringBuilder code = new StringBuilder();
+
+            List<IParameterNode> parameters = new ArrayList<IParameterNode>(
+                    defaults.values());
+            Collections.reverse(parameters);
+
+            int len = defaults.size();
+            // make the header in reverse order
+            for (IParameterNode pnode : parameters)
+            {
+                if (pnode != null)
+                {
+                    code.setLength(0);
+
+                    code.append(ASEmitterTokens.IF.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.PAREN_OPEN.getToken());
+                    code.append(JSEmitterTokens.ARGUMENTS.getToken());
+                    code.append(ASEmitterTokens.MEMBER_ACCESS.getToken());
+                    code.append(JSAMDEmitterTokens.LENGTH.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.LESS_THAN.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(len);
+                    code.append(ASEmitterTokens.PAREN_CLOSE.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.BLOCK_OPEN.getToken());
+
+                    write(code.toString());
+
+                    indentPush();
+                    writeNewline();
+                }
+                len--;
+            }
+
+            Collections.reverse(parameters);
+            for (int i = 0, n = parameters.size(); i < n; i++)
+            {
+                IParameterNode pnode = parameters.get(i);
+
+                if (pnode != null)
+                {
+                    code.setLength(0);
+
+                    code.append(pnode.getName());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.EQUAL.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(pnode.getDefaultValue());
+                    code.append(ASEmitterTokens.SEMICOLON.getToken());
+                    write(code.toString());
+
+                    indentPop();
+                    writeNewline();
+
+                    write(ASEmitterTokens.BLOCK_CLOSE);
+
+                    if (i == n - 1 && !hasBody)
+                        indentPop();
+
+                    writeNewline();
+                }
+            }
+        }
+    }
+
+    @Override
+    public void emitParameter(IParameterNode node)
+    {
+        getWalker().walk(node.getNameExpressionNode());
+    }
+
+    @Override
+    public void emitMemberAccessExpression(IMemberAccessExpressionNode node)
+    {
+        getWalker().walk(node.getLeftOperandNode());
+        if (!(node.getLeftOperandNode() instanceof ILanguageIdentifierNode))
+            write(node.getOperator().getOperatorText());
+        getWalker().walk(node.getRightOperandNode());
+    }
+
+    @Override
+    public void emitFunctionCall(IFunctionCallNode node)
+    {
+        if (node.isNewExpression())
+        {
+            write(ASEmitterTokens.NEW);
+            write(ASEmitterTokens.SPACE);
+        }
+        //        IDefinition resolve = node.resolveType(project);
+        //        if (NativeUtils.isNative(resolve.getBaseName()))
+        //        {
+        //
+        //        }
+
+        getWalker().walk(node.getNameNode());
+
+        emitArguments(node.getArgumentsNode());
+    }
+
+    @Override
+    public void emitArguments(IContainerNode node)
+    {
+        IContainerNode newNode = node;
+        FunctionCallNode fnode = (FunctionCallNode) node.getParent();
+        if (TempTools.injectThisArgument(fnode, false))
+        {
+            IdentifierNode thisNode = new IdentifierNode("this");
+            newNode = EmitterUtils.insertArgumentsBefore(node, thisNode);
+        }
+
+        int len = newNode.getChildCount();
+        write(ASEmitterTokens.PAREN_OPEN);
+        for (int i = 0; i < len; i++)
+        {
+            IExpressionNode inode = (IExpressionNode) newNode.getChild(i);
+            if (inode.getNodeID() == ASTNodeID.IdentifierID)
+            {
+                emitArgumentIdentifier((IIdentifierNode) inode);
+            }
+            else
+            {
+                getWalker().walk(inode);
+            }
+
+            if (i < len - 1)
+            {
+                writeToken(ASEmitterTokens.COMMA);
+            }
+        }
+        write(ASEmitterTokens.PAREN_CLOSE);
+    }
+
+    private void emitArgumentIdentifier(IIdentifierNode node)
+    {
+        ITypeDefinition type = node.resolveType(getWalker().getProject());
+        if (type instanceof ClassTraitsDefinition)
+        {
+            String qualifiedName = type.getQualifiedName();
+            write(qualifiedName);
+        }
+        else
+        {
+            // XXX A problem?
+            getWalker().walk(node);
+        }
+    }
+
+    @Override
+    public void emitIdentifier(IIdentifierNode node)
+    {
+        ICompilerProject project = getWalker().getProject();
+
+        IDefinition resolve = node.resolve(project);
+        if (TempTools.isBinding(node, project))
+        {
+            // AS3.bind( this,"secret$1");
+            // this will happen on the right side of the = sign to bind a methof/function
+            // to a variable
+
+            write("AS3.bind(this, \"" + toPrivateName(resolve) + "\")");
+        }
+        else
+        {
+            IExpressionNode leftBase = TempTools.getNode(node, false, project);
+            if (leftBase == node)
+            {
+                if (TempTools.isValidThis(node, project))
+                    write("this.");
+                // in constructor and a type
+                if (initializingFieldsInConstructor
+                        && resolve instanceof IClassDefinition)
+                {
+                    String name = resolve.getBaseName();
+                    write("(" + name + "._ || " + name + "._$get())");
+                    return;
+                }
+            }
+
+            if (resolve != null)
+            {
+                // TODO (mschmalle|AMD) optimize
+                String name = toPrivateName(resolve);
+                if (NativeUtils.isNative(name))
+                    exportWriter.addDependency(name, name, true, false);
+
+                if (node.getParent() instanceof IMemberAccessExpressionNode)
+                {
+                    IMemberAccessExpressionNode mnode = (IMemberAccessExpressionNode) node
+                            .getParent();
+                    if (mnode.getLeftOperandNode().getNodeID() == ASTNodeID.SuperID)
+                    {
+                        IIdentifierNode lnode = (IIdentifierNode) mnode
+                                .getRightOperandNode();
+
+                        IClassNode cnode = (IClassNode) node
+                                .getAncestorOfType(IClassNode.class);
+
+                        initializeInheritenceLevel(cnode.getDefinition());
+
+                        // super.foo();
+                        write("this.");
+
+                        write(lnode.getName() + "$" + inheritenceLevel);
+
+                        baseClassCalls.add(resolve);
+
+                        return;
+                    }
+                }
+                write(name);
+            }
+            else
+            {
+                // no definition, just plain ole identifer
+                write(node.getName());
+            }
+        }
+    }
+
+    @Override
+    protected void emitType(IExpressionNode node)
+    {
+    }
+
+    @Override
+    public void emitLanguageIdentifier(ILanguageIdentifierNode node)
+    {
+        if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.ANY_TYPE)
+        {
+            write("");
+        }
+        else if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.REST)
+        {
+            write("");
+        }
+        else if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.SUPER)
+        {
+            IIdentifierNode inode = (IIdentifierNode) node;
+            if (inode.getParent() instanceof IMemberAccessExpressionNode)
+            {
+
+            }
+            else
+            {
+                write("Super.call");
+            }
+        }
+        else if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.THIS)
+        {
+            write("");
+        }
+        else if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.VOID)
+        {
+            write("");
+        }
+    }
+
+    private String toPrivateName(IDefinition definition)
+    {
+        if (definition instanceof ITypeDefinition)
+            return definition.getBaseName();
+        if (!definition.isPrivate())
+            return definition.getBaseName();
+
+        initializeInheritenceLevel(definition);
+
+        return definition.getBaseName() + "$" + inheritenceLevel;
+    }
+
+    void initializeInheritenceLevel(IDefinition definition)
+    {
+        if (inheritenceLevel != -1)
+            return;
+
+        IClassDefinition cdefinition = null;
+        if (definition instanceof IClassDefinition)
+            cdefinition = (IClassDefinition) definition;
+        else
+            cdefinition = (IClassDefinition) definition
+                    .getAncestorOfType(IClassDefinition.class);
+
+        ICompilerProject project = getWalker().getProject();
+        IClassDefinition[] ancestry = cdefinition.resolveAncestry(project);
+        inheritenceLevel = ancestry.length - 1;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDEmitterTokens.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDEmitterTokens.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDEmitterTokens.java
new file mode 100644
index 0000000..122f711
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/JSAMDEmitterTokens.java
@@ -0,0 +1,38 @@
+/*
+ *
+ *  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.internal.codegen.js.amd;
+
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+
+public enum JSAMDEmitterTokens implements IEmitterTokens
+{
+    DEFINE("define"), LENGTH("length"), ;
+
+    private String token;
+
+    private JSAMDEmitterTokens(String value)
+    {
+        token = value;
+    }
+
+    public String getToken()
+    {
+        return token;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/TempTools.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/TempTools.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/TempTools.java
new file mode 100644
index 0000000..4d0d6f2
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/amd/TempTools.java
@@ -0,0 +1,451 @@
+/*
+ *
+ *  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.internal.codegen.js.amd;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.definitions.IParameterDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.definitions.IVariableDefinition;
+import org.apache.flex.compiler.definitions.references.IReference;
+import org.apache.flex.compiler.internal.definitions.ClassTraitsDefinition;
+import org.apache.flex.compiler.internal.tree.as.ExpressionNodeBase;
+import org.apache.flex.compiler.internal.tree.as.FunctionCallNode;
+import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
+import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode.LanguageIdentifierKind;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+
+/**
+ * These tools need to be refactored into utility classes.
+ * 
+ * @author Michael Schmalle
+ */
+public class TempTools
+{
+
+    public static void fillStaticStatements(IClassNode node,
+            List<IASNode> list, boolean excludeFields)
+    {
+        int len = node.getScopedNode().getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            IASNode child = node.getScopedNode().getChild(i);
+            if (child instanceof IExpressionNode)
+                list.add(child);
+            else if (child instanceof IDefinitionNode)
+            {
+                if (!excludeFields
+                        && ((IDefinitionNode) child)
+                                .hasModifier(ASModifier.STATIC)
+                        && child instanceof IVariableNode)
+                    list.add(child);
+            }
+        }
+    }
+
+    public static void fillInstanceMembers(IDefinitionNode[] members,
+            List<IDefinitionNode> list)
+    {
+        for (IDefinitionNode node : members)
+        {
+            if (node instanceof IFunctionNode
+                    && ((IFunctionNode) node).isConstructor())
+                continue;
+
+            if (!node.hasModifier(ASModifier.STATIC))
+            {
+                list.add(node);
+            }
+        }
+    }
+
+    public static void fillStaticMembers(IDefinitionNode[] members,
+            List<IDefinitionNode> list, boolean excludeFields,
+            boolean excludeFunctions)
+    {
+        for (IDefinitionNode node : members)
+        {
+            if (node.hasModifier(ASModifier.STATIC))
+            {
+                if (!excludeFields && node instanceof IVariableNode)
+                    list.add(node);
+                else if (!excludeFunctions && node instanceof IFunctionNode)
+                    list.add(node);
+            }
+        }
+    }
+
+    public static List<IVariableDefinition> getFields(
+            IClassDefinition definition, boolean excludePrivate)
+    {
+        ArrayList<IVariableDefinition> result = new ArrayList<IVariableDefinition>();
+        Collection<IDefinition> definitions = definition.getContainedScope()
+                .getAllLocalDefinitions();
+        for (IDefinition member : definitions)
+        {
+            if (!member.isImplicit() && member instanceof IVariableDefinition)
+            {
+                IVariableDefinition vnode = (IVariableDefinition) member;
+                if (!member.isStatic()
+                        && (member.isPublic() || member.isProtected()))
+                    result.add(vnode);
+                // TODO FIX the logic here, this won't add twice though
+                if (!excludePrivate && member.isPrivate())
+                    result.add(vnode);
+            }
+        }
+        return result;
+    }
+
+    public static boolean isVariableAParameter(IVariableDefinition node,
+            IParameterDefinition[] parameters)
+    {
+        for (IParameterDefinition parameter : parameters)
+        {
+            if (node.getBaseName().equals(parameter.getBaseName()))
+                return true;
+        }
+        return false;
+    }
+
+    public static Map<Integer, IParameterNode> getDefaults(
+            IParameterNode[] nodes)
+    {
+        Map<Integer, IParameterNode> result = new HashMap<Integer, IParameterNode>();
+        int i = 0;
+        boolean hasDefaults = false;
+        for (IParameterNode node : nodes)
+        {
+            if (node.hasDefaultValue())
+            {
+                hasDefaults = true;
+                result.put(i, node);
+            }
+            else
+            {
+                result.put(i, null);
+            }
+            i++;
+        }
+
+        if (!hasDefaults)
+            return null;
+
+        return result;
+    }
+
+    public static boolean injectThisArgument(FunctionCallNode node,
+            boolean allowMembers)
+    {
+        // if super isSuper checks the nameNode
+        if (node.isSuperExpression() && !node.isNewExpression())
+            return true;
+
+        ExpressionNodeBase base = node.getNameNode();
+        if (base.getNodeID() == ASTNodeID.IdentifierID)
+            return false;
+
+        if (allowMembers && base instanceof IMemberAccessExpressionNode)
+        {
+            //  foo.super()
+            IMemberAccessExpressionNode mnode = (IMemberAccessExpressionNode) base;
+            if (mnode.getLeftOperandNode().getNodeID() == ASTNodeID.SuperID)
+                return true;
+        }
+
+        return false;
+    }
+
+    public static String toInitialValue(IVariableDefinition field,
+            ICompilerProject project)
+    {
+        Object value = field.resolveInitialValue(project);
+        if (value != null)
+            return value.toString();
+        IReference reference = field.getTypeReference();
+        if (reference == null)
+            return "undefined";
+        if (reference.getName().equals("int")
+                || reference.getName().equals("uint")
+                || reference.getName().equals("Number"))
+            return "0";
+        return "null";
+    }
+
+    public static boolean isBinding(IIdentifierNode node,
+            ICompilerProject project)
+    {
+        IDefinition resolve = node.resolve(project);
+
+        if (resolve != null && resolve.isPrivate() && !isField(resolve))
+        {
+            //if (resolve instanceof IFunctionDefinition)
+            IExpressionNode rightSide = getNode(node, true, project);
+            IBinaryOperatorNode parent = (IBinaryOperatorNode) node
+                    .getAncestorOfType(IBinaryOperatorNode.class);
+            if (isThisLeftOf(node))
+                parent = (IBinaryOperatorNode) parent
+                        .getAncestorOfType(IBinaryOperatorNode.class);
+
+            IVariableNode vparent = (IVariableNode) node
+                    .getAncestorOfType(IVariableNode.class);
+            if (vparent != null)
+            {
+                IExpressionNode indentFromThis = getIndentFromThis(node);
+                if (vparent.getAssignedValueNode() == node
+                        || ((IBinaryOperatorNode) vparent
+                                .getAssignedValueNode()).getRightOperandNode() == indentFromThis)
+                    return true;
+            }
+
+            if (rightSide == node && parent != null/*|| isThisLeftOf(node)*/)
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    private static boolean isField(IDefinition node)
+    {
+        return !(node instanceof IFunctionDefinition);
+    }
+
+    public static boolean isValidThis(IIdentifierNode node,
+            ICompilerProject project)
+    {
+        // added super.foo(), wanted to 'this' behind foo
+        if (node.getParent() instanceof IMemberAccessExpressionNode)
+        {
+            IMemberAccessExpressionNode mnode = (IMemberAccessExpressionNode) node
+                    .getParent();
+            if (mnode.getLeftOperandNode().getNodeID() == ASTNodeID.SuperID)
+                return false;
+
+            IExpressionNode indentFromThis = getIndentFromThis(node);
+            if (node == indentFromThis)
+                return true;
+
+            // test that this is the base expression
+            ExpressionNodeBase enode = (ExpressionNodeBase) node;
+            ExpressionNodeBase baseExpression = enode.getBaseExpression();
+            if (indentFromThis == null && baseExpression != null
+                    && baseExpression != node)
+                return false;
+
+            // check to see if the left is a type
+            ITypeDefinition type = mnode.getLeftOperandNode().resolveType(
+                    project);
+
+            // A.{foo} : Left is a Type
+            // XXX going to have to test packgeName to com.acme.A
+            if (type instanceof ClassTraitsDefinition
+                    && mnode.getLeftOperandNode() == node)
+            {
+                return false;
+            }
+            // this.{foo} : explicit 'this', in js we are ignoring explicit this identifiers
+            // because we are inserting all of them with the emitter
+            else if (indentFromThis == null)
+            {
+                //return false;
+            }
+
+        }
+
+        IDefinition definition = node.resolve(project);
+        if (definition == null)
+            return false; // Is this correct?
+        if (definition instanceof IParameterDefinition)
+            return false;
+        if (definition.getParent() instanceof IMemberAccessExpressionNode)
+            return false;
+        if (!(definition.getParent() instanceof IClassDefinition))
+            return false;
+
+        if (definition instanceof IVariableDefinition)
+        {
+            IVariableDefinition variable = (IVariableDefinition) definition;
+            if (variable.isStatic())
+                return false;
+        }
+        if (definition instanceof IFunctionDefinition)
+        {
+            IFunctionDefinition function = (IFunctionDefinition) definition;
+            if (function.isStatic())
+                return false;
+        }
+
+        return true;
+    }
+
+    private static boolean isThisLeftOf(IIdentifierNode node)
+    {
+        if (node.getParent() instanceof IMemberAccessExpressionNode)
+        {
+            IMemberAccessExpressionNode parent = (IMemberAccessExpressionNode) node
+                    .getParent();
+            if (parent.getLeftOperandNode() instanceof ILanguageIdentifierNode
+                    && ((ILanguageIdentifierNode) parent.getLeftOperandNode())
+                            .getKind() == LanguageIdentifierKind.THIS)
+                return true;
+        }
+        return false;
+    }
+
+    public static IExpressionNode getNode(IASNode iNode, Boolean toRight,
+            ICompilerProject project)
+    {
+        try
+        {
+            IASNode node = iNode;
+            while (node != null)
+            {
+                if (node instanceof IBinaryOperatorNode
+                        && !(node instanceof MemberAccessExpressionNode))
+                {
+                    if (toRight)
+                        node = ((IBinaryOperatorNode) node)
+                                .getRightOperandNode();
+                    else
+                        node = ((IBinaryOperatorNode) node)
+                                .getLeftOperandNode();
+                }
+                else if (node instanceof IFunctionCallNode)
+                    node = ((IFunctionCallNode) node).getNameNode();
+                else if (node instanceof IDynamicAccessNode)
+                    node = ((IDynamicAccessNode) node).getLeftOperandNode();
+                else if (node instanceof IUnaryOperatorNode)
+                    node = ((IUnaryOperatorNode) node).getOperandNode();
+                else if (node instanceof IForLoopNode)
+                    node = ((IForLoopNode) node).getChild(0).getChild(0);
+                else if (node instanceof IVariableNode)
+                {
+                    if (toRight)
+                        node = ((IVariableNode) node).getAssignedValueNode();
+                    else
+                        node = ((IVariableNode) node).getVariableTypeNode();
+                }
+                else if (node instanceof IExpressionNode)
+                {
+                    //                    IDefinition def = ((IExpressionNode) node).resolve(project);
+                    //                    if (def instanceof VariableDefinition)
+                    //                    {
+                    //                        final VariableDefinition variable = (VariableDefinition) def;
+                    //                        def = variable.resolveType(project);
+                    //                    }
+                    //                    else if (def instanceof FunctionDefinition)
+                    //                    {
+                    //                        final FunctionDefinition functionDef = (FunctionDefinition) def;
+                    //                        final IReference typeRef = functionDef
+                    //                                .getReturnTypeReference();
+                    //                        if (typeRef != null)
+                    //                            def = typeRef.resolve(project,
+                    //                                    (ASScope) getScopeFromNode(iNode),
+                    //                                    DependencyType.INHERITANCE, false);
+                    //                    }
+                    //                    else if (def instanceof IGetterDefinition)
+                    //                    {
+                    //                        final ITypeDefinition returnType = ((IGetterDefinition) def)
+                    //                                .resolveReturnType(project);
+                    //                        //                        def = m_sharedData.getDefinition(returnType
+                    //                        //                                .getQualifiedName());
+                    //                        def = returnType; // XXX figure out
+                    //                    }
+                    //
+                    //                    if (def != null && def instanceof ClassDefinition)
+                    //                    {
+                    //                        return def;
+                    //                    }
+                    return (IExpressionNode) node;
+                }
+                else
+                {
+                    node = null;
+                }
+            }
+        }
+        catch (Exception e)
+        {
+            // getDefinitionForNode(iNode,toRight);
+
+            // getDefinition() sometimes crashes, e.g. when looking at a cast to an interface in some cases,
+            // FunctionDefinition.getParameters() returns null and ExpressionNodeBase.determineIfFunction() chokes on it
+            //           printWarning(iNode, "getDefinitionForNode() failed for" + iNode);
+        }
+        return null;
+    }
+
+    private static IExpressionNode getIndentFromThis(IIdentifierNode node)
+    {
+        if (node.getParent() instanceof IMemberAccessExpressionNode)
+        {
+            IMemberAccessExpressionNode parent = (IMemberAccessExpressionNode) node
+                    .getParent();
+            if (parent.getLeftOperandNode() instanceof ILanguageIdentifierNode
+                    && ((ILanguageIdentifierNode) parent.getLeftOperandNode())
+                            .getKind() == LanguageIdentifierKind.THIS)
+                return parent.getRightOperandNode();
+        }
+        return null;
+    }
+
+    public static String toPackageName(String name)
+    {
+        if (!name.contains("."))
+            return name;
+        final String stem = name.substring(0, name.lastIndexOf("."));
+        return stem;
+    }
+
+    public static String toBaseName(String name)
+    {
+        if (!name.contains("."))
+            return name;
+        final String basename = name.substring(name.lastIndexOf(".") + 1);
+        return basename;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
new file mode 100644
index 0000000..057bcf1
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSDocEmitter.java
@@ -0,0 +1,391 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flex.compiler.asdoc.flexjs.ASDocComment;
+import org.apache.flex.compiler.clients.MXMLJSC;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.common.DependencyType;
+import org.apache.flex.compiler.constants.IASKeywordConstants;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.definitions.references.IReference;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogDocEmitter;
+import org.apache.flex.compiler.internal.scopes.ASScope;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+
+public class JSFlexJSDocEmitter extends JSGoogDocEmitter
+{
+    private List<String> classIgnoreList;
+    private List<String> ignoreList;
+    private List<String> coercionList;
+
+    public JSFlexJSDocEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    public List<String> getClassIgnoreList()
+    {
+        return classIgnoreList;
+    }
+    
+    public void setClassIgnoreList(List<String> value)
+    {
+        this.classIgnoreList = value;
+    }
+
+    @Override
+    protected String convertASTypeToJS(String name, String pname)
+    {
+        if (ignoreList != null)
+        {
+            if (ignoreList.contains(pname + "." + name))
+                return IASLanguageConstants.Object;
+        }
+        if (coercionList != null)
+        {
+            if (!coercionList.contains(pname + "." + name))
+                return IASLanguageConstants.Object;
+        }
+        if (classIgnoreList != null)
+        {
+            if (classIgnoreList.contains(pname + "." + name))
+                return IASLanguageConstants.Object;
+        }
+        if (name.matches("Vector\\.<.*>"))
+        	return IASLanguageConstants.Array;
+        
+        name = super.convertASTypeToJS(name, pname);
+        return formatQualifiedName(name);
+    }
+
+    @Override
+    protected String formatQualifiedName(String name)
+    {
+    	return ((JSFlexJSEmitter)emitter).formatQualifiedName(name, true);
+    }
+
+    @Override
+    public void emitMethodDoc(IFunctionNode node, ICompilerProject project)
+    {
+        coercionList = null;
+        ignoreList = null;
+
+        IClassDefinition classDefinition = resolveClassDefinition(node);
+
+        ASDocComment asDoc = (ASDocComment) node.getASDocComment();
+
+        if (node instanceof IFunctionNode)
+        {
+            boolean hasDoc = false;
+            Boolean override = false;
+            
+            if (node.isConstructor())
+            {
+                if (asDoc != null && MXMLJSC.keepASDoc)
+                    write(changeAnnotations(asDoc.commentNoEnd()));
+                else
+                    begin();
+                hasDoc = true;
+
+                emitJSDocLine(JSEmitterTokens.CONSTRUCTOR);
+
+                IClassDefinition parent = (IClassDefinition) node
+                        .getDefinition().getParent();
+                IClassDefinition superClass = parent.resolveBaseClass(project);
+                String qname = (superClass != null) ? project.getActualPackageName(superClass.getQualifiedName()) : null;
+
+                if (superClass != null
+                        && !qname.equals(IASLanguageConstants.Object))
+                    emitExtends(superClass, superClass.getPackageName());
+
+                IReference[] references = classDefinition
+                        .getImplementedInterfaceReferences();
+                for (IReference iReference : references)
+                {
+                    ITypeDefinition type = (ITypeDefinition) iReference
+                            .resolve(project, (ASScope) classDefinition
+                                    .getContainingScope(),
+                                    DependencyType.INHERITANCE, true);
+                    if (type == null) {
+                        System.out.println(iReference.getDisplayString()
+                                + " not resolved in "
+                                + classDefinition.getQualifiedName());
+                    } else {
+                        emitImplements(type, project.getActualPackageName(type.getPackageName()));
+                    }
+                }
+            }
+            else
+            {
+                // @override
+                override = node.hasModifier(ASModifier.OVERRIDE);
+
+                String ns = node.getNamespace();
+                if (ns != null)
+                {
+                    if (asDoc != null && MXMLJSC.keepASDoc)
+                    {
+                        String docText = asDoc.commentNoEnd();
+                        String keepToken = JSFlexJSEmitterTokens.EMIT_COERCION
+                                .getToken();
+                        if (docText.contains(keepToken))
+                            loadKeepers(docText);
+                        String ignoreToken = JSFlexJSEmitterTokens.IGNORE_COERCION
+                        		.getToken();
+		                if (docText.contains(ignoreToken))
+		                    loadIgnores(docText);
+                        write(changeAnnotations(asDoc.commentNoEnd()));
+                    }
+                    else
+                        begin();
+                    emitMethodAccess(node);
+                    hasDoc = true;
+                }
+            }
+
+            if (!override)
+            {
+	            // @param
+	            IParameterNode[] parameters = node.getParameterNodes();
+	            for (IParameterNode pnode : parameters)
+	            {
+	                if (!hasDoc)
+	                {
+	                    if (asDoc != null && MXMLJSC.keepASDoc)
+	                        write(changeAnnotations(asDoc.commentNoEnd()));
+	                    else
+	                        begin();
+	                    emitMethodAccess(node);
+	                    hasDoc = true;
+	                }
+	
+	                IExpressionNode enode = pnode.getNameExpressionNode();
+	
+	                // ToDo (erikdebruin): add VF2JS conditional -> only use check during full SDK compilation
+	                ITypeDefinition tdef = enode.resolveType(project);
+	                if (tdef == null)
+	                    continue;
+	
+	                emitParam(pnode, project.getActualPackageName(tdef.getPackageName()));
+	            }
+            }
+            
+            if (!node.isConstructor())
+            {
+            	if (!override)
+            	{
+	                // @return
+	                String returnType = node.getReturnType();
+	                if (returnType != ""
+	                        && returnType != ASEmitterTokens.VOID.getToken())
+	                {
+	                    if (!hasDoc)
+	                    {
+	                        if (asDoc != null && MXMLJSC.keepASDoc)
+	                            write(changeAnnotations(asDoc.commentNoEnd()));
+	                        else
+	                            begin();
+	                        emitMethodAccess(node);
+	                        hasDoc = true;
+	                    }
+	
+	                    ITypeDefinition tdef = ((IFunctionDefinition) node
+	                            .getDefinition()).resolveReturnType(project);
+	
+	                    String packageName = "";
+	                    packageName = tdef != null ? tdef.getPackageName() : "";
+	
+	                    emitReturn(node, project.getActualPackageName(packageName));
+	                }
+            	}
+            	
+                if (override)
+                {
+                    if (!hasDoc)
+                    {
+                        if (asDoc != null && MXMLJSC.keepASDoc)
+                            write(changeAnnotations(asDoc.commentNoEnd()));
+                        else
+                            begin();
+                        emitMethodAccess(node);
+                        hasDoc = true;
+                    }
+
+                    emitOverride(node);
+                }
+            }
+
+            if (hasDoc)
+                end();
+        }
+    }
+
+    private void loadIgnores(String doc)
+    {
+    	ignoreList = new ArrayList<String>();
+        String ignoreToken = JSFlexJSEmitterTokens.IGNORE_COERCION.getToken();
+        int index = doc.indexOf(ignoreToken);
+        while (index != -1)
+        {
+            String ignore = doc.substring(index + ignoreToken.length());
+            int endIndex = ignore.indexOf("\n");
+            ignore = ignore.substring(0, endIndex);
+            ignore = ignore.trim();
+            ignoreList.add(ignore);
+            index = doc.indexOf(ignoreToken, index + endIndex);
+        }
+    }
+    
+    private void loadKeepers(String doc)
+    {
+    	coercionList = new ArrayList<String>();
+        String keepToken = JSFlexJSEmitterTokens.EMIT_COERCION.getToken();
+        int index = doc.indexOf(keepToken);
+        while (index != -1)
+        {
+            String keeper = doc.substring(index + keepToken.length());
+            int endIndex = keeper.indexOf("\n");
+            keeper = keeper.substring(0, endIndex);
+            keeper = keeper.trim();
+            coercionList.add(keeper);
+            index = doc.indexOf(keepToken, index + endIndex);
+        }
+    }
+
+    private String changeAnnotations(String doc)
+    {
+        // rename these tags so they don't conflict with generated
+        // jsdoc tags
+        String pass1 = doc.replaceAll("@param", "@asparam");
+        String pass2 = pass1.replaceAll("@return", "@asreturn");
+        String pass3 = pass2.replaceAll("@private", "@asprivate");
+        return pass3;
+    }
+
+    public void emitInterfaceMemberDoc(IDefinitionNode node,
+            ICompilerProject project)
+    {
+        boolean hasDoc = false;
+
+        ASDocComment asDoc = (ASDocComment) ((IFunctionNode) node)
+                .getASDocComment();
+
+        String returnType = ((IFunctionNode) node).getReturnType();
+        if (returnType != "" && returnType != ASEmitterTokens.VOID.getToken()) // has return
+        {
+            if (asDoc != null && MXMLJSC.keepASDoc)
+                write(changeAnnotations(asDoc.commentNoEnd()));
+            else
+                begin();
+            hasDoc = true;
+
+            ITypeDefinition tdef = ((IFunctionDefinition) node.getDefinition())
+                    .resolveReturnType(project);
+
+            emitReturn((IFunctionNode) node, tdef.getPackageName());
+        }
+
+        IParameterNode[] parameters = ((IFunctionNode) node)
+                .getParameterNodes();
+        for (IParameterNode pnode : parameters)
+        {
+            if (!hasDoc)
+            {
+                if (asDoc != null && MXMLJSC.keepASDoc)
+                    write(changeAnnotations(asDoc.commentNoEnd()));
+                else
+                    begin();
+                hasDoc = true;
+            }
+
+            IExpressionNode enode = pnode.getNameExpressionNode();
+            emitParam(pnode, enode.resolveType(project).getPackageName());
+        }
+
+        if (hasDoc)
+            end();
+    }
+
+    @Override
+    public void emitMethodAccess(IFunctionNode node)
+    {
+        String ns = node.getNamespace();
+        if (ns == IASKeywordConstants.PRIVATE)
+        {
+            emitPrivate(node);
+        }
+        else if (ns == IASKeywordConstants.PROTECTED)
+        {
+            emitProtected(node);
+        }
+        else if (ns == IASKeywordConstants.PUBLIC)
+        {
+            emitPublic(node);
+        }
+    }
+
+    @Override
+    public void emitFieldDoc(IVariableNode node, IDefinition def, ICompilerProject project)
+    {
+        begin();
+
+        String ns = node.getNamespace();
+        if (ns == IASKeywordConstants.PRIVATE)
+        {
+            emitPrivate(node);
+        }
+        else if (ns == IASKeywordConstants.PROTECTED)
+        {
+            emitProtected(node);
+        }
+        else
+        {
+            emitPublic(node);
+        }
+
+        if (node.isConst())
+            emitConst(node);
+
+        String packageName = "";
+        if (def != null)
+            packageName = def.getPackageName();
+
+        emitType(node, project.getActualPackageName(packageName));
+
+        end();
+    }
+
+}


[48/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/clients/ExternCConfiguration.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/clients/ExternCConfiguration.java b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/ExternCConfiguration.java
new file mode 100644
index 0000000..7eea457
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/ExternCConfiguration.java
@@ -0,0 +1,357 @@
+/*
+ *
+ *  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.clients;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.config.ConfigurationValue;
+import org.apache.flex.compiler.exceptions.ConfigurationException.CannotOpen;
+import org.apache.flex.compiler.exceptions.ConfigurationException.IncorrectArgumentCount;
+import org.apache.flex.compiler.internal.codegen.externals.pass.ReferenceCompiler.ExternalFile;
+import org.apache.flex.compiler.internal.codegen.externals.reference.BaseReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.FieldReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.MemberReference;
+import org.apache.flex.compiler.internal.config.annotations.Arguments;
+import org.apache.flex.compiler.internal.config.annotations.Config;
+import org.apache.flex.compiler.internal.config.annotations.InfiniteArguments;
+import org.apache.flex.compiler.internal.config.annotations.Mapping;
+import org.apache.flex.utils.FilenameNormalization;
+
+public class ExternCConfiguration extends Configuration
+{
+    private File jsRoot;
+
+    private File asRoot;
+    
+    private File asClassRoot;
+    private File asInterfaceRoot;
+    private File asFunctionRoot;
+    private File asConstantRoot;
+    private File asTypeDefRoot;
+
+    private List<ExternalFile> externals = new ArrayList<ExternalFile>();
+    private List<ExternalFile> externalExterns = new ArrayList<ExternalFile>();
+
+    private List<String> classToFunctions = new ArrayList<String>();
+    private List<ExcludedMember> excludesClass = new ArrayList<ExcludedMember>();
+    private List<ExcludedMember> excludesField = new ArrayList<ExcludedMember>();
+    private List<ExcludedMember> excludes = new ArrayList<ExcludedMember>();
+
+    public ExternCConfiguration()
+    {
+    }
+
+    public File getAsRoot()
+    {
+        return asRoot;
+    }
+
+    @Config
+    @Mapping("as-root")
+    public void setASRoot(ConfigurationValue cfgval, String filename) throws CannotOpen
+    {
+    	setASRoot(new File(FilenameNormalization.normalize(getOutputPath(cfgval, filename))));
+    }
+    
+    public void setASRoot(File file)
+    {
+        this.asRoot = file;
+
+        asClassRoot = new File(asRoot, "classes");
+        asInterfaceRoot = new File(asRoot, "interfaces");
+        asFunctionRoot = new File(asRoot, "functions");
+        asConstantRoot = new File(asRoot, "constants");
+        asTypeDefRoot = new File(asRoot, "typedefs");
+    }
+
+    public File getAsClassRoot()
+    {
+        return asClassRoot;
+    }
+
+    public File getAsInterfaceRoot()
+    {
+        return asInterfaceRoot;
+    }
+
+    public File getAsFunctionRoot()
+    {
+        return asFunctionRoot;
+    }
+
+    public File getAsConstantRoot()
+    {
+        return asConstantRoot;
+    }
+
+    public File getAsTypeDefRoot()
+    {
+        return asTypeDefRoot;
+    }
+
+    public Collection<ExternalFile> getExternals()
+    {
+        return externals;
+    }
+
+    public Collection<ExternalFile> getExternalExterns()
+    {
+        return externalExterns;
+    }
+
+    public boolean isClassToFunctions(String className)
+    {
+        return classToFunctions.contains(className);
+    }
+
+    public void addClassToFunction(String className)
+    {
+        classToFunctions.add(className);
+    }
+
+    public void addExternal(File file) throws IOException
+    {
+        if (!file.exists())
+            throw new IOException(file.getAbsolutePath() + " does not exist.");
+        externals.add(new ExternalFile(file));
+    }
+
+    public void addExternal(String externalFile) throws IOException
+    {
+        addExternal(new File(FilenameNormalization.normalize(externalFile)));
+    }
+
+    public void addExternalExtern(File file) throws IOException
+    {
+        if (!file.exists())
+            throw new IOException(file.getAbsolutePath() + " does not exist.");
+        externalExterns.add(new ExternalFile(file));
+    }
+
+    public void addExternalExtern(String externalFile) throws IOException
+    {
+        addExternalExtern(new File(FilenameNormalization.normalize(externalFile)));
+    }
+
+    @Config(allowMultiple = true)
+    @Mapping("class-to-function")
+    @Arguments(Arguments.CLASS)
+    public void setClassToFunctions(ConfigurationValue cfgval, List<String> values) throws IncorrectArgumentCount
+    {
+        addClassToFunction(values.get(0));
+    }
+
+    @Config(allowMultiple = true, isPath = true)
+    @Mapping("external")
+    @Arguments(Arguments.PATH_ELEMENT)
+    @InfiniteArguments
+    public void setExternal(ConfigurationValue cfgval, String[] vals) throws IOException, CannotOpen
+    {
+    	for (String val : vals)
+    		addExternal(resolvePathStrict(val, cfgval));
+    }
+
+    @Config(allowMultiple = true, isPath = true)
+    @Mapping("external-externs")
+    @Arguments(Arguments.PATH_ELEMENT)
+    @InfiniteArguments
+    public void setExternalExterns(ConfigurationValue cfgval, String[] vals) throws IOException, CannotOpen
+    {
+        for (String val : vals)
+            addExternalExtern(resolvePathStrict(val, cfgval));
+    }
+    
+    public boolean isExternalExtern(BaseReference reference)
+    {
+        String sourceFileName = reference.getNode().getSourceFileName();
+        for (ExternalFile file : externalExterns)
+        {
+            if (sourceFileName.equals("[" + file.getName() + "]"))
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+    
+    public ExcludedMember isExcludedClass(ClassReference classReference)
+    {
+        for (ExcludedMember memeber : excludesClass)
+        {
+            if (memeber.isExcluded(classReference, null))
+                return memeber;
+        }
+        return null;
+    }
+
+    public ExcludedMember isExcludedMember(ClassReference classReference,
+            MemberReference memberReference)
+    {
+        if (memberReference instanceof FieldReference)
+        {
+            for (ExcludedMember memeber : excludesField)
+            {
+                if (memeber.isExcluded(classReference, memberReference))
+                    return memeber;
+            }
+        }
+        for (ExcludedMember memeber : excludes)
+        {
+            if (memeber.isExcluded(classReference, memberReference))
+                return memeber;
+        }
+        return null;
+    }
+
+    @Config(allowMultiple = true)
+    @Mapping("exclude")
+    @Arguments({"class", "name"})
+    public void setExcludes(ConfigurationValue cfgval, List<String> values) throws IncorrectArgumentCount
+    {
+        final int size = values.size();
+        if (size % 2 != 0)
+            throw new IncorrectArgumentCount(size + 1, size, cfgval.getVar(), cfgval.getSource(), cfgval.getLine());
+
+        for (int nameIndex = 0; nameIndex < size - 1; nameIndex += 2)
+        {
+            final String className = values.get(nameIndex);
+            final String name = values.get(nameIndex + 1);
+        	addExclude(className, name);
+        }
+    }
+    
+    public void addExclude(String className, String name)
+    {
+        excludes.add(new ExcludedMember(className, name));
+    }
+
+    public void addExclude(String className, String name, String description)
+    {
+        excludes.add(new ExcludedMember(className, name, description));
+    }
+
+    @Config(allowMultiple = true)
+    @Mapping("field-exclude")
+    @Arguments({"class", "field"})
+    public void setFieldExcludes(ConfigurationValue cfgval, List<String> values) throws IncorrectArgumentCount
+    {
+        final int size = values.size();
+        if (size % 2 != 0)
+            throw new IncorrectArgumentCount(size + 1, size, cfgval.getVar(), cfgval.getSource(), cfgval.getLine());
+
+        for (int nameIndex = 0; nameIndex < size - 1; nameIndex += 2)
+        {
+            final String className = values.get(nameIndex);
+            final String fieldName = values.get(nameIndex + 1);
+        	addFieldExclude(className, fieldName);
+        }
+    }
+    
+    public void addFieldExclude(String className, String fieldName)
+    {
+        excludesField.add(new ExcludedMember(className, fieldName, ""));
+    }
+
+    @Config(allowMultiple = true)
+    @Mapping("class-exclude")
+    @Arguments("class")
+    public void setClassExcludes(ConfigurationValue cfgval, List<String> values)
+    {
+    	for (String className : values)
+    		addClassExclude(className);
+    }
+    public void addClassExclude(String className)
+    {
+        excludesClass.add(new ExcludedMember(className, null, ""));
+    }
+
+    public File getJsRoot()
+    {
+        return jsRoot;
+    }
+
+    @Config
+    @Mapping("js-root")
+    public void setJSRoot(ConfigurationValue cfgval, String filename) throws CannotOpen
+    {
+        this.jsRoot = new File(filename);
+    }
+
+
+    public static class ExcludedMember
+    {
+        private String className;
+        private String name;
+        private String description;
+
+        public String getClassName()
+        {
+            return className;
+        }
+
+        public String getName()
+        {
+            return name;
+        }
+
+        public String getDescription()
+        {
+            return description;
+        }
+
+        public ExcludedMember(String className, String name)
+        {
+            this.className = className;
+            this.name = name;
+        }
+
+        public ExcludedMember(String className, String name, String description)
+        {
+            this.className = className;
+            this.name = name;
+            this.description = description;
+        }
+
+        public boolean isExcluded(ClassReference classReference,
+                MemberReference memberReference)
+        {
+            if (memberReference == null)
+            {
+                return classReference.getQualifiedName().equals(className);
+            }
+            return classReference.getQualifiedName().equals(className)
+                    && memberReference.getQualifiedName().equals(name);
+        }
+
+        public void print(StringBuilder sb)
+        {
+            if (description != null)
+                sb.append("// " + description + "\n");
+            sb.append("//");
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/clients/FlexJSToolGroup.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/clients/FlexJSToolGroup.java b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/FlexJSToolGroup.java
new file mode 100644
index 0000000..e99a5ab
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/FlexJSToolGroup.java
@@ -0,0 +1,37 @@
+/*
+ *
+ *  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.clients;
+
+import org.apache.flex.compiler.internal.driver.mxml.flexjs.MXMLFlexJSBackend;
+import org.apache.flex.tools.AbstractFlexToolGroup;
+
+/**
+ * Created by christoferdutz on 10.11.14.
+ */
+public class FlexJSToolGroup extends AbstractFlexToolGroup {
+
+    public FlexJSToolGroup() {
+        super("FlexJS");
+        addFlexTool(new COMPJSC(new MXMLFlexJSBackend()));
+        addFlexTool(new MXMLJSC(new MXMLFlexJSBackend()));
+        addFlexTool(new EXTERNC());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/clients/JSCompilerEntryPoint.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/clients/JSCompilerEntryPoint.java b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/JSCompilerEntryPoint.java
new file mode 100644
index 0000000..0ffa22e
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/JSCompilerEntryPoint.java
@@ -0,0 +1,29 @@
+/*
+ *
+ *  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.clients;
+
+import org.apache.flex.compiler.problems.ICompilerProblem;
+
+import java.util.List;
+
+public interface JSCompilerEntryPoint {
+    public int mainNoExit(final String[] args, List<ICompilerProblem> problems,
+                          Boolean printProblems);
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/clients/JSConfiguration.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/clients/JSConfiguration.java b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/JSConfiguration.java
new file mode 100644
index 0000000..3ce8665
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/JSConfiguration.java
@@ -0,0 +1,83 @@
+/*
+ *
+ *  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.clients;
+
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.config.ConfigurationValue;
+import org.apache.flex.compiler.exceptions.ConfigurationException;
+import org.apache.flex.compiler.internal.config.annotations.Config;
+import org.apache.flex.compiler.internal.config.annotations.Mapping;
+
+/**
+ * The {@link JSConfiguration} class holds all compiler arguments needed for
+ * compiling ActionScript to JavaScript.
+ * <p>
+ * Specific flags are implemented here for the configuration to be loaded by the
+ * configure() method of {@link MXMLJSC}.
+ * <p>
+ * This class inherits all compiler arguments from the MXMLC compiler.
+ * 
+ * @author Michael Schmalle
+ */
+public class JSConfiguration extends Configuration
+{
+    public JSConfiguration()
+    {
+    }
+
+    //
+    // 'js-output-type'
+    //
+
+    private String jsOutputType = MXMLJSC.JSOutputType.FLEXJS.getText();
+
+    public String getJSOutputType()
+    {
+        return jsOutputType;
+    }
+
+    @Config
+    @Mapping("js-output-type")
+    public void setJSOutputType(ConfigurationValue cv, String value)
+            throws ConfigurationException
+    {
+        jsOutputType = value;
+    }
+
+    //
+    // 'source-map'
+    //
+
+    private boolean sourceMap = false;
+
+    public boolean getSourceMap()
+    {
+        return sourceMap;
+    }
+
+    @Config
+    @Mapping("source-map")
+    public void setSourceMap(ConfigurationValue cv, boolean value)
+            throws ConfigurationException
+    {
+        sourceMap = value;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/clients/MXMLJSC.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/clients/MXMLJSC.java b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/MXMLJSC.java
new file mode 100644
index 0000000..d324c9f
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/MXMLJSC.java
@@ -0,0 +1,847 @@
+/*
+ *
+ *  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.clients;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.io.FilenameUtils;
+import org.apache.flex.compiler.clients.problems.ProblemPrinter;
+import org.apache.flex.compiler.clients.problems.ProblemQuery;
+import org.apache.flex.compiler.clients.problems.ProblemQueryProvider;
+import org.apache.flex.compiler.clients.problems.WorkspaceProblemFormatter;
+import org.apache.flex.compiler.codegen.js.IJSPublisher;
+import org.apache.flex.compiler.codegen.js.IJSWriter;
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.config.ConfigurationBuffer;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.config.ICompilerSettingsConstants;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.driver.js.IJSApplication;
+import org.apache.flex.compiler.exceptions.ConfigurationException;
+import org.apache.flex.compiler.exceptions.ConfigurationException.IOError;
+import org.apache.flex.compiler.exceptions.ConfigurationException.MustSpecifyTarget;
+import org.apache.flex.compiler.exceptions.ConfigurationException.OnlyOneSource;
+import org.apache.flex.compiler.internal.codegen.js.JSSharedData;
+import org.apache.flex.compiler.internal.config.FlashBuilderConfigurator;
+import org.apache.flex.compiler.internal.driver.as.ASBackend;
+import org.apache.flex.compiler.internal.driver.js.amd.AMDBackend;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.driver.js.jsc.JSCBackend;
+import org.apache.flex.compiler.internal.driver.js.node.NodeBackend;
+import org.apache.flex.compiler.internal.driver.mxml.flexjs.MXMLFlexJSBackend;
+import org.apache.flex.compiler.internal.driver.mxml.vf2js.MXMLVF2JSBackend;
+import org.apache.flex.compiler.internal.parsing.as.FlexJSASDocDelegate;
+import org.apache.flex.compiler.internal.projects.CompilerProject;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.internal.units.ResourceModuleCompilationUnit;
+import org.apache.flex.compiler.internal.units.SourceCompilationUnitFactory;
+import org.apache.flex.compiler.internal.workspaces.Workspace;
+import org.apache.flex.compiler.problems.ConfigurationProblem;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.problems.InternalCompilerProblem;
+import org.apache.flex.compiler.problems.UnableToBuildSWFProblem;
+import org.apache.flex.compiler.problems.UnexpectedExceptionProblem;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.targets.ITarget;
+import org.apache.flex.compiler.targets.ITarget.TargetType;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.tools.FlexTool;
+import org.apache.flex.utils.ArgumentUtil;
+import org.apache.flex.utils.FilenameNormalization;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Iterables;
+
+/**
+ * @author Erik de Bruin
+ * @author Michael Schmalle
+ */
+public class MXMLJSC implements JSCompilerEntryPoint, ProblemQueryProvider,
+        FlexTool
+{
+    @Override
+    public ProblemQuery getProblemQuery()
+    {
+        return problems;
+    }
+
+    /*
+    	 * JS output type enumerations.
+    	 */
+    public enum JSOutputType
+    {
+        AMD("amd"),
+        FLEXJS("flexjs"),
+        GOOG("goog"),
+        VF2JS("vf2js"),
+        FLEXJS_DUAL("flexjs_dual"),
+        JSC("jsc"),
+        NODE("node");
+
+        private String text;
+
+        JSOutputType(String text)
+        {
+            this.text = text;
+        }
+
+        public String getText()
+        {
+            return this.text;
+        }
+
+        public static JSOutputType fromString(String text)
+        {
+            for (JSOutputType jsOutputType : JSOutputType.values())
+            {
+                if (text.equalsIgnoreCase(jsOutputType.text))
+                    return jsOutputType;
+            }
+            return GOOG;
+        }
+    }
+
+    /*
+     * Exit code enumerations.
+     */
+    static enum ExitCode
+    {
+        SUCCESS(0),
+        PRINT_HELP(1),
+        FAILED_WITH_PROBLEMS(2),
+        FAILED_WITH_ERRORS(3),
+        FAILED_WITH_EXCEPTIONS(4),
+        FAILED_WITH_CONFIG_PROBLEMS(5);
+
+        ExitCode(int code)
+        {
+            this.code = code;
+        }
+
+        final int code;
+    }
+
+    public static JSOutputType jsOutputType;
+    public static boolean keepASDoc;
+
+    @Override
+    public String getName()
+    {
+        return FLEX_TOOL_MXMLC;
+    }
+
+    @Override
+    public int execute(String[] args)
+    {
+        final List<ICompilerProblem> problems = new ArrayList<ICompilerProblem>();
+        return mainNoExit(args, problems, true);
+    }
+
+    /**
+     * Java program entry point.
+     * 
+     * @param args command line arguments
+     */
+    public static void main(final String[] args)
+    {
+        int exitCode = staticMainNoExit(args);
+        System.exit(exitCode);
+    }
+
+    /**
+     * Entry point for the {@code <compc>} Ant task.
+     *
+     * @param args Command line arguments.
+     * @return An exit code.
+     */
+    public static int staticMainNoExit(final String[] args)
+    {
+        long startTime = System.nanoTime();
+
+        IBackend backend = new ASBackend();
+        String jsOutputTypeString = "";
+        for (String s : args)
+        {
+            String[] kvp = s.split("=");
+
+            if (s.contains("-js-output-type"))
+            {
+                jsOutputTypeString = kvp[1];
+            }
+        }
+
+        if (jsOutputTypeString.equals(""))
+        {
+            jsOutputTypeString = JSOutputType.FLEXJS.getText();
+        }
+
+        jsOutputType = JSOutputType.fromString(jsOutputTypeString);
+        switch (jsOutputType)
+        {
+        case AMD:
+            backend = new AMDBackend();
+            break;
+        case JSC:
+            backend = new JSCBackend();
+            break;
+        case NODE:
+            backend = new NodeBackend();
+            break;
+        case FLEXJS:
+        case FLEXJS_DUAL:
+            backend = new MXMLFlexJSBackend();
+            break;
+        case GOOG:
+            backend = new GoogBackend();
+            break;
+        case VF2JS:
+            backend = new MXMLVF2JSBackend();
+            break;
+        // if you add a new js-output-type here, don't forget to also add it
+        // to flex2.tools.MxmlJSC in flex-compiler-oem for IDE support
+        }
+
+        final MXMLJSC mxmlc = new MXMLJSC(backend);
+        final List<ICompilerProblem> problems = new ArrayList<ICompilerProblem>();
+        final int exitCode = mxmlc.mainNoExit(args, problems, true);
+
+        long endTime = System.nanoTime();
+        JSSharedData.instance.stdout((endTime - startTime) / 1e9 + " seconds");
+
+        return exitCode;
+    }
+
+    protected Workspace workspace;
+    protected FlexJSProject project;
+
+    protected ProblemQuery problems;
+    protected ISourceFileHandler asFileHandler;
+    protected Configuration config;
+    protected Configurator projectConfigurator;
+    private ConfigurationBuffer configBuffer;
+    private ICompilationUnit mainCU;
+    protected ITarget target;
+    protected ITargetSettings targetSettings;
+    protected IJSApplication jsTarget;
+    private IJSPublisher jsPublisher;
+
+    public MXMLJSC(IBackend backend)
+    {
+        JSSharedData.backend = backend;
+        workspace = new Workspace();
+        workspace.setASDocDelegate(new FlexJSASDocDelegate());
+        project = new FlexJSProject(workspace);
+        problems = new ProblemQuery(); // this gets replaced in configure().  Do we need it here?
+        JSSharedData.OUTPUT_EXTENSION = backend.getOutputExtension();
+        JSSharedData.workspace = workspace;
+        asFileHandler = backend.getSourceFileHandlerInstance();
+    }
+
+    @Override
+    public int mainNoExit(final String[] args, List<ICompilerProblem> problems,
+            Boolean printProblems)
+    {
+        int exitCode = -1;
+        try
+        {
+            exitCode = _mainNoExit(ArgumentUtil.fixArgs(args), problems);
+        }
+        catch (Exception e)
+        {
+            JSSharedData.instance.stderr(e.toString());
+        }
+        finally
+        {
+            if (problems != null && !problems.isEmpty())
+            {
+                if (printProblems)
+                {
+                    final WorkspaceProblemFormatter formatter = new WorkspaceProblemFormatter(
+                            workspace);
+                    final ProblemPrinter printer = new ProblemPrinter(formatter);
+                    printer.printProblems(problems);
+                }
+            }
+        }
+        return exitCode;
+    }
+
+    /**
+     * Entry point that doesn't call <code>System.exit()</code>. This is for
+     * unit testing.
+     * 
+     * @param args command line arguments
+     * @return exit code
+     */
+    private int _mainNoExit(final String[] args,
+            List<ICompilerProblem> outProblems)
+    {
+        ExitCode exitCode = ExitCode.SUCCESS;
+        try
+        {
+            String[] adjustedArgs = args;
+
+            if (jsOutputType != null)
+            {
+                switch (jsOutputType)
+                {
+                case VF2JS:
+                    boolean isFlashBuilderProject = useFlashBuilderProjectFiles(args);
+
+                    if (isFlashBuilderProject)
+                    {
+                        adjustedArgs = FlashBuilderConfigurator.computeFlashBuilderArgs(
+                                adjustedArgs, getTargetType().getExtension());
+                    }
+
+                    //String projectFilePath = adjustedArgs[adjustedArgs.length - 1];
+                    //
+                    //String newProjectFilePath = VF2JSProjectUtils
+                    //        .createTempProject(projectFilePath,
+                    //                isFlashBuilderProject);
+                    //
+                    //adjustedArgs[adjustedArgs.length - 1] = newProjectFilePath;
+
+                    break;
+                default:
+                    break;
+                }
+            }
+
+            final boolean continueCompilation = configure(adjustedArgs);
+
+            // ToDo (erikdebruin): use JSSharedData for globals ...
+            keepASDoc = ((JSGoogConfiguration) config).getKeepASDoc();
+
+            if (outProblems != null && !config.isVerbose())
+                JSSharedData.STDOUT = JSSharedData.STDERR = null;
+
+            if (continueCompilation)
+            {
+                project.setProblems(problems.getProblems());
+                compile();
+                if (problems.hasFilteredProblems())
+                {
+                    if (problems.hasErrors())
+                        exitCode = ExitCode.FAILED_WITH_ERRORS;
+                    else
+                        exitCode = ExitCode.FAILED_WITH_PROBLEMS;
+                }
+            }
+            else if (problems.hasFilteredProblems())
+            {
+                exitCode = ExitCode.FAILED_WITH_CONFIG_PROBLEMS;
+            }
+            else
+            {
+                exitCode = ExitCode.PRINT_HELP;
+            }
+        }
+        catch (Exception e)
+        {
+            if (outProblems == null)
+                JSSharedData.instance.stderr(e.getMessage());
+            else
+            {
+                final ICompilerProblem unexpectedExceptionProblem = new UnexpectedExceptionProblem(
+                        e);
+                problems.add(unexpectedExceptionProblem);
+            }
+            exitCode = ExitCode.FAILED_WITH_EXCEPTIONS;
+        }
+        finally
+        {
+            waitAndClose();
+
+            if (outProblems != null && problems.hasFilteredProblems())
+            {
+                for (ICompilerProblem problem : problems.getFilteredProblems())
+                {
+                    outProblems.add(problem);
+                }
+            }
+        }
+        return exitCode.code;
+    }
+
+    /**
+     * Main body of this program. This method is called from the public static
+     * method's for this program.
+     * 
+     * @return true if compiler succeeds
+     * @throws IOException
+     * @throws InterruptedException
+     */
+    protected boolean compile()
+    {
+        boolean compilationSuccess = false;
+
+        try
+        {
+            project.getSourceCompilationUnitFactory().addHandler(asFileHandler);
+
+            if (!setupTargetFile())
+                return false;
+
+            buildArtifact();
+
+            if (jsTarget != null)
+            {
+                List<ICompilerProblem> errors = new ArrayList<ICompilerProblem>();
+                List<ICompilerProblem> warnings = new ArrayList<ICompilerProblem>();
+
+                if (!config.getCreateTargetWithErrors())
+                {
+                    problems.getErrorsAndWarnings(errors, warnings);
+                    if (errors.size() > 0)
+                        return false;
+                }
+
+                jsPublisher = (IJSPublisher) JSSharedData.backend.createPublisher(
+                        project, errors, config);
+
+                File outputFolder = jsPublisher.getOutputFolder();
+
+                ArrayList<ICompilationUnit> roots = new ArrayList<ICompilationUnit>();
+                roots.add(mainCU);
+                Set<ICompilationUnit> incs = target.getIncludesCompilationUnits();
+                roots.addAll(incs);
+                List<ICompilationUnit> reachableCompilationUnits = project.getReachableCompilationUnitsInSWFOrder(roots);
+                for (final ICompilationUnit cu : reachableCompilationUnits)
+                {
+                    ICompilationUnit.UnitType cuType = cu.getCompilationUnitType();
+
+                    if (cuType == ICompilationUnit.UnitType.AS_UNIT
+                            || cuType == ICompilationUnit.UnitType.MXML_UNIT)
+                    {
+                        final File outputClassFile = getOutputClassFile(
+                                cu.getQualifiedNames().get(0), outputFolder);
+
+                        System.out.println("Compiling file: " + outputClassFile);
+
+                        ICompilationUnit unit = cu;
+
+                        IJSWriter writer;
+                        if (cuType == ICompilationUnit.UnitType.AS_UNIT)
+                        {
+                            writer = (IJSWriter) JSSharedData.backend.createWriter(project,
+                                    errors, unit, false);
+                        }
+                        else
+                        {
+                            writer = (IJSWriter) JSSharedData.backend.createMXMLWriter(
+                                    project, errors, unit, false);
+                        }
+
+                        BufferedOutputStream out = new BufferedOutputStream(
+                                new FileOutputStream(outputClassFile));
+
+                        File outputSourceMapFile = null;
+                        if (project.config.getSourceMap())
+                        {
+                            outputSourceMapFile = getOutputSourceMapFile(
+                                    cu.getQualifiedNames().get(0), outputFolder);
+                        }
+                        
+                        writer.writeTo(out, outputSourceMapFile);
+                        out.flush();
+                        out.close();
+                        writer.close();
+                    }
+                }
+
+                if (jsPublisher != null)
+                {
+                    compilationSuccess = jsPublisher.publish(problems);
+                }
+                else
+                {
+                    compilationSuccess = true;
+                }
+            }
+        }
+        catch (Exception e)
+        {
+            final ICompilerProblem problem = new InternalCompilerProblem(e);
+            problems.add(problem);
+        }
+
+        return compilationSuccess;
+    }
+
+    /**
+     * Build target artifact.
+     * 
+     * @throws InterruptedException threading error
+     * @throws IOException IO error
+     * @throws ConfigurationException
+     */
+    protected void buildArtifact() throws InterruptedException, IOException,
+            ConfigurationException
+    {
+        jsTarget = buildJSTarget();
+    }
+
+    private IJSApplication buildJSTarget() throws InterruptedException,
+            FileNotFoundException, ConfigurationException
+    {
+        final List<ICompilerProblem> problemsBuildingSWF = new ArrayList<ICompilerProblem>();
+
+        project.mainCU = mainCU;
+        final IJSApplication app = buildApplication(project,
+                config.getMainDefinition(), mainCU, problemsBuildingSWF);
+        problems.addAll(problemsBuildingSWF);
+        if (app == null)
+        {
+            ICompilerProblem problem = new UnableToBuildSWFProblem(
+                    getOutputFilePath());
+            problems.add(problem);
+        }
+
+        return app;
+    }
+
+    /**
+     * Replaces FlexApplicationProject::buildSWF()
+     * 
+     * @param applicationProject
+     * @param rootClassName
+     * @param problems
+     * @return
+     * @throws InterruptedException
+     */
+
+    private IJSApplication buildApplication(CompilerProject applicationProject,
+            String rootClassName, ICompilationUnit mainCU,
+            Collection<ICompilerProblem> problems) throws InterruptedException,
+            ConfigurationException, FileNotFoundException
+    {
+        Collection<ICompilerProblem> fatalProblems = applicationProject.getFatalProblems();
+        if (!fatalProblems.isEmpty())
+        {
+            problems.addAll(fatalProblems);
+            return null;
+        }
+
+        return ((JSTarget) target).build(mainCU, problems);
+    }
+
+    /**
+     * Get the output file path. If {@code -output} is specified, use its value;
+     * otherwise, use the same base name as the target file.
+     * 
+     * @return output file path
+     */
+    private String getOutputFilePath()
+    {
+        if (config.getOutput() == null)
+        {
+            final String extension = "." + JSSharedData.OUTPUT_EXTENSION;
+            return FilenameUtils.removeExtension(config.getTargetFile()).concat(
+                    extension);
+        }
+        else
+            return config.getOutput();
+    }
+
+    /**
+     * @author Erik de Bruin
+     * 
+     *         Get the output class file. This includes the (sub)directory in
+     *         which the original class file lives. If the directory structure
+     *         doesn't exist, it is created.
+     * 
+     * @param qname
+     * @param outputFolder
+     * @return output class file path
+     */
+    private File getOutputClassFile(String qname, File outputFolder)
+    {
+        String[] cname = qname.split("\\.");
+        String sdirPath = outputFolder + File.separator;
+        if (cname.length > 0)
+        {
+            for (int i = 0, n = cname.length - 1; i < n; i++)
+            {
+                sdirPath += cname[i] + File.separator;
+            }
+
+            File sdir = new File(sdirPath);
+            if (!sdir.exists())
+                sdir.mkdirs();
+
+            qname = cname[cname.length - 1];
+        }
+
+        return new File(sdirPath + qname + "." + JSSharedData.OUTPUT_EXTENSION);
+    }
+
+    /**
+     * @param qname
+     * @param outputFolder
+     * @return output source map file path
+     */
+    private File getOutputSourceMapFile(String qname, File outputFolder)
+    {
+        String[] cname = qname.split("\\.");
+        String sdirPath = outputFolder + File.separator;
+        if (cname.length > 0)
+        {
+            for (int i = 0, n = cname.length - 1; i < n; i++)
+            {
+                sdirPath += cname[i] + File.separator;
+            }
+
+            File sdir = new File(sdirPath);
+            if (!sdir.exists())
+                sdir.mkdirs();
+
+            qname = cname[cname.length - 1];
+        }
+
+        return new File(sdirPath + qname + "." + JSSharedData.OUTPUT_EXTENSION + ".map");
+    }
+
+    /**
+     * Mxmlc uses target file as the main compilation unit and derive the output
+     * SWF file name from this file.
+     * 
+     * @return true if successful, false otherwise.
+     * @throws OnlyOneSource
+     * @throws InterruptedException
+     */
+    protected boolean setupTargetFile() throws InterruptedException
+    {
+        final String mainFileName = config.getTargetFile();
+
+        final String normalizedMainFileName = FilenameNormalization.normalize(mainFileName);
+
+        final SourceCompilationUnitFactory compilationUnitFactory = project.getSourceCompilationUnitFactory();
+
+        File normalizedMainFile = new File(normalizedMainFileName);
+        if (compilationUnitFactory.canCreateCompilationUnit(normalizedMainFile))
+        {
+            project.addIncludeSourceFile(normalizedMainFile);
+
+            final List<String> sourcePath = config.getCompilerSourcePath();
+            String mainQName = null;
+            if (sourcePath != null && !sourcePath.isEmpty())
+            {
+                for (String path : sourcePath)
+                {
+                    final String otherPath = new File(path).getAbsolutePath();
+                    if (mainFileName.startsWith(otherPath))
+                    {
+                        mainQName = mainFileName.substring(otherPath.length() + 1);
+                        mainQName = mainQName.replaceAll("\\\\", "/");
+                        mainQName = mainQName.replaceAll("\\/", ".");
+                        if (mainQName.endsWith(".as"))
+                            mainQName = mainQName.substring(0,
+                                    mainQName.length() - 3);
+                        break;
+                    }
+                }
+            }
+
+            if (mainQName == null)
+                mainQName = FilenameUtils.getBaseName(mainFileName);
+
+            Collection<ICompilationUnit> mainFileCompilationUnits = workspace.getCompilationUnits(
+                    normalizedMainFileName, project);
+
+            mainCU = Iterables.getOnlyElement(mainFileCompilationUnits);
+
+            config.setMainDefinition(mainQName);
+        }
+
+        Preconditions.checkNotNull(mainCU,
+                "Main compilation unit can't be null");
+
+        ITargetSettings settings = getTargetSettings();
+        if (settings != null)
+            project.setTargetSettings(settings);
+
+        target = JSSharedData.backend.createTarget(project,
+                getTargetSettings(), null);
+
+        return true;
+    }
+
+    private ITargetSettings getTargetSettings()
+    {
+        if (targetSettings == null)
+            targetSettings = projectConfigurator.getTargetSettings(null);
+
+        return targetSettings;
+    }
+
+    /**
+     * Create a new Configurator. This method may be overridden to allow
+     * Configurator subclasses to be created that have custom configurations.
+     * 
+     * @return a new instance or subclass of {@link Configurator}.
+     */
+    protected Configurator createConfigurator()
+    {
+        return JSSharedData.backend.createConfigurator();
+    }
+
+    /**
+     * Load configurations from all the sources.
+     * 
+     * @param args command line arguments
+     * @return True if mxmlc should continue with compilation.
+     */
+    protected boolean configure(final String[] args)
+    {
+        project.getSourceCompilationUnitFactory().addHandler(asFileHandler);
+        projectConfigurator = createConfigurator();
+
+        try
+        {
+            if (useFlashBuilderProjectFiles(args)
+                    && !jsOutputType.equals(JSOutputType.VF2JS))
+            {
+                projectConfigurator.setConfiguration(
+                        FlashBuilderConfigurator.computeFlashBuilderArgs(args,
+                                getTargetType().getExtension()),
+                        ICompilerSettingsConstants.FILE_SPECS_VAR);
+            }
+            else
+            {
+                projectConfigurator.setConfiguration(args,
+                        ICompilerSettingsConstants.FILE_SPECS_VAR);
+            }
+
+            projectConfigurator.applyToProject(project);
+            problems = new ProblemQuery(
+                    projectConfigurator.getCompilerProblemSettings());
+
+            project.config = (JSGoogConfiguration)projectConfigurator.getConfiguration();
+            config = projectConfigurator.getConfiguration();
+            configBuffer = projectConfigurator.getConfigurationBuffer();
+            problems.addAll(projectConfigurator.getConfigurationProblems());
+
+            if (configBuffer.getVar("version") != null) //$NON-NLS-1$
+                return false;
+
+            if (problems.hasErrors())
+                return false;
+
+            validateTargetFile();
+            return true;
+        }
+        catch (ConfigurationException e)
+        {
+            final ICompilerProblem problem = new ConfigurationProblem(e);
+            problems.add(problem);
+            return false;
+        }
+        catch (Exception e)
+        {
+            final ICompilerProblem problem = new ConfigurationProblem(null, -1,
+                    -1, -1, -1, e.getMessage());
+            problems.add(problem);
+            return false;
+        }
+        finally
+        {
+            if (config == null)
+            {
+                config = new Configuration();
+                configBuffer = new ConfigurationBuffer(Configuration.class,
+                        Configuration.getAliases());
+            }
+        }
+    }
+
+    private boolean useFlashBuilderProjectFiles(String[] args)
+    {
+        for (String arg : args)
+        {
+            if (arg.equals("-fb")
+                    || arg.equals("-use-flashbuilder-project-files"))
+                return true;
+        }
+        return false;
+    }
+
+    protected TargetType getTargetType()
+    {
+        return TargetType.SWF;
+    }
+
+    /**
+     * Validate target file.
+     * 
+     * @throws MustSpecifyTarget
+     * @throws IOError
+     */
+    protected void validateTargetFile() throws ConfigurationException
+    {
+        if (mainCU instanceof ResourceModuleCompilationUnit)
+            return; //when compiling a Resource Module, no target file is defined.
+
+        final String targetFile = config.getTargetFile();
+        if (targetFile == null)
+            throw new ConfigurationException.MustSpecifyTarget(null, null, -1);
+
+        final File file = new File(targetFile);
+        if (!file.exists())
+            throw new ConfigurationException.IOError(targetFile);
+    }
+
+    /**
+     * Wait till the workspace to finish compilation and close.
+     */
+    protected void waitAndClose()
+    {
+        workspace.startIdleState();
+        try
+        {
+            workspace.close();
+        }
+        finally
+        {
+            workspace.endIdleState(Collections.<ICompilerProject, Set<ICompilationUnit>> emptyMap());
+        }
+    }
+
+    /**
+     * Force terminate the compilation process.
+     */
+    protected void close()
+    {
+        workspace.close();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/clients/VF2JSToolGroup.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/clients/VF2JSToolGroup.java b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/VF2JSToolGroup.java
new file mode 100644
index 0000000..07cb796
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/VF2JSToolGroup.java
@@ -0,0 +1,35 @@
+/*
+ *
+ *  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.clients;
+
+import org.apache.flex.tools.AbstractFlexToolGroup;
+
+/**
+ * Created by christoferdutz on 10.11.14.
+ */
+public class VF2JSToolGroup extends AbstractFlexToolGroup {
+
+    public VF2JSToolGroup() {
+        super("VF2JS");
+//        addFlexTool(new COMPJSC(new MXMLVF2JSBackend()));
+//        addFlexTool(new MXMLJSC(new MXMLVF2JSBackend()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IASGlobalFunctionConstants.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IASGlobalFunctionConstants.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IASGlobalFunctionConstants.java
new file mode 100644
index 0000000..6d0106e
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IASGlobalFunctionConstants.java
@@ -0,0 +1,92 @@
+/*
+ *
+ *  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.codegen;
+
+/**
+ * AS3 language global functions, such as Array, encodeURI, isNaN etc.
+ * 
+ * @author Erik de Bruin
+ */
+public interface IASGlobalFunctionConstants
+{
+    static final String Array = "Array";
+    static final String Boolean = "Boolean";
+    static final String decodeURI = "decodeURI";
+    static final String decodeURIComponent = "decodeURIComponent";
+    static final String encodeURI = "encodeURI";
+    static final String encodeURIComponent = "encodeURIComponent";
+    static final String escape = "escape";
+    static final String _int = "int";
+    static final String isFinite = "isFinite";
+    static final String isNaN = "isNaN";
+    static final String isXMLName = "isXMLName";
+    static final String Number = "Number";
+    static final String Object = "Object";
+    static final String parseFloat = "parseFloat";
+    static final String parseInt = "parseInt";
+    static final String String = "String";
+    static final String trace = "trace";
+    static final String uint = "uint";
+    static final String unescape = "unescape";
+    static final String Vector = "Vector";
+    static final String XML = "XML";
+    static final String XMLList = "XMLList";
+
+    /**
+     * An enumeration of core built-in functions.
+     */
+    public static enum BuiltinType
+    {
+        ARRAY(IASGlobalFunctionConstants.Array), BOOLEAN(
+                IASGlobalFunctionConstants.Boolean), DECODEURI(
+                IASGlobalFunctionConstants.decodeURI), DECODEURICOMPONENT(
+                IASGlobalFunctionConstants.decodeURIComponent), ENCODEURI(
+                IASGlobalFunctionConstants.encodeURI), ENCODEURICOMPONENT(
+                IASGlobalFunctionConstants.encodeURIComponent), ESCAPE(
+                IASGlobalFunctionConstants.escape), INT(
+                IASGlobalFunctionConstants._int), ISFINITE(
+                IASGlobalFunctionConstants.isFinite), ISNAN(
+                IASGlobalFunctionConstants.isNaN), ISXMLNAME(
+                IASGlobalFunctionConstants.isXMLName), NUMBER(
+                IASGlobalFunctionConstants.Number), OBJECT(
+                IASGlobalFunctionConstants.Object), PARSEFLOAT(
+                IASGlobalFunctionConstants.parseFloat), PARSEINT(
+                IASGlobalFunctionConstants.parseInt), STRING(
+                IASGlobalFunctionConstants.String), TRACE(
+                IASGlobalFunctionConstants.trace), UINT(
+                IASGlobalFunctionConstants.uint), UNESCAPE(
+                IASGlobalFunctionConstants.unescape), VECTOR(
+                IASGlobalFunctionConstants.Vector), XML(
+                IASGlobalFunctionConstants.XML), XMLLIST(
+                IASGlobalFunctionConstants.XMLList);
+
+        private BuiltinType(String name)
+        {
+            this.name = name;
+        }
+
+        private final String name;
+
+        public String getName()
+        {
+            return name;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IDocEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IDocEmitter.java
new file mode 100644
index 0000000..f71ae5e
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IDocEmitter.java
@@ -0,0 +1,36 @@
+/*
+ *
+ *  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.codegen;
+
+/**
+ * Base interface for documentation emitters.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IDocEmitter
+{
+    void begin();
+
+    String flushBuffer();
+    
+    void setBufferWrite(boolean value);
+    
+    void end();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IEmitter.java
new file mode 100644
index 0000000..5e2e596
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IEmitter.java
@@ -0,0 +1,113 @@
+/*
+ *
+ *  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.codegen;
+
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.tree.as.IASNode;
+
+/**
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public interface IEmitter
+{
+
+    /**
+     * Pushes an indent into the emitter so after newlines are emitted, the
+     * output is correctly formatted.
+     */
+    void indentPush();
+
+    /**
+     * Pops an indent from the emitter so after newlines are emitted, the output
+     * is correctly formatted.
+     */
+    void indentPop();
+
+    /**
+     * Writes a string to the writer.
+     * 
+     * @param value The string to write to the output buffer.
+     */
+    void write(IEmitterTokens value);
+
+    void write(String value);
+
+    /**
+     * Writes newline character(s)
+     */
+    void writeNewline();
+
+    /**
+     * Writes the <code>value</code> and then a newline which will automatically
+     * have the indent applied after the \n character.
+     * 
+     * @param value The String value to write before the \n is appended.
+     */
+    void writeNewline(IEmitterTokens value);
+
+    void writeNewline(String value);
+
+    /**
+     * Writes the <code>value</code> after a push or pop of the indent.
+     * <p>
+     * This method effectively lets you write a value and then indent our
+     * outdent. The method can be useful in the following where your cursor
+     * writer is at <code>[0]</code>, you write
+     * <code>writeNewline("if (foo) {", true);</code> and the cursor after the
+     * call will end up at <code>[1]</code>.
+     * 
+     * <pre>
+     * [0]if (foo) {
+     *     [1]this.something;
+     * }
+     * </pre>
+     * 
+     * @param value The String value to write before the \n is appended.
+     * @param pushIndent Whether to push indent <code>true</code> or pop indent
+     * <code>false</code>.
+     */
+    void writeNewline(IEmitterTokens value, boolean pushIndent);
+
+    void writeNewline(String value, boolean pushIndent);
+
+    /**
+     * Writes a {@link ASEmitterTokens} character to the buffer and appends a
+     * space after automatically.
+     * 
+     * @param value The {@link ASEmitterTokens} value.
+     */
+    void writeToken(IEmitterTokens value);
+
+    void writeToken(String value);
+
+    /**
+     * Takes the node argument and created a String representation if it using
+     * the buffer temporarily.
+     * <p>
+     * Note; This method is still beta, it need more logic if an emitter is
+     * actually using the buffer!
+     * 
+     * @param node The node walk and create a String for.
+     * @return The node's output.
+     */
+    String stringifyNode(IASNode node);
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IEmitterTokens.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IEmitterTokens.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IEmitterTokens.java
new file mode 100644
index 0000000..09be781
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/IEmitterTokens.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.codegen;
+
+public interface IEmitterTokens
+{
+    String getToken();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/ISourceMapEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/ISourceMapEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/ISourceMapEmitter.java
new file mode 100644
index 0000000..3fef28e
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/ISourceMapEmitter.java
@@ -0,0 +1,30 @@
+/*
+ *
+ *  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.codegen;
+
+/**
+ * Base interface for source map emitters.
+ *
+ * @author Josh Tynjala
+ */
+public interface ISourceMapEmitter
+{
+    String emitSourceMap(String sourceFilePath, String sourceMapPath, String sourceRoot);
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/ISubEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/ISubEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/ISubEmitter.java
new file mode 100644
index 0000000..1431c4b
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/ISubEmitter.java
@@ -0,0 +1,45 @@
+/*
+ *
+ *  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.codegen;
+
+import org.apache.flex.compiler.tree.as.IASNode;
+
+/**
+ * The {@link IEmitter} emitter can use composition for it's more
+ * complicated production sequences with member, dynamic, binary expressions and
+ * identifiers etc.
+ * 
+ * @author Michael Schmalle
+ */
+public interface ISubEmitter<T>
+{
+    /**
+     * The main emitter will call this method of the sub emitter with the
+     * correct generic type implemented.
+     * <p>
+     * The main idea here is abstraction. Producing JavaScript can get
+     * complicated, the best way to avoid bugs is to avoid as much state and
+     * interdependence between emit() calls of the main emitter.
+     * 
+     * @param node The current {@link IASNode} being emitted by the
+     * {@link IEmitter}.
+     */
+    void emit(T node);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/as/IASEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/as/IASEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/as/IASEmitter.java
new file mode 100644
index 0000000..bd0d1eb
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/as/IASEmitter.java
@@ -0,0 +1,369 @@
+/*
+ *
+ *  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.codegen.as;
+
+import java.io.Writer;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.IEmitter;
+import org.apache.flex.compiler.definitions.IPackageDefinition;
+import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IBlockNode;
+import org.apache.flex.compiler.tree.as.ICatchNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IFunctionObjectNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IIfNode;
+import org.apache.flex.compiler.tree.as.IImportNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.IIterationFlowNode;
+import org.apache.flex.compiler.tree.as.IKeywordNode;
+import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
+import org.apache.flex.compiler.tree.as.ILiteralContainerNode;
+import org.apache.flex.compiler.tree.as.ILiteralNode;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.INamespaceAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.INamespaceNode;
+import org.apache.flex.compiler.tree.as.INumericLiteralNode;
+import org.apache.flex.compiler.tree.as.IObjectLiteralValuePairNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.IReturnNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.apache.flex.compiler.tree.as.ISwitchNode;
+import org.apache.flex.compiler.tree.as.ITernaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IThrowNode;
+import org.apache.flex.compiler.tree.as.ITryNode;
+import org.apache.flex.compiler.tree.as.ITypedExpressionNode;
+import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IUseNamespaceNode;
+import org.apache.flex.compiler.tree.as.IVariableExpressionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.tree.as.IWhileLoopNode;
+import org.apache.flex.compiler.tree.as.IWithNode;
+import org.apache.flex.compiler.tree.metadata.IMetaTagNode;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+
+/**
+ * The {@link IASEmitter} interface allows abstraction between the
+ * {@link IASNodeStrategy} and the current output buffer {@link Writer}.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IASEmitter extends IEmitter
+{
+    IBlockWalker getWalker();
+
+    void setWalker(IBlockWalker asBlockWalker);
+
+    IDocEmitter getDocEmitter();
+
+    void setDocEmitter(IDocEmitter value);
+
+    String postProcess(String output);
+    
+    void emitImport(IImportNode node);
+
+    void emitPackageHeader(IPackageDefinition definition);
+
+    void emitPackageHeaderContents(IPackageDefinition definition);
+
+    void emitPackageContents(IPackageDefinition definition);
+
+    void emitPackageFooter(IPackageDefinition definition);
+
+    /**
+     * Emit a Class.
+     * 
+     * @param node The {@link IClassNode} class.
+     */
+    void emitClass(IClassNode node);
+
+    /**
+     * Emit an Interface.
+     * 
+     * @param node The {@link IInterfaceNode} class.
+     */
+    void emitInterface(IInterfaceNode node);
+
+    /**
+     * Emit a documentation comment for a Class field or constant
+     * {@link IVariableNode}.
+     * 
+     * @param node The {@link IVariableNode} class field member.
+     */
+    void emitFieldDocumentation(IVariableNode node);
+
+    /**
+     * Emit a full Class field member.
+     * 
+     * @param node The {@link IVariableNode} class field member.
+     */
+    void emitField(IVariableNode node);
+
+    /**
+     * Emit a documentation comment for a Class method {@link IFunctionNode}.
+     * 
+     * @param node The {@link IFunctionNode} class method member.
+     */
+    void emitMethodDocumentation(IFunctionNode node);
+
+    /**
+     * Emit a full Class or Interface method member.
+     * 
+     * @param node The {@link IFunctionNode} class method member.
+     */
+    void emitMethod(IFunctionNode node);
+
+    /**
+     * Emit a documentation comment for a Class method {@link IGetterNode}.
+     * 
+     * @param node The {@link IGetterNode} class accessor member.
+     */
+    void emitGetAccessorDocumentation(IGetterNode node);
+
+    /**
+     * Emit a full Class getter member.
+     * 
+     * @param node The {@link IVariableNode} class getter member.
+     */
+    void emitGetAccessor(IGetterNode node);
+
+    /**
+     * Emit a documentation comment for a Class accessor {@link IGetterNode}.
+     * 
+     * @param node The {@link ISetterNode} class accessor member.
+     */
+    void emitSetAccessorDocumentation(ISetterNode node);
+
+    /**
+     * Emit a full Class setter member.
+     * 
+     * @param node The {@link ISetterNode} class setter member.
+     */
+    void emitSetAccessor(ISetterNode node);
+
+    void emitParameter(IParameterNode node);
+
+    /**
+     * Emit a namespace member.
+     * 
+     * @param node The {@link INamespaceNode} class member.
+     */
+    void emitNamespace(INamespaceNode node);
+
+    //--------------------------------------------------------------------------
+    // Statements
+    //--------------------------------------------------------------------------
+
+    /**
+     * Emit a statement found within an {@link IBlockNode}.
+     * 
+     * @param node The {@link IASNode} statement.
+     */
+    void emitStatement(IASNode node);
+
+    /**
+     * Emit a <code>if(){}else if(){}else{}</code> statement.
+     * 
+     * @param node The {@link IIfNode} node.
+     */
+    void emitIf(IIfNode node);
+
+    /**
+     * Emit a <code>for each</code> statement.
+     * 
+     * @param node The {@link IForLoopNode} node.
+     */
+    void emitForEachLoop(IForLoopNode node);
+
+    /**
+     * Emit a <code>for</code> statement.
+     * 
+     * @param node The {@link IForLoopNode} node.
+     */
+    void emitForLoop(IForLoopNode node);
+
+    /**
+     * Emit a <code>switch(){}</code> statement.
+     * 
+     * @param node The {@link ISwitchNode} node.
+     */
+    void emitSwitch(ISwitchNode node);
+
+    /**
+     * Emit a <code>while(){}</code> statement.
+     * 
+     * @param node The {@link IWhileLoopNode} node.
+     */
+    void emitWhileLoop(IWhileLoopNode node);
+
+    /**
+     * Emit a <code>do{}while()</code> statement.
+     * 
+     * @param node The {@link IWhileLoopNode} node.
+     */
+    void emitDoLoop(IWhileLoopNode node);
+
+    /**
+     * Emit a <code>with(){}</code> statement.
+     * 
+     * @param node The {@link IWithNode} node.
+     */
+    void emitWith(IWithNode node);
+
+    /**
+     * Emit a <code>throw</code> statement.
+     * 
+     * @param node The {@link IThrowNode} node.
+     */
+    void emitThrow(IThrowNode node);
+
+    /**
+     * Emit a <code>try{}</code> statement.
+     * 
+     * @param node The {@link ITryNode} node.
+     */
+    void emitTry(ITryNode node);
+
+    /**
+     * Emit a <code>catch(){}</code> statement.
+     * 
+     * @param node The {@link ICatchNode} node.
+     */
+    void emitCatch(ICatchNode node);
+
+    /**
+     * Emit a <code>foo:{}</code> statement.
+     * 
+     * @param node The {@link LabeledStatementNode} node.
+     */
+    void emitLabelStatement(LabeledStatementNode node);
+
+    void emitReturn(IReturnNode node);
+
+    //--------------------------------------------------------------------------
+    // Expressions
+    //--------------------------------------------------------------------------
+
+    /**
+     * Emit a variable declaration found in expression statements within scoped
+     * blocks.
+     * 
+     * @param node The {@link IVariableNode} or chain of variable nodes.
+     */
+    void emitVarDeclaration(IVariableNode node);
+
+    /**
+     * Emit an anonymous {@link IFunctionObjectNode}.
+     * 
+     * @param node The anonymous {@link IFunctionObjectNode}.
+     */
+    void emitFunctionObject(IFunctionObjectNode node);
+
+    /**
+     * Emit an local named function {@link IFunctionNode}.
+     * 
+     * @param node The local named function {@link IFunctionNode}.
+     */
+    void emitLocalNamedFunction(IFunctionNode node);
+
+    /**
+     * Emit a header at the start of a function block.
+     * 
+     * @param node The {@link IFunctionNode} node.
+     */
+    void emitFunctionBlockHeader(IFunctionNode node);
+
+    /**
+     * Emit a function call like <code>new Foo()</code> or <code>foo(42)</code>.
+     * 
+     * @param node The {@link IFunctionCallNode} node.
+     */
+    void emitFunctionCall(IFunctionCallNode node);
+    
+    void emitArguments(IContainerNode node);
+
+    void emitIterationFlow(IIterationFlowNode node);
+
+    void emitNamespaceAccessExpression(INamespaceAccessExpressionNode node);
+
+    void emitMemberAccessExpression(IMemberAccessExpressionNode node);
+
+    void emitVariableExpression(IVariableExpressionNode node);
+
+    void emitDynamicAccess(IDynamicAccessNode node);
+
+    void emitTypedExpression(ITypedExpressionNode node);
+
+    void emitObjectLiteralValuePair(IObjectLiteralValuePairNode node);
+
+    void emitIdentifier(IIdentifierNode node);
+
+    void emitLiteral(ILiteralNode node);
+
+    void emitLiteralContainer(ILiteralContainerNode node);
+
+    void emitNumericLiteral(INumericLiteralNode node);
+
+    //--------------------------------------------------------------------------
+    // Operators
+    //--------------------------------------------------------------------------
+
+    void emitUnaryOperator(IUnaryOperatorNode node);
+
+    void emitAsOperator(IBinaryOperatorNode node);
+
+    void emitIsOperator(IBinaryOperatorNode node);
+
+    /**
+     * Emit an operator statement.
+     * 
+     * @param node The {@link IBinaryOperatorNode} or chain of variable nodes.
+     */
+    void emitBinaryOperator(IBinaryOperatorNode node);
+
+    void emitTernaryOperator(ITernaryOperatorNode node);
+
+    //--------------------------------------------------------------------------
+    // Node
+    //--------------------------------------------------------------------------
+
+    void emitKeyword(IKeywordNode node);
+
+    void emitLanguageIdentifier(ILanguageIdentifierNode node);
+
+    void emitMetaTag(IMetaTagNode node);
+
+    void emitContainer(IContainerNode node);
+
+    void emitE4XFilter(IMemberAccessExpressionNode node);
+
+    void emitUseNamespace(IUseNamespaceNode node);
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/as/IASWriter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/as/IASWriter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/as/IASWriter.java
new file mode 100644
index 0000000..c2c2ded
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/as/IASWriter.java
@@ -0,0 +1,51 @@
+/*
+ *
+ *  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.codegen.as;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * An ActionScript writer that outputs cross compiled string data to the output
+ * stream.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IASWriter extends Closeable
+{
+    /**
+     * Start writing to output stream.
+     * 
+     * @param out output stream
+     */
+    void writeTo(OutputStream out);
+
+    /**
+     * Start writing to a file.
+     * 
+     * @param out The output {@link File}.
+     * @return The number of bytes written.
+     */
+    int writeTo(File out) throws FileNotFoundException, IOException;
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSDocEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSDocEmitter.java
new file mode 100644
index 0000000..e37dd18
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSDocEmitter.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.codegen.js;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+
+/**
+ * The {@link IJSDocEmitter} interface allows the abstraction of JavaScript
+ * document comments to be emitted per tag.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IJSDocEmitter extends IDocEmitter
+{
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSEmitter.java
new file mode 100644
index 0000000..218b5be
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSEmitter.java
@@ -0,0 +1,85 @@
+/*
+ *
+ *  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.codegen.js;
+
+import java.io.Writer;
+import java.util.List;
+
+import com.google.debugging.sourcemap.FilePosition;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.common.ISourceLocation;
+import org.apache.flex.compiler.internal.codegen.js.JSSessionModel;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.ITypeNode;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+
+/**
+ * The {@link IJSEmitter} interface allows abstraction between the
+ * {@link IASNodeStrategy} and the current output buffer {@link Writer}.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IJSEmitter extends IASEmitter
+{
+    JSSessionModel getModel();
+    List<SourceMapMapping> getSourceMapMappings();
+    
+    String formatQualifiedName(String name);
+
+    /**
+     * Adds a node to the source map.
+     */
+    void startMapping(ISourceLocation node);
+
+    /**
+     * Adds a node to the source map using custom line and column values,
+     * instead of the node's own line and column. Useful for starting a mapping
+     * in the middle of the node.
+     */
+    void startMapping(ISourceLocation node, int line, int column);
+
+    /**
+     * Adds a node to the source map after a particular node instead using the
+     * node's own line and column.
+     */
+    void startMapping(ISourceLocation node, ISourceLocation nodeBeforeMapping);
+
+    /**
+     * Commits a mapping to the source map.
+     */
+    void endMapping(ISourceLocation node);
+
+    void pushSourceMapName(ISourceLocation node);
+    void popSourceMapName();
+    
+    void emitSourceMapDirective(ITypeNode node);
+    
+    void emitClosureStart();
+    void emitClosureEnd(IASNode node);
+    
+    class SourceMapMapping
+    {
+        public String sourcePath;
+        public String name;
+        public FilePosition sourceStartPosition;
+        public FilePosition destStartPosition;
+        public FilePosition destEndPosition;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSPublisher.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSPublisher.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSPublisher.java
new file mode 100644
index 0000000..2d62436
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSPublisher.java
@@ -0,0 +1,41 @@
+/*
+ *
+ *  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.codegen.js;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.flex.compiler.clients.problems.ProblemQuery;
+import org.apache.flex.compiler.driver.IPublisher;
+
+/**
+ * The {@link IJSPublisher} interface allows the abstraction of project output
+ * generation.
+ * 
+ * @author Erik de Bruin
+ */
+public interface IJSPublisher extends IPublisher
+{
+
+    File getOutputFolder();
+
+    boolean publish(ProblemQuery problems) throws IOException;
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSWriter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSWriter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSWriter.java
new file mode 100644
index 0000000..aae8011
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSWriter.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.codegen.js;
+
+import java.io.File;
+import java.io.OutputStream;
+
+import org.apache.flex.compiler.codegen.as.IASWriter;
+
+/**
+ * A JavaScript writer that outputs cross compiled string data to the output
+ * stream.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IJSWriter extends IASWriter
+{
+    /**
+     * Write JS file and source map.
+     *
+     * @param jsOut JS output stream
+     * @param sourceMapOut Source map file
+     */
+    void writeTo(OutputStream jsOut, File sourceMapOut);
+
+}


[17/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/circular/Super.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular/Super.as b/compiler-jx/src/test/resources/flexjs/projects/circular/Super.as
new file mode 100644
index 0000000..d72a859
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/circular/Super.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+  public class Super
+  {
+    public function Super() {}
+
+    private static var isItCircular:Base;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/circular/Super_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular/Super_result.js b/compiler-jx/src/test/resources/flexjs/projects/circular/Super_result.js
new file mode 100644
index 0000000..368ec25
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/circular/Super_result.js
@@ -0,0 +1,77 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Super
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Super');
+
+
+
+
+/**
+ * @constructor
+ */
+Super = function() {
+};
+
+
+/**
+ * @private
+ * @type {Base}
+ */
+Super.isItCircular;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Super.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Super', qName: 'Super'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Super', Super);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Super.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'Super': { type: '', declaredBy: 'Super'}
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/Test.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/Test.as b/compiler-jx/src/test/resources/flexjs/projects/interfaces/Test.as
new file mode 100644
index 0000000..cd7791a
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/Test.as
@@ -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
+{
+	import classes.A;
+	import interfaces.IA;
+	import interfaces.IC;
+	import interfaces.IE;
+
+  public class Test extends A implements IA, IE
+  {
+    public function Test()
+    {
+      super();
+      
+      var ia:IA = doSomething(IC) as IA
+    }
+    
+    public function doSomething(ic:IC):IC
+    {
+      for (var i:int = 0; i < 3; i++ {
+        var a:A = null;
+      }
+      
+      return ic;
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/Test_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/Test_result.js b/compiler-jx/src/test/resources/flexjs/projects/interfaces/Test_result.js
new file mode 100644
index 0000000..42ab0f4
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/Test_result.js
@@ -0,0 +1,95 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Test
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Test');
+
+goog.require('classes.A');
+goog.require('interfaces.IA');
+goog.require('interfaces.IC');
+goog.require('interfaces.IE');
+goog.require('org.apache.flex.utils.Language');
+
+
+
+/**
+ * @constructor
+ * @extends {classes.A}
+ * @implements {interfaces.IA}
+ * @implements {interfaces.IE}
+ */
+Test = function() {
+  Test.base(this, 'constructor');
+  var /** @type {interfaces.IA} */ ia = org.apache.flex.utils.Language.as(this.doSomething(interfaces.IC), interfaces.IA);
+};
+goog.inherits(Test, classes.A);
+
+
+/**
+ * @export
+ * @param {interfaces.IC} ic
+ * @return {interfaces.IC}
+ */
+Test.prototype.doSomething = function(ic) {
+  for (var /** @type {number} */ i = 0; i < 3; i++) {
+    var /** @type {classes.A} */ a = null;
+  }
+  return ic;
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Test.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Test', qName: 'Test'}], interfaces: [interfaces.IA, interfaces.IE] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Test', Test);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Test.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'Test': { type: '', declaredBy: 'Test'},
+        'doSomething': { type: 'IC', declaredBy: 'Test'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/A.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/A.as b/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/A.as
new file mode 100644
index 0000000..978f038
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/A.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 classes
+{
+  public class A extends C
+  {
+    public function A()
+    {
+      super();
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/A_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/A_result.js b/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/A_result.js
new file mode 100644
index 0000000..9bb4b71
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/A_result.js
@@ -0,0 +1,74 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * classes.A
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.A');
+
+goog.require('classes.C');
+
+
+
+/**
+ * @constructor
+ * @extends {classes.C}
+ */
+classes.A = function() {
+  classes.A.base(this, 'constructor');
+};
+goog.inherits(classes.A, classes.C);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'classes.A'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.A', classes.A);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.A.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'A': { type: '', declaredBy: 'classes.A'}
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/B.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/B.as b/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/B.as
new file mode 100644
index 0000000..b410e59
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/B.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 classes
+{
+    public class B
+    {
+        public function B() {}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/B_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/B_result.js b/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/B_result.js
new file mode 100644
index 0000000..8aaa2f7
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/B_result.js
@@ -0,0 +1,69 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * classes.B
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.B');
+
+
+
+/**
+ * @constructor
+ */
+classes.B = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.B.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'B', qName: 'classes.B'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.B', classes.B);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.B.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'B': { type: '', declaredBy: 'classes.B'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/C.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/C.as b/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/C.as
new file mode 100644
index 0000000..d414a26
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/C.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 classes
+{
+    public class C
+    {
+        public function C() {}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/C_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/C_result.js b/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/C_result.js
new file mode 100644
index 0000000..46f094f
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/classes/C_result.js
@@ -0,0 +1,69 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * classes.C
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.C');
+
+
+
+/**
+ * @constructor
+ */
+classes.C = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.C.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'C', qName: 'classes.C'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.C', classes.C);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.C.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'C': { type: '', declaredBy: 'classes.C'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IA.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IA.as b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IA.as
new file mode 100644
index 0000000..5fbd6c2
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IA.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+  public interface IA extends IC {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IA_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IA_result.js b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IA_result.js
new file mode 100644
index 0000000..19d0593
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IA_result.js
@@ -0,0 +1,65 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IA
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IA');
+
+goog.require('interfaces.IC');
+
+
+
+/**
+ * @interface
+ * @extends {interfaces.IC}
+ */
+interfaces.IA = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IA.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IA', qName: 'interfaces.IA'}], interfaces: [interfaces.IC] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IA.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IB.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IB.as b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IB.as
new file mode 100644
index 0000000..a995635
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IB.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+    public interface IB {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IB_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IB_result.js b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IB_result.js
new file mode 100644
index 0000000..952f6a8
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IB_result.js
@@ -0,0 +1,38 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IB
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IB');
+
+
+
+/**
+ * @interface
+ */
+interfaces.IB = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IB.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IB', qName: 'interfaces.IB'}] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IC.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IC.as b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IC.as
new file mode 100644
index 0000000..9183bac
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IC.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+  public interface IC extends ID {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IC_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IC_result.js b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IC_result.js
new file mode 100644
index 0000000..d5bb746
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IC_result.js
@@ -0,0 +1,65 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IC
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IC');
+
+goog.require('interfaces.ID');
+
+
+
+/**
+ * @interface
+ * @extends {interfaces.ID}
+ */
+interfaces.IC = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IC.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IC', qName: 'interfaces.IC'}], interfaces: [interfaces.ID] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IC.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/ID.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/ID.as b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/ID.as
new file mode 100644
index 0000000..d5e9543
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/ID.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+    public interface ID {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/ID_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/ID_result.js b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/ID_result.js
new file mode 100644
index 0000000..13cee62
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/ID_result.js
@@ -0,0 +1,62 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.ID
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.ID');
+
+
+
+/**
+ * @interface
+ */
+interfaces.ID = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.ID.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'ID', qName: 'interfaces.ID'}] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.ID.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IE.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IE.as b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IE.as
new file mode 100644
index 0000000..d2c7ce1
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IE.as
@@ -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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package interfaces
+{
+    public interface IE {
+      function myMethod():void;
+      function get myProp():String;
+      function set myProp(value:String):void;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IE_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IE_result.js b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IE_result.js
new file mode 100644
index 0000000..bc57179
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/interfaces/interfaces/IE_result.js
@@ -0,0 +1,68 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IE
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IE');
+
+
+
+/**
+ * @interface
+ */
+interfaces.IE = function() {
+};
+interfaces.IE.prototype.myMethod = function() {
+};
+/**  * @type {string}
+ */interfaces.IE.prototype.myProp;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IE.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IE', qName: 'interfaces.IE'}] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IE.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+        'myProp': { type: 'String', declaredBy: 'interfaces.IE'}
+      };
+    },
+    methods: function () {
+      return {
+        'myMethod': { type: 'void', declaredBy: 'interfaces.IE'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/internal/MainClass.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/internal/MainClass.as b/compiler-jx/src/test/resources/flexjs/projects/internal/MainClass.as
new file mode 100644
index 0000000..fe7c8a5
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/internal/MainClass.as
@@ -0,0 +1,38 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+
+  public class MainClass
+  {
+    public function MainClass() 
+    {
+    }
+  }
+}
+
+class InternalClass
+{
+	public function InternalClass()
+	{
+		foo = new OtherClass();
+	}
+	
+	public var foo:OtherClass;
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/internal/MainClass_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/internal/MainClass_result.js b/compiler-jx/src/test/resources/flexjs/projects/internal/MainClass_result.js
new file mode 100644
index 0000000..76b34c5
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/internal/MainClass_result.js
@@ -0,0 +1,127 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * MainClass
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('MainClass');
+
+goog.require('OtherClass');
+
+
+
+/**
+ * @constructor
+ */
+MainClass = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+MainClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'MainClass', qName: 'MainClass'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('MainClass', MainClass);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+MainClass.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'MainClass': { type: '', declaredBy: 'MainClass'}
+      };
+    }
+  };
+};
+
+
+
+/**
+ * @constructor
+ */
+MainClass.InternalClass = function() {
+  this.foo = new OtherClass();
+};
+
+
+/**
+ * @export
+ * @type {OtherClass}
+ */
+MainClass.InternalClass.prototype.foo;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+MainClass.InternalClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'InternalClass', qName: 'MainClass.InternalClass'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('MainClass.InternalClass', MainClass.InternalClass);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+MainClass.InternalClass.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+        'foo': { type: 'OtherClass'}
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'InternalClass': { type: '', declaredBy: 'MainClass.InternalClass'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/internal/OtherClass.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/internal/OtherClass.as b/compiler-jx/src/test/resources/flexjs/projects/internal/OtherClass.as
new file mode 100644
index 0000000..2d01b44
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/internal/OtherClass.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+  public class OtherClass
+  {
+    public function OtherClass() {}
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/internal/OtherClass_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/internal/OtherClass_result.js b/compiler-jx/src/test/resources/flexjs/projects/internal/OtherClass_result.js
new file mode 100644
index 0000000..2186d65
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/internal/OtherClass_result.js
@@ -0,0 +1,69 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * OtherClass
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('OtherClass');
+
+
+
+/**
+ * @constructor
+ */
+OtherClass = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+OtherClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'OtherClass', qName: 'OtherClass'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('OtherClass', OtherClass);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+OtherClass.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'OtherClass': { type: '', declaredBy: 'OtherClass'}
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/Test.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/Test.as b/compiler-jx/src/test/resources/flexjs/projects/overrides/Test.as
new file mode 100644
index 0000000..9190d6e
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/Test.as
@@ -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
+{
+	import classes.A;
+	import classes.C;
+	import interfaces.IC;
+
+  public class Test extends A
+  {
+    public function Test()
+    {
+      super();
+    }
+    
+    override public function someFunction():C
+    {
+		return null;
+    }
+	
+	override public function someOtherFunction():IC
+	{
+		return null;
+    }
+	
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/Test_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/Test_result.js b/compiler-jx/src/test/resources/flexjs/projects/overrides/Test_result.js
new file mode 100644
index 0000000..8f8fd20
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/Test_result.js
@@ -0,0 +1,94 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Test
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Test');
+
+goog.require('classes.A');
+
+
+
+/**
+ * @constructor
+ * @extends {classes.A}
+ */
+Test = function() {
+  Test.base(this, 'constructor');
+};
+goog.inherits(Test, classes.A);
+
+
+/**
+ * @export
+ * @override
+ */
+Test.prototype.someFunction = function() {
+  return null;
+};
+
+
+/**
+ * @export
+ * @override
+ */
+Test.prototype.someOtherFunction = function() {
+  return null;
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Test.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Test', qName: 'Test'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Test', Test);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Test.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'Test': { type: '', declaredBy: 'Test'},
+        'someFunction': { type: 'C', declaredBy: 'Test'},
+        'someOtherFunction': { type: 'IC', declaredBy: 'Test'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/A.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/A.as b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/A.as
new file mode 100644
index 0000000..004a607
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/A.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 classes
+{
+  import interfaces.IA;
+  import interfaces.IB;
+  
+  public class A implements IA
+  {
+    public function A()
+    {
+    }
+	
+	public function someFunction():B
+	{
+		return null;
+	}
+	
+	public function someOtherFunction():IB
+	{
+		return null;
+	}
+
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/A_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/A_result.js b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/A_result.js
new file mode 100644
index 0000000..e3320af
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/A_result.js
@@ -0,0 +1,92 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * classes.A
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.A');
+
+goog.require('interfaces.IA');
+
+
+
+/**
+ * @constructor
+ * @implements {interfaces.IA}
+ */
+classes.A = function() {
+};
+
+
+/**
+ * @export
+ * @return {classes.B}
+ */
+classes.A.prototype.someFunction = function() {
+  return null;
+};
+
+
+/**
+ * @export
+ * @return {interfaces.IB}
+ */
+classes.A.prototype.someOtherFunction = function() {
+  return null;
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'classes.A'}], interfaces: [interfaces.IA] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.A', classes.A);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.A.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'A': { type: '', declaredBy: 'classes.A'},
+        'someFunction': { type: 'B', declaredBy: 'classes.A'},
+        'someOtherFunction': { type: 'IB', declaredBy: 'classes.A'}
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/B.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/B.as b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/B.as
new file mode 100644
index 0000000..b410e59
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/B.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 classes
+{
+    public class B
+    {
+        public function B() {}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/B_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/B_result.js b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/B_result.js
new file mode 100644
index 0000000..8aaa2f7
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/B_result.js
@@ -0,0 +1,69 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * classes.B
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.B');
+
+
+
+/**
+ * @constructor
+ */
+classes.B = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.B.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'B', qName: 'classes.B'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.B', classes.B);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.B.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'B': { type: '', declaredBy: 'classes.B'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/C.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/C.as b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/C.as
new file mode 100644
index 0000000..e2e4c8f
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/C.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 classes
+{
+    public class C extends B
+    {
+        public function C() {}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/C_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/C_result.js b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/C_result.js
new file mode 100644
index 0000000..208d51c
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/classes/C_result.js
@@ -0,0 +1,74 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * classes.C
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.C');
+
+goog.require('classes.B');
+
+
+
+/**
+ * @constructor
+ * @extends {classes.B}
+ */
+classes.C = function() {
+  classes.C.base(this, 'constructor');
+};
+goog.inherits(classes.C, classes.B);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.C.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'C', qName: 'classes.C'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.C', classes.C);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.C.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'C': { type: '', declaredBy: 'classes.C'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IA.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IA.as b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IA.as
new file mode 100644
index 0000000..6f363bc
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IA.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+  import classes.B;
+  
+  public interface IA 
+  {
+	  function someFunction():B;
+	  function someOtherFunction():IB;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IA_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IA_result.js b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IA_result.js
new file mode 100644
index 0000000..04220e1
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IA_result.js
@@ -0,0 +1,69 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IA
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IA');
+
+
+
+
+/**
+ * @interface
+ */
+interfaces.IA = function() {
+};
+interfaces.IA.prototype.someFunction = function() {
+};
+interfaces.IA.prototype.someOtherFunction = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IA.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IA', qName: 'interfaces.IA'}] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IA.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'someFunction': { type: 'B', declaredBy: 'interfaces.IA'},
+        'someOtherFunction': { type: 'IB', declaredBy: 'interfaces.IA'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IB.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IB.as b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IB.as
new file mode 100644
index 0000000..a995635
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IB.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+    public interface IB {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IB_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IB_result.js b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IB_result.js
new file mode 100644
index 0000000..01a7fe6
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IB_result.js
@@ -0,0 +1,62 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IB
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IB');
+
+
+
+/**
+ * @interface
+ */
+interfaces.IB = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IB.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IB', qName: 'interfaces.IB'}] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IB.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IC.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IC.as b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IC.as
new file mode 100644
index 0000000..b2440bf
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IC.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+  public interface IC extends IB {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IC_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IC_result.js b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IC_result.js
new file mode 100644
index 0000000..1af780a
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/overrides/interfaces/IC_result.js
@@ -0,0 +1,65 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IC
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IC');
+
+goog.require('interfaces.IB');
+
+
+
+/**
+ * @interface
+ * @extends {interfaces.IB}
+ */
+interfaces.IC = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IC.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IC', qName: 'interfaces.IC'}], interfaces: [interfaces.IB] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IC.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/AmbiguousDefinition.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/AmbiguousDefinition.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/AmbiguousDefinition.as
new file mode 100644
index 0000000..666d6ad
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/AmbiguousDefinition.as
@@ -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
+{
+  import mypackage.TestClass;
+  
+  public class AmbiguousDefinition
+  {
+    public function AmbiguousDefinition() 
+    {
+        testClass = new TestClass();
+    }
+
+    private var testClass:TestClass;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/AmbiguousDefinition_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/AmbiguousDefinition_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/AmbiguousDefinition_result.js
new file mode 100644
index 0000000..f822585
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/AmbiguousDefinition_result.js
@@ -0,0 +1,49 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from AmbiguousDefinition.as
+ * AmbiguousDefinition
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('AmbiguousDefinition');
+
+goog.require('mypackage.TestClass');
+
+
+
+/**
+ * @constructor
+ */
+AmbiguousDefinition = function() {
+  testClass = new mypackage.TestClass();
+};
+
+
+/**
+ * @export
+ * @type {mypackage.TestClass}
+ */
+AmbiguousDefinition.prototype.testClass;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+AmbiguousDefinition.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'AmbiguousDefinition', qName: 'AmbiguousDefinition'}] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/Event.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/Event.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/Event.as
new file mode 100644
index 0000000..31633de
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/Event.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+  public class Event
+  {
+    public function Event() 
+    {
+    }; 
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/Event_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/Event_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/Event_result.js
new file mode 100644
index 0000000..8bd22d5
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/Event_result.js
@@ -0,0 +1,39 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Generated by Apache Flex Cross-Compiler from Event.as
+ * Event
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Event');
+
+
+
+/**
+ * @constructor
+ */
+Event = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Event.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Event', qName: 'Event'}] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/mypackage/TestClass.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/mypackage/TestClass.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/mypackage/TestClass.as
new file mode 100644
index 0000000..329090c
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/mypackage/TestClass.as
@@ -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 mypackage
+{
+  import otherpackage.Event;
+  import window.Event;
+  
+  public class TestClass
+  {
+    public function TestClass() 
+    {
+    }; 
+
+	private var event1:Event = new window.Event();
+	private var event2:otherpackage.Event = Event();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/otherpackage/Event.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/otherpackage/Event.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/otherpackage/Event.as
new file mode 100644
index 0000000..69ca7e7
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_ambiguous_definition/otherpackage/Event.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 otherpackage
+{
+  public class Event
+  {
+    public function Event() 
+    {
+    } 
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/DifferentPackageAsConflict.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/DifferentPackageAsConflict.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/DifferentPackageAsConflict.as
new file mode 100644
index 0000000..3b545e9
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/DifferentPackageAsConflict.as
@@ -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
+{
+  import mypackage.TestClass;
+  
+  public class DifferentPackageAsConflict
+  {
+    public function DifferentPackageAsConflict() 
+    {
+        testClass = new TestClass();
+    }
+
+    private var testClass:TestClass;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/DifferentPackageAsConflict_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/DifferentPackageAsConflict_result.js b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/DifferentPackageAsConflict_result.js
new file mode 100644
index 0000000..680e048
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/DifferentPackageAsConflict_result.js
@@ -0,0 +1,79 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * DifferentPackageAsConflict
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('DifferentPackageAsConflict');
+
+goog.require('mypackage.TestClass');
+
+
+
+/**
+ * @constructor
+ */
+DifferentPackageAsConflict = function() {
+  this.testClass = new mypackage.TestClass();
+};
+
+
+/**
+ * @private
+ * @type {mypackage.TestClass}
+ */
+DifferentPackageAsConflict.prototype.testClass;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+DifferentPackageAsConflict.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'DifferentPackageAsConflict', qName: 'DifferentPackageAsConflict'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('DifferentPackageAsConflict', DifferentPackageAsConflict);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+DifferentPackageAsConflict.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'DifferentPackageAsConflict': { type: '', declaredBy: 'DifferentPackageAsConflict'}
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/Event.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/Event.as b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/Event.as
new file mode 100644
index 0000000..1a1d54c
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/package_conflicts_different_package_as_conflict/Event.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+  public class Event
+  {
+    public function Event() 
+    {
+    }
+  }
+}
\ No newline at end of file


[41/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogEmitter.java
new file mode 100644
index 0000000..e08fb84
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogEmitter.java
@@ -0,0 +1,1120 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import java.io.FilterWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.flex.compiler.codegen.IASGlobalFunctionConstants.BuiltinType;
+import org.apache.flex.compiler.codegen.js.goog.IJSGoogDocEmitter;
+import org.apache.flex.compiler.codegen.js.goog.IJSGoogEmitter;
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.common.ModifiersSet;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.definitions.IPackageDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.definitions.IVariableDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSessionModel;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
+import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
+import org.apache.flex.compiler.internal.scopes.PackageScope;
+import org.apache.flex.compiler.internal.tree.as.ChainedVariableNode;
+import org.apache.flex.compiler.internal.tree.as.FunctionCallNode;
+import org.apache.flex.compiler.internal.tree.as.FunctionNode;
+import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.scopes.IASScope;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IAccessorNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IEmbedNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.INamespaceAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.apache.flex.compiler.tree.as.ITypeNode;
+import org.apache.flex.compiler.tree.as.IVariableExpressionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.utils.ASNodeUtils;
+
+/**
+ * Concrete implementation of the 'goog' JavaScript production.
+ * 
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class JSGoogEmitter extends JSEmitter implements IJSGoogEmitter
+{
+    protected List<String> propertyNames = new ArrayList<String>();
+
+    // TODO (mschmalle) Remove this (not used in JSFlexJSEmitter and JSGoogEmitter anymore)
+    public ICompilerProject project;
+
+    private JSGoogDocEmitter docEmitter;
+    
+    // TODO (mschmalle) Fix; this is not using the backend doc strategy for replacement
+    @Override
+    public IJSGoogDocEmitter getDocEmitter()
+    {
+        if (docEmitter == null)
+            docEmitter = new JSGoogDocEmitter(this);
+        return docEmitter;
+    }
+
+    @Override
+    public String formatQualifiedName(String name)
+    {
+        return name;
+    }
+
+    //--------------------------------------------------------------------------
+    // Package Level
+    //--------------------------------------------------------------------------
+
+    // XXX DEAD
+    @Override
+    public void emitPackageHeader(IPackageDefinition definition)
+    {
+        IASScope containedScope = definition.getContainedScope();
+        ITypeDefinition type = findType(containedScope.getAllLocalDefinitions());
+        if (type == null)
+            return;
+
+        /* goog.provide('x');\n\n */
+        write(JSGoogEmitterTokens.GOOG_PROVIDE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(type.getQualifiedName());
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline(ASEmitterTokens.SEMICOLON);
+        writeNewline();
+    }
+
+    // XXX DEAD
+    @Override
+    public void emitPackageHeaderContents(IPackageDefinition definition)
+    {
+        PackageScope containedScope = (PackageScope) definition
+                .getContainedScope();
+
+        ITypeDefinition type = findType(containedScope.getAllLocalDefinitions());
+        if (type == null)
+            return;
+
+        List<String> list = EmitterUtils.resolveImports(type);
+        for (String imp : list)
+        {
+            if (imp.indexOf(JSGoogEmitterTokens.AS3.getToken()) != -1)
+                continue;
+
+            /* goog.require('x');\n */
+            write(JSGoogEmitterTokens.GOOG_REQUIRE);
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+            write(imp);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+            write(ASEmitterTokens.PAREN_CLOSE);
+            writeNewline(ASEmitterTokens.SEMICOLON);
+        }
+
+        // (erikdebruin) only write 'closing' line break when there are 
+        //               actually imports...
+        if (list.size() > 1
+                || (list.size() == 1 && list.get(0).indexOf(
+                        JSGoogEmitterTokens.AS3.getToken()) == -1))
+        {
+            writeNewline();
+        }
+    }
+
+    // XXX DEAD
+    @Override
+    public void emitPackageContents(IPackageDefinition definition)
+    {
+        IASScope containedScope = definition.getContainedScope();
+        
+        ITypeDefinition type = EmitterUtils.findType(containedScope.getAllLocalDefinitions());
+        if (type != null)
+        {
+            ITypeNode tnode = EmitterUtils.findTypeNode(definition.getNode());
+            if (tnode != null)
+            {
+                getWalker().walk(tnode); // IClassNode | IInterfaceNode
+            }
+            return;
+        }
+        
+        IFunctionDefinition func = EmitterUtils.findFunction(containedScope.getAllLocalDefinitions());
+        if (func != null)
+        {
+            IFunctionNode fnode = EmitterUtils.findFunctionNode(definition.getNode());
+            if (fnode != null)
+            {
+                getWalker().walk(fnode);
+            }
+            return;
+        }
+
+        IVariableDefinition variable = EmitterUtils.findVariable(containedScope.getAllLocalDefinitions());
+        if (variable != null)
+        {
+            IVariableNode vnode = EmitterUtils.findVariableNode(definition.getNode());
+            if (vnode != null)
+            {
+                getWalker().walk(vnode);
+            }
+        }
+    }
+
+    // XXX DEAD
+    @Override
+    public void emitPackageFooter(IPackageDefinition definition)
+    {
+    }
+
+    //--------------------------------------------------------------------------
+    // Class
+    //--------------------------------------------------------------------------
+
+    // XXX DEAD
+    @Override
+    public void emitClass(IClassNode node)
+    {
+        IClassDefinition definition = node.getDefinition();
+        getModel().setCurrentClass(definition);
+
+        IFunctionDefinition ctorDefinition = definition.getConstructor();
+
+        // Static-only (Singleton) classes may not have a constructor
+        if (ctorDefinition != null)
+        {
+            IFunctionNode ctorNode = (IFunctionNode) ctorDefinition.getNode();
+            if (ctorNode != null)
+            {
+                // constructor
+                emitMethod(ctorNode);
+                write(ASEmitterTokens.SEMICOLON);
+            }
+            else
+            {
+                String qname = definition.getQualifiedName();
+                if (qname != null && !qname.equals(""))
+                {
+                    write(qname);
+                    write(ASEmitterTokens.SPACE);
+                    writeToken(ASEmitterTokens.EQUAL);
+                    write(ASEmitterTokens.FUNCTION);
+                    write(ASEmitterTokens.PAREN_OPEN);
+                    write(ASEmitterTokens.PAREN_CLOSE);
+                    write(ASEmitterTokens.SPACE);
+                    write(ASEmitterTokens.BLOCK_OPEN);
+                    writeNewline();
+                    write(ASEmitterTokens.BLOCK_CLOSE);
+                    write(ASEmitterTokens.SEMICOLON);
+                }
+            }
+        }
+
+        IDefinitionNode[] dnodes = node.getAllMemberNodes();
+        for (IDefinitionNode dnode : dnodes)
+        {
+            if (dnode.getNodeID() == ASTNodeID.VariableID)
+            {
+                writeNewline();
+                writeNewline();
+                emitField((IVariableNode) dnode);
+                write(ASEmitterTokens.SEMICOLON);
+            }
+            else if (dnode.getNodeID() == ASTNodeID.FunctionID)
+            {
+                if (!((IFunctionNode) dnode).isConstructor())
+                {
+                    writeNewline();
+                    writeNewline();
+                    emitMethod((IFunctionNode) dnode);
+                    write(ASEmitterTokens.SEMICOLON);
+                }
+            }
+            else if (dnode.getNodeID() == ASTNodeID.GetterID
+                    || dnode.getNodeID() == ASTNodeID.SetterID)
+            {
+                writeNewline();
+                writeNewline();
+                emitAccessors((IAccessorNode) dnode);
+                write(ASEmitterTokens.SEMICOLON);
+            }
+        }
+    }
+
+    // XXX Dead [InterfaceEmitter]
+    @Override
+    public void emitInterface(IInterfaceNode node)
+    {
+        ICompilerProject project = getWalker().getProject();
+
+        getDocEmitter().emitInterfaceDoc(node, project);
+
+        String qname = node.getQualifiedName();
+        if (qname != null && !qname.equals(""))
+        {
+            write(formatQualifiedName(qname));
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            write(ASEmitterTokens.FUNCTION);
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(ASEmitterTokens.PAREN_CLOSE);
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.BLOCK_OPEN);
+            writeNewline();
+            write(ASEmitterTokens.BLOCK_CLOSE);
+            write(ASEmitterTokens.SEMICOLON);
+        }
+
+        final IDefinitionNode[] members = node.getAllMemberDefinitionNodes();
+        for (IDefinitionNode mnode : members)
+        {
+            boolean isAccessor = mnode.getNodeID() == ASTNodeID.GetterID
+                    || mnode.getNodeID() == ASTNodeID.SetterID;
+
+            if (!isAccessor || !propertyNames.contains(qname))
+            {
+                writeNewline();
+
+                write(formatQualifiedName(qname));
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                write(JSEmitterTokens.PROTOTYPE);
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                write(mnode.getQualifiedName());
+
+                if (isAccessor && !propertyNames.contains(qname))
+                {
+                    propertyNames.add(qname);
+                }
+                else
+                {
+                    write(ASEmitterTokens.SPACE);
+                    writeToken(ASEmitterTokens.EQUAL);
+                    write(ASEmitterTokens.FUNCTION);
+
+                    emitParameters(((IFunctionNode) mnode).getParametersContainerNode());
+
+                    write(ASEmitterTokens.SPACE);
+                    write(ASEmitterTokens.BLOCK_OPEN);
+                    writeNewline();
+                    write(ASEmitterTokens.BLOCK_CLOSE);
+                }
+
+                write(ASEmitterTokens.SEMICOLON);
+            }
+        }
+    }
+
+    // XXX Dead
+    @Override
+    public void emitField(IVariableNode node)
+    {
+        IClassDefinition definition = EmitterUtils.getClassDefinition(node);
+
+        IDefinition def = null;
+        IExpressionNode enode = node.getVariableTypeNode();//getAssignedValueNode();
+        if (enode != null)
+            def = enode.resolveType(getWalker().getProject());
+
+        getDocEmitter().emitFieldDoc(node, def, getWalker().getProject());
+
+        /* x.prototype.y = z */
+
+        ModifiersSet modifierSet = node.getDefinition().getModifiers();
+        String root = "";
+        if (modifierSet != null && !modifierSet.hasModifier(ASModifier.STATIC))
+        {
+            root = JSEmitterTokens.PROTOTYPE.getToken();
+            root += ASEmitterTokens.MEMBER_ACCESS.getToken();
+        }
+        write(definition.getQualifiedName()
+                + ASEmitterTokens.MEMBER_ACCESS.getToken() + root
+                + node.getName());
+
+        IExpressionNode vnode = node.getAssignedValueNode();
+        if (vnode != null)
+        {
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            getWalker().walk(vnode);
+        }
+
+        if (!(node instanceof ChainedVariableNode))
+        {
+            int len = node.getChildCount();
+            for (int i = 0; i < len; i++)
+            {
+                IASNode child = node.getChild(i);
+                if (child instanceof ChainedVariableNode)
+                {
+                    writeNewline(ASEmitterTokens.SEMICOLON);
+                    writeNewline();
+                    emitField((IVariableNode) child);
+                }
+            }
+        }
+    }
+
+    // XXX Dead [VarDeclarationEmitter]
+    @Override
+    public void emitVarDeclaration(IVariableNode node)
+    {
+        if (!(node instanceof ChainedVariableNode) && !node.isConst())
+        {
+            emitMemberKeyword(node);
+        }
+
+        IExpressionNode avnode = node.getAssignedValueNode();
+        if (avnode != null)
+        {
+            IDefinition def = avnode.resolveType(getWalker().getProject());
+
+            String opcode = avnode.getNodeID().getParaphrase();
+            if (opcode != "AnonymousFunction")
+                getDocEmitter().emitVarDoc(node, def, getWalker().getProject());
+        }
+        else
+        {
+            getDocEmitter().emitVarDoc(node, null, getWalker().getProject());
+        }
+
+        emitDeclarationName(node);
+        if (avnode != null && !(avnode instanceof IEmbedNode))
+        {
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            emitAssignedValue(avnode);
+        }
+
+        if (!(node instanceof ChainedVariableNode))
+        {
+            // check for chained variables
+            int len = node.getChildCount();
+            for (int i = 0; i < len; i++)
+            {
+                IASNode child = node.getChild(i);
+                if (child instanceof ChainedVariableNode)
+                {
+                    writeToken(ASEmitterTokens.COMMA);
+                    emitVarDeclaration((IVariableNode) child);
+                }
+            }
+        }
+    }
+
+    // XXX Dead 
+    public void emitAccessors(IAccessorNode node)
+    {
+        String qname = node.getQualifiedName();
+        if (!propertyNames.contains(qname))
+        {
+            emitField(node);
+            write(ASEmitterTokens.SEMICOLON);
+            writeNewline();
+            writeNewline();
+
+            propertyNames.add(qname);
+        }
+
+        if (node.getNodeID() == ASTNodeID.GetterID)
+        {
+            emitGetAccessor((IGetterNode) node);
+        }
+        else if (node.getNodeID() == ASTNodeID.SetterID)
+        {
+            emitSetAccessor((ISetterNode) node);
+        }
+    }
+
+    // XXX Dead 
+    @Override
+    public void emitGetAccessor(IGetterNode node)
+    {
+        emitObjectDefineProperty(node);
+    }
+
+    // XXX Dead 
+    @Override
+    public void emitSetAccessor(ISetterNode node)
+    {
+        emitObjectDefineProperty(node);
+    }
+
+    // XXX Dead [MethodEmitter]
+    @Override
+    public void emitMethod(IFunctionNode node)
+    {
+        FunctionNode fn = (FunctionNode) node;
+        fn.parseFunctionBody(new ArrayList<ICompilerProblem>());
+
+        ICompilerProject project = getWalker().getProject();
+
+        getDocEmitter().emitMethodDoc(node, project);
+
+        boolean isConstructor = node.isConstructor();
+
+        String qname = EmitterUtils.getTypeDefinition(node).getQualifiedName();
+        if (qname != null && !qname.equals(""))
+        {
+            write(formatQualifiedName(qname));
+            if (!isConstructor)
+            {
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                if (!fn.hasModifier(ASModifier.STATIC))
+                {
+                    write(JSEmitterTokens.PROTOTYPE);
+                    write(ASEmitterTokens.MEMBER_ACCESS);
+                }
+            }
+        }
+
+        if (!isConstructor)
+            emitMemberName(node);
+
+        write(ASEmitterTokens.SPACE);
+        writeToken(ASEmitterTokens.EQUAL);
+        write(ASEmitterTokens.FUNCTION);
+
+        emitParameters(node.getParametersContainerNode());
+
+        boolean hasSuperClass = EmitterUtils.hasSuperClass(project, node);
+
+        if (isConstructor && node.getScopedNode().getChildCount() == 0)
+        {
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.BLOCK_OPEN);
+            if (hasSuperClass)
+                emitSuperCall(node, JSSessionModel.CONSTRUCTOR_EMPTY);
+            writeNewline();
+            write(ASEmitterTokens.BLOCK_CLOSE);
+        }
+
+        if (!isConstructor || node.getScopedNode().getChildCount() > 0)
+            emitMethodScope(node.getScopedNode());
+
+        if (isConstructor && hasSuperClass)
+        {
+            writeNewline(ASEmitterTokens.SEMICOLON);
+            write(JSGoogEmitterTokens.GOOG_INHERITS);
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(formatQualifiedName(qname));
+            writeToken(ASEmitterTokens.COMMA);
+            String sname = EmitterUtils.getSuperClassDefinition(node, project)
+                    .getQualifiedName();
+            write(formatQualifiedName(sname));
+            write(ASEmitterTokens.PAREN_CLOSE);
+        }
+    }
+
+    // XXX Dead
+    @Override
+    public void emitFunctionCall(IFunctionCallNode node)
+    {
+        IASNode cnode = node.getChild(0);
+
+        if (cnode.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+            cnode = cnode.getChild(0);
+
+        ASTNodeID id = cnode.getNodeID();
+        if (id != ASTNodeID.SuperID)
+        {
+            if (node.isNewExpression())
+            {
+                writeToken(ASEmitterTokens.NEW);
+            }
+
+            getWalker().walk(node.getNameNode());
+            
+            emitArguments(node.getArgumentsNode());
+        }
+        else
+        {
+            emitSuperCall(node, JSSessionModel.SUPER_FUNCTION_CALL);
+        }
+    }
+
+    // XXX Dead
+    @Override
+    public void emitIdentifier(IIdentifierNode node)
+    {
+        ICompilerProject project = getWalker().getProject();
+
+        IClassNode cnode = (IClassNode) node
+                .getAncestorOfType(IClassNode.class);
+
+        IDefinition def = node.resolve(project);
+
+        ITypeDefinition type = node.resolveType(project);
+
+        IASNode pnode = node.getParent();
+        ASTNodeID inode = pnode.getNodeID();
+
+        boolean writeSelf = false;
+        if (cnode != null)
+        {
+            IDefinitionNode[] members = cnode.getAllMemberNodes();
+            for (IDefinitionNode mnode : members)
+            {
+                if ((type != null && type.getQualifiedName().equalsIgnoreCase(
+                        IASLanguageConstants.Function))
+                        || (def != null && def.getQualifiedName()
+                                .equalsIgnoreCase(mnode.getQualifiedName())))
+                {
+                    if (!(pnode instanceof FunctionNode)
+                            && inode != ASTNodeID.MemberAccessExpressionID)
+                    {
+                        writeSelf = true;
+                        break;
+                    }
+                    else if (inode == ASTNodeID.MemberAccessExpressionID
+                            && !def.isStatic())
+                    {
+                        String tname = type.getQualifiedName();
+                        writeSelf = !tname.equalsIgnoreCase(cnode
+                                .getQualifiedName())
+                                && !tname.equals(IASLanguageConstants.Function);
+                        break;
+                    }
+                }
+            }
+        }
+
+        boolean isRunningInTestMode = cnode != null
+                && cnode.getQualifiedName().equalsIgnoreCase("FalconTest_A");
+        if (writeSelf && !isRunningInTestMode)
+        {
+            write(JSGoogEmitterTokens.SELF);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+        }
+        else
+        {
+            String pname = (type != null) ? type.getPackageName() : "";
+            if (cnode != null && pname != ""
+                    && !pname.equalsIgnoreCase(cnode.getPackageName())
+                    && inode != ASTNodeID.ArgumentID
+                    && inode != ASTNodeID.VariableID
+                    && inode != ASTNodeID.TypedExpressionID)
+            {
+                write(pname);
+                write(ASEmitterTokens.MEMBER_ACCESS);
+            }
+        }
+
+        super.emitIdentifier(node);
+    }
+
+    @Override
+    public void emitFunctionBlockHeader(IFunctionNode node)
+    {
+        IDefinition def = node.getDefinition();
+        boolean isStatic = false;
+        if (def != null && def.isStatic())
+            isStatic = true;
+        boolean isLocal = false;
+        if (node.getFunctionClassification() == IFunctionDefinition.FunctionClassification.LOCAL)
+            isLocal = true;
+        if (EmitterUtils.hasBody(node) && !isStatic && !isLocal)
+            emitSelfReference(node);
+
+        if (node.isConstructor()
+                && EmitterUtils.hasSuperClass(getWalker().getProject(), node)
+                && !EmitterUtils.hasSuperCall(node.getScopedNode()))
+            emitSuperCall(node, JSSessionModel.CONSTRUCTOR_FULL);
+
+        emitRestParameterCodeBlock(node);
+
+        emitDefaultParameterCodeBlock(node);
+    }
+
+    // XXX Dead
+    protected void emitSelfReference(IFunctionNode node)
+    {
+        writeToken(ASEmitterTokens.VAR);
+        writeToken(JSGoogEmitterTokens.SELF);
+        writeToken(ASEmitterTokens.EQUAL);
+        write(ASEmitterTokens.THIS);
+        writeNewline(ASEmitterTokens.SEMICOLON);
+    }
+
+    // XXX Dead
+    protected void emitSuperCall(IASNode node, String type)
+    {
+        IFunctionNode fnode = (node instanceof IFunctionNode) ? (IFunctionNode) node
+                : null;
+        IFunctionCallNode fcnode = (node instanceof IFunctionCallNode) ? (FunctionCallNode) node
+                : null;
+
+        if (type == JSSessionModel.CONSTRUCTOR_EMPTY)
+        {
+            indentPush();
+            writeNewline();
+            indentPop();
+        }
+        else if (type == JSSessionModel.SUPER_FUNCTION_CALL)
+        {
+            if (fnode == null)
+                fnode = (IFunctionNode) fcnode
+                        .getAncestorOfType(IFunctionNode.class);
+        }
+
+        if (fnode.isConstructor()
+                && !EmitterUtils.hasSuperClass(getWalker().getProject(), fnode))
+            return;
+
+        IClassNode cnode = (IClassNode) node
+                .getAncestorOfType(IClassNode.class);
+
+        if (cnode == null)
+        {
+            IDefinition cdef = getModel().getCurrentClass();
+            write(formatQualifiedName(cdef.getQualifiedName()));
+        }
+        else
+            write(formatQualifiedName(cnode.getQualifiedName()));
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        write(JSGoogEmitterTokens.GOOG_BASE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(ASEmitterTokens.THIS);
+
+        if (fnode.isConstructor())
+        {
+            writeToken(ASEmitterTokens.COMMA);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+            write(JSGoogEmitterTokens.GOOG_CONSTRUCTOR);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+        }
+
+        if (fnode != null && !fnode.isConstructor())
+        {
+            writeToken(ASEmitterTokens.COMMA);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+            write(fnode.getName());
+            write(ASEmitterTokens.SINGLE_QUOTE);
+        }
+
+        IASNode[] anodes = null;
+        boolean writeArguments = false;
+        if (fcnode != null)
+        {
+            anodes = fcnode.getArgumentNodes();
+
+            writeArguments = anodes.length > 0;
+        }
+        else if (fnode.isConstructor())
+        {
+            anodes = fnode.getParameterNodes();
+
+            writeArguments = (anodes != null && anodes.length > 0);
+        }
+
+        if (writeArguments)
+        {
+            int len = anodes.length;
+            for (int i = 0; i < len; i++)
+            {
+                writeToken(ASEmitterTokens.COMMA);
+
+                getWalker().walk(anodes[i]);
+            }
+        }
+
+        write(ASEmitterTokens.PAREN_CLOSE);
+
+        if (type == JSSessionModel.CONSTRUCTOR_FULL)
+        {
+            write(ASEmitterTokens.SEMICOLON);
+            writeNewline();
+        }
+        else if (type == JSSessionModel.CONSTRUCTOR_EMPTY)
+        {
+            write(ASEmitterTokens.SEMICOLON);
+        }
+    }
+
+    protected void emitDefaultParameterCodeBlock(IFunctionNode node)
+    {
+        IParameterNode[] pnodes = node.getParameterNodes();
+        if (pnodes.length == 0)
+            return;
+
+        Map<Integer, IParameterNode> defaults = EmitterUtils
+                .getDefaults(pnodes);
+
+        if (defaults != null)
+        {
+            final StringBuilder code = new StringBuilder();
+
+            if (!EmitterUtils.hasBody(node))
+            {
+                indentPush();
+                writeIndent();
+            }
+
+            List<IParameterNode> parameters = new ArrayList<IParameterNode>(
+                    defaults.values());
+
+            for (int i = 0, n = parameters.size(); i < n; i++)
+            {
+                IParameterNode pnode = parameters.get(i);
+
+                if (pnode != null)
+                {
+                    code.setLength(0);
+
+                    /* x = typeof y !== 'undefined' ? y : z;\n */
+                    code.append(pnode.getName());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.EQUAL.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.TYPEOF.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(pnode.getName());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.STRICT_NOT_EQUAL.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+                    code.append(ASEmitterTokens.UNDEFINED.getToken());
+                    code.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.TERNARY.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(pnode.getName());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(ASEmitterTokens.COLON.getToken());
+                    code.append(ASEmitterTokens.SPACE.getToken());
+                    code.append(pnode.getDefaultValue());
+                    code.append(ASEmitterTokens.SEMICOLON.getToken());
+
+                    write(code.toString());
+
+                    if (i == n - 1 && !EmitterUtils.hasBody(node))
+                        indentPop();
+
+                    writeNewline();
+                }
+            }
+        }
+    }
+
+    protected void emitRestParameterCodeBlock(IFunctionNode node)
+    {
+        IParameterNode[] pnodes = node.getParameterNodes();
+
+        IParameterNode rest = EmitterUtils.getRest(pnodes);
+        if (rest != null)
+        {
+            final StringBuilder code = new StringBuilder();
+
+            /* x = Array.prototype.slice.call(arguments, y);\n */
+            code.append(rest.getName());
+            code.append(ASEmitterTokens.SPACE.getToken());
+            code.append(ASEmitterTokens.EQUAL.getToken());
+            code.append(ASEmitterTokens.SPACE.getToken());
+            code.append(BuiltinType.ARRAY.getName());
+            code.append(ASEmitterTokens.MEMBER_ACCESS.getToken());
+            code.append(JSEmitterTokens.PROTOTYPE.getToken());
+            code.append(ASEmitterTokens.MEMBER_ACCESS.getToken());
+            code.append(JSEmitterTokens.SLICE.getToken());
+            code.append(ASEmitterTokens.MEMBER_ACCESS.getToken());
+            code.append(JSEmitterTokens.CALL.getToken());
+            code.append(ASEmitterTokens.PAREN_OPEN.getToken());
+            code.append(JSEmitterTokens.ARGUMENTS.getToken());
+            code.append(ASEmitterTokens.COMMA.getToken());
+            code.append(ASEmitterTokens.SPACE.getToken());
+            code.append(String.valueOf(pnodes.length - 1));
+            code.append(ASEmitterTokens.PAREN_CLOSE.getToken());
+            code.append(ASEmitterTokens.SEMICOLON.getToken());
+
+            write(code.toString());
+
+            writeNewline();
+        }
+    }
+
+    @Override
+    public void emitParameter(IParameterNode node)
+    {
+        getWalker().walk(node.getNameExpressionNode());
+    }
+
+    @Override
+    public void emitAssignedValue(IExpressionNode node)
+    {
+        if (node == null)
+        {
+            return;
+        }
+        IDefinition definition = node.resolve(getWalker().getProject());
+        if (node.getNodeID() == ASTNodeID.ClassReferenceID)
+        {
+            write(definition.getQualifiedName());
+        }
+        else
+        {
+            // AJH need Language.bind here and maybe not require
+            // that the node is a MemberAccessExpression
+            if (definition instanceof FunctionDefinition &&
+                    !((FunctionDefinition)definition).isStatic() &&
+                    (!(definition instanceof AccessorDefinition)) &&
+                    node instanceof MemberAccessExpressionNode)
+            {
+                emitClosureStart();
+                getWalker().walk(node);
+                writeToken(ASEmitterTokens.COMMA);
+                getWalker().walk(((MemberAccessExpressionNode)node).getLeftOperandNode());
+                emitClosureEnd(((MemberAccessExpressionNode)node).getLeftOperandNode());
+            }
+            else
+                getWalker().walk(node);
+        }
+    }
+
+    // XXX Dead
+    @Override
+    public void emitForEachLoop(IForLoopNode node)
+    {
+        IContainerNode xnode = (IContainerNode) node.getChild(1);
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) node
+                .getConditionalsContainerNode().getChild(0);
+        IASNode childNode = bnode.getChild(0);
+
+        write(JSGoogEmitterTokens.GOOG_ARRAY_FOREACH);
+        write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(bnode.getChild(1));
+        writeToken(ASEmitterTokens.COMMA);
+        writeToken(ASEmitterTokens.FUNCTION);
+        write(ASEmitterTokens.PAREN_OPEN);
+        if (childNode instanceof IVariableExpressionNode)
+            write(((IVariableNode) childNode.getChild(0)).getName());
+        else
+            write(((IIdentifierNode) childNode).getName());
+        writeToken(ASEmitterTokens.PAREN_CLOSE);
+        if (isImplicit(xnode))
+            write(ASEmitterTokens.BLOCK_OPEN);
+        getWalker().walk(node.getStatementContentsNode());
+        if (isImplicit(xnode))
+        {
+            writeNewline();
+            write(ASEmitterTokens.BLOCK_CLOSE);
+        }
+        write(ASEmitterTokens.PAREN_CLOSE);
+    }
+
+    public JSGoogEmitter(FilterWriter out)
+    {
+        super(out);
+    }
+
+    // XXX Dead
+    protected void emitObjectDefineProperty(IAccessorNode node)
+    {
+        /*
+        Object.defineProperty(
+            A.prototype, 
+            'foo', 
+            {get: function() {return -1;}, 
+            configurable: true}
+         );
+        */
+
+        FunctionNode fn = (FunctionNode) node;
+        fn.parseFunctionBody(getProblems());
+
+        // head
+        write(JSGoogEmitterTokens.OBJECT);
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        write(JSEmitterTokens.DEFINE_PROPERTY);
+        writeNewline(ASEmitterTokens.PAREN_OPEN, true);
+
+        // Type
+        IFunctionDefinition definition = node.getDefinition();
+        ITypeDefinition type = (ITypeDefinition) definition.getParent();
+        write(type.getQualifiedName());
+        if (!node.hasModifier(ASModifier.STATIC))
+        {
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSEmitterTokens.PROTOTYPE);
+        }
+        writeToken(ASEmitterTokens.COMMA);
+        writeNewline();
+
+        // name
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(definition.getBaseName());
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        writeToken(ASEmitterTokens.COMMA);
+        writeNewline();
+
+        // info object
+        // declaration
+        write(ASEmitterTokens.BLOCK_OPEN);
+        write(node.getNodeID() == ASTNodeID.GetterID ? ASEmitterTokens.GET
+                : ASEmitterTokens.SET);
+        write(ASEmitterTokens.COLON);
+        write(ASEmitterTokens.FUNCTION);
+        emitParameters(node.getParametersContainerNode());
+
+        emitDefinePropertyFunction(node);
+
+        writeToken(ASEmitterTokens.COMMA);
+        write(JSEmitterTokens.CONFIGURABLE);
+        write(ASEmitterTokens.COLON);
+        write(ASEmitterTokens.TRUE);
+        writeNewline(ASEmitterTokens.BLOCK_CLOSE, false);
+
+        // tail, no colon; parent container will add it
+        write(ASEmitterTokens.PAREN_CLOSE);
+    }
+
+    // XXX Dead
+    protected void emitDefinePropertyFunction(IAccessorNode node)
+    {
+        emitMethodScope(node.getScopedNode());
+    }
+
+    //--------------------------------------------------------------------------
+    // Operators
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitNamespaceAccessExpression(
+            INamespaceAccessExpressionNode node)
+    {
+        getWalker().walk(node.getLeftOperandNode());
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        getWalker().walk(node.getRightOperandNode());
+    }
+
+    @Override
+    public void emitAsOperator(IBinaryOperatorNode node)
+    {
+        emitBinaryOperator(node);
+    }
+
+    @Override
+    public void emitIsOperator(IBinaryOperatorNode node)
+    {
+        emitBinaryOperator(node);
+    }
+
+    // XXX Dead
+    @Override
+    public void emitBinaryOperator(IBinaryOperatorNode node)
+    {
+        if (ASNodeUtils.hasParenOpen(node))
+            write(ASEmitterTokens.PAREN_OPEN);
+
+        ASTNodeID id = node.getNodeID();
+
+        if (id == ASTNodeID.Op_IsID)
+        {
+            write(ASEmitterTokens.IS);
+            write(ASEmitterTokens.PAREN_OPEN);
+            getWalker().walk(node.getLeftOperandNode());
+            writeToken(ASEmitterTokens.COMMA);
+            getWalker().walk(node.getRightOperandNode());
+            write(ASEmitterTokens.PAREN_CLOSE);
+        }
+        else if (id == ASTNodeID.Op_AsID)
+        {
+            // (is(a, b) ? a : null)
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(ASEmitterTokens.IS);
+            write(ASEmitterTokens.PAREN_OPEN);
+            getWalker().walk(node.getLeftOperandNode());
+            writeToken(ASEmitterTokens.COMMA);
+            getWalker().walk(node.getRightOperandNode());
+            writeToken(ASEmitterTokens.PAREN_CLOSE);
+            writeToken(ASEmitterTokens.TERNARY);
+            getWalker().walk(node.getLeftOperandNode());
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.COLON);
+            write(ASEmitterTokens.NULL);
+            write(ASEmitterTokens.PAREN_CLOSE);
+        }
+        else
+        {
+            getWalker().walk(node.getLeftOperandNode());
+
+            if (id != ASTNodeID.Op_CommaID)
+                write(ASEmitterTokens.SPACE);
+
+            // (erikdebruin) rewrite 'a &&= b' to 'a = a && b'
+            if (id == ASTNodeID.Op_LogicalAndAssignID
+                    || id == ASTNodeID.Op_LogicalOrAssignID)
+            {
+                IIdentifierNode lnode = (IIdentifierNode) node
+                        .getLeftOperandNode();
+
+                writeToken(ASEmitterTokens.EQUAL);
+                writeToken(lnode.getName());
+                write((id == ASTNodeID.Op_LogicalAndAssignID) ? ASEmitterTokens.LOGICAL_AND
+                        : ASEmitterTokens.LOGICAL_OR);
+            }
+            else
+            {
+                write(node.getOperator().getOperatorText());
+            }
+
+            write(ASEmitterTokens.SPACE);
+
+            getWalker().walk(node.getRightOperandNode());
+        }
+
+        if (ASNodeUtils.hasParenOpen(node))
+            write(ASEmitterTokens.PAREN_CLOSE);
+    }
+    
+    protected void emitClosureStart(FunctionNode node)
+    {
+        write(JSGoogEmitterTokens.GOOG_BIND);
+        write(ASEmitterTokens.PAREN_OPEN);
+    }
+    
+    protected void emitClosureEnd(FunctionNode node)
+    {
+        write(ASEmitterTokens.PAREN_CLOSE);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogEmitterTokens.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogEmitterTokens.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogEmitterTokens.java
new file mode 100644
index 0000000..fd41804
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogEmitterTokens.java
@@ -0,0 +1,52 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+
+public enum JSGoogEmitterTokens implements IEmitterTokens
+{
+    AS3("__AS3__"),
+    GOOG_ARRAY_FOREACH("goog.array.forEach"),
+    GOOG_BASE("base"),
+    GOOG_CALL("call"),
+    GOOG_BIND("goog.bind"),
+    GOOG_CONSTRUCTOR("constructor"),
+    GOOG_GOOG("goog"),
+    GOOG_INHERITS("goog.inherits"),
+    GOOG_PROVIDE("goog.provide"),
+    GOOG_REQUIRE("goog.require"),
+    OBJECT("Object"),
+    ARRAY("Array"),
+    ERROR("Error"),
+    SELF("self"),
+    SUPERCLASS("superClass_");
+
+    private String token;
+
+    private JSGoogEmitterTokens(String value)
+    {
+        token = value;
+    }
+
+    public String getToken()
+    {
+        return token;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogPublisher.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogPublisher.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogPublisher.java
new file mode 100644
index 0000000..a031737
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogPublisher.java
@@ -0,0 +1,360 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.filefilter.DirectoryFileFilter;
+import org.apache.commons.io.filefilter.RegexFileFilter;
+import org.apache.flex.compiler.clients.JSConfiguration;
+import org.apache.flex.compiler.clients.MXMLJSC.JSOutputType;
+import org.apache.flex.compiler.clients.problems.ProblemQuery;
+import org.apache.flex.compiler.codegen.js.IJSPublisher;
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.internal.codegen.js.JSPublisher;
+import org.apache.flex.compiler.internal.codegen.js.JSSharedData;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.utils.JSClosureCompilerUtil;
+
+import com.google.javascript.jscomp.CheckLevel;
+import com.google.javascript.jscomp.ErrorManager;
+import com.google.javascript.jscomp.JSError;
+import com.google.javascript.jscomp.SourceFile;
+import com.google.javascript.jscomp.SourceMap;
+import com.google.javascript.jscomp.deps.DepsGenerator;
+import com.google.javascript.jscomp.deps.DepsGenerator.InclusionStrategy;
+
+public class JSGoogPublisher extends JSPublisher implements IJSPublisher
+{
+
+    public static final String GOOG_INTERMEDIATE_DIR_NAME = "js-intermediate";
+    public static final String GOOG_RELEASE_DIR_NAME = "js-release";
+
+    public JSGoogPublisher(Configuration config)
+    {
+        super(config);
+    }
+
+    @Override
+    public File getOutputFolder()
+    {
+        outputParentFolder = new File(configuration.getTargetFileDirectory()).getParentFile();
+        outputFolder = new File(outputParentFolder,
+                JSGoogPublisher.GOOG_INTERMEDIATE_DIR_NAME);
+
+        setupOutputFolder();
+
+        return outputFolder;
+    }
+
+    @Override
+    public boolean publish(ProblemQuery problems) throws IOException
+    {
+        final String intermediateDirPath = getOutputFolder().getPath();
+
+        final String projectName = FilenameUtils.getBaseName(configuration.getTargetFile());
+        final String outputFileName = projectName + "."
+                + JSSharedData.OUTPUT_EXTENSION;
+
+        File releaseDir = new File(
+                new File(intermediateDirPath).getParentFile(),
+                GOOG_RELEASE_DIR_NAME);
+        final String releaseDirPath = releaseDir.getPath();
+        if (releaseDir.exists())
+            org.apache.commons.io.FileUtils.deleteQuietly(releaseDir);
+        releaseDir.mkdir();
+
+        final String closureLibDirPath = ((JSGoogConfiguration) configuration).getClosureLib();
+        final String closureGoogSrcLibDirPath = closureLibDirPath
+                + "/closure/goog/";
+        final String closureGoogTgtLibDirPath = intermediateDirPath
+                + "/library/closure/goog";
+        final String closureTPSrcLibDirPath = closureLibDirPath
+                + "/third_party/closure/goog/";
+        final String closureTPTgtLibDirPath = intermediateDirPath
+                + "/library/third_party/closure/goog";
+        final List<String> vanillaSDKSrcLibDirPath = ((JSGoogConfiguration) configuration).getSDKJSLib();
+        final String vanillaSDKTgtLibDirPath = intermediateDirPath
+                + "/VanillaSDK";
+
+        final String depsSrcFilePath = intermediateDirPath
+                + "/library/closure/goog/deps.js";
+        final String depsTgtFilePath = intermediateDirPath + "/deps.js";
+        final String projectIntermediateJSFilePath = intermediateDirPath
+                + File.separator + outputFileName;
+        final String projectReleaseJSFilePath = releaseDirPath + File.separator
+                + outputFileName;
+
+        appendExportSymbol(projectIntermediateJSFilePath, projectName);
+
+        copyFile(vanillaSDKSrcLibDirPath.get(0), vanillaSDKTgtLibDirPath);
+
+        List<SourceFile> inputs = new ArrayList<SourceFile>();
+        Collection<File> files = org.apache.commons.io.FileUtils.listFiles(
+                new File(intermediateDirPath),
+                new RegexFileFilter("^.*(\\.js)"),
+                DirectoryFileFilter.DIRECTORY);
+        for (File file : files)
+        {
+            inputs.add(SourceFile.fromFile(file));
+        }
+
+        copyFile(closureGoogSrcLibDirPath, closureGoogTgtLibDirPath);
+        copyFile(closureTPSrcLibDirPath, closureTPTgtLibDirPath);
+
+        File srcDeps = new File(depsSrcFilePath);
+
+        final List<SourceFile> deps = new ArrayList<SourceFile>();
+        deps.add(SourceFile.fromFile(srcDeps));
+
+        ErrorManager errorManager = new JSGoogErrorManager();
+        DepsGenerator depsGenerator = new DepsGenerator(deps, inputs,
+                InclusionStrategy.ALWAYS, closureGoogTgtLibDirPath,
+                errorManager);
+        writeFile(depsTgtFilePath, depsGenerator.computeDependencyCalls(),
+                false);
+
+        org.apache.commons.io.FileUtils.deleteQuietly(srcDeps);
+        org.apache.commons.io.FileUtils.moveFile(new File(depsTgtFilePath),
+                srcDeps);
+
+        // XXX (mschmalle) until we figure out what is going on with this configuration, just skip
+        // HTML generation for JSC output type
+        String outputType = ((JSConfiguration) configuration).getJSOutputType();
+        if (!outputType.equals(JSOutputType.JSC.getText()))
+        {
+            writeHTML("intermediate", projectName, intermediateDirPath);
+            writeHTML("release", projectName, releaseDirPath);
+        }
+
+        ArrayList<String> optionList = new ArrayList<String>();
+
+        files = org.apache.commons.io.FileUtils.listFiles(new File(
+                intermediateDirPath), new RegexFileFilter("^.*(\\.js)"),
+                DirectoryFileFilter.DIRECTORY);
+        for (File file : files)
+        {
+            optionList.add("--js=" + file.getCanonicalPath());
+        }
+
+        optionList.add("--closure_entry_point=" + projectName);
+        optionList.add("--only_closure_dependencies");
+        optionList.add("--compilation_level=ADVANCED_OPTIMIZATIONS");
+        optionList.add("--js_output_file=" + projectReleaseJSFilePath);
+        optionList.add("--output_manifest=" + releaseDirPath + File.separator
+                + "manifest.txt");
+        optionList.add("--create_source_map=" + projectReleaseJSFilePath
+                + ".map");
+        optionList.add("--source_map_format=" + SourceMap.Format.V3);
+
+        String[] options = optionList.toArray(new String[0]);
+
+        JSClosureCompilerUtil.run(options);
+
+        appendSourceMapLocation(projectReleaseJSFilePath, projectName);
+
+        System.out.println("The project '" + projectName
+                + "' has been successfully compiled and optimized.");
+
+        return true;
+    }
+
+    private void appendExportSymbol(String path, String projectName)
+            throws IOException
+    {
+        StringBuilder appendString = new StringBuilder();
+        appendString.append("\n\n// Ensures the symbol will be visible after compiler renaming.\n");
+        appendString.append("goog.exportSymbol('");
+        appendString.append(projectName);
+        appendString.append("', ");
+        appendString.append(projectName);
+        appendString.append(");\n");
+        writeFile(path, appendString.toString(), true);
+    }
+
+    protected void appendSourceMapLocation(String path, String projectName)
+            throws IOException
+    {
+        StringBuilder appendString = new StringBuilder();
+        appendString.append("\n//# sourceMappingURL=./" + projectName
+                + ".js.map");
+        writeFile(path, appendString.toString(), true);
+    }
+
+    protected void copyFile(String srcPath, String tgtPath) throws IOException
+    {
+        File srcFile = new File(srcPath);
+        if (srcFile.isDirectory())
+            org.apache.commons.io.FileUtils.copyDirectory(srcFile, new File(
+                    tgtPath));
+        else
+            org.apache.commons.io.FileUtils.copyFile(srcFile, new File(tgtPath));
+    }
+
+    protected void writeHTML(String type, String projectName, String dirPath)
+            throws IOException
+    {
+        StringBuilder htmlFile = new StringBuilder();
+        htmlFile.append("<!DOCTYPE html>\n");
+        htmlFile.append("<html>\n");
+        htmlFile.append("<head>\n");
+        htmlFile.append("\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n");
+        htmlFile.append("\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
+
+        if (type == "intermediate")
+        {
+            htmlFile.append("\t<script type=\"text/javascript\" src=\"./library/closure/goog/base.js\"></script>\n");
+            htmlFile.append("\t<script type=\"text/javascript\">\n");
+            htmlFile.append("\t\tgoog.require(\"");
+            htmlFile.append(projectName);
+            htmlFile.append("\");\n");
+            htmlFile.append("\t</script>\n");
+        }
+        else
+        {
+            htmlFile.append("\t<script type=\"text/javascript\" src=\"./");
+            htmlFile.append(projectName);
+            htmlFile.append(".js\"></script>\n");
+        }
+
+        htmlFile.append("</head>\n");
+        htmlFile.append("<body>\n");
+        htmlFile.append("\t<script type=\"text/javascript\">\n");
+        htmlFile.append("\t\tnew ");
+        htmlFile.append(projectName);
+        htmlFile.append("();\n");
+        htmlFile.append("\t</script>\n");
+        htmlFile.append("</body>\n");
+        htmlFile.append("</html>");
+
+        writeFile(dirPath + File.separator + "index.html", htmlFile.toString(),
+                false);
+    }
+
+    protected void writeFile(String path, String content, boolean append)
+            throws IOException
+    {
+        File tgtFile = new File(path);
+
+        if (!tgtFile.exists())
+            tgtFile.createNewFile();
+
+        FileWriter fw = new FileWriter(tgtFile, append);
+        fw.write(content);
+        fw.close();
+    }
+
+    protected void dumpJar(File jarFile, File outputDir) throws IOException
+    {
+        // TODO (mschmalle) for some reason ide thinks this has not been closed
+        @SuppressWarnings("resource")
+        JarFile jar = new JarFile(jarFile);
+
+        for (Enumeration<JarEntry> jarEntries = jar.entries(); jarEntries.hasMoreElements();)
+        {
+            JarEntry jarEntry = jarEntries.nextElement();
+            if (!jarEntry.getName().endsWith("/"))
+            {
+                File file = new File(outputDir, jarEntry.getName());
+
+                // Check if the parent directory exists. If not -> create it.
+                File dir = file.getParentFile();
+                if (!dir.exists())
+                {
+                    if (!dir.mkdirs())
+                    {
+                        throw new IOException("Unable to create directory "
+                                + dir.getAbsolutePath());
+                    }
+                }
+
+                // Dump the file.
+                InputStream is = jar.getInputStream(jarEntry);
+                FileOutputStream fos = new FileOutputStream(file);
+                while (is.available() > 0)
+                {
+                    fos.write(is.read());
+                }
+                fos.close();
+                is.close();
+            }
+        }
+
+        jar.close();
+    }
+
+    public class JSGoogErrorManager implements ErrorManager
+    {
+        @Override
+        public void setTypedPercent(double arg0)
+        {
+        }
+
+        @Override
+        public void report(CheckLevel arg0, JSError arg1)
+        {
+        }
+
+        @Override
+        public JSError[] getWarnings()
+        {
+            return null;
+        }
+
+        @Override
+        public int getWarningCount()
+        {
+            return 0;
+        }
+
+        @Override
+        public double getTypedPercent()
+        {
+            return 0;
+        }
+
+        @Override
+        public JSError[] getErrors()
+        {
+            return null;
+        }
+
+        @Override
+        public int getErrorCount()
+        {
+            return 0;
+        }
+
+        @Override
+        public void generateReport()
+        {
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jsc/JSCJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jsc/JSCJSEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jsc/JSCJSEmitter.java
new file mode 100644
index 0000000..1a10804
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jsc/JSCJSEmitter.java
@@ -0,0 +1,39 @@
+/*
+ *
+ *  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.internal.codegen.js.jsc;
+
+import java.io.FilterWriter;
+
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+
+/**
+ * Concrete implementation of the 'FlexJS' JavaScript production.
+ * 
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class JSCJSEmitter extends JSFlexJSEmitter
+{
+
+    public JSCJSEmitter(FilterWriter out)
+    {
+        super(out);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jsc/JSCPublisher.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jsc/JSCPublisher.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jsc/JSCPublisher.java
new file mode 100644
index 0000000..1f39d50
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jsc/JSCPublisher.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.internal.codegen.js.jsc;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSPublisher;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+
+public class JSCPublisher extends MXMLFlexJSPublisher
+{
+
+    public JSCPublisher(Configuration config, FlexJSProject project)
+    {
+        super(config, project);
+    }
+
+    @Override
+    protected void writeHTML(String type, String projectName, String dirPath,
+            String deps, List<String> additionalHTML) throws IOException
+    {
+        if ("intermediate".equals(type))
+        {
+            StringBuilder depsFile = new StringBuilder();
+            depsFile.append(deps);
+            depsFile.append("goog.require(\"");
+            depsFile.append(projectName);
+            depsFile.append("\");\n");
+            writeFile(dirPath + File.separator + projectName + "-dependencies.js", depsFile.toString(), false);
+        }
+        // super.writeHTML(type, projectName, dirPath, deps, additionalHTML);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/AccessorEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/AccessorEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/AccessorEmitter.java
new file mode 100644
index 0000000..f2910d7
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/AccessorEmitter.java
@@ -0,0 +1,420 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import java.util.HashMap;
+import java.util.Set;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.common.IMetaInfo;
+import org.apache.flex.compiler.common.ModifiersSet;
+import org.apache.flex.compiler.definitions.IAccessorDefinition;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSDocEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSessionModel.PropertyNodes;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.semantics.SemanticUtils;
+import org.apache.flex.compiler.internal.tree.as.FunctionNode;
+import org.apache.flex.compiler.internal.tree.as.SetterNode;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IAccessorNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+
+public class AccessorEmitter extends JSSubEmitter implements
+        ISubEmitter<IAccessorNode>
+{
+
+    public AccessorEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IAccessorNode node)
+    {
+        if (node.getNodeID() == ASTNodeID.GetterID)
+        {
+            emitGet((IGetterNode) node);
+        }
+        else if (node.getNodeID() == ASTNodeID.SetterID)
+        {
+            emitSet((ISetterNode) node);
+        }
+    }
+
+    public void emit(IClassDefinition definition)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+
+        if (!getModel().getPropertyMap().isEmpty())
+        {
+            writeNewline();
+            writeNewline();
+            writeNewline();
+            write(JSGoogEmitterTokens.OBJECT);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSEmitterTokens.DEFINE_PROPERTIES);
+            write(ASEmitterTokens.PAREN_OPEN);
+            String qname = definition.getQualifiedName();
+            write(getEmitter().formatQualifiedName(qname));
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSEmitterTokens.PROTOTYPE);
+            write(ASEmitterTokens.COMMA);
+            write(ASEmitterTokens.SPACE);
+            write("/** @lends {" + getEmitter().formatQualifiedName(qname)
+                    + ".prototype} */ ");
+            writeNewline(ASEmitterTokens.BLOCK_OPEN);
+
+            Set<String> propertyNames = getModel().getPropertyMap().keySet();
+            boolean firstTime = true;
+            for (String propName : propertyNames)
+            {
+                if (firstTime)
+                    firstTime = false;
+                else
+                    writeNewline(ASEmitterTokens.COMMA);
+
+                boolean wroteGetter = false;
+                PropertyNodes p = getModel().getPropertyMap().get(propName);
+                writeNewline("/** @export */");
+                write(propName);
+                write(ASEmitterTokens.COLON);
+                write(ASEmitterTokens.SPACE);
+                writeNewline(ASEmitterTokens.BLOCK_OPEN);
+                if (p.getter != null)
+                {
+                    write(ASEmitterTokens.GET);
+                    write(ASEmitterTokens.COLON);
+                    write(ASEmitterTokens.SPACE);
+                    write(JSDocEmitterTokens.JSDOC_OPEN);
+                    write(ASEmitterTokens.SPACE);
+                    write(ASEmitterTokens.ATSIGN);
+                    write(ASEmitterTokens.THIS);
+                    write(ASEmitterTokens.SPACE);
+                    write(ASEmitterTokens.BLOCK_OPEN);
+                    write(getEmitter().formatQualifiedName(qname));
+                    write(ASEmitterTokens.BLOCK_CLOSE);
+                    write(ASEmitterTokens.SPACE);
+                    write(JSDocEmitterTokens.JSDOC_CLOSE);
+                    write(ASEmitterTokens.SPACE);
+                    write(ASEmitterTokens.FUNCTION);
+                    fjs.emitParameters(p.getter.getParametersContainerNode());
+
+                    fjs.emitDefinePropertyFunction(p.getter);
+                    wroteGetter = true;
+                }
+                else if (p.setter != null && p.setter.getDefinition().isOverride())
+                {
+                	// see if there is a getter on a base class.  If so, we have to 
+                	// generate a call to the super from this class because 
+                	// Object.defineProperty doesn't allow overriding just the setter.
+                	// If there is no getter defineProp'd the property will seen as
+                	// write-only.
+                	IAccessorDefinition other = (IAccessorDefinition)SemanticUtils.resolveCorrespondingAccessor(p.setter.getDefinition(), getProject());
+                	if (other != null)
+                	{
+                        write(ASEmitterTokens.GET);
+                        write(ASEmitterTokens.COLON);
+                        write(ASEmitterTokens.SPACE);
+                        write(JSDocEmitterTokens.JSDOC_OPEN);
+                        write(ASEmitterTokens.SPACE);
+                        write(ASEmitterTokens.ATSIGN);
+                        write(ASEmitterTokens.THIS);
+                        write(ASEmitterTokens.SPACE);
+                        write(ASEmitterTokens.BLOCK_OPEN);
+                        write(getEmitter().formatQualifiedName(qname));
+                        write(ASEmitterTokens.BLOCK_CLOSE);
+                        write(ASEmitterTokens.SPACE);
+                        write(JSDocEmitterTokens.JSDOC_CLOSE);
+                        write(ASEmitterTokens.SPACE);
+                        write(ASEmitterTokens.FUNCTION);
+                        write(ASEmitterTokens.PAREN_OPEN);
+                        write(ASEmitterTokens.PAREN_CLOSE);
+                        write(ASEmitterTokens.SPACE);
+                        writeNewline(ASEmitterTokens.BLOCK_OPEN);
+                        
+                        ICompilerProject project = this.getProject();
+                        if (project instanceof FlexJSProject)
+                        	((FlexJSProject)project).needLanguage = true;
+                        // setter is handled in binaryOperator
+                        write(ASEmitterTokens.RETURN);
+                        write(ASEmitterTokens.SPACE);
+                        write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+                        write(ASEmitterTokens.MEMBER_ACCESS);
+                        write(JSFlexJSEmitterTokens.SUPERGETTER);
+                        write(ASEmitterTokens.PAREN_OPEN);
+                        write(getEmitter().formatQualifiedName(qname));
+                        writeToken(ASEmitterTokens.COMMA);
+                        write(ASEmitterTokens.THIS);
+                        writeToken(ASEmitterTokens.COMMA);
+                        write(ASEmitterTokens.SINGLE_QUOTE);
+                        write(propName);
+                        write(ASEmitterTokens.SINGLE_QUOTE);
+                        write(ASEmitterTokens.PAREN_CLOSE);
+                        writeNewline(ASEmitterTokens.SEMICOLON);
+                        write(ASEmitterTokens.BLOCK_CLOSE);
+                		wroteGetter = true;
+                	}
+                }
+                if (p.setter != null)
+                {
+                    if (wroteGetter)
+                        writeNewline(ASEmitterTokens.COMMA);
+
+                    write(ASEmitterTokens.SET);
+                    write(ASEmitterTokens.COLON);
+                    write(ASEmitterTokens.SPACE);
+                    write(JSDocEmitterTokens.JSDOC_OPEN);
+                    write(ASEmitterTokens.SPACE);
+                    write(ASEmitterTokens.ATSIGN);
+                    write(ASEmitterTokens.THIS);
+                    write(ASEmitterTokens.SPACE);
+                    write(ASEmitterTokens.BLOCK_OPEN);
+                    write(getEmitter().formatQualifiedName(qname));
+                    write(ASEmitterTokens.BLOCK_CLOSE);
+                    write(ASEmitterTokens.SPACE);
+                    write(JSDocEmitterTokens.JSDOC_CLOSE);
+                    write(ASEmitterTokens.SPACE);
+                    write(ASEmitterTokens.FUNCTION);
+                    fjs.emitParameters(p.setter.getParametersContainerNode());
+
+                    fjs.emitDefinePropertyFunction(p.setter);
+                }
+                else if (p.getter != null && p.getter.getDefinition().isOverride())
+                {
+                	// see if there is a getter on a base class.  If so, we have to 
+                	// generate a call to the super from this class because 
+                	// Object.defineProperty doesn't allow overriding just the getter.
+                	// If there is no setter defineProp'd the property will seen as
+                	// read-only.
+                	IAccessorDefinition other = (IAccessorDefinition)SemanticUtils.resolveCorrespondingAccessor(p.getter.getDefinition(), getProject());
+                	if (other != null)
+                	{
+                        if (wroteGetter)
+                            writeNewline(ASEmitterTokens.COMMA);
+
+                        write(ASEmitterTokens.SET);
+                        write(ASEmitterTokens.COLON);
+                        write(ASEmitterTokens.SPACE);
+                        write(JSDocEmitterTokens.JSDOC_OPEN);
+                        write(ASEmitterTokens.SPACE);
+                        write(ASEmitterTokens.ATSIGN);
+                        write(ASEmitterTokens.THIS);
+                        write(ASEmitterTokens.SPACE);
+                        write(ASEmitterTokens.BLOCK_OPEN);
+                        write(getEmitter().formatQualifiedName(qname));
+                        write(ASEmitterTokens.BLOCK_CLOSE);
+                        write(ASEmitterTokens.SPACE);
+                        write(JSDocEmitterTokens.JSDOC_CLOSE);
+                        write(ASEmitterTokens.SPACE);
+                        write(ASEmitterTokens.FUNCTION);
+                        write(ASEmitterTokens.PAREN_OPEN);
+                        write("value");
+                        write(ASEmitterTokens.PAREN_CLOSE);
+                        write(ASEmitterTokens.SPACE);
+                        writeNewline(ASEmitterTokens.BLOCK_OPEN);
+                        
+                        ICompilerProject project = this.getProject();
+                        if (project instanceof FlexJSProject)
+                        	((FlexJSProject)project).needLanguage = true;
+                        
+                        write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+                        write(ASEmitterTokens.MEMBER_ACCESS);
+                        write(JSFlexJSEmitterTokens.SUPERSETTER);
+                        write(ASEmitterTokens.PAREN_OPEN);
+                        write(getEmitter().formatQualifiedName(qname));
+                        writeToken(ASEmitterTokens.COMMA);
+                        write(ASEmitterTokens.THIS);
+                        writeToken(ASEmitterTokens.COMMA);
+                        write(ASEmitterTokens.SINGLE_QUOTE);
+                        write(propName);
+                        write(ASEmitterTokens.SINGLE_QUOTE);
+                        writeToken(ASEmitterTokens.COMMA);
+                        write("value");
+                        write(ASEmitterTokens.PAREN_CLOSE);
+                        writeNewline(ASEmitterTokens.SEMICOLON);
+                        write(ASEmitterTokens.BLOCK_CLOSE);
+                	}
+                }
+                write(ASEmitterTokens.BLOCK_CLOSE);
+            }
+            writeNewline(ASEmitterTokens.BLOCK_CLOSE);
+            write(ASEmitterTokens.PAREN_CLOSE);
+            write(ASEmitterTokens.SEMICOLON);
+        }
+        if (!getModel().getStaticPropertyMap().isEmpty())
+        {
+            write(JSGoogEmitterTokens.OBJECT);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSEmitterTokens.DEFINE_PROPERTIES);
+            write(ASEmitterTokens.PAREN_OPEN);
+            String qname = definition.getQualifiedName();
+            write(getEmitter().formatQualifiedName(qname));
+            write(ASEmitterTokens.COMMA);
+            write(ASEmitterTokens.SPACE);
+            write("/** @lends {" + getEmitter().formatQualifiedName(qname)
+                    + "} */ ");
+            writeNewline(ASEmitterTokens.BLOCK_OPEN);
+
+            Set<String> propertyNames = getModel().getStaticPropertyMap()
+                    .keySet();
+            boolean firstTime = true;
+            for (String propName : propertyNames)
+            {
+                if (firstTime)
+                    firstTime = false;
+                else
+                    writeNewline(ASEmitterTokens.COMMA);
+
+                PropertyNodes p = getModel().getStaticPropertyMap().get(
+                        propName);
+                writeNewline("/** @export */");
+                write(propName);
+                write(ASEmitterTokens.COLON);
+                write(ASEmitterTokens.SPACE);
+                writeNewline(ASEmitterTokens.BLOCK_OPEN);
+                if (p.getter != null)
+                {
+                    write(ASEmitterTokens.GET);
+                    write(ASEmitterTokens.COLON);
+                    write(ASEmitterTokens.SPACE);
+                    write(ASEmitterTokens.FUNCTION);
+                    fjs.emitParameters(p.getter.getParametersContainerNode());
+
+                    fjs.emitDefinePropertyFunction(p.getter);
+                }
+                if (p.setter != null)
+                {
+                    if (p.getter != null)
+                        writeNewline(ASEmitterTokens.COMMA);
+
+                    write(ASEmitterTokens.SET);
+                    write(ASEmitterTokens.COLON);
+                    write(ASEmitterTokens.SPACE);
+                    write(ASEmitterTokens.FUNCTION);
+                    fjs.emitParameters(p.setter.getParametersContainerNode());
+
+                    fjs.emitDefinePropertyFunction(p.setter);
+                }
+                write(ASEmitterTokens.BLOCK_CLOSE);
+            }
+            writeNewline(ASEmitterTokens.BLOCK_CLOSE);
+            write(ASEmitterTokens.PAREN_CLOSE);
+            write(ASEmitterTokens.SEMICOLON);
+        }
+    }
+
+    public void emitGet(IGetterNode node)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+
+        ModifiersSet modifierSet = node.getDefinition().getModifiers();
+        boolean isStatic = (modifierSet != null && modifierSet
+                .hasModifier(ASModifier.STATIC));
+        HashMap<String, PropertyNodes> map = isStatic ? getModel()
+                .getStaticPropertyMap() : getModel().getPropertyMap();
+        String name = node.getName();
+        PropertyNodes p = map.get(name);
+        if (p == null)
+        {
+            p = new PropertyNodes();
+            map.put(name, p);
+        }
+        p.getter = node;
+        FunctionNode fn = (FunctionNode) node;
+        fn.parseFunctionBody(fjs.getProblems());
+    }
+
+    public void emitSet(ISetterNode node)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+        JSFlexJSDocEmitter doc = (JSFlexJSDocEmitter) fjs.getDocEmitter();
+
+        ModifiersSet modifierSet = node.getDefinition().getModifiers();
+        boolean isStatic = (modifierSet != null && modifierSet
+                .hasModifier(ASModifier.STATIC));
+        HashMap<String, PropertyNodes> map = isStatic ? getModel()
+                .getStaticPropertyMap() : getModel().getPropertyMap();
+        String name = node.getName();
+        PropertyNodes p = map.get(name);
+        if (p == null)
+        {
+            p = new PropertyNodes();
+            map.put(name, p);
+        }
+        p.setter = node;
+        FunctionNode fn = (FunctionNode) node;
+        fn.parseFunctionBody(fjs.getProblems());
+
+        boolean isBindableSetter = false;
+        if (node instanceof SetterNode)
+        {
+            IMetaInfo[] metaInfos = null;
+            metaInfos = node.getMetaInfos();
+            for (IMetaInfo metaInfo : metaInfos)
+            {
+                name = metaInfo.getTagName();
+                if (name.equals("Bindable")
+                        && metaInfo.getAllAttributes().length == 0)
+                {
+                    isBindableSetter = true;
+                    break;
+                }
+            }
+        }
+        if (isBindableSetter)
+        {
+            IFunctionDefinition definition = node.getDefinition();
+            ITypeDefinition type = (ITypeDefinition) definition.getParent();
+            doc.emitMethodDoc(fn, getProject());
+            write(fjs.formatQualifiedName(type.getQualifiedName()));
+            if (!node.hasModifier(ASModifier.STATIC))
+            {
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                write(JSEmitterTokens.PROTOTYPE);
+            }
+
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write("__bindingWrappedSetter__");
+            writeToken(node.getName());
+            writeToken(ASEmitterTokens.EQUAL);
+            write(ASEmitterTokens.FUNCTION);
+            fjs.emitParameters(node.getParametersContainerNode());
+            //writeNewline();
+            fjs.emitMethodScope(node.getScopedNode());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/AsIsEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/AsIsEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/AsIsEmitter.java
new file mode 100644
index 0000000..ee8a5e6
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/AsIsEmitter.java
@@ -0,0 +1,197 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.asdoc.flexjs.ASDocComment;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+
+public class AsIsEmitter extends JSSubEmitter
+{
+
+    public AsIsEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    public void emitIsAs(IExpressionNode node, IExpressionNode left, IExpressionNode right,
+                         ASTNodeID id, boolean coercion)
+    {
+        // project is null in unit tests
+        //IDefinition dnode = project != null ? (right).resolve(project) : null;
+        IDefinition dnode = getProject() != null ? (right)
+                .resolve(getProject()) : null;
+        if (id != ASTNodeID.Op_IsID && dnode != null)
+        {
+            boolean emit = coercion ? 
+            		!((FlexJSProject)getProject()).config.getJSOutputOptimizations().contains(JSFlexJSEmitterTokens.SKIP_FUNCTION_COERCIONS.getToken()) :
+                	!((FlexJSProject)getProject()).config.getJSOutputOptimizations().contains(JSFlexJSEmitterTokens.SKIP_AS_COERCIONS.getToken());
+            			
+            // find the function node
+            IFunctionNode functionNode = (IFunctionNode) left
+                    .getAncestorOfType(IFunctionNode.class);
+            if (functionNode != null) // can be null in synthesized binding code
+            {
+                if (coercion)
+                {
+                	// see if the cast is inside a try/catch in this function. If so,
+                	// assume that we want an exception.
+                	IASNode child = left.getParent();
+                	while (child != functionNode)
+                	{
+                		if (child.getNodeID() == ASTNodeID.TryID)
+                		{
+                			emit = true;
+                			break;
+                		}
+                		child = child.getParent();
+                	}
+                }
+                ASDocComment asDoc = (ASDocComment) functionNode
+                        .getASDocComment();
+                if (asDoc != null)
+                {
+                    String asDocString = asDoc.commentNoEnd();
+                    String coercionToken = JSFlexJSEmitterTokens.EMIT_COERCION
+                            .getToken();
+                    int emitIndex = asDocString.indexOf(coercionToken);
+                    while (emitIndex != -1)
+                    {
+                        String emitable = asDocString.substring(emitIndex
+                                + coercionToken.length());
+                        int endIndex = emitable.indexOf("\n");
+                        emitable = emitable.substring(0, endIndex);
+                        emitable = emitable.trim();
+                        String rightSide = dnode.getQualifiedName();
+                        if (emitable.equals(rightSide))
+                        {
+                            emit = true;
+                            break;
+                        }
+                        emitIndex = asDocString.indexOf(coercionToken,
+                        		emitIndex + coercionToken.length());
+                    }
+                    String ignoreToken = JSFlexJSEmitterTokens.IGNORE_COERCION
+                    .getToken();
+		            int ignoreIndex = asDocString.indexOf(ignoreToken);
+		            while (ignoreIndex != -1)
+		            {
+		                String ignorable = asDocString.substring(ignoreIndex
+		                        + ignoreToken.length());
+		                int endIndex = ignorable.indexOf("\n");
+		                ignorable = ignorable.substring(0, endIndex);
+		                ignorable = ignorable.trim();
+		                String rightSide = dnode.getQualifiedName();
+		                if (ignorable.equals(rightSide))
+		                {
+		                    emit = false;
+		                    break;
+		                }
+		                ignoreIndex = asDocString.indexOf(ignoreToken,
+		                		ignoreIndex + ignoreToken.length());
+		            }
+                }
+            }
+            if (!emit)
+            {
+                getWalker().walk(left);
+                return;
+            }
+        }
+
+        ICompilerProject project = this.getProject();
+        if (project instanceof FlexJSProject)
+        	((FlexJSProject)project).needLanguage = true;
+        
+        if (node instanceof IBinaryOperatorNode)
+        {
+            IBinaryOperatorNode binaryOperatorNode = (IBinaryOperatorNode) node; 
+            startMapping(node, binaryOperatorNode.getLeftOperandNode());
+        }
+        else
+        {
+            startMapping(node);
+        }
+        write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+        write(ASEmitterTokens.MEMBER_ACCESS);
+
+        if (id == ASTNodeID.Op_IsID)
+            write(ASEmitterTokens.IS);
+        else
+            write(ASEmitterTokens.AS);
+
+        write(ASEmitterTokens.PAREN_OPEN);
+        endMapping(node);
+        
+        getWalker().walk(left);
+        if (node instanceof IBinaryOperatorNode)
+        {
+            IBinaryOperatorNode binaryOperatorNode = (IBinaryOperatorNode) node;
+            startMapping(node, binaryOperatorNode.getLeftOperandNode());
+        }
+        else
+        {
+            startMapping(node);
+        }
+        writeToken(ASEmitterTokens.COMMA);
+        endMapping(node);
+
+        if (dnode instanceof IClassDefinition)
+        {
+            startMapping(right);
+            write(getEmitter().formatQualifiedName(dnode.getQualifiedName()));
+            endMapping(right);
+        }
+        else
+        {
+            getWalker().walk(right);
+        }
+
+        if (node instanceof IBinaryOperatorNode)
+        {
+            IBinaryOperatorNode binaryOperatorNode = (IBinaryOperatorNode) node;
+            startMapping(node, binaryOperatorNode.getLeftOperandNode());
+        }
+        else
+        {
+            startMapping(node);
+        }
+        if (coercion)
+        {
+            writeToken(ASEmitterTokens.COMMA);
+            write(ASEmitterTokens.TRUE);
+        }
+
+        write(ASEmitterTokens.PAREN_CLOSE);
+        endMapping(node);
+    }
+
+}


[20/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSStatements.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSStatements.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSStatements.java
new file mode 100644
index 0000000..2d59b6a
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSStatements.java
@@ -0,0 +1,549 @@
+/*
+ *
+ *  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.internal.codegen.js.vf2js;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogStatements;
+import org.apache.flex.compiler.internal.driver.js.vf2js.VF2JSBackend;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IIfNode;
+import org.apache.flex.compiler.tree.as.ISwitchNode;
+import org.apache.flex.compiler.tree.as.ITryNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.tree.as.IWhileLoopNode;
+import org.apache.flex.compiler.tree.as.IWithNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestVF2JSStatements extends TestGoogStatements
+{
+    @Override
+    public void setUp()
+    {
+    	project = new FlexJSProject(workspace);
+        super.setUp();
+    }
+    
+    @Test
+    public void testVarDeclaration_withReservedWord()
+    {
+        IVariableNode node = (IVariableNode) getNode("var max:int = int.MAX_VALUE;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ max = INT.MAX_VALUE");
+    }
+    
+    @Test
+    public void testVarDeclaration_withTypeAssignedStringWithNewLine()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a:String = \"\\n\"",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {string} */ a = \"\\n\"");
+    }
+
+    @Test
+    public void testVarDeclaration_withXMLList()
+    {
+    	IVariableNode node = (IVariableNode) getNode(
+    			"var childDesc:XMLList = typeDescription.accessor."
+    			+ "(@name == childName) + typeDescription.method."
+    			+ "(@name == childName);",
+    			IVariableNode.class);
+    	asBlockWalker.visitVariable(node);
+    	assertOut("var /** @type {XMLList} */ childDesc = 'E4XFilter' + 'E4XFilter'");
+    }
+
+    @Test
+    public void testVarDeclaration_withEmbed()
+    {
+    	IVariableNode node = (IVariableNode) getNode(
+    			"[Embed(source=\"LuminosityMaskFilter.pbj\", mimeType=\"application/octet-stream\")]\nprivate static var ShaderClass:Class;",
+    			IVariableNode.class);
+    	asBlockWalker.visitVariable(node);
+    	assertOut("var /** @type {Object} */ falconTest_a.ShaderClass");
+    }
+
+    //----------------------------------
+    // const declaration
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testConstDeclaration()
+    {
+        IVariableNode node = (IVariableNode) getNode("const a = 42;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {*} */ a = 42");
+        // ToDo (erikdebruin): assertOut("const /** @type {*} */ a = 42");
+    }
+
+    @Override
+    @Test
+    public void testConstDeclaration_withType()
+    {
+        IVariableNode node = (IVariableNode) getNode("const a:int = 42;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = 42");
+        // ToDo (erikdebruin): assertOut("const /** @type {number} */ a = 42");
+    }
+
+    @Override
+    @Test
+    public void testConstDeclaration_withList()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "const a:int = 4, b:int = 11, c:int = 42;", IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = 4, /** @type {number} */ b = 11, /** @type {number} */ c = 42");
+        // ToDo (erikdebruin): assertOut("const /** @type {number} */ a = 4, /** @type {number} */ b = 11, /** @type {number} */ c = 42");
+    }
+    
+    //----------------------------------
+    // for () { }
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitFor_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int = 0; i < len; i++) { break; }",
+                IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {number} */ i = 0; i < len; i++) {\n  break;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitFor_1b()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int = 0; i < len; i++) break;", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {number} */ i = 0; i < len; i++)\n  break;");
+    }
+    
+    @Test
+    public void testVisitFor_1c()
+    {
+    	IForLoopNode node = (IForLoopNode) getNode(
+    			"for (var i:int = 0, j:int = 3; i < j; i++) break;", IForLoopNode.class);
+    	asBlockWalker.visitForLoop(node);
+    	assertOut("for (var /** @type {number} */ i = 0, /** @type {number} */ j = 3; i < j; i++)\n  break;");
+    }
+
+    @Override
+    @Test
+    public void testVisitForIn_1()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int in obj) { break; }", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {number} */ i in obj) {\n  break;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitForIn_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int in obj)  break; ", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {number} */ i in obj)\n  break;");
+    }
+
+    @Override
+    @Test
+    public void testVisitForEach_1()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for each(var i:int in obj) { break; }", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var foreachiter0 in obj) \n{\nvar i = obj[foreachiter0];\n{\n  break;\n}}\n");
+    }
+
+    @Override
+    @Test
+    public void testVisitForEach_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for each(var i:int in obj)  break; ", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var foreachiter0 in obj) \n{\nvar i = obj[foreachiter0];\n\n  break;}\n");
+    }
+
+    @Test
+    public void testVisitForEach_HoistedVar()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "var i:int; for each(i in obj)  break; ", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var foreachiter0 in obj) \n{\ni = obj[foreachiter0];\n\n  break;}\n");
+    }
+
+    //----------------------------------
+    // try {} catch () {} finally {}
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitTry_Catch()
+    {
+        ITryNode node = (ITryNode) getNode("try { a; } catch (e:Error) { b; }",
+                ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n  a;\n} catch (e) {\n  b;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitTry_Catch_Finally()
+    {
+        ITryNode node = (ITryNode) getNode(
+                "try { a; } catch (e:Error) { b; } finally { c; }",
+                ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n  a;\n} catch (e) {\n  b;\n} finally {\n  c;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitTry_Catch_Catch_Finally()
+    {
+        // TODO (erikdebruin) handle multiple 'catch' statements (FW in Wiki)
+        ITryNode node = (ITryNode) getNode(
+                "try { a; } catch (e:Error) { b; } catch (f:Error) { c; } finally { d; }",
+                ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n  a;\n} catch (e) {\n  b;\n} catch (f) {\n  c;\n} finally {\n  d;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitTry_CatchEmpty_FinallyEmpty_()
+    {
+        ITryNode node = (ITryNode) getNode(
+                "try { a; } catch (e:Error) {  } finally {  }", ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n  a;\n} catch (e) {\n} finally {\n}");
+    }
+
+    //----------------------------------
+    // switch {}
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitSwitch_1()
+    {
+        ISwitchNode node = (ISwitchNode) getNode("switch(i){case 1: break;}",
+                ISwitchNode.class);
+        asBlockWalker.visitSwitch(node);
+        assertOut("switch (i) {\n  case 1:\n    break;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitSwitch_1a()
+    {
+        ISwitchNode node = (ISwitchNode) getNode(
+                "switch(i){case 1: { break; }}", ISwitchNode.class);
+        asBlockWalker.visitSwitch(node);
+        // (erikdebruin) the code is valid without the extra braces, 
+        //               i.e. we're good, we "don't care"
+        assertOut("switch (i) {\n  case 1:\n    break;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitSwitch_2()
+    {
+        ISwitchNode node = (ISwitchNode) getNode(
+                "switch(i){case 1: break; default: return;}", ISwitchNode.class);
+        asBlockWalker.visitSwitch(node);
+        assertOut("switch (i) {\n  case 1:\n    break;\n  default:\n    return;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitSwitch_3()
+    {
+        ISwitchNode node = (ISwitchNode) getNode(
+                "switch(i){case 1: { var x:int = 42; break; }; case 2: { var y:int = 66; break; }}", ISwitchNode.class);
+        asBlockWalker.visitSwitch(node);
+        assertOut("switch (i) {\n  case 1:\n    var /** @type {number} */ x = 42;\n    break;\n  case 2:\n    var /** @type {number} */ y = 66;\n    break;\n}");
+    }
+
+    @Test
+    public void testVisitSwitch_EscapedQuotes()
+    {
+    	ISwitchNode node = (ISwitchNode) getNode(
+    			"switch (type) { case \"string\": { return \"\\\"\" + value.toString() + \"\\\"\"; } }", ISwitchNode.class);
+    	asBlockWalker.visitSwitch(node);
+    	assertOut("switch (type) {\n  case \"string\":\n    return \"\\\"\" + value.toString() + \"\\\"\";\n}");
+    }
+    
+    //----------------------------------
+    // if ()
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitIf_1()
+    {
+        IIfNode node = (IIfNode) getNode("if (a) b++;", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a)\n  b++;");
+    }
+
+    @Override
+    @Test
+    public void testVisitIf_2()
+    {
+        IIfNode node = (IIfNode) getNode("if (a) b++; else c++;", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a)\n  b++;\nelse\n  c++;");
+    }
+
+    @Override
+    @Test
+    public void testVisitIf_4()
+    {
+        IIfNode node = (IIfNode) getNode(
+                "if (a) b++; else if (c) d++; else if(e) --f;", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a)\n  b++;\nelse if (c)\n  d++;\nelse if (e)\n  --f;");
+    }
+
+    @Test
+    public void testVisitIf_E4X()
+    {
+        IIfNode node = (IIfNode) getNode(
+                "if (numChildren == 0) { if (!typeDescription.@dynamic) { trace(\"warning: no describeType entry for '\" + childName + \"' on non-dynamic type '\" + typeDescription.@name + \"'\"); } }", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (numChildren == 0) {\n  if (!this.typeDescription['E4XOperator']) {\n    org.apache.flex.utils.Language.trace(\"warning: no describeType entry for '\" + childName + \"' on non-dynamic type '\" + this.typeDescription['E4XOperator'] + \"'\");\n  }\n}");
+    }
+    
+    @Test
+    public void testVisitIf_E4X_Again()
+    {
+    	IIfNode node = (IIfNode) getNode(
+    			"if (options.includeReadOnly) { properties = classInfo..accessor.(@access != \"writeonly\") + classInfo..variable; }", IIfNode.class);
+    	asBlockWalker.visitIf(node);
+    	assertOut("if (options.includeReadOnly) {\n  properties = 'E4XFilter' + this.classInfo['E4XSelector'];\n}");
+    }
+    
+    @Test
+    public void testVisitIf_UnescapedBackSlash()
+    {
+    	IIfNode node = (IIfNode) getNode(
+    			"if (rootURL && !(url.indexOf(\":\") > -1 || url.indexOf(\"/\") == 0 || url.indexOf(\"\\\\\") == 0)) { var index:int; }", IIfNode.class);
+    	asBlockWalker.visitIf(node);
+    	assertOut("if (rootURL && !(url.indexOf(\":\") > -1 || url.indexOf(\"/\") == 0 || url.indexOf(\"\\\\\") == 0)) {\n  var /** @type {number} */ index;\n}");
+    }
+
+    //----------------------------------
+    // if () { }
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitIf_1a()
+    {
+        IIfNode node = (IIfNode) getNode("if (a) { b++; }", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a) {\n  b++;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitIf_1b()
+    {
+        IIfNode node = (IIfNode) getNode("if (a) { b++; } else { c++; }",
+                IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a) {\n  b++;\n} else {\n  c++;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitIf_1c()
+    {
+        IIfNode node = (IIfNode) getNode(
+                "if (a) { b++; } else if (b) { c++; } else { d++; }",
+                IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a) {\n  b++;\n} else if (b) {\n  c++;\n} else {\n  d++;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitIf_3()
+    {
+        IIfNode node = (IIfNode) getNode(
+                "if (a) b++; else if (c) d++; else --e;", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a)\n  b++;\nelse if (c)\n  d++;\nelse\n  --e;");
+    }
+
+    //----------------------------------
+    // label : for () {}
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitFor_2()
+    {
+        IForLoopNode node = (IForLoopNode) getNode("for (;;) { break; }",
+                IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (;;) {\n  break;\n}");
+    }
+    
+    //----------------------------------
+    // while () { }
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitWhileLoop_1()
+    {
+        IWhileLoopNode node = (IWhileLoopNode) getNode(
+                "while(a > b){a++;--b;}", IWhileLoopNode.class);
+        asBlockWalker.visitWhileLoop(node);
+        assertOut("while (a > b) {\n  a++;\n  --b;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitWhileLoop_1a()
+    {
+        IWhileLoopNode node = (IWhileLoopNode) getNode("while(a > b) a++;",
+                IWhileLoopNode.class);
+        asBlockWalker.visitWhileLoop(node);
+        assertOut("while (a > b)\n  a++;");
+    }
+
+    //----------------------------------
+    // do {} while ()
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitWhileLoop_Do_1()
+    {
+        IWhileLoopNode node = (IWhileLoopNode) getNode(
+                "do {a++;--b;} while(a > b);", IWhileLoopNode.class);
+        asBlockWalker.visitWhileLoop(node);
+        assertOut("do {\n  a++;\n  --b;\n} while (a > b);");
+    }
+
+    @Override
+    @Test
+    public void testVisitWhileLoop_Do_1a()
+    {
+        IWhileLoopNode node = (IWhileLoopNode) getNode("do a++; while(a > b);",
+                IWhileLoopNode.class);
+        asBlockWalker.visitWhileLoop(node);
+        assertOut("do\n  a++;\nwhile (a > b);");
+    }
+
+    //----------------------------------
+    // label : for () {}
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitLabel_1()
+    {
+        LabeledStatementNode node = (LabeledStatementNode) getNode(
+                "foo: for each(var i:int in obj) { break foo; }",
+                LabeledStatementNode.class);
+        asBlockWalker.visitLabeledStatement(node);
+        assertOut("foo : for (var foreachiter0 in obj) \n{\nvar i = obj[foreachiter0];\n{\n  break foo;\n}}\n");
+    }
+
+    @Override
+    @Test
+    public void testVisitLabel_1a()
+    {
+        // TODO (mschmalle) LabelStatement messes up in finally{} block, something is wrong there
+        LabeledStatementNode node = (LabeledStatementNode) getNode(
+                "foo: for each(var i:int in obj) break foo;",
+                LabeledStatementNode.class);
+        asBlockWalker.visitLabeledStatement(node);
+        assertOut("foo : for (var foreachiter0 in obj) \n{\nvar i = obj[foreachiter0];\n\n  break foo;}\n");
+    }
+
+    //----------------------------------
+    // with () {}
+    //----------------------------------
+
+    @Test
+    public void testVisitWith()
+    {
+        IWithNode node = (IWithNode) getNode("with (a) { b; }", IWithNode.class);
+        asBlockWalker.visitWith(node);
+        assertOut("with (a) {\n  b;\n}");
+    }
+
+    @Test
+    public void testVisitWith_1a()
+    {
+        IWithNode node = (IWithNode) getNode("with (a) b;", IWithNode.class);
+        asBlockWalker.visitWith(node);
+        assertOut("with (a)\n  b;");
+    }
+
+    @Override
+    @Test
+    public void testVisit()
+    {
+        IFileNode node = (IFileNode) getNode(
+                "try { a; } catch (e:Error) { if (a) { if (b) { if (c) b; else if (f) a; else e; }} } finally {  }"
+                        + "if (d) for (var i:int = 0; i < len; i++) break;"
+                        + "if (a) { with (ab) { c(); } "
+                        + "do {a++;do a++; while(a > b);} while(c > d); }"
+                        + "if (b) { try { a; throw new Error('foo'); } catch (e:Error) { "
+                        + " switch(i){case 1: break; default: return;}"
+                        + " } finally { "
+                        + "  d;  var a:Object = function(foo:int, bar:String = 'goo'):int{return -1;};"
+                        + "  eee.dd; eee.dd; eee.dd; eee.dd;} }"
+                        + "foo: for each(var i:int in obj) break foo;",
+                IFileNode.class);
+        asBlockWalker.visitFile(node);
+        assertOutWithMetadata("/**\n * FalconTest_A\n *\n * @fileoverview\n *\n * @suppress {checkTypes}\n */\n\ngoog.provide('FalconTest_A');\n\n\n\n/**\n * @constructor\n */\nFalconTest_A = function() {};\n\n\nFalconTest_A.prototype.falconTest_a = function() {\n  try {\n    a;\n  } catch (e) {\n    if (a) {\n      if (b) {\n        if (c)\n          b;\n        else if (f)\n          a;\n        else\n          e;\n      }\n    }\n  } finally {\n  }\n  if (d)\n    for (var /** @type {number} */ i = 0; i < len; i++)\n      break;\n  if (a) {\n    with (ab) {\n      c();\n    }\n    do {\n      a++;\n      do\n        a++;\n      while (a > b);\n    } while (c > d);\n  }\n  if (b) {\n    try {\n      a;\n      throw new Error('foo');\n    } catch (e) {\n      switch (i) {\n        case 1:\n          break;\n        default:\n          return;\n      }\n    } finally {\n      d;\n      var /** @type {Object} */ a = function(foo, bar) {\n        bar = typeof bar !== 'undefined' ? bar 
 : 'goo';\n        return -1;\n      };\n      eee.dd;\n      eee.dd;\n      eee.dd;\n      eee.dd;\n    }\n  }\n  foo : for (var foreachiter0 in obj) \n  {\n  var i = obj[foreachiter0];\n  \n    break foo;}\n  ;\n};\n\n\n/**\n * Metadata\n *\n * @type {Object.<string, Array.<Object>>}\n */\nFalconTest_A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'FalconTest_A', qName: 'FalconTest_A'}] };\n");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new VF2JSBackend();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLApplication.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLApplication.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLApplication.java
new file mode 100644
index 0000000..fbfe6b8
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLApplication.java
@@ -0,0 +1,109 @@
+/*
+ *
+ *  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.internal.codegen.mxml;
+
+import org.apache.flex.compiler.internal.test.MXMLTestBase;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.junit.Test;
+
+public class TestMXMLApplication extends MXMLTestBase
+{
+
+    @Test
+    public void testBasicApp()
+    {
+        String code = ""
+                + "<s:Application xmlns:s=\"library://ns.adobe.com/flex/spark\">"
+                + "</s:Application>";
+
+        IMXMLFileNode node = compileMXML(code);
+
+        mxmlBlockWalker.visitFile(node);
+
+        assertOut("<Application>\n\t\n</Application>");
+    }
+
+    @Test
+    public void testBasicAppWithOneComponent()
+    {
+        String code = ""
+                + "<s:Application xmlns:s=\"library://ns.adobe.com/flex/spark\">"
+                + "    <s:Button id=\"myBtn\" label=\"Hello world\"></s:Button>"
+                + "</s:Application>";
+
+        IMXMLFileNode node = compileMXML(code);
+
+        mxmlBlockWalker.visitFile(node);
+
+        assertOut("<Application>\n\t<Button id=\"myBtn\" label=\"Hello world\"></Button>\n</Application>");
+    }
+
+    @Test
+    public void testBasicAppWithTwoComponents()
+    {
+        String code = ""
+                + "<s:Application xmlns:s=\"library://ns.adobe.com/flex/spark\">"
+                + "    <s:Label id=\"myLbl\" text=\"Bye bye\"></s:Label>"
+                + "    <s:Button id=\"myBtn\" label=\"Hello world\"></s:Button>"
+                + "</s:Application>";
+
+        IMXMLFileNode node = compileMXML(code);
+
+        mxmlBlockWalker.visitFile(node);
+
+        assertOut("<Application>\n\t<Label id=\"myLbl\" text=\"Bye bye\"></Label>\n\t<Button id=\"myBtn\" label=\"Hello world\"></Button>\n</Application>");
+    }
+
+    @Test
+    public void testBasicAppWithSimpleScript()
+    {
+        String code = ""
+                + "<s:Application xmlns:fx=\"http://ns.adobe.com/mxml/2009\" xmlns:s=\"library://ns.adobe.com/flex/spark\">"
+                + "    <fx:Script><![CDATA["
+                + "        private const GREETING:String = \"Hello world!\""
+                + "    ]]></fx:Script>" + "</s:Application>";
+
+        IMXMLFileNode node = compileMXML(code);
+
+        mxmlBlockWalker.visitFile(node);
+
+        assertOut("<Application>\n\t<script><![CDATA[\n\t\tprivate var GREETING:String = \"Hello world!\";\n\t]]></script>\n</Application>");
+    }
+
+    @Test
+    public void testDefaultApp()
+    {
+        String code = ""
+                + "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
+                + "<s:Application xmlns:fx=\"http://ns.adobe.com/mxml/2009\""
+                + "               xmlns:s=\"library://ns.adobe.com/flex/spark\" "
+                + "               xmlns:mx=\"library://ns.adobe.com/flex/mx\" "
+                + "               minWidth=\"955\" minHeight=\"600\">"
+                + "    <fx:Declarations>"
+                + "        <!-- Place non-visual elements (e.g., services, value objects) here -->"
+                + "    </fx:Declarations>" + "</s:Application>";
+
+        IMXMLFileNode node = compileMXML(code);
+
+        mxmlBlockWalker.visitFile(node);
+
+        assertOut("<Application minWidth=\"955\" minHeight=\"600\">\n\t\n</Application>");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLAttributes.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLAttributes.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLAttributes.java
new file mode 100644
index 0000000..5292df3
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLAttributes.java
@@ -0,0 +1,118 @@
+/*
+ *
+ *  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.internal.codegen.mxml;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import org.apache.flex.compiler.internal.test.MXMLTestBase;
+import org.apache.flex.compiler.tree.mxml.IMXMLInstanceNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
+import org.junit.Test;
+
+public class TestMXMLAttributes extends MXMLTestBase
+{
+
+    @Test
+    public void testIdAttribute()
+    {
+        // (erikdebruin) id attributes are a special case...
+        
+        String code = "id=\"myBtn\"";
+
+        IMXMLInstanceNode node = (IMXMLInstanceNode) getNode(
+                code, IMXMLInstanceNode.class,
+                MXMLTestBase.WRAP_LEVEL_NODE);
+        
+        mxmlBlockWalker.visitInstance(node);
+
+        assertThat(((IMXMLInstanceNode) node.getChild(0)).getID(), is("myBtn"));
+    }
+
+    @Test
+    public void testSimpleBooleanAttribute()
+    {
+        String code = "visible=\"false\"";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_NODE);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("visible=\"false\"");
+    }
+
+    @Test
+    public void testSimpleIntAttribute()
+    {
+        String code = "x=\"100\"";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_NODE);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("x=\"100\"");
+    }
+
+    @Test
+    public void testSimpleNumberAttribute()
+    {
+        String code = "width=\"1.5\"";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_NODE);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("width=\"1.5\"");
+    }
+
+    @Test
+    public void testSimpleStringAttribute()
+    {
+        String code = "label=\"Click me ;-)\"";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_NODE);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("label=\"Click me ;-)\"");
+    }
+
+    @Test
+    public void testSimpleUintAttribute()
+    {
+        String code = "color=\"0xFF0000\"";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_NODE);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("color=\"16711680\"");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLNodes.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLNodes.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLNodes.java
new file mode 100644
index 0000000..ba39c2b
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLNodes.java
@@ -0,0 +1,187 @@
+/*
+ *
+ *  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.internal.codegen.mxml;
+
+import org.apache.flex.compiler.internal.test.MXMLTestBase;
+import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
+import org.junit.Test;
+
+public class TestMXMLNodes extends MXMLTestBase
+{
+
+    @Test
+    public void testSimpleNode()
+    {
+        String code = "<s:Button />";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("<Button></Button>");
+    }
+
+    @Test
+    public void testSimpleNodeWithId()
+    {
+        String code = "<s:Button id=\"myBtn\"/>";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("<Button id=\"myBtn\"></Button>");
+    }
+
+    @Test
+    public void testSimpleNodeWithAttribute()
+    {
+        String code = "<s:Button label=\"Click me\" />";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("<Button label=\"Click me\"></Button>");
+    }
+
+    @Test
+    public void testSimpleNodeWithInnerText()
+    {
+        String code = "<s:Button>Click me</s:Button>";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("<Button label=\"Click me\"></Button>");
+    }
+
+    @Test
+    public void testAnotherSimpleNodeWithInnerText()
+    {
+        String code = "<s:Label>Hello World!</s:Label>";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("<Label text=\"Hello World!\"></Label>");
+    }
+
+    @Test
+    public void testSimpleNodeWithMultipleAttributes()
+    {
+        String code = "<s:Button visible=\"false\" x=\"100\" width=\"1.5\" label=\"Click me ;-)\" color=\"0xFF0000\"/>";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("<Button visible=\"false\" x=\"100\" width=\"1.5\" label=\"Click me ;-)\" color=\"16711680\"></Button>");
+    }
+
+    @Test
+    public void testNodeWithChild()
+    {
+        String code = "<s:Group><s:RadioButton /></s:Group>";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("<Group><RadioButton></RadioButton></Group>");
+    }
+
+    @Test
+    public void testNodeWithChildAndAttribute()
+    {
+        String code = "<s:Group id=\"myGrp\"><s:RadioButton /></s:Group>";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("<Group id=\"myGrp\"><RadioButton></RadioButton></Group>");
+    }
+
+    @Test
+    public void testNodeWithNestedChildren()
+    {
+        String code = "<s:Group><s:Group><s:Group>" + "<s:RadioButton />"
+                + "</s:Group></s:Group></s:Group>";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("<Group><Group><Group><RadioButton></RadioButton></Group></Group></Group>");
+    }
+
+    @Test
+    public void testNodeWithNestedChildrenAndAttribute()
+    {
+        String code = "<s:Group><s:Group><s:Group>"
+                + "<s:RadioButton id=\"myRB\"/>"
+                + "</s:Group></s:Group></s:Group>";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("<Group><Group><Group><RadioButton id=\"myRB\"></RadioButton></Group></Group></Group>");
+    }
+
+    @Test
+    public void testNodeWithNestedChildrenAndInnerText()
+    {
+        String code = "<s:Group><s:Group><s:Group>"
+                + "<s:Button>Click me</s:Button>"
+                + "</s:Group></s:Group></s:Group>";
+
+        IMXMLPropertySpecifierNode node = (IMXMLPropertySpecifierNode) getNode(
+                code, IMXMLPropertySpecifierNode.class,
+                MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitPropertySpecifier(node);
+
+        assertOut("<Group><Group><Group><Button label=\"Click me\"></Button></Group></Group></Group>");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLScript.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLScript.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLScript.java
new file mode 100644
index 0000000..912ff45
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/TestMXMLScript.java
@@ -0,0 +1,106 @@
+/*
+ *
+ *  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.internal.codegen.mxml;
+
+import org.apache.flex.compiler.internal.test.MXMLTestBase;
+import org.apache.flex.compiler.tree.mxml.IMXMLScriptNode;
+import org.junit.Test;
+
+public class TestMXMLScript extends MXMLTestBase
+{
+
+    @Test
+    public void testEmptyScript()
+    {
+        String code = "" + "<fx:Script><![CDATA[]]></fx:Script>";
+
+        IMXMLScriptNode node = (IMXMLScriptNode) getNode(code,
+                IMXMLScriptNode.class, MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitScript(node);
+
+        assertOut("<script><![CDATA[]]></script>");
+    }
+
+    @Test
+    public void testSimpleScript()
+    {
+        String code = "" + "<fx:Script><![CDATA["
+                + "    private var GREETING:String = \"Hello world!\";"
+                + "]]></fx:Script>";
+
+        IMXMLScriptNode node = (IMXMLScriptNode) getNode(code,
+                IMXMLScriptNode.class, MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitScript(node);
+
+        assertOut("<script><![CDATA[\n\tprivate var GREETING:String = \"Hello world!\";\n]]></script>");
+    }
+
+    @Test
+    public void testMultiLineScript()
+    {
+        String code = "" + "<fx:Script><![CDATA["
+                + "    public var goodbye:String = \"Bye bye :-(\";"
+                + "    private const GREETING:String = \"Hello world!\";"
+                + "]]></fx:Script>";
+
+        IMXMLScriptNode node = (IMXMLScriptNode) getNode(code,
+                IMXMLScriptNode.class, MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitScript(node);
+
+        assertOut("<script><![CDATA[\n\tpublic var goodbye:String = \"Bye bye :-(\";\n\tprivate var GREETING:String = \"Hello world!\";\n]]></script>");
+    }
+
+    @Test
+    public void testComplexScript()
+    {
+        // TODO (erikdebruin) fix indentation...
+        String code = "" + "<fx:Script><![CDATA[" + "    var n:int = 3;"
+                + "    for (var i:int = 0; i < n; i++)" + "    {"
+                + "        Alert.show(\"Hi\");" + "    }" + "]]></fx:Script>";
+
+        IMXMLScriptNode node = (IMXMLScriptNode) getNode(code,
+                IMXMLScriptNode.class, MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+
+        mxmlBlockWalker.visitScript(node);
+
+        assertOut("<script><![CDATA[\n\tvar n:int = 3;\n\tfor (var i:int = 0; i < n; i++) {\n\tAlert.show(\"Hi\");\n};\n]]></script>");
+    }
+
+    // TODO (erikdebruin) this isn't working...
+    @Test
+    public void testFunctionScript()
+    {
+//        String code = "" + "<fx:Script><![CDATA["
+//                + "    public static function beNice(input:*):Object" + "    {"
+//                + "        Alert.show(\"I'm nice :-P\");"
+//                + "        return null;" + "    }" + "]]></fx:Script>";
+//
+//        IMXMLScriptNode node = (IMXMLScriptNode) getNode(code,
+//                IMXMLScriptNode.class, MXMLTestBase.WRAP_LEVEL_DOCUMENT);
+//
+//        mxmlBlockWalker.visitScript(node);
+//
+//        System.out.println(writer.toString());
+//
+//        assertOut("<script><![CDATA[\n\tvar n:int = 3;\n\tfor (var i:int = 0; i < n; i++) {\n\tAlert.show(\"Hi\");\n};\n]]></script>");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/TestFlexJSMXMLApplication.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/TestFlexJSMXMLApplication.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/TestFlexJSMXMLApplication.java
new file mode 100644
index 0000000..fc5ce66
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/TestFlexJSMXMLApplication.java
@@ -0,0 +1,279 @@
+/*
+ *
+ *  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.internal.codegen.mxml.flexjs;
+
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.test.FlexJSTestBase;
+import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.utils.ITestAdapter;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.Test;
+
+import java.io.File;
+
+public class TestFlexJSMXMLApplication extends FlexJSTestBase
+{
+    private static ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
+
+    @Override
+    public void setUp()
+    {
+        super.setUp();
+    	((FlexJSProject)project).config = new JSGoogConfiguration();
+    }
+
+    @Test
+    public void testFile()
+    {
+        String fileName = "wildcard_import";
+
+        IMXMLFileNode node = compileMXML(fileName, true,
+                new File(testAdapter.getUnitTestBaseDir(), "flexjs/files").getPath(), false);
+
+        mxmlBlockWalker.visitFile(node);
+        
+        //writeResultToFile(writer.toString(), fileName);
+
+        assertOutWithMetadata(getCodeFromFile(fileName + "_result", true, "flexjs/files"));
+    }
+
+    @Test
+    public void testFlexJSMainFile()
+    {
+        String fileName = "FlexJSTest_again";
+
+        IMXMLFileNode node = compileMXML(fileName, true,
+                new File(testAdapter.getUnitTestBaseDir(), "flexjs/files").getPath(), false);
+
+        mxmlBlockWalker.visitFile(node);
+
+        //writeResultToFile(writer.toString(), fileName);
+
+        assertOutWithMetadata(getCodeFromFile(fileName + "_result", true, "flexjs/files"));
+    }
+
+    @Test
+    public void testFlexJSInitialViewFile()
+    {
+        String fileName = "MyInitialView";
+
+        IMXMLFileNode node = compileMXML(fileName, true,
+                new File(testAdapter.getUnitTestBaseDir(), "flexjs/files").getPath(), false);
+
+        mxmlBlockWalker.visitFile(node);
+
+        //writeResultToFile(writer.toString(), fileName);
+
+        assertOutWithMetadata(getCodeFromFile(fileName + "_result", true, "flexjs/files"));
+    }
+
+    @Test
+    public void testInterfaceAttribute()
+    {
+        String code = "<basic:Application xmlns:fx=\"http://ns.adobe.com/mxml/2009\" xmlns:basic=\"library://ns.apache.org/flexjs/basic\" implements=\"org.apache.flex.core.IChrome\">"
+        		+ "<fx:Script><![CDATA["
+                + "    import org.apache.flex.core.IChrome;"
+                + "]]></fx:Script></basic:Application>";
+
+        IMXMLDocumentNode dnode = (IMXMLDocumentNode) getNode(code,
+        		IMXMLDocumentNode.class, FlexJSTestBase.WRAP_LEVEL_NONE);
+
+        ((JSFlexJSEmitter)(mxmlBlockWalker.getASEmitter())).getModel().setCurrentClass(dnode.getDefinition());
+        mxmlBlockWalker.visitDocument(dnode);
+        String appName = dnode.getQualifiedName();
+        String outTemplate = "/**\n" +
+        		" * AppName\n" +
+        		" *\n" +
+        		" * @fileoverview\n" +
+        		" *\n" +
+        		" * @suppress {checkTypes|accessControls}\n" +
+        		" */\n" +
+        		"\n" +
+        		"goog.provide('AppName');\n" +
+        		"\n" +
+        		"goog.require('org.apache.flex.core.Application');\n" +
+        		"goog.require('org.apache.flex.core.IChrome');\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @constructor\n" +
+        		" * @extends {org.apache.flex.core.Application}\n" +
+        		" */\n" +
+        		"AppName = function() {\n" +
+        		"  AppName.base(this, 'constructor');\n" +
+        		"  \n" +
+        		"  /**\n" +
+        		"   * @private\n" +
+        		"   * @type {Array}\n" +
+        		"   */\n" +
+        		"  this.mxmldd;\n" +
+        		"  \n" +
+        		"  /**\n" +
+        		"   * @private\n" +
+        		"   * @type {Array}\n" +
+        		"   */\n" +
+        		"  this.mxmldp;\n" +
+        		"};\n" +
+        		"goog.inherits(AppName, org.apache.flex.core.Application);\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Metadata\n" +
+        		" *\n" +
+        		" * @type {Object.<string, Array.<Object>>}\n" +
+        		" */\n" +
+        		"AppName.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'AppName', qName: 'AppName' }], interfaces: [org.apache.flex.core.IChrome] };\n" +
+          		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('AppName', AppName);\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"AppName.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n" +
+        		"\n" +
+        		"\n" +
+        		"\n";
+
+        assertOutWithMetadata(outTemplate.replaceAll("AppName", appName));
+    }
+
+    @Test
+    public void testTwoInterfaceAttribute()
+    {
+        String code = "<basic:Application xmlns:fx=\"http://ns.adobe.com/mxml/2009\" xmlns:basic=\"library://ns.apache.org/flexjs/basic\" implements=\"org.apache.flex.core.IChrome, org.apache.flex.core.IPopUp\">"
+        		+ "<fx:Script><![CDATA["
+                + "    import org.apache.flex.core.IPopUp;"
+                + "    import org.apache.flex.core.IChrome;"
+                + "]]></fx:Script></basic:Application>";
+
+        IMXMLDocumentNode dnode = (IMXMLDocumentNode) getNode(code,
+        		IMXMLDocumentNode.class, FlexJSTestBase.WRAP_LEVEL_NONE);
+
+        ((JSFlexJSEmitter)(mxmlBlockWalker.getASEmitter())).getModel().setCurrentClass(dnode.getDefinition());
+        mxmlBlockWalker.visitDocument(dnode);
+        String appName = dnode.getQualifiedName();
+        String outTemplate = "/**\n" +
+        		" * AppName\n" +
+        		" *\n" +
+        		" * @fileoverview\n" +
+        		" *\n" +
+        		" * @suppress {checkTypes|accessControls}\n" +
+        		" */\n" +
+        		"\n" +
+        		"goog.provide('AppName');\n" +
+        		"\n" +
+        		"goog.require('org.apache.flex.core.Application');\n" +
+        		"goog.require('org.apache.flex.core.IChrome');\n" +
+        		"goog.require('org.apache.flex.core.IPopUp');\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @constructor\n" +
+        		" * @extends {org.apache.flex.core.Application}\n" +
+        		" */\n" +
+        		"AppName = function() {\n" +
+        		"  AppName.base(this, 'constructor');\n" +
+        		"  \n" +
+        		"  /**\n" +
+        		"   * @private\n" +
+        		"   * @type {Array}\n" +
+        		"   */\n" +
+        		"  this.mxmldd;\n" +
+        		"  \n" +
+        		"  /**\n" +
+        		"   * @private\n" +
+        		"   * @type {Array}\n" +
+        		"   */\n" +
+        		"  this.mxmldp;\n" +
+        		"};\n" +
+        		"goog.inherits(AppName, org.apache.flex.core.Application);\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Metadata\n" +
+        		" *\n" +
+        		" * @type {Object.<string, Array.<Object>>}\n" +
+        		" */\n" +
+        		"AppName.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'AppName', qName: 'AppName' }], interfaces: [org.apache.flex.core.IChrome, org.apache.flex.core.IPopUp] };\n" +
+          		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('AppName', AppName);\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"AppName.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n" +
+        		"\n" +
+        		"\n" +
+        		"\n";
+
+        assertOutWithMetadata(outTemplate.replaceAll("AppName", appName));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/TestFlexJSMXMLScript.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/TestFlexJSMXMLScript.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/TestFlexJSMXMLScript.java
new file mode 100644
index 0000000..3da0c36
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/TestFlexJSMXMLScript.java
@@ -0,0 +1,237 @@
+/*
+ *
+ *  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.internal.codegen.mxml.flexjs;
+
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.test.FlexJSTestBase;
+import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLScriptNode;
+import org.junit.Test;
+
+public class TestFlexJSMXMLScript extends FlexJSTestBase
+{
+
+    @Test
+    public void testSuperInScript()
+    {
+        String code = "" + "<fx:Script><![CDATA["
+                + "    override public function addedToParent():void {"
+                + "    super.addedToParent();}"
+                + "]]></fx:Script>";
+
+        IMXMLScriptNode node = (IMXMLScriptNode) getNode(code,
+                IMXMLScriptNode.class, FlexJSTestBase.WRAP_LEVEL_DOCUMENT);
+
+        IMXMLDocumentNode dnode = (IMXMLDocumentNode) node
+        	.getAncestorOfType(IMXMLDocumentNode.class);
+        ((JSFlexJSEmitter)(mxmlBlockWalker.getASEmitter())).getModel().setCurrentClass(dnode.getDefinition());
+        mxmlBlockWalker.visitDocument(dnode);
+        String appName = dnode.getQualifiedName();
+        String outTemplate = "/**\n" +
+        		" * AppName\n" +
+        		" *\n" +
+        		" * @fileoverview\n" +
+        		" *\n" +
+        		" * @suppress {checkTypes|accessControls}\n" +
+        		" */\n" +
+        		"\n" +
+        		"goog.provide('AppName');\n" +
+        		"\n" +
+        		"goog.require('org.apache.flex.core.Application');\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @constructor\n" +
+        		" * @extends {org.apache.flex.core.Application}\n" +
+        		" */\n" +
+        		"AppName = function() {\n" +
+        		"  AppName.base(this, 'constructor');\n" +
+        		"  \n" +
+        		"  /**\n" +
+        		"   * @private\n" +
+        		"   * @type {Array}\n" +
+        		"   */\n" +
+        		"  this.mxmldd;\n" +
+        		"  \n" +
+        		"  /**\n" +
+        		"   * @private\n" +
+        		"   * @type {Array}\n" +
+        		"   */\n" +
+        		"  this.mxmldp;\n" +
+        		"};\n" +
+        		"goog.inherits(AppName, org.apache.flex.core.Application);\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Metadata\n" +
+        		" *\n" +
+        		" * @type {Object.<string, Array.<Object>>}\n" +
+        		" */\n" +
+        		"AppName.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'AppName', qName: 'AppName' }] };\n" +
+          		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('AppName', AppName);\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"AppName.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"        'addedToParent': { type: 'void', declaredBy: 'AppName'}\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @export\n" +
+        		" * @override\n" +
+        		" */\n" +
+        		"AppName.prototype.addedToParent = function() {\n" +
+        		"  AppName.base(this, 'addedToParent');\n" +
+        		"};\n" +
+        		"\n" +
+        		"\n";
+        	
+        assertOutWithMetadata(outTemplate.replaceAll("AppName", appName));
+    }
+
+    @Test
+    public void testComplexInitializersInScript()
+    {
+        String code = "" + "<fx:Script><![CDATA["
+                + "    public var foo:Array = ['foo'];"
+                + "]]></fx:Script>";
+
+        IMXMLScriptNode node = (IMXMLScriptNode) getNode(code,
+                IMXMLScriptNode.class, FlexJSTestBase.WRAP_LEVEL_DOCUMENT);
+
+        IMXMLDocumentNode dnode = (IMXMLDocumentNode) node
+        	.getAncestorOfType(IMXMLDocumentNode.class);
+        ((JSFlexJSEmitter)(mxmlBlockWalker.getASEmitter())).getModel().setCurrentClass(dnode.getDefinition());
+        mxmlBlockWalker.visitDocument(dnode);
+        String appName = dnode.getQualifiedName();
+        String outTemplate = "/**\n" +
+        		" * AppName\n" +
+        		" *\n" +
+        		" * @fileoverview\n" +
+        		" *\n" +
+        		" * @suppress {checkTypes|accessControls}\n" +
+        		" */\n" +
+        		"\n" +
+        		"goog.provide('AppName');\n" +
+        		"\n" +
+        		"goog.require('org.apache.flex.core.Application');\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @constructor\n" +
+        		" * @extends {org.apache.flex.core.Application}\n" +
+        		" */\n" +
+        		"AppName = function() {\n" +
+        		"  AppName.base(this, 'constructor');\n" +
+        		"  \n" +
+        		"  this.foo = ['foo'];\n" +
+        		"  /**\n" +
+        		"   * @private\n" +
+        		"   * @type {Array}\n" +
+        		"   */\n" +
+        		"  this.mxmldd;\n" +
+        		"  \n" +
+        		"  /**\n" +
+        		"   * @private\n" +
+        		"   * @type {Array}\n" +
+        		"   */\n" +
+        		"  this.mxmldp;\n" +
+        		"};\n" +
+        		"goog.inherits(AppName, org.apache.flex.core.Application);\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Metadata\n" +
+        		" *\n" +
+        		" * @type {Object.<string, Array.<Object>>}\n" +
+        		" */\n" +
+        		"AppName.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'AppName', qName: 'AppName' }] };\n" +
+          		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Prevent renaming of class. Needed for reflection.\n" +
+        		" */\n" +
+        		"goog.exportSymbol('AppName', AppName);\n" +
+          		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * Reflection\n" +
+        		" *\n" +
+        		" * @return {Object.<string, Function>}\n" +
+        		" */\n" +
+        		"AppName.prototype.FLEXJS_REFLECTION_INFO = function () {\n" +
+        		"  return {\n" +
+        		"    variables: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" + 
+        		"    },\n" +
+        		"    accessors: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    },\n" +
+        		"    methods: function () {\n" +
+        		"      return {\n" +
+        		"      };\n" +
+        		"    }\n" +
+        		"  };\n" +
+        		"};\n" +
+        		"\n" +
+        		"\n" +
+        		"\n" +
+        		"/**\n" +
+        		" * @export\n" +
+        		" * @type {Array}\n" +
+        		" */\n" +
+        		"AppName.prototype.foo;\n" +
+        		"\n" +
+        		"\n" +
+        		"";
+        	
+        assertOutWithMetadata(outTemplate.replaceAll("AppName", appName));
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java
new file mode 100644
index 0000000..93f2a6b
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/TestVF2JSMXMLApplication.java
@@ -0,0 +1,97 @@
+/*
+ *
+ *  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.internal.codegen.mxml.vf2js;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.flex.compiler.internal.test.VF2JSMXMLTestBase;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.utils.ITestAdapter;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.Test;
+
+public class TestVF2JSMXMLApplication extends VF2JSMXMLTestBase
+{
+    private static ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
+
+    @Override
+    protected void addSourcePaths(List<File> sourcePaths)
+    {
+        sourcePaths.add(new File(testAdapter.getUnitTestBaseDir(), "vf2js/files"));
+        sourcePaths.add(new File(testAdapter.getUnitTestBaseDir(), "vf2js/projects/simpleMXML/src"));
+
+        super.addSourcePaths(sourcePaths);
+    }
+
+    @Test
+    public void testSimple()
+    {
+        String fileName = "SimpleMXML";
+
+        IMXMLFileNode node = compileMXML(fileName, true,
+                new File(testAdapter.getUnitTestBaseDir(), "vf2js/files").getPath(), false);
+
+        mxmlBlockWalker.visitFile(node);
+        
+        //writeResultToFile(writer.toxString(), fileName);
+
+        assertOutWithMetadata(getCodeFromFile(fileName + "_result", true, "vf2js/files"));
+    }
+
+
+    @Test
+    public void testSimpleMXMLProject()
+    {
+        String testDirPath = "vf2js/projects/simpleMXML/src";
+
+        String fileName = "SimpleMXML_Project";
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        // ToDo (erikdebruin): MXML property initialized with a FunctionCall
+        //                     are not included in the output (the assignment 
+        //                     should be handled in the constructor, like in AS
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    protected void assertProjectOut(List<String> compiledFileNames,
+            String testDirPath)
+    {
+        for (String compiledFileName : compiledFileNames)
+        {
+            String compiledFilePath = tempDir.getAbsolutePath()
+                    + File.separator + testDirPath + File.separator
+                    + compiledFileName + "_output" + "."
+                    + backend.getOutputExtension();
+            String compiledResult = readCodeFile(new File(compiledFilePath));
+
+            //System.out.println(compiledResult);
+
+            String expectedFilePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                    testDirPath + "/" + compiledFileName + "_result" + "." + backend.getOutputExtension()).getPath();
+            String expectedResult = readCodeFile(new File(expectedFilePath));
+
+            assertThat(compiledResult, is(expectedResult));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/AMDTestBase.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/AMDTestBase.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/AMDTestBase.java
new file mode 100644
index 0000000..faa7ea0
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/AMDTestBase.java
@@ -0,0 +1,149 @@
+/*
+ *
+ *  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.internal.test;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.driver.js.amd.AMDBackend;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.apache.flex.compiler.tree.as.ITypeNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.TestAdapterFactory;
+
+/**
+ * This class tests the production of AMD JavaScript for AS package.
+ * 
+ * @author Michael Schmalle
+ */
+public abstract class AMDTestBase extends TestBase
+{
+    protected IFileNode fileNode;
+
+    protected IClassNode classNode;
+
+    protected IInterfaceNode interfaceNode;
+
+    private String projectPath;
+
+    @Override
+    public void setUp()
+    {
+        super.setUp();
+
+        asEmitter = backend.createEmitter(writer);
+        asBlockWalker = backend.createWalker(project, errors, asEmitter);
+
+        projectPath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                "amd/simple-project/src").getPath();
+
+        String target = getTypeUnderTest().replace(".", File.separator);
+        String targetDir = projectPath + File.separator
+                + target.substring(0, target.lastIndexOf(File.separator));
+        String targetFile = target.substring(
+                target.lastIndexOf(File.separator) + 1, target.length());
+
+        fileNode = compileAS(targetFile, true, targetDir, false);
+        ITypeNode type = (ITypeNode) findFirstDescendantOfType(fileNode,
+                ITypeNode.class);
+        if (type instanceof IClassNode)
+            classNode = (IClassNode) type;
+        else if (type instanceof IInterfaceNode)
+            interfaceNode = (IInterfaceNode) type;
+
+    }
+
+    abstract protected String getTypeUnderTest();
+
+    @Override
+    protected void addLibraries(List<File> libraries)
+    {
+        libraries.add(new File(FilenameNormalization.normalize(env.FPSDK
+                + "/" + env.FPVER + "/playerglobal.swc")));
+
+        super.addLibraries(libraries);
+    }
+
+    @Override
+    protected void addSourcePaths(List<File> sourcePaths)
+    {
+        sourcePaths.add(new File(FilenameNormalization.normalize(projectPath)));
+
+        super.addSourcePaths(sourcePaths);
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new AMDBackend();
+    }
+
+    protected IVariableNode findField(String name, IClassNode node)
+    {
+        IDefinitionNode[] nodes = node.getAllMemberNodes();
+        for (IDefinitionNode inode : nodes)
+        {
+            if (inode.getName().equals(name))
+                return (IVariableNode) inode;
+        }
+        return null;
+    }
+
+    protected IFunctionNode findFunction(String name, IClassNode node)
+    {
+        IDefinitionNode[] nodes = node.getAllMemberNodes();
+        for (IDefinitionNode inode : nodes)
+        {
+            if (inode.getName().equals(name))
+                return (IFunctionNode) inode;
+        }
+        return null;
+    }
+
+    protected IGetterNode findGetter(String name, IClassNode node)
+    {
+        IDefinitionNode[] nodes = node.getAllMemberNodes();
+        for (IDefinitionNode inode : nodes)
+        {
+            if (inode.getName().equals(name) && inode instanceof IGetterNode)
+                return (IGetterNode) inode;
+        }
+        return null;
+    }
+
+    protected ISetterNode findSetter(String name, IClassNode node)
+    {
+        IDefinitionNode[] nodes = node.getAllMemberNodes();
+        for (IDefinitionNode inode : nodes)
+        {
+            if (inode.getName().equals(name) && inode instanceof ISetterNode)
+                return (ISetterNode) inode;
+        }
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/ASTestBase.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/ASTestBase.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/ASTestBase.java
new file mode 100644
index 0000000..a5dbc93
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/ASTestBase.java
@@ -0,0 +1,190 @@
+/*
+ *
+ *  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.internal.test;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.driver.as.ASBackend;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IAccessorNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.INamespaceAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.ITestAdapter;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.Ignore;
+
+@Ignore
+public class ASTestBase extends TestBase
+{
+
+    protected ITestAdapter testAdapter;
+
+    @Override
+    public void setUp()
+    {
+        super.setUp();
+
+        testAdapter = TestAdapterFactory.getTestAdapter();
+
+        asEmitter = backend.createEmitter(writer);
+        asBlockWalker = backend.createWalker(project, errors, asEmitter);
+    }
+
+    @Override
+    protected void addLibraries(List<File> libraries)
+    {
+        libraries.addAll(testAdapter.getLibraries(false));
+        // TODO: Make this use the test-adapter
+        libraries.add(new File(FilenameNormalization.normalize(
+                "../externs/GCL/out/bin/GCL.swc")));
+
+        super.addLibraries(libraries);
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new ASBackend();
+    }
+
+    //--------------------------------------------------------------------------
+    // Node "factory"
+    //--------------------------------------------------------------------------
+
+    protected static final int WRAP_LEVEL_MEMBER = 3;
+    protected static final int WRAP_LEVEL_CLASS = 2;
+    protected static final int WRAP_LEVEL_PACKAGE = 1;
+
+    protected IASNode getNode(String code, Class<? extends IASNode> type)
+    {
+        return getNode(code, type, WRAP_LEVEL_MEMBER, false);
+    }
+
+    protected IASNode getNode(String code, Class<? extends IASNode> type,
+            int wrapLevel)
+    {
+        return getNode(code, type, wrapLevel, false);
+    }
+
+    protected IASNode getNode(String code, Class<? extends IASNode> type,
+            int wrapLevel, boolean includePackage)
+    {
+        if (wrapLevel == WRAP_LEVEL_MEMBER)
+            code = "function falconTest_a():void {" + code + "}";
+
+        if (wrapLevel >= WRAP_LEVEL_CLASS)
+            code = "public class FalconTest_A {" + code + "}";
+
+        if (wrapLevel >= WRAP_LEVEL_PACKAGE)
+            code = "package" + ((includePackage) ? " foo.bar" : "") + " {"
+                    + code + "}";
+
+        IFileNode node = compileAS(code);
+
+        if (type.isInstance(node))
+            return node;
+
+        return findFirstDescendantOfType(node, type);
+    }
+
+    protected IInterfaceNode getInterfaceNode(String code)
+    {
+        return (IInterfaceNode) getNode(code, IInterfaceNode.class,
+                WRAP_LEVEL_PACKAGE);
+    }
+
+    protected IAccessorNode getAccessor(String code)
+    {
+        return (IAccessorNode) getNode(code, IAccessorNode.class,
+                WRAP_LEVEL_CLASS);
+    }
+
+    protected IVariableNode getField(String code)
+    {
+        return (IVariableNode) getNode(code, IVariableNode.class,
+                WRAP_LEVEL_CLASS);
+    }
+
+    protected IFunctionNode getMethod(String code)
+    {
+        return (IFunctionNode) getNode(code, IFunctionNode.class,
+                WRAP_LEVEL_CLASS);
+    }
+
+    protected IFunctionNode getMethodWithPackage(String code)
+    {
+        return (IFunctionNode) getNode(code, IFunctionNode.class,
+                WRAP_LEVEL_CLASS, true);
+    }
+
+    protected IExpressionNode getExpressionNode(String code,
+            Class<? extends IASNode> type)
+    {
+        return (IExpressionNode) getNode(code, type);
+    }
+
+    protected IBinaryOperatorNode getBinaryNode(String code)
+    {
+        return (IBinaryOperatorNode) getNode(code, IBinaryOperatorNode.class);
+    }
+
+    protected IForLoopNode getForLoopNode(String code)
+    {
+        return (IForLoopNode) getNode(code, IForLoopNode.class);
+    }
+
+    protected INamespaceAccessExpressionNode getNamespaceAccessExpressionNode(
+            String code)
+    {
+        return (INamespaceAccessExpressionNode) getNode(code,
+                INamespaceAccessExpressionNode.class);
+    }
+
+    protected IDynamicAccessNode getDynamicAccessNode(String code)
+    {
+        return (IDynamicAccessNode) getNode(code, IDynamicAccessNode.class);
+    }
+
+    protected IUnaryOperatorNode getUnaryNode(String code)
+    {
+        return (IUnaryOperatorNode) getNode(code, IUnaryOperatorNode.class);
+    }
+
+    protected IUnaryOperatorNode getUnaryNode(String code, int wrapLevel)
+    {
+        return (IUnaryOperatorNode) getNode(code, IUnaryOperatorNode.class, wrapLevel);
+    }
+
+    protected IVariableNode getVariable(String code)
+    {
+        return (IVariableNode) getNode(code, IVariableNode.class);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/FlexJSTestBase.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/FlexJSTestBase.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/FlexJSTestBase.java
new file mode 100644
index 0000000..203d16a
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/FlexJSTestBase.java
@@ -0,0 +1,140 @@
+/*
+ *
+ *  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.internal.test;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.driver.mxml.flexjs.MXMLFlexJSBackend;
+import org.apache.flex.compiler.internal.mxml.MXMLNamespaceMapping;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.mxml.IMXMLNamespaceMapping;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLNode;
+import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.ITestAdapter;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.Ignore;
+
+@Ignore
+public class FlexJSTestBase extends TestBase
+{
+    protected static ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
+
+    @Override
+    public void setUp()
+    {
+    	project = new FlexJSProject(workspace);
+        super.setUp();
+
+        asEmitter = backend.createEmitter(writer);
+        mxmlEmitter = backend.createMXMLEmitter(writer);
+
+        asBlockWalker = backend.createWalker(project, errors, asEmitter);
+        mxmlBlockWalker = backend.createMXMLWalker(project, errors,
+                mxmlEmitter, asEmitter, asBlockWalker);
+    }
+
+    @Override
+    protected void addLibraries(List<File> libraries)
+    {
+        libraries.add(new File(FilenameNormalization.normalize(env.FPSDK
+                + "/" + env.FPVER + "/playerglobal.swc")));
+        libraries.add(new File(FilenameNormalization.normalize(env.SDK
+                + "/frameworks/libs/framework.swc")));
+        libraries.add(new File(FilenameNormalization.normalize(env.SDK
+                + "\\frameworks\\libs\\rpc.swc")));
+        libraries.add(new File(env.ASJS + "/frameworks/libs/Core.swc"));
+        libraries.add(new File(env.ASJS + "/frameworks/libs/HTML.swc"));
+        libraries.add(new File(env.ASJS + "/frameworks/libs/Binding.swc"));
+        libraries.add(new File(env.ASJS + "/frameworks/libs/Network.swc"));
+        libraries.add(new File(env.ASJS + "/frameworks/libs/Collections.swc"));
+
+        super.addLibraries(libraries);
+    }
+
+    @Override
+    protected void addNamespaceMappings(List<IMXMLNamespaceMapping> namespaceMappings)
+    {
+        namespaceMappings
+                .add(new MXMLNamespaceMapping(
+                        "library://ns.apache.org/flexjs/basic", new File(
+                                env.ASJS + "/frameworks/as/basic-manifest.xml")
+                                .getAbsolutePath()));
+
+        super.addNamespaceMappings(namespaceMappings);
+    }
+
+    @Override
+    protected void addSourcePaths(List<File> sourcePaths)
+    {
+        sourcePaths.add(new File(env.ASJS + "/examples/FlexJSTest_basic/src"));
+        sourcePaths.add(new File(testAdapter.getUnitTestBaseDir(), "flexjs/files"));
+
+        super.addSourcePaths(sourcePaths);
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new MXMLFlexJSBackend();
+    }
+
+    //--------------------------------------------------------------------------
+    // Node "factory"
+    //--------------------------------------------------------------------------
+
+    public static final int WRAP_LEVEL_NONE = 0;
+    public static final int WRAP_LEVEL_DOCUMENT = 1;
+
+    protected IMXMLNode getNode(String code, Class<? extends IMXMLNode> type,
+            int wrapLevel)
+    {
+        if (wrapLevel >= WRAP_LEVEL_DOCUMENT)
+            code = ""
+                    + "<basic:Application xmlns:fx=\"http://ns.adobe.com/mxml/2009\" xmlns:basic=\"library://ns.apache.org/flexjs/basic\">"
+                    + code + "</basic:Application>";
+
+        IMXMLFileNode node = compileMXML(code);
+
+        return findFirstDescendantOfType(node, type);
+    }
+
+    protected IMXMLNode findFirstDescendantOfType(IMXMLNode node,
+            Class<? extends IMXMLNode> nodeType)
+    {
+
+        int n = node.getChildCount();
+        for (int i = 0; i < n; i++)
+        {
+            IMXMLNode child = (IMXMLNode) node.getChild(i);
+            if (nodeType.isInstance(child))
+                return child;
+
+            IMXMLNode found = findFirstDescendantOfType(child,
+                    nodeType);
+            if (found != null)
+                return found;
+        }
+
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/ITestBase.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/ITestBase.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/ITestBase.java
new file mode 100644
index 0000000..9096022
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/test/ITestBase.java
@@ -0,0 +1,25 @@
+/*
+ *
+ *  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.internal.test;
+
+public interface ITestBase
+{
+
+}


[33/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java
new file mode 100644
index 0000000..6e2dfba
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSEmitter.java
@@ -0,0 +1,1589 @@
+/*
+ *
+ *  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.internal.codegen.mxml.vf2js;
+
+
+import java.io.FilterWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.apache.flex.abc.semantics.MethodInfo;
+import org.apache.flex.abc.semantics.Name;
+import org.apache.flex.abc.semantics.Namespace;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.mxml.flexjs.IMXMLFlexJSEmitter;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.databinding.BindingDatabase;
+import org.apache.flex.compiler.internal.codegen.databinding.BindingInfo;
+import org.apache.flex.compiler.internal.codegen.databinding.FunctionWatcherInfo;
+import org.apache.flex.compiler.internal.codegen.databinding.PropertyWatcherInfo;
+import org.apache.flex.compiler.internal.codegen.databinding.StaticPropertyWatcherInfo;
+import org.apache.flex.compiler.internal.codegen.databinding.WatcherInfoBase;
+import org.apache.flex.compiler.internal.codegen.databinding.WatcherInfoBase.WatcherType;
+import org.apache.flex.compiler.internal.codegen.databinding.XMLWatcherInfo;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.vf2js.JSVF2JSEmitter;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLEmitter;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLEventSpecifier;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLScriptSpecifier;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.projects.FlexProject;
+import org.apache.flex.compiler.internal.scopes.ASProjectScope;
+import org.apache.flex.compiler.internal.tree.as.FunctionCallNode;
+import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
+import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
+import org.apache.flex.compiler.internal.tree.mxml.MXMLDocumentNode;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IImportNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLArrayNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLClassDefinitionNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLClassNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLComponentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDataBindingNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLEventSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFactoryNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLInstanceNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLLiteralNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLScriptNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStateNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStringNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStyleSpecifierNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.utils.NativeUtils;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * @author Erik de Bruin
+ */
+public class MXMLVF2JSEmitter extends MXMLEmitter implements
+        IMXMLFlexJSEmitter
+{
+
+    private ArrayList<MXMLVF2JSDescriptorSpecifier> currentInstances;
+    private ArrayList<MXMLVF2JSDescriptorSpecifier> currentPropertySpecifiers;
+    private ArrayList<MXMLVF2JSDescriptorSpecifier> descriptorTree;
+    private MXMLVF2JSDescriptorSpecifier propertiesTree;
+    private ArrayList<MXMLEventSpecifier> events;
+    private ArrayList<MXMLVF2JSDescriptorSpecifier> instances;
+    private ArrayList<MXMLScriptSpecifier> scripts;
+    //private ArrayList<MXMLStyleSpecifier> styles;
+
+    private int eventCounter;
+    private int idCounter;
+
+    private boolean inMXMLContent;
+    private boolean inStatesOverride;
+    
+    private StringBuilder subDocuments = new StringBuilder();
+    private ArrayList<String> subDocumentNames = new ArrayList<String>();
+
+    public MXMLVF2JSEmitter(FilterWriter out)
+    {
+        super(out);
+    }
+
+    @Override
+    protected String getIndent(int numIndent)
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < numIndent; i++)
+            sb.append(JSFlexJSEmitterTokens.INDENT.getToken());
+        return sb.toString();
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitDocument(IMXMLDocumentNode node)
+    {
+        descriptorTree = new ArrayList<MXMLVF2JSDescriptorSpecifier>();
+        propertiesTree = new MXMLVF2JSDescriptorSpecifier();
+
+        events = new ArrayList<MXMLEventSpecifier>();
+        instances = new ArrayList<MXMLVF2JSDescriptorSpecifier>();
+        scripts = new ArrayList<MXMLScriptSpecifier>();
+        //styles = new ArrayList<MXMLStyleSpecifier>();
+
+        currentInstances = new ArrayList<MXMLVF2JSDescriptorSpecifier>();
+        currentPropertySpecifiers = new ArrayList<MXMLVF2JSDescriptorSpecifier>();
+
+        eventCounter = 0;
+        idCounter = 0;
+
+        // visit MXML
+        IClassDefinition cdef = node.getClassDefinition();
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+                .getASEmitter();
+        ((JSVF2JSEmitter) asEmitter).getModel().setCurrentClass(cdef);
+
+        // visit tags
+        final int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            getMXMLWalker().walk(node.getChild(i));
+        }
+
+        String cname = node.getFileNode().getName();
+
+        emitHeader(node);
+
+        write(subDocuments.toString());
+        writeNewline();
+
+        emitClassDeclStart(cname, node.getBaseClassName(), false);
+
+        emitPropertyDecls();
+        
+        emitClassDeclEnd(cname, node.getBaseClassName());
+
+        emitMetaData(cdef);
+        
+        emitScripts();
+
+        emitEvents(cname);
+
+        emitPropertyGetterSetters(cname);
+
+        emitMXMLDescriptorFuncs(cname);
+
+        emitBindingData(cname, cdef);
+
+    }
+
+    public void emitSubDocument(IMXMLComponentNode node)
+    {
+        ArrayList<MXMLVF2JSDescriptorSpecifier> oldDescriptorTree;
+        MXMLVF2JSDescriptorSpecifier oldPropertiesTree;
+        ArrayList<MXMLEventSpecifier> oldEvents;
+        ArrayList<MXMLScriptSpecifier> oldScripts;
+        ArrayList<MXMLVF2JSDescriptorSpecifier> oldCurrentInstances;
+        ArrayList<MXMLVF2JSDescriptorSpecifier> oldCurrentPropertySpecifiers;
+        int oldEventCounter;
+        int oldIdCounter;
+        
+        oldDescriptorTree = descriptorTree;
+        descriptorTree = new ArrayList<MXMLVF2JSDescriptorSpecifier>();
+        oldPropertiesTree = propertiesTree;
+        propertiesTree = new MXMLVF2JSDescriptorSpecifier();
+
+        oldEvents = events;
+        events = new ArrayList<MXMLEventSpecifier>();
+        // we don't save these.  We want all requires to be generated at the top of the file
+        instances = new ArrayList<MXMLVF2JSDescriptorSpecifier>();
+        oldScripts = scripts;
+        scripts = new ArrayList<MXMLScriptSpecifier>();
+        //styles = new ArrayList<MXMLStyleSpecifier>();
+
+        oldCurrentInstances = currentInstances;
+        currentInstances = new ArrayList<MXMLVF2JSDescriptorSpecifier>();
+        oldCurrentPropertySpecifiers = currentPropertySpecifiers;
+        currentPropertySpecifiers = new ArrayList<MXMLVF2JSDescriptorSpecifier>();
+
+        oldEventCounter = eventCounter;
+        eventCounter = 0;
+        oldIdCounter = idCounter;
+        idCounter = 0;
+
+        // visit MXML
+        IClassDefinition cdef = node.getContainedClassDefinition();
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+                .getASEmitter();
+        ((JSVF2JSEmitter) asEmitter).getModel().setCurrentClass(cdef);
+
+        IASNode classNode = node.getContainedClassDefinitionNode();
+        // visit tags
+        final int len = classNode.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            getMXMLWalker().walk(classNode.getChild(i));
+        }
+
+        String cname = cdef.getQualifiedName();
+        subDocumentNames.add(cname);
+        String baseClassName = cdef.getBaseClassAsDisplayString();
+
+        emitClassDeclStart(cname, baseClassName, false);
+
+        emitPropertyDecls();
+        
+        emitClassDeclEnd(cname, baseClassName);
+
+        emitMetaData(cdef);
+
+        emitScripts();
+
+        emitEvents(cname);
+
+        emitPropertyGetterSetters(cname);
+
+        emitMXMLDescriptorFuncs(cname);
+
+        emitBindingData(cname, cdef);
+
+        descriptorTree = oldDescriptorTree;
+        propertiesTree = oldPropertiesTree;
+        events = oldEvents;
+        scripts = oldScripts;
+        currentInstances = oldCurrentInstances;
+        currentPropertySpecifiers = oldCurrentPropertySpecifiers;
+        eventCounter = oldEventCounter;
+        idCounter = oldIdCounter;
+
+    }
+
+    //--------------------------------------------------------------------------
+
+    protected void emitClassDeclStart(String cname, String baseClassName,
+            boolean indent)
+    {
+        writeNewline();
+        writeNewline("/**");
+        writeNewline(" * @constructor");
+        writeNewline(" * @extends {" + baseClassName + "}");
+        writeNewline(" */");
+        writeToken(cname);
+        writeToken(ASEmitterTokens.EQUAL);
+        write(ASEmitterTokens.FUNCTION);
+        write(ASEmitterTokens.PAREN_OPEN);
+        writeToken(ASEmitterTokens.PAREN_CLOSE);
+        if (indent)
+            indentPush();
+        writeNewline(ASEmitterTokens.BLOCK_OPEN, true);
+        write(cname);
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        write(JSGoogEmitterTokens.GOOG_BASE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(ASEmitterTokens.THIS);
+        writeToken(ASEmitterTokens.COMMA);
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(JSGoogEmitterTokens.GOOG_CONSTRUCTOR);
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline(ASEmitterTokens.SEMICOLON);
+    }
+
+    //--------------------------------------------------------------------------
+
+    protected void emitClassDeclEnd(String cname, String baseClassName)
+    {
+        write(ASEmitterTokens.BLOCK_CLOSE);
+        writeNewline(ASEmitterTokens.SEMICOLON);
+        write(JSGoogEmitterTokens.GOOG_INHERITS);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(cname);
+        writeToken(ASEmitterTokens.COMMA);
+        write(baseClassName);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline(ASEmitterTokens.SEMICOLON);
+        writeNewline();
+        writeNewline();
+    }
+
+    //--------------------------------------------------------------------------
+
+    protected void emitMetaData(IClassDefinition cdef)
+    {
+        String cname = cdef.getQualifiedName();
+        
+        writeNewline("/**");
+        writeNewline(" * Metadata");
+        writeNewline(" *");
+        writeNewline(" * @type {Object.<string, Array.<Object>>}");
+        writeNewline(" */");
+        write(cname + ".prototype.FLEXJS_CLASS_INFO = { names: [{ name: '");
+        write(cdef.getBaseName());
+        write("', qName: '");
+        write(cname);
+        writeNewline("' }] };");
+        writeNewline();
+        writeNewline();
+    }
+
+    //--------------------------------------------------------------------------
+
+    protected void emitPropertyDecls()
+    {
+        indentPop();
+        
+        for (MXMLVF2JSDescriptorSpecifier instance : instances)
+        {
+            indentPush();
+            writeNewline();
+            writeNewline("/**");
+            writeNewline(" * @private");
+            writeNewline(" * @type {" + instance.name + "}");
+            writeNewline(" */");
+            write(ASEmitterTokens.THIS);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(instance.id);
+            indentPop();
+            writeNewline(ASEmitterTokens.SEMICOLON);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+
+    protected void emitBindingData(String cname, IClassDefinition cdef)
+    {
+        BindingDatabase bd = BindingDatabase.bindingMap.get(cdef);
+        if (bd == null)
+            return;
+        if (bd.getBindingInfo().isEmpty())
+            return;
+
+        outputBindingInfoAsData(cname, bd);
+    }
+
+    private void outputBindingInfoAsData(String cname, BindingDatabase bindingDataBase)
+    {
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+        .getASEmitter();
+
+        writeNewline("/**");
+        writeNewline(" * @export");
+        writeNewline(" */");
+        writeNewline(cname
+                + ".prototype._bindings = [");
+        
+        Set<BindingInfo> bindingInfo = bindingDataBase.getBindingInfo();
+        writeNewline(bindingInfo.size() + ","); // number of bindings
+        
+        for (BindingInfo bi : bindingInfo)
+        {
+            String s;
+            s = bi.getSourceString();
+            if (s == null)
+                s = getSourceStringFromGetter(bi.getExpressionNodesForGetter());
+            if (s.contains("."))
+            {
+                String[] parts = s.split("\\.");
+                write(ASEmitterTokens.SQUARE_OPEN.getToken() + ASEmitterTokens.DOUBLE_QUOTE.getToken() + 
+                        parts[0] + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+                int n = parts.length;
+                for (int i = 1; i < n; i++)
+                {
+                    String part = parts[i];
+                    write(", " +  ASEmitterTokens.DOUBLE_QUOTE.getToken() + part + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+                }
+                writeNewline(ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.COMMA.getToken());
+            }
+            else if (s == null || s.length() == 0)
+            {
+                List<IExpressionNode> getterNodes = bi.getExpressionNodesForGetter();
+                StringBuilder sb = new StringBuilder();
+                sb.append("function() { return ");
+                for (IExpressionNode getterNode : getterNodes)
+                {
+                    sb.append(asEmitter.stringifyNode(getterNode));
+                }
+                sb.append("; },");
+                writeNewline(sb.toString());
+            }
+            else
+                writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + s + 
+                        ASEmitterTokens.DOUBLE_QUOTE.getToken() + ASEmitterTokens.COMMA.getToken());
+            
+            IExpressionNode destNode = bi.getExpressionNodeForDestination();
+            if (destNode != null)
+            {
+                StringBuilder sb = new StringBuilder();
+                sb.append(asEmitter.stringifyNode(destNode));
+                writeNewline(sb.toString());
+            }
+            else
+                writeNewline(ASEmitterTokens.NULL.getToken() + ASEmitterTokens.COMMA.getToken());
+            
+            s = bi.getDestinationString();
+            if (s.contains("."))
+            {
+                String[] parts = s.split("\\.");
+                write(ASEmitterTokens.SQUARE_OPEN.getToken() + ASEmitterTokens.DOUBLE_QUOTE.getToken() + 
+                        parts[0] + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+                int n = parts.length;
+                for (int i = 1; i < n; i++)
+                {
+                    String part = parts[i];
+                    write(", " + ASEmitterTokens.DOUBLE_QUOTE.getToken() + part + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+                }
+                writeNewline(ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.COMMA.getToken());
+            }
+            else
+                writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + s +
+                        ASEmitterTokens.DOUBLE_QUOTE.getToken() + ASEmitterTokens.COMMA.getToken());
+        }
+        Set<Entry<Object, WatcherInfoBase>> watcherChains = bindingDataBase.getWatcherChains();
+        for (Entry<Object, WatcherInfoBase> entry : watcherChains)
+        {
+            WatcherInfoBase watcherInfoBase = entry.getValue();
+            encodeWatcher(watcherInfoBase);
+        }
+        // add a trailing null for now so I don't have to have logic where the watcher figures out not to add
+        // a comma
+        writeNewline("null" + ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.SEMICOLON.getToken());
+    }
+
+    private void encodeWatcher(WatcherInfoBase watcherInfoBase)
+    {
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+        .getASEmitter();
+
+        writeNewline(watcherInfoBase.getIndex() + ASEmitterTokens.COMMA.getToken());
+        WatcherType type = watcherInfoBase.getType();
+        if (type == WatcherType.FUNCTION)
+        {
+            writeNewline("0" + ASEmitterTokens.COMMA.getToken());
+
+            FunctionWatcherInfo functionWatcherInfo = (FunctionWatcherInfo)watcherInfoBase;
+           
+            writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + functionWatcherInfo.getFunctionName() + 
+                    ASEmitterTokens.DOUBLE_QUOTE.getToken());
+            IExpressionNode params[] = functionWatcherInfo.params;
+            StringBuilder sb = new StringBuilder();
+            sb.append("function() { return [");
+            boolean firstone = true;
+            for (IExpressionNode param : params)
+            {
+                if (firstone)
+                    firstone = false;
+                sb.append(ASEmitterTokens.COMMA.getToken());
+                sb.append(asEmitter.stringifyNode(param));   
+            }
+            sb.append("]; },");
+            outputEventNames(functionWatcherInfo.getEventNames());
+            outputBindings(functionWatcherInfo.getBindings());
+        }
+        else if ((type == WatcherType.STATIC_PROPERTY) || (type == WatcherType.PROPERTY))
+        {
+            writeNewline((type == WatcherType.STATIC_PROPERTY ? "1" : "2") + 
+                    ASEmitterTokens.COMMA.getToken());
+
+            PropertyWatcherInfo propertyWatcherInfo = (PropertyWatcherInfo)watcherInfoBase;
+           
+            boolean makeStaticWatcher = (watcherInfoBase.getType() == WatcherType.STATIC_PROPERTY);
+            
+            // round up the getter function for the watcher, or null if we don't need one
+            MethodInfo propertyGetterFunction = null;
+            if (watcherInfoBase.isRoot && !makeStaticWatcher)
+            {
+                // TODO: figure out what this looks like
+                // propertyGetterFunction = this.propertyGetter;
+                // assert propertyGetterFunction != null;
+            }
+            else if (watcherInfoBase.isRoot && makeStaticWatcher)
+            {
+                 // TODO: implement getter func for static watcher.
+            }
+            writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + propertyWatcherInfo.getPropertyName() +
+                    ASEmitterTokens.DOUBLE_QUOTE.getToken() + ASEmitterTokens.COMMA.getToken());
+            outputEventNames(propertyWatcherInfo.getEventNames());
+            outputBindings(propertyWatcherInfo.getBindings());
+            if (propertyGetterFunction == null)
+                writeNewline("null" + ASEmitterTokens.COMMA.getToken()); // null is valid
+            if (type == WatcherType.STATIC_PROPERTY)
+            {
+                StaticPropertyWatcherInfo pwinfo = (StaticPropertyWatcherInfo)watcherInfoBase;
+                Name classMName = pwinfo.getContainingClass(getMXMLWalker().getProject());
+                writeNewline(nameToString(classMName));
+            }
+        }
+        else if (type == WatcherType.XML)
+        {
+            writeNewline("3" + ASEmitterTokens.COMMA.getToken());
+
+            XMLWatcherInfo xmlWatcherInfo = (XMLWatcherInfo)watcherInfoBase;
+            writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + xmlWatcherInfo.getPropertyName() +
+                    ASEmitterTokens.DOUBLE_QUOTE.getToken() + ASEmitterTokens.COMMA.getToken());
+            outputBindings(xmlWatcherInfo.getBindings());
+        }
+        else assert false;     
+
+        // then recurse into children
+        Set<Entry<Object, WatcherInfoBase>> children = watcherInfoBase.getChildren();
+        if (children != null)
+        {
+            writeNewline(ASEmitterTokens.SQUARE_OPEN.getToken());
+            for ( Entry<Object, WatcherInfoBase> ent : children)
+            {
+                encodeWatcher(ent.getValue());
+            }
+            writeNewline("null" + ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.COMMA.getToken());
+        }
+        else
+        {
+            writeNewline("null" + ASEmitterTokens.COMMA.getToken());
+        }
+    }
+    
+    private String getSourceStringFromMemberAccessExpressionNode(MemberAccessExpressionNode node)
+    {
+        String s = "";
+        
+        IExpressionNode left = node.getLeftOperandNode();
+        if (left instanceof FunctionCallNode) //  probably a cast
+        {
+            IASNode child = ((FunctionCallNode)left).getArgumentsNode().getChild(0);
+            if (child instanceof IdentifierNode)
+                s = getSourceStringFromIdentifierNode((IdentifierNode)child);
+            else if (child instanceof MemberAccessExpressionNode)
+                s = getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)child);
+        }
+        else if (left instanceof MemberAccessExpressionNode)
+            s = getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)left);
+        else if (left instanceof IdentifierNode)
+            s = getSourceStringFromIdentifierNode((IdentifierNode)left);
+        else
+            System.out.println("expected binding member access left node" + node.toString());
+        s += ".";
+        
+        IExpressionNode right = node.getRightOperandNode();
+        if (right instanceof FunctionCallNode) //  probably a cast
+        {
+            IASNode child = ((FunctionCallNode)right).getArgumentsNode().getChild(0);
+            if (child instanceof IdentifierNode)
+                s += getSourceStringFromIdentifierNode((IdentifierNode)child);
+            else if (child instanceof MemberAccessExpressionNode)
+                s += getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)child);
+        }
+        else if (right instanceof MemberAccessExpressionNode)
+            s += getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)right);
+        else if (right instanceof IdentifierNode)
+            s += getSourceStringFromIdentifierNode((IdentifierNode)right);
+        else
+            System.out.println("expected binding member access right node" + node.toString());
+        
+        return s;
+    }
+    
+    private String getSourceStringFromIdentifierNode(IdentifierNode node)
+    {
+        return node.getName();
+    }
+    
+    private String getSourceStringFromGetter(List<IExpressionNode> nodes)
+    {
+        String s = "";
+        IExpressionNode node = nodes.get(0);
+        if (node instanceof MemberAccessExpressionNode)
+        {
+            s = getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)node);
+        }
+        return s;
+    }
+    
+    private void outputEventNames(List<String> events)
+    {
+        if (events.size() > 1)
+        {
+            int n = events.size();
+            write(ASEmitterTokens.SQUARE_OPEN.getToken() + ASEmitterTokens.DOUBLE_QUOTE.getToken() +
+                    events.get(0) + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+            for (int i = 1; i < n; i++)
+            {
+                String event = events.get(i);
+                write(ASEmitterTokens.COMMA.getToken() + ASEmitterTokens.DOUBLE_QUOTE.getToken() + 
+                        event + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+            }
+            writeNewline(ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.COMMA.getToken());
+        }
+        else if (events.size() == 1)
+            writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + events.get(0) +
+                    ASEmitterTokens.DOUBLE_QUOTE.getToken() + ASEmitterTokens.COMMA.getToken());
+        else
+            writeNewline("null" + ASEmitterTokens.COMMA.getToken());
+    }
+    
+    private void outputBindings(List<BindingInfo> bindings)
+    {
+        if (bindings.size() > 1)
+        {
+            int n = bindings.size();
+            write(ASEmitterTokens.SQUARE_OPEN.getToken() + bindings.get(0).getIndex());
+            for (int i = 1; i < n; i++)
+            {
+                BindingInfo binding = bindings.get(i);
+                write(ASEmitterTokens.COMMA.getToken() + binding.getIndex());
+            }
+            writeNewline(ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.COMMA.getToken());
+        }
+        else if (bindings.size() == 1)
+            writeNewline(bindings.get(0).getIndex() + ASEmitterTokens.COMMA.getToken());
+        else
+            writeNewline("null" + ASEmitterTokens.COMMA.getToken());
+        
+    }
+
+    //--------------------------------------------------------------------------    
+
+    protected void emitScripts()
+    {
+        for (MXMLScriptSpecifier script : scripts)
+        {
+            String output = script.output();
+
+            if (!output.equals(""))
+            {
+                writeNewline(output);
+            }
+        }
+    }
+
+    //--------------------------------------------------------------------------    
+
+    protected void emitEvents(String cname)
+    {
+        for (MXMLEventSpecifier event : events)
+        {
+            writeNewline("/**");
+            writeNewline(" * @export");
+            writeNewline(" * @param {" + event.type + "} event");
+            writeNewline(" */");
+            writeNewline(cname
+                    + ".prototype." + event.eventHandler + " = function(event)");
+            writeNewline(ASEmitterTokens.BLOCK_OPEN, true);
+
+            writeNewline(event.value + ASEmitterTokens.SEMICOLON.getToken(),
+                    false);
+
+            write(ASEmitterTokens.BLOCK_CLOSE);
+            writeNewline(";");
+            writeNewline();
+            writeNewline();
+        }
+    }
+
+    //--------------------------------------------------------------------------    
+
+    protected void emitPropertyGetterSetters(String cname)
+    {
+        for (MXMLVF2JSDescriptorSpecifier instance : instances)
+        {
+            if (!instance.id.startsWith(MXMLFlexJSEmitterTokens.ID_PREFIX
+                    .getToken()))
+            {
+                writeNewline("/**");
+                writeNewline(" * @export");
+                writeNewline(" * @return {" + instance.name + "}");
+                writeNewline(" */");
+                writeNewline(cname
+                        + ".prototype.get_" + instance.id + " = function()");
+                indentPush();
+                writeNewline("{");
+                indentPop();
+                writeNewline("return this." + instance.id + ";");
+                writeNewline("};");
+                writeNewline();
+                writeNewline();
+                writeNewline("/**");
+                writeNewline(" * @export");
+                writeNewline(" * @param {" + instance.name + "} value");
+                writeNewline(" */");
+                writeNewline(cname
+                        + ".prototype.set_" + instance.id
+                        + " = function(value)");
+                indentPush();
+                writeNewline("{");
+                indentPush();
+                writeNewline("if (value != this." + instance.id + ")");
+                indentPop();
+                indentPop();
+                writeNewline("this." + instance.id + " = value;");
+                writeNewline("};");
+                writeNewline();
+                writeNewline();
+            }
+        }
+    }
+
+    //--------------------------------------------------------------------------    
+
+    protected void emitMXMLDescriptorFuncs(String cname)
+    {
+        // top level is 'mxmlContent', skip it...
+        if (descriptorTree.size() > 0)
+        {
+            MXMLVF2JSDescriptorSpecifier root = descriptorTree.get(0);
+            root.isTopNode = false;
+    
+            //writeNewline(root.output(true));
+        }
+        
+        if (propertiesTree.propertySpecifiers.size() > 0 ||
+                propertiesTree.eventSpecifiers.size() > 0)
+        {
+            MXMLVF2JSDescriptorSpecifier root = propertiesTree;
+            root.isTopNode = true;
+
+            writeNewline("/**");
+            writeNewline(" * start");
+            writeNewline(" *");
+            writeNewline(" * @export");
+            writeNewline(" */");
+            writeNewline(cname + ".prototype.start = function () {");
+            //writeNewline(root.output(true));
+            writeNewline("};");
+        }
+    }
+
+    //--------------------------------------------------------------------------    
+
+    @Override
+    public void emitEventSpecifier(IMXMLEventSpecifierNode node)
+    {
+        IDefinition cdef = node.getDefinition();
+
+        MXMLVF2JSDescriptorSpecifier currentDescriptor = getCurrentDescriptor("i");
+
+        MXMLEventSpecifier eventSpecifier = new MXMLEventSpecifier();
+        eventSpecifier.eventHandler = MXMLFlexJSEmitterTokens.EVENT_PREFIX
+                .getToken() + eventCounter++;
+        eventSpecifier.name = cdef.getBaseName();
+        eventSpecifier.type = node.getEventParameterDefinition()
+                .getTypeAsDisplayString();
+
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+                .getASEmitter();
+
+        StringBuilder sb = null;
+        int len = node.getChildCount();
+        if (len > 0)
+        {
+            sb = new StringBuilder();
+            for (int i = 0; i < len; i++)
+            {
+                sb.append(getIndent((i > 0) ? 1 : 0)
+                        + asEmitter.stringifyNode(node.getChild(i)));
+                if (i < len - 1)
+                {
+                    sb.append(ASEmitterTokens.SEMICOLON.getToken());
+                    sb.append(ASEmitterTokens.NEW_LINE.getToken());
+                }
+            }
+        }
+        eventSpecifier.value = sb.toString();
+
+        if (currentDescriptor != null)
+            currentDescriptor.eventSpecifiers.add(eventSpecifier);
+        else  // in theory, if no currentdescriptor must be top tag event
+            propertiesTree.eventSpecifiers.add(eventSpecifier);
+
+        events.add(eventSpecifier);
+    }
+
+    @Override
+    public void emitInstance(IMXMLInstanceNode node)
+    {
+        if (isStateDependent(node) && !inStatesOverride)
+            return;
+        
+        IClassDefinition cdef = node
+                .getClassReference((ICompilerProject) getMXMLWalker()
+                        .getProject());
+
+        MXMLVF2JSDescriptorSpecifier currentPropertySpecifier = getCurrentDescriptor("ps");
+
+        String id = node.getID();
+        if (id == null)
+            id = node.getEffectiveID();
+        if (id == null)
+            id = MXMLFlexJSEmitterTokens.ID_PREFIX.getToken() + idCounter++;
+
+        MXMLVF2JSDescriptorSpecifier currentInstance = new MXMLVF2JSDescriptorSpecifier();
+        currentInstance.isProperty = false;
+        currentInstance.id = id;
+        currentInstance.name = cdef.getQualifiedName();
+        currentInstance.parent = currentPropertySpecifier;
+
+        if (currentPropertySpecifier != null)
+            currentPropertySpecifier.propertySpecifiers.add(currentInstance);
+        else if (inMXMLContent)
+            descriptorTree.add(currentInstance);
+        else
+        {
+            currentInstance.parent = propertiesTree;
+            propertiesTree.propertySpecifiers.add(currentInstance);
+        }
+
+        instances.add(currentInstance);
+
+        IMXMLPropertySpecifierNode[] pnodes = node.getPropertySpecifierNodes();
+        if (pnodes != null)
+        {
+            moveDown(false, currentInstance, null);
+
+            for (IMXMLPropertySpecifierNode pnode : pnodes)
+            {
+                getMXMLWalker().walk(pnode); // Property Specifier
+            }
+
+            moveUp(false, true);
+        }
+        else if (node instanceof IMXMLStateNode)
+        {
+            IMXMLStateNode stateNode = (IMXMLStateNode)node;
+            String name = stateNode.getStateName();
+            if (name != null)
+            {
+                MXMLVF2JSDescriptorSpecifier stateName = new MXMLVF2JSDescriptorSpecifier();
+                stateName.isProperty = true;
+                stateName.id = id;
+                stateName.name = "name";
+                stateName.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + name + ASEmitterTokens.SINGLE_QUOTE.getToken();
+                stateName.parent = currentInstance;
+                currentInstance.propertySpecifiers.add(stateName);
+            }
+            MXMLVF2JSDescriptorSpecifier overrides = new MXMLVF2JSDescriptorSpecifier();
+            overrides.isProperty = true;
+            overrides.hasArray = true;
+            overrides.id = id;
+            overrides.name = "overrides";
+            overrides.parent = currentInstance;
+            currentInstance.propertySpecifiers.add(overrides);
+            moveDown(false, null, overrides);
+
+            IMXMLClassDefinitionNode classDefinitionNode = stateNode.getClassDefinitionNode();
+            List<IMXMLNode> snodes = classDefinitionNode.getNodesDependentOnState(stateNode.getStateName());
+            if (snodes != null)
+            {
+                for (int i=snodes.size()-1; i>=0; --i)
+                {
+                    IMXMLNode inode = snodes.get(i);
+                    if (inode.getNodeID() == ASTNodeID.MXMLInstanceID)
+                    {
+                        emitInstanceOverride((IMXMLInstanceNode)inode);
+                    }
+                }
+                // Next process the non-instance overrides dependent on this state.
+                // Each one will generate code to push an IOverride instance.
+                for (IMXMLNode anode : snodes)
+                {
+                    switch (anode.getNodeID())
+                    {
+                        case MXMLPropertySpecifierID:
+                        {
+                            emitPropertyOverride((IMXMLPropertySpecifierNode)anode);
+                            break;
+                        }
+                        case MXMLStyleSpecifierID:
+                        {
+                            if (node instanceof IMXMLStyleSpecifierNode)
+                            {
+                                emitStyleOverride((IMXMLStyleSpecifierNode)node);
+                            }
+                            break;
+                        }
+                        case MXMLEventSpecifierID:
+                        {
+                            emitEventOverride((IMXMLEventSpecifierNode)node);
+                            break;
+                        }
+                        default:
+                        {
+                            break;
+                        }
+                    }
+                }
+            }
+            
+            moveUp(false, false);
+        }
+
+        IMXMLEventSpecifierNode[] enodes = node.getEventSpecifierNodes();
+        if (enodes != null)
+        {
+            moveDown(false, currentInstance, null);
+
+            for (IMXMLEventSpecifierNode enode : enodes)
+            {
+                getMXMLWalker().walk(enode); // Event Specifier
+            }
+
+            moveUp(false, true);
+        }
+    }
+
+    public void emitPropertyOverride(IMXMLPropertySpecifierNode propertyNode)
+    {
+        FlexProject project = (FlexProject) getMXMLWalker().getProject();
+        Name propertyOverride = project.getPropertyOverrideClassName();
+        emitPropertyOrStyleOverride(propertyOverride, propertyNode);
+    }
+    
+    /**
+     * Generates instructions in the current context
+     * to create an instance of mx.states.SetStyle
+     * with its <code>target</code>, <code>name</code>,
+     * and <code>value</code> properties set.
+     */
+    void emitStyleOverride(IMXMLStyleSpecifierNode styleNode)
+    {
+        FlexProject project = (FlexProject) getMXMLWalker().getProject();
+        Name styleOverride = project.getStyleOverrideClassName();
+        emitPropertyOrStyleOverride(styleOverride, styleNode);
+    }
+    
+    void emitPropertyOrStyleOverride(Name overrideName, IMXMLPropertySpecifierNode propertyOrStyleNode)
+    {
+        MXMLVF2JSDescriptorSpecifier currentInstance = getCurrentDescriptor("ps");
+        IASNode parentNode = propertyOrStyleNode.getParent();
+        String id = parentNode instanceof IMXMLInstanceNode ?
+                    ((IMXMLInstanceNode)parentNode).getEffectiveID() :
+                    "";
+        
+        String name = propertyOrStyleNode.getName();        
+        
+        IMXMLInstanceNode propertyOrStyleValueNode = propertyOrStyleNode.getInstanceNode();
+        
+        MXMLVF2JSDescriptorSpecifier setProp = new MXMLVF2JSDescriptorSpecifier();
+        setProp.isProperty = false;
+        setProp.name = nameToString(overrideName);
+        setProp.parent = currentInstance;
+        currentInstance.propertySpecifiers.add(setProp);
+            // Set its 'target' property to the id of the object
+            // whose property or style this override will set.
+        MXMLVF2JSDescriptorSpecifier target = new MXMLVF2JSDescriptorSpecifier();
+        target.isProperty = true;
+        target.name = "target";
+        target.parent = setProp;
+        target.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + id + ASEmitterTokens.SINGLE_QUOTE.getToken();
+        setProp.propertySpecifiers.add(target);
+
+            // Set its 'name' property to the name of the property or style.
+        MXMLVF2JSDescriptorSpecifier pname = new MXMLVF2JSDescriptorSpecifier();
+        pname.isProperty = true;
+        pname.name = "name";
+        pname.parent = setProp;
+        pname.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + name + ASEmitterTokens.SINGLE_QUOTE.getToken();
+        setProp.propertySpecifiers.add(pname);
+
+            // Set its 'value' property to the value of the property or style.
+        MXMLVF2JSDescriptorSpecifier value = new MXMLVF2JSDescriptorSpecifier();
+        value.isProperty = true;
+        value.name = "value";
+        value.parent = setProp;
+        setProp.propertySpecifiers.add(value);
+        moveDown(false, null, value);
+        getMXMLWalker().walk(propertyOrStyleValueNode); // instance node
+        moveUp(false, false);
+    }
+        
+    /**
+     * Generates instructions in the current context
+     * to create an instance of mx.states.SetEventHandler
+     * with its <code>target</code>, <code>name</code>,
+     * and <code>handlerFunction</code> properties set.
+     */
+    void emitEventOverride(IMXMLEventSpecifierNode eventNode)
+    {
+        MXMLVF2JSDescriptorSpecifier currentInstance = getCurrentDescriptor("ps");
+        FlexProject project = (FlexProject) getMXMLWalker().getProject();
+        Name eventOverride = project.getEventOverrideClassName();
+        
+        IASNode parentNode = eventNode.getParent();
+        String id = parentNode instanceof IMXMLInstanceNode ?
+                    ((IMXMLInstanceNode)parentNode).getEffectiveID() :
+                    "";
+        
+        String name = eventNode.getName();
+        
+        MXMLDocumentNode doc = (MXMLDocumentNode)eventNode.getAncestorOfType(MXMLDocumentNode.class);
+
+        Name eventHandler = doc.cdp.getEventHandlerName(eventNode);
+
+        MXMLVF2JSDescriptorSpecifier setEvent = new MXMLVF2JSDescriptorSpecifier();
+        setEvent.isProperty = true;
+        setEvent.name = nameToString(eventOverride);
+        setEvent.parent = currentInstance;
+        currentInstance.propertySpecifiers.add(setEvent);
+        // Set its 'target' property to the id of the object
+        // whose event this override will set.
+        MXMLVF2JSDescriptorSpecifier target = new MXMLVF2JSDescriptorSpecifier();
+        target.isProperty = true;
+        target.name = "target";
+        target.parent = setEvent;
+        target.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + id + ASEmitterTokens.SINGLE_QUOTE.getToken();
+        setEvent.propertySpecifiers.add(target);
+
+        // Set its 'name' property to the name of the property or style.
+        MXMLVF2JSDescriptorSpecifier pname = new MXMLVF2JSDescriptorSpecifier();
+        pname.isProperty = true;
+        pname.name = "name";
+        pname.parent = setEvent;
+        pname.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + name + ASEmitterTokens.SINGLE_QUOTE.getToken();
+        setEvent.propertySpecifiers.add(pname);
+        
+        // Set its 'handlerFunction' property to the autogenerated event handler.
+        MXMLVF2JSDescriptorSpecifier handler = new MXMLVF2JSDescriptorSpecifier();
+        handler.isProperty = false;
+        handler.name = "handlerFunction";
+        handler.parent = setEvent;
+        handler.value = eventHandler.toString();
+        setEvent.propertySpecifiers.add(handler);
+        
+    }
+
+    public void emitInstanceOverride(IMXMLInstanceNode instanceNode)
+    {
+        inStatesOverride = true;
+        
+        MXMLVF2JSDescriptorSpecifier currentInstance = getCurrentDescriptor("ps");
+        FlexProject project = (FlexProject) getMXMLWalker().getProject();
+        Name instanceOverrideName = project.getInstanceOverrideClassName();
+
+        MXMLVF2JSDescriptorSpecifier addItems = new MXMLVF2JSDescriptorSpecifier();
+        addItems.isProperty = false;
+        addItems.name = nameToString(instanceOverrideName);
+        addItems.parent = currentInstance;
+        currentInstance.propertySpecifiers.add(addItems);
+        MXMLVF2JSDescriptorSpecifier itemsDesc = new MXMLVF2JSDescriptorSpecifier();
+        itemsDesc.isProperty = true;
+        itemsDesc.hasArray = true;
+        itemsDesc.name = "itemsDescriptor";
+        itemsDesc.parent = addItems;
+        addItems.propertySpecifiers.add(itemsDesc);
+        boolean oldInMXMLContent = inMXMLContent;
+        moveDown(false, null, itemsDesc);
+        inMXMLContent = true;
+        getMXMLWalker().walk(instanceNode); // instance node
+        inMXMLContent = oldInMXMLContent;
+        moveUp(false, false);
+        
+        //-----------------------------------------------------------------------------
+        // Second property set: maybe set destination and propertyName
+        
+        // get the property specifier node for the property the instanceNode represents
+        IMXMLPropertySpecifierNode propertySpecifier = (IMXMLPropertySpecifierNode) 
+            instanceNode.getAncestorOfType( IMXMLPropertySpecifierNode.class);
+    
+        if (propertySpecifier == null)
+        {
+           assert false;        // I think this indicates an invalid tree...
+        }
+        else
+        {
+            // Check the parent - if it's an instance then we want to use these
+            // nodes to get our property values from. If not, then it's the root
+            // and we don't need to specify destination
+            
+            IASNode parent = propertySpecifier.getParent();
+            if (parent instanceof IMXMLInstanceNode)
+            {
+               IMXMLInstanceNode parentInstance = (IMXMLInstanceNode)parent;
+               String parentId = parentInstance.getEffectiveID();
+               assert parentId != null;
+               String propName = propertySpecifier.getName();
+               
+               MXMLVF2JSDescriptorSpecifier dest = new MXMLVF2JSDescriptorSpecifier();
+               dest.isProperty = true;
+               dest.name = "destination";
+               dest.parent = addItems;
+               dest.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + parentId + ASEmitterTokens.SINGLE_QUOTE.getToken();
+               addItems.propertySpecifiers.add(dest);
+
+               MXMLVF2JSDescriptorSpecifier prop = new MXMLVF2JSDescriptorSpecifier();
+               prop.isProperty = true;
+               prop.name = "propertyName";
+               prop.parent = addItems;
+               prop.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + propName + ASEmitterTokens.SINGLE_QUOTE.getToken();
+               addItems.propertySpecifiers.add(prop);
+            }
+        }  
+        
+        //---------------------------------------------------------------
+        // Third property set: position and relativeTo
+        String positionPropertyValue = null;
+        String relativeToPropertyValue = null;
+       
+        // look to see if we have any sibling nodes that are not state dependent
+        // that come BEFORE us
+        IASNode instanceParent = instanceNode.getParent();
+        IASNode prevStatelessSibling=null;
+        for (int i=0; i< instanceParent.getChildCount(); ++i)
+        {
+            IASNode sib = instanceParent.getChild(i);
+            assert sib instanceof IMXMLInstanceNode;    // surely our siblings are also instances?
+           
+            // stop looking for previous nodes when we find ourself
+            if (sib == instanceNode)
+                break;
+
+            if (!isStateDependent(sib))
+            {
+                prevStatelessSibling = sib;
+            }
+        }
+        
+        if (prevStatelessSibling == null) {
+            positionPropertyValue = "first";        // TODO: these should be named constants
+        }
+        else {
+            positionPropertyValue = "after";
+            relativeToPropertyValue = ((IMXMLInstanceNode)prevStatelessSibling).getEffectiveID();
+        }
+       
+        MXMLVF2JSDescriptorSpecifier pos = new MXMLVF2JSDescriptorSpecifier();
+        pos.isProperty = true;
+        pos.name = "position";
+        pos.parent = addItems;
+        pos.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + positionPropertyValue + ASEmitterTokens.SINGLE_QUOTE.getToken();
+        addItems.propertySpecifiers.add(pos);
+        
+        if (relativeToPropertyValue != null)
+        {
+            MXMLVF2JSDescriptorSpecifier rel = new MXMLVF2JSDescriptorSpecifier();
+            rel.isProperty = true;
+            rel.name = "relativeTo";
+            rel.parent = addItems;
+            rel.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + relativeToPropertyValue + ASEmitterTokens.SINGLE_QUOTE.getToken();
+            addItems.propertySpecifiers.add(rel);
+        }
+        
+        inStatesOverride = false;
+    }
+
+    private String nameToString(Name name)
+    {
+        String s = "";
+        Namespace ns = name.getSingleQualifier();
+        s = ns.getName() + ASEmitterTokens.MEMBER_ACCESS.getToken() + name.getBaseName();
+        return s;
+    }
+    /**
+     * Determines whether a node is state-dependent.
+     * TODO: we should move to IMXMLNode
+     */
+    protected boolean isStateDependent(IASNode node)
+    {
+        if (node instanceof IMXMLSpecifierNode)
+        {
+            String suffix = ((IMXMLSpecifierNode)node).getSuffix();
+            return suffix != null && suffix.length() > 0;
+        }
+        else if (isStateDependentInstance(node))
+            return true;
+        return false;
+    }
+    
+    /**
+     * Determines whether the geven node is an instance node, as is state dependent
+     */
+    protected boolean isStateDependentInstance(IASNode node)
+    {
+        if (node instanceof IMXMLInstanceNode)
+        {
+            String[] includeIn = ((IMXMLInstanceNode)node).getIncludeIn();
+            String[] excludeFrom = ((IMXMLInstanceNode)node).getExcludeFrom();
+            return includeIn != null || excludeFrom != null;
+        }
+        return false;
+    }
+    
+    /**
+     * Is a give node a "databinding node"?
+     */
+    public static boolean isDataBindingNode(IASNode node)
+    {
+        return node instanceof IMXMLDataBindingNode;
+    }
+    
+    protected static boolean isDataboundProp(IMXMLPropertySpecifierNode propertyNode)
+    {
+        boolean ret = propertyNode.getChildCount() > 0 && isDataBindingNode(propertyNode.getInstanceNode());
+        
+        // Sanity check that we based our conclusion about databinding on the correct node.
+        // (code assumes only one child if databinding)
+        int n = propertyNode.getChildCount();
+        for (int i = 0; i < n; i++)
+        {
+            boolean db = isDataBindingNode(propertyNode.getChild(i));
+            assert db == ret;
+        }
+        
+        return ret;
+    }
+
+    @Override
+    public void emitPropertySpecifier(IMXMLPropertySpecifierNode node)
+    {
+        if (isDataboundProp(node))
+            return;
+        
+        IDefinition cdef = node.getDefinition();
+
+        IASNode cnode = node.getChild(0);
+
+        MXMLVF2JSDescriptorSpecifier currentInstance = getCurrentDescriptor("i");
+
+        MXMLVF2JSDescriptorSpecifier currentPropertySpecifier = new MXMLVF2JSDescriptorSpecifier();
+        currentPropertySpecifier.isProperty = true;
+        currentPropertySpecifier.name = cdef.getQualifiedName();
+        currentPropertySpecifier.parent = currentInstance;
+
+        boolean oldInMXMLContent = inMXMLContent;
+        if (currentPropertySpecifier.name.equals("mxmlContent"))
+            inMXMLContent = true;
+        
+        if (currentInstance != null)
+            currentInstance.propertySpecifiers.add(currentPropertySpecifier);
+        else if (inMXMLContent)
+            descriptorTree.add(currentPropertySpecifier);
+        else
+        {
+            currentPropertySpecifier.parent = propertiesTree;
+            propertiesTree.propertySpecifiers.add(currentPropertySpecifier);
+        }
+
+        boolean bypass = cnode != null && cnode instanceof IMXMLArrayNode;
+
+        currentPropertySpecifier.hasArray = bypass;
+
+        moveDown(bypass, null, currentPropertySpecifier);
+
+        getMXMLWalker().walk(cnode); // Array or Instance
+
+        moveUp(bypass, false);
+        
+        inMXMLContent = oldInMXMLContent;
+    }
+
+    @Override
+    public void emitScript(IMXMLScriptNode node)
+    {
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+                .getASEmitter();
+
+        String nl = ASEmitterTokens.NEW_LINE.getToken();
+
+        StringBuilder sb = null;
+        MXMLScriptSpecifier scriptSpecifier = null;
+
+        int len = node.getChildCount();
+        if (len > 0)
+        {
+            for (int i = 0; i < len; i++)
+            {
+                IASNode cnode = node.getChild(i);
+
+                if (!(cnode instanceof IImportNode))
+                {
+                    sb = new StringBuilder();
+                    scriptSpecifier = new MXMLScriptSpecifier();
+
+                    sb.append(asEmitter.stringifyNode(cnode));
+
+                    sb.append(ASEmitterTokens.SEMICOLON.getToken());
+
+                    if (i == len - 1)
+                        indentPop();
+
+                    sb.append(nl);
+                    sb.append(nl);
+
+                    scriptSpecifier.fragment = sb.toString();
+
+                    scripts.add(scriptSpecifier);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void emitStyleSpecifier(IMXMLStyleSpecifierNode node)
+    {
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitArray(IMXMLArrayNode node)
+    {
+        moveDown(false, null, null);
+
+        final int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            getMXMLWalker().walk(node.getChild(i)); // Instance
+        }
+
+        moveUp(false, false);
+    }
+
+    @Override
+    public void emitString(IMXMLStringNode node)
+    {
+        getCurrentDescriptor("ps").valueNeedsQuotes = true;
+
+        emitAttributeValue(node);
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitLiteral(IMXMLLiteralNode node)
+    {
+        MXMLVF2JSDescriptorSpecifier ps = getCurrentDescriptor("ps");
+        ps.value = "";
+
+        if (ps.valueNeedsQuotes)
+            ps.value += ASEmitterTokens.SINGLE_QUOTE.getToken();
+
+        String s = node.getValue().toString();
+        if (ps.valueNeedsQuotes)
+        {
+            // escape all single quotes found within the string
+            s = s.replace(ASEmitterTokens.SINGLE_QUOTE.getToken(), 
+                    "\\" + ASEmitterTokens.SINGLE_QUOTE.getToken());
+        }
+        ps.value += s;
+        
+        if (ps.valueNeedsQuotes)
+            ps.value += ASEmitterTokens.SINGLE_QUOTE.getToken();
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitFactory(IMXMLFactoryNode node)
+    {
+        MXMLVF2JSDescriptorSpecifier ps = getCurrentDescriptor("ps");
+        ps.value = "new mx.core.ClassFactory(";
+
+        IASNode cnode = node.getChild(0);
+        if (cnode instanceof IMXMLClassNode)
+        {
+            ps.value += ((IMXMLClassNode)cnode).getValue(getMXMLWalker().getProject()).getQualifiedName();
+        }
+        ps.value += ")";
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitComponent(IMXMLComponentNode node)
+    {
+        MXMLVF2JSDescriptorSpecifier ps = getCurrentDescriptor("ps");
+        ps.value = "new mx.core.ClassFactory(";
+
+        ps.value += node.getName();
+        ps.value += ")";
+        
+        setBufferWrite(true);
+        emitSubDocument(node);
+        subDocuments.append(getBuilder().toString());
+        getBuilder().setLength(0);
+        setBufferWrite(false);
+    }
+
+    //--------------------------------------------------------------------------
+    //    JS output
+    //--------------------------------------------------------------------------
+    
+    private void emitHeader(IMXMLDocumentNode node)
+    {
+        String cname = node.getFileNode().getName();
+        String bcname = node.getBaseClassName();
+
+        writeNewline("/**");
+        writeNewline(" * " + cname);
+        writeNewline(" *");
+        writeNewline(" * @fileoverview");
+        writeNewline(" *");
+        writeNewline(" * @suppress {checkTypes}");
+        writeNewline(" */");
+        writeNewline();
+        
+        emitHeaderLine(cname, true); // provide
+        for (String subDocumentName : subDocumentNames)
+            emitHeaderLine(subDocumentName, true);
+        writeNewline();
+        emitHeaderLine(bcname);
+        ArrayList<String> writtenInstances = new ArrayList<String>();
+        writtenInstances.add(cname); // make sure we don't add ourselves
+        writtenInstances.add(bcname); // make sure we don't add the baseclass twice
+        for (MXMLVF2JSDescriptorSpecifier instance : instances)
+        {
+            String name = instance.name;
+            if (writtenInstances.indexOf(name) == -1)
+            {
+                emitHeaderLine(name);
+                writtenInstances.add(name);
+            }
+        }
+        FlexJSProject project = (FlexJSProject) getMXMLWalker().getProject();
+        ASProjectScope projectScope = (ASProjectScope) project.getScope();
+        IDefinition cdef = node.getDefinition();
+        ICompilationUnit cu = projectScope
+                .getCompilationUnitForDefinition(cdef);
+        ArrayList<String> deps = project.getRequires(cu);
+
+        if (deps != null)
+        {
+            for (String imp : deps)
+            {
+                if (imp.indexOf(JSGoogEmitterTokens.AS3.getToken()) != -1)
+                    continue;
+    
+                if (imp.equals(cname))
+                    continue;
+    
+                if (imp.equals("mx.binding.Binding"))
+                    continue;
+                if (imp.equals("mx.binding.BindingManager"))
+                    continue;
+                if (imp.equals("mx.binding.FunctionReturnWatcher"))
+                    continue;
+                if (imp.equals("mx.binding.PropertyWatcher"))
+                    continue;
+                if (imp.equals("mx.binding.StaticPropertyWatcher"))
+                    continue;
+                if (imp.equals("mx.binding.XMLWatcher"))
+                    continue;
+                if (imp.equals("mx.events.PropertyChangeEvent"))
+                    continue;
+                if (imp.equals("mx.events.PropertyChangeEventKind"))
+                    continue;
+                if (imp.equals("mx.core.DeferredInstanceFromFunction"))
+                    continue;
+    
+                if (NativeUtils.isNative(imp))
+                    continue;
+    
+                if (writtenInstances.indexOf(imp) == -1)
+                {
+                    emitHeaderLine(imp);
+                    writtenInstances.add(imp);
+                }
+            }
+        }
+
+        // erikdebruin: Add missing language feature support, like the 'is' and 
+        //              'as' operators. We don't need to worry about requiring
+        //              this in every project: ADVANCED_OPTIMISATIONS will NOT
+        //              include any of the code if it is not used in the project.
+        if (project.mainCU != null &&
+                cu.getName().equals(project.mainCU.getName()))
+        {
+            emitHeaderLine(JSFlexJSEmitterTokens.LANGUAGE_QNAME.getToken());
+        }
+
+        writeNewline();
+        writeNewline();
+    }
+
+    private void emitHeaderLine(String qname)
+    {
+        emitHeaderLine(qname, false);
+    }
+
+    private void emitHeaderLine(String qname, boolean isProvide)
+    {
+        write((isProvide) ? JSGoogEmitterTokens.GOOG_PROVIDE
+                : JSGoogEmitterTokens.GOOG_REQUIRE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(qname);
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline(ASEmitterTokens.SEMICOLON);
+    }
+
+    //--------------------------------------------------------------------------
+    //    Utils
+    //--------------------------------------------------------------------------
+
+    @Override
+    protected void emitAttributeValue(IASNode node)
+    {
+        IMXMLLiteralNode cnode = (IMXMLLiteralNode) node.getChild(0);
+
+        if (cnode.getValue() != null)
+            getMXMLWalker().walk((IASNode) cnode); // Literal
+    }
+
+    private MXMLVF2JSDescriptorSpecifier getCurrentDescriptor(String type)
+    {
+        MXMLVF2JSDescriptorSpecifier currentDescriptor = null;
+
+        int index;
+
+        if (type.equals("i"))
+        {
+            index = currentInstances.size() - 1;
+            if (index > -1)
+                currentDescriptor = currentInstances.get(index);
+        }
+        else
+        {
+            index = currentPropertySpecifiers.size() - 1;
+            if (index > -1)
+                currentDescriptor = currentPropertySpecifiers.get(index);
+        }
+
+        return currentDescriptor;
+    }
+
+    protected void moveDown(boolean byPass,
+            MXMLVF2JSDescriptorSpecifier currentInstance,
+            MXMLVF2JSDescriptorSpecifier currentPropertySpecifier)
+    {
+        if (!byPass)
+        {
+            if (currentInstance != null)
+                currentInstances.add(currentInstance);
+        }
+
+        if (currentPropertySpecifier != null)
+            currentPropertySpecifiers.add(currentPropertySpecifier);
+    }
+
+    protected void moveUp(boolean byPass, boolean isInstance)
+    {
+        if (!byPass)
+        {
+            int index;
+
+            if (isInstance)
+            {
+                index = currentInstances.size() - 1;
+                if (index > -1)
+                    currentInstances.remove(index);
+            }
+            else
+            {
+                index = currentPropertySpecifiers.size() - 1;
+                if (index > -1)
+                    currentPropertySpecifiers.remove(index);
+            }
+        }
+    }
+
+}


[45/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/NamespaceResolutionPass.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/NamespaceResolutionPass.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/NamespaceResolutionPass.java
new file mode 100644
index 0000000..8f5cd95
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/NamespaceResolutionPass.java
@@ -0,0 +1,120 @@
+/*
+ *
+ *  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.internal.codegen.externals.pass;
+
+import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;
+
+import com.google.javascript.jscomp.AbstractCompiler;
+import com.google.javascript.jscomp.NodeTraversal;
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.Node;
+
+public class NamespaceResolutionPass extends AbstractCompilerPass
+{
+
+    public NamespaceResolutionPass(ReferenceModel model,
+            AbstractCompiler compiler)
+    {
+        super(model, compiler);
+    }
+
+    @Override
+    public boolean shouldTraverse(NodeTraversal nodeTraversal, Node n,
+            Node parent)
+    {
+        return n.isBlock() || n.isScript();
+    }
+
+    @Override
+    public void visit(NodeTraversal t, Node n, Node parent)
+    {
+        for (Node child : n.children())
+        {
+            //System.out.println("-------------------------------------");
+            //System.out.println(child.toStringTree());
+            JSDocInfo comment = null;
+
+            if (child.isVar())
+            {
+                Node name = child.getFirstChild();
+                comment = child.getJSDocInfo();
+                if (comment != null && comment.isConstant())
+                {
+                    if (name.getFirstChild() != null
+                            && name.getFirstChild().isObjectLit())
+                    {
+                        // * @const
+                        // var chrome = {}:
+                        // print(child);
+                        model.addClass(child, name.getQualifiedName());
+                    }
+                }
+                else if (comment != null && comment.hasEnumParameterType())
+                {
+                    model.addEnum(child, name.getQualifiedName());
+                }
+            }
+            else if (child.isExprResult())
+            {
+                Node first = child.getFirstChild();
+                comment = first.getJSDocInfo();
+                if (first.isQualifiedName())
+                {
+                    //print(name.getQualifiedName());
+                }
+                else if (first.isAssign())
+                {
+                    comment = first.getJSDocInfo();
+
+                    Node firstAssignChild = first.getFirstChild();
+                    Node lastAssignChild = first.getLastChild();
+                    if (lastAssignChild.isObjectLit())
+                    {
+                        if (comment.getType() != null)
+                        {
+                            //print("Class "
+                            //        + firstAssignChild.getQualifiedName());
+                            model.addClass(first,
+                                    firstAssignChild.getQualifiedName());
+                        }
+                        else if (comment.isConstant())
+                        {
+                            //print("Package "
+                            //        + firstAssignChild.getQualifiedName());
+                            model.addClass(first,
+                                    firstAssignChild.getQualifiedName());
+                        }
+                        else if (comment.hasEnumParameterType())
+                        {
+                            err(first);
+                            model.addEnum(first,
+                                    firstAssignChild.getQualifiedName());
+                        }
+                        else
+                        {
+                            err("Unhandled expression result:");
+                            err(child);
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/ReferenceCompiler.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/ReferenceCompiler.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/ReferenceCompiler.java
new file mode 100644
index 0000000..dc83314
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/ReferenceCompiler.java
@@ -0,0 +1,135 @@
+/*
+ *
+ *  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.internal.codegen.externals.pass;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;
+
+import com.google.common.collect.ImmutableList;
+import com.google.javascript.jscomp.*;
+import com.google.javascript.jscomp.Compiler;
+
+public class ReferenceCompiler
+{
+    private static final List<SourceFile> EMPTY_EXTERNS = ImmutableList.of(SourceFile.fromCode("externs", ""));
+
+    private ReferenceModel model;
+
+    private Compiler jscompiler;
+    private JXCompilerOptions options;
+
+    public Compiler getJSCompiler()
+    {
+        return jscompiler;
+    }
+
+    public ReferenceCompiler(ReferenceModel model)
+    {
+        this.model = model;
+
+        initializeCompiler();
+    }
+    
+    String[] asdocTags = new String[] {"chainable", 
+    		"readOnly", "uses", "main"};
+
+    private void initializeCompiler()
+    {
+        jscompiler = new Compiler();
+
+        options = new JXCompilerOptions();
+        //options.setLanguageIn(LanguageMode.ECMASCRIPT6_TYPED);
+        //options.setLanguageOut(LanguageMode.ECMASCRIPT6_TYPED);
+        options.setPreserveTypeAnnotations(true);
+        options.setPrettyPrint(true);
+        options.setLineLengthThreshold(80);
+        options.setPreferSingleQuotes(true);
+        options.setIdeMode(true);
+        options.setParseJsDocDocumentation(true);
+        options.setExternExports(false);
+        options.setExtraAnnotationNames(Arrays.asList(asdocTags));
+
+        options.addCustomPass(CustomPassExecutionTime.BEFORE_OPTIMIZATIONS, new NamespaceResolutionPass(model,
+                jscompiler));
+        options.addCustomPass(CustomPassExecutionTime.BEFORE_OPTIMIZATIONS, new ResolvePackagesPass(model, jscompiler));
+
+        options.addCustomPass(CustomPassExecutionTime.BEFORE_OPTIMIZATIONS, new CollectTypesPass(model, jscompiler));
+        options.addCustomPass(CustomPassExecutionTime.BEFORE_OPTIMIZATIONS, new AddMemberPass(model, jscompiler));
+
+        options.addCustomPass(CustomPassExecutionTime.BEFORE_OPTIMIZATIONS, new CollectImportsPass(model, jscompiler));
+
+        //compiler.setErrorManager(testErrorManager);
+        jscompiler.initOptions(options);
+
+        model.setJSCompiler(jscompiler);
+    }
+
+    public Result compile() throws IOException
+    {
+        List<SourceFile> sources = new ArrayList<SourceFile>();
+        for (ExternalFile externalFile : model.getConfiguration().getExternals())
+        {
+            String name = externalFile.getName();
+            String source = FileUtils.readFileToString(externalFile.getFile());
+            sources.add(SourceFile.fromCode("[" + name + "]", source));
+        }
+        for (ExternalFile externalFile : model.getConfiguration().getExternalExterns())
+        {
+            String name = externalFile.getName();
+            String source = FileUtils.readFileToString(externalFile.getFile());
+            sources.add(SourceFile.fromCode("[" + name + "]", source));
+        }
+
+        Result result = jscompiler.compile(EMPTY_EXTERNS, sources, options);
+        if (!result.success)
+        {
+
+        }
+
+        return result;
+    }
+
+    public static class ExternalFile
+    {
+        private File file;
+
+        public File getFile()
+        {
+            return file;
+        }
+
+        public ExternalFile(File file)
+        {
+            this.file = file;
+        }
+
+        public String getName()
+        {
+            return FilenameUtils.getBaseName(getFile().getAbsolutePath());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/ResolvePackagesPass.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/ResolvePackagesPass.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/ResolvePackagesPass.java
new file mode 100644
index 0000000..b446d8c
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/ResolvePackagesPass.java
@@ -0,0 +1,100 @@
+/*
+ *
+ *  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.internal.codegen.externals.pass;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.FieldReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;
+
+import com.google.javascript.jscomp.AbstractCompiler;
+import com.google.javascript.jscomp.NodeTraversal;
+import com.google.javascript.rhino.Node;
+
+public class ResolvePackagesPass extends AbstractCompilerPass
+{
+    public ResolvePackagesPass(ReferenceModel model, AbstractCompiler compiler)
+    {
+        super(model, compiler);
+    }
+
+    @SuppressWarnings("unused")
+    @Override
+    public void process(Node externs, Node root)
+    {
+        log(">>>-----------------------------");
+        for (ClassReference reference : model.getClasses())
+        {
+            if (reference.isQualifiedName())
+            {
+                reference.setIsNamespace(true);
+            }
+            log(reference.getQualifiedName());
+            List<ClassReference> children = getFirstChildren(reference);
+
+        }
+        log("<<<-----------------------------");
+    }
+
+    @SuppressWarnings("unused")
+    private List<ClassReference> getFirstChildren(ClassReference reference)
+    {
+        ArrayList<ClassReference> result = new ArrayList<ClassReference>();
+        String qualifiedName = reference.getQualifiedName();
+        String[] split = qualifiedName.split("\\.");
+
+        for (ClassReference child : model.getClasses())
+        {
+            String baseName = child.getBaseName();
+            String testName = qualifiedName + "." + baseName;
+            if (testName.equals(child.getQualifiedName()))
+            {
+                FieldReference field;
+                if (!reference.isQualifiedName())
+                {
+                    log("   Add field: public static var " + baseName);
+                    field = reference.addField(child.getNode(), baseName, child.getNode().getJSDocInfo(), true);
+                }
+                else
+                {
+                    log("   Add field: public var " + baseName);
+                    field = reference.addField(child.getNode(), baseName, child.getNode().getJSDocInfo(), false);
+                }
+
+                field.setOverrideStringType(child.getQualifiedName());
+            }
+        }
+
+        return result;
+    }
+
+    @Override
+    public boolean shouldTraverse(NodeTraversal arg0, Node arg1, Node arg2)
+    {
+        return false;
+    }
+
+    @Override
+    public void visit(NodeTraversal arg0, Node arg1, Node arg2)
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/BaseReference.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/BaseReference.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/BaseReference.java
new file mode 100644
index 0000000..b74167e
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/BaseReference.java
@@ -0,0 +1,297 @@
+/*
+ *
+ *  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.internal.codegen.externals.reference;
+
+import java.io.File;
+import java.util.Set;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration.ExcludedMember;
+
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.JSDocInfo.Marker;
+import com.google.javascript.rhino.JSDocInfo.StringPosition;
+import com.google.javascript.rhino.JSDocInfo.TypePosition;
+import com.google.javascript.rhino.JSTypeExpression;
+import com.google.javascript.rhino.Node;
+
+public abstract class BaseReference
+{
+    private String qualifiedName;
+
+    protected JSDocInfo comment;
+
+    private File currentFile;
+
+    private Node node;
+
+    private ReferenceModel model;
+
+    protected boolean outputJS;
+
+    protected String indent = "    ";
+
+    public File getCurrentFile()
+    {
+        return currentFile;
+    }
+
+    public void setCurrentFile(File currentFile)
+    {
+        this.currentFile = currentFile;
+    }
+
+    public String getBaseName()
+    {
+        return qualifiedName.substring(qualifiedName.lastIndexOf('.') + 1);
+    }
+
+    public String getPackageName()
+    {
+        int end = qualifiedName.lastIndexOf('.');
+        if (end == -1)
+            return "";
+        return qualifiedName.substring(0, end);
+    }
+
+    public String getQualifiedName()
+    {
+        return qualifiedName;
+    }
+
+    public final boolean isQualifiedName()
+    {
+        return qualifiedName.indexOf('.') != -1;
+    }
+
+    public Node getNode()
+    {
+        return node;
+    }
+
+    public void setNode(Node node)
+    {
+        this.node = node;
+    }
+
+    public void setComment(JSDocInfo comment)
+    {
+        this.comment = comment;
+    }
+
+    public JSDocInfo getComment()
+    {
+        return comment;
+    }
+
+    public ReferenceModel getModel()
+    {
+        return model;
+    }
+
+    public BaseReference(ReferenceModel model, Node node, String qualifiedName, JSDocInfo comment)
+    {
+        this.model = model;
+        this.node = node;
+        this.qualifiedName = qualifiedName;
+        this.comment = comment;
+        outputJS = model.getConfiguration().getJsRoot() != null;
+    }
+
+    public ExcludedMember isExcluded()
+    {
+        return null;
+    }
+
+    public abstract void emit(StringBuilder sb);
+
+    public void emitComment(StringBuilder sb)
+    {
+        sb.append(indent);
+        sb.append("/**\n");
+        emitCommentBody(sb);
+        sb.append(indent);
+        sb.append(" */\n");
+    }
+
+    protected void emitCommentBody(StringBuilder sb)
+    {
+        emitBlockDescription(sb);
+        emitSee(sb);
+        emitSeeSourceFileName(sb);
+    }
+
+    protected void emitBlockDescription(StringBuilder sb)
+    {
+        String blockDescription = getComment().getBlockDescription();
+        if (blockDescription != null)
+        {
+            sb.append(indent);
+            sb.append(" * ");
+            sb.append(blockDescription.replaceAll("\\n", "\n" + indent + " * "));
+            sb.append("\n ").append(indent).append("*\n");
+        }
+    }
+
+    protected void emitSee(StringBuilder sb)
+    {
+        for (Marker marker : getComment().getMarkers())
+        {
+            StringPosition name = marker.getAnnotation();
+            TypePosition typePosition = marker.getType();
+            StringPosition descriptionPosition = marker.getDescription();
+            StringBuilder desc = new StringBuilder();
+
+            // XXX Figure out how to toString() a TypePosition Node for markers
+            // XXX Figure out how to get a @param name form the Marker
+            if (!name.getItem().equals("see"))
+                continue;
+
+            desc.append(name.getItem());
+            desc.append(" ");
+
+            if (typePosition != null)
+            {
+                //desc.append(typePosition.getItem().getString());
+                //desc.append(" ");
+            }
+
+            if (descriptionPosition != null)
+            {
+                desc.append(descriptionPosition.getItem());
+                desc.append(" ");
+            }
+
+            sb.append(indent);
+            sb.append(" * @").append(desc.toString()).append("\n");
+        }
+    }
+
+    protected void emitSeeSourceFileName(StringBuilder sb)
+    {
+        sb.append(indent);
+        sb.append(" * @see ").append(getNode().getSourceFileName()).append("\n");
+    }
+
+    protected void emitFunctionCommentBody(StringBuilder sb)
+    {
+        emitBlockDescription(sb);
+        emitParams(sb);
+        emitSee(sb);
+        emitSeeSourceFileName(sb);
+        emitReturns(sb);
+    }
+
+    protected String mapBackToJS(String t)
+    {
+    	// remove all whitespace
+    	t = t.replace(" ", "");
+    	if (t.contains("{String}")) 
+    		t = t.replace("{String}", "{string}");
+    	if (t.contains("{Number}")) 
+    		t = t.replace("{Number}", "{number}");
+    	if (t.contains("{Boolean}")) 
+    		t = t.replace("{Boolean}", "{boolean}");
+    	if (t.contains("{object")) 
+    		t = t.replace("{object}", "{Object}");
+    	if (t.contains("(String|")) 
+    		t = t.replace("(String|", "(string|");
+    	if (t.contains("(Number|")) 
+    		t = t.replace("(Number|", "(number|");
+    	if (t.contains("(Boolean|")) 
+    		t = t.replace("(Boolean|", "(boolean|");
+    	if (t.contains("(object|")) 
+    		t = t.replace("(object|", "(Object|");
+    	if (t.contains("|String|")) 
+    		t = t.replace("|String|", "|string|");
+    	if (t.contains("|Number|")) 
+    		t = t.replace("|Number|", "|number|");
+    	if (t.contains("|Boolean|")) 
+    		t = t.replace("|Boolean|", "|boolean|");
+    	if (t.contains("|object|")) 
+    		t = t.replace("|object|", "|Object|");
+    	if (t.contains("|String)")) 
+    		t = t.replace("|String)", "|string)");
+    	if (t.contains("|Number)")) 
+    		t = t.replace("|Number)", "|number)");
+    	if (t.contains("|Boolean)")) 
+    		t = t.replace("|Boolean)", "|boolean)");
+    	if (t.contains("|object)")) 
+    		t = t.replace("|object)", "|Object)");
+    	return t;
+    }
+    
+    protected void emitParams(StringBuilder sb)
+    {
+        Set<String> parameterNames = getComment().getParameterNames();
+        for (String paramName : parameterNames)
+        {
+            JSTypeExpression parameterType = getComment().getParameterType(paramName);
+            String description = getComment().getDescriptionForParameter(paramName);
+
+            sb.append(indent);
+            sb.append(" * @param ");
+
+            if (outputJS && parameterType != null)
+            {
+                sb.append("{");
+                sb.append(mapBackToJS(getModel().evaluate(parameterType).toAnnotationString()));
+                sb.append("}");
+                sb.append(" ");            	
+            }
+            
+            sb.append(paramName);
+            sb.append(" ");
+
+            if (!outputJS && parameterType != null)
+            {
+                sb.append("[");
+                sb.append(getModel().evaluate(parameterType).toAnnotationString());
+                sb.append("]");
+                sb.append(" ");
+            }
+            if (description != null)
+                sb.append(description);
+            sb.append("\n");
+        }
+    }
+
+    protected void emitReturns(StringBuilder sb)
+    {
+        if (getComment().hasReturnType())
+        {
+            JSTypeExpression returnType = getComment().getReturnType();
+            if (returnType != null)
+            {
+                sb.append(indent);
+                sb.append(" * @returns ");
+                sb.append("{");
+                if (outputJS)
+                    sb.append(mapBackToJS(getModel().evaluate(returnType).toAnnotationString()));
+                else
+                	sb.append(getModel().evaluate(returnType).toAnnotationString());
+                sb.append("} ");
+                String description = getComment().getReturnDescription();
+                if (description != null)
+                    sb.append(description);
+                sb.append("\n");
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java
new file mode 100644
index 0000000..b04fb0e
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ClassReference.java
@@ -0,0 +1,890 @@
+/*
+ *
+ *  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.internal.codegen.externals.reference;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.flex.compiler.internal.codegen.externals.utils.DebugLogUtils;
+import org.apache.flex.compiler.internal.codegen.externals.utils.JSTypeUtils;
+
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.JSDocInfoBuilder;
+import com.google.javascript.rhino.JSTypeExpression;
+import com.google.javascript.rhino.Node;
+import com.google.javascript.rhino.jstype.JSType;
+
+public class ClassReference extends BaseReference
+{
+    private boolean isFinal;
+    private boolean isDynamic;
+    private int enumConstantCounter = 0;
+
+    private Set<String> imports = new HashSet<String>();
+    private MethodReference constructor;
+    private Map<String, FieldReference> instanceFields = new HashMap<String, FieldReference>();
+    private Map<String, FieldReference> staticFields = new HashMap<String, FieldReference>();
+    private Map<String, MethodReference> instanceMethods = new HashMap<String, MethodReference>();
+    private Map<String, MethodReference> staticMethods = new HashMap<String, MethodReference>();
+
+    private Node nameNode;
+
+    private Node functionNode;
+
+    @SuppressWarnings("unused")
+    private Node paramListNode;
+
+    private boolean isNamespace;
+
+    public final int getEnumConstant()
+    {
+        return enumConstantCounter;
+    }
+
+    public final void nextEnumConstant()
+    {
+        enumConstantCounter++;
+    }
+
+    public void setIsNamespace(boolean isNamespace)
+    {
+        this.isNamespace = isNamespace;
+    }
+
+    public boolean isNamespace()
+    {
+        return isNamespace;
+    }
+
+    public MethodReference getConstructor()
+    {
+        return constructor;
+    }
+
+    public ArrayList<FieldReference> getAllFields()
+    {
+        ArrayList<FieldReference> allMethods = new ArrayList<FieldReference>();
+        if (!isInterface())
+        	allMethods.addAll(staticFields.values());
+        allMethods.addAll(instanceFields.values());
+        return allMethods;
+    }
+
+    public ArrayList<MethodReference> getAllMethods()
+    {
+    	ArrayList<MethodReference> allMethods = new ArrayList<MethodReference>();
+    	if (!isInterface())
+    		allMethods.addAll(staticMethods.values());
+    	allMethods.addAll(instanceMethods.values());
+        return allMethods;
+    }
+
+    public FieldReference getStaticField(String name)
+    {
+    	return staticFields.get(name);
+    }
+    
+    public FieldReference getInstanceField(String name)
+    {
+        return instanceFields.get(name);
+    }
+
+    public MethodReference getStaticMethod(String name)
+    {
+        return staticMethods.get(name);
+    }
+
+    public MethodReference getInstanceMethod(String name)
+    {
+        return instanceMethods.get(name);
+    }
+
+    public boolean isDynamic()
+    {
+        return isDynamic;
+    }
+
+    public void setDynamic(boolean isDynamic)
+    {
+        this.isDynamic = isDynamic;
+    }
+
+    public boolean isFinal()
+    {
+        return isFinal;
+    }
+
+    public void setFinal(boolean isFinal)
+    {
+        this.isFinal = isFinal;
+    }
+
+    public final boolean isInterface()
+    {
+        return getComment().isInterface();
+    }
+
+    /**
+     * 
+     * @param model
+     * @param node (FUNCTION [NAME, PARAM_LIST, BLOCK]), or (ASSIGN [FUNCTION [NAME, PARAM_LIST, BLOCK]])
+     * @param qualifiedName
+     */
+    public ClassReference(ReferenceModel model, Node node, String qualifiedName)
+    {
+        super(model, node, qualifiedName, node.getJSDocInfo());
+
+        indent = "";
+
+        nameNode = null;
+        functionNode = null;
+        paramListNode = null;
+
+        if (comment.hasEnumParameterType())
+        {
+            /*
+            var Foo = { ...
+            
+            VAR 35 [jsdoc_info: JSDocInfo]
+                NAME FontFaceSetLoadStatus
+                    OBJECTLIT
+                        STRING_KEY LOADED
+                            STRING loaded
+                        STRING_KEY LOADING
+                            STRING loading
+                            
+             Or..
+             
+             foo.bar.baz.QualifiedEnum = { ...
+             
+             ASSIGN 50 [jsdoc_info: JSDocInfo]
+                GETPROP 
+                    GETPROP
+                        ...
+                    STRING QualifiedEnum 
+                OBJECTLIT 50 
+             */
+
+            String overrideStringType = JSTypeUtils.toEnumTypeString(this);
+
+            Node objLit = null;
+            if (node.isVar())
+            {
+                objLit = node.getFirstChild().getFirstChild();
+            }
+            else if (node.isAssign())
+            {
+                objLit = node.getLastChild();
+            }
+
+            if (objLit != null)
+            {
+                for (Node stringKey : objLit.children())
+                {
+                    if (stringKey.isStringKey())
+                    {
+                        Node valueNode = stringKey.getFirstChild();
+
+                        JSDocInfoBuilder b = new JSDocInfoBuilder(true);
+                        JSDocInfo fieldComment = b.build();
+                        String fieldName = stringKey.getString();
+                        FieldReference field = addField(stringKey, fieldName, fieldComment, true);
+                        field.setConst(true);
+                        field.setOverrideStringType(overrideStringType);
+                        field.setConstantValueNode(valueNode);
+                    }
+                }
+            }
+        }
+        else if (comment.getTypedefType() != null)
+        {
+            //System.out.println(node.toStringTree());
+            /*
+             VAR 727 [jsdoc_info: JSDocInfo] [source_file: [w3c_rtc]] [length: 21]
+                NAME MediaConstraints 727 [source_file: [w3c_rtc]] [length: 16]
+             */
+        }
+        else if (comment.isConstant())
+        {
+            /*
+             VAR 882 [jsdoc_info: JSDocInfo]
+                NAME Math 
+                    OBJECTLIT
+             */
+            constructor = new NullConstructorReference(model, this, node, getBaseName(), comment);
+        }
+        else if (node.isFunction())
+        {
+            /*
+             FUNCTION FooVarArgs 43 [jsdoc_info: JSDocInfo]
+                NAME FooVarArgs
+                PARAM_LIST
+                    NAME arg1
+                    NAME var_args
+                BLOCK 43
+             */
+            nameNode = node.getChildAtIndex(0);
+            functionNode = node;
+            paramListNode = functionNode.getChildAtIndex(1);
+        }
+        else if (node.isVar())
+        {
+            /*
+            VAR 67 [jsdoc_info: JSDocInfo]
+                NAME VarAssignFooNoArgs
+                    FUNCTION 
+                        NAME 
+                        PARAM_LIST
+                        BLOCK
+             */
+            nameNode = node.getChildAtIndex(0);
+            functionNode = nameNode.getChildAtIndex(0);
+            try
+            {
+                paramListNode = functionNode.getChildAtIndex(1);
+            }
+            catch (Exception e)
+            {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+        else if (node.isAssign() && node.getChildAtIndex(1).isFunction())
+        {
+            /*
+             ASSIGN 60 [jsdoc_info: JSDocInfo]
+                NAME AssignFooNoArgs
+                FUNCTION
+                    NAME
+                    PARAM_LIST
+                    BLOCK
+             */
+            nameNode = node.getFirstChild();
+            functionNode = node.getLastChild();
+            // this is an anonymous function assignment, no name
+            //functionNameNode = functionNode.getChildAtIndex(0);
+            paramListNode = functionNode.getChildAtIndex(1);
+        }
+
+        if (functionNode != null)
+        {
+            constructor = new MethodReference(model, this, functionNode, getBaseName(), comment, false);
+        }
+
+    }
+
+    private static List<String> definedPackages = new ArrayList<String>();
+    
+    @Override
+    public void emit(StringBuilder sb)
+    {
+        enumConstantCounter = 0;
+
+        String packageName = getPackageName();
+
+        if (outputJS)
+        {
+        	sb.append("/** @fileoverview Auto-generated Externs files\n * @externs\n */\n");
+        	if (!packageName.isEmpty())
+        	{
+            	if (!definedPackages.contains(packageName))
+	        	{
+            		definedPackages.add(packageName);
+	        		String[] pieces = packageName.split("\\.");
+	        		String chain = "";
+	        		int n = pieces.length;
+	        		for (int i = 0; i < n; i++)
+	        		{
+	        			String piece = pieces[i];
+	                	sb.append("\n");
+	                	sb.append("\n");
+	        			sb.append("/**\n * @const\n * @suppress {duplicate|const} */\n");
+	        			if (chain.isEmpty())
+	        				sb.append("var " + piece + " = {};\n\n\n");
+	        			else
+	        				sb.append(chain + "." + piece + " = {}\n\n\n");
+	        			chain = chain + "." + piece;
+	        		}
+	        	}
+        	}
+        }
+        else
+        {
+	        sb.append("package ");
+	        if (!packageName.equals(""))
+	            sb.append(packageName).append(" ");
+	        sb.append("{\n");
+	        sb.append("\n");
+	
+	        emitImports(sb);
+        }
+        
+        emitComment(sb);
+
+        boolean isInterface = isInterface();
+
+        if (isInterface)
+        {
+            emitInterface(sb);
+        }
+        else
+        {
+            emitClass(sb);
+        }
+
+        if (!outputJS)
+        {
+	        sb.append("{\n");
+	        sb.append("\n");
+        }
+        
+        if (!isInterface)
+        {
+            emitConstructor(sb);
+            sb.append("\n");
+        }
+
+        emitFields(sb);
+        emitMethods(sb);
+
+        if (!outputJS)
+        {
+            sb.append("}\n");
+            sb.append("}\n"); // package        	
+        }
+    }
+
+    public boolean hasSuperField(String fieldName)
+    {
+        List<ClassReference> list = getSuperClasses();
+        for (ClassReference reference : list)
+        {
+            if (reference.hasInstanceField(fieldName))
+                return true;
+        }
+        return false;
+    }
+
+    public boolean hasSuperMethod(String methodName)
+    {
+        List<ClassReference> list = getSuperClasses();
+        for (ClassReference reference : list)
+        {
+            if (reference.hasInstanceMethod(methodName))
+                return true;
+        }
+        return false;
+    }
+
+    public MethodReference getSuperMethod(String methodName)
+    {
+        List<ClassReference> list = getSuperClasses();
+        for (ClassReference reference : list)
+        {
+            if (reference.hasInstanceMethod(methodName))
+                return reference.getInstanceMethod(methodName);
+        }
+
+        list = getAllImplInterfaces(); // return all our interfaces and all superclass
+        for (ClassReference reference : list)
+        {
+            if (reference.hasInstanceMethod(methodName))
+                return reference.getInstanceMethod(methodName);
+        }
+
+        return null;
+    }
+
+    public List<ClassReference> getSuperClasses()
+    {
+        ArrayList<ClassReference> result = new ArrayList<ClassReference>();
+        ClassReference superClass = getSuperClass();
+        while (superClass != null)
+        {
+            result.add(superClass);
+            superClass = superClass.getSuperClass();
+        }
+
+        return result;
+    }
+
+    public List<ClassReference> getAllImplInterfaces()
+    {
+        ArrayList<ClassReference> result = new ArrayList<ClassReference>();
+        for (JSTypeExpression jsTypeExpression : getComment().getImplementedInterfaces())
+        {
+            String interfaceName = getModel().evaluate(jsTypeExpression).getDisplayName();
+            ClassReference classReference = getModel().getClassReference(interfaceName);
+            if (classReference != null)
+                result.add(classReference);
+        }
+
+        return result;
+    }
+
+    public List<ClassReference> getImplementedInterfaces()
+    {
+        ArrayList<ClassReference> result = new ArrayList<ClassReference>();
+        for (JSTypeExpression jsTypeExpression : getComment().getImplementedInterfaces())
+        {
+            String interfaceName = getModel().evaluate(jsTypeExpression).toAnnotationString();
+            ClassReference reference = getModel().getClassReference(interfaceName);
+            if (reference != null)
+                result.add(reference);
+        }
+        return result;
+    }
+
+    public List<ClassReference> getExtendedInterfaces()
+    {
+        ArrayList<ClassReference> result = new ArrayList<ClassReference>();
+        for (JSTypeExpression jsTypeExpression : getComment().getExtendedInterfaces())
+        {
+            String interfaceName = getModel().evaluate(jsTypeExpression).toAnnotationString();
+            ClassReference reference = getModel().getClassReference(interfaceName);
+            if (reference != null)
+                result.add(reference);
+        }
+        return result;
+    }
+
+    public List<ClassReference> getInterfaces()
+    {
+        ArrayList<ClassReference> result = new ArrayList<ClassReference>();
+        List<JSTypeExpression> implementedInterfaces = getComment().getImplementedInterfaces();
+        for (JSTypeExpression jsTypeExpression : implementedInterfaces)
+        {
+            JSType jsType = getModel().evaluate(jsTypeExpression);
+            String interfaceName = jsType.toAnnotationString();
+            result.add(getModel().getClassReference(interfaceName));
+        }
+        return result;
+    }
+
+    public List<ClassReference> getSuperInterfaces()
+    {
+        ArrayList<ClassReference> result = new ArrayList<ClassReference>();
+        result.addAll(getInterfaces());
+
+        ClassReference superClass = getSuperClass();
+        while (superClass != null)
+        {
+            result.addAll(superClass.getInterfaces());
+            superClass = superClass.getSuperClass();
+        }
+
+        return result;
+    }
+
+    public boolean hasInstanceField(String fieldName)
+    {
+        return instanceFields.containsKey(fieldName);
+    }
+
+    public boolean hasStaticField(String fieldName)
+    {
+        return staticFields.containsKey(fieldName);
+    }
+
+    public boolean hasInstanceMethod(String fieldName)
+    {
+        return instanceMethods.containsKey(fieldName);
+    }
+
+    public boolean hasStaticMethod(String fieldName)
+    {
+        return staticMethods.containsKey(fieldName);
+    }
+
+    public FieldReference addField(Node node, String fieldName, JSDocInfo comment, boolean isStatic)
+    {
+        if (isStatic ? hasStaticField(fieldName) : hasInstanceField(fieldName))
+        {
+            // XXX Warning
+            return null;
+        }
+
+        /* AJH This doesn't make sense to me
+        if (isNamespace)
+            isStatic = false;
+        */
+
+        if (comment == null)
+        {
+            DebugLogUtils.err("Field comment null for; " + node.getQualifiedName());
+            //DebugLogUtils.err(node);
+            JSDocInfoBuilder b = new JSDocInfoBuilder(true);
+            b.recordBlockDescription("Generated doc for missing field JSDoc.");
+            comment = b.build();
+        }
+
+        FieldReference field = new FieldReference(getModel(), this, node, fieldName, comment, isStatic);
+
+        if (isStatic)
+        	staticFields.put(fieldName, field);
+        else
+        	instanceFields.put(fieldName, field);
+        return field;
+    }
+
+    public MethodReference addMethod(Node node, String functionName, JSDocInfo comment, boolean isStatic)
+    {
+        /* AJH This doesn't make sense to me
+        if (isNamespace)
+            isStatic = false;
+		*/
+    	
+        if (comment == null)
+        {
+            DebugLogUtils.err("Method comment null for; " + node.getQualifiedName());
+            //DebugLogUtils.err(node);
+            JSDocInfoBuilder b = new JSDocInfoBuilder(true);
+            b.recordBlockDescription("Generated doc for missing method JSDoc.");
+            comment = b.build();
+        }
+
+        MethodReference method = new MethodReference(getModel(), this, node, functionName, comment, isStatic);
+
+        if (isStatic)
+        {
+            staticMethods.put(functionName, method);
+        }
+        else if (getQualifiedName().equals("Object") && functionName.equals("toString"))
+        {
+            // skipping Object.prototype.toString() allows toString(opt_radix) for Number, int and uint
+        }
+        else
+        {
+       	    instanceMethods.put(functionName, method);
+        }
+        return method;
+    }
+
+    public boolean isMethodOverrideFromInterface(MethodReference reference)
+    {
+        boolean isMethodOverrideFromInterface = false;
+
+        if (!hasImplementations())
+        {
+            List<JSTypeExpression> implementedInterfaces = getComment().getImplementedInterfaces();
+            for (JSTypeExpression jsTypeExpression : implementedInterfaces)
+            {
+                String interfaceName = getModel().evaluate(jsTypeExpression).getDisplayName();
+                ClassReference classReference = getModel().getClassReference(interfaceName);
+                if (classReference.hasSuperMethod(reference.getQualifiedName()))
+                {
+                    isMethodOverrideFromInterface = true;
+                    break;
+                }
+            }
+        }
+
+        return isMethodOverrideFromInterface;
+    }
+
+    public MethodReference getMethodOverrideFromInterface(MethodReference reference)
+    {
+        // get all super classes, reverse and search top down
+        List<ClassReference> superClasses = getSuperClasses();
+        superClasses.add(0, this);
+        Collections.reverse(superClasses);
+
+        // for each superclass, get all implemented interfaces
+        for (ClassReference classReference : superClasses)
+        {
+            List<ClassReference> interfaces = classReference.getImplementedInterfaces();
+            for (ClassReference interfaceReference : interfaces)
+            {
+                // check for the method on the interface
+                MethodReference method = interfaceReference.getInstanceMethod(reference.getBaseName());
+                if (method != null)
+                    return method;
+            }
+        }
+
+        return null;
+    }
+
+    public ClassReference getSuperClass()
+    {
+        if (getBaseName().equals("Object"))
+            return null;
+
+        JSTypeExpression baseType = getComment().getBaseType();
+        if (baseType != null)
+        {
+            JSType jsType = getModel().evaluate(baseType);
+            if (jsType != null)
+                return getModel().getClassReference(jsType.getDisplayName());
+        }
+        else
+        {
+            return getModel().getObjectReference();
+        }
+
+        return null;
+    }
+
+    public boolean hasSuperFieldConflict(FieldReference reference)
+    {
+        //        ClassReference2 superClass = getSuperClass();
+        //        if (superClass != null)
+        //            return superClass.getInstanceFields().containsKey(
+        //                    reference.getName());
+        return false;
+    }
+
+    public boolean isPropertyInterfaceImplementation(String fieldName)
+    {
+        List<ClassReference> superInterfaces = getSuperInterfaces();
+        for (ClassReference interfaceRef : superInterfaces)
+        {
+            if (interfaceRef == null)
+            {
+                System.err.println("isPropertyInterfaceImplementation() null");
+                continue;
+            }
+            if (interfaceRef.hasInstanceField(fieldName))
+                return true;
+        }
+        return false;
+    }
+
+    public boolean hasLocalMethodConflict(String functionName)
+    {
+        return instanceMethods.containsKey(functionName) || staticMethods.containsKey(functionName);
+    }
+
+    public void addImport(ClassReference reference)
+    {
+        if (reference != null)
+        {
+            imports.add(reference.getQualifiedName());
+        }
+    }
+
+    public boolean hasImport(String qualifiedName)
+    {
+        return imports.contains(qualifiedName);
+    }
+
+    private boolean hasImplementations()
+    {
+        return getComment().getImplementedInterfaceCount() > 0;
+    }
+
+    private void emitImports(StringBuilder sb)
+    {
+        if (imports.size() > 0)
+        {
+            for (String anImport : imports)
+            {
+                sb.append("import ").append(anImport).append(";\n");
+            }
+            sb.append("\n");
+        }
+    }
+
+    @Override
+    protected void emitCommentBody(StringBuilder sb)
+    {
+    	super.emitCommentBody(sb);
+		if (isInterface())
+			sb.append(" * @interface\n");
+		else
+			sb.append(" * @constructor ");
+        if (getComment().hasBaseType())
+        {
+            emitSuperClass(sb);
+        }
+        if (!isInterface())
+        {
+            emitImplements(sb);
+        }
+    }
+    
+    private void emitClass(StringBuilder sb)
+    {
+    	if (outputJS)
+    		return;
+    	
+        sb.append("public ");
+        if (isDynamic)
+        {
+            sb.append("dynamic ");
+        }
+
+        if (isFinal)
+        {
+            sb.append("final ");
+        }
+
+        sb.append("class ");
+        sb.append(getBaseName()).append(" ");
+
+        if (getComment().hasBaseType())
+        {
+            emitSuperClass(sb);
+            sb.append(" ");
+        }
+        else
+        {
+            // XXX JSObject extends
+            //sb.append("extends JSObject ");
+        }
+
+        if (!isInterface())
+        {
+            emitImplements(sb);
+        }
+    }
+
+    private void emitInterface(StringBuilder sb)
+    {
+        sb.append("public interface ");
+
+        sb.append(getBaseName()).append(" ");
+
+        List<JSTypeExpression> extendedInterfaces = getComment().getExtendedInterfaces();
+        int len = extendedInterfaces.size();
+        if (len > 0)
+        {
+            sb.append("extends ");
+            for (JSTypeExpression jsTypeExpression : extendedInterfaces)
+            {
+                String value = getModel().evaluate(jsTypeExpression).toAnnotationString();
+                sb.append(value);
+                if (--len > 0)
+                    sb.append(", ");
+            }
+            sb.append(" ");
+        }
+    }
+
+    private void emitSuperClass(StringBuilder sb)
+    {
+    	if (outputJS)
+    	{
+	        sb.append(" * @extends ");
+	        String value = JSTypeUtils.toClassTypeString(this);
+	        sb.append(value);
+	        sb.append("\n");
+    	}
+    	else
+    	{
+	        sb.append("extends ");
+	        String value = JSTypeUtils.toClassTypeString(this);
+	        sb.append(value);
+    	}
+    }
+
+    private void emitImplements(StringBuilder sb)
+    {
+        List<JSTypeExpression> implementedInterfaces = getComment().getImplementedInterfaces();
+        if (implementedInterfaces.size() == 0)
+            return;
+
+        if (outputJS)
+        	sb.append(" * @implements ");
+        else
+        	sb.append("implements ");
+
+        int len = implementedInterfaces.size();
+        for (int i = 0; i < len; i++)
+        {
+            String value = getModel().evaluate(implementedInterfaces.get(i)).getDisplayName();
+
+            sb.append(value);
+            if (outputJS)
+            	sb.append("\n");
+            else
+            {
+	            if (i < len - 1)
+	                sb.append(", ");
+            }
+        }
+
+        sb.append(" ");
+    }
+
+    private void emitConstructor(StringBuilder sb)
+    {
+        if (constructor != null)
+        {
+            constructor.emit(sb);
+        }
+    }
+
+    private void emitFields(StringBuilder sb)
+    {
+        for (FieldReference field : getAllFields())
+        {
+            field.emit(sb);
+            sb.append("\n");
+            nextEnumConstant();
+        }
+    }
+
+    private void emitMethods(StringBuilder sb)
+    {
+        for (MethodReference method : getAllMethods())
+        {
+            method.emit(sb);
+            sb.append("\n");
+        }
+    }
+
+    public File getFile(File asSourceRoot)
+    {
+    	File jsRoot = getModel().getConfiguration().getJsRoot();
+    	if (jsRoot == null)
+    	{
+            String packagePath = toPackagePath();
+            return new File(asSourceRoot, packagePath + File.separator + getBaseName() + ".as");    		
+    	}
+    	
+    	return new File(jsRoot, getBaseName() + ".js");
+    }
+
+    private String toPackagePath()
+    {
+        String packageName = getPackageName();
+
+        String[] cname = packageName.split("\\.");
+        String sdirPath = "";
+        if (cname.length > 0)
+        {
+            for (final String aCname : cname)
+            {
+                sdirPath += aCname + File.separator;
+            }
+
+            return sdirPath;
+        }
+
+        return "";
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ConstantReference.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ConstantReference.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ConstantReference.java
new file mode 100644
index 0000000..655fe57
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ConstantReference.java
@@ -0,0 +1,101 @@
+/*
+ *
+ *  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.internal.codegen.externals.reference;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.apache.flex.compiler.internal.codegen.externals.utils.JSTypeUtils;
+
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.Node;
+import com.google.javascript.rhino.jstype.JSType;
+
+public class ConstantReference extends BaseReference
+{
+
+    @SuppressWarnings("unused")
+    private JSType type;
+
+    public ConstantReference(ReferenceModel model, Node node,
+            String qualifiedName, JSDocInfo comment)
+    {
+        super(model, node, qualifiedName, node.getJSDocInfo());
+
+        /*
+        VAR 70 [jsdoc_info: JSDocInfo]
+            NAME self  [is_constant_var: 1]
+        */
+    }
+
+    public ConstantReference(ReferenceModel model, Node node,
+            String qualifiedName, JSDocInfo comment, JSType type)
+    {
+        super(model, node, qualifiedName, node.getJSDocInfo());
+        this.type = type;
+    }
+
+    public File getFile(File asSourceRoot)
+    {
+        String packageName = "";
+
+        return new File(asSourceRoot, packageName + File.separator
+                + getQualifiedName() + ".as");
+    }
+
+    @Override
+    public void emit(StringBuilder sb)
+    {
+        sb.append("package ");
+
+        sb.append("{\n");
+        sb.append("\n");
+
+        String type = JSTypeUtils.toConstantTypeString(this);
+        String value = resolveValue(type);
+
+        if (getQualifiedName().equals("undefined"))
+        {
+            sb.append(indent);
+            sb.append("public const undefined:* = 0;\n");
+        }
+        else
+        {
+            sb.append(indent);
+            sb.append("public const " + getQualifiedName() + ":" + type + " = "
+                    + value + ";\n");
+        }
+
+        sb.append("}\n"); // package
+    }
+
+    private String resolveValue(String type)
+    {
+        HashMap<String, String> map = new HashMap<String, String>();
+        map.put("Number", "0");
+        map.put("undefined", "0");
+
+        if (map.containsKey(type))
+            return map.get(type);
+
+        return "undefined";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/FieldReference.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/FieldReference.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/FieldReference.java
new file mode 100644
index 0000000..d99a66d
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/FieldReference.java
@@ -0,0 +1,264 @@
+/*
+ *
+ *  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.internal.codegen.externals.reference;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration.ExcludedMember;
+import org.apache.flex.compiler.internal.codegen.externals.utils.JSTypeUtils;
+
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.JSTypeExpression;
+import com.google.javascript.rhino.Node;
+import com.google.javascript.rhino.jstype.JSType;
+
+public class FieldReference extends MemberReference
+{
+
+    private boolean isStatic;
+    private boolean isConst;
+    private String overrideStringType;
+    private Node constantValueNode;
+
+    public boolean isStatic()
+    {
+        return isStatic;
+    }
+
+    public void setStatic(boolean isStatic)
+    {
+        this.isStatic = isStatic;
+    }
+
+    public boolean isConst()
+    {
+        return isConst;
+    }
+
+    public void setConst(boolean isConst)
+    {
+        this.isConst = isConst;
+    }
+
+    public void setOverrideStringType(String overrideStringType)
+    {
+        this.overrideStringType = overrideStringType;
+    }
+
+    public void setConstantValueNode(Node constantValueNode)
+    {
+        this.constantValueNode = constantValueNode;
+    }
+
+    public String toTypeAnnotationString()
+    {
+        JSType jsType = null;
+        if (getComment() != null && getComment().getType() != null)
+        {
+            jsType = getModel().evaluate(getComment().getType());
+        }
+        return jsType != null ? jsType.toAnnotationString() : "Object";
+    }
+
+    public FieldReference(ReferenceModel model, ClassReference classReference, Node node, String name,
+            JSDocInfo comment, boolean isStatic)
+    {
+        super(model, classReference, node, name, comment);
+        this.isStatic = isStatic;
+    }
+
+    @Override
+    public void emit(StringBuilder sb)
+    {
+        // XXX HACK TEMP!
+        if (getComment().isConstructor())
+            return;
+
+        // Window has a global var Window that conflicts with the constructor.
+        if (getQualifiedName().equals(getClassReference().getQualifiedName()))
+            return;
+
+        if (getClassReference().hasSuperField(getQualifiedName()))
+            return;
+
+        emitComment(sb);
+
+        ExcludedMember excluded = isExcluded();
+        if (excluded != null)
+        {
+            excluded.print(sb);
+            return; // XXX (mschmalle) accessors are not treated right, need to exclude get/set
+        }
+
+        if (!getClassReference().isInterface() && !getComment().isOverride()
+                && !getClassReference().isPropertyInterfaceImplementation(getBaseName()))
+        {
+            emitVar(sb);
+        }
+        else
+        {
+            emitAccessor(sb);
+        }
+    }
+
+    private void emitAccessor(StringBuilder sb)
+    {
+        boolean isInterface = getClassReference().isInterface();
+
+        String staticValue = (isStatic) ? "static " : "";
+        String isPublic = isInterface ? "" : "public ";
+        String getBody = isInterface ? "" : "{ return null; }";
+        String setBody = isInterface ? "" : "{}";
+
+        String type = toTypeString();
+        if (type.contains("|") || type.contains("?"))
+            type = "*";
+
+        if (outputJS)
+        {
+        	sb.append(getClassReference().getPackageName());
+        	sb.append(".");
+        	sb.append(getClassReference().getBaseName());
+        	sb.append(".");
+        	if (!isStatic)
+        		sb.append("prototype.");
+        	sb.append(getBaseName());
+        	sb.append(";\n");
+        	return;
+        }
+        // getter
+        sb.append(indent);
+        sb.append(isPublic);
+        sb.append(staticValue);
+        sb.append("function get ");
+        sb.append(getBaseName());
+        sb.append("():");
+        sb.append(type);
+        sb.append(getBody);
+        sb.append(";\n");
+
+        // setter
+        sb.append(indent);
+        sb.append(isPublic);
+        sb.append(staticValue);
+        sb.append("function set ");
+        sb.append(getBaseName());
+        sb.append("(value:");
+        sb.append(type);
+        sb.append("):void");
+        sb.append(setBody);
+        sb.append(";\n");
+    }
+
+    private void emitVar(StringBuilder sb)
+    {
+        String staticValue = (isStatic) ? "static " : "";
+        String constVarValue = (isConst) ? "const " : "var ";
+
+        String type = toTypeString();
+        if (type.contains("|") || type.contains("?"))
+            type = "*";
+
+        if (outputJS)
+        {
+        	sb.append(getClassReference().getPackageName());
+        	sb.append(".");
+        	sb.append(getClassReference().getBaseName());
+        	sb.append(".");
+        	if (!isStatic)
+        		sb.append("prototype.");
+        	sb.append(getBaseName());
+        	sb.append(";\n");
+        	return;
+        }
+        
+        sb.append(indent);
+        sb.append("public ");
+        sb.append(staticValue);
+        sb.append(constVarValue);
+        sb.append(getQualifiedName());
+        sb.append(":");
+        sb.append(type);
+        if (isConst)
+        {
+            emitConstValue(sb);
+        }
+        sb.append(";\n");
+    }
+
+    private void emitConstValue(StringBuilder sb)
+    {
+        sb.append(" = ");
+        sb.append(toConstValue(constantValueNode));
+    }
+
+    private String toConstValue(Node node)
+    {
+        if (toTypeString().equals("Number"))
+            return Integer.toString(getClassReference().getEnumConstant());
+        if (node.isString())
+            return "'" + node.getString() + "'";
+        return "undefined /* TODO type not set */";
+    }
+
+    public String toTypeString()
+    {
+        if (overrideStringType != null)
+            return overrideStringType;
+        return JSTypeUtils.toFieldTypeString(this);
+    }
+
+    @Override
+    protected void emitCommentBody(StringBuilder sb)
+    {
+        emitBlockDescription(sb);
+        emitType(sb);
+        emitSee(sb);
+        emitSeeSourceFileName(sb);
+    }
+
+    private void emitType(StringBuilder sb)
+    {
+        JSTypeExpression type = getComment().getType();
+        if (type != null)
+        {
+        	if (outputJS)
+        	{
+                sb.append(indent);
+                sb.append(" * @type ");
+                sb.append("{");
+                sb.append(mapBackToJS(getModel().evaluate(type).toAnnotationString()));
+                sb.append("} ");
+                sb.append("\n");
+        	}
+        	else
+        	{
+                sb.append(indent);
+                sb.append(" * @see JSType - ");
+                sb.append("[");
+                sb.append(getModel().evaluate(type).toAnnotationString());
+                sb.append("] ");
+                String description = getComment().getReturnDescription();
+                if (description != null)
+                    sb.append(description);
+                sb.append("\n");        		
+        	}
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/FunctionReference.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/FunctionReference.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/FunctionReference.java
new file mode 100644
index 0000000..38d9d30
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/FunctionReference.java
@@ -0,0 +1,186 @@
+/*
+ *
+ *  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.internal.codegen.externals.reference;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration.ExcludedMember;
+import org.apache.flex.compiler.internal.codegen.externals.utils.FunctionUtils;
+
+import com.google.common.collect.Lists;
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.Node;
+
+public class FunctionReference extends BaseReference {
+    private boolean isStatic;
+    private Node paramNode;
+    private Set<String> imports = new HashSet<String>();
+    private List<ParameterReference> parameters;
+
+    public File getFile(File asSourceRoot) {
+        String packageName = "";
+
+        return new File(asSourceRoot, packageName + File.separator + getQualifiedName() + ".as");
+    }
+
+    private FunctionReference getContext() {
+        return this;
+    }
+
+    public boolean isStatic() {
+        return isStatic;
+    }
+
+    public void setStatic(boolean isStatic) {
+        this.isStatic = isStatic;
+    }
+
+    /*
+    FUNCTION [node] Scope:Global
+        NAME
+        PARAM_LIST
+            NAME
+            NAME
+        BLOCK
+    */
+
+    public FunctionReference(ReferenceModel model, Node node, String qualifiedName, JSDocInfo comment) {
+        super(model, node, qualifiedName, comment);
+        this.paramNode = node.getChildAtIndex(1);
+
+        addParameterReferences();
+    }
+
+    private void addParameterReferences() {
+
+        parameters = new ArrayList<ParameterReference>();
+
+        if (paramNode != null) {
+
+            final boolean isDocumented = comment.getParameterCount() > 0;
+            List<String> parameterNames = null;
+
+            if (isDocumented) {
+                parameterNames = Lists.newArrayList(comment.getParameterNames());
+            }
+
+            for (Node param : paramNode.children()) {
+                ParameterReference parameterReference;
+
+                if (isDocumented && parameterNames.contains(param.getString())) {
+                    final String qualifiedName = FunctionUtils.toParameterType(this, param.getString());
+                    parameterReference = new ParameterReference(getModel(), param, qualifiedName);
+                } else {
+                    parameterReference = new ParameterReference(getModel(), param);
+                }
+
+                parameters.add(parameterReference);
+            }
+        }
+    }
+
+    @Override
+    public void emit(StringBuilder sb) {
+        String packageName = "";
+
+        sb.append("package ");
+        sb.append(packageName).append(" ");
+        sb.append("{\n");
+        sb.append("\n");
+
+        printImports(sb);
+
+        emitComment(sb);
+
+        ExcludedMember excluded = isExcluded();
+        if (excluded != null) {
+            excluded.print(sb);
+        }
+
+        String staticValue = (isStatic) ? "static " : "";
+
+        String publicModifier = "public ";
+        String braces;
+
+        String returns = "";
+        if (!transformReturnString().equals("void")) {
+            returns = " return null;";
+        }
+
+        braces = " { " + returns + " }";
+
+        sb.append("    ");
+        sb.append(publicModifier);
+        sb.append(staticValue);
+        sb.append("function ");
+        sb.append(getQualifiedName());
+        sb.append(toParameterString());
+        sb.append(":");
+        sb.append(transformReturnString());
+        sb.append(braces);
+        sb.append("\n");
+
+        sb.append("}\n"); // package
+    }
+
+    private void printImports(final StringBuilder sb) {
+        if (imports.size() > 0) {
+            for (String anImport : imports) {
+                sb.append("import ").append(anImport).append(";\n");
+            }
+            sb.append("\n");
+        }
+    }
+
+    public String transformReturnString() {
+        return FunctionUtils.toReturnString(getContext());
+    }
+
+    private String toParameterString() {
+        return FunctionUtils.toParameterString(getContext(), getComment(), paramNode, outputJS);
+    }
+
+    public boolean isOverride() {
+        return getComment().isOverride();
+    }
+
+    @Override
+    protected void emitCommentBody(StringBuilder sb) {
+        emitFunctionCommentBody(sb);
+    }
+
+    public void addImport(ClassReference reference) {
+        if (reference != null) {
+            imports.add(reference.getQualifiedName());
+        }
+    }
+
+    public List<ParameterReference> getParameters() {
+        return parameters;
+    }
+
+    public boolean hasImport(String qualifiedName) {
+        return imports.contains(qualifiedName);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/MemberReference.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/MemberReference.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/MemberReference.java
new file mode 100644
index 0000000..8e753ed
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/MemberReference.java
@@ -0,0 +1,51 @@
+/*
+ *
+ *  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.internal.codegen.externals.reference;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration.ExcludedMember;
+
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.Node;
+
+public abstract class MemberReference extends BaseReference
+{
+
+    private ClassReference classReference;
+
+    public ClassReference getClassReference()
+    {
+        return classReference;
+    }
+
+    public MemberReference(ReferenceModel model, ClassReference classReference,
+            Node node, String name, JSDocInfo comment)
+    {
+        super(model, node, name, comment);
+        this.classReference = classReference;
+    }
+
+    @Override
+    public ExcludedMember isExcluded()
+    {
+        return getClassReference().getModel().isExcludedMember(
+                getClassReference(), this);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/MethodReference.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/MethodReference.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/MethodReference.java
new file mode 100644
index 0000000..96aa9f2
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/MethodReference.java
@@ -0,0 +1,316 @@
+/*
+ *
+ *  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.internal.codegen.externals.reference;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration.ExcludedMember;
+import org.apache.flex.compiler.internal.codegen.externals.utils.FunctionUtils;
+
+import com.google.common.collect.Lists;
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.Node;
+import com.google.javascript.rhino.jstype.JSType;
+
+public class MethodReference extends MemberReference
+{
+
+    private boolean isStatic;
+    private MethodReference override;
+    private Node paramNode;
+
+    private List<ParameterReference> parameters;
+
+    private MethodReference getContext()
+    {
+        return override == null ? this : override;
+    }
+
+    public boolean isStatic()
+    {
+        return isStatic;
+    }
+
+    public void setStatic(boolean isStatic)
+    {
+        this.isStatic = isStatic;
+    }
+
+    public List<ParameterReference> getParameters()
+    {
+        return parameters;
+    }
+
+    public Set<String> getParameterNames()
+    {
+        return getComment().getParameterNames();
+    }
+
+    public String toReturnTypeAnnotationString()
+    {
+        JSType jsType = getModel().evaluate(getComment().getReturnType());
+        return jsType.toAnnotationString();
+    }
+
+    public MethodReference(ReferenceModel model, ClassReference classReference, Node node, String name,
+            JSDocInfo comment, boolean isStatic)
+    {
+        super(model, classReference, node, name, comment);
+        this.isStatic = isStatic;
+
+        if (node.isFunction())
+        {
+            this.paramNode = node.getChildAtIndex(1);
+        }
+        else if (node.getLastChild().isFunction())
+        {
+            this.paramNode = node.getLastChild().getChildAtIndex(1);
+        }
+
+        addParameterReferences();
+    }
+
+    private void addParameterReferences()
+    {
+
+        parameters = new ArrayList<ParameterReference>();
+
+        if (paramNode != null)
+        {
+
+            final boolean isDocumented = comment.getParameterCount() > 0;
+            List<String> parameterNames = null;
+
+            if (isDocumented)
+            {
+                parameterNames = Lists.newArrayList(comment.getParameterNames());
+            }
+
+            for (Node param : paramNode.children())
+            {
+                ParameterReference parameterReference;
+
+                if (isDocumented && parameterNames.contains(param.getString()))
+                {
+                    final String qualifiedName = FunctionUtils.toParameterType(this, param.getString());
+                    parameterReference = new ParameterReference(getModel(), param, qualifiedName);
+                }
+                else
+                {
+                    parameterReference = new ParameterReference(getModel(), param);
+                }
+
+                parameters.add(parameterReference);
+            }
+        }
+    }
+
+    @Override
+    public void emit(StringBuilder sb)
+    {
+    	String className = getClassReference().getBaseName();
+    	
+        // XXX HACK TEMP!
+        if (getComment().isConstructor() && !getBaseName().equals(className))
+            return;
+
+        if (isConstructor())
+        {
+            emitConstructor(sb);
+            return;
+        }
+
+        String qName = getQualifiedName();
+        // skip overrides since they have to have the same signature as the super method
+        if (getClassReference().hasSuperMethod(qName))
+        	return;
+
+        emitComment(sb);
+
+        ExcludedMember excluded = isExcluded();
+        if (excluded != null)
+        {
+            excluded.print(sb);
+        }
+
+        emitCode(sb);
+
+        override = null;
+    }
+
+    public void emitCode(StringBuilder sb)
+    {
+        String staticValue = (isStatic) ? "static " : "";
+        if (getClassReference().isInterface())
+            staticValue = "";
+
+        String isOverride = "";
+
+        if (!getClassReference().isInterface())
+        {
+            MethodReference overrideFromInterface = getClassReference().getMethodOverrideFromInterface(this);
+            if (/*isOverride() && */overrideFromInterface != null)
+            {
+                override = overrideFromInterface;
+            }
+        }
+
+        String qName = getQualifiedName();
+        
+        String publicModifier = "";
+        String braces = "";
+        String returns = "";
+
+        String returnString = transformReturnString();
+        if (!returnString.equals("void"))
+        {
+        	if (returnString.equals("Number"))
+        		returns = "return 0;";
+        	else
+        		returns = " return null;";
+        }
+
+        if (!getClassReference().isInterface())
+        {
+            publicModifier = "public ";
+            braces = " { " + returns + " }";
+        }
+        
+        if (getClassReference().hasSuperMethod(qName))
+        {
+        	isOverride = "override ";
+        }
+
+    	if (outputJS)
+    	{
+        	sb.append(getClassReference().getPackageName());
+        	sb.append(".");
+        	sb.append(getClassReference().getBaseName());
+        	sb.append(".");
+        	if (isStatic)
+        		sb.append("prototype.");
+        	sb.append(qName);    		
+        	sb.append(" = function "); 		
+            sb.append(toParameterString());
+            sb.append(braces);
+            sb.append("\n");
+            return;
+    	}
+    	
+        sb.append(indent);
+        sb.append(publicModifier);
+        sb.append(isOverride);
+        sb.append(staticValue);
+        sb.append("function ");
+        sb.append(getQualifiedName());
+        sb.append(toParameterString());
+        sb.append(":");
+        sb.append(transformReturnString());
+        sb.append(braces);
+        sb.append("\n");
+    }
+
+    private void emitConstructor(StringBuilder sb)
+    {
+    	if (!outputJS)
+    		emitComment(sb);
+
+    	if (outputJS)
+    	{
+        	sb.append(getClassReference().getPackageName());
+        	sb.append(".");
+        	sb.append(getBaseName());    		
+        	sb.append(" = function "); 		
+            sb.append(toParameterString());
+            sb.append(" {}\n");
+            return;
+    	}
+    	
+        sb.append(indent);
+        sb.append("public function ");
+        sb.append(getBaseName());
+        if (!getBaseName().equals("Object"))
+        {
+            sb.append(toParameterString());
+            sb.append(" {\n");
+            sb.append(indent);
+            emitSuperCall(sb);
+            sb.append(indent);
+            sb.append("}");
+        }
+        else
+        {
+            sb.append("() {}");
+        }
+
+        sb.append("\n");
+    }
+
+    private void emitSuperCall(StringBuilder sb)
+    {
+
+        sb.append(indent);
+        sb.append("super(");
+
+        ClassReference superClass = getClassReference().getSuperClass();
+        if (superClass != null && !superClass.getBaseName().equals("Object"))
+        {
+            MethodReference constructor = superClass.getConstructor();
+            Set<String> parameterNames = constructor.getParameterNames();
+            int len = parameterNames.size();
+            for (int i = 0; i < len; i++)
+            {
+                sb.append("null");
+                if (i < len - 1)
+                    sb.append(", ");
+            }
+        }
+
+        sb.append(");\n");
+    }
+
+    public boolean isConstructor()
+    {
+        return getComment().isConstructor();
+    }
+
+    public String transformReturnString()
+    {
+        return FunctionUtils.toReturnString(getContext());
+    }
+
+    private String toParameterString()
+    {
+        return FunctionUtils.toParameterString(getContext(), getContext().getComment(), paramNode, outputJS);
+    }
+
+    public boolean isOverride()
+    {
+        return getComment().isOverride();
+    }
+
+    @Override
+    protected void emitCommentBody(StringBuilder sb)
+    {
+        emitFunctionCommentBody(sb);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/NullConstructorReference.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/NullConstructorReference.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/NullConstructorReference.java
new file mode 100644
index 0000000..f1caf7a
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/NullConstructorReference.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.internal.codegen.externals.reference;
+
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.Node;
+
+public class NullConstructorReference extends MethodReference
+{
+
+    public NullConstructorReference(ReferenceModel model,
+            ClassReference classReference, Node node, String name,
+            JSDocInfo comment)
+    {
+        super(model, classReference, node, name, comment, false);
+    }
+
+    @Override
+    protected void emitFunctionCommentBody(StringBuilder sb)
+    {
+        emitBlockDescription(sb);
+        emitSee(sb);
+        emitSeeSourceFileName(sb);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ParameterReference.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ParameterReference.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ParameterReference.java
new file mode 100644
index 0000000..4823873
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ParameterReference.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.internal.codegen.externals.reference;
+
+import com.google.javascript.rhino.Node;
+
+/**
+ * @author: Frederic Thomas Date: 05/07/2015 Time: 19:34
+ */
+public class ParameterReference extends BaseReference
+{
+
+    private String name;
+
+    public ParameterReference(final ReferenceModel model, final Node node, final String qualifiedName)
+    {
+        super(model, node, qualifiedName, null);
+        name = node.getString();
+    }
+
+    public ParameterReference(final ReferenceModel model, final Node parameterNode)
+    {
+        this(model, parameterNode, "Object");
+    }
+
+    @Override
+    public void emit(final StringBuilder sb)
+    {
+        // Emitted by the Method / Function reference.
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+}


[03/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSWriter.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSWriter.java b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSWriter.java
deleted file mode 100644
index 105452a..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSWriter.java
+++ /dev/null
@@ -1,1443 +0,0 @@
-/*
- *
- *  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.internal.as.codegen;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.flex.abc.ABCConstants;
-import org.apache.flex.abc.semantics.Name;
-import org.apache.flex.abc.semantics.Namespace;
-import org.apache.flex.compiler.clients.MXMLJSC;
-import org.apache.flex.compiler.definitions.IDefinition;
-import org.apache.flex.compiler.definitions.INamespaceDefinition;
-import org.apache.flex.compiler.definitions.metadata.IMetaTag;
-import org.apache.flex.compiler.internal.scopes.ASProjectScope;
-import org.apache.flex.compiler.internal.units.SWCCompilationUnit;
-import org.apache.flex.compiler.problems.ICompilerProblem;
-import org.apache.flex.compiler.problems.InternalCompilerProblem;
-import org.apache.flex.compiler.projects.ICompilerProject;
-import org.apache.flex.compiler.units.ICompilationUnit;
-import org.apache.flex.compiler.units.requests.IABCBytesRequestResult;
-import org.apache.flex.swf.ISWF;
-import org.apache.flex.swf.SWFFrame;
-import org.apache.flex.swf.io.ISWFWriter;
-import org.apache.flex.swf.io.OutputBitStream;
-import org.apache.flex.swf.tags.DoABCTag;
-import org.apache.flex.swf.tags.ITag;
-import org.apache.flex.swf.TagType;
-
-import com.google.javascript.jscomp.CompilationLevel;
-import com.google.javascript.jscomp.Compiler;
-import com.google.javascript.jscomp.CompilerOptions;
-import com.google.javascript.jscomp.CommandLineRunner;
-import com.google.javascript.jscomp.JSError;
-import com.google.javascript.jscomp.JSSourceFile;
-
-/**
- * The implementation of SWF tag, type encoding logic. The SWF file body are
- * buffered in memory using {@code IOutputBitStream}. ZLIB compression is
- * optional. If enabled, compression is on-the-fly via a filtered output stream.
- * JSWriter is modeled after SWFWriter and emits the resulting JS file collected
- * from JSEmitters. JSEmitter only collects JS from one JSCompilationUnit
- * (usually one class) while JSWriter combines all JS code into one JS file with
- * some extra code for static initializers etc. JSDriver creates and uses
- * JSWriter for writing SWFs, which are JS files in FalconJS's world. This
- * implementation is part of FalconJS. For more details on FalconJS see
- * org.apache.flex.compiler.JSDriver
- */
-public class JSWriter implements ISWFWriter
-{
-    private ICompilerProject m_project;
-    List<ICompilerProblem> m_problems;
-
-    // SWF model
-    private final ISWF swf;
-
-    private final Collection<ICompilationUnit> compilationUnits;
-
-    // This buffer contains the SWF data after FileLength field. 
-    private final OutputBitStream outputBuffer;
-
-    private Boolean hasStage = false;
-
-    /**
-     * Create a SWF writer.
-     * 
-     * @param swf the SWF model to be encoded
-     * @param useCompression use ZLIB compression if true
-     */
-    public JSWriter(ICompilerProject project, List<ICompilerProblem> problems, ISWF swf, boolean useCompression, boolean enableDebug)
-    {
-        this.m_project = project;
-        this.m_problems = problems;
-        this.swf = swf;
-        this.compilationUnits = null;
-        this.outputBuffer = new OutputBitStream(useCompression);
-    }
-
-    /**
-     * Create a SWF writer.
-     * 
-     * @param abc the ABC bytes to be encoded
-     * @param useCompression use ZLIB compression if true
-     */
-    public JSWriter(ICompilerProject project, List<ICompilerProblem> problems, Collection<ICompilationUnit> compilationUnits, boolean useCompression)
-    {
-        this.m_project = project;
-        this.m_problems = problems;
-        this.swf = null;
-        this.compilationUnits = compilationUnits;
-        this.outputBuffer = new OutputBitStream(useCompression);
-    }
-
-    private Boolean isStageCompilationUnit(ICompilationUnit cu)
-    {
-        if (cu != null)
-        {
-            final String name = cu.getName();
-            if (name.endsWith("(flash.display:Stage)"))
-                return true;
-        }
-        return false;
-    }
-
-    public String getTopLevelClass()
-    {
-        if (swf != null)
-            return swf.getTopLevelClass();
-        return null;
-    }
-
-    private void writeCode(List<byte[]> abcByteList, Boolean createSharedLib) throws InterruptedException
-    {
-        // start with the time stamp
-        // write time stamp to outputBuffer
-        if (JSSharedData.OUTPUT_TIMESTAMPS)
-            writeString("/** @preserve " + JSGeneratingReducer.getTimeStampString() + " */\n");
-
-        if (!JSSharedData.OUTPUT_ISOLATED)
-        {
-            // open function closure: function() { ... } 
-            writePrologue(createSharedLib);
-
-            // write out the framework root first.
-            writeFrameworkRoot(createSharedLib);
-
-            // write out DOM extensions.
-            writeDomExtensions();
-
-            // write out copyright notes
-            writeCopyrightNotes();
-
-            // write out package names
-            writePackageNames(createSharedLib);
-
-            // writeExternNames();
-
-            // write out namespace names
-            writeNamepaceNames();
-
-        }
-
-        // Current frame index. Updated in writeFrames().
-        for (byte[] abcBytes : abcByteList)
-        {
-            /*
-             * Extract abc from frame, see JSCompilationUnit::addToFrame():
-             * doABC.setAbcData(abc.getABCBytes()); doABC.setName("as3");
-             * frame.addTag(doABC);
-             */
-            {
-                // see SWFWriter::writeTag
-                {
-                    // see SWFWriter::writeDoABC
-
-                    Boolean isBinary = false;
-                    /*
-                     * see avm2overview.pdf, chapter 4.2 abcFile { u16
-                     * minor_version u16 major_version cpool_info constant_pool
-                     * u30 method_count method_info method[method_count] u30
-                     * metadata_count metadata_info metadata[metadata_count] u30
-                     * class_count instance_info instance[class_count]
-                     * class_info class[class_count] u30 script_count
-                     * script_info script[script_count] u30 method_body_count
-                     * method_body_info method_body[method_body_count] }
-                     */
-                    if (abcBytes.length > 2)
-                    {
-                        // 16 00 46 00
-                        final int minorVersion = 16;
-                        final int majorVersion = 46;
-                        if (abcBytes[0] == minorVersion &&
-                            abcBytes[2] == majorVersion)
-                        {
-                            isBinary = true;
-
-                            // throw new Error( "Embedded data is not supported yet." );
-
-                            /*
-                             * final AbcDump abcDump = new AbcDump();
-                             * abcDump.out = JSSharedData.STDOUT; ABCParser
-                             * parser = new ABCParser(abcBytes);
-                             * parser.parseAbc(abcDump);
-                             */
-                            /*
-                             * try { FileOutputStream out = new
-                             * FileOutputStream("/tmp/falcon-js.abc"); try {
-                             * out.write(abcBytes); out.close(); } catch(
-                             * IOException e ) { } } catch(
-                             * FileNotFoundException e ) { }
-                             */
-                        }
-                    }
-
-                    if (!isBinary)
-                        outputBuffer.write(abcBytes);
-                }
-            }
-        }
-
-        if (createSharedLib || !JSSharedData.OUTPUT_ISOLATED)
-        {
-            // write out adobe.finalize();
-            writeFinalize(createSharedLib);
-
-            // close closure: function() { ... } 
-            writeEpilogue(createSharedLib);
-        }
-    }
-
-    /*
-     * private Boolean hasEncryptedJS( ICompilationUnit cu ) throws
-     * InterruptedException { final JSSharedData sharedData =
-     * JSSharedData.instance; final List<IDefinition> defs =
-     * MXMLJSC.getDefinitions(cu, false); for( IDefinition def: defs ) { final
-     * String fullName = def.getQualifiedName(); if(
-     * sharedData.hasJavaScript(fullName) && sharedData.hasEncryptedJS(fullName)
-     * ) return true; } return false; }
-     */
-
-    private List<byte[]> getAbcData(ISWF swf, Boolean createSharedLib) throws InterruptedException
-    {
-        final JSSharedData sharedData = JSSharedData.instance;
-        final List<byte[]> abcByteList = new ArrayList<byte[]>();
-        if (swf == null)
-        {
-            for (ICompilationUnit cu : compilationUnits)
-            {
-                // only add topLevelClass to Stage if the Stage gets emitted.
-                if (!hasStage)
-                    hasStage = isStageCompilationUnit(cu);
-
-                final Boolean isSWC = cu instanceof SWCCompilationUnit;
-                if (createSharedLib == isSWC)
-                {
-                    final List<IDefinition> defs = MXMLJSC.getDefinitions(cu, false);
-                    for (IDefinition def : defs)
-                    {
-                        final String fullName = def.getQualifiedName();
-                        if (sharedData.hasJavaScript(fullName))
-                        {
-                            final String jsCode = sharedData.getJavaScript(fullName);
-                            abcByteList.add(jsCode.getBytes());
-                        }
-                    }
-
-                    final IABCBytesRequestResult codegenResult = cu.getABCBytesRequest().get();
-                    final byte[] abcBytes = codegenResult.getABCBytes();
-                    abcByteList.add(abcBytes);
-                }
-            }
-            return abcByteList;
-        }
-
-        // Current frame index. Updated in writeFrames().
-        for (int currentFrameIndex = 0; currentFrameIndex < swf.getFrameCount(); currentFrameIndex++)
-        {
-            final SWFFrame frame = swf.getFrameAt(currentFrameIndex);
-
-            // If the SWF has a top level class name, the first frame must contain a SymbolClass tag.
-            if (0 == currentFrameIndex && null != getTopLevelClass())
-            {
-                SWFFrame.forceSymbolClassTag(frame);
-            }
-
-            /*
-             * Extract abc from frame, see JSCompilationUnit::addToFrame():
-             * doABC.setAbcData(abc.getABCBytes()); doABC.setName("as3");
-             * frame.addTag(doABC);
-             */
-            for (final ITag tag : frame)
-            {
-                // see SWFWriter::writeTag
-                if (tag.getTagType() == TagType.DoABC)
-                {
-                    // see SWFWriter::writeDoABC
-                    final DoABCTag abcTag = ((DoABCTag)tag);
-                    byte[] abcBytes = abcTag.getABCData();
-
-                    Boolean isBinary = false;
-                    /*
-                     * see avm2overview.pdf, chapter 4.2 abcFile { u16
-                     * minor_version u16 major_version cpool_info constant_pool
-                     * u30 method_count method_info method[method_count] u30
-                     * metadata_count metadata_info metadata[metadata_count] u30
-                     * class_count instance_info instance[class_count]
-                     * class_info class[class_count] u30 script_count
-                     * script_info script[script_count] u30 method_body_count
-                     * method_body_info method_body[method_body_count] }
-                     */
-                    if (abcBytes.length > 2)
-                    {
-                        // 16 00 46 00
-                        final int minorVersion = 16;
-                        final int majorVersion = 46;
-                        if (abcBytes[0] == minorVersion &&
-                            abcBytes[2] == majorVersion)
-                        {
-                            isBinary = true;
-
-                            // throw new Error( "Embedded data is not supported yet." );
-
-                            if (abcTag.getName().startsWith("#"))
-                                sharedData.verboseMessage("ABC: " + abcTag.getName());
-
-                            /*
-                             * final AbcDump abcDump = new AbcDump();
-                             * abcDump.out = JSSharedData.STDOUT; ABCParser
-                             * parser = new ABCParser(abcBytes);
-                             * parser.parseAbc(abcDump);
-                             */
-                            /*
-                             * try { FileOutputStream out = new
-                             * FileOutputStream("/tmp/falcon-js.abc"); try {
-                             * out.write(abcBytes); out.close(); } catch(
-                             * IOException e ) { } } catch(
-                             * FileNotFoundException e ) { }
-                             */
-                        }
-                    }
-
-                    if (!isBinary)
-                    {
-                        final ICompilationUnit cu = sharedData.getCompilationUnit(frame);
-                        final Boolean isSWC = cu instanceof SWCCompilationUnit;
-
-                        // only add topLevelClass to Stage if the Stage gets emitted.
-                        if (!hasStage)
-                            hasStage = isStageCompilationUnit(cu);
-
-                        if (createSharedLib == isSWC)
-                        {
-                            if (cu != null && sharedData.isVerbose())
-                            {
-                                String str = cu.toString() + ": ";
-                                if (cu instanceof SWCCompilationUnit)
-                                {
-                                    Boolean comma = false;
-                                    final List<IDefinition> defs = MXMLJSC.getDefinitions(cu, true);
-                                    for (IDefinition def : defs)
-                                    {
-                                        if (comma)
-                                            str += ", ";
-                                        else
-                                            comma = true;
-                                        str += JSGeneratingReducer.createFullNameFromDefinition(cu.getProject(), def);
-                                    }
-                                }
-                                str += " " + abcBytes.length + " bytes.";
-                                sharedData.verboseMessage(str);
-                            }
-
-                            abcByteList.add(abcBytes);
-                        }
-                    }
-                }
-            }
-        }
-
-        return abcByteList;
-    }
-
-    public void writeTo(OutputStream output)
-    {
-        writeTo(output, false);
-    }
-
-    public void writeLibTo(OutputStream output)
-    {
-        writeTo(output, true);
-    }
-
-    private void writeTo(OutputStream output, Boolean createSharedLib)
-    {
-        assert output != null;
-
-        try
-        {
-            outputBuffer.reset();
-
-            List<byte[]> abcByteList = getAbcData(swf, createSharedLib);
-            if (!abcByteList.isEmpty())
-            {
-                writeCode(abcByteList, createSharedLib);
-
-                // if we are pulling in encrypted JS through a SWC that JS should probably 
-                // go into the shared lib and obfuscated with ADVANCED_OPTIMIZATIONS. Otherwise the whole point
-                // of encrypting JS would be defeated.
-                // At this point protecting intellectual property of JS and -js-generate-shared-library 
-                // have a lower priority than other features.
-                // DISABLED for now:
-                // if( JSSharedData.OPTIMIZE || (createSharedLib && JSSharedData.instance.hasAnyEncryptedJS()) )
-                // 		optimize( outputBuffer, createSharedLib );
-
-                // support for optimize=true
-                // if (JSSharedData.OPTIMIZE)
-                    // optimize(outputBuffer, createSharedLib);
-
-                output.write(outputBuffer.getBytes(), 0, outputBuffer.size());
-                output.flush();
-            }
-        }
-        catch (IOException e)
-        {
-            throw new RuntimeException(e);
-        }
-        catch (InterruptedException e)
-        {
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * Close the internal output buffer that stores the encoded SWF tags and
-     * part of the SWF header.
-     */
-    public void close() throws IOException
-    {
-        outputBuffer.close();
-    }
-
-    private void writeString(String s)
-    {
-        outputBuffer.write(s.getBytes());
-    }
-
-    protected void writeCopyrightNotes()
-    {
-        if (!JSSharedData.m_useClosureLib)
-        {
-            // Source: http://ejohn.org/blog/simple-javascript-inheritance/
-            final String jresigNote =
-                    "/* Simple JavaScript Inheritance\n" +
-                            " * By John Resig http://ejohn.org/\n" +
-                            " * MIT Licensed.\n" +
-                            " *\n" +
-                            " * Adobe Systems Inc. 2010.  Modifications:\n" +
-                            " * - added support for getter and setter.\n" +
-                            " * - all objects become jQuery objects if jQuery is present.\n" +
-                            " * - support for calling constructor functions directly, i.e. var s = Sprite();\n" +
-                            " * - ported to ActionScript so this code can be cross-compiled.\n" +
-                            " */\n" +
-                            "// Inspired by base2 and Prototype";
-
-            // write out the copyright note for John Resig's simple class inheritance in JS:
-            // http://ejohn.org/blog/simple-javascript-inheritance/
-            writeString(jresigNote + "\n\n");
-        }
-    }
-
-    protected void writePackageNames(Boolean createSharedLib)
-    {
-        writeString("\n");
-        writeString("/**\n");
-        writeString(" * Packages \n");
-        writeString(" */\n");
-
-        final Set<String> visited = new HashSet<String>();
-        final Set<String> packages = JSSharedData.instance.getPackages();
-        for (String name : packages)
-        {
-            String packageName = JSSharedData.ROOT_NAME;
-            String[] parts = name.split("\\.");
-            for (String part : parts)
-            {
-                if (!part.isEmpty())
-                {
-                    if (!packageName.isEmpty())
-                        packageName += ".";
-
-                    packageName += part;
-                    if (!visited.contains(packageName))
-                    {
-                        visited.add(packageName);
-
-                        writeString("/** @typedef { Object } */\n");
-                        if (!packageName.contains("."))
-                            writeString("var ");
-
-                        writeString(packageName + " = { _FULLNAME: \"" + packageName + "\"};\n");
-                    }
-                }
-            }
-        }
-        writeString("\n");
-    }
-
-    /*
-     * protected void writeExternNames() { final Set<String> externs =
-     * JSSharedData.instance.getUsedExterns(); if( !externs.isEmpty() ) {
-     * writeString( "\n" ); writeString( "/ **\n" ); writeString(
-     * " * Externs \n" ); writeString( " * /\n" ); for( String defName: externs
-     * ) { if( JSSharedData.instance.isReferencedDefinition(defName) ) { final
-     * IDefinition def = JSSharedData.instance.getDefinition(defName); String
-     * name = null; final IMetaTag extern =
-     * def.getMetaTagByName(JSSharedData.EXTERN_METATAG); if( extern != null )
-     * name = extern.getAttributeValue("name"); if( name == null ) name =
-     * def.getShortName(); // TODO: get rid of the hard-coded checks. String
-     * fullName = def.getPackageName(); if( !fullName.isEmpty() ) fullName +=
-     * "."; fullName += def.getName(); if( !fullName.equals(name) ) writeString(
-     * fullName + " = " + name + ";\n" ); } } writeString( "\n" ); } }
-     */
-
-    protected void writeNamepaceNames()
-    {
-        final Map<String, INamespaceDefinition> namespaces = JSSharedData.instance.getNamespaces();
-
-        if (!namespaces.isEmpty())
-        {
-            writeString("\n");
-            writeString("/**\n");
-            writeString(" * Namespace identifiers \n");
-            writeString(" */\n");
-
-            // see JSGeneratingReducer.reduce_namespaceDeclarationConstantInitializer() for where these get registered
-
-            for (Map.Entry<String, INamespaceDefinition> entry : namespaces.entrySet())
-            {
-                String uri = entry.getKey();
-                INamespaceDefinition nsDef = entry.getValue();
-
-                // TODO: should there be a package qualifier prefix?
-                String name = nsDef.getBaseName();
-
-                // TODO: value should really be an object of type Namespace, not a String; see FJS-65
-                writeString("var " + name + " = \"" + uri + "\";\n");
-            }
-            writeString("\n");
-        }
-
-    }
-
-    protected void writeFrameworkRoot(Boolean createSharedLib)
-    {
-        writeString("// Declaring missing types\n");
-        writeString("var IntClass = function(){};\n");
-        writeString("var UIntClass = function(){};\n");
-        writeString("\n");
-
-        // write out framework root object
-        if (JSSharedData.m_useClosureLib)
-        {
-            writeString("/**\n");
-            writeString(" * Framework: " + JSSharedData.JS_FRAMEWORK_NAME + "\n");
-            writeString(" */\n");
-            // writeString( "goog.provide(\"" + JSSharedData.JS_FRAMEWORK_NAME + "\");\n\n" ); 
-
-            if (createSharedLib)
-                writeString("var " + JSSharedData.JS_FRAMEWORK_NAME + " = __adobe || {};\n\n");
-            else
-                writeString("var " + JSSharedData.JS_FRAMEWORK_NAME + " = {};\n\n");
-
-            if (!JSSharedData.ROOT_NAME.isEmpty())
-            {
-                String rootName = JSSharedData.ROOT_NAME;
-                // remove trailing dot
-                if (rootName.endsWith("."))
-                    rootName = rootName.substring(0, rootName.length() - 1);
-
-                writeString("/**\n");
-                writeString(" * Root: " + rootName + "\n");
-                writeString(" */\n");
-                writeString("goog.provide(\"" + rootName + "\");\n");
-            }
-        }
-        else
-        {
-            writeString("/**\n");
-            writeString(" * Framework: " + JSSharedData.JS_FRAMEWORK_NAME + "\n");
-            writeString(" * @type {object}\n");
-            writeString(" */\n");
-            writeString("var " + JSSharedData.JS_FRAMEWORK_NAME + " = {};\n");
-
-        }
-
-        writeString(JSSharedData.JS_SYMBOLS + "= {};\n");
-
-        writeString("\n");
-    }
-
-    protected void writeDomExtensions()
-    {
-        if (JSSharedData.EXTEND_DOM)
-        {
-            final String indent = "\t";
-
-            // see also:
-            // http://hg.mozilla.org/tamarin-redux/file/758198237dc1/test/acceptance/ecma3
-            // http://qfox.nl/ecma/275
-            // http://code.google.com/p/sputniktests/
-            // http://es5.github.com/
-
-            writeString("\n");
-
-            writeString("// Additions to DOM classes necessary for passin Tamarin's acceptance tests.\n");
-            writeString("// Please use -js-extend-dom=false if you want to prevent DOM core objects changes.\n");
-            writeString("if( typeof(__global[\"Math\"].NaN) != \"number\" )\n");
-            writeString("{\n");
-
-            writeString(indent + "/**\n");
-            writeString(indent + " * @const\n");
-            writeString(indent + " * @type {function()}\n");
-            writeString(indent + " */\n");
-            writeString(indent + "var fnToString = function() { return \"function Function() {}\"; };\n");
-
-            writeString(indent + "/** @type {object} */\n");
-            writeString(indent + "var proto = {};\n");
-
-            // see e15_8_1.as
-            writeString("\n");
-            writeString(indent + "// Additions to Math\n");
-            writeString(indent + "__global[\"Math\"].NaN = NaN;\n");
-
-            // see e15_8_1.as, ecma3/Array/e15_4_2_1_3.
-            writeString("\n");
-            writeString(indent + "// Additions to Array (see e15_4_1_1, e15_4_2_1_1, e15_4_2_1_3, e15_4_2_2_1)\n");
-            writeString(indent + "proto = __global[\"Array\"].prototype;\n");
-            writeString(indent + "proto.toString.toString = fnToString;\n");
-            writeString(indent + "proto.join.toString = fnToString;\n");
-            writeString(indent + "proto.sort.toString = fnToString;\n");
-            writeString(indent + "proto.reverse.toString = fnToString;\n");
-
-            // In browsers, Array.prototype.unshift.length = 1, because
-            // the this value is coerced to an object.
-
-            // We need to hide unshift after setting it.
-            // Otherwise we'll get "unshift" for:
-            // var arr = new Array(); for( n in arr ) { console.info(n); }
-            writeString(indent + "if( Object.defineProperty )\n");
-            writeString(indent + "{\n");
-            writeString(indent + indent + "proto.unshift = (function ()\n");
-            writeString(indent + indent + "{\n");
-            writeString(indent + indent + indent + "/** @type {function()} */\n");
-            writeString(indent + indent + indent + "var f = proto.unshift;\n");
-            writeString(indent + indent + indent + "return function() { return f.apply(this,arguments); };\n");
-            writeString(indent + indent + "})();\n");
-            writeString(indent + indent + "Object.defineProperty( proto, \"unshift\", {enumerable: false} );\n");
-            writeString(indent + "}\n");
-
-            // see ecma3/ErrorObject/e15_11_2_1.as
-            writeString("\n");
-            writeString(indent + "// Additions to Error (see e15_11_2_1)\n");
-            writeString(indent + "proto = __global[\"Error\"].prototype;\n");
-            writeString(indent + "proto.getStackTrace = proto.getStackTrace || function() { return null; };\n");
-            writeString(indent + "proto.toString = (function ()\n");
-            writeString(indent + "{\n");
-            writeString(indent + indent + "/** @type {function()} */\n");
-            writeString(indent + indent + "var f = proto.toString;\n");
-            writeString(indent + indent + "return function () { return (this.name == this.message || this.message == \"\") ? this.name : f.call(this); };\n");
-            writeString(indent + "})();\n");
-
-            // see ecma3/ErrorObject/e15_11_2_1.as
-            writeString("\n");
-            writeString(indent + "proto = __global[\"Object\"].prototype;\n");
-            writeString(indent + "// Additions to Object (see e15_11_2_1)\n");
-            writeString(indent + "proto.toString = (function ()\n");
-            writeString(indent + "{\n");
-            writeString(indent + indent + "/** @type {function()} */\n");
-            writeString(indent + indent + "var f = proto.toString;\n");
-            writeString(indent + indent + "return function () { return (this instanceof Error) ? (\"[object \" + this.name + \"]\") : f.call(this); };\n");
-            writeString(indent + "})();\n");
-
-            writeString("}\n");
-        }
-
-    }
-
-    private void emitSettings()
-    {
-        final String topLevelClass = getTopLevelClass();
-        if (topLevelClass != null)
-        {
-            // support for no export 
-            if (!JSSharedData.NO_EXPORTS)
-            {
-                // We are now using createMain() isntead of m_topLevelClass
-                // writeString( "\tadobe.m_topLevelClass = " + JSSharedData.ROOT_NAME + getTopLevelClass() + ";\n" );
-                writeString("\tadobe.m_topLevelClass = null;\n");
-                writeString("\tgoog.exportSymbol(\"" + JSSharedData.JS_FRAMEWORK_NAME + ".m_topLevelClass\", " + JSSharedData.JS_FRAMEWORK_NAME + ".m_topLevelClass);\n");
-            }
-
-            // emit createMain
-            String create = "new " + JSSharedData.ROOT_NAME + topLevelClass + "()";
-            final String symbolName = JSSharedData.instance.getSymbol(topLevelClass);
-            if (symbolName != null && !symbolName.isEmpty())
-                create = symbolName + "." + JSSharedData.SYMBOL_INSTANCE + "." + JSSharedData.SYMBOL_INIT + "(" + create + ")";
-            writeString("\tadobe.createMain = function() { return " + create + "; };\n");
-
-        }
-
-        // shell.as is using flash.system.Capabilities.playerType, which must be set to "AVMPlus"
-        // var playerType /* : String */ = flash.system.Capabilities.playerType;
-        // flash.system.Capabilities.__static_init() must be called before we set playerType, see http://watsonexp.corp.adobe.com/#bug=3021707
-        if (JSSharedData.GENERATE_TEST_CASE)
-        {
-            writeString("\n");
-            writeString("\t// Setting playerType to AVMPlus for running Tamarin's acceptance tests.\n");
-            writeString("\tif( flash && flash.system && flash.system.Capabilities )\n");
-            writeString("\t{\n");
-            writeString("\t\tflash.system.Capabilities.__static_init();\n");
-            writeString("\t\tflash.system.Capabilities.playerType = \"AVMPlus\";\n");
-            writeString("\t}\n");
-        }
-    }
-
-    /*
-     * private void emitClassInfo() { writeString( "\n" ); writeString(
-     * "\t// Class Information \n" ); writeString( "\t" +
-     * JSSharedData.JS_FRAMEWORK_NAME + ".info = {};\n" ); Map<String,String>map
-     * = JSSharedData.instance.getClassInfo(); // sorted output final
-     * TreeSet<String> keys = new TreeSet<String>(map.keySet()); for(String key
-     * : keys) { final String value = map.get(key); writeString( "\t" +
-     * JSSharedData.JS_FRAMEWORK_NAME + ".info[\"" + key + "\"] = \"" + value +
-     * "\";\n" ); } }
-     */
-    /*
-     * private void emitExports() { writeString( "\n" ); writeString(
-     * "\t// Exported Symbols\n" ); writeString( "\t" +
-     * JSSharedData.JS_FRAMEWORK_NAME + ".root = {};\n" ); final Set<String>
-     * visited = new HashSet<String>(); final Set<Name> classes =
-     * JSSharedData.instance.getClasses(); List<String> sorted = new
-     * ArrayList<String>(); for(Name name : classes ) { if( name != null &&
-     * JSSharedData.instance.hasClassBeenEmitted(name) ) { String fullName = "";
-     * final String packageName =
-     * JSGeneratingReducer.getPackageNameFromName(name, false); if( packageName
-     * != null && !packageName.isEmpty() ) fullName += packageName + ".";
-     * fullName += name.getBaseName(); String[] parts = fullName.split("\\.");
-     * fullName = JSSharedData.ROOT_NAME; for( String part: parts ) { if(
-     * !part.isEmpty() ) { if( !fullName.isEmpty() ) fullName += "."; fullName
-     * += part; if(!visited.contains(fullName)) { visited.add(fullName); //
-     * collect symbols for later sorted.add("\tgoog.exportSymbol(\"" + fullName
-     * + "\", " + fullName + ", " + JSSharedData.JS_FRAMEWORK_NAME +
-     * ".root);\n"); } } } } } java.util.Collections.sort(sorted); for( String
-     * s: sorted ) { writeString( s ); } writeString( "\n" ); }
-     */
-
-    private void emitInterfacesInfo()
-    {
-        writeString("\n");
-        writeString("\t// Interfaces Information \n");
-        writeString("\t" + JSSharedData.JS_FRAMEWORK_NAME + ".interfaces = {};\n");
-
-        Map<Name, Set<Name>> map = JSSharedData.instance.getAllInterfaces();
-        Iterator<Map.Entry<Name, Set<Name>>> it = map.entrySet().iterator();
-        while (it.hasNext())
-        {
-            Map.Entry<Name, Set<Name>> pair = it.next();
-            final IDefinition def = JSSharedData.instance.getDefinition(pair.getKey());
-            final String className = def.getQualifiedName();
-            writeString("\t" + JSSharedData.JS_FRAMEWORK_NAME + ".interfaces[\"" + className + "\"] = ");
-            writeString("[");
-
-            Boolean emitComma = false;
-            Set<Name> interfaces = pair.getValue();
-            for (Name name : interfaces)
-            {
-                if (emitComma)
-                    writeString(", ");
-                else
-                    emitComma = true;
-                // writeString( JSGeneratingReducer.getFullNameFromName(name, true) );
-
-                String fullName = "";
-                if (name.getQualifiers().length() > 1)
-                {
-                    if (!JSSharedData.ROOT_NAME.isEmpty())
-                        fullName += JSSharedData.ROOT_NAME;
-
-                    // Picking a package qualifier at random (if there's more than one). We skip other things like
-                    // namespace qualifiers since their names might be URLs (not syntactically valid).
-                    Namespace packageNS = findAnyPackageQualifier(name);
-                    assert packageNS != null : "Unable to find a usable qualifier for " + name;
-
-                    fullName += packageNS.getName();
-                    fullName += "." + name.getBaseName();
-                }
-                else
-                {
-                    final IDefinition idef = JSSharedData.instance.getDefinition(name);
-                    fullName = idef.getQualifiedName();
-                }
-                writeString(fullName);
-            }
-
-            writeString("];\n");
-        }
-    }
-
-    private static Namespace findAnyPackageQualifier(Name name)
-    {
-        for (Namespace ns : name.getQualifiers())
-        {
-            if (ns.getKind() == ABCConstants.CONSTANT_PackageNs || ns.getKind() == ABCConstants.CONSTANT_PackageInternalNs)
-                return ns;
-        }
-        return null;
-    }
-
-    /*
-     * private void emitStaticInits() { writeString( "\n" ); writeString(
-     * "\t// Static inits \n" ); // writeString(
-     * JSSharedData.instance.getStaticInits("\t", "\n") ); // auto-register
-     * static inits. writeString( "\t" + JSSharedData.JS_RUN_STATIC_INITS + "("
-     * + JSSharedData.JS_STATIC_INITS + ");\n" ); writeString( "\tdelete(" +
-     * JSSharedData.JS_STATIC_INITS + ");\n" ); }
-     */
-
-    private void emitScriptInfos()
-    {
-        final Set<String> scriptInfos = JSSharedData.instance.getScriptInfos();
-        if (!scriptInfos.isEmpty())
-        {
-            writeString("\n");
-            for (String si : scriptInfos)
-            {
-                writeString(si);
-            }
-        }
-    }
-
-    private void emitSymbolInstances()
-    {
-        if (JSSharedData.instance.hasSymbols())
-        {
-            writeString("\n");
-            writeString("\n");
-            writeString("\t// Symbols \n");
-
-            final List<String> list = JSSharedData.instance.getSymbols();
-            for (String symbol : list)
-            {
-                writeString("\t" + JSSharedData.ROOT_NAME + symbol + "." + JSSharedData.SYMBOL_INSTANCE + " = new " + JSSharedData.ROOT_NAME + symbol + "();\n");
-            }
-        }
-    }
-
-    // support for generating test cases for JsTestDriver.
-    // see http://code.google.com/p/js-test-driver/wiki/TestCase
-    /*
-     * private void emitTestCase(String topLevelClass) { if(
-     * JSSharedData.GENERATE_TEST_CASE && topLevelClass != null ) { // support
-     * for [TestCase(name="...")] String testCaseName = topLevelClass;
-     * ASProjectScope projectScope = (ASProjectScope)m_project.getScope();
-     * IDefinition rootClassDef =
-     * projectScope.findDefinitionByName(topLevelClass); if (rootClassDef !=
-     * null) { final IMetaTag testCaseTag =
-     * rootClassDef.getMetaTagByName(JSSharedData.TESTCASE_METATAG );
-     * if(testCaseTag!= null) { final String testCaseAttr =
-     * testCaseTag.getAttributeValue("name"); if( testCaseAttr != null &&
-     * !testCaseAttr.isEmpty() ) testCaseName = testCaseAttr; } } writeString(
-     * "\n" ); writeString( "\t// Create and export " +
-     * JSSharedData.JS_FRAMEWORK_NAME + ".mainTestCase\n" ); writeString(
-     * "\tif(typeof(TestCase) != \"undefined\")\n" ); writeString( "\t{\n" );
-     * writeString( "\t\tadobe.mainTestCase = TestCase(\"" + testCaseName +
-     * "\");\n" ); writeString(
-     * "\t\tadobe.mainTestCase.prototype.testMain = function()\n" );
-     * writeString( "\t\t{\n" ); if( JSSharedData.MAIN != null ) { writeString(
-     * "\t\t\tconsole.info(\"Running " + JSSharedData.MAIN + "() ...\")\n" );
-     * writeString( "\t\t\t" + JSSharedData.MAIN + "();\n" ); } else {
-     * writeString( "\t\t\tconsole.info(\"Running " + testCaseName + " ...\")\n"
-     * ); writeString( "\t\t\tnew " + topLevelClass + "();\n" ); } writeString(
-     * "\t\t}\n" ); writeString( "\t\tgoog.exportSymbol( \"" +
-     * JSSharedData.JS_FRAMEWORK_NAME + ".mainTestCase\", " +
-     * JSSharedData.JS_FRAMEWORK_NAME + ".mainTestCase );\n" ); writeString(
-     * "\t\tgoog.exportSymbol( \"" + JSSharedData.JS_FRAMEWORK_NAME +
-     * ".mainTestCase.prototype.testMain\", " + JSSharedData.JS_FRAMEWORK_NAME +
-     * ".mainTestCase.prototype.testMain );\n" ); writeString( "\t}\n" ); } }
-     */
-    protected void writePrologue(Boolean createSharedLib)
-    {
-        if (createSharedLib)
-        {
-            writeString("/**\n");
-            writeString(" * @const\n");
-            writeString(" * @type {function()}\n");
-            writeString(" */\n");
-            writeString("var __libInit = function(__global, __adobe) {\n");
-        }
-        else if (JSSharedData.GENERATE_TEST_CASE)
-        {
-            // ensure there is always a TestCase.
-            String testCaseName;
-            String topLevelClass = getTopLevelClass();
-            if (topLevelClass == null)
-            {
-                final Date now = new Date();
-                testCaseName = topLevelClass = "Test_" + now.getTime();
-            }
-            else
-            {
-                testCaseName = topLevelClass;
-                final ASProjectScope projectScope = (ASProjectScope)m_project.getScope();
-                final IDefinition rootClassDef = projectScope.findDefinitionByName(topLevelClass);
-                if (rootClassDef != null)
-                {
-                    final IMetaTag testCaseTag = rootClassDef.getMetaTagByName(JSSharedData.TESTCASE_METATAG);
-                    if (testCaseTag != null)
-                    {
-                        final String testCaseAttr = testCaseTag.getAttributeValue("name");
-                        if (testCaseAttr != null && !testCaseAttr.isEmpty())
-                            testCaseName = testCaseAttr;
-                    }
-                }
-            }
-
-            // TODO: emit type annotations for Google's closure compiler.
-            writeString("var __global = this;\n");
-
-            writeString("/**\n");
-            writeString(" * @const\n");
-            writeString(" * @typedef {string}\n");
-            writeString(" */\n");
-            writeString("var testCaseName = \"" + testCaseName + "\";\n");
-            writeString("\n");
-
-            writeString("/**\n");
-            writeString(" * @const\n");
-            writeString(" * @typedef {boolean}\n");
-            writeString(" */\n");
-            writeString("var hasTestCase = typeof(TestCase) != \"undefined\";\n");
-            writeString("\n");
-
-            writeString("/**\n");
-            writeString(" * @const\n");
-            writeString(" * @type {array}\n");
-            writeString(" */\n");
-            writeString("var __testCases = [];\n");
-
-            writeString("/**\n");
-            writeString(" * @const\n");
-            writeString(" * @type {function()}\n");
-            writeString(" */\n");
-            writeString("var __runTestCases = function()\n");
-            writeString("{\n");
-            writeString("\tif(hasTestCase)\n");
-            writeString("\t\treturn;\n\n");
-            writeString("\twhile( __testCases.length > 0 )\n");
-            writeString("\t{\n");
-            writeString("\t\tvar tc = __testCases.shift();\n");
-            writeString("\t\tfor( var method in tc )\n");
-            writeString("\t\t{\n");
-            writeString("\t\t\tif( method.substring(0,4) == \"test\" )\n");
-            writeString("\t\t\t\ttc[method]();\n");
-            writeString("\t\t}\n");
-            writeString("\t}\n");
-            writeString("}\n");
-
-            writeString("/**\n");
-            writeString(" * @const\n");
-            writeString(" * @type {function(...)}\n");
-            writeString(" */\n");
-            writeString("var TestCase = hasTestCase ? TestCase : (function(name,testcase)\n");
-            writeString("\t{\n");
-            writeString("\t\tvar tc = testcase;\n");
-            writeString("\t\tif( tc )\n");
-            writeString("\t\t{\n");
-            writeString("\t\t\t__testCases.push(tc);\n");
-            writeString("\t\t}\n");
-            writeString("\t\telse\n");
-            writeString("\t\t{\n");
-            writeString("\t\t\ttc = function(){};\n");
-            writeString("\t\t\t __testCases.push(new tc());\n");
-            writeString("\t\t}\n");
-            writeString("\t\treturn tc;\n");
-            writeString("\t});\n");
-
-            writeString("\n");
-            writeString("/**\n");
-            writeString(" * @const\n");
-            writeString(" * @type {function(...)}\n");
-            writeString(" */\n");
-            writeString("var AsyncTestCase = hasTestCase ? AsyncTestCase : TestCase;\n");
-
-            writeString("\n");
-            writeString("/**\n");
-            writeString(" * @const\n");
-            writeString(" * @type {function(...)}\n");
-            writeString(" */\n");
-            writeString("var MainTestCase = TestCase(testCaseName);\n");
-            writeString("MainTestCase.prototype.testMain = function() {\n");
-            writeString("console.info(\"START TEST: \" + testCaseName );\n");
-            writeString("(function(__global) {\n");
-        }
-        else
-        {
-            writeString("(function(__global) {\n");
-        }
-    }
-
-    protected void writeEpilogue(Boolean createSharedLib)
-    {
-        if (createSharedLib)
-        {
-            writeString("}; // __libInit() \n\n");
-            writeString("goog.exportSymbol( \"__libInit\", __libInit);\n");
-        }
-        else if (JSSharedData.GENERATE_TEST_CASE)
-        {
-            writeString("})(__global);\n");
-            writeString("console.info(\"END TEST: \" + testCaseName );\n");
-            writeString("} // MainTestCase.prototype.testMain \n\n");
-
-            writeString("goog.exportSymbol( \"MainTestCase\", MainTestCase);\n");
-            writeString("goog.exportSymbol( \"MainTestCase.prototype.testMain\", MainTestCase.prototype.testMain);\n");
-
-            writeString("__runTestCases();\n");
-        }
-        else
-        {
-            writeString("})(this);\n");
-        }
-    }
-
-    protected void writeFinalize(Boolean createSharedLib)
-    {
-        writeString("\n");
-
-        // ASProjectScope projectScope = applicationProject.getScope();
-        // IDefinition rootClassDef = projectScope.findDefinitionByName(getTopLevelClass());
-
-        // export toplevel class
-
-        // support for no export 
-        final String topLevelClass = getTopLevelClass();
-        if (topLevelClass != null && !JSSharedData.NO_EXPORTS)
-        {
-            writeString("// Top Level Class\n");
-            writeString("goog.exportSymbol(\"" + JSSharedData.ROOT_NAME + topLevelClass + "\", "
-                                                + JSSharedData.ROOT_NAME + topLevelClass + ");\n");
-            writeString("// Export " + JSSharedData.JS_FRAMEWORK_NAME + ".createStage\n");
-            writeString("goog.exportSymbol( \"" + JSSharedData.JS_FRAMEWORK_NAME + ".createStage\", " + JSSharedData.JS_FRAMEWORK_NAME + ".createStage );\n\n");
-        }
-
-        final String finalize = "staticInits";
-
-        // generated finalize() function 
-        writeString("/** \n");
-        writeString(" * Generated finalizer.\n");
-        writeString(" * @param {DOMWindow} global Global object\n");
-        writeString(" * @param {" + JSSharedData.ROOT_NAME + "browser.IFramework} framework Framework to use\n");
-        writeString(" */\n");
-        writeString(JSSharedData.JS_FRAMEWORK_NAME + "." + finalize + " = function(global,framework)\n");
-        writeString("{\n");
-        writeString("\tadobe.globals = global;\n");
-        writeString("\tadobe.m_framework = framework;\n");
-
-        writeString("\tadobe.uintClass = UIntClass;\n");
-        writeString("\tadobe.intClass = IntClass;\n");
-
-        emitSettings();
-        // emitExports();
-        // emitClassInfo();
-        emitInterfacesInfo();
-        // emitStaticInits();
-        emitSymbolInstances();
-        // emitTestCase(topLevelClass);
-        writeString("}\n\n");
-
-        // select framework 
-        writeString("/** \n");
-        writeString(" * Selected framework, i.e. JQueryFramework, or GoogleFramework\n");
-        writeString(" * @typedef {" + JSSharedData.ROOT_NAME + "browser.IFramework}\n");
-        writeString(" */\n");
-        writeString("var framework = new " + JSSharedData.ROOT_NAME + JSSharedData.FRAMEWORK_CLASS + "();\n\n");
-
-        // call finalize() 
-        writeString("// Call static initialization chain\n");
-        writeString(JSSharedData.JS_FRAMEWORK_NAME + "." + finalize + "(goog.global,framework);\n\n");
-
-        emitScriptInfos();
-
-        // support for no export
-        if (!createSharedLib)
-        {
-            if (JSSharedData.MAIN != null)
-            {
-                writeString("// Main entry point: " + JSSharedData.MAIN + "\n");
-                writeString(JSSharedData.MAIN + "();\n\n");
-            }
-            else if (topLevelClass != null)
-            {
-                if (hasStage)
-                {
-                    writeString("// Main entry point: wrapper for adding " + topLevelClass + " to the stage.\n");
-                    writeString("function main()\n");
-                    writeString("{\n");
-                    writeString("\t/** @type {flash.display.Stage} */\n");
-                    writeString("\tvar stage /* : Stage */ = flash.display.Stage.instance();\n");
-                    writeString("\t/** @type {flash.display.DisplayObject} */\n");
-                    writeString("\tvar sprite /* : DisplayObject */ = (new " + JSSharedData.ROOT_NAME + topLevelClass + "());\n");
-                    writeString("\tstage.addChild(sprite);\n");
-                    writeString("}\n\n");
-
-                    writeString("// Delay creation of " + topLevelClass + "\n");
-                    writeString("document.addEventListener( \"DOMContentLoaded\", main, false );\n\n");
-                }
-                else
-                {
-                    writeString("// Main entry point: wrapper for creating " + topLevelClass + "\n");
-                    writeString("\t/** @type {flash.display.DisplayObject} */\n");
-                    writeString("\tvar sprite /* : DisplayObject */ = (new " + JSSharedData.ROOT_NAME + topLevelClass + "());\n");
-                }
-            }
-        }
-    }
-
-    // see http://blog.bolinfest.com/2009/11/calling-closure-compiler-from-java.html
-    private void optimize(OutputBitStream outputbuffer, Boolean createSharedLib) throws IOException
-    {
-        /*
-         * <arg value="--compilation_level=ADVANCED_OPTIMIZATIONS"/> <arg value=
-         * "--externs=${falcon-sdk}/lib/google/closure-compiler/contrib/externs/jquery-1.5.js"
-         * /> <arg value=
-         * "--externs=${falcon-sdk}/lib/google/closure-compiler/contrib/externs/svg.js"
-         * /> <arg value=
-         * "--externs=${falcon-sdk}/lib/google/closure-compiler/contrib/externs/jsTestDriver.js"
-         * /> <arg value="--formatting=PRETTY_PRINT"/> <arg
-         * value="--js=${falcon-sdk}/frameworks/javascript/goog/base.js"/> <arg
-         * value="--js=${build.target.js}"/> <arg
-         * value="--js_output_file=${build.target.compiled.js}"/> <arg
-         * value="--create_source_map=${build.target.compiled.map}"/>
-         */
-        String code = new String(outputbuffer.getBytes());
-        code = code.substring(0, outputBuffer.size());
-        Compiler compiler = new Compiler();
-
-        CompilerOptions options = new CompilerOptions();
-
-        if (JSSharedData.CLOSURE_compilation_level.equals("ADVANCED_OPTIMIZATIONS"))
-            CompilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
-        else if (createSharedLib && JSSharedData.instance.hasAnyEncryptedJS())
-            CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
-        else if (JSSharedData.CLOSURE_compilation_level.equals("WHITESPACE_ONLY"))
-            CompilationLevel.WHITESPACE_ONLY.setOptionsForCompilationLevel(options);
-        else
-            CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
-
-        String sdkPath = null;
-        if (JSSharedData.CLOSURE_externs == null || JSSharedData.CLOSURE_js == null)
-        {
-            sdkPath = JSSharedData.SDK_PATH;
-        }
-
-        // To get the complete set of externs, the logic in
-        // CompilerRunner.getDefaultExterns() should be used here.
-        final List<JSSourceFile> extern = CommandLineRunner.getDefaultExterns();
-        if (JSSharedData.CLOSURE_externs != null)
-        {
-            for (String externsFile : JSSharedData.CLOSURE_externs)
-                extern.add(JSSourceFile.fromFile(externsFile));
-        }
-        else if (sdkPath != null)
-        {
-            /*
-             * <arg value=
-             * "--externs=${falcon-sdk}/lib/google/closure-compiler/contrib/externs/jquery-1.5.js"
-             * /> <arg value=
-             * "--externs=${falcon-sdk}/lib/google/closure-compiler/contrib/externs/svg.js"
-             * /> <arg value=
-             * "--externs=${falcon-sdk}/lib/google/closure-compiler/contrib/externs/jsTestDriver.js"
-             * />
-             */
-            extern.add(JSSourceFile.fromFile(sdkPath + "/lib/google/closure-compiler/contrib/externs/svg.js"));
-            if (JSSharedData.FRAMEWORK_CLASS.equals("browser.JQueryFramework"))
-                extern.add(JSSourceFile.fromFile(sdkPath + "/lib/google/closure-compiler/contrib/externs/jquery-1.5.js"));
-            if (JSSharedData.GENERATE_TEST_CASE)
-                extern.add(JSSourceFile.fromFile(sdkPath + "/lib/google/closure-compiler/contrib/externs/jsTestDriver.js"));
-        }
-
-        final List<JSSourceFile> input = new ArrayList<JSSourceFile>();
-        if (JSSharedData.CLOSURE_js != null)
-        {
-            for (String inputFile : JSSharedData.CLOSURE_js)
-                input.add(JSSourceFile.fromFile(inputFile));
-        }
-        else if (sdkPath != null)
-        {
-            // <arg value="--js=${falcon-sdk}/frameworks/javascript/goog/base.js"/>
-            input.add(JSSourceFile.fromFile(sdkPath + "/frameworks/javascript/goog/base.js"));
-        }
-
-        // The dummy input name "input.js" is used here so that any warnings or
-        // errors will cite line numbers in terms of input.js.
-        input.add(JSSourceFile.fromCode("input.js", code.toString()));
-        // input.add( JSSourceFile.fromCode("input.js", "/** @preserve CROSS-COMPILED BY FALCONJS (320588.13) ON 2011-09-09 22:18:10 */\nvar __global = this;\n") );
-
-        if (JSSharedData.CLOSURE_create_source_map != null)
-            options.sourceMapOutputPath = JSSharedData.CLOSURE_create_source_map;
-
-        if (JSSharedData.CLOSURE_formatting != null)
-        {
-            if (JSSharedData.CLOSURE_formatting.equals("PRETTY_PRINT"))
-                options.prettyPrint = true;
-            else if (JSSharedData.CLOSURE_formatting.equals("PRINT_INPUT_DELIMITER"))
-                options.prettyPrint = true;
-            else
-                throw new RuntimeException("Unknown formatting option: " + JSSharedData.CLOSURE_formatting);
-        }
-        else if (JSSharedData.DEBUG)
-        {
-            options.prettyPrint = true;
-        }
-
-        // turn off closure's logger depending on verbose mode.
-        if (!JSSharedData.instance.isVerbose())
-        {
-            final Logger logger = Logger.getLogger("com.google.javascript.jscomp");
-            logger.setLevel(Level.OFF);
-        }
-
-        try
-        {
-            // compile() returns a Result, but it is not needed here.
-            compiler.compile(extern, input, options);
-
-            if (compiler.getErrorCount() == 0)
-            {
-                // The compiler is responsible for generating the compiled code; it is not
-                // accessible via the Result.
-                final String optimizedCode = compiler.toSource();
-                outputbuffer.reset();
-                outputbuffer.write(optimizedCode.getBytes());
-            }
-            else if (m_problems != null)
-            {
-                final JSError[] errors = compiler.getErrors();
-                for (JSError err : errors)
-                    m_problems.add(new ClosureProblem(err));
-            }
-        }
-
-        /*
-         * internal compiler error generated with optimize enabled compiling
-         * as3_enumerate.fla and fails to release the JS file
-         * http://watsonexp.corp.adobe.com/#bug=3047880 This is part #3 of the
-         * fix: The closure compiler throws RTEs on internal compiler errors,
-         * that don't get caught until they bubble up to MXMLJSC's scope. On
-         * their way out files remain unclosed and cause problems, because Flame
-         * cannot delete open files. The change below addresses this problem.
-         */
-        catch (RuntimeException rte)
-        {
-            if (m_problems != null)
-            {
-                final ICompilerProblem problem = new InternalCompilerProblem(rte);
-                m_problems.add(problem);
-            }
-        }
-    }
-
-    /**
-     * {@inherit}
-     */
-    @Override
-    public int writeTo(File outputFile) throws FileNotFoundException, IOException
-    {
-        return 0;
-    }
-
-    public class ClosureProblem implements ICompilerProblem
-    {
-        private JSError m_error;
-
-        public ClosureProblem(JSError error)
-        {
-            m_error = error;
-        }
-
-        /**
-         * Returns a unique identifier for this type of problem.
-         * <p>
-         * Clients can use this identifier to look up, in a .properties file, a
-         * localized template string describing the problem. The template string
-         * can have named placeholders such as ${name} to be filled in, based on
-         * correspondingly-named fields in the problem instance.
-         * <p>
-         * Clients can also use this identifier to decide whether the problem is
-         * an error, a warning, or something else; for example, they might keep
-         * a list of error ids and a list of warning ids.
-         * <p>
-         * The unique identifier happens to be the fully-qualified classname of
-         * the problem class.
-         * 
-         * @return A unique identifier for the type of problem.
-         */
-        public String getID()
-        {
-            // Return the fully-qualified classname of the CompilerProblem subclass
-            // as a String to identify the type of problem that occurred.
-            return getClass().getName();
-        }
-
-        /**
-         * Gets the path of the file in which the problem occurred.
-         * 
-         * @return The path of the source file, or null if unknown.
-         */
-        public String getFilePath()
-        {
-            return m_error.sourceName;
-        }
-
-        /**
-         * Gets the offset within the source buffer at which the problem starts.
-         * 
-         * @return The starting offset, or -1 if unknown.
-         */
-        public int getStart()
-        {
-            return m_error.getCharno();
-        }
-
-        /**
-         * Gets the offset within the source buffer at which the problem ends.
-         * 
-         * @return The ending offset, or -1 if unknown.
-         */
-        public int getEnd()
-        {
-            return -1;
-        }
-
-        /**
-         * Gets the line number within the source buffer at which the problem
-         * starts. Line numbers start at 0, not 1.
-         * 
-         * @return The line number, or -1 if unknown.
-         */
-        public int getLine()
-        {
-            return m_error.lineNumber;
-        }
-
-        /**
-         * Gets the column number within the source buffer at which the problem
-         * starts. Column numbers start at 0, not 1.
-         * 
-         * @return The column number, of -1 if unknown.
-         */
-        public int getColumn()
-        {
-            return -1;
-        }
-
-        /**
-         * Returns a readable description of the problem, by substituting field
-         * values for named placeholders such as ${name} in the localized
-         * template.
-         * 
-         * @param template A localized template string describing the problem,
-         * determined by the client from the problem ID. If this parameter is
-         * null, an English template string, stored as the DESCRIPTION of the
-         * problem class, will be used.
-         * @return A readable description of the problem.
-         */
-        public String getDescription(String template)
-        {
-            return m_error.description;
-        }
-
-        /**
-         * Compares this problem to another problem by path, line, and column so
-         * that problems can be sorted.
-         */
-        final public int compareTo(final ICompilerProblem other)
-        {
-            if (getFilePath() != null && other.getSourcePath() != null)
-            {
-                final int pathCompare = getFilePath().compareTo(other.getSourcePath());
-                if (pathCompare != 0)
-                    return pathCompare;
-            }
-            else if (getFilePath() != null && other.getSourcePath() == null)
-            {
-                return 1;
-            }
-            else if (getFilePath() == null && other.getSourcePath() != null)
-            {
-                return -1;
-            }
-
-            if (getLine() < other.getLine())
-                return -1;
-            else if (getLine() > other.getLine())
-                return 1;
-
-            if (getColumn() < other.getColumn())
-                return -1;
-            else if (getColumn() > other.getColumn())
-                return 1;
-
-            return 0;
-        }
-
-        public int getAbsoluteEnd()
-        {
-            // TODO Auto-generated method stub
-            return 0;
-        }
-
-        public int getAbsoluteStart()
-        {
-            // TODO Auto-generated method stub
-            return 0;
-        }
-
-        public String getSourcePath()
-        {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/cmc-js.jbg
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/cmc-js.jbg b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/cmc-js.jbg
deleted file mode 100644
index c1e7830..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/cmc-js.jbg
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- *
- *  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.
- *
- */
-
-/**
- * cmc-js.jbg mirrors cmc.jbg and contains FalconJS's definitions for JBurg.
- *
- * After making changes to cmc-js.jbg or JSCmcRules.jbg you need to run this command 
- * in the ./compiler/trunk folder:
- *  
- *      ant -f build-js.xml
- * 
- * This implementation is part of FalconJS.
- * For more details on FalconJS see org.apache.flex.compiler.JSDriver.
- * 
- */
-
-package org.apache.flex.compiler.internal.as.codegen;
-
-header
-{
-    import org.apache.flex.compiler.problems.ICompilerProblem;
-    import org.apache.flex.compiler.problems.*;
-
-    import static org.apache.flex.abc.ABCConstants.*;
-
-    import org.apache.flex.abc.semantics.Label;
-    import org.apache.flex.abc.semantics.Name;
-    import org.apache.flex.abc.semantics.Namespace;
-    import org.apache.flex.abc.instructionlist.InstructionList;
-
-    import org.apache.flex.compiler.constants.IASLanguageConstants;
-
-    import org.apache.flex.compiler.tree.ASTNodeID;
-    import static org.apache.flex.compiler.tree.ASTNodeID.*;
-
-    import org.apache.flex.compiler.internal.semantics.SemanticUtils;
-
-    import org.apache.flex.compiler.tree.as.IASNode;
-    import org.apache.flex.compiler.tree.as.ITryNode;
-
-	import org.apache.flex.abc.semantics.ECMASupport;
-}
-
-INodeType IASNode;
-OpcodeType ASTNodeID;
-
-/*
- *  The I-node type is IASNode, and it has its own adapter.
- */
-INodeAdapter org.apache.flex.compiler.internal.as.codegen.IASNodeAdapter;
-
-//  Generate Java output.
-Language java;
-
-ReturnType String;
-ReturnType InstructionList = String;
-
-ReturnType name = Binding;
-ReturnType type_name = Binding;
-ReturnType decl_name = Name;
-ReturnType new_type_name = Binding;
-ReturnType qualifiedName = Binding;
-ReturnType qualifiedNamePart = String;
-ReturnType return_type_name = Binding;
-
-ReturnType dottedNamePart = String;
-
-ReturnType conditionalElements = JSGeneratingReducer.ConditionalFragment;
-
-ReturnType ifElseIf = JSGeneratingReducer.ConditionalFragment;
-
-ReturnType catch_block = JSGeneratingReducer.CatchPrototype;
-
-ReturnType integer_constant = Integer;
-ReturnType uint_constant = Long;
-ReturnType double_constant = Double;
-ReturnType string_constant = String;
-ReturnType boolean_constant = Boolean;
-ReturnType float_constant = Float;
-
-ReturnType numeric_constant = Number;
-
-ReturnType constant_value = Object;
-ReturnType required_constant_value = Object;
-
-ReturnType non_resolving_identifier = String;
-
-ReturnType runtime_name_expression = JSGeneratingReducer.RuntimeMultiname;
-ReturnType multinameL = Name;
-ReturnType stmt_label = String;
-ReturnType e4x_literal = String;
-
-JBurg.Constant ERROR_TRAP = 268435456;
-
-{
-    final static boolean NEED_VALUE = true;
-    final static boolean DISCARD_VALUE = false;
-
-
-    /**
-     *  The reducer has all the implementation
-     *  logic for the rewrite; the BURM constructed
-     *  by this specification drives that logic.
-     */
-    JSGeneratingReducer reducer;
-
-    /**
-     *  Delegate calls to pushNumericConstant to the reducer.
-     *  This routine is called from other parts of the code generator,
-     *  so it's necessary to keep this layer of indirection.
-     */
-    public static void pushNumericConstant(long value, String result_list)
-    {
-        JSGeneratingReducer.pushNumericConstant(value, result_list);
-    }
-
-    /*
-     *  **  Cost functions  **
-     */
-
-
-    /**
-     *  @return "feasible" if the reducer can reduce this to a dotted name.
-     */
-    int isDottedName(IASNode iNode)
-    {
-       return reducer.isDottedName(iNode);
-    }
-
-    /**
-     *  @return "feasible" if the reducer can reduce this to a dotted name.
-     */
-    int isPackageName(IASNode iNode)
-    {
-       return reducer.isPackageName(iNode);
-    }
-
-    /**
-     *  @return "feasible" if this node's qualifier is a compile-time constant.
-     */
-    int qualifierIsCompileTimeConstant(IASNode iNode)
-    {
-       return reducer.qualifierIsCompileTimeConstant(iNode);
-    }
-
-    /**
-    /**
-     *  @return "feasible" if this node's qualifier is an interface.
-     */
-    int qualifierIsInterface(IASNode iNode)
-    {
-       return reducer.qualifierIsInterface(iNode);
-    }
-
-    /**
-     *  @return "feasible" if this node can be resolved to a compile-time constant.
-     */
-    int isCompileTimeConstant(IASNode iNode)
-    {
-       return reducer.isCompileTimeConstant(iNode);
-    }
-
-    /**
-     *  @return "feasible" if this function call node can be resolved to a compile-time constant function.
-     */
-    int isCompileTimeConstantFunction(IASNode iNode)
-    {
-       return reducer.isCompileTimeConstantFunction(iNode);
-    }
-
-    /**
-     *  @return "feasible" if this node is for 'new Array()'.
-     */
-    int isEmptyArrayConstructor(IASNode iNode)
-    {
-        return reducer.isEmptyArrayConstructor(iNode);
-    }
-
-    /**
-     *  @return "feasible" if this node is for 'new Object()'.
-     */
-    int isEmptyObjectConstructor(IASNode iNode)
-    {
-        return reducer.isEmptyObjectConstructor(iNode);
-    }
-    
-    /**
-     *  @return "feasible" if this node is "super(this)".
-     */
-    int isSuperThisForFieldAccess(IASNode iNode)
-    {
-        return SemanticUtils.isSuperThisForFieldAccess(iNode);
-    }
-
-    /**
-     * @return "feasible" if the base and parameter types of
-     * a parameterized type are both known types.
-     */
-    int parameterTypeIsConstant(IASNode iNode)
-    {
-        return reducer.parameterTypeIsConstant(iNode);
-    }
-
-    /**
-     * @return "feasible" if a standalone "super" expression is in a parameter list.
-     */
-    int isValidStandaloneSuper(IASNode iNode)
-    {
-        return /* SemanticUtils.isValidStandaloneSuper(iNode)? 1: */ Integer.MAX_VALUE;
-    }
-    
-    /**
-     * @return "feasible" if this node resolves to a type definition.
-     */
-    int isKnownType(IASNode iNode)
-    {
-        return reducer.isKnownType(iNode);
-    }
-
-    /*
-     *  ******************************
-     *  **  IASNodeAdapter Support  **
-     *  ******************************
-     */
-    /**
-     *  Get the default child of a node type that requires special handling.
-     *  @param parent - the child's parent node.
-     *  @param index - the desired child.
-     *  @return the child at the specified (abstract) index, or null
-     *    if no such child exists.
-     */
-    public static IASNode getDefaultChild(IASNode parent, int index)
-    {
-        switch(parent.getNodeID())
-        {
-            case VariableID:
-            case BindableVariableID:
-                {
-                    //  Look for chained variable definitions.
-                    IASNode candidate = parent.getChild(index);
-
-                    if ( candidate != null )
-                    {
-                        ASTNodeID candidateID = candidate.getNodeID();
-                        if( candidateID == VariableID || candidateID == BindableVariableID )
-                        {
-                            return candidate;
-                        }
-                    }
-                    return null;
-                }
-
-            case Op_CommaID:
-                return parent.getChild(index-1);
-
-            case FunctionID:
-            case GetterID:
-            case SetterID:
-                return null;
-
-            case TryID:
-                {
-                    //  Note: If the try has a contents and finally nodes,
-                    //  they are presented to the CG by getNthChild() as child
-                    //  nodes 0 and 1 before the n-ary tail of catch nodes.
-                    if (((ITryNode)parent).getStatementContentsNode() != null)
-                    	index--;
-                    if (((ITryNode)parent).getFinallyNode() != null)
-                    	index--;
-                    return ((ITryNode)parent).getCatchNode(index);
-                }
-            default:
-                return parent.getChild(index);
-        }
-    }
-
-    /**
-     *  recordError is a convenience method for error reductions;
-     *  it adds a problem to the current set of problems and
-     *  returns an empty String.
-     *  @return an empty String.
-     */
-    String recordError(ICompilerProblem problem)
-    {
-        reducer.getProblems().add(problem);
-        return "";
-    }
-}
-
-/*
- *  Error recovery routine: deduce what we can from the problem
- *  tree, then abort this BURM with an exception that the caller
- *  can catch and ignore.
- */
-
-/* 
-bparadie, 2011-12-01: Tom recommends not using DefaultErrorHandler at all.
-
-DefaultErrorHandler
-{
-    new UnknownTreeHandler(reducer.getProblems()).analyze(p);
-    throw new BURMAbortException();
-}
-*/
-
-/*
- *  Patterns and rules are stored in their own, shareable file.
- */
-JBurg.include "../../../../../../../../../compiler/src/org/apache/flex/compiler/internal/as/codegen/CmcPatterns.jbg"
-JBurg.include "../../../../../../../../../compiler/src/org/apache/flex/compiler/internal/as/codegen/CmcRules.jbg"
-JBurg.include "../../../../../../../../../compiler/src/org/apache/flex/compiler/internal/as/codegen/SemanticErrors.jbg"
-

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/driver/IBackend.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/driver/IBackend.java b/compiler.js/src/org/apache/flex/compiler/internal/driver/IBackend.java
deleted file mode 100644
index 2985c1f..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/driver/IBackend.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- *
- *  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.internal.driver;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.flex.abc.visitors.IABCVisitor;
-import org.apache.flex.compiler.config.Configurator;
-import org.apache.flex.compiler.internal.as.codegen.CmcJSEmitter;
-import org.apache.flex.compiler.internal.as.codegen.InterfaceDirectiveProcessor;
-import org.apache.flex.compiler.internal.as.codegen.JSEmitter;
-import org.apache.flex.compiler.internal.as.codegen.JSGeneratingReducer;
-import org.apache.flex.compiler.internal.as.codegen.JSGenerator;
-import org.apache.flex.compiler.internal.as.codegen.JSGlobalDirectiveProcessor;
-import org.apache.flex.compiler.internal.as.codegen.JSClassDirectiveProcessor;
-import org.apache.flex.compiler.internal.as.codegen.JSWriter;
-import org.apache.flex.compiler.internal.as.codegen.LexicalScope;
-import org.apache.flex.compiler.internal.projects.CompilerProject;
-import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
-import org.apache.flex.compiler.internal.tree.as.ClassNode;
-import org.apache.flex.compiler.internal.tree.as.InterfaceNode;
-import org.apache.flex.compiler.problems.ICompilerProblem;
-import org.apache.flex.compiler.projects.ICompilerProject;
-import org.apache.flex.compiler.targets.ISWFTarget;
-import org.apache.flex.compiler.targets.ITargetProgressMonitor;
-import org.apache.flex.compiler.targets.ITargetSettings;
-import org.apache.flex.compiler.units.ICompilationUnit;
-import org.apache.flex.swf.ISWF;
-import org.apache.flex.swf.io.ISWFWriter;
-
-public interface IBackend
-{
-    // called by MXMLJSC
-    public Configurator createConfigurator();
-
-    public ISWFWriter createSWFWriter(ICompilerProject project, List<ICompilerProblem> problems, ISWF swf, boolean useCompression, boolean enableDebug);
-
-    public JSWriter createJSWriter(ICompilerProject project, List<ICompilerProblem> problems, Collection<ICompilationUnit> compilationUnits, boolean useCompression);
-
-    public ISWFTarget createSWFTarget(CompilerProject project, ITargetSettings targetSettings, ITargetProgressMonitor progressMonitor) throws InterruptedException;
-
-    public ISourceFileHandler getSourceFileHandlerInstance();
-
-    // TODO: can all reducers be derived from IGenerator?
-    // called by JSCompilationUnit.
-    public JSGenerator createGenerator();
-
-    // called by JSGenerator.
-    public JSEmitter createEmitter(ICompilationUnit.Operation buildPhase, ICompilerProject project, JSGenerator generator);
-
-    // TODO: can all reducers be derived from ICmcEmitter?
-    // called by JSGenerator.
-    public CmcJSEmitter createCmcJSEmitter();
-
-    // TODO: can all reducers be derived from IReducer?
-    // called by JSGenerator.
-    public JSGeneratingReducer createReducer();
-
-    // TODO: GlobalDirectiveProcessor is not visible
-    // called by JSGenerator.
-    public JSGlobalDirectiveProcessor createGlobalDirectiveProcessor(JSGenerator generator, LexicalScope current_scope, IABCVisitor emitter);
-
-    // TODO: ClassDirectiveProcessor is not visible
-    public JSClassDirectiveProcessor createClassDirectiveProcessor(JSGenerator generator, ClassNode c, LexicalScope enclosing_scope, IABCVisitor emitter);
-
-    public InterfaceDirectiveProcessor createInterfaceDirectiveProcessor(JSGenerator jsGenerator, InterfaceNode in, LexicalScope enclosing_scope, IABCVisitor emitter);
-
-    public RuntimeException createException(String msg);
-
-    public String getOutputExtension();
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/driver/JSBackend.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/driver/JSBackend.java b/compiler.js/src/org/apache/flex/compiler/internal/driver/JSBackend.java
deleted file mode 100644
index b081721..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/driver/JSBackend.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- *
- *  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.internal.driver;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.flex.abc.visitors.IABCVisitor;
-import org.apache.flex.compiler.clients.JSCommandLineConfiguration;
-import org.apache.flex.compiler.config.Configurator;
-import org.apache.flex.compiler.internal.as.codegen.CmcJSEmitter;
-import org.apache.flex.compiler.internal.as.codegen.InterfaceDirectiveProcessor;
-import org.apache.flex.compiler.internal.as.codegen.JSEmitter;
-import org.apache.flex.compiler.internal.as.codegen.JSGeneratingReducer;
-import org.apache.flex.compiler.internal.as.codegen.JSGenerator;
-import org.apache.flex.compiler.internal.as.codegen.JSGlobalDirectiveProcessor;
-import org.apache.flex.compiler.internal.as.codegen.JSClassDirectiveProcessor;
-import org.apache.flex.compiler.internal.as.codegen.JSInterfaceDirectiveProcessor;
-import org.apache.flex.compiler.internal.as.codegen.JSSharedData;
-import org.apache.flex.compiler.internal.as.codegen.JSWriter;
-import org.apache.flex.compiler.internal.as.codegen.LexicalScope;
-import org.apache.flex.compiler.internal.projects.CompilerProject;
-import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
-import org.apache.flex.compiler.internal.tree.as.ClassNode;
-import org.apache.flex.compiler.internal.tree.as.InterfaceNode;
-import org.apache.flex.compiler.problems.ICompilerProblem;
-import org.apache.flex.compiler.projects.ICompilerProject;
-import org.apache.flex.compiler.targets.ISWFTarget;
-import org.apache.flex.compiler.targets.ITargetProgressMonitor;
-import org.apache.flex.compiler.targets.ITargetSettings;
-import org.apache.flex.compiler.units.ICompilationUnit;
-import org.apache.flex.swf.ISWF;
-import org.apache.flex.swf.io.ISWFWriter;
-
-public class JSBackend implements IBackend
-{
-    // called by MXMLJSC
-    public Configurator createConfigurator()
-    {
-        return new Configurator(JSCommandLineConfiguration.class);
-    }
-
-    public ISWFWriter createSWFWriter(ICompilerProject project, List<ICompilerProblem> problems, ISWF swf, boolean useCompression, boolean enableDebug)
-    {
-        return new JSWriter(project, problems, swf, useCompression, enableDebug);
-    }
-
-    public JSWriter createJSWriter(ICompilerProject project, List<ICompilerProblem> problems, Collection<ICompilationUnit> compilationUnits, boolean useCompression)
-    {
-        return new JSWriter(project, problems, compilationUnits, useCompression);
-    }
-
-    public ISWFTarget createSWFTarget(CompilerProject project, ITargetSettings targetSettings, ITargetProgressMonitor progressMonitor) throws InterruptedException
-    {
-        // see FlexProject::createSWFTarget()
-        return new JSTarget(project, targetSettings, progressMonitor);
-    }
-
-    public ISourceFileHandler getSourceFileHandlerInstance()
-    {
-        return JSSourceFileHandler.INSTANCE;
-    }
-
-    // TODO: can all reducers be derived from IGenerator?
-    // called by JSCompilationUnit.
-    public JSGenerator createGenerator()
-    {
-        return new JSGenerator();
-    }
-
-    // called by JSGenerator.
-    public JSEmitter createEmitter(ICompilationUnit.Operation buildPhase, ICompilerProject project, JSGenerator generator)
-    {
-        return new JSEmitter(JSSharedData.instance, buildPhase, project, generator);
-    }
-
-    // TODO: can all reducers be derived from ICmcEmitter?
-    // called by JSGenerator.
-    public CmcJSEmitter createCmcJSEmitter()
-    {
-        return new CmcJSEmitter();
-    }
-
-    // TODO: can all reducers be derived from IReducer?
-    // called by JSGenerator.
-    public JSGeneratingReducer createReducer()
-    {
-        return new JSGeneratingReducer(JSSharedData.instance);
-    }
-
-    // TODO: GlobalDirectiveProcessor is not visible
-    // called by JSGenerator.
-    public JSGlobalDirectiveProcessor createGlobalDirectiveProcessor(JSGenerator generator, LexicalScope current_scope, IABCVisitor emitter)
-    {
-        return new JSGlobalDirectiveProcessor(generator, current_scope, emitter);
-    }
-
-    // TODO: ClassDirectiveProcessor is not visible
-    public JSClassDirectiveProcessor createClassDirectiveProcessor(JSGenerator generator, ClassNode c, LexicalScope enclosing_scope, IABCVisitor emitter)
-    {
-        return new JSClassDirectiveProcessor(generator, c, enclosing_scope, emitter);
-    }
-
-    public InterfaceDirectiveProcessor createInterfaceDirectiveProcessor(JSGenerator generator, InterfaceNode in, LexicalScope enclosing_scope, IABCVisitor emitter)
-    {
-        return new JSInterfaceDirectiveProcessor(generator, in, enclosing_scope, emitter);
-    }
-
-    public RuntimeException createException(String msg)
-    {
-        return new RuntimeException(msg);
-    }
-
-    public String getOutputExtension()
-    {
-        return "js";
-    }
-}


[49/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-build-tools/src/main/java/org/apache/flex/compiler/internal/as/codegen/UnknownTreePatternInputOutput.java
----------------------------------------------------------------------
diff --git a/compiler-build-tools/src/main/java/org/apache/flex/compiler/internal/as/codegen/UnknownTreePatternInputOutput.java b/compiler-build-tools/src/main/java/org/apache/flex/compiler/internal/as/codegen/UnknownTreePatternInputOutput.java
new file mode 100644
index 0000000..f551331
--- /dev/null
+++ b/compiler-build-tools/src/main/java/org/apache/flex/compiler/internal/as/codegen/UnknownTreePatternInputOutput.java
@@ -0,0 +1,306 @@
+/*
+ *
+ *  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.internal.as.codegen;
+
+import java.io.PrintWriter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Stack;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ext.DefaultHandler2;
+
+/**
+ *  UnknownTreePatternInputOutput is a support class that reads
+ *  an XML file with template data and populates a map of finding templates,
+ *  and may also write this map out as Java code to be copied into
+ *  the UnknownTreeHandler as hard-coded patterns.
+ */
+class UnknownTreePatternInputOutput extends DefaultHandler2
+{
+    /**
+     *  The map of templates by node ID to read into.
+     */
+    Map<String, ArrayList<Template>> destination;
+
+    /**
+     *  Package name to use.  Hard-coded for now.
+     */
+    String packageName = "org.apache.flex.compiler.internal.as.codegen";
+
+    /**
+     *  Class name to use.  Also hard-coded.
+     */
+    String className = "UnknownTreeHandlerPatterns";
+
+    /**
+     *  Emitter to use.  Hard-coded.
+     */
+    String emitterName = "org.apache.flex.compiler.internal.as.codegen.CmcEmitter";
+
+    /**
+     *  Load a map of templates from an XML file.
+     *  @param pattern_file - the path of the XML pattern file.
+     *  @param dest - the destination map.
+     */
+    boolean load(String pattern_file, Map<String, ArrayList<Template>> dest)
+    {
+        this.destination = dest;
+
+        try
+        {
+            SAXParserFactory factory = SAXParserFactory.newInstance();
+            factory.setNamespaceAware(true);
+
+            SAXParser parser = factory.newSAXParser();
+            parser.parse( new java.io.FileInputStream(pattern_file), this);
+            return true;
+        }
+        catch ( Throwable load_failed )
+        {
+            System.err.println("Load of " + pattern_file + " failed!");
+            load_failed.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     *  This stack tracks UnknownTreeFindingTemplate objects from 
+     *  their startElement event to their endElement event; 
+     *  it's used to create the pattern/subpattern hierarchy.
+     */
+    Stack<Template> nodeStack = new Stack<Template>();
+
+    /**
+     *  Create new UnknownTreeFindingTemplate objects in response to Pattern
+     *  elements, and decode the Pattern's attributes.
+     */
+    @Override
+        public void startElement(String uri, String localName, String qName, Attributes attributes)
+        {   
+            if ( ! (localName.equals("Pattern")) )
+            {
+                if ( ! (localName.equals("SEW")) )
+                    System.err.println("Unknown element " + localName);
+                return;
+            }
+
+            Template template = new Template();
+
+            for ( int index = 0; index < attributes.getLength(); index++)
+            {
+                String attr_name = attributes.getLocalName(index);
+                String attr_value = attributes.getValue(index);
+
+                if ( "ID".equals(attr_name) )
+                {
+                    template.id = attr_value;
+                }
+                else if ( "cantHaveState".equals(attr_name) )
+                {
+                    String state_id = "__" + attr_value + "_NT";
+                    template.cantHaveState = state_id;
+                }
+                else if ( "mustHaveState".equals(attr_name) )
+                {
+                    String state_id = "__" + attr_value + "_NT";
+                    template.mustHaveState = state_id;
+                }
+                else if ( "problem".equals(attr_name) )
+                {
+                    String class_name;
+                    if ( attr_value.startsWith("org.apache.") )
+                        class_name = attr_value;
+                    else
+                        class_name = "org.apache.flex.compiler.problems." + attr_value;
+                    template.problemClass = class_name;
+                }
+                else if ( "nodeClass".equals(attr_name) )
+                {
+                    String class_name;
+                    if ( attr_value.startsWith("org.apache.") )
+                        class_name = attr_value;
+                    else
+                        class_name = "org.apache.flex.compiler.internal.tree.as." + attr_value;
+                    template.nodeClass = class_name;
+                }
+                else if ( "provisional".equals(attr_name) )
+                {
+                    template.provisional = Boolean.valueOf(attr_value);
+                }
+                else
+                {
+                    System.err.println("** Unknown attr name:" + attr_name);
+                }
+            }
+
+
+            //  Top-level templates go into the map by node id;
+            //  subpatterns get linked to their immediate parent.
+            if ( nodeStack.isEmpty() )
+            {
+                assert template.problemClass != null : "Top-level template " + template + " must have a problem class.";
+
+                if ( ! (destination.containsKey(template.id)) )
+                    destination.put(template.id, new ArrayList<Template>());
+
+                destination.get(template.id).add(template);
+            }
+            else
+            {
+                Template base = nodeStack.peek();
+                if ( base.requiredSubtree == null )
+                    base.requiredSubtree = template;
+                else
+                    System.err.println("already has subtree: " + base);
+            }
+
+            this.nodeStack.push(template);
+        }
+
+    /**
+     *  Maintain the UnknownTreeFindingTemplate stack.
+     */
+    @Override
+    public void endElement(String uri,  String localName,  String qName)
+    {
+        if ( localName.equals("Pattern") )
+            this.nodeStack.pop();
+    }
+
+    /**
+     *  Load an XML file containing patterns and dump equivalent Java code to System.out.
+     */
+    public static void main(String[] argv)
+    throws Exception
+    {
+        if ( argv.length < 2 )
+        {
+            System.err.println("Usage: java org.apache.flex.compiler.internal.as.codegen.UnknownTreePatternInputOutput <xml pattern file> <destination java file>");
+            System.exit(1);
+        }
+
+        new UnknownTreePatternInputOutput().dumpTemplateData(argv[0], argv[1]);
+    }
+    
+    PrintWriter output;
+
+    /**
+     *  Read an XML file of patterns and dump the equivalent Java code to the target file.
+     *  @param src_file_name - the path of the XML file.
+     *  @param dest_file_name - the path of the output Java file.
+     */
+    void dumpTemplateData(String src_file_name, String dest_file_name)
+    throws Exception
+    {
+        if ( !load(src_file_name, new HashMap<String, ArrayList<Template>>()) )
+            return;
+
+        output = new PrintWriter(dest_file_name);
+
+        output.println("package " + this.packageName + ";");
+        output.println("import java.util.ArrayList;");
+        output.println("import java.util.HashMap;");
+        output.println("import java.util.Map;");
+        output.println("import org.apache.flex.compiler.tree.ASTNodeID;");
+        output.println("import static org.apache.flex.compiler.tree.ASTNodeID.*;");
+        output.println("import " + this.emitterName + ";");
+        output.println();
+        output.println("public class " + this.className);
+        output.println("{");
+        output.println();
+        output.println("    //  Patterns generated " + new java.util.Date().toString() + " from " + src_file_name.replaceAll("\\\\", "/"));
+        output.println("    public static Map<ASTNodeID, ArrayList<UnknownTreeFinding.Template> > allTemplates = new HashMap<ASTNodeID, ArrayList<UnknownTreeFinding.Template>>();");
+
+        output.println("    static");
+        output.println("    {");
+
+        for ( String id: destination.keySet() )
+        {
+            String templates_name = "templates_for_" + id;
+            output.printf("        ArrayList<UnknownTreeFinding.Template> %s = allTemplates.get(%s);%n", templates_name, id);
+            output.printf("        if ( %s == null ) {%n", templates_name);
+            output.printf("            %s = new ArrayList<UnknownTreeFinding.Template>();%n", templates_name);
+            output.printf("            allTemplates.put(%s, %s);%n", id, templates_name);
+            output.printf("        }%n");
+
+            for ( Template templ: destination.get(id) )
+            {
+                output.printf("        {%n");
+                dumpTemplate(templ, "current_template");
+                output.printf("            %s.add(current_template);%n", templates_name);
+                output.printf("        }%n");
+            }
+        }
+        output.println("    }");
+        output.println("}");
+        output.close();
+    }
+
+    /**
+     *  Recursively dump a template.
+     *  @param templ - the template to dump.
+     *  @param var_name - the name by which this template will be known
+     *    in the output Java code.  As this routine recurses, it builds
+     *    successively longer variable names.
+     */
+    void dumpTemplate(Template templ, String var_name)
+    {
+        output.printf("            UnknownTreeFinding.Template %s = new UnknownTreeFinding.Template();%n", var_name);
+        output.printf("            %s.id = %s;%n", var_name, templ.id);
+        if ( templ.problemClass != null )
+            output.printf("            %s.problemClass = %s.class;%n", var_name, templ.problemClass);
+        if ( templ.nodeClass != null )
+            output.printf("            %s.nodeClass = %s.class;%n", var_name, templ.nodeClass);
+        if ( templ.mustHaveState != null )
+            output.printf("            %s.mustHaveState = CmcEmitter.%s;%n", var_name, templ.mustHaveState);
+        if ( templ.cantHaveState != null )
+            output.printf("            %s.cantHaveState = CmcEmitter.%s;%n", var_name, templ.cantHaveState);
+        output.printf("            %s.provisional = %s;%n", var_name, templ.provisional);
+
+        if ( templ.requiredSubtree != null )
+        {
+            String subtemp_name = var_name + "_subtempl";
+            dumpTemplate(templ.requiredSubtree, subtemp_name);
+            output.printf("            %s.requiredSubtree = %s;%n", var_name, subtemp_name);
+        }
+    }
+
+    /**
+     *  Build-time representation of a UnknownTreeFinding.Template object.
+     */
+    private static class Template
+    {
+        String id = "UnknownID";
+
+        String problemClass;
+        String nodeClass;
+        String mustHaveState;
+        String cantHaveState;
+        Boolean provisional = Boolean.FALSE;
+
+        Template requiredSubtree;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/BaseProblemGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/BaseProblemGeneratorMojo.java b/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/BaseProblemGeneratorMojo.java
index 04929a5..f0c29ca 100644
--- a/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/BaseProblemGeneratorMojo.java
+++ b/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/BaseProblemGeneratorMojo.java
@@ -50,6 +50,7 @@ public abstract class BaseProblemGeneratorMojo extends AbstractMojo
     abstract protected File getInputDirectory();
     abstract protected File getOutputDirectory();
     abstract protected String getOutputFile();
+    abstract protected void clean(File outputFile) throws MojoExecutionException;
 
     public void execute() throws MojoExecutionException
     {
@@ -61,12 +62,8 @@ public abstract class BaseProblemGeneratorMojo extends AbstractMojo
             }
         }
 
-        // If the file already exists, delete it before generating output.
-        if(generatedFile.exists()) {
-            if(!generatedFile.delete()) {
-                throw new MojoExecutionException("Could not clear previously created file: " + generatedFile.getPath());
-            }
-        }
+        // Give the generator a chance to clean up.
+        clean(generatedFile);
 
         try {
             PrintWriter writer = new PrintWriter(new FileWriter(generatedFile, true));

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/ProblemEnumGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/ProblemEnumGeneratorMojo.java b/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/ProblemEnumGeneratorMojo.java
index 77c3d1c..b8d1fae 100644
--- a/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/ProblemEnumGeneratorMojo.java
+++ b/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/ProblemEnumGeneratorMojo.java
@@ -149,4 +149,14 @@ public class ProblemEnumGeneratorMojo
         return "PROBLEM_" + problemTypeName;
     }
 
+    @Override
+    protected void clean(File outputFile) throws MojoExecutionException {
+        // If the file already exists, delete it before generating output.
+        if(outputFile.exists()) {
+            if(!outputFile.delete()) {
+                throw new MojoExecutionException("Could not clear previously created file: " + outputFile.getPath());
+            }
+        }
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/ProblemResourceBundleGeneratorMojo.java
----------------------------------------------------------------------
diff --git a/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/ProblemResourceBundleGeneratorMojo.java b/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/ProblemResourceBundleGeneratorMojo.java
index a240c0c..fd97798 100644
--- a/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/ProblemResourceBundleGeneratorMojo.java
+++ b/compiler-build-tools/src/main/java/org/apache/flex/compiler/tools/problems/ProblemResourceBundleGeneratorMojo.java
@@ -16,6 +16,7 @@
 
 package org.apache.flex.compiler.tools.problems;
 
+import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
@@ -98,4 +99,9 @@ public class ProblemResourceBundleGeneratorMojo
         return "";
     }
 
+    @Override
+    protected void clean(File outputFile) throws MojoExecutionException {
+        // TODO: Clear all the content after: "# Messages for Compiler problems are written below by ProblemLocalizer."
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-build-tools/src/main/java/org/apache/flex/utils/AntTestAdapter.java
----------------------------------------------------------------------
diff --git a/compiler-build-tools/src/main/java/org/apache/flex/utils/AntTestAdapter.java b/compiler-build-tools/src/main/java/org/apache/flex/utils/AntTestAdapter.java
new file mode 100644
index 0000000..cd3cb4f
--- /dev/null
+++ b/compiler-build-tools/src/main/java/org/apache/flex/utils/AntTestAdapter.java
@@ -0,0 +1,115 @@
+/*
+ *
+ *  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.utils;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Created by christoferdutz on 23.02.16.
+ */
+public class AntTestAdapter implements ITestAdapter {
+
+    private static EnvProperties env = EnvProperties.initiate();
+
+    private static final File PLAYERGLOBAL_SWC = new File(FilenameNormalization.normalize(env.FPSDK + "\\" + env.FPVER + "\\playerglobal.swc"));
+    // The Ant script for compiler.tests copies a standalone player to the temp directory.
+    private static final File FLASHPLAYER = new File(FilenameNormalization.normalize(env.FDBG));
+
+    private static final File LIBS_ROOT = new File(FilenameNormalization.normalize(env.SDK + "\\frameworks\\libs"));
+    private static final File RESOURCE_BUNDLES_ROOT = new File(FilenameNormalization.normalize(env.SDK + "\\frameworks\\locale\\en_US"));
+
+    @Override
+    public String getTempDir() {
+        return FilenameNormalization.normalize("temp"); // ensure this exists
+    }
+
+    @Override
+    public List<File> getLibraries(boolean withFlex) {
+        // Do some checks if all needed environment variables are set.
+        if (withFlex) {
+            assertNotNull("Environment variable FLEX_HOME is not set", env.SDK);
+        }
+        assertNotNull("Environment variable PLAYERGLOBAL_HOME is not set", env.FPSDK);
+
+        // Create a list of libs needed to compile.
+        List<File> libraries = new ArrayList<File>();
+        libraries.add(getPlayerglobal());
+        if (withFlex)
+        {
+            libraries.add(getFlexArtifact("framework"));
+            libraries.add(getFlexArtifact("rpc"));
+            libraries.add(getFlexArtifact("spark"));
+        }
+        return libraries;
+    }
+
+    @Override
+    public File getPlayerglobal() {
+        return PLAYERGLOBAL_SWC;
+    }
+
+    @Override
+    public File getFlashplayerDebugger() {
+        return FLASHPLAYER;
+    }
+
+    @Override
+    public String getFlexManifestPath(String type) {
+        return env.SDK + "\\frameworks\\" + type + "-manifest.xml";
+    }
+
+    @Override
+    public File getFlexArtifact(String artifactName) {
+        return getLib(artifactName);
+    }
+
+    @Override
+    public File getFlexArtifactResourceBundle(String artifactName) {
+        return getResourceBundle(artifactName);
+    }
+
+    @Override
+    public String getFlexJsManifestPath(String type) {
+        return null;
+    }
+
+    @Override
+    public File getFlexJSArtifact(String artifactName) {
+        return null;
+    }
+
+    @Override
+    public File getUnitTestBaseDir() {
+        return new File("test-files");
+    }
+
+    private File getLib(String artifactId) {
+        return new File(LIBS_ROOT, artifactId + ".swc");
+    }
+
+    private File getResourceBundle(String artifactId) {
+        return new File(RESOURCE_BUNDLES_ROOT, artifactId + "_rb.swc");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-build-tools/src/main/java/org/apache/flex/utils/EnvProperties.java
----------------------------------------------------------------------
diff --git a/compiler-build-tools/src/main/java/org/apache/flex/utils/EnvProperties.java b/compiler-build-tools/src/main/java/org/apache/flex/utils/EnvProperties.java
new file mode 100644
index 0000000..be22fee
--- /dev/null
+++ b/compiler-build-tools/src/main/java/org/apache/flex/utils/EnvProperties.java
@@ -0,0 +1,149 @@
+/*
+ *
+ *  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.utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Properties;
+
+
+/**
+ *  EnvProperties checks in following order for a value.
+ * 
+ *  1) unittest.properties 
+ *  2) environment variables
+ *  3) for key FLEX_HOME & PLAYERGLOBAL_HOME sets a default value.
+ */
+public class EnvProperties {
+	
+    /**
+     * FLEX_HOME
+     */
+    public String SDK;
+    
+    /**
+     * TLF_HOME
+     */
+    public String TLF;
+    
+	/**
+	 * PLAYERGLOBAL_HOME
+	 */
+	public String FPSDK;
+	
+	/**
+	 * AIR_HOME
+	 */
+	public String AIRSDK;
+	
+	/**
+	 * FLASHPLAYER_DEBUGGER
+	 */
+	public String FDBG;
+	
+    /**
+     * ASJS_HOME
+     */
+    public String ASJS;
+
+    /**
+     * PLAYERGLOBAL_VERSION
+     */
+    public String FPVER;
+    
+	
+	private static EnvProperties env;
+	
+	public static EnvProperties initiate() {
+		if(env == null) {
+			env = new EnvProperties();
+			env.setup();
+		}
+		return env;
+	}
+	
+	private void setup()
+	{
+        String prefix = "";
+		Properties p = new Properties();
+        String envFileName = FilenameNormalization.normalize("../env.properties");
+        try {
+            File f = new File(envFileName);
+            if (f.exists())
+            {
+            	p.load(new FileInputStream( f ));
+                prefix = "env.";
+            }
+        } catch (FileNotFoundException e) {
+            System.out.println(envFileName + " not found");
+            try {
+                File f = new File("unittest.properties");
+                p.load(new FileInputStream( f ));
+            } catch (FileNotFoundException e1) {
+                System.out.println("unittest.properties not found");
+            } catch (IOException e1) {
+	            // Ignore
+            }
+        } catch (IOException e) {
+	        // Ignore
+        }
+		
+		SDK = p.getProperty(prefix + "FLEX_HOME", System.getenv("FLEX_HOME"));
+		if(SDK == null)
+		{
+            SDK = FilenameNormalization.normalize("../../flex-sdk");
+	        File mxmlc = new File(SDK + "/lib/mxmlc.jar");
+	        if (!mxmlc.exists())
+	            SDK = FilenameNormalization.normalize("../compiler/generated/dist/sdk");
+		}
+		System.out.println("environment property - FLEX_HOME = " + SDK);
+		
+		FPSDK = p.getProperty(prefix + "PLAYERGLOBAL_HOME", System.getenv("PLAYERGLOBAL_HOME"));
+		if(FPSDK == null)
+			FPSDK = FilenameNormalization.normalize("../compiler/generated/dist/sdk/frameworks/libs/player");
+		System.out.println("environment property - PLAYERGLOBAL_HOME = " + FPSDK);
+        
+        FPVER = p.getProperty(prefix + "PLAYERGLOBAL_VERSION", System.getenv("PLAYERGLOBAL_VERSION"));
+        if (FPVER == null)
+            FPVER = "11.1";
+        System.out.println("environment property - PLAYERGLOBAL_VERSION = " + FPVER);
+        
+        TLF = p.getProperty(prefix + "TLF_HOME", System.getenv("TLF_HOME"));
+        if (TLF == null)
+        {
+            TLF = FilenameNormalization.normalize("../../flex-tlf");
+        }
+        System.out.println("environment property - TLF_HOME = " + TLF);
+		
+		AIRSDK = p.getProperty(prefix + "AIR_HOME", System.getenv("AIR_HOME"));
+		System.out.println("environment property - AIR_HOME = " + AIRSDK);
+
+		FDBG = p.getProperty(prefix + "FLASHPLAYER_DEBUGGER", System.getenv("FLASHPLAYER_DEBUGGER"));
+		System.out.println("environment property - FLASHPLAYER_DEBUGGER = " + FDBG);
+
+		ASJS = p.getProperty(prefix + "ASJS_HOME", System.getenv("ASJS_HOME"));
+		if (ASJS == null)
+			ASJS = FilenameNormalization.normalize("../../flex-asjs");
+		System.out.println("environment property - ASJS_HOME = " + ASJS);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-build-tools/src/main/java/org/apache/flex/utils/FilenameNormalization.java
----------------------------------------------------------------------
diff --git a/compiler-build-tools/src/main/java/org/apache/flex/utils/FilenameNormalization.java b/compiler-build-tools/src/main/java/org/apache/flex/utils/FilenameNormalization.java
new file mode 100644
index 0000000..7ef5e68
--- /dev/null
+++ b/compiler-build-tools/src/main/java/org/apache/flex/utils/FilenameNormalization.java
@@ -0,0 +1,109 @@
+/*
+ *
+ *  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.utils;
+
+import java.io.File;
+
+import org.apache.commons.io.FilenameUtils;
+
+/**
+ * Utility class to normalize filenames.  All Files entering the driver
+ * should be run through this class
+ */
+public class FilenameNormalization
+{
+    /**
+     * Normalizes an array of files.
+     * 
+     * @see #normalize(File)
+     * @param files Array of files to normalize.
+     * @return Array of normalized files.
+     */
+    public static File[] normalize(File[] files)
+    {
+        File[] result = new File[files.length];
+        for (int i = 0; i < files.length; ++i)
+        {
+            result[i] = normalize(files[i]);
+        }
+        return result;
+    }
+
+    /**
+     * Normalize a {@link File}.  This method normalizes the case of the file path
+     * characters and then calls {@link FilenameUtils#normalize(String)}.
+     * @see FilenameUtils#normalize(String)
+     * @param f A file.
+     * @return The normalized File.
+     */
+    public static File normalize(File f)
+    {
+        String caseNormalizedAbsPath = f.getAbsolutePath();
+        return new File(FilenameUtils.normalize(caseNormalizedAbsPath));
+    }
+
+    /**
+     * Normalize a {@link String}. This method normalizes the case of the file
+     * path characters and then calls {@link FilenameUtils#normalize(String)}.
+     * 
+     * @see FilenameUtils#normalize(String)
+     * @param path The fiel path.
+     * @return The normalized String. If the given path is already normalized,
+     * the original string object will be returned.
+     */
+    public static String normalize(String path)
+    {
+        File f = new File(path);
+        String caseNormalizedAbsPath = f.getAbsolutePath();
+        String normalized = FilenameUtils.normalize(caseNormalizedAbsPath);
+
+        if (normalized == null)
+            return path;
+
+        // If the path is already normalized, return the original string object
+        // to prevent duplicated string objects.
+        if (normalized.equals(path))
+            return path;
+        else
+            return normalized;
+    }
+    
+    /**
+     * Determines whether a file path is in normalized form.
+     * 
+     * @param path A file path.
+     */
+    public static boolean isNormalized(String path)
+    {
+        String normalizedPath = normalize(path);
+        return normalizedPath.equals(path);
+    }
+
+    /**
+     * Get the normalized file path of a Java {@link File} object.
+     * 
+     * @param file File object.
+     * @return Normalized file path.
+     */
+    public static String normalizeFileToPath(File file)
+    {
+        return normalize(file.getAbsolutePath());
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-build-tools/src/main/java/org/apache/flex/utils/ITestAdapter.java
----------------------------------------------------------------------
diff --git a/compiler-build-tools/src/main/java/org/apache/flex/utils/ITestAdapter.java b/compiler-build-tools/src/main/java/org/apache/flex/utils/ITestAdapter.java
new file mode 100644
index 0000000..5f35557
--- /dev/null
+++ b/compiler-build-tools/src/main/java/org/apache/flex/utils/ITestAdapter.java
@@ -0,0 +1,50 @@
+/*
+ *
+ *  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.utils;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * Created by christoferdutz on 23.02.16.
+ */
+public interface ITestAdapter {
+
+    String getTempDir();
+
+    List<File> getLibraries(boolean withFlex);
+
+    File getPlayerglobal();
+
+    File getFlashplayerDebugger();
+
+    String getFlexManifestPath(String type);
+
+    File getFlexArtifact(String artifactName);
+
+    File getFlexArtifactResourceBundle(String artifactName);
+
+    String getFlexJsManifestPath(String type);
+
+    File getFlexJSArtifact(String artifactName);
+
+    File getUnitTestBaseDir();
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-build-tools/src/main/java/org/apache/flex/utils/MavenTestAdapter.java
----------------------------------------------------------------------
diff --git a/compiler-build-tools/src/main/java/org/apache/flex/utils/MavenTestAdapter.java b/compiler-build-tools/src/main/java/org/apache/flex/utils/MavenTestAdapter.java
new file mode 100644
index 0000000..457249d
--- /dev/null
+++ b/compiler-build-tools/src/main/java/org/apache/flex/utils/MavenTestAdapter.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.utils;
+
+import org.apache.commons.compress.archivers.ArchiveEntry;
+import org.apache.commons.compress.archivers.ArchiveException;
+import org.apache.commons.compress.archivers.ArchiveInputStream;
+import org.apache.commons.compress.archivers.ArchiveStreamFactory;
+import org.apache.commons.io.FilenameUtils;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+
+/**
+ * Created by christoferdutz on 23.02.16.
+ */
+public class MavenTestAdapter implements ITestAdapter {
+
+    private static final int KILOBYTE = 1024;
+    private static final int MEGABYTE = KILOBYTE * 1024;
+    private static final int BUFFER_MAX = MEGABYTE;
+
+    @Override
+    public String getTempDir() {
+        File tempDir = new File("target/surefire-temp");
+        if(!tempDir.exists()) {
+            if(!tempDir.mkdirs()) {
+                throw new RuntimeException("Could not create temp dir at: " + tempDir.getAbsolutePath());
+            }
+        }
+        return tempDir.getPath();
+    }
+
+    @Override
+    public List<File> getLibraries(boolean withFlex) {
+        List<File> libs = new ArrayList<File>();
+        libs.add(getPlayerglobal());
+        if(withFlex) {
+            String flexVersion = System.getProperty("flexVersion");
+            libs.add(getDependency("org.apache.flex.framework", "framework", flexVersion, "swc", null));
+            libs.add(getDependency("org.apache.flex.framework", "rpc", flexVersion, "swc", null));
+            libs.add(getDependency("org.apache.flex.framework", "spark", flexVersion, "swc", null));
+        }
+        return libs;
+    }
+
+    @Override
+    public File getPlayerglobal() {
+        return getDependency("com.adobe.flash.framework", "playerglobal",
+                System.getProperty("flashVersion"), "swc", null);
+    }
+
+    @Override
+    public File getFlashplayerDebugger() {
+        // TODO: If the archive isn't unpacked, unpack it.
+        // TODO: Return a reference to the player debugger executable, depending on the current platform.
+        String FLASHPLAYER_DEBUGGER = System.getProperty("FLASHPLAYER_DEBUGGER", null);
+        if(FLASHPLAYER_DEBUGGER == null || FLASHPLAYER_DEBUGGER.length() == 0) {
+            throw new RuntimeException("You have to specify the location of the flash debug player executable.");
+        }
+        return new File(FLASHPLAYER_DEBUGGER);
+        /*return getDependency("com.adobe.flash.runtime", "player-debugger",
+                System.getProperty("flashVersion"), "zip", null);*/
+    }
+
+    @Override
+    public String getFlexManifestPath(String type) {
+        File configsZip = getDependency("org.apache.flex.framework", "framework",
+                System.getProperty("flexVersion"), "zip", "configs");
+        File frameworkDir = configsZip.getParentFile();
+        File unpackedConfigsDir = new File(frameworkDir, "configs_zip");
+        // If the directory doesn't exist, we have to create it by unpacking the zip archive.
+        // This is identical behaviour to Flexmojos, which does the same thing.
+        if(!unpackedConfigsDir.exists()) {
+            unpackFrameworkConfigs(configsZip, unpackedConfigsDir);
+        }
+        return new File(unpackedConfigsDir, type + "-manifest.xml").getPath();
+    }
+
+    @Override
+    public File getFlexArtifact(String artifactName) {
+        String flexVersion = System.getProperty("flexVersion");
+        return getDependency("org.apache.flex.framework", artifactName, flexVersion, "swc", null);
+    }
+
+    @Override
+    public File getFlexArtifactResourceBundle(String artifactName) {
+        String flexVersion = System.getProperty("flexVersion");
+        return getDependency("org.apache.flex.framework", artifactName, flexVersion, "rb.swc", "en_US");
+    }
+
+    @Override
+    public String getFlexJsManifestPath(String type) {
+        File configsZip = getDependency("org.apache.flex.framework.flexjs", "framework",
+                System.getProperty("flexJsVersion"), "zip", "configs");
+        File frameworkDir = configsZip.getParentFile();
+        File unpackedConfigsDir = new File(frameworkDir, "configs_zip");
+        // If the directory doesn't exist, we have to create it by unpacking the zip archive.
+        // This is identical behaviour to Flexmojos, which does the same thing.
+        if(!unpackedConfigsDir.exists()) {
+            unpackFrameworkConfigs(configsZip, unpackedConfigsDir);
+        }
+        return new File(unpackedConfigsDir, type + "-manifest.xml").getPath();
+    }
+
+    @Override
+    public File getFlexJSArtifact(String artifactName) {
+        String flexJsVersion = System.getProperty("flexJsVersion");
+        return getDependency("org.apache.flex.framework.flexjs", artifactName, flexJsVersion, "swc", null);
+    }
+
+    @Override
+    public File getUnitTestBaseDir() {
+        return new File(FilenameUtils.normalize("target/test-classes"));
+    }
+
+    private File getDependency(String groupId, String artifactId, String version, String type, String classifier) {
+        String dependencyPath = System.getProperty("mavenLocalRepoDir") + File.separator +
+                groupId.replaceAll("\\.", Matcher.quoteReplacement(File.separator)) + File.separator + artifactId + File.separator + version +
+                File.separator + artifactId + "-" + version + ((classifier != null) ? "-" + classifier : "") + "." +
+                type;
+        File dependency = new File(dependencyPath);
+        if(!dependency.exists()) {
+            throw new RuntimeException("Could not read SWC dependency at " + dependency.getAbsolutePath());
+        }
+        return dependency;
+    }
+
+    private void unpackFrameworkConfigs(File configZip, File outputDirectory) {
+        final byte[] data = new byte[BUFFER_MAX];
+        ArchiveInputStream archiveInputStream = null;
+        ArchiveEntry entry;
+        try {
+            archiveInputStream = new ArchiveStreamFactory().createArchiveInputStream(
+                    new BufferedInputStream(new FileInputStream(configZip)));
+            if(!outputDirectory.exists() && !outputDirectory.mkdirs()) {
+                throw new RuntimeException("Could not create output directory for config zip at " +
+                        outputDirectory.getPath());
+            }
+            while ((entry = archiveInputStream.getNextEntry()) != null) {
+                final File outputFile = new File(outputDirectory, entry.getName());
+
+                // Entry is a directory.
+                if (entry.isDirectory()) {
+                    if (!outputFile.exists()) {
+                        if(!outputFile.mkdirs()) {
+                            throw new RuntimeException(
+                                    "Could not create output directory " + outputFile.getAbsolutePath());
+                        }
+                    }
+                }
+
+                // Entry is a file.
+                else {
+                    final FileOutputStream fos = new FileOutputStream(outputFile);
+                    BufferedOutputStream dest = null;
+                    try {
+                        dest = new BufferedOutputStream(fos, BUFFER_MAX);
+
+                        int count;
+                        while ((count = archiveInputStream.read(data, 0, BUFFER_MAX)) != -1) {
+                            dest.write(data, 0, count);
+                        }
+                    } finally {
+                        if(dest != null) {
+                            dest.flush();
+                            dest.close();
+                        }
+                    }
+                }
+            }
+        } catch (FileNotFoundException e) {
+            throw new RuntimeException("Error unpacking resources", e);
+        } catch (IOException e) {
+            throw new RuntimeException("Error unpacking resources", e);
+        } catch (ArchiveException e) {
+            throw new RuntimeException("Error unpacking resources", e);
+        } finally {
+            if(archiveInputStream != null) {
+                try {
+                    archiveInputStream.close();
+                } catch(Exception e) {
+                    // Ignore...
+                }
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-build-tools/src/main/java/org/apache/flex/utils/TestAdapterFactory.java
----------------------------------------------------------------------
diff --git a/compiler-build-tools/src/main/java/org/apache/flex/utils/TestAdapterFactory.java b/compiler-build-tools/src/main/java/org/apache/flex/utils/TestAdapterFactory.java
new file mode 100644
index 0000000..ccdb0c2
--- /dev/null
+++ b/compiler-build-tools/src/main/java/org/apache/flex/utils/TestAdapterFactory.java
@@ -0,0 +1,41 @@
+/*
+ *
+ *  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.utils;
+
+/**
+ * Created by christoferdutz on 10.03.16.
+ */
+public class TestAdapterFactory {
+
+    private static final ITestAdapter adapter =
+            System.getProperty("buildType", "Ant").equals("Maven") ?
+                    new MavenTestAdapter() : new AntTestAdapter();
+
+    /**
+     * Depending on the "buildType" system-property, create the corresponding test-adapter
+     * Make the AntTestAdapter the default.
+     *
+     * @return test adapter instance for the given type of build.
+     */
+    public static ITestAdapter getTestAdapter() {
+        return adapter;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jburg-types/src/main/java/org/apache/flex/compiler/internal/as/codegen/IASNodeAdapter.java
----------------------------------------------------------------------
diff --git a/compiler-jburg-types/src/main/java/org/apache/flex/compiler/internal/as/codegen/IASNodeAdapter.java b/compiler-jburg-types/src/main/java/org/apache/flex/compiler/internal/as/codegen/IASNodeAdapter.java
new file mode 100644
index 0000000..d35f2a4
--- /dev/null
+++ b/compiler-jburg-types/src/main/java/org/apache/flex/compiler/internal/as/codegen/IASNodeAdapter.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.internal.as.codegen;
+
+import jburg.burg.emitlangs.EmitLang;
+import jburg.burg.inode.InodeAdapter;
+import jburg.burg.inode.InodeAdapter2;
+
+/**
+ *  IASNodeAdapter generates method calls into
+ *  a BURM to access properties of an IASNode.
+ */
+public class IASNodeAdapter implements InodeAdapter
+{
+	/**
+	 *  @return true if the adapter can handle this type of inode.
+	 */
+	public boolean accept(String inodeClassName)
+	{
+        return "IASNode".equals(inodeClassName);
+    }
+
+    /**
+     *  Generate an expression to fetch a node's child count.
+     *  @param node_path - the code generator's path to the node.
+     *  @param emitter - the compiler-compiler's code emitter.
+     *  @return said expression.
+     */
+	public String genGetArity(String node_path, EmitLang emitter)
+	{
+		return emitter.genCallMethod("SemanticUtils", "getChildCount", new String[] { node_path } );
+	}
+
+	/**
+	 *  Generate an expression to fetch a node's Nth child.
+	 *  @param node_path - the code generator's path to the node.
+	 *  @param index - the index expression. 
+	 *  @param emitter - the compiler-compiler's code emitter.
+     *  @return said expression.
+	 */
+	public String genGetNthChild(String node_path, String index, EmitLang emitter)
+	{
+		return emitter.genCallMethod("SemanticUtils", "getNthChild", new String[] { node_path, index } );
+	}
+
+	/**
+	 *  Generate an expression to fetch a node's node ID.
+	 *  @param node_path - the code generator's path to the node.
+     *  @param emitter - the compiler-compiler's code emitter.
+     *  @return said expression.
+	 */
+	public String genGetOperator(String node_path, EmitLang emitter)
+	{
+		return emitter.genCallMethod(node_path, "getNodeID", null);
+	}
+}
+

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/assembly/scripts/asjsc
----------------------------------------------------------------------
diff --git a/compiler-jx/src/assembly/scripts/asjsc b/compiler-jx/src/assembly/scripts/asjsc
new file mode 100755
index 0000000..6c65155
--- /dev/null
+++ b/compiler-jx/src/assembly/scripts/asjsc
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+################################################################################
+##
+##  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.
+##
+################################################################################
+
+
+#
+# mxmlc shell script to launch falcon-mxmlc.jar on OSX, Unix, or Cygwin.
+# In Windows Command Prompt, use mxmlc.bat instead.
+#
+
+if [ "x${FALCON_HOME}" = "x" ]
+then
+    SCRIPT_HOME=`dirname "$0"`
+    FALCON_HOME=${SCRIPT_HOME}/../../compiler
+fi
+
+echo Using Falcon codebase: $FALCON_HOME
+
+if [ "x${FLEX_HOME}" = "x" ]
+then
+    FLEX_HOME=${FALCON_HOME}/generated/dist/sdk
+fi
+echo Using Flex SDK: $FLEX_HOME
+
+case `uname` in
+		CYGWIN*)
+			OS="Windows"
+		;;
+		*)
+			OS=Unix
+esac
+
+D32=''
+
+if [ $OS = "Windows" ]; then
+
+	FALCON_HOME=`cygpath -m $FALCON_HOME`
+	FLEX_HOME=`cygpath -m $FLEX_HOME`
+
+elif [ $OS = "Unix" ]; then
+
+    check64="`java -version 2>&1 | grep -i 64-Bit`"
+    isOSX="`uname | grep -i Darwin`"
+    javaVersion="`java -version 2>&1 | awk -F '[ ".]+' 'NR==1 {print $3 "." $4}'`"
+    
+    if [ "$isOSX" != "" -a "$HOSTTYPE" = "x86_64" -a "$check64" != "" -a "$javaVersion" = "1.6" ]; then
+        D32='-d32'
+    fi	
+fi
+
+VMARGS="-Xmx384m -Dsun.io.useCanonCaches=false "
+
+java $VMARGS $D32 $SETUP_SH_VMARGS -Dflexcompiler="$FALCON_HOME" -Dflexlib="$FLEX_HOME/frameworks" -jar "$SCRIPT_HOME/../lib/mxmlc.jar" +flexlib="$FLEX_HOME/frameworks" -external-library-path="$SCRIPT_HOME/../libs/JS.swc" "$@"

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/assembly/scripts/asjsc.bat
----------------------------------------------------------------------
diff --git a/compiler-jx/src/assembly/scripts/asjsc.bat b/compiler-jx/src/assembly/scripts/asjsc.bat
new file mode 100644
index 0000000..041fbcf
--- /dev/null
+++ b/compiler-jx/src/assembly/scripts/asjsc.bat
@@ -0,0 +1,29 @@
+@echo off
+
+rem
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+rem
+
+rem
+rem mxmlc.bat script to launch falcon-mxmlc.jar in Windows Command Prompt.
+rem On OSX, Unix, or Cygwin, use the mxmlc shell script instead.
+rem
+
+if "x%FALCON_HOME%"=="x"  (set FALCON_HOME=%~dp0..) else echo Using Falcon codebase: %FALCON_HOME%
+
+if "x%FLEX_HOME%"=="x" (set FLEX_HOME=%~dp0..) else echo Using Flex SDK: %FLEX_HOME%
+
+@java -Dsun.io.useCanonCaches=false -Xms32m -Xmx512m -Dflexcompiler="%FALCON_HOME%" -Dflexlib="%FLEX_HOME%\frameworks" -jar "%FALCON_HOME%\lib\mxmlc.jar" -external-library-path="%FALCON_HOME%\libs\JS.swc" %*
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/assembly/scripts/compc
----------------------------------------------------------------------
diff --git a/compiler-jx/src/assembly/scripts/compc b/compiler-jx/src/assembly/scripts/compc
new file mode 100755
index 0000000..bb48e71
--- /dev/null
+++ b/compiler-jx/src/assembly/scripts/compc
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+################################################################################
+##
+##  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.
+##
+################################################################################
+
+
+#
+# mxmlc shell script to launch falcon-mxmlc.jar on OSX, Unix, or Cygwin.
+# In Windows Command Prompt, use mxmlc.bat instead.
+#
+
+if [ "x${FALCON_HOME}" = "x" ]
+then
+    SCRIPT_HOME=`dirname "$0"`
+    FALCON_HOME=${SCRIPT_HOME}/../../compiler
+fi
+
+echo Using Falcon codebase: $FALCON_HOME
+
+if [ "x${FLEX_HOME}" = "x" ]
+then
+    FLEX_HOME=${FALCON_HOME}/generated/dist/sdk
+fi
+echo Using Flex SDK: $FLEX_HOME
+
+case `uname` in
+		CYGWIN*)
+			OS="Windows"
+		;;
+		*)
+			OS=Unix
+esac
+
+D32=''
+
+if [ $OS = "Windows" ]; then
+
+	FALCON_HOME=`cygpath -m $FALCON_HOME`
+	FLEX_HOME=`cygpath -m $FLEX_HOME`
+
+elif [ $OS = "Unix" ]; then
+
+    check64="`java -version 2>&1 | grep -i 64-Bit`"
+    isOSX="`uname | grep -i Darwin`"
+    javaVersion="`java -version 2>&1 | awk -F '[ ".]+' 'NR==1 {print $3 "." $4}'`"
+    
+    if [ "$isOSX" != "" -a "$HOSTTYPE" = "x86_64" -a "$check64" != "" -a "$javaVersion" = "1.6" ]; then
+        D32='-d32'
+    fi	
+fi
+
+VMARGS="-Xmx384m -Dsun.io.useCanonCaches=false "
+
+java $VMARGS $D32 $SETUP_SH_VMARGS -Dflexcompiler="$FALCON_HOME" -Dflexlib="$FLEX_HOME/frameworks" -jar "$SCRIPT_HOME/../lib/compc.jar" +flexlib="$FLEX_HOME/frameworks" "$@"

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/assembly/scripts/compc.bat
----------------------------------------------------------------------
diff --git a/compiler-jx/src/assembly/scripts/compc.bat b/compiler-jx/src/assembly/scripts/compc.bat
new file mode 100644
index 0000000..6626760
--- /dev/null
+++ b/compiler-jx/src/assembly/scripts/compc.bat
@@ -0,0 +1,29 @@
+@echo off
+
+rem
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+rem
+
+rem
+rem mxmlc.bat script to launch falcon-mxmlc.jar in Windows Command Prompt.
+rem On OSX, Unix, or Cygwin, use the mxmlc shell script instead.
+rem
+
+if "x%FALCON_HOME%"=="x"  (set FALCON_HOME=%~dp0..) else echo Using Falcon codebase: %FALCON_HOME%
+
+if "x%FLEX_HOME%"=="x" (set FLEX_HOME=%~dp0..) else echo Using Flex SDK: %FLEX_HOME%
+
+@java -Dsun.io.useCanonCaches=false -Xms32m -Xmx512m -Dflexcompiler="%FALCON_HOME%" -Dflexlib="%FLEX_HOME%\frameworks" -jar "%FALCON_HOME%\lib\mxmlc.jar" %*
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/assembly/scripts/mxmlc
----------------------------------------------------------------------
diff --git a/compiler-jx/src/assembly/scripts/mxmlc b/compiler-jx/src/assembly/scripts/mxmlc
new file mode 100755
index 0000000..9218961
--- /dev/null
+++ b/compiler-jx/src/assembly/scripts/mxmlc
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+################################################################################
+##
+##  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.
+##
+################################################################################
+
+
+#
+# mxmlc shell script to launch falcon-mxmlc.jar on OSX, Unix, or Cygwin.
+# In Windows Command Prompt, use mxmlc.bat instead.
+#
+
+if [ "x${FALCON_HOME}" = "x" ]
+then
+    SCRIPT_HOME=`dirname "$0"`
+    FALCON_HOME=${SCRIPT_HOME}/../../compiler
+fi
+
+echo Using Falcon codebase: $FALCON_HOME
+
+if [ "x${FLEX_HOME}" = "x" ]
+then
+    FLEX_HOME=${FALCON_HOME}/generated/dist/sdk
+fi
+echo Using Flex SDK: $FLEX_HOME
+
+case `uname` in
+		CYGWIN*)
+			OS="Windows"
+		;;
+		*)
+			OS=Unix
+esac
+
+D32=''
+
+if [ $OS = "Windows" ]; then
+
+	FALCON_HOME=`cygpath -m $FALCON_HOME`
+	FLEX_HOME=`cygpath -m $FLEX_HOME`
+
+elif [ $OS = "Unix" ]; then
+
+    check64="`java -version 2>&1 | grep -i 64-Bit`"
+    isOSX="`uname | grep -i Darwin`"
+    javaVersion="`java -version 2>&1 | awk -F '[ ".]+' 'NR==1 {print $3 "." $4}'`"
+    
+    if [ "$isOSX" != "" -a "$HOSTTYPE" = "x86_64" -a "$check64" != "" -a "$javaVersion" = "1.6" ]; then
+        D32='-d32'
+    fi	
+fi
+
+VMARGS="-Xmx384m -Dsun.io.useCanonCaches=false "
+
+java $VMARGS $D32 $SETUP_SH_VMARGS -Dflexcompiler="$FALCON_HOME" -Dflexlib="$FLEX_HOME/frameworks" -jar "$SCRIPT_HOME/../lib/mxmlc.jar" +flexlib="$FLEX_HOME/frameworks" "$@"

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/assembly/scripts/mxmlc.bat
----------------------------------------------------------------------
diff --git a/compiler-jx/src/assembly/scripts/mxmlc.bat b/compiler-jx/src/assembly/scripts/mxmlc.bat
new file mode 100644
index 0000000..6626760
--- /dev/null
+++ b/compiler-jx/src/assembly/scripts/mxmlc.bat
@@ -0,0 +1,29 @@
+@echo off
+
+rem
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+rem
+
+rem
+rem mxmlc.bat script to launch falcon-mxmlc.jar in Windows Command Prompt.
+rem On OSX, Unix, or Cygwin, use the mxmlc shell script instead.
+rem
+
+if "x%FALCON_HOME%"=="x"  (set FALCON_HOME=%~dp0..) else echo Using Falcon codebase: %FALCON_HOME%
+
+if "x%FLEX_HOME%"=="x" (set FLEX_HOME=%~dp0..) else echo Using Flex SDK: %FLEX_HOME%
+
+@java -Dsun.io.useCanonCaches=false -Xms32m -Xmx512m -Dflexcompiler="%FALCON_HOME%" -Dflexlib="%FLEX_HOME%\frameworks" -jar "%FALCON_HOME%\lib\mxmlc.jar" %*
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/com/google/javascript/jscomp/FlexJSDiagnosticGroups.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/com/google/javascript/jscomp/FlexJSDiagnosticGroups.java b/compiler-jx/src/main/java/com/google/javascript/jscomp/FlexJSDiagnosticGroups.java
new file mode 100644
index 0000000..5b77b44
--- /dev/null
+++ b/compiler-jx/src/main/java/com/google/javascript/jscomp/FlexJSDiagnosticGroups.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 com.google.javascript.jscomp;
+
+/**
+ * Custom DiagnosticGroups allow @suppress directives to disable
+ * certain warnings while letting other warnings in the group
+ * show.
+ */
+public class FlexJSDiagnosticGroups {
+
+	/**
+	 * Flex ItemRenderer Factories store the constructor in a variable
+	 * resulting in this warning.
+	 */
+	public static final DiagnosticGroup FLEXJS_NOT_A_CONSTRUCTOR =
+		DiagnosticGroups.registerGroup("flexjsNotAConstructor",
+                TypeCheck.NOT_A_CONSTRUCTOR);
+
+	/**
+	 * Flex code calls super.methodName from functions other than
+	 * overrides of the methodName.
+	 */
+	public static final DiagnosticGroup FLEXJS_SUPER_CALL_TO_DIFFERENT_NAME =
+		DiagnosticGroups.registerGroup("flexjsSuperCallToDifferentName",
+                ProcessClosurePrimitives.BASE_CLASS_ERROR);
+	/*
+	public static final DiagnosticGroup FLEXJS_REFERENCE_BEFORE_DECLARE =
+		DiagnosticGroups.registerGroup("flexjsReferenceBeforeDeclare",
+                VariableReferenceCheck.UNDECLARED_REFERENCE);
+    */
+	
+	/**
+	 * Flex code won't always generate a goog.requires for types only used
+	 * in JSDoc annotations, but the compiler complains.
+	 */
+	public static final DiagnosticGroup FLEXJS_UNKNOWN_JSDOC_TYPE_NAME =
+		DiagnosticGroups.registerGroup("flexjsUnknownJSDocTypeName",
+                RhinoErrorReporter.TYPE_PARSE_ERROR);
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/com/google/javascript/jscomp/JXCompilerOptions.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/com/google/javascript/jscomp/JXCompilerOptions.java b/compiler-jx/src/main/java/com/google/javascript/jscomp/JXCompilerOptions.java
new file mode 100644
index 0000000..c31c46d
--- /dev/null
+++ b/compiler-jx/src/main/java/com/google/javascript/jscomp/JXCompilerOptions.java
@@ -0,0 +1,34 @@
+/*
+ *
+ *  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 com.google.javascript.jscomp;
+
+public class JXCompilerOptions extends CompilerOptions
+{
+
+    private static final long serialVersionUID = 2021530437904249081L;
+
+    public JXCompilerOptions()
+    {
+        super();
+        
+        declaredGlobalExternsOnWindow = false;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/asdoc/flexjs/ASDocComment.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/asdoc/flexjs/ASDocComment.java b/compiler-jx/src/main/java/org/apache/flex/compiler/asdoc/flexjs/ASDocComment.java
new file mode 100644
index 0000000..5470f47
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/asdoc/flexjs/ASDocComment.java
@@ -0,0 +1,107 @@
+/*
+ *
+ *  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.asdoc.flexjs;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.flex.compiler.asdoc.IASDocComment;
+import org.apache.flex.compiler.asdoc.IASDocTag;
+
+import antlr.Token;
+
+public class ASDocComment implements IASDocComment
+{
+
+    public ASDocComment(Token t)
+    {
+        token = t;
+    }
+
+    Token token;
+
+    public String commentNoEnd()
+    {
+        String s = token.getText();
+        String[] lines = s.split("\n");
+        StringBuilder sb = new StringBuilder();
+        int n = lines.length;
+        if (n == 1)
+        {
+        	int c = lines[0].indexOf("*/");
+        	if (c != -1)
+        		lines[0] = lines[0].substring(0, c);
+        }
+        sb.append(lines[0]);
+        sb.append("\n");
+        for (int i = 1; i < n - 1; i++)
+        {
+            String line = lines[i];
+            int star = line.indexOf("*");
+            sb.append(" ");
+            if (star > -1)
+                sb.append(line.substring(star));
+            sb.append("\n");
+        }
+        return sb.toString();
+    }
+
+    @Override
+    public String getDescription()
+    {
+        return null;
+    }
+
+    @Override
+    public void compile()
+    {
+    }
+
+    @Override
+    public boolean hasTag(String name)
+    {
+        return false;
+    }
+
+    @Override
+    public IASDocTag getTag(String name)
+    {
+        return null;
+    }
+
+    @Override
+    public Map<String, List<IASDocTag>> getTags()
+    {
+        return null;
+    }
+
+    @Override
+    public Collection<IASDocTag> getTagsByName(String string)
+    {
+        return null;
+    }
+
+    @Override
+    public void paste(IASDocComment source)
+    {
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/clients/COMPJSC.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/clients/COMPJSC.java b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/COMPJSC.java
new file mode 100644
index 0000000..b3b9c64
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/COMPJSC.java
@@ -0,0 +1,430 @@
+/*
+ *
+ *  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.clients;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.io.FilenameUtils;
+import org.apache.flex.compiler.codegen.as.IASWriter;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.driver.js.IJSApplication;
+import org.apache.flex.compiler.exceptions.ConfigurationException;
+import org.apache.flex.compiler.exceptions.ConfigurationException.IOError;
+import org.apache.flex.compiler.exceptions.ConfigurationException.MustSpecifyTarget;
+import org.apache.flex.compiler.internal.codegen.js.JSSharedData;
+import org.apache.flex.compiler.internal.driver.as.ASBackend;
+import org.apache.flex.compiler.internal.driver.js.amd.AMDBackend;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.internal.driver.mxml.flexjs.MXMLFlexJSSWCBackend;
+import org.apache.flex.compiler.internal.driver.mxml.jsc.MXMLJSCJSSWCBackend;
+import org.apache.flex.compiler.internal.driver.mxml.vf2js.MXMLVF2JSSWCBackend;
+import org.apache.flex.compiler.internal.projects.CompilerProject;
+import org.apache.flex.compiler.internal.targets.FlexJSSWCTarget;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.problems.InternalCompilerProblem;
+import org.apache.flex.compiler.problems.UnableToBuildSWFProblem;
+import org.apache.flex.compiler.targets.ITarget.TargetType;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.units.ICompilationUnit;
+
+/**
+ * @author Erik de Bruin
+ * @author Michael Schmalle
+ */
+public class COMPJSC extends MXMLJSC
+{
+    /*
+     * Exit code enumerations.
+     */
+    static enum ExitCode
+    {
+        SUCCESS(0),
+        PRINT_HELP(1),
+        FAILED_WITH_PROBLEMS(2),
+        FAILED_WITH_EXCEPTIONS(3),
+        FAILED_WITH_CONFIG_PROBLEMS(4);
+
+        ExitCode(int code)
+        {
+            this.code = code;
+        }
+
+        final int code;
+    }
+
+    @Override
+    public String getName()
+    {
+        return FLEX_TOOL_COMPC;
+    }
+
+    @Override
+    public int execute(String[] args)
+    {
+        return staticMainNoExit(args);
+    }
+
+    /**
+     * Java program entry point.
+     * 
+     * @param args command line arguments
+     */
+    public static void main(final String[] args)
+    {
+        int exitCode = staticMainNoExit(args);
+        System.exit(exitCode);
+    }
+
+    /**
+     * Entry point for the {@code <compc>} Ant task.
+     *
+     * @param args Command line arguments.
+     * @return An exit code.
+     */
+    public static int staticMainNoExit(final String[] args)
+    {
+        long startTime = System.nanoTime();
+
+        IBackend backend = new ASBackend();
+        for (String s : args)
+        {
+            if (s.contains("-js-output-type"))
+            {
+                jsOutputType = JSOutputType.fromString(s.split("=")[1]);
+
+                switch (jsOutputType)
+                {
+                case AMD:
+                    backend = new AMDBackend();
+                    break;
+
+                case JSC:
+                    backend = new MXMLJSCJSSWCBackend();
+                    break;
+
+                case FLEXJS:
+                case FLEXJS_DUAL:
+                    backend = new MXMLFlexJSSWCBackend();
+                    break;
+
+                case GOOG:
+                    backend = new GoogBackend();
+                    break;
+
+                case VF2JS:
+                    backend = new MXMLVF2JSSWCBackend();
+                    break;
+
+                default:
+                    throw new UnsupportedOperationException();
+                }
+            }
+        }
+
+        final COMPJSC mxmlc = new COMPJSC(backend);
+        final List<ICompilerProblem> problems = new ArrayList<ICompilerProblem>();
+        final int exitCode = mxmlc.mainNoExit(args, problems, true);
+
+        long endTime = System.nanoTime();
+        JSSharedData.instance.stdout((endTime - startTime) / 1e9 + " seconds");
+
+        return exitCode;
+    }
+
+    public COMPJSC(IBackend backend)
+    {
+        super(backend);
+    }
+
+    /**
+     * Main body of this program. This method is called from the public static
+     * method's for this program.
+     * 
+     * @return true if compiler succeeds
+     * @throws IOException
+     * @throws InterruptedException
+     */
+    @Override
+    protected boolean compile()
+    {
+        boolean compilationSuccess = false;
+
+        try
+        {
+            project.getSourceCompilationUnitFactory().addHandler(asFileHandler);
+
+            if (setupTargetFile())
+                buildArtifact();
+
+            if (jsTarget != null)
+            {
+                Collection<ICompilerProblem> errors = new ArrayList<ICompilerProblem>();
+                Collection<ICompilerProblem> warnings = new ArrayList<ICompilerProblem>();
+
+                if (!config.getCreateTargetWithErrors())
+                {
+                    problems.getErrorsAndWarnings(errors, warnings);
+                    if (errors.size() > 0)
+                        return false;
+                }
+
+                File outputFolder = new File(getOutputFilePath());
+
+                Set<String> externs = config.getExterns();
+                Collection<ICompilationUnit> roots = ((FlexJSSWCTarget)target).getReachableCompilationUnits(errors);
+                Collection<ICompilationUnit> reachableCompilationUnits = project.getReachableCompilationUnitsInSWFOrder(roots);
+                for (final ICompilationUnit cu : reachableCompilationUnits)
+                {
+                    ICompilationUnit.UnitType cuType = cu.getCompilationUnitType();
+
+                    if (cuType == ICompilationUnit.UnitType.AS_UNIT
+                            || cuType == ICompilationUnit.UnitType.MXML_UNIT)
+                    {
+                    	String symbol = cu.getQualifiedNames().get(0);
+                    	if (externs.contains(symbol)) continue;
+                    	
+                        final File outputClassFile = getOutputClassFile(
+                                cu.getQualifiedNames().get(0), outputFolder);
+
+                        System.out.println("Compiling file: " + outputClassFile);
+
+                        ICompilationUnit unit = cu;
+
+                        IASWriter writer;
+                        if (cuType == ICompilationUnit.UnitType.AS_UNIT)
+                        {
+                            writer = JSSharedData.backend.createWriter(project,
+                                    (List<ICompilerProblem>) errors, unit,
+                                    false);
+                        }
+                        else
+                        {
+                            writer = JSSharedData.backend.createMXMLWriter(
+                                    project, (List<ICompilerProblem>) errors,
+                                    unit, false);
+                        }
+                        problems.addAll(errors);
+                        BufferedOutputStream out = new BufferedOutputStream(
+                                new FileOutputStream(outputClassFile));
+                        writer.writeTo(out);
+                        out.flush();
+                        out.close();
+                        writer.close();
+                    }
+                }
+
+                compilationSuccess = true;
+            }
+        }
+        catch (Exception e)
+        {
+            final ICompilerProblem problem = new InternalCompilerProblem(e);
+            problems.add(problem);
+        }
+
+        return compilationSuccess;
+    }
+
+    /**
+     * Build target artifact.
+     * 
+     * @throws InterruptedException threading error
+     * @throws IOException IO error
+     * @throws ConfigurationException
+     */
+    @Override
+    protected void buildArtifact() throws InterruptedException, IOException,
+            ConfigurationException
+    {
+        jsTarget = buildJSTarget();
+    }
+
+    private IJSApplication buildJSTarget() throws InterruptedException,
+            FileNotFoundException, ConfigurationException
+    {
+        final List<ICompilerProblem> problemsBuildingSWF = new ArrayList<ICompilerProblem>();
+
+        final IJSApplication app = buildApplication(project,
+                config.getMainDefinition(), null, problemsBuildingSWF);
+        problems.addAll(problemsBuildingSWF);
+        if (app == null)
+        {
+            ICompilerProblem problem = new UnableToBuildSWFProblem(
+                    getOutputFilePath());
+            problems.add(problem);
+        }
+
+        return app;
+    }
+
+    /**
+     * Replaces FlexApplicationProject::buildSWF()
+     * 
+     * @param applicationProject
+     * @param rootClassName
+     * @param problems
+     * @return
+     * @throws InterruptedException
+     */
+
+    private IJSApplication buildApplication(CompilerProject applicationProject,
+            String rootClassName, ICompilationUnit mainCU,
+            Collection<ICompilerProblem> problems) throws InterruptedException,
+            ConfigurationException, FileNotFoundException
+    {
+        Collection<ICompilerProblem> fatalProblems = applicationProject.getFatalProblems();
+        if (!fatalProblems.isEmpty())
+        {
+            problems.addAll(fatalProblems);
+            return null;
+        }
+
+        return ((JSTarget) target).build(mainCU, problems);
+    }
+
+    /**
+     * Get the output file path. If {@code -output} is specified, use its value;
+     * otherwise, use the same base name as the target file.
+     * 
+     * @return output file path
+     */
+    private String getOutputFilePath()
+    {
+        if (config.getOutput() == null)
+        {
+            final String extension = "." + JSSharedData.OUTPUT_EXTENSION;
+            return FilenameUtils.removeExtension(config.getTargetFile()).concat(
+                    extension);
+        }
+        else
+        {
+            String outputFolderName = config.getOutput();
+            if (outputFolderName.endsWith(".swc"))
+            {
+                File outputFolder = new File(outputFolderName);
+                outputFolderName = outputFolder.getParent();
+            }
+            return outputFolderName;
+        }
+    }
+
+    /**
+     * Get the output class file. This includes the (sub)directory in which the
+     * original class file lives. If the directory structure doesn't exist, it
+     * is created.
+     * 
+     * @author Erik de Bruin
+     * @param qname
+     * @param outputFolder
+     * @return output class file path
+     */
+    private File getOutputClassFile(String qname, File outputFolder)
+    {
+        String[] cname = qname.split("\\.");
+        String sdirPath = outputFolder + File.separator;
+        if (cname.length > 0)
+        {
+            for (int i = 0, n = cname.length - 1; i < n; i++)
+            {
+                sdirPath += cname[i] + File.separator;
+            }
+
+            File sdir = new File(sdirPath);
+            if (!sdir.exists())
+                sdir.mkdirs();
+
+            qname = cname[cname.length - 1];
+        }
+
+        return new File(sdirPath + qname + "." + JSSharedData.OUTPUT_EXTENSION);
+    }
+
+    /**
+     * Mxmlc uses target file as the main compilation unit and derive the output
+     * SWF file name from this file.
+     * 
+     * @return true if successful, false otherwise.
+     * @throws InterruptedException
+     */
+    @Override
+    protected boolean setupTargetFile() throws InterruptedException
+    {
+        config.getTargetFile();
+
+        ITargetSettings settings = getTargetSettings();
+        if (settings != null)
+            project.setTargetSettings(settings);
+        else
+            return false;
+
+        target = JSSharedData.backend.createTarget(project,
+                getTargetSettings(), null);
+
+        return true;
+    }
+
+    private ITargetSettings getTargetSettings()
+    {
+        if (targetSettings == null)
+            targetSettings = projectConfigurator.getTargetSettings(getTargetType());
+
+        if (targetSettings == null)
+            problems.addAll(projectConfigurator.getConfigurationProblems());
+
+        return targetSettings;
+    }
+
+    /**
+     * Validate target file.
+     * 
+     * @throws MustSpecifyTarget
+     * @throws IOError
+     */
+    @Override
+    protected void validateTargetFile() throws ConfigurationException
+    {
+
+    }
+
+    protected String getProgramName()
+    {
+        return "compc";
+    }
+
+    protected boolean isCompc()
+    {
+        return true;
+    }
+
+    @Override
+    protected TargetType getTargetType()
+    {
+        return TargetType.SWC;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/clients/EXTERNC.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/clients/EXTERNC.java b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/EXTERNC.java
new file mode 100644
index 0000000..ed96162
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/clients/EXTERNC.java
@@ -0,0 +1,216 @@
+/*
+ *
+ *  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.clients;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.internal.codegen.externals.emit.ReferenceEmitter;
+import org.apache.flex.compiler.internal.codegen.externals.pass.ReferenceCompiler;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;
+import org.apache.flex.compiler.internal.codegen.js.JSSharedData;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.targets.ITarget.TargetType;
+
+import com.google.javascript.jscomp.Result;
+import org.apache.flex.tools.FlexTool;
+
+/**
+ * @author Michael Schmalle
+ */
+public class EXTERNC implements FlexTool
+{
+    static enum ExitCode
+    {
+        SUCCESS(0),
+        PRINT_HELP(1),
+        FAILED_WITH_PROBLEMS(2),
+        FAILED_WITH_EXCEPTIONS(3),
+        FAILED_WITH_CONFIG_PROBLEMS(4);
+
+        ExitCode(int code)
+        {
+            this.code = code;
+        }
+
+        final int code;
+    }
+
+    protected Configurator projectConfigurator;
+    private ExternCConfiguration configuration;
+    private ReferenceModel model;
+    private ReferenceCompiler compiler;
+    private ReferenceEmitter emitter;
+
+    public ReferenceModel getModel()
+    {
+        return model;
+    }
+
+    public ReferenceCompiler getCompiler()
+    {
+        return compiler;
+    }
+
+    public ReferenceEmitter getEmitter()
+    {
+        return emitter;
+    }
+
+    public EXTERNC()
+    {
+    }
+
+    public EXTERNC(ExternCConfiguration configuration)
+    {
+        configure(configuration);
+    }
+
+    public void configure(String[] args)
+    {
+        projectConfigurator = createConfigurator();
+        projectConfigurator.setConfiguration(args, "external", false);
+        projectConfigurator.getTargetSettings(TargetType.SWC);
+        configure((ExternCConfiguration) projectConfigurator.getConfiguration());
+    }
+
+    public void configure(ExternCConfiguration configuration)
+    {
+        this.configuration = configuration;
+
+        model = new ReferenceModel(configuration);
+        compiler = new ReferenceCompiler(model);
+        emitter = new ReferenceEmitter(model);
+    }
+
+    /**
+     * Create a new Configurator. This method may be overridden to allow
+     * Configurator subclasses to be created that have custom configurations.
+     * 
+     * @return a new instance or subclass of {@link Configurator}.
+     */
+    protected Configurator createConfigurator()
+    {
+        return new Configurator(ExternCConfiguration.class);
+    }
+
+    /**
+     * Java program entry point.
+     * 
+     * @param args command line arguments
+     */
+    public static void main(final String[] args)
+    {
+        int exitCode = staticMainNoExit(args);
+        System.exit(exitCode);
+    }
+
+    /**
+     * Entry point for the <code>externc</code>.
+     *
+     * @param args Command line arguments.
+     * @return An exit code.
+     */
+    public static int staticMainNoExit(final String[] args)
+    {
+        long startTime = System.nanoTime();
+
+        final EXTERNC compiler = new EXTERNC();
+        compiler.configure(args);
+        final Set<ICompilerProblem> problems = new HashSet<ICompilerProblem>();
+        final int exitCode = compiler.mainNoExit(args, problems, true);
+
+        long endTime = System.nanoTime();
+        JSSharedData.instance.stdout((endTime - startTime) / 1e9 + " seconds");
+
+        return exitCode;
+    }
+
+    public int mainNoExit(final String[] args, Set<ICompilerProblem> problems,
+            Boolean printProblems)
+    {
+        int exitCode = -1;
+
+        try
+        {
+            cleanOutput();
+            compile();
+            emit();
+        }
+        catch (IOException e)
+        {
+            JSSharedData.instance.stderr(e.toString());
+        }
+        finally
+        {
+            if (problems != null && !problems.isEmpty())
+            {
+                if (printProblems)
+                {
+                }
+            }
+        }
+
+        return exitCode;
+    }
+
+    public void cleanOutput() throws IOException
+    {
+        FileUtils.deleteDirectory(configuration.getAsRoot());
+    }
+
+    public void emit() throws IOException
+    {
+        emitter.emit();
+    }
+
+    public Result compile() throws IOException
+    {
+        return compiler.compile();
+    }
+
+    @Override
+    public String getName() {
+        // TODO: Change this to a flex-tool-api constant ...
+        return "EXTERNC";
+    }
+
+    @Override
+    public int execute(String[] args) {
+        EXTERNC generator = new EXTERNC();
+        generator.configure(args);
+        try {
+            generator.cleanOutput();
+            /*Result result =*/ generator.compile();
+            // We ignore errors for now ... they seem to be normal.
+            /*if(result.errors.length > 0) {
+                return 1;
+            }*/
+            generator.emit();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return 0;
+    }
+
+}


[21/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogStatements.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogStatements.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogStatements.java
new file mode 100644
index 0000000..cf550da
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogStatements.java
@@ -0,0 +1,310 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.TestStatements;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.ISwitchNode;
+import org.apache.flex.compiler.tree.as.ITryNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class TestGoogStatements extends TestStatements
+{
+    //----------------------------------
+    // var declaration
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVarDeclaration()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {*} */ a");
+    }
+
+    @Override
+    @Test
+    public void testVarDeclaration_withType()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a:int;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a");
+    }
+
+    @Override
+    @Test
+    public void testVarDeclaration_withTypeAssignedValue()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a:int = 42;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = 42");
+    }
+
+    @Override
+    @Test
+    public void testVarDeclaration_withTypeAssignedValueComplex()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "class A { public function b():void { var a:Foo = new Foo(42, 'goo');}} class Foo {}", IVariableNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Foo} */ a = new Foo(42, 'goo')");
+    }
+
+    @Override
+    @Test
+    public void testVarDeclaration_withList()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "var a:int = 4, b:int = 11, c:int = 42;", IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = 4, /** @type {number} */ b = 11, /** @type {number} */ c = 42");
+    }
+
+    //----------------------------------
+    // const declaration
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testConstDeclaration()
+    {
+        IVariableNode node = (IVariableNode) getNode("const a = 42;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("\n/**\n * @const\n * @type {*}\n */\na = 42");
+    }
+
+    @Override
+    @Test
+    public void testConstDeclaration_withType()
+    {
+        IVariableNode node = (IVariableNode) getNode("const a:int = 42;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("\n/**\n * @const\n * @type {number}\n */\na = 42");
+    }
+
+    @Override
+    @Test
+    public void testConstDeclaration_withList()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "const a:int = 4, b:int = 11, c:int = 42;", IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("\n/**\n * @const\n * @type {number}\n */\na = 4, \n/**\n * @const\n * @type {number}\n */\nb = 11, \n/**\n * @const\n * @type {number}\n */\nc = 42");
+    }
+
+    //----------------------------------
+    // for () { }
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitFor_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int = 0; i < len; i++) { break; }",
+                IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {number} */ i = 0; i < len; i++) {\n\tbreak;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitFor_1b()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int = 0; i < len; i++) break;", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {number} */ i = 0; i < len; i++)\n\tbreak;");
+    }
+
+    @Override
+    @Test
+    public void testVisitForIn_1()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int in obj) { break; }", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {number} */ i in obj) {\n\tbreak;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitForIn_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int in obj)  break; ", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {number} */ i in obj)\n\tbreak;");
+    }
+
+    @Override
+    @Test
+    public void testVisitForEach_1()
+    {
+        // TODO (erikdebruin) we need to insert a "goog.require('goog.array')"
+        //                    into the header
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for each(var i:int in obj) { break; }", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("goog.array.forEach(obj, function (i) {\n\tbreak;\n})");
+    }
+
+    @Override
+    @Test
+    public void testVisitForEach_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for each(var i:int in obj)  break; ", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("goog.array.forEach(obj, function (i) {\n\tbreak;\n})");
+    }
+
+    //----------------------------------
+    // try {} catch () {} finally {}
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitTry_Catch()
+    {
+        ITryNode node = (ITryNode) getNode("try { a; } catch (e:Error) { b; }",
+                ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n\ta;\n} catch (e) {\n\tb;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitTry_Catch_Finally()
+    {
+        ITryNode node = (ITryNode) getNode(
+                "try { a; } catch (e:Error) { b; } finally { c; }",
+                ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n\ta;\n} catch (e) {\n\tb;\n} finally {\n\tc;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitTry_Catch_Catch_Finally()
+    {
+        // TODO (erikdebruin) handle multiple 'catch' statements (FW in Wiki)
+        ITryNode node = (ITryNode) getNode(
+                "try { a; } catch (e:Error) { b; } catch (f:Error) { c; } finally { d; }",
+                ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n\ta;\n} catch (e) {\n\tb;\n} catch (f) {\n\tc;\n} finally {\n\td;\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitTry_CatchEmpty_FinallyEmpty_()
+    {
+        ITryNode node = (ITryNode) getNode(
+                "try { a; } catch (e:Error) {  } finally {  }", ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n\ta;\n} catch (e) {\n} finally {\n}");
+    }
+
+    //----------------------------------
+    // switch {}
+    //----------------------------------
+
+    @Test
+    public void testVisitSwitch_3()
+    {
+        ISwitchNode node = (ISwitchNode) getNode(
+                "switch(i){case 1: { var x:int = 42; break; }; case 2: { var y:int = 66; break; }}", ISwitchNode.class);
+        asBlockWalker.visitSwitch(node);
+        assertOut("switch (i) {\n\tcase 1:\n\t\tvar /** @type {number} */ x = 42;\n\t\tbreak;\n\tcase 2:\n\t\tvar /** @type {number} */ y = 66;\n\t\tbreak;\n}");
+    }
+
+    //----------------------------------
+    // label : for () {}
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitLabel_1()
+    {
+        LabeledStatementNode node = (LabeledStatementNode) getNode(
+                "foo: for each(var i:int in obj) { break foo; }",
+                LabeledStatementNode.class);
+        asBlockWalker.visitLabeledStatement(node);
+        assertOut("foo : goog.array.forEach(obj, function (i) {\n\tbreak foo;\n})");
+    }
+
+    @Override
+    @Test
+    public void testVisitLabel_1a()
+    {
+        LabeledStatementNode node = (LabeledStatementNode) getNode(
+                "foo: for each(var i:int in obj) break foo;",
+                LabeledStatementNode.class);
+        asBlockWalker.visitLabeledStatement(node);
+        assertOut("foo : goog.array.forEach(obj, function (i) {\n\tbreak foo;\n})");
+    }
+
+    //----------------------------------
+    // all together now!
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisit()
+    {
+        IFileNode node = (IFileNode) getNode(
+                "try { a; } catch (e:Error) { if (a) { if (b) { if (c) b; else if (f) a; else e; }} } finally {  }"
+                        + "if (d) for (var i:int = 0; i < len; i++) break;"
+                        + "if (a) { with (ab) { c(); } "
+                        + "do {a++;do a++; while(a > b);} while(c > d); }"
+                        + "if (b) { try { a; throw new Error('foo'); } catch (e:Error) { "
+                        + " switch(i){case 1: break; default: return;}"
+                        + " } finally { "
+                        + "  d;  var a:Object = function(foo:int, bar:String = 'goo'):int{return -1;};"
+                        + "  eee.dd; eee.dd; eee.dd; eee.dd;} }"
+                        + "foo: for each(var i:int in obj) break foo;",
+                IFileNode.class);
+        asBlockWalker.visitFile(node);
+        assertOut("goog.provide('FalconTest_A');\n\n/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\nFalconTest_A.prototype.falconTest_a = function() {\n\tvar self = this;\n\ttry {\n\t\ta;\n\t} catch (e) {\n\t\tif (a) {\n\t\t\tif (b) {\n\t\t\t\tif (c)\n\t\t\t\t\tb;\n\t\t\t\telse if (f)\n\t\t\t\t\ta;\n\t\t\t\telse\n\t\t\t\t\te;\n\t\t\t}\n\t\t}\n\t} finally {\n\t}\n\tif (d)\n\t\tfor (var /** @type {number} */ i = 0; i < len; i++)\n\t\t\tbreak;\n\tif (a) {\n\t\twith (ab) {\n\t\t\tc();\n\t\t}\n\t\tdo {\n\t\t\ta++;\n\t\t\tdo\n\t\t\t\ta++;\n\t\t\twhile (a > b);\n\t\t} while (c > d);\n\t}\n\tif (b) {\n\t\ttry {\n\t\t\ta;\n\t\t\tthrow new Error('foo');\n\t\t} catch (e) {\n\t\t\tswitch (i) {\n\t\t\t\tcase 1:\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t} finally {\n\t\t\td;\n\t\t\tvar /** @type {Object} */ a = function(foo, bar) {\n\t\t\t\tbar = typeof bar !== 'undefined' ? bar : 'goo';\n\t\t\t\treturn -1;\n\t\t\t};\n\t\t\teee.dd;\n\t\t\teee.dd;\n\t\t\tee
 e.dd;\n\t\t\teee.dd;\n\t\t}\n\t}\n\tfoo : goog.array.forEach(obj, function (i) {\n\t\tbreak foo;\n\t});\n};");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/sourcemaps/TestSourceMapExpressions.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/sourcemaps/TestSourceMapExpressions.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/sourcemaps/TestSourceMapExpressions.java
new file mode 100644
index 0000000..57ab17b
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/sourcemaps/TestSourceMapExpressions.java
@@ -0,0 +1,716 @@
+package org.apache.flex.compiler.internal.codegen.js.sourcemaps;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.internal.test.SourceMapTestBase;
+import org.apache.flex.compiler.internal.tree.as.ArrayLiteralNode;
+import org.apache.flex.compiler.internal.tree.as.ObjectLiteralNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IIterationFlowNode;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.IReturnNode;
+import org.apache.flex.compiler.tree.as.ITernaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+
+import org.junit.Test;
+
+public class TestSourceMapExpressions extends SourceMapTestBase
+{
+    //----------------------------------
+    // Primary expression keywords
+    //----------------------------------
+
+    //----------------------------------
+    // Arithmetic
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_Plus()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a + b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_Minus()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a - b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_Divide()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a / b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_Modulo()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a % b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_Multiply()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a * b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_PostIncrement()
+    {
+        IUnaryOperatorNode node = getUnaryNode("a++");
+        asBlockWalker.visitUnaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 3);
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_PreIncrement()
+    {
+        IUnaryOperatorNode node = getUnaryNode("++a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 2);
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_PostDecrement()
+    {
+        IUnaryOperatorNode node = getUnaryNode("a--");
+        asBlockWalker.visitUnaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 3);
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_PreDecrement()
+    {
+        IUnaryOperatorNode node = getUnaryNode("--a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 2);
+    }
+
+    //----------------------------------
+    // Arithmetic compound assignment
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_PlusAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a += b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_MinusAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a -= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_DivideAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a /= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_ModuloAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a %= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_MultiplyAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a *= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    //----------------------------------
+    // Assignment
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_Assignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a = b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+    }
+
+    //----------------------------------
+    // Bitwise
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseAnd()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a & b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseLeftShift()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a << b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_BitwiseNot()
+    {
+        IUnaryOperatorNode node = getUnaryNode("~a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 1);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseOr()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a | b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseRightShift()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a >> b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseUnsignedRightShift()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a >>> b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 6);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseXOR()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a ^ b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+    }
+
+    //----------------------------------
+    // Bitwise compound assignment
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseAndAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a &= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseLeftShiftAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a <<= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 6);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseOrAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a |= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseRightShiftAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a >>= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 6);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseUnsignedRightShiftAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a >>>= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 7);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_BitwiseXORAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a ^= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    //----------------------------------
+    // Comparison
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_Equal()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a == b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_GreaterThan()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a > b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_GreaterThanEqual()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a >= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_NotEqual()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a != b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_LessThan()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a < b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_LessThanEqual()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a <= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_StrictEqual()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a === b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 6);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_StrictNotEqual()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a !== b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 6);
+    }
+
+    //----------------------------------
+    // Logical
+    //----------------------------------
+
+    @Test
+    public void testVisitBinaryOperatorNode_LogicalAnd()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a && b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_LogicalAndAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a &&= b");
+        asBlockWalker.visitBinaryOperator(node);
+        //a = a && b
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+        assertMapping(node, 0, 1, 0, 5, 0, 9);
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_LogicalNot()
+    {
+        IUnaryOperatorNode node = getUnaryNode("!a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 1);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_LogicalOr()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a || b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_LogicalOrAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a ||= b");
+        asBlockWalker.visitBinaryOperator(node);
+        //a = a || b
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+        assertMapping(node, 0, 1, 0, 5, 0, 9);
+    }
+
+    //----------------------------------
+    // Other
+    //----------------------------------
+
+    @Test
+    public void testVisitDynamicAccessNode_1()
+    {
+        IDynamicAccessNode node = getDynamicAccessNode("a[b]");
+        asBlockWalker.visitDynamicAccess(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 2);
+        assertMapping(node, 0, 3, 0, 3, 0, 4);
+    }
+
+    @Test
+    public void testVisitDynamicAccessNode_2()
+    {
+        IDynamicAccessNode node = getDynamicAccessNode("a[b[c][d]]");
+        asBlockWalker.visitDynamicAccess(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 2);
+        assertMapping(node, 0, 3, 0, 3, 0, 4);
+        assertMapping(node, 0, 5, 0, 5, 0, 6);
+        assertMapping(node, 0, 6, 0, 6, 0, 7);
+        assertMapping(node, 0, 8, 0, 8, 0, 9);
+        assertMapping(node, 0, 9, 0, 9, 0, 10);
+    }
+
+    @Test
+    public void testVisitBinaryOperatorNode_Comma()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a, b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 3);
+    }
+
+    @Test
+    public void testVisitTernaryOperatorNode()
+    {
+        ITernaryOperatorNode node = (ITernaryOperatorNode) getExpressionNode(
+                "a ? b : c", ITernaryOperatorNode.class);
+        asBlockWalker.visitTernaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 4);
+        assertMapping(node, 0, 5, 0, 5, 0, 8);
+    }
+
+    @Test
+    public void testVisitUnaryOperator_Delete()
+    {
+        IUnaryOperatorNode node = getUnaryNode("delete a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 7);
+    }
+
+    @Test
+    public void testVisitMemberAccess_1()
+    {
+        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getExpressionNode(
+                "a.b", IMemberAccessExpressionNode.class);
+        asBlockWalker.visitMemberAccessExpression(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 2);
+    }
+
+    @Test
+    public void testVisitMemberAccess_2()
+    {
+        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getExpressionNode(
+                "a.b.c.d", IMemberAccessExpressionNode.class);
+        asBlockWalker.visitMemberAccessExpression(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 2);
+        assertMapping(node, 0, 3, 0, 3, 0, 4);
+        assertMapping(node, 0, 5, 0, 5, 0, 6);
+    }
+
+    @Test
+    public void testVisitBinaryOperator_In()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a in b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 5);
+    }
+
+    @Test
+    public void testVisitBinaryOperator_Instancof()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a instanceof b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 13);
+    }
+
+    @Test
+    public void testVisitBinaryOperator_New()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getExpressionNode(
+                "new Object()", IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 4);
+    }
+
+    @Test
+    public void testVisitObjectLiteral_1()
+    {
+        ObjectLiteralNode node = (ObjectLiteralNode) getExpressionNode(
+                "a = {a:1}", ObjectLiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 1); // {
+        assertMapping(node, 0, 1, 0, 1, 0, 2); // a
+        assertMapping(node, 0, 2, 0, 2, 0, 3); // :
+        assertMapping(node, 0, 4, 0, 4, 0, 5); // }
+    }
+
+    @Test
+    public void testVisitObjectLiteral_2()
+    {
+        ObjectLiteralNode node = (ObjectLiteralNode) getExpressionNode(
+                "a = {a:1,b:{c:2,d:{e:4}}}", ObjectLiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        //{a:1, b:{c:2, d:{e:4}}}
+        assertMapping(node, 0, 0, 0, 0, 0, 1);    // {
+        assertMapping(node, 0, 1, 0, 1, 0, 2);    // a
+        assertMapping(node, 0, 2, 0, 2, 0, 3);    // :
+        assertMapping(node, 0, 4, 0, 4, 0, 6);    // ,
+        assertMapping(node, 0, 5, 0, 6, 0, 7);    // b
+        assertMapping(node, 0, 6, 0, 7, 0, 8);    // :
+        assertMapping(node, 0, 7, 0, 8, 0, 9);    // {
+        assertMapping(node, 0, 8, 0, 9, 0, 10);   // c
+        assertMapping(node, 0, 9, 0, 10, 0, 11);  // :
+        assertMapping(node, 0, 11, 0, 12, 0, 14); // ,
+        assertMapping(node, 0, 12, 0, 14, 0, 15); // d
+        assertMapping(node, 0, 13, 0, 15, 0, 16); // :
+        assertMapping(node, 0, 14, 0, 16, 0, 17); // {
+        assertMapping(node, 0, 15, 0, 17, 0, 18); // e
+        assertMapping(node, 0, 16, 0, 18, 0, 19); // :
+        assertMapping(node, 0, 18, 0, 20, 0, 21); // }
+        assertMapping(node, 0, 19, 0, 21, 0, 22); // }
+        assertMapping(node, 0, 20, 0, 22, 0, 23); // }
+        
+    }
+
+    @Test
+    public void testVisitObjectLiteral_3()
+    {
+        ObjectLiteralNode node = (ObjectLiteralNode) getExpressionNode(
+                "a = { a: 12,  bb: 2   \t}", ObjectLiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        //{a:12, bb:2}
+        assertMapping(node, 0, 0, 0, 0, 0, 1);    // {
+        assertMapping(node, 0, 2, 0, 1, 0, 2);    // a
+        assertMapping(node, 0, 3, 0, 2, 0, 3);    // :
+        assertMapping(node, 0, 7, 0, 5, 0, 7);    // ,
+        assertMapping(node, 0, 10, 0, 7, 0, 9);   // bb
+        assertMapping(node, 0, 12, 0, 9, 0, 10);  // :
+        assertMapping(node, 0, 19, 0, 11, 0, 12); // }
+    }
+
+    @Test
+    public void testVisitArrayLiteral_1()
+    {
+        ArrayLiteralNode node = (ArrayLiteralNode) getExpressionNode(
+                "a = [0,1,2]", ArrayLiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        //[0, 1, 2]
+        assertMapping(node, 0, 0, 0, 0, 0, 1); // [
+        assertMapping(node, 0, 2, 0, 2, 0, 4); // ,
+        assertMapping(node, 0, 4, 0, 5, 0, 7); // ,
+        assertMapping(node, 0, 6, 0, 8, 0, 9); // ]
+    }
+
+    @Test
+    public void testVisitArrayLiteral_2()
+    {
+        ArrayLiteralNode node = (ArrayLiteralNode) getExpressionNode(
+                "a = [0,[0,1,[0,1]],2,[1,2]]", ArrayLiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        //[0, [0, 1, [0, 1]], 2, [1, 2]]
+        assertMapping(node, 0, 0, 0, 0, 0, 1);    // [
+        assertMapping(node, 0, 2, 0, 2, 0, 4);    // ,
+        assertMapping(node, 0, 3, 0, 4, 0, 5);    // [
+        assertMapping(node, 0, 5, 0, 6, 0, 8);    // ,
+        assertMapping(node, 0, 7, 0, 9, 0, 11);   // ,
+        assertMapping(node, 0, 8, 0, 11, 0, 12);  // [
+        assertMapping(node, 0, 10, 0, 13, 0, 15); // ,
+        assertMapping(node, 0, 12, 0, 16, 0, 17); // ]
+        assertMapping(node, 0, 13, 0, 17, 0, 18); // ]
+        
+        assertMapping(node, 0, 14, 0, 18, 0, 20); // ,
+        assertMapping(node, 0, 16, 0, 21, 0, 23); // ,
+        assertMapping(node, 0, 17, 0, 23, 0, 24); // [
+        assertMapping(node, 0, 19, 0, 25, 0, 27); // ,
+        assertMapping(node, 0, 21, 0, 28, 0, 29); // ]
+        assertMapping(node, 0, 22, 0, 29, 0, 30); // ]
+    }
+
+    @Test
+    public void testVisitArrayLiteral_3()
+    {
+        ArrayLiteralNode node = (ArrayLiteralNode) getExpressionNode(
+                "a = [ 0,  123, 45   \t]", ArrayLiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        //[0, 123, 45]
+        assertMapping(node, 0, 0, 0, 0, 0, 1);    // [
+        assertMapping(node, 0, 3, 0, 2, 0, 4);    // ,
+        assertMapping(node, 0, 9, 0, 7, 0, 9);    // ,
+        assertMapping(node, 0, 17, 0, 11, 0, 12); // ]
+    }
+
+    @Test
+    public void testVisitArrayLiteral_4()
+    {
+        ArrayLiteralNode node = (ArrayLiteralNode) getExpressionNode(
+                "a = [0,\n123, 45]", ArrayLiteralNode.class);
+        asBlockWalker.visitLiteral(node);
+        //[0, 123, 45]
+        assertMapping(node, 0, 0, 0, 0, 0, 1);    // [
+        assertMapping(node, 0, 1, 0, 1, 0, 2);    // 0
+        assertMapping(node, 0, 2, 0, 2, 0, 4);    // ,
+        assertMapping(node, 1, 0, 0, 4, 0, 7);    // 123
+        assertMapping(node, 1, 3, 0, 7, 0, 9);    // ,
+        assertMapping(node, 1, 5, 0, 9, 0, 11);    // 45
+        //TODO: figure out how to place the ] 
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_Typeof()
+    {
+        IUnaryOperatorNode node = getUnaryNode("typeof(a)");
+        asBlockWalker.visitUnaryOperator(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 7);
+        assertMapping(node, 0, 0, 0, 8, 0, 9);
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_Typeof_NoParens()
+    {
+        // TODO (mschmalle) the notation without parenthesis is also valid in AS/JS
+        IUnaryOperatorNode node = getUnaryNode("typeof a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 7);
+        assertMapping(node, 0, 0, 0, 8, 0, 9);
+    }
+
+    @Test
+    public void testVisitUnaryOperatorNode_Void()
+    {
+        IUnaryOperatorNode node = getUnaryNode("void a");
+        asBlockWalker.visitUnaryOperator(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 5);
+    }
+
+    @Test
+    public void testVisitIterationFlowNode_BreakWithoutLabel()
+    {
+        IIterationFlowNode node = (IIterationFlowNode) getNode("break",
+                IIterationFlowNode.class);
+        asBlockWalker.visitIterationFlow(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 5);
+    }
+
+    @Test
+    public void testVisitIterationFlowNode_BreakWithLabel()
+    {
+        IIterationFlowNode node = (IIterationFlowNode) getNode("break label",
+                IIterationFlowNode.class);
+        asBlockWalker.visitIterationFlow(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 6);
+    }
+
+    @Test
+    public void testVisitIterationFlowNode_ContinueWithoutLabel()
+    {
+        IIterationFlowNode node = (IIterationFlowNode) getNode("continue",
+                IIterationFlowNode.class);
+        asBlockWalker.visitIterationFlow(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 8);
+    }
+
+    @Test
+    public void testVisitIterationFlowNode_ContinueWithLabel()
+    {
+        IIterationFlowNode node = (IIterationFlowNode) getNode("continue label",
+                IIterationFlowNode.class);
+        asBlockWalker.visitIterationFlow(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 9);
+    }
+
+    @Test
+    public void testVisitReturnWithoutValue()
+    {
+        IReturnNode node = (IReturnNode) getNode("return", IReturnNode.class);
+        asBlockWalker.visitReturn(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 6);
+    }
+
+    @Test
+    public void testVisitReturnWithValue()
+    {
+        IReturnNode node = (IReturnNode) getNode("return 0", IReturnNode.class);
+        asBlockWalker.visitReturn(node);
+        assertMapping(node, 0, 0, 0, 0, 0, 7);
+    }
+
+    @Test
+    public void testVisitFunctionCall_1()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode("a()", IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 2);
+        assertMapping(node, 0, 2, 0, 2, 0, 3);
+    }
+
+    @Test
+    public void testVisitFunctionCall_2()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode("a(b)", IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 2);
+        assertMapping(node, 0, 3, 0, 3, 0, 4);
+    }
+
+    @Test
+    public void testVisitFunctionCall_3()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode("a(b, c)", IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertMapping(node, 0, 1, 0, 1, 0, 2);
+        assertMapping(node, 0, 3, 0, 3, 0, 5);
+        assertMapping(node, 0, 6, 0, 6, 0, 7);
+    }
+
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/sourcemaps/TestSourceMapStatements.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/sourcemaps/TestSourceMapStatements.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/sourcemaps/TestSourceMapStatements.java
new file mode 100644
index 0000000..3c25d07
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/sourcemaps/TestSourceMapStatements.java
@@ -0,0 +1,171 @@
+package org.apache.flex.compiler.internal.codegen.js.sourcemaps;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.internal.test.SourceMapTestBase;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+
+import org.junit.Test;
+
+public class TestSourceMapStatements extends SourceMapTestBase
+{
+    //----------------------------------
+    // var declaration
+    //----------------------------------
+
+    @Test
+    public void testVarDeclaration()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        //var /** @type {*} */ a
+        assertMapping(node, 0, 0, 0, 0, 0, 4);   // var
+        assertMapping(node, 0, 4, 0, 21, 0, 22); // a
+        assertMapping(node, 0, 5, 0, 4, 0, 21);  // (type)
+    }
+
+    @Test
+    public void testVarDeclaration_withType()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a:int;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        //var /** @type {number} */ a
+        assertMapping(node, 0, 0, 0, 0, 0, 4);   // var
+        assertMapping(node, 0, 4, 0, 26, 0, 27); // a
+        assertMapping(node, 0, 5, 0, 4, 0, 26);  // :int
+    }
+
+    @Test
+    public void testVarDeclaration_withTypeAssignedValue()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a:int = 42;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        //var /** @type {number} */ a = 42
+        assertMapping(node, 0, 0, 0, 0, 0, 4);    // var
+        assertMapping(node, 0, 4, 0, 26, 0, 27);  // a
+        assertMapping(node, 0, 5, 0, 4, 0, 26);   // :int
+        assertMapping(node, 0, 9, 0, 27, 0, 30);  // =
+        assertMapping(node, 0, 12, 0, 30, 0, 32); // 42
+    }
+
+    @Test
+    public void testVarDeclaration_withTypeAssignedValueComplex()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "class A { public function b():void { var a:Foo = new Foo(42, 'goo');}} class Foo {}", IVariableNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitVariable(node);
+        //var /** @type {Foo} */ a = new Foo(42, 'goo')
+        assertMapping(node, 0, 0, 0, 0, 0, 4);    // var
+        assertMapping(node, 0, 4, 0, 23, 0, 24);  // a
+        assertMapping(node, 0, 5, 0, 4, 0, 23);   // :Foo
+        assertMapping(node, 0, 9, 0, 24, 0, 27);  // =
+        assertMapping(node, 0, 12, 0, 27, 0, 31);  // new
+        assertMapping(node, 0, 16, 0, 31, 0, 34);  // Foo
+        assertMapping(node, 0, 19, 0, 34, 0, 35);  // (
+        assertMapping(node, 0, 20, 0, 35, 0, 37);  // 42
+        assertMapping(node, 0, 22, 0, 37, 0, 39);  // ,
+        assertMapping(node, 0, 24, 0, 39, 0, 44);  // 'goo'
+        assertMapping(node, 0, 29, 0, 44, 0, 45);  // )
+    }
+
+    @Test
+    public void testVarDeclaration_withList()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "var a:int = 4, b:int = 11, c:int = 42;", IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        //var /** @type {number} */ a = 4, /** @type {number} */ b = 11, /** @type {number} */ c = 42
+        assertMapping(node, 0, 0, 0, 0, 0, 4);    // var
+        assertMapping(node, 0, 4, 0, 26, 0, 27);  // a
+        assertMapping(node, 0, 5, 0, 4, 0, 26);   // :int
+        assertMapping(node, 0, 9, 0, 27, 0, 30);  // =
+        assertMapping(node, 0, 12, 0, 30, 0, 31); // 4
+        assertMapping(node, 0, 13, 0, 31, 0, 33); // ,
+        assertMapping(node, 0, 15, 0, 55, 0, 56); // b
+        assertMapping(node, 0, 16, 0, 33, 0, 55); // :int
+        assertMapping(node, 0, 20, 0, 56, 0, 59); // =
+        assertMapping(node, 0, 23, 0, 59, 0, 61); // 11
+        assertMapping(node, 0, 25, 0, 61, 0, 63); // ,
+        assertMapping(node, 0, 27, 0, 85, 0, 86); // c
+        assertMapping(node, 0, 28, 0, 63, 0, 85); // :int
+        assertMapping(node, 0, 32, 0, 86, 0, 89); // =
+        assertMapping(node, 0, 35, 0, 89, 0, 91); // 42
+    }
+
+    //----------------------------------
+    // for () { }
+    //----------------------------------
+
+    @Test
+    public void testVisitFor_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int = 0; i < len; i++) { break; }",
+                IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        //for (var /** @type {number} */ i = 0; i < len; i++) {\n  break;\n}
+        assertMapping(node, 0, 0, 0, 0, 0, 5);    // for (
+        assertMapping(node, 0, 18, 0, 36, 0, 38); // ;
+        assertMapping(node, 0, 27, 0, 45, 0, 47); // ;
+        assertMapping(node, 0, 32, 0, 50, 0, 52); // )
+    }
+
+    @Test
+    public void testVisitFor_1b()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int = 0; i < len; i++) break;", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        //for (var /** @type {number} */ i = 0; i < len; i++)\n  break;
+        assertMapping(node, 0, 0, 0, 0, 0, 5);    // for (
+        assertMapping(node, 0, 18, 0, 36, 0, 38); // ;
+        assertMapping(node, 0, 27, 0, 45, 0, 47); // ;
+        assertMapping(node, 0, 32, 0, 50, 0, 51); // )
+    }
+
+    @Test
+    public void testVisitFor_2()
+    {
+        IForLoopNode node = (IForLoopNode) getNode("for (;;) { break; }",
+                IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        //for (;;) {\n  break;\n}
+        assertMapping(node, 0, 0, 0, 0, 0, 5); // for (
+        assertMapping(node, 0, 5, 0, 5, 0, 6); // ;
+        assertMapping(node, 0, 6, 0, 6, 0, 7); // ;
+        assertMapping(node, 0, 7, 0, 7, 0, 9); // )
+    }
+
+    @Test
+    public void testVisitForIn_1()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int in obj) { break; }", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        //for (var /** @type {number} */ i in obj) {\n  break;\n}
+        assertMapping(node, 0, 0, 0, 0, 0, 5);    // for (
+        assertMapping(node, 0, 14, 0, 32, 0, 36); // in
+        assertMapping(node, 0, 21, 0, 39, 0, 41); // )
+    }
+
+    @Test
+    public void testVisitForIn_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int in obj)  break; ", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        //for (var /** @type {number} */ i in obj)\n  break;
+        assertMapping(node, 0, 0, 0, 0, 0, 5);    // for (
+        assertMapping(node, 0, 14, 0, 32, 0, 36); // in
+        assertMapping(node, 0, 21, 0, 39, 0, 40); // )
+    }
+
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSClass.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSClass.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSClass.java
new file mode 100644
index 0000000..588a892
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSClass.java
@@ -0,0 +1,402 @@
+/*
+ *
+ *  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.internal.codegen.js.vf2js;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogClass;
+import org.apache.flex.compiler.internal.driver.js.vf2js.VF2JSBackend;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.utils.FilenameNormalization;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestVF2JSClass extends TestGoogClass
+{
+
+    @Override
+    @Test
+    public void testSimple()
+    {
+        IClassNode node = getClassNode("public class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleInternal()
+    {
+        // (erikdebruin) the AS compiler will enforce 'internal' namespace, 
+        //               in JS we ignore it
+        IClassNode node = getClassNode("internal class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleFinal()
+    {
+        // (erikdebruin) the AS compiler will enforce the 'final' keyword, 
+        //               in JS we ignore it
+        IClassNode node = getClassNode("public final class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleDynamic()
+    {
+        // (erikdebruin) all JS objects are 'dynamic' by design
+        IClassNode node = getClassNode("public dynamic class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
+    public void testConstructor_super()
+    {
+        IClassNode node = getClassNode("public class A {public function A() { super(); }}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n  ;\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleExtends()
+    {
+        IClassNode node = getClassNode("public class A extends Button {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
+    }
+
+    @Override
+    @Test
+    public void testSimpleImplements()
+    {
+        IClassNode node = getClassNode("public class A implements IEventDispatcher {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @implements {flash.events.IEventDispatcher}\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public class A implements IEventDispatcher, ILogger {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @implements {flash.events.IEventDispatcher}\n * @implements {mx.logging.ILogger}\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleExtendsImplements()
+    {
+        IClassNode node = getClassNode("public class A extends Button implements IEventDispatcher {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n * @implements {flash.events.IEventDispatcher}\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
+    }
+
+    @Override
+    @Test
+    public void testSimpleExtendsImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public class A extends Button implements IEventDispatcher, ILogger {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n * @implements {flash.events.IEventDispatcher}\n * @implements {mx.logging.ILogger}\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
+    }
+
+    @Override
+    @Test
+    public void testSimpleFinalExtendsImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public final class A extends Button implements IEventDispatcher, ILogger {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n * @implements {flash.events.IEventDispatcher}\n * @implements {mx.logging.ILogger}\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
+    }
+
+    @Override
+    @Test
+    public void testQualifiedExtendsImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public class A extends spark.components.Button implements flash.events.IEventDispatcher, mx.logging.ILogger {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n * @implements {flash.events.IEventDispatcher}\n * @implements {mx.logging.ILogger}\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
+    }
+
+    @Override
+    @Test
+    public void testConstructor()
+    {
+        IClassNode node = getClassNode("public class A {public function A() { }}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};");
+    }
+
+    @Override
+    @Test
+    public void testExtendsConstructor_super()
+    {
+        IClassNode node = getClassNode("public class A extends spark.components.Button { public function A() { super('foo', 42);}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.base(this, 'constructor', 'foo', 42);\n};\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
+    }
+
+    @Override
+    @Test
+    public void testConstructor_withArguments()
+    {
+        IClassNode node = getClassNode("public class A {public function A(arg1:String, arg2:int) {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @param {string} arg1\n * @param {number} arg2\n */\norg.apache.flex.A = function(arg1, arg2) {};");
+    }
+
+    @Test
+    public void testConstructor_withArgumentNameMatchingMemberName()
+    {
+        IClassNode node = getClassNode("public class B {public function B(arg1:String) {this.arg1 = arg1}; public var arg1:String;}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n * @param {string} arg1\n */\norg.apache.flex.B = function(arg1) {\n  this.arg1 = arg1;\n};\n\n\n/**\n * @type {string}\n */\norg.apache.flex.B.prototype.arg1;";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_withImplicitSelfInReturnValue()
+    {
+        IClassNode node = getClassNode("public class B {public function B() {}; public var button:Button = new Button(); public function foo():String {return button.label;};}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n  this.button = new spark.components.Button();\n};\n\n\n/**\n * @type {spark.components.Button}\n */\norg.apache.flex.B.prototype.button;\n\n\n/**\n * @export\n * @return {string}\n */\norg.apache.flex.B.prototype.foo = function() {\n  return this.button.get_label();\n};";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_noArgsNoReturn()
+    {
+        IClassNode node = getClassNode("public class B {public function B() {}; public function foo():void {};}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @export\n */\norg.apache.flex.B.prototype.foo = function() {\n};";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_override()
+    {
+        IClassNode node = getClassNode("public class B {public function B() {}; override public function foo():void {};}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @export\n * @override\n */\norg.apache.flex.B.prototype.foo = function() {\n};";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_overrideWithFunctionBody()
+    {
+        IClassNode node = getClassNode("public class B {public function B() {}; override public function foo(value:Object):void {baz = ''};}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @export\n * @param {Object} value\n * @override\n */\norg.apache.flex.B.prototype.foo = function(value) {\n  baz = '';\n};";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_overrideSuperCall()
+    {
+        IClassNode node = getClassNode("public class B {public function B() {}; override public function foo():void {super.foo();};}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @export\n * @override\n */\norg.apache.flex.B.prototype.foo = function() {\n  org.apache.flex.B.base(this, 'foo');\n};";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_setterCall()
+    {
+        IClassNode node = getClassNode("public class B {public function B() {}; public function set baz(value:Object):void {}; public function set foo(value:Object):void {baz = value;};}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @export\n * @param {Object} value\n */\norg.apache.flex.B.prototype.set_baz = function(value) {\n};\n\n\n/**\n * @export\n * @param {Object} value\n */\norg.apache.flex.B.prototype.set_foo = function(value) {\n  this.set_baz(value);\n};";
+        assertOut(expected);
+    }
+
+    @Test
+    public void testMethod_overrideSetterSuperCall()
+    {
+        IClassNode node = getClassNode("public class B {public function B() {}; override public function set foo(value:Object):void {super.foo = value;};}");
+        asBlockWalker.visitClass(node);
+        String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @export\n * @param {Object} value\n * @override\n */\norg.apache.flex.B.prototype.set_foo = function(value) {\n  org.apache.flex.B.base(this, 'set_foo', value);\n};";
+        assertOut(expected);
+    }
+
+    @Override
+    @Test
+    public void testExtendsConstructor_withArguments()
+    {
+        IClassNode node = getClassNode("public class A extends spark.components.Button {public function A(arg1:String, arg2:int) {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {spark.components.Button}\n * @param {string} arg1\n * @param {number} arg2\n */\norg.apache.flex.A = function(arg1, arg2) {\n  org.apache.flex.A.base(this, 'constructor', arg1, arg2);\n};\ngoog.inherits(org.apache.flex.A, spark.components.Button);");
+    }
+
+    @Override
+    @Test
+    public void testFields()
+    {
+        IClassNode node = getClassNode("public class A {public var a:Object;protected var b:String; "
+                + "private var c:int; internal var d:uint; var e:Number}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};\n\n\n/**\n * @type {Object}\n */\norg.apache.flex.A.prototype.a;\n\n\n/**\n * @protected\n * @type {string}\n */\norg.apache.flex.A.prototype.b;\n\n\n/**\n * @private\n * @type {number}\n */\norg.apache.flex.A.prototype.c;\n\n\n/**\n * @type {number}\n */\norg.apache.flex.A.prototype.d;\n\n\n/**\n * @type {number}\n */\norg.apache.flex.A.prototype.e;");
+    }
+
+    @Test
+    public void testFieldWithEmbed()
+    {
+        IClassNode node = getClassNode("public class A {[Embed(source=\"LuminosityMaskFilter.pbj\", mimeType=\"application/octet-stream\")]\nprivate static var ShaderClass:Class;}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};\n\n\n/**\n * @private\n * @type {Object}\n */\norg.apache.flex.A.ShaderClass;");
+    }
+    
+    @Test
+    public void testFieldWithObjectAssignment()
+    {
+    	IClassNode node = getClassNode("public class A {private var controlBarGroupProperties:Object = { visible: true }; private var _visible:Boolean; public function get visible():Boolean { return _visible; }; public function set visible(value:Boolean):void { _visible = value; };}");
+    	asBlockWalker.visitClass(node);
+    	assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};\n\n\n/**\n * @private\n * @type {Object}\n */\norg.apache.flex.A.prototype.controlBarGroupProperties = {visible:true};\n\n\n/**\n * @private\n * @type {boolean}\n */\norg.apache.flex.A.prototype._visible;\n\n\n/**\n * @export\n * @return {boolean}\n */\norg.apache.flex.A.prototype.get_visible = function() {\n  return this._visible;\n};\n\n\n/**\n * @export\n * @param {boolean} value\n */\norg.apache.flex.A.prototype.set_visible = function(value) {\n  this._visible = value;\n};");
+    }
+
+    @Override
+    @Test
+    public void testConstants()
+    {
+        IClassNode node = getClassNode("public class A {"
+                + "public static const A:int = 42;"
+                + "protected static const B:Number = 42;"
+                + "private static const C:Number = 42;"
+                + "foo_bar static const C:String = 'me' + 'you';");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n  org.apache.flex.A.C = 'me' + 'you';\n};\n\n\n/**\n * @const\n * @type {number}\n */\norg.apache.flex.A.A = 42;\n\n\n/**\n * @protected\n * @const\n * @type {number}\n */\norg.apache.flex.A.B = 42;\n\n\n/**\n * @private\n * @const\n * @type {number}\n */\norg.apache.flex.A.C = 42;\n\n\n/**\n * @const\n * @type {string}\n */\norg.apache.flex.A.C;");
+    }
+
+    @Override
+    @Test
+    public void testAccessors()
+    {
+        IClassNode node = getClassNode("public class A {"
+                + "public function get foo1():Object{return null;}"
+                + "public function set foo1(value:Object):void{}"
+                + "protected function get foo2():Object{return null;}"
+                + "protected function set foo2(value:Object):void{}"
+                + "private function get foo3():Object{return null;}"
+                + "private function set foo3(value:Object):void{}"
+                + "internal function get foo5():Object{return null;}"
+                + "internal function set foo5(value:Object):void{}"
+                + "foo_bar function get foo6():Object{return null;}"
+                + "foo_bar function set foo6(value:Object):void{}" + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};\n\n\n/**\n * @export\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo1 = function() {\n  return null;\n};\n\n\n/**\n * @export\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo1 = function(value) {\n};\n\n\n/**\n * @protected\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo2 = function() {\n  return null;\n};\n\n\n/**\n * @protected\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo2 = function(value) {\n};\n\n\n/**\n * @private\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo3 = function() {\n  return null;\n};\n\n\n/**\n * @private\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo3 = function(value) {\n};\n\n\n/**\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo5 = function() {\n  return null;\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo5 = function(value) {\
 n};\n\n\n/**\n * @return {Object}\n */\norg.apache.flex.A.prototype.get_foo6 = function() {\n  return null;\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.set_foo6 = function(value) {\n};");
+    }
+
+    @Override
+    @Test
+    public void testMethods()
+    {
+        IClassNode node = getClassNode("public class A {"
+                + "public function foo1():Object{return null;}"
+                + "public final function foo1a():Object{return null;}"
+                + "override public function foo1b():Object{return super.foo1b();}"
+                + "protected function foo2(value:Object):void{}"
+                + "private function foo3(value:Object):void{}"
+                + "internal function foo5(value:Object):void{}"
+                + "foo_bar function foo6(value:Object):void{}"
+                + "public static function foo7(value:Object):void{}"
+                + "foo_bar static function foo7(value:Object):void{}" + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {};\n\n\n/**\n * @export\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1 = function() {\n  return null;\n};\n\n\n/**\n * @export\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1a = function() {\n  return null;\n};\n\n\n/**\n * @export\n * @return {Object}\n * @override\n */\norg.apache.flex.A.prototype.foo1b = function() {\n  return org.apache.flex.A.base(this, 'foo1b');\n};\n\n\n/**\n * @protected\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo2 = function(value) {\n};\n\n\n/**\n * @private\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo3 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo5 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo6 = function(value) {\n};\n\n\n/**\n * @export\n * @param {Object} value\n */\norg.apache.flex.A.foo7 = function(value) {\n};
 \n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.foo7 = function(value) {\n};");
+    }
+
+    @Test
+    public void testMethodsWithLocalFunctions()
+    {
+        IClassNode node = getClassNode("public class B {"
+                + "public function foo1():Object{function bar1():Object {return null;}; return bar1()}"
+                + "public function foo2():Object{function bar2(param1:Object):Object {return null;}; return bar2('foo');}"
+                + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @export\n * @return {Object}\n */\norg.apache.flex.B.prototype.foo1 = function() {\n  function bar1() {\n    return null;\n  };\n  return goog.bind(bar1, this)();\n};\n\n\n/**\n * @export\n * @return {Object}\n */\norg.apache.flex.B.prototype.foo2 = function() {\n  function bar2(param1) {\n    return null;\n  };\n  return goog.bind(bar2, this)('foo');\n};");
+    }
+
+    @Test
+    public void testMethodsWithLocalFunctions2()
+    {
+        IClassNode node = getClassNode("public class B {"
+                + "public var baz1:String;"
+                + "public function foo1():String{function bar1():String {return baz1;}; return bar1()}"
+                + "public function foo2():String{function bar2(param1:String):String {return param1 + baz1;}; return bar2('foo');}"
+                + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @type {string}\n */\norg.apache.flex.B.prototype.baz1;\n\n\n/**\n * @export\n * @return {string}\n */\norg.apache.flex.B.prototype.foo1 = function() {\n  function bar1() {\n    return this.baz1;\n  };\n  return goog.bind(bar1, this)();\n};\n\n\n/**\n * @export\n * @return {string}\n */\norg.apache.flex.B.prototype.foo2 = function() {\n  function bar2(param1) {\n    return param1 + this.baz1;\n  };\n  return goog.bind(bar2, this)('foo');\n};");
+    }
+
+    @Test
+    public void testClassWithoutConstructor()
+    {
+        /* AJH couldn't find a way to reproduce the code paths
+         * in a simple test case.  May require multiple compilation
+         * units in the same package.
+         */
+        
+        // (erikdebruin) what's wrong with this test case and/or the resulting code?
+        
+        // (erikdebruin) if you're looking for a way to test multiple cu's 
+        //               (a project), look in 'TestGoogProject' for an example
+        
+        IClassNode node = getClassNode("public class B {"
+                + "public function clone():B { return new B() }"
+                + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.B = function() {};\n\n\n/**\n * @export\n * @return {org.apache.flex.B}\n */\norg.apache.flex.B.prototype.clone = function() {\n  return new org.apache.flex.B();\n};");
+    }
+
+    @Override
+    protected void addLibraries(List<File> libraries)
+    {
+        libraries.addAll(testAdapter.getLibraries(true));
+    }
+    
+    @Override
+    protected IClassNode getClassNode(String code)
+    {
+        String source = "package org.apache.flex {import flash.events.IEventDispatcher;import mx.logging.ILogger;import spark.components.Button;"
+                + code + "}";
+        IFileNode node = compileAS(source);
+        IClassNode child = (IClassNode) findFirstDescendantOfType(node,
+                IClassNode.class);
+        return child;
+    }
+
+
+    protected IBackend createBackend()
+    {
+        return new VF2JSBackend();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSExpressions.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSExpressions.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSExpressions.java
new file mode 100644
index 0000000..3ba79e7
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSExpressions.java
@@ -0,0 +1,124 @@
+/*
+ *
+ *  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.internal.codegen.js.vf2js;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogExpressions;
+import org.apache.flex.compiler.internal.driver.js.vf2js.VF2JSBackend;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestVF2JSExpressions extends TestGoogExpressions
+{
+
+    @Ignore
+    @Override
+    @Test
+    public void testVisitLanguageIdentifierNode_SuperMember()
+    {
+        // (erikdebruin) this test doesn't make sense in VF2JS context
+        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getNode(
+                "if (a) super.foo;", IMemberAccessExpressionNode.class);
+        asBlockWalker.visitMemberAccessExpression(node);
+        assertOut("super.foo");
+    }
+
+    @Override
+    @Test
+    public void testVisitLanguageIdentifierNode_SuperMethod_1()
+    {
+        IFunctionNode node = getMethod("function foo(){if (a) super.foo();}");
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.foo = function() {\n  if (a)\n    FalconTest_A.base(this, 'foo');\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitLanguageIdentifierNode_SuperMethod_2()
+    {
+        IFunctionNode node = getMethod("function foo(){if (a) super.foo(a, b, c);}");
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.foo = function() {\n  if (a)\n    FalconTest_A.base(this, 'foo', a, b, c);\n}");
+    }
+
+    @Override
+    @Test
+    public void testAnonymousFunctionWithParamsReturn()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "var a:Object = function(foo:int, bar:String = 'goo'):int{return -1;};",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Object} */ a = function(foo, bar) {\n  bar = typeof bar !== 'undefined' ? bar : 'goo';\n  return -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testAnonymousFunctionAsArgument()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode(
+                "addListener('foo', function(event:Object):void{doit();})",
+                IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("addListener('foo', function(event) {\n  doit();\n})");
+    }
+
+    @Override
+    @Test
+    public void testVisitAs()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a as b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("org.apache.flex.utils.Language.as(a, b)");
+    }
+
+    @Test
+    public void testVisitAs2()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "public class B {public function b(o:Object):int { var a:B; a = o as B; }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n * @param {Object} o\n * @return {number}\n */\nfoo.bar.B.prototype.b = function(o) {\n  var /** @type {foo.bar.B} */ a;\n  a = org.apache.flex.utils.Language.as(o, foo.bar.B);\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitBinaryOperator_Is()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a is b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("org.apache.flex.utils.Language.is(a, b)");
+    }
+
+    protected IBackend createBackend()
+    {
+        return new VF2JSBackend();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java
new file mode 100644
index 0000000..eaa79d3
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSFile.java
@@ -0,0 +1,92 @@
+/*
+ *
+ *  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.internal.codegen.js.vf2js;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.driver.js.vf2js.VF2JSBackend;
+import org.apache.flex.compiler.internal.test.VF2JSTestBase;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.utils.ITestAdapter;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid 'goog' JS code from an external
+ * file.
+ * 
+ * @author Erik de Bruin
+ */
+public class TestVF2JSFile extends VF2JSTestBase
+{
+    private static ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
+
+    @Ignore
+    @Test
+    public void testSimple()
+    {
+        String fileName = "SimpleAS";
+
+        IFileNode node = compileAS(fileName, true,
+                new File(testAdapter.getUnitTestBaseDir(), "vf2js/files").getPath(),
+                false);
+        
+        asBlockWalker.visitFile(node);
+        
+        //writeResultToFile(writer.toString(), fileName);
+        
+        assertOut(getCodeFromFile(fileName + "_result", true,
+                "vf2js" + File.separator + "files"));
+    }
+	
+    @Test
+    public void testVersion()
+    {
+        String fileName = "Version";
+
+        IFileNode node = compileAS(fileName, true,
+                new File(testAdapter.getUnitTestBaseDir(), "vf2js/files").getPath(),
+                false);
+        
+        asBlockWalker.visitFile(node);
+        
+        //writeResultToFile(writer.toString(), fileName);
+        
+        assertOut(getCodeFromFile(fileName + "_result", true,
+                "vf2js" + File.separator + "files"));
+    }
+
+    @Override
+    protected void addSourcePaths(List<File> sourcePaths)
+    {
+        sourcePaths.add(new File(testAdapter.getUnitTestBaseDir(), "vf2js/files"));
+
+        super.addSourcePaths(sourcePaths);
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new VF2JSBackend();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java
new file mode 100644
index 0000000..fad2b93
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSProject.java
@@ -0,0 +1,131 @@
+/*
+ *
+ *  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.internal.codegen.js.vf2js;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogProject;
+import org.apache.flex.compiler.internal.driver.js.vf2js.VF2JSBackend;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid 'vf2js' JS code from an external
+ * project.
+ * 
+ * @author Erik de Bruin
+ */
+public class TestVF2JSProject extends TestGoogProject
+{
+
+    private static String projectDirPath = "vf2js/projects";
+
+    @Override
+    public void setUp()
+    {
+        project = new FlexJSProject(workspace);
+
+        super.setUp();
+    }
+    
+    @Ignore
+    @Test
+    public void test_imports()
+    {
+        // crude bypass to allow for successful inheritance
+    }
+
+    @Test
+    public void test_Test()
+    {
+        String testDirPath = projectDirPath + "/interfaces";
+
+        String fileName = "Test";
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Test
+    @Ignore
+    public void test_SDKTricks()
+    {
+        String testDirPath = projectDirPath + "/sdk";
+
+        String fileName = "SomeSDKClass";
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Test
+    public void test_Super()
+    {
+        String testDirPath = projectDirPath + "/super";
+
+        String fileName = "Base";
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Override
+    protected void addSourcePaths(List<File> sourcePaths)
+    {
+        sourcePaths.add(new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/interfaces"));
+
+        sourcePaths.add(new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/sdk"));
+
+        sourcePaths.add(new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/super"));
+
+        super.addSourcePaths(sourcePaths);
+    }
+
+    @Override
+    protected void addLibraries(List<File> libraries)
+    {
+        libraries.add(new File(FilenameNormalization.normalize(env.FPSDK
+                + "/" + env.FPVER + "/playerglobal.swc")));
+        libraries.add(new File(FilenameNormalization.normalize(env.SDK
+                + "/frameworks/libs/framework.swc")));
+        libraries.add(new File(FilenameNormalization.normalize(env.SDK
+                + "/frameworks/libs/spark.swc")));
+
+        super.addLibraries(libraries);
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new VF2JSBackend();
+    }
+
+}


[42/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
new file mode 100644
index 0000000..cde30e8
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
@@ -0,0 +1,1009 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import java.io.FilterWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.js.flexjs.IJSFlexJSEmitter;
+import org.apache.flex.compiler.codegen.js.goog.IJSGoogDocEmitter;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IPackageDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitter;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.jx.AccessorEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.AsIsEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.BinaryOperatorEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.BindableEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.ClassEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.DefinePropertyFunctionEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.FieldEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.ForEachEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.FunctionCallEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.IdentifierEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.InterfaceEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.LiteralEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.MemberAccessEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.MethodEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.ObjectDefinePropertyEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.PackageFooterEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.PackageHeaderEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.SelfReferenceEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.SuperCallEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.VarDeclarationEmitter;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSEmitter;
+import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.projects.FlexProject;
+import org.apache.flex.compiler.internal.tree.as.BinaryOperatorAsNode;
+import org.apache.flex.compiler.internal.tree.as.BlockNode;
+import org.apache.flex.compiler.internal.tree.as.DynamicAccessNode;
+import org.apache.flex.compiler.internal.tree.as.FunctionCallNode;
+import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
+import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
+import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
+import org.apache.flex.compiler.internal.tree.as.NumericLiteralNode;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IAccessorNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IFunctionObjectNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.ILiteralNode;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.INamespaceNode;
+import org.apache.flex.compiler.tree.as.IPackageNode;
+import org.apache.flex.compiler.tree.as.IScopedNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.utils.ASNodeUtils;
+
+import com.google.common.base.Joiner;
+
+/**
+ * Concrete implementation of the 'FlexJS' JavaScript production.
+ * 
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
+{
+
+    private JSFlexJSDocEmitter docEmitter = null;
+
+    private PackageHeaderEmitter packageHeaderEmitter;
+    public PackageFooterEmitter packageFooterEmitter;
+
+    private BindableEmitter bindableEmitter;
+
+    private ClassEmitter classEmitter;
+    private InterfaceEmitter interfaceEmitter;
+
+    private FieldEmitter fieldEmitter;
+    public VarDeclarationEmitter varDeclarationEmitter;
+    public AccessorEmitter accessorEmitter;
+    public MethodEmitter methodEmitter;
+
+    private FunctionCallEmitter functionCallEmitter;
+    private SuperCallEmitter superCallEmitter;
+    private ForEachEmitter forEachEmitter;
+    private MemberAccessEmitter memberAccessEmitter;
+    private BinaryOperatorEmitter binaryOperatorEmitter;
+    private IdentifierEmitter identifierEmitter;
+    private LiteralEmitter literalEmitter;
+
+    private AsIsEmitter asIsEmitter;
+    private SelfReferenceEmitter selfReferenceEmitter;
+    private ObjectDefinePropertyEmitter objectDefinePropertyEmitter;
+    private DefinePropertyFunctionEmitter definePropertyFunctionEmitter;
+
+    public ArrayList<String> usedNames = new ArrayList<String>();
+    
+    @Override
+    public String postProcess(String output)
+    {
+        output = super.postProcess(output);
+        
+    	String[] lines = output.split("\n");
+    	ArrayList<String> finalLines = new ArrayList<String>();
+        boolean foundLanguage = false;
+        boolean foundXML = false;
+    	boolean sawRequires = false;
+    	boolean stillSearching = true;
+        int addIndex = -1;
+        int len = lines.length;
+    	for (int i = 0; i < len; i++)
+    	{
+            String line = lines[i];
+    		if (stillSearching)
+    		{
+                int c = line.indexOf(JSGoogEmitterTokens.GOOG_PROVIDE.getToken());
+                if (c != -1)
+                {
+                    // if zero requires are found, require Language after the
+                    // call to goog.provide
+                    addIndex = i + 1;
+                }
+	            c = line.indexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+	            if (c != -1)
+	            {
+                    // we found other requires, so we'll just add Language at
+                    // the end of the list
+                    addIndex = -1;
+	                int c2 = line.indexOf(")");
+	                String s = line.substring(c + 14, c2 - 1);
+                    if (s.equals(JSFlexJSEmitterTokens.LANGUAGE_QNAME.getToken()))
+                    {
+                        foundLanguage = true;
+                    }
+                    else if (s.equals(IASLanguageConstants.XML))
+                    {
+                        foundXML = true;
+                    }
+	    			sawRequires = true;
+	    			if (!usedNames.contains(s))
+                    {
+                        removeLineFromMappings(i);
+                        continue;
+                    }
+	    		}
+	    		else if (sawRequires || i == len - 1)
+                {
+                    stillSearching = false;
+
+                    //when we emitted the requires based on the imports, we may
+                    //not have known if Language was needed yet because the
+                    //imports are at the beginning of the file. other code,
+                    //later in the file, may require Language. 
+                    ICompilerProject project = getWalker().getProject();
+                    if (project instanceof FlexJSProject)
+                    {
+                        FlexJSProject flexJSProject = (FlexJSProject) project;
+                        boolean needLanguage = flexJSProject.needLanguage;
+                        if (needLanguage && !foundLanguage)
+                        {
+                            StringBuilder appendString = new StringBuilder();
+                            appendString.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+                            appendString.append(ASEmitterTokens.PAREN_OPEN.getToken());
+                            appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+                            appendString.append(JSFlexJSEmitterTokens.LANGUAGE_QNAME.getToken());
+                            appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+                            appendString.append(ASEmitterTokens.PAREN_CLOSE.getToken());
+                            appendString.append(ASEmitterTokens.SEMICOLON.getToken());
+                            if(addIndex != -1)
+                            {
+                                // if we didn't find other requires, this index
+                                // points to the line after goog.provide
+                                finalLines.add(addIndex, appendString.toString());
+                                addLineToMappings(addIndex);
+                            }
+                            else
+                            {
+                                finalLines.add(appendString.toString());
+                                addLineToMappings(i);
+                            }
+                        }
+                        boolean needXML = flexJSProject.needXML;
+                        if (needXML && !foundXML)
+                        {
+                            StringBuilder appendString = new StringBuilder();
+                            appendString.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+                            appendString.append(ASEmitterTokens.PAREN_OPEN.getToken());
+                            appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+                            appendString.append(IASLanguageConstants.XML);
+                            appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+                            appendString.append(ASEmitterTokens.PAREN_CLOSE.getToken());
+                            appendString.append(ASEmitterTokens.SEMICOLON.getToken());
+                            if(addIndex != -1)
+                            {
+                                // if we didn't find other requires, this index
+                                // points to the line after goog.provide
+                                finalLines.add(addIndex, appendString.toString());
+                                addLineToMappings(addIndex);
+                            }
+                            else
+                            {
+                                finalLines.add(appendString.toString());
+                                addLineToMappings(i);
+                            }
+                        }
+                    }
+                }
+    		}
+    		finalLines.add(line);
+    	}
+    	
+    	return Joiner.on("\n").join(finalLines);
+    }
+    
+    public BindableEmitter getBindableEmitter()
+    {
+        return bindableEmitter;
+    }
+
+    public ClassEmitter getClassEmiter()
+    {
+        return classEmitter;
+    }
+
+    public AccessorEmitter getAccessorEmitter()
+    {
+        return accessorEmitter;
+    }
+
+    public PackageFooterEmitter getPackageFooterEmitter()
+    {
+        return packageFooterEmitter;
+    }
+
+    // TODO (mschmalle) Fix; this is not using the backend doc strategy for replacement
+    @Override
+    public IJSGoogDocEmitter getDocEmitter()
+    {
+        if (docEmitter == null)
+            docEmitter = new JSFlexJSDocEmitter(this);
+        return docEmitter;
+    }
+
+    public JSFlexJSEmitter(FilterWriter out)
+    {
+        super(out);
+
+        packageHeaderEmitter = new PackageHeaderEmitter(this);
+        packageFooterEmitter = new PackageFooterEmitter(this);
+
+        bindableEmitter = new BindableEmitter(this);
+
+        classEmitter = new ClassEmitter(this);
+        interfaceEmitter = new InterfaceEmitter(this);
+
+        fieldEmitter = new FieldEmitter(this);
+        varDeclarationEmitter = new VarDeclarationEmitter(this);
+        accessorEmitter = new AccessorEmitter(this);
+        methodEmitter = new MethodEmitter(this);
+
+        functionCallEmitter = new FunctionCallEmitter(this);
+        superCallEmitter = new SuperCallEmitter(this);
+        forEachEmitter = new ForEachEmitter(this);
+        memberAccessEmitter = new MemberAccessEmitter(this);
+        binaryOperatorEmitter = new BinaryOperatorEmitter(this);
+        identifierEmitter = new IdentifierEmitter(this);
+        literalEmitter = new LiteralEmitter(this);
+
+        asIsEmitter = new AsIsEmitter(this);
+        selfReferenceEmitter = new SelfReferenceEmitter(this);
+        objectDefinePropertyEmitter = new ObjectDefinePropertyEmitter(this);
+        definePropertyFunctionEmitter = new DefinePropertyFunctionEmitter(this);
+        
+    }
+
+    @Override
+    protected void writeIndent()
+    {
+        write(JSFlexJSEmitterTokens.INDENT);
+    }
+
+    @Override
+    protected String getIndent(int numIndent)
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < numIndent; i++)
+            sb.append(JSFlexJSEmitterTokens.INDENT.getToken());
+        return sb.toString();
+    }
+
+    @Override
+    public void emitLocalNamedFunction(IFunctionNode node)
+    {
+		IFunctionNode fnNode = (IFunctionNode)node.getAncestorOfType(IFunctionNode.class);
+    	if (fnNode.getEmittingLocalFunctions())
+    	{
+    		super.emitLocalNamedFunction(node);
+    	}
+    }
+    
+    @Override
+    public void emitFunctionBlockHeader(IFunctionNode node)
+    {
+    	node.setEmittingLocalFunctions(true);
+    	super.emitFunctionBlockHeader(node);
+    	if (node.isConstructor())
+    	{
+            IClassNode cnode = (IClassNode) node
+            .getAncestorOfType(IClassNode.class);
+            emitComplexInitializers(cnode);
+    	}
+        if (node.containsLocalFunctions())
+        {
+            List<IFunctionNode> anonFns = node.getLocalFunctions();
+            int n = anonFns.size();
+            for (int i = 0; i < n; i++)
+            {
+                IFunctionNode anonFn = anonFns.get(i);
+                if (anonFn.getParent().getNodeID() == ASTNodeID.AnonymousFunctionID)
+                {
+                    write("var /** @type {Function} */ __localFn" + Integer.toString(i) + "__ = ");
+                	getWalker().walk(anonFn.getParent());
+                }
+                else
+                {
+                	getWalker().walk(anonFn);
+                	write(ASEmitterTokens.SEMICOLON);
+                }
+                this.writeNewline();
+            }
+        }
+    	node.setEmittingLocalFunctions(false);
+    }
+    
+    @Override
+    public void emitFunctionObject(IFunctionObjectNode node)
+    {
+		IFunctionNode fnNode = (IFunctionNode)node.getAncestorOfType(IFunctionNode.class);
+    	if (fnNode == null || fnNode.getEmittingLocalFunctions())
+    	{
+    		super.emitFunctionObject(node);
+    	}
+    	else
+    	{
+            List<IFunctionNode> anonFns = fnNode.getLocalFunctions();
+            int i = anonFns.indexOf(node.getFunctionNode());
+            if (i < 0)
+            	System.out.println("missing index for " + node.toString());
+            else
+            	write("__localFn" + Integer.toString(i) + "__");
+    	}
+    }
+    
+    @Override
+    public void emitNamespace(INamespaceNode node)
+    {
+        write(formatQualifiedName(node.getName()));
+        write(ASEmitterTokens.SPACE);
+        writeToken(ASEmitterTokens.EQUAL);
+        writeToken(ASEmitterTokens.NEW);
+        write(IASLanguageConstants.Namespace);
+        write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(node.getNamespaceURINode());
+        write(ASEmitterTokens.PAREN_CLOSE);
+        write(ASEmitterTokens.SEMICOLON);
+    }
+
+    @Override
+    public void emitMemberName(IDefinitionNode node)
+    {
+        write(node.getName());
+    }
+
+    @Override
+    public String formatQualifiedName(String name)
+    {
+        return formatQualifiedName(name, false);
+    }
+
+    public MXMLFlexJSEmitter mxmlEmitter = null;
+    
+    public String formatQualifiedName(String name, boolean isDoc)
+    {
+    	if (mxmlEmitter != null)
+    		name = mxmlEmitter.formatQualifiedName(name);
+        /*
+        if (name.contains("goog.") || name.startsWith("Vector."))
+            return name;
+        name = name.replaceAll("\\.", "_");
+        */
+    	if (getModel().isInternalClass(name))
+    		return getModel().getInternalClasses().get(name);
+    	if (name.startsWith("window."))
+    		name = name.substring(7);
+    	else if (!isDoc)
+    	{
+    		if (!usedNames.contains(name))
+    			usedNames.add(name);
+    	}
+        return name;
+    }
+    
+    //--------------------------------------------------------------------------
+    // Package Level
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitPackageHeader(IPackageDefinition definition)
+    {
+    	IPackageNode packageNode = definition.getNode();
+    	IFileNode fileNode = (IFileNode) packageNode.getAncestorOfType(IFileNode.class);
+        int nodeCount = fileNode.getChildCount();
+        String mainClassName = null;
+        for (int i = 0; i < nodeCount; i++)
+        {
+	        IASNode pnode = fileNode.getChild(i);
+	        
+	        if (pnode instanceof IPackageNode)
+	        {
+	        	IScopedNode snode = ((IPackageNode)pnode).getScopedNode();
+	            int snodeCount = snode.getChildCount();
+	            for (int j = 0; j < snodeCount; j++)
+	            {
+	    	        IASNode cnode = snode.getChild(j);
+	    	        if (cnode instanceof IClassNode)
+	    	        {
+	    	        	mainClassName = ((IClassNode)cnode).getQualifiedName();
+	    	        	break;
+	    	        }
+	            }
+	        }
+	        else if (pnode instanceof IClassNode)
+	        {
+	        	String className = ((IClassNode)pnode).getQualifiedName();
+	        	getModel().getInternalClasses().put(className, mainClassName + "." + className);
+	        }
+	        else if (pnode instanceof IInterfaceNode)
+	        {
+	        	String className = ((IInterfaceNode)pnode).getQualifiedName();
+	        	getModel().getInternalClasses().put(className, mainClassName + "." + className);
+	        }
+            else if (pnode instanceof IFunctionNode)
+            {
+                String className = ((IFunctionNode)pnode).getQualifiedName();
+                getModel().getInternalClasses().put(className, mainClassName + "." + className);
+            }
+            else if (pnode instanceof INamespaceNode)
+            {
+                String className = ((INamespaceNode)pnode).getQualifiedName();
+                getModel().getInternalClasses().put(className, mainClassName + "." + className);
+            }
+            else if (pnode instanceof IVariableNode)
+            {
+                String className = ((IVariableNode)pnode).getQualifiedName();
+                getModel().getInternalClasses().put(className, mainClassName + "." + className);
+            }
+        }
+        
+        packageHeaderEmitter.emit(definition);
+    }
+
+    @Override
+    public void emitPackageHeaderContents(IPackageDefinition definition)
+    {
+        packageHeaderEmitter.emitContents(definition);
+        usedNames.clear();
+    }
+
+    @Override
+    public void emitPackageFooter(IPackageDefinition definition)
+    {
+        packageFooterEmitter.emit(definition);
+    }
+
+    //--------------------------------------------------------------------------
+    // Class
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitClass(IClassNode node)
+    {
+        classEmitter.emit(node);
+    }
+
+    @Override
+    public void emitInterface(IInterfaceNode node)
+    {
+        interfaceEmitter.emit(node);
+    }
+
+    @Override
+    public void emitField(IVariableNode node)
+    {
+        fieldEmitter.emit(node);
+    }
+
+    @Override
+    public void emitVarDeclaration(IVariableNode node)
+    {
+        varDeclarationEmitter.emit(node);
+    }
+
+    @Override
+    public void emitAccessors(IAccessorNode node)
+    {
+        accessorEmitter.emit(node);
+    }
+
+    @Override
+    public void emitGetAccessor(IGetterNode node)
+    {
+        accessorEmitter.emitGet(node);
+    }
+
+    @Override
+    public void emitSetAccessor(ISetterNode node)
+    {
+        accessorEmitter.emitSet(node);
+    }
+
+    @Override
+    public void emitMethod(IFunctionNode node)
+    {
+        methodEmitter.emit(node);
+    }
+
+    public void emitComplexInitializers(IClassNode node)
+    {
+    	classEmitter.emitComplexInitializers(node);
+    }
+    
+    //--------------------------------------------------------------------------
+    // Statements
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitFunctionCall(IFunctionCallNode node)
+    {
+        functionCallEmitter.emit(node);
+    }
+
+    @Override
+    public void emitForEachLoop(IForLoopNode node)
+    {
+        forEachEmitter.emit(node);
+    }
+
+    //--------------------------------------------------------------------------
+    // Expressions
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitSuperCall(IASNode node, String type)
+    {
+        superCallEmitter.emit(node, type);
+    }
+
+    @Override
+    public void emitMemberAccessExpression(IMemberAccessExpressionNode node)
+    {
+        memberAccessEmitter.emit(node);
+    }
+
+    @Override
+    public void emitArguments(IContainerNode node)
+    {
+        IContainerNode newNode = node;
+        int len = node.getChildCount();
+    	if (len == 2)
+    	{
+            ICompilerProject project = getWalker().getProject();;
+    		IFunctionCallNode fcNode = (IFunctionCallNode) node.getParent();
+    		IExpressionNode nameNode = fcNode.getNameNode();
+            IDefinition def = nameNode.resolve(project);
+        	if (def != null && def.getBaseName().equals("insertAt"))
+        	{
+        		if (def.getParent() != null &&
+            		def.getParent().getQualifiedName().equals("Array"))
+        		{
+            		if (nameNode instanceof MemberAccessExpressionNode)
+            		{
+                        newNode = EmitterUtils.insertArgumentsAt(node, 1, new NumericLiteralNode("0"));
+            		}
+    			}
+    		}
+    	}
+        if (len == 1)
+        {
+            ICompilerProject project = getWalker().getProject();;
+            IFunctionCallNode fcNode = (IFunctionCallNode) node.getParent();
+            IExpressionNode nameNode = fcNode.getNameNode();
+            IDefinition def = nameNode.resolve(project);
+            if (def != null && def.getBaseName().equals("removeAt"))
+            {
+                if (def.getParent() != null &&
+                        def.getParent().getQualifiedName().equals("Array"))
+                {
+                    if (nameNode instanceof MemberAccessExpressionNode)
+                    {
+                        newNode = EmitterUtils.insertArgumentsAfter(node, new NumericLiteralNode("1"));
+                    }
+                }
+            }
+            else if (def != null && def.getBaseName().equals("parseInt"))
+            {
+                IDefinition parentDef = def.getParent();
+                if (parentDef == null)
+                {
+                    if (nameNode instanceof IdentifierNode)
+                    {
+                        newNode = EmitterUtils.insertArgumentsAfter(node, new NumericLiteralNode("10"));
+                    }
+                }
+            }
+        }
+        super.emitArguments(newNode);
+    }
+
+    @Override
+    public void emitE4XFilter(IMemberAccessExpressionNode node)
+    {
+    	getWalker().walk(node.getLeftOperandNode());
+    	write(".filter(function(node){return (node.");
+    	String s = stringifyNode(node.getRightOperandNode());
+    	if (s.startsWith("(") && s.endsWith(")"))
+    		s = s.substring(1, s.length() - 1);
+    	write(s);
+    	write(")})");
+    }
+
+    @Override
+    public void emitBinaryOperator(IBinaryOperatorNode node)
+    {
+        binaryOperatorEmitter.emit(node);
+    }
+
+    @Override
+    public void emitIdentifier(IIdentifierNode node)
+    {
+        identifierEmitter.emit(node);
+    }
+
+    @Override
+    public void emitLiteral(ILiteralNode node)
+    {
+        literalEmitter.emit(node);
+    }
+
+    //--------------------------------------------------------------------------
+    // Specific
+    //--------------------------------------------------------------------------
+
+    public void emitIsAs(IExpressionNode node, IExpressionNode left, IExpressionNode right, ASTNodeID id, boolean coercion)
+    {
+        asIsEmitter.emitIsAs(node, left, right, id, coercion);
+    }
+
+    @Override
+    protected void emitSelfReference(IFunctionNode node)
+    {
+        selfReferenceEmitter.emit(node);
+    }
+
+    @Override
+    protected void emitObjectDefineProperty(IAccessorNode node)
+    {
+        objectDefinePropertyEmitter.emit(node);
+    }
+
+    @Override
+    public void emitDefinePropertyFunction(IAccessorNode node)
+    {
+        definePropertyFunctionEmitter.emit(node);
+    }
+    
+    public String stringifyDefineProperties(IClassDefinition cdef)
+    {
+    	setBufferWrite(true);
+    	accessorEmitter.emit(cdef);
+        String result = getBuilder().toString();
+        getBuilder().setLength(0);
+        setBufferWrite(false);
+        return result;
+    }
+
+    @Override
+	public void emitClosureStart()
+    {
+        ICompilerProject project = getWalker().getProject();;
+        if (project instanceof FlexJSProject)
+        	((FlexJSProject)project).needLanguage = true;
+        write(JSFlexJSEmitterTokens.CLOSURE_FUNCTION_NAME);
+        write(ASEmitterTokens.PAREN_OPEN);
+    }
+
+    @Override
+	public void emitClosureEnd(IASNode node)
+    {
+    	write(ASEmitterTokens.COMMA);
+    	write(ASEmitterTokens.SPACE);
+    	write(ASEmitterTokens.SINGLE_QUOTE);
+    	if (node.getNodeID() == ASTNodeID.IdentifierID)
+    		write(((IIdentifierNode)node).getName());
+    	else if (node.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+    		writeChainName(node);
+    	else
+    		System.out.println("unexpected node in emitClosureEnd");
+    	write(ASEmitterTokens.SINGLE_QUOTE);
+        write(ASEmitterTokens.PAREN_CLOSE);
+    }
+    
+    @Override
+    public void emitStatement(IASNode node)
+    {
+    	// don't emit named local functions as statements
+    	// they are emitted as part of the function block header
+    	if (node.getNodeID() == ASTNodeID.FunctionID)
+    	{
+    		return;
+    	}
+    	super.emitStatement(node);
+    }
+    private void writeChainName(IASNode node)
+    {
+    	while (node.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+    	{    		
+    		node = ((IMemberAccessExpressionNode)node).getRightOperandNode();
+    	}
+    	if (node.getNodeID() == ASTNodeID.IdentifierID)
+    		write(((IdentifierNode)node).getName());
+    	else
+    		System.out.println("unexpected node in emitClosureEnd");
+    }
+    
+    @Override
+    public void emitUnaryOperator(IUnaryOperatorNode node)
+    {
+        if (node.getNodeID() == ASTNodeID.Op_DeleteID)
+        {
+        	if (node.getChild(0).getNodeID() == ASTNodeID.ArrayIndexExpressionID)
+        	{
+        		if (node.getChild(0).getChild(0).getNodeID() == ASTNodeID.MemberAccessExpressionID)
+        		{
+        			MemberAccessExpressionNode obj = (MemberAccessExpressionNode)(node.getChild(0).getChild(0));
+        			if (isXMLList(obj))
+        			{
+        		        if (ASNodeUtils.hasParenOpen(node))
+        		            write(ASEmitterTokens.PAREN_OPEN);
+        		        
+        	            getWalker().walk(obj);
+        	            DynamicAccessNode dan = (DynamicAccessNode)(node.getChild(0));
+        	            IASNode indexNode = dan.getChild(1);
+        	            write(".removeChildAt(");
+        	            getWalker().walk(indexNode);
+        	            write(")");
+        		        if (ASNodeUtils.hasParenClose(node))
+        		            write(ASEmitterTokens.PAREN_CLOSE);
+        		        return;
+        			}
+        		}
+        		else if (node.getChild(0).getChild(0).getNodeID() == ASTNodeID.IdentifierID)
+        		{
+        			if (isXML((IdentifierNode)(node.getChild(0).getChild(0))))
+        			{
+        		        if (ASNodeUtils.hasParenOpen(node))
+        		            write(ASEmitterTokens.PAREN_OPEN);
+        		        
+        	            getWalker().walk(node.getChild(0).getChild(0));
+        	            DynamicAccessNode dan = (DynamicAccessNode)(node.getChild(0));
+        	            IASNode indexNode = dan.getChild(1);
+        	            write(".removeChild(");
+        	            getWalker().walk(indexNode);
+        	            write(")");
+        		        if (ASNodeUtils.hasParenClose(node))
+        		            write(ASEmitterTokens.PAREN_CLOSE);
+        		        return;        				
+        			}
+        			else if (isProxy((IdentifierNode)(node.getChild(0).getChild(0))))
+        			{
+        		        if (ASNodeUtils.hasParenOpen(node))
+        		            write(ASEmitterTokens.PAREN_OPEN);
+        		        
+        	            getWalker().walk(node.getChild(0).getChild(0));
+        	            DynamicAccessNode dan = (DynamicAccessNode)(node.getChild(0));
+        	            IASNode indexNode = dan.getChild(1);
+        	            write(".deleteProperty(");
+        	            getWalker().walk(indexNode);
+        	            write(")");
+        		        if (ASNodeUtils.hasParenClose(node))
+        		            write(ASEmitterTokens.PAREN_CLOSE);
+        		        return;        				
+        			}
+        		}
+
+        	}
+        	else if (node.getChild(0).getNodeID() == ASTNodeID.MemberAccessExpressionID)
+    		{
+    			MemberAccessExpressionNode obj = (MemberAccessExpressionNode)(node.getChild(0));
+    			if (isXMLList(obj))
+    			{
+    		        if (ASNodeUtils.hasParenOpen(node))
+    		            write(ASEmitterTokens.PAREN_OPEN);
+    		        
+    	            String s = stringifyNode(obj.getLeftOperandNode());
+    	            write(s);
+    	            write(".removeChild('");
+    	            s = stringifyNode(obj.getRightOperandNode());
+    	            write(s);
+    	            write("')");
+    		        if (ASNodeUtils.hasParenClose(node))
+    		            write(ASEmitterTokens.PAREN_CLOSE);
+    		        return;
+    			}
+    		}
+
+        }
+        else if (node.getNodeID() == ASTNodeID.Op_AtID)
+        {
+        	write("attribute('");
+            getWalker().walk(node.getOperandNode());
+        	write("')");
+        	return;
+        }
+
+        super.emitUnaryOperator(node);
+
+    }
+
+    /**
+     * resolveType on an XML expression returns null
+     * (see IdentiferNode.resolveType).
+     * So, we have to walk the tree ourselves and resolve
+     * individual pieces.
+     * @param obj
+     * @return
+     */
+    public boolean isXMLList(MemberAccessExpressionNode obj)
+    {
+    	IExpressionNode leftNode = obj.getLeftOperandNode();
+    	IExpressionNode rightNode = obj.getRightOperandNode();
+    	ASTNodeID rightID = rightNode.getNodeID();
+		if (rightID == ASTNodeID.IdentifierID)
+		{
+			IDefinition rightDef = rightNode.resolveType(getWalker().getProject());
+			if (rightDef != null)
+				return IdentifierNode.isXMLish(rightDef, getWalker().getProject());
+		}
+    	ASTNodeID leftID = leftNode.getNodeID();
+		if (leftID == ASTNodeID.IdentifierID)
+		{
+			IDefinition leftDef = leftNode.resolveType(getWalker().getProject());
+			if (leftDef != null)
+				return IdentifierNode.isXMLish(leftDef, getWalker().getProject());
+		}
+		else if (leftID == ASTNodeID.MemberAccessExpressionID)
+		{
+			return isXMLList((MemberAccessExpressionNode)leftNode);
+		}
+		else if (leftID == ASTNodeID.FunctionCallID)
+		{
+			FunctionCallNode fcn = (FunctionCallNode)leftNode;
+			String fname = fcn.getFunctionName();
+			if (fname.equals("XML") || fname.equals("XMLList"))
+				return true;
+		}
+		else if (leftID == ASTNodeID.Op_AsID)
+		{
+			BinaryOperatorAsNode boan = (BinaryOperatorAsNode)leftNode;
+			String fname = ((IdentifierNode)boan.getChild(1)).getName();
+			if (fname.equals("XML") || fname.equals("XMLList"))
+				return true;
+		}
+    	return false;
+    }
+    
+    /**
+     * resolveType on an XML expression returns null
+     * (see IdentiferNode.resolveType).
+     * So, we have to walk the tree ourselves and resolve
+     * individual pieces.
+     * @param obj
+     * @return
+     */
+    public boolean isProxy(IExpressionNode obj)
+    {
+		FlexProject project = (FlexProject)getWalker().getProject();
+		// See if it is Proxy
+		ITypeDefinition leftDef = obj.resolveType(project);
+		if (leftDef == null)
+		{
+			if (obj.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+			{
+				IExpressionNode leftNode = ((MemberAccessExpressionNode)obj).getLeftOperandNode();
+				leftDef = leftNode.resolveType(project);
+				if (leftDef != null && leftDef.isInstanceOf(project.getProxyBaseClass(), project))
+					return true;
+				while (leftNode.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+				{
+					// walk up chain looking for a proxy
+					leftNode = ((MemberAccessExpressionNode)leftNode).getLeftOperandNode();
+					leftDef = leftNode.resolveType(project);
+					if (leftDef != null && leftDef.isInstanceOf(project.getProxyBaseClass(), project))
+						return true;
+				}
+			}
+			return false;
+		}
+		return leftDef.isInstanceOf(project.getProxyBaseClass(), project);
+    }
+    
+    /**
+     * resolveType on an XML expression returns null
+     * (see IdentiferNode.resolveType).
+     * So, we have to walk the tree ourselves and resolve
+     * individual pieces.
+     * @param obj
+     * @return
+     */
+    public boolean isDateProperty(IExpressionNode obj)
+    {
+		FlexProject project = (FlexProject)getWalker().getProject();
+		if (obj.getNodeID() == ASTNodeID.MemberAccessExpressionID)
+		{
+			IDefinition leftDef;
+			IExpressionNode leftNode = ((MemberAccessExpressionNode)obj).getLeftOperandNode();
+			IExpressionNode rightNode = ((MemberAccessExpressionNode)obj).getRightOperandNode();
+			leftDef = leftNode.resolveType(project);
+			IDefinition rightDef = rightNode.resolve(project);
+			if (leftDef != null && leftDef.getQualifiedName().equals("Date") && rightDef instanceof AccessorDefinition)
+			{
+				return true;
+			}
+		}
+		return false;
+	}
+    
+    /**
+     * resolveType on an XML expression returns null
+     * (see IdentiferNode.resolveType).
+     * So, we have to walk the tree ourselves and resolve
+     * individual pieces.
+     * @param obj
+     * @return
+     */
+    public boolean isXML(IExpressionNode obj)
+    {
+		// See if the left side is XML or XMLList
+		IDefinition leftDef = obj.resolveType(getWalker().getProject());
+		return IdentifierNode.isXMLish(leftDef, getWalker().getProject());
+    }
+    
+    public MemberAccessExpressionNode getLastMAEInChain(MemberAccessExpressionNode node)
+    {
+    	while (node.getRightOperandNode() instanceof MemberAccessExpressionNode)
+    		node = (MemberAccessExpressionNode)node.getRightOperandNode();
+    	return node;
+    }
+    
+    @Override
+    public void emitLabelStatement(LabeledStatementNode node)
+    {
+    	BlockNode innerBlock = node.getLabeledStatement();
+    	if (innerBlock.getChildCount() == 1 && innerBlock.getChild(0).getNodeID() == ASTNodeID.ForEachLoopID)
+    	{        
+    		getWalker().walk(node.getLabeledStatement());
+    		return; // for each emitter will emit label in the right spot
+    	}
+    	super.emitLabelStatement(node);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitterTokens.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitterTokens.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitterTokens.java
new file mode 100644
index 0000000..67623a9
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitterTokens.java
@@ -0,0 +1,64 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+
+/**
+ * @author Erik de Bruin
+ */
+public enum JSFlexJSEmitterTokens implements IEmitterTokens
+{
+    FLEXJS_CLASS_INFO("FLEXJS_CLASS_INFO"),
+    FLEXJS_REFLECTION_INFO("FLEXJS_REFLECTION_INFO"),
+    GOOG_EXPORT_SYMBOL("goog.exportSymbol"),
+    INDENT("  "),
+    INTERFACES("interfaces"),
+    LANGUAGE_QNAME("org.apache.flex.utils.Language"),
+    NAME("name"),
+    NAMES("names"),
+    QNAME("qName"),
+    UNDERSCORE("_"),
+    EMIT_COERCION("@flexjsemitcoercion"),
+    IGNORE_COERCION("@flexjsignorecoercion"),
+    IGNORE_IMPORT("@flexjsignoreimport"),
+    PREINCREMENT("preincrement"),
+    PREDECREMENT("predecrement"),
+    POSTINCREMENT("postincrement"),
+    POSTDECREMENT("postdecrement"),
+    SUPERGETTER("superGetter"),
+    SUPERSETTER("superSetter"),
+    CLOSURE_FUNCTION_NAME("org.apache.flex.utils.Language.closure"),
+    SKIP_AS_COERCIONS("skipAsCoercions"),
+    SKIP_FUNCTION_COERCIONS("skipFunctionCoercions"),
+    ;
+
+    private String token;
+
+    private JSFlexJSEmitterTokens(String value)
+    {
+        token = value;
+    }
+
+    public String getToken()
+    {
+        return token;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/Notes_JSFlexJSEmitter.txt
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/Notes_JSFlexJSEmitter.txt b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/Notes_JSFlexJSEmitter.txt
new file mode 100644
index 0000000..97e2ffa
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/Notes_JSFlexJSEmitter.txt
@@ -0,0 +1,367 @@
+/*
+ *
+ *  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.
+ *
+ */
+
+//-------------------------------------
+// Removed from JSFlexJSEmitter.java 05-31-2015
+//-------------------------------------
+
+/*
+    @Override
+    public void emitForEachLoop(IForLoopNode node)
+    {
+        IContainerNode xnode = (IContainerNode) node.getChild(1);
+        IBinaryOperatorNode bnode = (IBinaryOperatorNode) node
+                .getConditionalsContainerNode().getChild(0);
+        IASNode childNode = bnode.getChild(0);
+
+        write(ASEmitterTokens.TRY);
+        write(ASEmitterTokens.BLOCK_OPEN);
+        writeNewline();
+        
+        write(JSGoogEmitterTokens.GOOG_ARRAY_FOREACH);
+        write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(bnode.getChild(1));
+        writeToken(ASEmitterTokens.COMMA);
+        writeToken(ASEmitterTokens.FUNCTION);
+        write(ASEmitterTokens.PAREN_OPEN);
+        if (childNode instanceof IVariableExpressionNode)
+        	write(((IVariableNode) childNode.getChild(0)).getName());
+        else
+        	write(((IIdentifierNode) childNode).getName());
+        writeToken(ASEmitterTokens.PAREN_CLOSE);
+        if (isImplicit(xnode))
+            write(ASEmitterTokens.BLOCK_OPEN);
+        getWalker().walk(node.getStatementContentsNode());
+        if (isImplicit(xnode))
+        {
+            writeNewline();
+            write(ASEmitterTokens.BLOCK_CLOSE);
+        }
+        write(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline();
+        write(ASEmitterTokens.BLOCK_CLOSE);
+        writeNewline();
+        write(ASEmitterTokens.CATCH);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write("foreachbreakerror");
+        write(ASEmitterTokens.PAREN_CLOSE);
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.BLOCK_OPEN);
+        write(ASEmitterTokens.BLOCK_CLOSE);
+        writeNewline();
+        
+    }
+
+    @Override
+    public void emitIterationFlow(IIterationFlowNode node)
+    {
+    	// look for break in foreach and throw error instead
+    	if (node.getKind() == IIterationFlowNode.IterationFlowKind.BREAK)
+    	{
+    		IASNode pNode = node.getParent();
+    		while (pNode != null)
+    		{
+    			ASTNodeID id = pNode.getNodeID();
+    			if (id == ASTNodeID.ForEachLoopID)
+    			{
+    				write(ASEmitterTokens.THROW);
+    				write(ASEmitterTokens.SPACE);
+    				write(ASEmitterTokens.NEW);
+    				write(ASEmitterTokens.SPACE);
+    				write(JSGoogEmitterTokens.ERROR);
+    				write(ASEmitterTokens.PAREN_OPEN);
+    				write(ASEmitterTokens.PAREN_CLOSE);
+    				write(ASEmitterTokens.SEMICOLON);
+    				return;
+    			}
+    			else if (id == ASTNodeID.ForLoopID ||
+    					id == ASTNodeID.DoWhileLoopID ||
+    					id == ASTNodeID.WhileLoopID)
+    				break;
+    			pNode = pNode.getParent();
+    		}
+    	}
+        write(node.getKind().toString().toLowerCase());
+        IIdentifierNode lnode = node.getLabelNode();
+        if (lnode != null)
+        {
+            write(ASEmitterTokens.SPACE);
+            getWalker().walk(lnode);
+        }
+    }
+*/
+
+/*
+@Override
+public void emitInterface(IInterfaceNode node)
+{
+    ICompilerProject project = getWalker().getProject();
+
+    getDoc().emitInterfaceDoc(node, project);
+
+    String qname = node.getQualifiedName();
+    if (qname != null && !qname.equals(""))
+    {
+        write(formatQualifiedName(qname));
+        write(ASEmitterTokens.SPACE);
+        writeToken(ASEmitterTokens.EQUAL);
+        write(ASEmitterTokens.FUNCTION);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.BLOCK_OPEN);
+        writeNewline();
+        write(ASEmitterTokens.BLOCK_CLOSE);
+        write(ASEmitterTokens.SEMICOLON);
+    }
+
+    
+    final IDefinitionNode[] members = node.getAllMemberDefinitionNodes();
+    for (IDefinitionNode mnode : members)
+    {
+        boolean isAccessor = mnode.getNodeID() == ASTNodeID.GetterID
+                || mnode.getNodeID() == ASTNodeID.SetterID;
+
+        writeNewline();
+        writeNewline();
+        writeNewline();
+
+        getDoc().emitInterfaceMemberDoc((IFunctionNode) mnode, project);
+        
+        write(formatQualifiedName(qname));
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        write(JSEmitterTokens.PROTOTYPE);
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        if (isAccessor)
+        {
+            writeGetSetPrefix(mnode.getNodeID() == ASTNodeID.GetterID);
+        }
+        write(mnode.getQualifiedName());
+        write(ASEmitterTokens.SPACE);
+        writeToken(ASEmitterTokens.EQUAL);
+        write(ASEmitterTokens.FUNCTION);
+        emitParameters(((IFunctionNode) mnode).getParameterNodes());
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.BLOCK_OPEN);
+        write(ASEmitterTokens.BLOCK_CLOSE);
+        write(ASEmitterTokens.SEMICOLON);
+    }
+}
+*/
+
+/*
+@Override
+public void emitMethod(IFunctionNode node)
+{
+    FunctionNode fn = (FunctionNode) node;
+    fn.parseFunctionBody(getProblems());
+
+    ICompilerProject project = getWalker().getProject();
+
+    getDoc().emitMethodDoc(node, project);
+
+    boolean isConstructor = node.isConstructor();
+
+    String qname = getTypeDefinition(node).getQualifiedName();
+    if (qname != null && !qname.equals(""))
+    {
+        write(formatQualifiedName(qname));
+        if (!isConstructor)
+        {
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            if (!fn.hasModifier(ASModifier.STATIC))
+            {
+                write(JSEmitterTokens.PROTOTYPE);
+                write(ASEmitterTokens.MEMBER_ACCESS);
+            }
+        }
+    }
+
+    if (!isConstructor)
+        emitMemberName(node);
+
+    write(ASEmitterTokens.SPACE);
+    writeToken(ASEmitterTokens.EQUAL);
+    write(ASEmitterTokens.FUNCTION);
+
+    emitParameters(node.getParameterNodes());
+
+    boolean hasSuperClass = hasSuperClass(node);
+
+    if (isConstructor && node.getScopedNode().getChildCount() == 0)
+    {
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.BLOCK_OPEN);
+        if (hasSuperClass)
+            emitSuperCall(node, CONSTRUCTOR_EMPTY);
+        writeNewline();
+        write(ASEmitterTokens.BLOCK_CLOSE);
+    }
+
+    if (!isConstructor || node.getScopedNode().getChildCount() > 0)
+        emitMethodScope(node.getScopedNode());
+
+    if (isConstructor && hasSuperClass)
+    {
+        writeNewline(ASEmitterTokens.SEMICOLON);
+        write(JSGoogEmitterTokens.GOOG_INHERITS);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(formatQualifiedName(qname));
+        writeToken(ASEmitterTokens.COMMA);
+        String sname = getSuperClassDefinition(node, project)
+                .getQualifiedName();
+        write(formatQualifiedName(sname));
+        write(ASEmitterTokens.PAREN_CLOSE);
+    }
+}
+*/
+
+/*
+@Override
+protected void emitDefaultParameterCodeBlock(IFunctionNode node)
+{
+    IParameterNode[] pnodes = node.getParameterNodes();
+    if (pnodes.length == 0)
+        return;
+
+    Map<Integer, IParameterNode> defaults = getDefaults(pnodes);
+
+    if (defaults != null)
+    {
+        final StringBuilder code = new StringBuilder();
+
+        if (!hasBody(node))
+        {
+            indentPush();
+            write(JSFlexJSEmitterTokens.INDENT);
+        }
+
+        List<IParameterNode> parameters = new ArrayList<IParameterNode>(
+                defaults.values());
+
+        for (int i = 0, n = parameters.size(); i < n; i++)
+        {
+            IParameterNode pnode = parameters.get(i);
+
+            if (pnode != null)
+            {
+                code.setLength(0);
+
+                // x = typeof y !== 'undefined' ? y : z;\n 
+                code.append(pnode.getName());
+                code.append(ASEmitterTokens.SPACE.getToken());
+                code.append(ASEmitterTokens.EQUAL.getToken());
+                code.append(ASEmitterTokens.SPACE.getToken());
+                code.append(ASEmitterTokens.TYPEOF.getToken());
+                code.append(ASEmitterTokens.SPACE.getToken());
+                code.append(pnode.getName());
+                code.append(ASEmitterTokens.SPACE.getToken());
+                code.append(ASEmitterTokens.STRICT_NOT_EQUAL.getToken());
+                code.append(ASEmitterTokens.SPACE.getToken());
+                code.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+                code.append(ASEmitterTokens.UNDEFINED.getToken());
+                code.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+                code.append(ASEmitterTokens.SPACE.getToken());
+                code.append(ASEmitterTokens.TERNARY.getToken());
+                code.append(ASEmitterTokens.SPACE.getToken());
+                code.append(pnode.getName());
+                code.append(ASEmitterTokens.SPACE.getToken());
+                code.append(ASEmitterTokens.COLON.getToken());
+                code.append(ASEmitterTokens.SPACE.getToken());
+                code.append(pnode.getDefaultValue());
+                code.append(ASEmitterTokens.SEMICOLON.getToken());
+
+                write(code.toString());
+
+                if (i == n - 1 && !hasBody(node))
+                    indentPop();
+
+                writeNewline();
+            }
+        }
+    }
+}
+*/
+
+/*
+private void writeGetSetPrefix(boolean isGet)
+{
+    if (isGet)
+        write(ASEmitterTokens.GET);
+    else
+        write(ASEmitterTokens.SET);
+    write("_");
+}
+*/
+
+/*
+@Override
+public void emitUnaryOperator(IUnaryOperatorNode node)
+{
+    if (node.getNodeID() == ASTNodeID.Op_PreIncrID
+            || node.getNodeID() == ASTNodeID.Op_PreDecrID
+            || node.getNodeID() == ASTNodeID.Op_PostIncrID
+            || node.getNodeID() == ASTNodeID.Op_PostDecrID)
+    {
+        IExpressionNode opNode = node.getOperandNode();
+        String getString = stringifyNode(opNode);
+        int index = getString.lastIndexOf("get_");
+        if (index != -1)
+        {
+            write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            if (node.getNodeID() == ASTNodeID.Op_PreIncrID)
+                write(JSFlexJSEmitterTokens.PREINCREMENT);
+            else if (node.getNodeID() == ASTNodeID.Op_PostIncrID)
+                write(JSFlexJSEmitterTokens.POSTINCREMENT);
+            else if (node.getNodeID() == ASTNodeID.Op_PreDecrID)
+                write(JSFlexJSEmitterTokens.PREDECREMENT);
+            else
+                write(JSFlexJSEmitterTokens.POSTDECREMENT);
+            write(ASEmitterTokens.PAREN_OPEN);
+            String obj = getString.substring(0, index - 1);
+            write(obj);
+            write(ASEmitterTokens.COMMA);
+            String prop = getString.substring(index + 4);               
+            int endIndex = prop.indexOf(ASEmitterTokens.PAREN_OPEN.getToken());
+            prop = prop.substring(0, endIndex);
+            write(ASEmitterTokens.DOUBLE_QUOTE);
+            write(prop);
+            write(ASEmitterTokens.DOUBLE_QUOTE);
+            write(ASEmitterTokens.PAREN_CLOSE);
+            return;
+        }
+        else
+        {
+            IASNode parentNode = node.getParent();
+            if (parentNode.getNodeID() == ASTNodeID.MemberAccessExpressionID &&
+                    ((MemberAccessExpressionNode)parentNode).getLeftOperandNode() == node)
+            {
+                // GCC wanted parens around foo++.toString().  As in (foo++).toString();
+                write(ASEmitterTokens.PAREN_OPEN);
+                super.emitUnaryOperator(node);
+                write(ASEmitterTokens.PAREN_CLOSE);
+                return;
+            }
+        }
+
+    }
+    super.emitUnaryOperator(node);
+}
+*/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
new file mode 100644
index 0000000..df762c5
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitter.java
@@ -0,0 +1,531 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.codegen.IASGlobalFunctionConstants;
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.codegen.js.goog.IJSGoogDocEmitter;
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.common.DependencyType;
+import org.apache.flex.compiler.constants.IASKeywordConstants;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.definitions.references.IReference;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.JSDocEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSharedData;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.scopes.ASScope;
+import org.apache.flex.compiler.internal.semantics.SemanticUtils;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.IPackageNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.IScopedNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
+
+public class JSGoogDocEmitter extends JSDocEmitter implements IJSGoogDocEmitter
+{
+
+    public JSGoogDocEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emitInterfaceDoc(IInterfaceNode node, ICompilerProject project)
+    {
+        begin();
+
+        emitJSDocLine(JSEmitterTokens.INTERFACE.getToken());
+
+        boolean hasQualifiedNames = true;
+        IExpressionNode[] inodes = node.getExtendedInterfaceNodes();
+        for (IExpressionNode inode : inodes)
+        {
+            IDefinition dnode = inode.resolve(project);
+            if (dnode != null)
+            {
+                emitJSDocLine(ASEmitterTokens.EXTENDS,
+                        formatQualifiedName(dnode.getQualifiedName()));
+            }
+            else
+            {
+                hasQualifiedNames = false;
+                break;
+            }
+        }
+
+        if (!hasQualifiedNames)
+        {
+            String[] inames = node.getExtendedInterfaces();
+            for (String iname : inames)
+            {
+                emitJSDocLine(ASEmitterTokens.EXTENDS, iname);
+            }
+        }
+
+        end();
+    }
+
+    public void emitInterfaceMemberDoc(IDefinitionNode node,
+            ICompilerProject project)
+    {
+        // (erikdebruin) placeholder method, so we don't have to further complicate
+        //               the interface structure
+    }
+
+    @Override
+    public void emitFieldDoc(IVariableNode node, IDefinition def, ICompilerProject project)
+    {
+        begin();
+
+        String ns = node.getNamespace();
+        if (ns == IASKeywordConstants.PRIVATE)
+        {
+            emitPrivate(node);
+        }
+        else if (ns == IASKeywordConstants.PROTECTED)
+        {
+            emitProtected(node);
+        }
+
+        if (node.isConst())
+            emitConst(node);
+
+        String packageName = "";
+        if (def != null)
+            packageName = def.getPackageName();
+
+        emitType(node, packageName);
+
+        end();
+    }
+
+    @Override
+    public void emitMethodDoc(IFunctionNode node, ICompilerProject project)
+    {
+        IClassDefinition classDefinition = resolveClassDefinition(node);
+
+        if (node instanceof IFunctionNode)
+        {
+            boolean hasDoc = false;
+
+            if (node.isConstructor())
+            {
+                begin();
+                hasDoc = true;
+
+                emitJSDocLine(JSEmitterTokens.CONSTRUCTOR);
+
+                IClassDefinition parent = (IClassDefinition) node
+                        .getDefinition().getParent();
+                IClassDefinition superClass = parent.resolveBaseClass(project);
+                String qname = superClass.getQualifiedName();
+
+                if (superClass != null
+                        && !qname.equals(IASLanguageConstants.Object))
+                    emitExtends(superClass, superClass.getPackageName());
+
+                IReference[] references = classDefinition
+                        .getImplementedInterfaceReferences();
+                for (IReference iReference : references)
+                {
+                    ITypeDefinition type = (ITypeDefinition) iReference
+                            .resolve(project, (ASScope) classDefinition
+                                    .getContainingScope(),
+                                    DependencyType.INHERITANCE, true);
+                    emitImplements(type, type.getPackageName());
+                }
+            }
+            else
+            {
+                // @this
+                if (containsThisReference(node))
+                {
+                    begin();
+                    emitMethodAccess(node);
+                    hasDoc = true;
+
+                    emitThis(classDefinition, classDefinition.getPackageName());
+                }
+            }
+
+            // @param
+            IParameterNode[] parameters = node.getParameterNodes();
+            for (IParameterNode pnode : parameters)
+            {
+                if (!hasDoc)
+                {
+                    begin();
+                    emitMethodAccess(node);
+                    hasDoc = true;
+                }
+
+                IExpressionNode enode = pnode.getNameExpressionNode();
+                emitParam(pnode, enode.resolveType(project).getPackageName());
+            }
+
+            if (!node.isConstructor())
+            {
+                // @return
+                String returnType = node.getReturnType();
+                if (returnType != ""
+                        && returnType != ASEmitterTokens.VOID.getToken())
+                {
+                    if (!hasDoc)
+                    {
+                        begin();
+                        emitMethodAccess(node);
+                        hasDoc = true;
+                    }
+
+                    emitReturn(node, node.getPackageName());
+                }
+
+                // @override
+                Boolean override = node.hasModifier(ASModifier.OVERRIDE);
+                if (override)
+                {
+                    if (!hasDoc)
+                    {
+                        begin();
+                        emitMethodAccess(node);
+                        hasDoc = true;
+                    }
+
+                    emitOverride(node);
+                }
+            }
+
+            if (hasDoc)
+                end();
+        }
+    }
+
+    public void emitMethodAccess(IFunctionNode node)
+    {
+        // do nothing
+    }
+
+    @Override
+    public void emitVarDoc(IVariableNode node, IDefinition def, ICompilerProject project)
+    {
+        String packageName = "";
+        if (def != null)
+            packageName = def.getPackageName();
+
+        if (!node.isConst())
+        {
+            IDefinition ndef = node.getDefinition();
+            if (emitter != null && emitter instanceof JSFlexJSEmitter)
+            {
+                ITypeDefinition type = ndef.resolveType(project);
+                if (type != null)
+                {
+                    packageName = ((ITypeDefinition) type).getPackageName();
+                }
+            }
+
+            emitTypeShort(node, project.getActualPackageName(packageName));
+        }
+        else
+        {
+            writeNewline();
+            begin();
+            emitConst(node);
+            emitType(node, project.getActualPackageName(packageName));
+            end();
+        }
+    }
+
+    @Override
+    public void emitConst(IVariableNode node)
+    {
+        emitJSDocLine(ASEmitterTokens.CONST);
+    }
+
+    @Override
+    public void emitExtends(IClassDefinition superDefinition, String packageName)
+    {
+        emitJSDocLine(ASEmitterTokens.EXTENDS,
+                formatQualifiedName(superDefinition.getQualifiedName()));
+    }
+
+    @Override
+    public void emitImplements(ITypeDefinition definition, String packageName)
+    {
+        emitJSDocLine(ASEmitterTokens.IMPLEMENTS,
+                formatQualifiedName(definition.getQualifiedName()));
+    }
+
+    @Override
+    public void emitOverride(IFunctionNode node)
+    {
+        emitJSDocLine(ASEmitterTokens.OVERRIDE);
+    }
+
+    @Override
+    public void emitParam(IParameterNode node, String packageName)
+    {
+        String postfix = (node.getDefaultValue() == null) ? ""
+                : ASEmitterTokens.EQUAL.getToken();
+
+        String paramType = "";
+        if (node.isRest())
+        {
+            paramType = ASEmitterTokens.ELLIPSIS.getToken();
+        }
+        else
+        {
+            String typeName = node.getVariableType();
+            if (typeName.indexOf(packageName) > -1)
+            {
+                String[] parts = typeName.split("\\.");
+                if (parts.length > 0)
+                {
+                    typeName = parts[parts.length - 1];
+                }
+            }
+            paramType = convertASTypeToJS(typeName, packageName);
+        }
+
+        emitJSDocLine(JSGoogDocEmitterTokens.PARAM, paramType + postfix,
+                node.getName());
+    }
+
+    @Override
+    public void emitPrivate(IASNode node)
+    {
+        emitJSDocLine(ASEmitterTokens.PRIVATE);
+    }
+
+    @Override
+    public void emitProtected(IASNode node)
+    {
+        emitJSDocLine(ASEmitterTokens.PROTECTED);
+    }
+
+    @Override
+    public void emitPublic(IASNode node)
+    {
+        emitJSDocLine(JSGoogDocEmitterTokens.EXPORT);
+    }
+
+    @Override
+    public void emitReturn(IFunctionNode node, String packageName)
+    {
+        String rtype = node.getReturnType();
+        if (rtype != null)
+        {
+            emitJSDocLine(ASEmitterTokens.RETURN,
+                    convertASTypeToJS(rtype, packageName));
+        }
+    }
+
+    @Override
+    public void emitThis(ITypeDefinition type, String packageName)
+    {
+        emitJSDocLine(ASEmitterTokens.THIS.getToken(), type.getQualifiedName());
+    }
+
+    @Override
+    public void emitType(IASNode node, String packageName)
+    {
+        String type = ((IVariableNode) node).getVariableType();
+        emitJSDocLine(JSGoogDocEmitterTokens.TYPE.getToken(),
+                convertASTypeToJS(type, packageName));
+    }
+
+    @Override
+    public void emitType(String type, String packageName)
+    {
+        emitJSDocLine(JSGoogDocEmitterTokens.TYPE.getToken(),
+                convertASTypeToJS(type, packageName));
+    }
+
+    public void emitTypeShort(IASNode node, String packageName)
+    {
+        String type = ((IVariableNode) node).getVariableType();
+        writeToken(JSDocEmitterTokens.JSDOC_OPEN);
+        write(ASEmitterTokens.ATSIGN);
+        writeToken(JSGoogDocEmitterTokens.TYPE);
+        writeBlockOpen();
+        write(convertASTypeToJS(type, packageName));
+        writeBlockClose();
+        write(ASEmitterTokens.SPACE);
+        writeToken(JSDocEmitterTokens.JSDOC_CLOSE);
+    }
+
+    //--------------------------------------------------------------------------
+
+    public void emmitPackageHeader(IPackageNode node)
+    {
+        begin();
+        write(ASEmitterTokens.SPACE);
+        writeToken(JSGoogDocEmitterTokens.STAR);
+        write(JSSharedData.getTimeStampString());
+        end();
+    }
+
+    //--------------------------------------------------------------------------
+
+    protected void emitJSDocLine(IEmitterTokens name)
+    {
+        emitJSDocLine(name.getToken(), "");
+    }
+
+    private void emitJSDocLine(String name)
+    {
+        emitJSDocLine(name, "");
+    }
+
+    protected void emitJSDocLine(IEmitterTokens name, String type)
+    {
+        emitJSDocLine(name.getToken(), type, "");
+    }
+
+    private void emitJSDocLine(String name, String type)
+    {
+        emitJSDocLine(name, type, "");
+    }
+
+    private void emitJSDocLine(IEmitterTokens name, String type, String param)
+    {
+        emitJSDocLine(name.getToken(), type, param);
+    }
+
+    private void emitJSDocLine(String name, String type, String param)
+    {
+        write(ASEmitterTokens.SPACE);
+        writeToken(JSGoogDocEmitterTokens.STAR);
+        write(ASEmitterTokens.ATSIGN);
+        write(name);
+        if (type != "")
+        {
+            write(ASEmitterTokens.SPACE);
+            writeBlockOpen();
+            write(type);
+            writeBlockClose();
+        }
+        if (param != "")
+        {
+            write(ASEmitterTokens.SPACE);
+            write(param);
+        }
+        writeNewline();
+    }
+
+    protected boolean containsThisReference(IASNode node)
+    {
+        final int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            final IASNode child = node.getChild(i);
+            if (child.getChildCount() > 0)
+            {
+                return containsThisReference(child);
+            }
+            else
+            {
+                if (SemanticUtils.isThisKeyword(child))
+                    return true;
+            }
+        }
+
+        return false;
+    }
+
+    protected String convertASTypeToJS(String name, String pname)
+    {
+        String result = "";
+
+        if (name.equals(""))
+            result = ASEmitterTokens.ANY_TYPE.getToken();
+        else if (name.equals(IASLanguageConstants.Class))
+            result = IASLanguageConstants.Object;
+        else if (name.equals(IASLanguageConstants.Boolean)
+                || name.equals(IASLanguageConstants.String)
+                || name.equals(IASLanguageConstants.Number))
+            result = name.toLowerCase();
+        else if (name.equals(IASLanguageConstants._int)
+                || name.equals(IASLanguageConstants.uint))
+            result = IASLanguageConstants.Number.toLowerCase();
+
+        boolean isBuiltinFunction = name.matches("Vector\\.<.*>");
+        if (isBuiltinFunction)
+        {
+        	// is a vector so convert the element type
+        	String elementType = name.substring(8, name.length() - 1);
+        	elementType = convertASTypeToJS(elementType, pname);
+        	name = "Vector.<" + elementType + ">";
+        }
+        IASGlobalFunctionConstants.BuiltinType[] builtinTypes = IASGlobalFunctionConstants.BuiltinType
+                .values();
+        for (IASGlobalFunctionConstants.BuiltinType builtinType : builtinTypes)
+        {
+            if (name.equalsIgnoreCase(builtinType.getName()))
+            {
+                isBuiltinFunction = true;
+                break;
+            }
+        }
+
+        if (result == "")
+            result = (pname != "" && !isBuiltinFunction && name.indexOf(".") < 0) ? pname
+                    + ASEmitterTokens.MEMBER_ACCESS.getToken() + name
+                    : name;
+
+        return result;
+    }
+
+    protected IClassDefinition resolveClassDefinition(IFunctionNode node)
+    {
+        IScopedNode scope = node.getContainingScope();
+        if (scope instanceof IMXMLDocumentNode)
+            return ((IMXMLDocumentNode) scope).getClassDefinition();
+
+        IClassNode cnode = (IClassNode) node
+                .getAncestorOfType(IClassNode.class);
+
+        // ToDo (erikdebruin): add VF2JS conditional -> only use check during full SDK compilation
+        if (cnode == null)
+            return null;
+
+        return cnode.getDefinition();
+    }
+
+    protected String formatQualifiedName(String name)
+    {
+        return name;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitterTokens.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitterTokens.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitterTokens.java
new file mode 100644
index 0000000..9578726
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/goog/JSGoogDocEmitterTokens.java
@@ -0,0 +1,38 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+
+public enum JSGoogDocEmitterTokens implements IEmitterTokens
+{
+    PARAM("param"), STAR("*"), TYPE("type"), EXPOSE("expose"), EXPORT("export");
+
+    private String token;
+
+    private JSGoogDocEmitterTokens(String value)
+    {
+        token = value;
+    }
+
+    public String getToken()
+    {
+        return token;
+    }
+}


[02/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/driver/JSCompilationUnit.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/driver/JSCompilationUnit.java b/compiler.js/src/org/apache/flex/compiler/internal/driver/JSCompilationUnit.java
deleted file mode 100644
index c00baa7..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/driver/JSCompilationUnit.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- *
- *  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.internal.driver;
-
-import java.io.IOException;
-import java.util.Collection;
-
-import org.apache.flex.compiler.common.DependencyType;
-import org.apache.flex.compiler.definitions.IDefinition;
-import org.apache.flex.compiler.internal.as.codegen.JSGeneratingReducer;
-import org.apache.flex.compiler.internal.as.codegen.JSGenerator;
-import org.apache.flex.compiler.internal.as.codegen.JSSharedData;
-import org.apache.flex.compiler.internal.projects.CompilerProject;
-import org.apache.flex.compiler.internal.projects.DefinitionPriority;
-import org.apache.flex.compiler.internal.scopes.ASProjectScope;
-import org.apache.flex.compiler.internal.units.ASCompilationUnit;
-import org.apache.flex.compiler.problems.ICompilerProblem;
-import org.apache.flex.compiler.targets.ITarget.TargetType;
-import org.apache.flex.compiler.tree.as.IASNode;
-import org.apache.flex.compiler.units.ICompilationUnit;
-import org.apache.flex.compiler.units.requests.IABCBytesRequestResult;
-import org.apache.flex.compiler.units.requests.IOutgoingDependenciesRequestResult;
-import org.apache.flex.compiler.units.requests.ISyntaxTreeRequestResult;
-
-/**
- * JSCompilationUnit is the CompilationUnit for compiling ActionScript source
- * files to JavasScript. JSCompilationUnit is derived from ASCompilationUnit and
- * overrides the parts that generate the code. JSCompilationUnit also supports
- * requests for two-pass compilation (see m_needsSecondPass).
- * JSSourceFileHandler provides JSCompilationUnit for *.as files. JSDriver
- * registers JSSourceFileHandler at FlexApplicationProject. This implementation
- * is part of FalconJS. For more details on FalconJS see
- * org.apache.flex.compiler.JSDriver
- */
-
-public class JSCompilationUnit extends ASCompilationUnit
-{
-    private IABCBytesRequestResult m_abcBytes = null;
-    private Boolean m_needsSecondPass = false;
-    private Boolean m_inCodeGen = false;
-
-    /**
-     * Create a compilation unit from an ABC file.
-     * 
-     * @param project compiler project
-     * @param path ABC file path
-     * @throws IOException error
-     */
-    public JSCompilationUnit(CompilerProject project, String path) throws IOException
-    {
-        this(project, path, DefinitionPriority.BasePriority.LIBRARY_PATH);
-    }
-
-    public JSCompilationUnit(CompilerProject project, String path, DefinitionPriority.BasePriority basePriority)
-    {
-        super(project, path, basePriority);
-    }
-
-    public JSCompilationUnit(CompilerProject project, String path, DefinitionPriority.BasePriority basePriority, String qname)
-    {
-        super(project, path, basePriority, 0, qname);
-    }
-
-    protected IABCBytesRequestResult _handleABCBytesRequest(Operation buildPhase) throws InterruptedException
-    {
-        // If JSEmitter.needsSecondPass() returns true, JSGenerator.generate() will return null during scanning, 
-        // which will result in JSCompilationUnit::handleSemanticProblemsRequest not caching any abcBytes for 
-        // handleABCBytesRequest. The net result is that JSGenerator.generate() will be called again in handleABCBytesRequest. 
-        // This mechanic will ensure selective two-pass compilation. 
-        if (m_abcBytes != null &&
-            !JSSharedData.instance.hasSymbols() && // Symbol support
-            !JSSharedData.instance.hasAnyClassInit()) // support for class inits 
-            return m_abcBytes;
-
-        JSGenerator jsGenerator = new JSGenerator();
-        jsGenerator.m_compilationUnit = this;
-        jsGenerator.setBuildPhase(buildPhase);
-
-        // Need to force the file scope request to happen first to get the ASFileScope
-        // for this compilation unit registered with the project.
-        // ** TODO this is a hack!
-        getFileScopeRequest().get();
-
-        // This is also a hack!  If there are embed directives, need to ensure
-        // semantic pass has finished, as that is what will generate the embed classes
-        // which are needed by codegen
-        if (buildPhase != Operation.GET_SEMANTIC_PROBLEMS)
-        {
-        	// AJH this was deadlocking as getOutgoingDependencies calls handleABCBytes
-        	if (buildPhase != Operation.GET_ABC_BYTES)
-        		getOutgoingDependenciesRequest().get();
-        }
-
-        final ISyntaxTreeRequestResult fsr = getSyntaxTreeRequest().get();
-        final IASNode rootNode = fsr.getAST();
-
-        startProfile(buildPhase);
-        IABCBytesRequestResult result = jsGenerator.generate(getFilenameNoPath(), rootNode, this.getProject());
-        stopProfile(buildPhase);
-
-        m_needsSecondPass = jsGenerator.needsSecondPass();
-
-        return result;
-    }
-
-    @Override
-    protected IABCBytesRequestResult handleABCBytesRequest() throws InterruptedException
-    {
-        final IABCBytesRequestResult result = _handleABCBytesRequest(Operation.GET_ABC_BYTES);
-
-        /*
-         * // explicitly reference all classes this class depends on if(
-         * result.getProblems() == null || result.getProblems().length == 0 ) {
-         * final String code = new String( result.getABCBytes() ); if(
-         * code.contains(JSSharedData.REQUIRED_TAG_MARKER) ) { final
-         * ICompilationUnit cu = this; final Set<ICompilationUnit> deps = new
-         * HashSet<ICompilationUnit>(); deps.addAll(
-         * getProject().getDependencies(cu) ); if( !deps.isEmpty() ) { String
-         * depNames = ""; Boolean separator = false; final List<IDefinition>
-         * defs = MXMLJSC.getClassDefinitions( cu ); for( IDefinition def: defs
-         * ) { if( def instanceof ClassDefinition ) { final String defName =
-         * JSGeneratingReducer.createFullNameFromDefinition(def); if( defName !=
-         * null && !defName.isEmpty() ) { if( separator ) depNames += ":"; else
-         * separator = true; depNames += defName; } } }
-         * code.replaceFirst(JSSharedData.REQUIRED_TAG_MARKER, depNames); return
-         * new ABCBytesRequestResult(code.getBytes(), result.getProblems()); } }
-         * }
-         */
-        return result;
-    }
-
-    @Override
-    protected IOutgoingDependenciesRequestResult handleOutgoingDependenciesRequest() throws InterruptedException
-    {
-        // Every CU is dependent on the class glue, which is implemented in browser.adobe.
-        // Add dependency from this JSCompilationUnit to browser.adobe's JSCompilationUnit.
-        addDependency(JSSharedData.JS_FRAMEWORK_NAME, DependencyType.INHERITANCE);
-        addDependency(JSSharedData.FRAMEWORK_CLASS, DependencyType.INHERITANCE);
-
-        IOutgoingDependenciesRequestResult result = super.handleOutgoingDependenciesRequest();
-
-        // SWFTarget::startBuildAndFindAllCompilationUnits() is called by SWFTarget::collectProblems(), which is called by SWFTarget::addToSWF() in JSDriver::main().
-        // This is our first pass. jsGenerator.generate() will return null if JSGeneratingReducer.getMember 
-        // If JSEmitter.needsSecondPass() returns true, JSGenerator.generate() will return null during scanning, 
-        // which will result in JSCompilationUnit::handleSemanticProblemsRequest not caching any abcBytes for 
-        // handleABCBytesRequest. The net result is that JSGenerator.generate() will be called again in handleABCBytesRequest. 
-        // This mechanic will ensure selective two-pass compilation. 
-        if (result.getProblems().length == 0)
-        {
-            m_needsSecondPass = false;
-            m_abcBytes = _handleABCBytesRequest(Operation.GET_SEMANTIC_PROBLEMS);
-            if (m_needsSecondPass)
-                m_abcBytes = null;
-        }
-
-        return result;
-    }
-
-    public Boolean addDependency(String className, DependencyType dt)
-    {
-        if (JSGeneratingReducer.isReservedDataType(className))
-            return false;
-
-        final ICompilationUnit fromCU = this;
-        final CompilerProject compilerProject = this.getProject();
-        final ASProjectScope projectScope = compilerProject.getScope();
-
-        final IDefinition classDef = projectScope.findDefinitionByName(className);
-        if (classDef == null)
-            return false;
-
-        final ICompilationUnit toCU = projectScope.getCompilationUnitForDefinition(classDef);
-        if (fromCU == toCU)
-            return false;
-
-        // sharedData.verboseMessage( "Adding dependency: " + className );
-        compilerProject.addDependency(fromCU, toCU, dt);
-
-        return true;
-    }
-
-    @Override
-    public void startBuildAsync(TargetType targetType)
-    {
-        // super.startBuildAsync(targetType);
-
-        getSyntaxTreeRequest();
-        getFileScopeRequest();
-        getOutgoingDependenciesRequest();
-
-        // scanning and code generating phases need to be separated
-        // in order to create two distinct passes for m_needSecondPass.
-        if (m_inCodeGen)
-        {
-            getABCBytesRequest();
-            getSWFTagsRequest();
-        }
-    }
-
-    @Override
-    public void waitForBuildFinish(final Collection<ICompilerProblem> problems, TargetType targetType) throws InterruptedException
-    {
-        m_inCodeGen = true;
-        super.waitForBuildFinish(problems, targetType);
-        m_inCodeGen = false;
-        /*
-         * assert problems != null :
-         * "Expected 'problems'. Do not ignore problems."; //$NON-NLS-1$
-         * Collections.addAll(problems,
-         * getSyntaxTreeRequest().get().getProblems());
-         * Collections.addAll(problems,
-         * getFileScopeRequest().get().getProblems());
-         * Collections.addAll(problems,
-         * getSemanticProblemsRequest().get().getProblems());
-         * Collections.addAll(problems,
-         * getABCBytesRequest().get().getProblems());
-         * Collections.addAll(problems,
-         * getSWFTagsRequest().get().getProblems());
-         */
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/driver/JSSourceFileHandler.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/driver/JSSourceFileHandler.java b/compiler.js/src/org/apache/flex/compiler/internal/driver/JSSourceFileHandler.java
deleted file mode 100644
index ca06784..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/driver/JSSourceFileHandler.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- *
- *  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.internal.driver;
-
-import org.apache.flex.compiler.internal.projects.CompilerProject;
-import org.apache.flex.compiler.internal.projects.DefinitionPriority;
-import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
-import org.apache.flex.compiler.units.ICompilationUnit;
-
-/**
- * Implementation of ISourceFileHandler that constructs
- * {@link ASCompilationUnit}'s. JSSourceFileHandler is the SourceFileHandler
- * that provides JSCompilationUnit for *.as files. JSDriver registers
- * JSSourceFileHandler at FlexApplicationProject. This implementation is part of
- * FalconJS. For more details on FalconJS see org.apache.flex.compiler.JSDriver
- */
-public final class JSSourceFileHandler implements ISourceFileHandler
-{
-
-    public static final String EXTENSION = "as"; //$NON-NLS-1$
-    public static final JSSourceFileHandler INSTANCE = new JSSourceFileHandler();
-
-    private JSSourceFileHandler()
-    {
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public String[] getExtensions()
-    {
-        return new String[] {EXTENSION};
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public ICompilationUnit createCompilationUnit(CompilerProject proj,
-                                                  String path,
-                                                  DefinitionPriority.BasePriority basePriority,
-                                                  int order,
-                                                  String qname,
-                                                  String locale)
-    {
-        return new JSCompilationUnit(proj, path, basePriority, qname);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean needCompilationUnit(CompilerProject project, String path, String qname, String locale)
-    {
-        return true;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean canCreateInvisibleCompilationUnit()
-    {
-        return false;
-    }
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/driver/JSTarget.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/driver/JSTarget.java b/compiler.js/src/org/apache/flex/compiler/internal/driver/JSTarget.java
deleted file mode 100644
index 5636872..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/driver/JSTarget.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- *
- *  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.internal.driver;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.flex.abc.ABCLinker.ABCLinkerSettings;
-import org.apache.flex.compiler.clients.MXMLJSC;
-import org.apache.flex.compiler.definitions.IDefinition;
-import org.apache.flex.compiler.exceptions.BuildCanceledException;
-import org.apache.flex.compiler.internal.as.codegen.JSGeneratingReducer;
-import org.apache.flex.compiler.internal.as.codegen.JSSharedData;
-import org.apache.flex.compiler.internal.definitions.DefinitionBase;
-import org.apache.flex.compiler.internal.projects.CompilerProject;
-import org.apache.flex.compiler.internal.targets.AppSWFTarget;
-import org.apache.flex.compiler.internal.targets.Target;
-import org.apache.flex.compiler.internal.units.ResourceBundleCompilationUnit;
-import org.apache.flex.compiler.problems.ICompilerProblem;
-import org.apache.flex.compiler.problems.UnableToBuildSWFTagProblem;
-import org.apache.flex.compiler.targets.ITargetProgressMonitor;
-import org.apache.flex.compiler.targets.ITargetSettings;
-import org.apache.flex.compiler.units.ICompilationUnit;
-import org.apache.flex.swf.ISWF;
-import org.apache.flex.swf.SWFFrame;
-import org.apache.flex.swf.tags.DoABCTag;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-
-/**
- * Concrete implementation of ITarget for building a collection of source files
- * into a SWF.
- */
-
-public class JSTarget extends AppSWFTarget
-{
-    private ICompilationUnit mainCU;
-    
-    /**
-     * Initialize a SWF target with the owner project and root compilation
-     * units.
-     * 
-     * @param project the owner project
-     */
-
-    public JSTarget(CompilerProject project, ITargetSettings targetSettings, ITargetProgressMonitor progressMonitor)
-    {
-        super(project, targetSettings, progressMonitor);
-    }
-
-    /*
-     * private void printDefinitionsFromCompilationUnit( ICompilationUnit cu )
-     * throws InterruptedException { final List<IDefinition> defs =
-     * MXMLJSC.getDefinitions(cu, true); String s = cu.toString() + ": " +
-     * cu.getShortNames(); JSSharedData.instance.verboseMessage(s); }
-     */
-
-    protected void buildAndCollectProblems(
-            final Set<ICompilationUnit> compilationUnits,
-            final Collection<ICompilerProblem> problems)
-            throws InterruptedException
-    {
-        final JSSharedData sharedData = JSSharedData.instance;
-        sharedData.beginCodeGen();
-
-        BuiltCompilationUnitSet builtCompilationUnits = getBuiltCompilationUnitSet();
-
-        if (JSSharedData.OUTPUT_ISOLATED)
-        {
-            final ICompilationUnit rootCU = getRootClassCompilationUnit();
-            compilationUnits.clear();
-            compilationUnits.add(rootCU);
-        }
-        else
-        {
-            final List<ICompilationUnit> allUnits = new ArrayList<ICompilationUnit>();
-            allUnits.addAll(project.getReachableCompilationUnitsInSWFOrder(builtCompilationUnits.compilationUnits));
-            final List<ICompilationUnit> cuList = sortCompilationUnits(allUnits);
-            compilationUnits.clear();
-            for (ICompilationUnit cu : cuList)
-                compilationUnits.add(cu);
-        }
-        sharedData.endCodeGen();
-    }
-
-    public ISWF build(ICompilationUnit mainCU, Collection<ICompilerProblem> problems)
-    {
-        this.mainCU = mainCU;
-        return build(problems);
-    }
-    
-    @Override
-    public ISWF build(Collection<ICompilerProblem> problems)
-    {
-        buildStarted();
-        try
-        {
-            Iterable<ICompilerProblem> fatalProblems = getFatalProblems();
-            if (!Iterables.isEmpty(fatalProblems))
-            {
-                Iterables.addAll(problems, fatalProblems);
-                return null;
-            }
-
-            Set<ICompilationUnit> compilationUnitSet = new HashSet<ICompilationUnit>();
-            Target.RootedCompilationUnits rootedCompilationUnits = getRootedCompilationUnits();
-            Iterables.addAll(problems, rootedCompilationUnits.getProblems());
-
-            compilationUnitSet.addAll(rootedCompilationUnits.getUnits());
-
-            buildAndCollectProblems(compilationUnitSet, problems);
-
-            List<ICompilationUnit> reachableCompilationUnits = project.getReachableCompilationUnitsInSWFOrder(rootedCompilationUnits.getUnits());
-            ISWF swf = initializeSWF(reachableCompilationUnits);
-
-            // make main frame for DoABC tags
-            final SWFFrame mainFrame = new SWFFrame();
-            swf.addFrame(mainFrame);
-
-            // Add definitions.
-            for (final ICompilationUnit cu : compilationUnitSet)
-            {
-                // ignore externals
-                if (isLinkageExternal(cu, targetSettings))
-                    continue;
-
-                // ignore any resource bundles
-                if (cu instanceof ResourceBundleCompilationUnit)
-                    continue;
-
-                // Create a DoABC tag per compilation unit.
-
-                // Please add this API to SWFTarget. Thx.
-                // protected Boolean addToFrame(ICompilationUnit cu, SWFFrame mainFrame) throws InterruptedException
-                // final boolean tagsAdded = cu.getSWFTagsRequest().get().addToFrame(mainFrame);
-                final boolean tagsAdded = addToFrame(cu, mainFrame);
-                if (!tagsAdded)
-                {
-                    ICompilerProblem problem = new UnableToBuildSWFTagProblem(cu.getAbsoluteFilename());
-                    problems.add(problem);
-                }
-            }
-
-            createLinkReport(problems);
-
-            return swf;
-        }
-        catch (BuildCanceledException bce)
-        {
-            return null;
-        }
-        catch (InterruptedException ie)
-        {
-            return null;
-        }
-        finally
-        {
-            buildFinished();
-        }
-    }
-
-    // Please add this API to SWFTarget. Thx.
-    protected Boolean addToFrame(ICompilationUnit cu, SWFFrame mainFrame) throws InterruptedException
-    {
-        // SWFTarget's implementation:
-        // return cu.getSWFTagsRequest().get().addToFrame(mainFrame);
-
-        final JSSharedData sharedData = JSSharedData.instance;
-
-        String code = "";
-        final List<IDefinition> defs = MXMLJSC.getDefinitions(cu, false);
-        for (IDefinition def : defs)
-        {
-            final String fullName = def.getQualifiedName();
-            if (sharedData.hasJavaScript(fullName))
-            {
-                final String jsCode = sharedData.getJavaScript(fullName);
-                code += jsCode;
-            }
-        }
-
-        if (!code.isEmpty())
-        {
-            final DoABCTag abcTag = new DoABCTag();
-            abcTag.setABCData(code.getBytes());
-            mainFrame.addTag(abcTag);
-        }
-        else
-        {
-            return cu.getSWFTagsRequest().get().addToFrame(mainFrame);
-        }
-        sharedData.registerSWFFrame(mainFrame, cu);
-        return true;
-    }
-
-    /**
-     * sortCompilationUnits() is a workaround for DependencyGraph bugs. There
-     * are three problem areas: 1. The order of the CUs is somewhat random
-     * depending on the thread that compiled a CU. 2. Dependencies through
-     * static initializers are not always correctly detected. 3. Dependencies to
-     * classes provided by SWCs are not correctly detected.
-     */
-    public static List<ICompilationUnit> sortCompilationUnits(List<ICompilationUnit> frameCompilationUnits) throws InterruptedException
-    {
-        ICompilationUnit frameWorkCU = null;
-        ICompilationUnit xmlCU = null;
-        ICompilationUnit xmlListCU = null;
-
-        // extract framework CU, AS3XML CU, and AS3XMLList CU from frameCompilationUnits
-        Iterator<ICompilationUnit> it = frameCompilationUnits.iterator();
-        while (it.hasNext())
-        {
-            // get class name for compilation unit.
-            ICompilationUnit cu = it.next();
-            final List<IDefinition> defs = MXMLJSC.getDefinitions(cu, false);
-            for (IDefinition def : defs)
-            {
-                final String fullName = JSGeneratingReducer.createFullNameFromDefinition(cu.getProject(), def);
-                if (frameWorkCU == null && fullName.equals(JSSharedData.JS_FRAMEWORK_NAME))
-                {
-                    frameWorkCU = cu;
-                    it.remove();
-                }
-                else if (xmlCU == null && fullName.equals(JSSharedData.AS3XML))
-                {
-                    xmlCU = cu;
-                    it.remove();
-                }
-                else if (xmlListCU == null && fullName.equals(JSSharedData.AS3XMLList))
-                {
-                    xmlListCU = cu;
-                    it.remove();
-                }
-
-                if (def instanceof DefinitionBase)
-                {
-                    JSSharedData.instance.registerReferencedDefinition(def.getQualifiedName());
-                }
-
-                JSSharedData.instance.registerPackage(def.getPackageName());
-            }
-        }
-
-        // insist on framework CU
-        if (frameWorkCU == null)
-            throw JSSharedData.backend.createException("JSTarget: cannot find " + JSSharedData.JS_FRAMEWORK_NAME + " compilation unit.");
-
-        // add the framework CU at pos 0
-        frameCompilationUnits.add(0, frameWorkCU);
-
-        // add AS3XML and AS3XMLList framework CUs if necessary
-        if (xmlCU != null)
-        {
-            // add the AS3XML CU at pos 1
-            frameCompilationUnits.add(1, xmlCU);
-
-            // insist on AS3XMLList CU
-            if (xmlListCU == null)
-                throw JSSharedData.backend.createException("JSTarget: cannot find " + JSSharedData.AS3XMLList + " compilation unit.");
-
-            // add the AS3XMLList CU at pos 2
-            frameCompilationUnits.add(2, xmlListCU);
-        }
-
-        return frameCompilationUnits;
-    }
-
-    @Override
-    public Target.RootedCompilationUnits computeRootedCompilationUnits() throws InterruptedException
-    {
-        if (mainCU != null)
-        {
-            return new Target.RootedCompilationUnits(ImmutableSet.of(mainCU), Collections.<ICompilerProblem> emptyList());
-        }
-        
-        assert false;
-        return new Target.RootedCompilationUnits(Collections.<ICompilationUnit> emptySet(), Collections.<ICompilerProblem> emptyList());
-    }
-
-    @Override
-    protected FramesInformation computeFramesInformation() throws InterruptedException
-    {
-        assert false;
-        return null;
-    }
-
-    @Override
-    protected void addLinkedABCToFrame(SWFFrame targetFrame, Iterable<DoABCTag> inputABCs, ABCLinkerSettings linkSettings) throws Exception
-    {
-        assert false;
-    }
-
-    @Override
-    protected void setKeepAS3MetadataLinkerSetting(ABCLinkerSettings linkSettings)
-    {
-        assert false;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java b/compiler.js/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
deleted file mode 100644
index 6a601fc..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
+++ /dev/null
@@ -1,299 +0,0 @@
-package org.apache.flex.compiler.internal.graph;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Scanner;
-import java.util.Set;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.flex.compiler.internal.projects.DependencyGraph;
-import org.apache.flex.compiler.units.ICompilationUnit;
-
-public class GoogDepsWriter {
-
-	public GoogDepsWriter(ICompilationUnit mainCU, File outputFolder)
-	{
-		this.mainCU = mainCU;
-		this.outputFolderPath = outputFolder.getAbsolutePath();
-		this.sourceFolderPath = mainCU.getAbsoluteFilename();
-		File sourceFile = new File(sourceFolderPath);
-		sourceFile = sourceFile.getParentFile();
-		this.sourceFolderPath = sourceFile.getAbsolutePath();
-		String flexJSHome = System.getenv("FLEXJS_HOME");
-		if (flexJSHome == null || flexJSHome.length() == 0)
-			System.out.println("FLEXJS_HOME not defined.  Should point to root of FlexJS source.");
-		frameworkRoot = flexJSHome;
-	}
-	
-	private ICompilationUnit mainCU;
-	private String outputFolderPath;
-	private String sourceFolderPath;
-	
-	private HashMap<String,GoogDep> depMap = new HashMap<String,GoogDep>();
-	
-	public ArrayList<String> getListOfFiles() throws InterruptedException
-	{
-		buildDB();
-		String mainName = mainCU.getShortNames().get(0);
-		ArrayList<GoogDep> dps = sort(mainName);
-		ArrayList<String> files = new ArrayList<String>();
-		for (GoogDep gd : dps)
-		{
-			files.add(gd.filePath);
-		}
-		return files;
-	}
-	
-	public void writeToStream(OutputStream outputStream) throws InterruptedException, FileNotFoundException
-	{
-		buildDB();
-		String mainName = mainCU.getShortNames().get(0);
-		ArrayList<GoogDep> dps = sort(mainName);
-		String outString = "// generated by FalconJS" + "\n";
-		int n = dps.size();
-		for (int i = n - 1; i >= 0; i--)
-		{
-			GoogDep gd = dps.get(i);
-			String s = "goog.addDependency('";
-			s += relativePath(gd.filePath);
-			s += "', ['";
-			s += gd.className;
-			s += "'], [";
-			s += getDependencies(gd.deps);
-			s += "]);\n";
-			outString += s;
-		}
-		System.out.println("Assumptions:");
-		System.out.println("    1) Output folder has copy of goog folder from GoogleClosure/library/closure/goog");
-		System.out.println("    2) Output folder has copy of FlexJS source in FlexJS folder");
-		System.out.println("    3) Output Folder structure is:");
-		System.out.println("             OutputFolder/");
-		System.out.println("                  goog/");
-		System.out.println("                      base.js");
-		System.out.println("                      ...");
-		System.out.println("                  flash/  (from FlexJS/src)");
-		System.out.println("                      events/  (from FlexJS/src)");
-		System.out.println("                  org/   (from FlexJS/src)");
-		System.out.println("                      apache/   (from FlexJS/src)");
-		System.out.println("    4) Output folder has html file of the form:");
-		System.out.println("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
-		System.out.println("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
-		System.out.println("<head>");
-		System.out.println("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />");
-		System.out.println("<script type=\"text/javascript\" src=\"goog/base.js\" ></script>");
-		System.out.println("<script type=\"text/javascript\" src=\"" + mainName + "Deps.js" + "\" ></script>");
-		System.out.println("<script type=\"text/javascript\">");
-		System.out.println("    goog.require('" + mainName + "')");
-		System.out.println("</script>");
-		System.out.println("<script type=\"text/javascript\">");
-		System.out.println("    var app = new " + mainName + "();");
-		System.out.println("</script>");
-		System.out.println("<title>" + mainName + "</title>");
-		System.out.println("</head>");
-		System.out.println("<body onload=\"app.start()\">");
-		System.out.println("</body>");
-		System.out.println("</html>");
-		File htmlFile = new File(outputFolderPath + File.separator + mainName + ".example.html");
-		BufferedOutputStream outputbuffer = new BufferedOutputStream(new FileOutputStream(htmlFile));
-		String html = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
-		html += "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
-		html += "<head>\n";
-		html += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n";
-		html += "<script type=\"text/javascript\" src=\"goog/base.js\" ></script>\n";
-		html += "<script type=\"text/javascript\" src=\"" + mainName + "Deps.js" + "\" ></script>\n";
-		html += "<script type=\"text/javascript\">\n";
-		html += "    goog.require('" + mainName + "')\n";
-		html += "</script>\n";
-		html += "<script type=\"text/javascript\">\n";
-		html += "    var app = new " + mainName + "();\n";
-		html += "</script>\n";
-		html += "<title>" + mainName + "</title>\n";
-		html += "</head>\n";
-		html += "<body onload=\"app.start()\">\n";
-		html += "</body>\n";
-		html += "</html>\n";
-		try
-		{
-			outputbuffer.write(html.getBytes());
-			outputbuffer.flush();
-			outputbuffer.close();
-			outputStream.write(outString.getBytes());
-		}
-		catch (IOException e)
-		{
-			
-		}
-	}
-	
-	private void buildDB()
-	{
-		try {
-			addDeps(mainCU.getShortNames().get(0));
-		} catch (InterruptedException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-	}
-	
-	private HashMap<String, GoogDep> visited = new HashMap<String, GoogDep>();
-	
-	private ArrayList<GoogDep> sort(String rootClassName)
-	{
-		ArrayList<GoogDep> arr = new ArrayList<GoogDep>();
-		GoogDep current = depMap.get(rootClassName);
-		sortFunction(current, arr);
-		return arr;
-	}
-	
-	private void sortFunction(GoogDep current, ArrayList<GoogDep> arr)
-	{
-		visited.put(current.className, current);
-
-		ArrayList<String> deps = current.deps;
-		for (String className : deps)
-		{
-			if (!visited.containsKey(className))
-			{
-				GoogDep gd = depMap.get(className);
-				sortFunction(gd, arr);
-			}
-		}
-		arr.add(current);
-	}
-	
-	private void addDeps(String className)
-	{
-		if (depMap.containsKey(className))
-			return;
-		
-		// build goog dependency list
-		GoogDep gd = new GoogDep();
-		gd.className = className;
-		gd.filePath = getFilePath(className);
-		depMap.put(gd.className, gd);
-		ArrayList<String> deps = getDirectDependencies(gd.filePath);
-		gd.deps = new ArrayList<String>();
-		for (String dep : deps)
-		{
-			gd.deps.add(dep);
-			addDeps(dep);
-		}
-	}
-	
-	String frameworkRoot;
-	
-	String getFilePath(String className)
-	{
-		System.out.println("Finding file for class: " + className);
-		String classPath = className.replace(".", File.separator);
-		String fn = frameworkRoot + File.separator + classPath + ".js";
-		File f = new File(fn);
-		if (f.exists())
-			return fn;
-		fn = sourceFolderPath + File.separator + classPath + ".js";
-		f = new File(fn);
-		if (f.exists())
-		{
-			fn = outputFolderPath + File.separator + classPath + ".js";
-			File destFile = new File(fn);
-			// copy source to output
-			try {
-				FileUtils.copyFile(f, destFile);
-				System.out.println("Copying file for class: " + className);
-			} catch (IOException e) {
-				// TODO Auto-generated catch block
-				System.out.println("Error copying file for class: " + className);
-			}
-			return fn;
-		}
-		fn = outputFolderPath + File.separator + classPath + ".js";
-		f = new File(fn);
-		if (f.exists())
-			return fn;
-		if (className.indexOf('.') > -1)
-		{
-			classPath = className.substring(className.lastIndexOf('.') + 1);
-			fn = outputFolderPath + File.separator + classPath + ".js";
-			f = new File(fn);
-			if (f.exists())
-				return fn;
-		}
-		System.out.println("Could not find file for class: " + className);
-		return "";
-	}
-	
-	private ArrayList<String> getDirectDependencies(String fn)
-	{
-		ArrayList<String> deps = new ArrayList<String>();
-		
-		FileInputStream fis;
-		try {
-			fis = new FileInputStream(fn);
-			Scanner scanner = new Scanner(fis, "UTF-8");
-			while (scanner.hasNextLine())
-			{
-				String s = scanner.nextLine();
-				if (s.indexOf("goog.inherits") > -1)
-					break;
-				int c = s.indexOf("goog.require");
-				if (c > -1)
-				{
-					int c2 = s.indexOf(")");
-					s = s.substring(c + 14, c2 - 1);
-					deps.add(s);
-				}
-			}
-		} catch (FileNotFoundException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		return deps;
-	}
-	
-	private String getDependencies(ArrayList<String> deps)
-	{
-		String s = "";
-		for (String dep : deps)
-		{
-			if (s.length() > 0)
-			{
-				s += ", ";
-			}
-			s += "'" + dep + "'";			
-		}
-		return s;
-	}
-
-	String relativePath(String path)
-	{
-		if (path.indexOf(frameworkRoot) == 0)
-		{
-			path = path.replace(frameworkRoot, "");
-		}
-		else if (path.indexOf(outputFolderPath) == 0)
-		{
-			path = path.replace(outputFolderPath, "");
-		}
-		// paths are actually URIs and always have forward slashes
-		path = path.replace('\\', '/');
-		return ".." + path;
-	}
-	private class GoogDep
-	{
-		public String filePath;
-		public String className;
-		public ArrayList<String> deps;
-		
-	}
-}


[04/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSSharedData.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSSharedData.java b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSSharedData.java
deleted file mode 100644
index ce10d46..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSSharedData.java
+++ /dev/null
@@ -1,989 +0,0 @@
-/*
- *
- *  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.internal.as.codegen;
-
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
-import org.apache.flex.abc.semantics.Name;
-import org.apache.flex.abc.semantics.Namespace;
-import org.apache.flex.abc.semantics.Nsset;
-import org.apache.flex.compiler.definitions.IDefinition;
-import org.apache.flex.compiler.definitions.IFunctionDefinition;
-import org.apache.flex.compiler.definitions.IMemberedDefinition;
-import org.apache.flex.compiler.definitions.INamespaceDefinition;
-import org.apache.flex.compiler.definitions.metadata.IMetaTag;
-import org.apache.flex.compiler.internal.driver.IBackend;
-import org.apache.flex.compiler.internal.legacy.MemberedDefinitionUtils;
-import org.apache.flex.compiler.internal.legacy.ASDefinitionFilter;
-import org.apache.flex.compiler.internal.legacy.ASDefinitionFilter.AccessValue;
-import org.apache.flex.compiler.internal.legacy.ASDefinitionFilter.ClassificationValue;
-import org.apache.flex.compiler.internal.legacy.ASDefinitionFilter.SearchScopeValue;
-import org.apache.flex.compiler.internal.workspaces.Workspace;
-import org.apache.flex.compiler.projects.ICompilerProject;
-import org.apache.flex.compiler.units.ICompilationUnit;
-import org.apache.flex.swf.SWFFrame;
-
-import static org.apache.flex.abc.ABCConstants.OP_nop;
-
-/**
- * JSSharedData contains information that is being shared across
- * JSCompilationUnit, JSGenerator, and JSEmitter instances.
- * JSSharedData.COMPILER_VERSION holds FalconJS's version, which uses the Falcon
- * change list number as the major revision number. The minor revision number
- * represents FalconJS's internal version within the Falcon change list number
- * it is based on. This implementation is part of FalconJS. For more details on
- * FalconJS see org.apache.flex.compiler.JSDriver
- */
-public class JSSharedData
-{
-    public static String COMPILER_NAME = "MXMLJSC";
-    public final static String COMPILER_VERSION = "329449.1";
-
-    public final static JSSharedData instance = new JSSharedData();
-    public static IBackend backend = null;
-    public static Workspace workspace = null;
-
-    public final static String JS_FRAMEWORK_NAME = "org.apache.flex.FlexGlobal";
-    public final static String ROOT_NAME = ""; // JS_FRAMEWORK_NAME + ".root.";
-    public static String FRAMEWORK_CLASS = "browser.JQueryFramework";
-    public static String BUILT_IN = "builtin.abc";
-    public static String MAIN = null;
-    public static Boolean NO_EXPORTS = true;
-    public static Boolean OUTPUT_TIMESTAMPS = false;
-    public static Boolean OUTPUT_ISOLATED = true;
-    public static Boolean GENERATE_TEST_CASE = false;
-    public static Boolean WARN_PERFORMANCE_LOSS = false;
-    public static Boolean WARN_RUNTIME_NAME_LOOKUP = false; // JSWarnRuntimeNameLookupProblem
-    public static Boolean WARN_CLASS_INIT = false; // JSWarnClassInitProblem
-    public static Boolean DEBUG = false;
-    public static Boolean OPTIMIZE = false;
-    public static Boolean EXTEND_DOM = true;
-    public static Boolean KEEP_GENERATED_AS = false;
-
-    public static PrintStream STDOUT = System.out;
-    public static PrintStream STDERR = System.err;
-    public static String OUTPUT_FOLDER = ".";
-    public static String OUTPUT_EXTENSION = "js";
-    public static String SDK_PATH = null;
-
-    public static String CLOSURE_compilation_level = "SIMPLE_OPTIMIZATIONS";
-    public static List<String> CLOSURE_externs = null;
-    public static List<String> CLOSURE_js = null;
-    public static String CLOSURE_create_source_map = null;
-    public static String CLOSURE_formatting = null;
-
-    // public final static String FRAMEWORK_CLASS = "browser.ClosureFramework";
-    public final static String m_superCalledMarker = "___SUPER_HAS_BEEN_CALLED___ ";
-    public final static String THIS = "this";
-    public final static String SUPER = "super";
-    public final static String _SUPER = "_super";
-    public final static String THIS_SUPER = THIS + "." + SUPER;
-    public final static String JS_THIS = "this";
-    public final static Boolean m_useClosureLib = false;
-    public final static Boolean m_useSelfParameter = false;
-    public final static int OP_JS = OP_nop;
-    public final static String DEFAULT_PARAM_PREFIX = "_default_";
-    public final static String GETTER_PREFIX = "get_";
-    public final static String SETTER_PREFIX = "set_";
-    public final static String CTOR_NAME = "init";
-    public final static String EXTERN_INTERFACE_NAME = "IExtern";
-    public final static String SYMBOL_INTERFACE_NAME = "ISymbol";
-    public final static String FRAMEWORK_INTERFACE_NAME = "IFramework";
-    public final static String CLASS_NAME = "_CLASS";
-    public final static String SYMBOL_GET_LINKAGE = "getLinkage"; // see browser.ISymbol 
-    public final static String SYMBOL_INIT = "init"; // see browser.ISymbol 
-    public final static String SYMBOL_INSTANCE = "instance"; // see browser.ISymbol 
-    public final static String GENERATE_CLASSINFO = "GenerateClassInfo"; // see browser.ISymbol 
-    public final static String CONVERT_LOCAL_VARS_TO_MEMBERS = "ConvertLocalVarsToMembers";
-    // public final static String JS_STATIC_INITS = JS_FRAMEWORK_NAME + ".m_staticInits";
-    public final static String JS_RUN_STATIC_INITS = JS_FRAMEWORK_NAME + ".runStaticInits";
-    public final static String JS_SYMBOLS = JS_FRAMEWORK_NAME + ".m_symbols";
-    public final static String JS_CLASSES = JS_FRAMEWORK_NAME + ".classes";
-    public final static String JS_TESTCASES = JS_FRAMEWORK_NAME + ".testCases";
-    public final static String JS_INT_CLASS = JS_FRAMEWORK_NAME + ".intClass";
-    public final static String JS_UINT_CLASS = JS_FRAMEWORK_NAME + ".uintClass";
-    public final static String JS_EMPTY_FUNCTION = JS_FRAMEWORK_NAME + ".emptyFunction";
-    public final static String REQUIRED_TAG_MARKER = "__REQUIRED__";
-    public final static String EXTERN_METATAG = "Extern";
-    public final static String DATACLASS_METATAG = "DataClass";
-    public final static String TESTCASE_METATAG = "TestCase";
-    public final static String AS3XML = "browser.AS3XML";
-    public final static String AS3XMLList = "browser.AS3XMLList";
-    public final static String STATIC_INIT = "__static_init";
-
-    public final static byte CONSTANT_Namespace = 1;
-    public final static byte CONSTANT_PackageNs = 2;
-    public final static byte CONSTANT_PackageInternalNs = 3;
-    public final static byte CONSTANT_ProtectedNs = 4;
-    public final static byte CONSTANT_ExplicitNamespace = 5;
-    public final static byte CONSTANT_StaticProtectedNs = 6;
-    public final static byte CONSTANT_PrivateNs = 7;
-    public final static byte CONSTANT_ClassPrivateNS = 8;
-
-    private Set<String> m_packages = new TreeSet<String>();
-    private final ReadWriteLock m_packagesLock = new ReentrantReadWriteLock();
-
-    private Map<Name, Name> m_classes = new HashMap<Name, Name>();
-    private final ReadWriteLock m_classesLock = new ReentrantReadWriteLock();
-
-    private Map<Name, Set<Name>> m_interfaces = new HashMap<Name, Set<Name>>();
-    private final ReadWriteLock m_interfacesLock = new ReentrantReadWriteLock();
-
-    private Map<String, String> m_externs = new HashMap<String, String>();
-    private final ReadWriteLock m_externsLock = new ReentrantReadWriteLock();
-
-    private Map<String, String> m_varTypes = new HashMap<String, String>();
-    private final ReadWriteLock m_varTypesLock = new ReentrantReadWriteLock();
-
-    private Boolean m_verbose = false;
-    private final ReadWriteLock m_verboseLock = new ReentrantReadWriteLock();
-
-    private Object m_codeGenMonitor = new Object();
-    private long m_codeGenCounter = 0;
-    private final ReadWriteLock m_codeGenCounterLock = new ReentrantReadWriteLock();
-
-    private Set<Name> m_emittedClasses = new HashSet<Name>();
-    private final ReadWriteLock m_emittedClassesLock = new ReentrantReadWriteLock();
-
-    private Map<String, INamespaceDefinition> m_uriToNamespace = new HashMap<String, INamespaceDefinition>();
-    private Map<String, INamespaceDefinition> m_qnameToNamespace = new HashMap<String, INamespaceDefinition>();
-    private final ReadWriteLock m_uriToNamespaceLock = new ReentrantReadWriteLock();
-
-    private Map<String, String> m_classToSymbol = new HashMap<String, String>();
-    private final ReadWriteLock m_classToSymbolLock = new ReentrantReadWriteLock();
-
-    // private Map<IDefinition,Set<IDefinition>> m_dependencies = new HashMap<IDefinition,Set<IDefinition>>();
-    // private final ReadWriteLock m_dependenciesLock = new ReentrantReadWriteLock();
-
-    private Map<String, String> m_compilationUnitToJS = new HashMap<String, String>();
-    private final ReadWriteLock m_compilationUnitToJSLock = new ReentrantReadWriteLock();
-
-    private Map<SWFFrame, ICompilationUnit> m_swfFrameToCompilationUnit = new HashMap<SWFFrame, ICompilationUnit>();
-    private final ReadWriteLock m_swfFrameToCompilationUnitLock = new ReentrantReadWriteLock();
-
-    private Set<String> m_referencedDefinitions = new HashSet<String>();
-    private final ReadWriteLock m_referencedDefinitionsLock = new ReentrantReadWriteLock();
-
-    private Map<String, IDefinition> m_definitions = new HashMap<String, IDefinition>();
-    private final ReadWriteLock m_definitionsLock = new ReentrantReadWriteLock();
-
-    private Set<String> m_usedExterns = new HashSet<String>();
-    private final ReadWriteLock m_usedExternsLock = new ReentrantReadWriteLock();
-
-    private Set<String> m_scriptInfos = new HashSet<String>();
-    private final ReadWriteLock m_scriptInfosLock = new ReentrantReadWriteLock();
-
-    private Map<String, Integer> m_propertyNames = new HashMap<String, Integer>();
-    private final ReadWriteLock m_propertyNamesLock = new ReentrantReadWriteLock();
-
-    private Set<String> m_accessedPropertyNames = new HashSet<String>();
-    private final ReadWriteLock m_accessedPropertyNamesLock = new ReentrantReadWriteLock();
-
-    private Set<String> m_classInit = new HashSet<String>();
-    private final ReadWriteLock m_classInitLock = new ReentrantReadWriteLock();
-
-    private Map<String, String> m_pathToUUID = new HashMap<String, String>();
-    private final ReadWriteLock m_pathToUUIDLock = new ReentrantReadWriteLock();
-
-    private Set<String> m_encryptedJS = new HashSet<String>();
-    private final ReadWriteLock m_encryptedJSLock = new ReentrantReadWriteLock();
-
-    private Map<String, Set<String>> m_methods = new HashMap<String, Set<String>>();
-    private final ReadWriteLock m_methodsLock = new ReentrantReadWriteLock();
-
-    public void reset()
-    {
-        m_packages.clear();
-        m_classes.clear();
-        m_interfaces.clear();
-        m_externs.clear();
-        m_varTypes.clear();
-        m_verbose = false;
-        // m_codeGenMonitor
-        m_emittedClasses.clear();
-        m_uriToNamespace.clear();
-        m_qnameToNamespace.clear();
-        m_classToSymbol.clear();
-        // m_dependencies.clear();
-        m_compilationUnitToJS.clear();
-        m_swfFrameToCompilationUnit.clear();
-        m_referencedDefinitions.clear();
-        m_definitions.clear();
-        m_usedExterns.clear();
-        m_scriptInfos.clear();
-        m_propertyNames.clear();
-        m_accessedPropertyNames.clear();
-        m_classInit.clear();
-        // m_pathToUUID.clear();
-        m_encryptedJS.clear();
-        m_methods.clear();
-    }
-
-    /**
-     * @param m_packages the m_packages to set
-     */
-    public void registerPackage(String packageName)
-    {
-        // TODO: generalize, avoid hard-coded "goog"
-        if (packageName != null && !packageName.isEmpty() && !packageName.startsWith("goog"))
-        {
-            m_packagesLock.writeLock().lock();
-            this.m_packages.add(packageName);
-            m_packagesLock.writeLock().unlock();
-        }
-    }
-
-    /**
-     * @return the m_packages
-     */
-    public Boolean hasPackage(String packageName)
-    {
-        m_packagesLock.readLock().lock();
-        final Boolean val = m_packages.contains(packageName);
-        m_packagesLock.readLock().unlock();
-        return val;
-    }
-
-    /**
-     * @return the m_packages
-     */
-    @SuppressWarnings("unchecked")
-    public Set<String> getPackages()
-    {
-        Set<String> packages = null;
-        m_packagesLock.readLock().lock();
-        Object clone = ((TreeSet<String>)m_packages).clone();
-        if (clone != null && clone instanceof Set<?>)
-            packages = (Set<String>)(clone);
-        m_packagesLock.readLock().unlock();
-        return packages;
-    }
-
-    /**
-     * @param m_varTypes the m_varTypes to set
-     */
-    public void registerVarType(String varName, String varType)
-    {
-        m_varTypesLock.writeLock().lock();
-        this.m_varTypes.put(varName, varType);
-        m_varTypesLock.writeLock().unlock();
-    }
-
-    /**
-     * @return the m_varTypes
-     */
-    public String getVarType(String varName)
-    {
-        m_varTypesLock.readLock().lock();
-        final String val = m_varTypes.get(varName);
-        m_varTypesLock.readLock().unlock();
-        return val;
-    }
-
-    public Boolean hasVarName(String varName)
-    {
-        m_varTypesLock.readLock().lock();
-        final Boolean val = m_varTypes.containsKey(varName);
-        m_varTypesLock.readLock().unlock();
-        return val;
-    }
-
-    /**
-     * @param m_classes the m_classes to set
-     */
-    public void registerClass(Name className, Name superName)
-    {
-        m_classesLock.writeLock().lock();
-        this.m_classes.put(className, superName);
-        m_classesLock.writeLock().unlock();
-    }
-
-    /**
-     * @return the m_classes
-     */
-    public Name getSuperClass(Name className)
-    {
-        m_classesLock.readLock().lock();
-        final Name val = m_classes.get(className);
-        m_classesLock.readLock().unlock();
-        return val;
-    }
-
-    public Boolean hasClass(Name className)
-    {
-        m_classesLock.readLock().lock();
-        final Boolean val = m_classes.containsKey(className);
-        m_classesLock.readLock().unlock();
-        return val;
-    }
-
-    public Map<String, String> getClassInfo()
-    {
-        // copying the whole m_classes is the only thing you can do 
-        // if you want to stay thread safe.
-        Map<String, String> info = new HashMap<String, String>();
-
-        m_classesLock.readLock().lock();
-        Iterator<Map.Entry<Name, Name>> it = m_classes.entrySet().iterator();
-        while (it.hasNext())
-        {
-            Map.Entry<Name, Name> pair = it.next();
-            final Name _class = pair.getKey();
-            final Name _super = pair.getValue();
-            if (_super != null)
-                info.put(_class.getBaseName(), _super.getBaseName());
-            else
-                info.put(_class.getBaseName(), "Object");
-        }
-        m_classesLock.readLock().unlock();
-
-        return info;
-    }
-
-    public Set<Name> getClasses()
-    {
-        m_classesLock.readLock().lock();
-
-        Set<Name> info = new HashSet<Name>();
-        info.addAll(m_classes.keySet());
-        m_classesLock.readLock().unlock();
-
-        return info;
-    }
-
-    public void setVerbose(Boolean value)
-    {
-        m_verboseLock.writeLock().lock();
-        this.m_verbose = value;
-        m_verboseLock.writeLock().unlock();
-    }
-
-    public Boolean isVerbose()
-    {
-        m_verboseLock.readLock().lock();
-        final Boolean val = m_verbose;
-        m_verboseLock.readLock().unlock();
-        return val;
-    }
-
-    public void stdout(String s)
-    {
-        if (STDOUT != null)
-        {
-            m_verboseLock.writeLock().lock();
-            STDOUT.println(s);
-            m_verboseLock.writeLock().unlock();
-        }
-    }
-
-    public void stderr(String s)
-    {
-        if (STDERR != null)
-        {
-            m_verboseLock.writeLock().lock();
-            STDERR.println(s);
-            m_verboseLock.writeLock().unlock();
-        }
-    }
-
-    public void verboseMessage(String s)
-    {
-        if (isVerbose() && STDOUT != null)
-        {
-            m_verboseLock.writeLock().lock();
-            STDOUT.println(s);
-            m_verboseLock.writeLock().unlock();
-        }
-    }
-
-    public void beginCodeGen()
-    {
-        m_codeGenCounterLock.writeLock().lock();
-        m_codeGenCounter++;
-        m_codeGenCounterLock.writeLock().unlock();
-    }
-
-    public void endCodeGen()
-    {
-        m_codeGenCounterLock.writeLock().lock();
-        final long currentCounter = --m_codeGenCounter;
-        m_codeGenCounterLock.writeLock().unlock();
-
-        if (currentCounter == 0)
-        {
-            synchronized (m_codeGenMonitor)
-            {
-                m_codeGenMonitor.notifyAll();
-            }
-        }
-    }
-
-    /*
-     * private long getCodeGenCounter() {
-     * m_codeGenCounterLock.readLock().lock(); final long val =
-     * m_codeGenCounter; m_codeGenCounterLock.readLock().unlock(); return val; }
-     * private void waitUntilCodeGenHasFinished() throws InterruptedException {
-     * if( getCodeGenCounter() == 0 ) { synchronized (m_codeGenMonitor) {
-     * m_codeGenMonitor.wait(); } } }
-     */
-
-    public void registerInterface(Name className, Name interfaceName)
-    {
-        m_interfacesLock.writeLock().lock();
-        Set<Name> interfaces = m_interfaces.get(className);
-        if (interfaces == null)
-        {
-            interfaces = new HashSet<Name>();
-            this.m_interfaces.put(className, interfaces);
-        }
-        interfaces.add(interfaceName);
-        m_interfacesLock.writeLock().unlock();
-    }
-
-    @SuppressWarnings("unchecked")
-    public Map<Name, Set<Name>> getAllInterfaces()
-    {
-        // copying the whole m_classes is the only thing you can do 
-        // if you want to stay thread safe.
-        Map<Name, Set<Name>> info = new HashMap<Name, Set<Name>>();
-
-        m_interfacesLock.readLock().lock();
-        Iterator<Map.Entry<Name, Set<Name>>> it = m_interfaces.entrySet().iterator();
-        while (it.hasNext())
-        {
-            Map.Entry<Name, Set<Name>> pair = it.next();
-            final Name _class = pair.getKey();
-            final HashSet<Name> interfaces = (HashSet<Name>)pair.getValue();
-            info.put(_class, (Set<Name>)(interfaces.clone()));
-        }
-        m_interfacesLock.readLock().unlock();
-
-        return info;
-    }
-
-    public void registerExtern(Name name)
-    {
-        final IDefinition def = getDefinition(name);
-        if (def == null)
-            throw backend.createException("registerExtern: can't find definition for " + name.toString());
-        registerExtern(def);
-    }
-
-    public void registerExtern(IDefinition def)
-    {
-        final IMetaTag extern = def.getMetaTagByName(EXTERN_METATAG);
-        if (extern != null)
-        {
-            String externName = extern.getAttributeValue("name");
-            if (externName == null)
-                externName = def.getBaseName();
-
-            m_externsLock.writeLock().lock();
-            m_externs.put(def.getQualifiedName(), externName);
-            m_externsLock.writeLock().unlock();
-        }
-    }
-
-    public Boolean isExtern(String name)
-    {
-        m_externsLock.readLock().lock();
-        final Boolean val = m_externs.containsKey(name);
-        m_externsLock.readLock().unlock();
-        return val;
-    }
-
-    public String getExternName(String name)
-    {
-        m_externsLock.readLock().lock();
-        final String val = m_externs.get(name);
-        m_externsLock.readLock().unlock();
-        return val;
-    }
-
-    public Set<String> getExterns()
-    {
-        final Set<String> externs = new HashSet<String>();
-        m_externsLock.readLock().lock();
-        externs.addAll(m_externs.keySet());
-        m_externsLock.readLock().unlock();
-        return externs;
-    }
-
-    public void registerEmittedClass(Name classOrInterfaceName)
-    {
-        m_emittedClassesLock.writeLock().lock();
-        this.m_emittedClasses.add(classOrInterfaceName);
-        m_emittedClassesLock.writeLock().unlock();
-    }
-
-    public Boolean hasClassBeenEmitted(Name classOrInterfaceName)
-    {
-        m_emittedClassesLock.readLock().lock();
-        final Boolean val = m_emittedClasses.contains(classOrInterfaceName);
-        m_emittedClassesLock.readLock().unlock();
-        return val;
-    }
-
-    public void registerSymbol(String className, String symbolName)
-    {
-        m_classToSymbolLock.writeLock().lock();
-        this.m_classToSymbol.put(className, symbolName);
-        m_classToSymbolLock.writeLock().unlock();
-    }
-
-    public String getSymbol(String className)
-    {
-        m_classToSymbolLock.writeLock().lock();
-        final String symbol = this.m_classToSymbol.get(className);
-        m_classToSymbolLock.writeLock().unlock();
-        return symbol;
-    }
-
-    public Boolean hasSymbols()
-    {
-        m_classToSymbolLock.writeLock().lock();
-        final Boolean hasSymbols = !this.m_classToSymbol.isEmpty();
-        m_classToSymbolLock.writeLock().unlock();
-        return hasSymbols;
-    }
-
-    public List<String> getSymbols()
-    {
-        // copying the whole m_classes is the only thing you can do 
-        // if you want to stay thread safe.
-        List<String> info = new ArrayList<String>();
-        m_classToSymbolLock.readLock().lock();
-        info.addAll(m_classToSymbol.values());
-        m_classToSymbolLock.readLock().unlock();
-
-        return info;
-    }
-
-    public void registerNamespace(String uri, INamespaceDefinition ns)
-    {
-        m_uriToNamespaceLock.writeLock().lock();
-        this.m_uriToNamespace.put(uri, ns);
-        this.m_qnameToNamespace.put(ns.getQualifiedName(), ns);
-        m_uriToNamespaceLock.writeLock().unlock();
-    }
-
-    public Map<String, INamespaceDefinition> getNamespaces()
-    {
-        // Copy the whole m_uriToNamespace for thread-safety
-        Map<String, INamespaceDefinition> namespaces = new HashMap<String, INamespaceDefinition>();
-        m_uriToNamespaceLock.writeLock().lock();
-        namespaces.putAll(m_uriToNamespace);
-        m_uriToNamespaceLock.writeLock().unlock();
-        return namespaces;
-    }
-
-    public INamespaceDefinition getNamespace(String uri)
-    {
-        m_uriToNamespaceLock.writeLock().lock();
-        final INamespaceDefinition ns = this.m_uriToNamespace.get(uri);
-        m_uriToNamespaceLock.writeLock().unlock();
-        return ns;
-    }
-
-    public INamespaceDefinition getNamespaceForQName(String qname)
-    {
-        m_uriToNamespaceLock.writeLock().lock();
-        final INamespaceDefinition ns = this.m_qnameToNamespace.get(qname);
-        m_uriToNamespaceLock.writeLock().unlock();
-        return ns;
-    }
-
-    /*
-     * // returns true if def1 depends on def2 private Boolean dependsOn(
-     * IDefinition def1, IDefinition def2 ) { Set<IDefinition> defs =
-     * m_dependencies.get(def2); if( defs.contains(def1) ) return true; for(
-     * IDefinition next: defs ) { if( dependsOn(def1, next) ) return true; }
-     * return false; } // workaround for Falcon bugs // Falcon's DependencyGraph
-     * does not work correctly for Definitions // implemented by SWCs. // def1
-     * depends on def2 public void addDependency( IDefinition def1, IDefinition
-     * def2 ) { if( def1 != def2 ) { m_dependenciesLock.writeLock().lock();
-     * Set<IDefinition> defs = m_dependencies.get(def1); if( defs == null ) {
-     * defs = new HashSet<IDefinition>(); m_dependencies.put( def1, defs ); }
-     * else { if( !defs.contains(def2) && dependsOn(def2, def1) ) throw new
-     * Error( "addDependency: circular dependencies!" ); } defs.add(def2);
-     * m_dependenciesLock.writeLock().unlock(); } } public Set<IDefinition>
-     * getDependencies( IDefinition def ) {
-     * m_dependenciesLock.writeLock().lock(); final Set<IDefinition> defs =
-     * m_dependencies.get(def); m_dependenciesLock.writeLock().unlock(); return
-     * defs; }
-     */
-
-    public void registerJavaScript(String className, String jsCode)
-    {
-        m_compilationUnitToJSLock.writeLock().lock();
-        m_compilationUnitToJS.put(className, jsCode);
-        m_compilationUnitToJSLock.writeLock().unlock();
-    }
-
-    public void registerJavaScript(Map<String, String> classNameToJS)
-    {
-        m_compilationUnitToJSLock.writeLock().lock();
-        m_compilationUnitToJS.putAll(classNameToJS);
-        m_compilationUnitToJSLock.writeLock().unlock();
-    }
-
-    public Boolean hasJavaScript(String className)
-    {
-        m_compilationUnitToJSLock.writeLock().lock();
-        final Boolean found = m_compilationUnitToJS.containsKey(className);
-        m_compilationUnitToJSLock.writeLock().unlock();
-        return found;
-    }
-
-    public String getJavaScript(String className)
-    {
-        m_compilationUnitToJSLock.writeLock().lock();
-        final String jsCode = m_compilationUnitToJS.get(className);
-        m_compilationUnitToJSLock.writeLock().unlock();
-        return jsCode;
-    }
-
-    public void registerSWFFrame(SWFFrame frame, ICompilationUnit cu)
-    {
-        m_swfFrameToCompilationUnitLock.writeLock().lock();
-        m_swfFrameToCompilationUnit.put(frame, cu);
-        m_swfFrameToCompilationUnitLock.writeLock().unlock();
-    }
-
-    public ICompilationUnit getCompilationUnit(SWFFrame frame)
-    {
-        m_swfFrameToCompilationUnitLock.writeLock().lock();
-        final ICompilationUnit cu = m_swfFrameToCompilationUnit.get(frame);
-        m_swfFrameToCompilationUnitLock.writeLock().unlock();
-        return cu;
-    }
-
-    public void registerReferencedDefinition(String name)
-    {
-        m_referencedDefinitionsLock.writeLock().lock();
-        m_referencedDefinitions.add(name);
-        m_referencedDefinitionsLock.writeLock().unlock();
-    }
-
-    public Boolean isReferencedDefinition(String name)
-    {
-        m_referencedDefinitionsLock.readLock().lock();
-        final Boolean val = m_referencedDefinitions.contains(name);
-        m_referencedDefinitionsLock.readLock().unlock();
-        return val;
-    }
-
-    public void registerDefinition(IDefinition def)
-    {
-        m_definitionsLock.writeLock().lock();
-        final String qName = def.getQualifiedName();
-        this.m_definitions.put(qName, def);
-        m_definitionsLock.writeLock().unlock();
-
-        // register this definition as an extern if necessary.
-        final IMetaTag extern = def.getMetaTagByName(JSSharedData.EXTERN_METATAG);
-        if (extern != null)
-            registerExtern(def);
-    }
-
-    public IDefinition getDefinition(String qualifiedName)
-    {
-        m_definitionsLock.readLock().lock();
-        final IDefinition val = m_definitions.get(qualifiedName);
-        m_definitionsLock.readLock().unlock();
-        return val;
-    }
-
-    public IDefinition getDefinition(Name name)
-    {
-        m_definitionsLock.readLock().lock();
-
-        IDefinition val = null;
-        final String baseName = name.getBaseName();
-        if (baseName != null)
-        {
-            final Nsset nsset = name.getQualifiers();
-            if (nsset != null)
-            {
-                for (Namespace ns : nsset)
-                {
-                    String defName = ns.getName();
-                    if (!defName.isEmpty())
-                        defName += ".";
-                    defName += name.getBaseName();
-                    val = m_definitions.get(defName);
-                    if (val != null)
-                        break;
-                }
-            }
-        }
-
-        if (val == null)
-            val = m_definitions.get(baseName);
-
-        m_definitionsLock.readLock().unlock();
-        return val;
-    }
-
-    public String getQualifiedName(Name name)
-    {
-        final IDefinition def = getDefinition(name);
-        if (def != null)
-            return def.getQualifiedName();
-        return null;
-    }
-
-    public void registerUsedExtern(String name)
-    {
-        m_usedExternsLock.writeLock().lock();
-        m_usedExterns.add(name);
-        m_usedExternsLock.writeLock().unlock();
-    }
-
-    public Boolean isUsedExtern(String name)
-    {
-        m_usedExternsLock.readLock().lock();
-        final Boolean val = m_usedExterns.contains(name);
-        m_usedExternsLock.readLock().unlock();
-        return val;
-    }
-
-    public Set<String> getUsedExterns()
-    {
-        final Set<String> externs = new HashSet<String>();
-        m_scriptInfosLock.readLock().lock();
-        externs.addAll(m_scriptInfos);
-        m_scriptInfosLock.readLock().unlock();
-        return externs;
-    }
-
-    public void registerScriptInfo(String name)
-    {
-        m_scriptInfosLock.writeLock().lock();
-        m_scriptInfos.add(name);
-        m_scriptInfosLock.writeLock().unlock();
-    }
-
-    public Set<String> getScriptInfos()
-    {
-        final Set<String> scriptInfos = new HashSet<String>();
-        m_scriptInfosLock.readLock().lock();
-        scriptInfos.addAll(m_scriptInfos);
-        m_scriptInfosLock.readLock().unlock();
-        return scriptInfos;
-    }
-
-    public void registerPropertyName(String name)
-    {
-        m_propertyNamesLock.writeLock().lock();
-
-        if (m_propertyNames.containsKey(name))
-        {
-            final Integer uses = m_propertyNames.get(name);
-            m_propertyNames.put(name, uses + 1);
-        }
-        else
-        {
-            m_propertyNames.put(name, 1);
-        }
-        m_propertyNamesLock.writeLock().unlock();
-    }
-
-    public Boolean isUniquePropertyName(String name)
-    {
-        Boolean isUnique = true;
-        m_propertyNamesLock.readLock().lock();
-        if (m_propertyNames.containsKey(name))
-        {
-            final Integer uses = m_propertyNames.get(name);
-            if (uses > 1)
-                isUnique = false;
-        }
-        m_propertyNamesLock.readLock().unlock();
-        return isUnique;
-    }
-
-    // called whenever we have to emit adobe.get/set/call property.
-    public void registerAccessedPropertyName(String name)
-    {
-        m_accessedPropertyNamesLock.writeLock().lock();
-        m_accessedPropertyNames.add(name);
-        m_accessedPropertyNamesLock.writeLock().unlock();
-    }
-
-    public Boolean isAccessedPropertyName(String name)
-    {
-        m_accessedPropertyNamesLock.readLock().lock();
-        final Boolean val = m_accessedPropertyNames.contains(name);
-        m_accessedPropertyNamesLock.readLock().unlock();
-        return val;
-    }
-
-    public static Boolean usingAdvancedOptimizations()
-    {
-        return CLOSURE_compilation_level.equals("ADVANCED_OPTIMIZATIONS");
-    }
-
-    // called whenever we have to emit adobe.get/set/call property.
-    public void registerClassInit(String fullClassName)
-    {
-        if (fullClassName != null && !fullClassName.isEmpty())
-        {
-            m_classInitLock.writeLock().lock();
-            m_classInit.add(fullClassName);
-            m_classInitLock.writeLock().unlock();
-        }
-    }
-
-    public Boolean hasClassInit(String fullClassName)
-    {
-        m_classInitLock.readLock().lock();
-        final Boolean val = m_classInit.contains(fullClassName);
-        m_classInitLock.readLock().unlock();
-        return val;
-    }
-
-    public Boolean hasAnyClassInit()
-    {
-        m_classInitLock.readLock().lock();
-        final Boolean val = m_classInit.isEmpty();
-        m_classInitLock.readLock().unlock();
-        return !val;
-    }
-
-    public void registerUUID(String path, String uuid)
-    {
-        m_pathToUUIDLock.writeLock().lock();
-        m_pathToUUID.put(path, uuid);
-        m_pathToUUIDLock.writeLock().unlock();
-    }
-
-    public String getUUID(String path)
-    {
-        m_pathToUUIDLock.readLock().lock();
-        final String val = m_pathToUUID.get(path);
-        m_pathToUUIDLock.readLock().unlock();
-        return val;
-    }
-
-    public void registerEncryptedJS(String name)
-    {
-        m_encryptedJSLock.writeLock().lock();
-        m_encryptedJS.add(name);
-        m_encryptedJSLock.writeLock().unlock();
-    }
-
-    public Boolean hasEncryptedJS(String name)
-    {
-        m_encryptedJSLock.readLock().lock();
-        final Boolean val = m_encryptedJS.contains(name);
-        m_encryptedJSLock.readLock().unlock();
-        return val;
-    }
-
-    public Boolean hasAnyEncryptedJS()
-    {
-        m_encryptedJSLock.readLock().lock();
-        final Boolean val = !m_encryptedJS.isEmpty();
-        m_encryptedJSLock.readLock().unlock();
-        return val;
-    }
-
-    public void registerMethod(String methodName, String className)
-    {
-        m_methodsLock.writeLock().lock();
-        Set<String> classes = m_methods.get(methodName);
-        if (classes == null)
-        {
-            classes = new HashSet<String>();
-            m_methods.put(methodName, classes);
-        }
-        classes.add(className);
-        m_methodsLock.writeLock().unlock();
-    }
-
-    // poor man's type inference.
-    public void registerMethods(ICompilerProject project, IMemberedDefinition memberedDef)
-    {
-        final String className = memberedDef.getQualifiedName();
-        final ASDefinitionFilter memberFilter = new ASDefinitionFilter(
-                ClassificationValue.FUNCTIONS, SearchScopeValue.INHERITED_MEMBERS,
-                AccessValue.ALL, memberedDef);
-
-        for (IDefinition member : MemberedDefinitionUtils.getAllMembers(memberedDef, project, memberFilter))
-        {
-            /*
-             * class method registered as eventListener gets global when class
-             * instance is in an array
-             * http://watsonexp.corp.adobe.com/#bug=3040108 We need register
-             * only methods with unique signatures. In other words overridden
-             * methods must be excluded.
-             */
-            if (member instanceof IFunctionDefinition && !member.isOverride())
-            {
-                final INamespaceDefinition ns = member.resolveNamespace(project);
-                if (ns != null && ns.isPublicOrInternalNamespace())
-                    registerMethod(member.getBaseName(), className);
-            }
-        }
-    }
-
-    // poor man's type inference.
-    public Set<IFunctionDefinition> getMethods(ICompilerProject project, String methodName)
-    {
-        Set<IFunctionDefinition> defs = new HashSet<IFunctionDefinition>();
-        m_methodsLock.readLock().lock();
-        final Set<String> classes = m_methods.get(methodName);
-        if (classes != null)
-        {
-            for (String className : classes)
-            {
-                final IDefinition def = getDefinition(className);
-                if (def != null && def instanceof IMemberedDefinition)
-                {
-                    final ASDefinitionFilter memberFilter = new ASDefinitionFilter(
-                            ClassificationValue.FUNCTIONS, SearchScopeValue.INHERITED_MEMBERS,
-                            AccessValue.ALL, def);
-                    final IMemberedDefinition memberedDef = (IMemberedDefinition)def;
-                    final IDefinition mdef = MemberedDefinitionUtils.getMemberByName(
-                            memberedDef, project, methodName, memberFilter);
-                    if (mdef instanceof IFunctionDefinition)
-                    {
-                        final IFunctionDefinition fdef = (IFunctionDefinition)mdef;
-                        defs.add(fdef);
-                    }
-                }
-            }
-        }
-        m_methodsLock.readLock().unlock();
-        return defs;
-    }
-
-}


[11/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_pt.properties
----------------------------------------------------------------------
diff --git a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_pt.properties b/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_pt.properties
deleted file mode 100644
index 00b86b9..0000000
--- a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_pt.properties
+++ /dev/null
@@ -1,282 +0,0 @@
-################################################################################
-##
-##  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.
-##
-################################################################################
-
-ABCGeneratorProblem=Erro interno no subsistema gerador ABC ao gerar código para: ${sourceFileName}: ${stackTrace}
-AccessorTypesMustMatchProblem=Os tipos de acessadores devem ser correspondentes.
-AccessUndefinedMemberProblem=Acesso à propriedade provavelmente indefinida ${memberName} por meio de uma referência com tipo estático ${className}.
-AccessUndefinedPropertyInPackageProblem=Acesso à propriedade indefinida ${propertyName} no pacote ${packageName}.
-AccessUndefinedPropertyProblem=Acesso à propriedade provavelmente indefinida ${propertyName}.
-AmbiguousReferenceProblem=Referência ambígua a ${property}
-AssignToConstProblem=Atribuições ilegais a uma variável especificada como constante.
-AssignToFunctionProblem=Atribuição ilegal para a função ${funcName}.
-AssignToReadOnlyPropertyProblem=A propriedade ${name} é só de leitura.
-AttemptToDeleteFixedPropertyProblem=Tentativa de excluir a propriedade fixa ${name}. Somente propriedades definidas dinamicamente podem ser excluídas.
-AttributesAreNotCallableProblem=Os atributos não podem ser chamados.
-BadAccessInterfaceMemberProblem=Os membros da interface não podem ser declarados público, privado, protegido ou interno.
-BadCharacterProblem=Erro de caractere não esperado: '${errorText}' não é permitido aqui
-BadSetterReturnTypeProblem=O tipo de retorno de uma definição de setter deve ser não especificado ou nulo.
-BaseClassIsFinalProblem=A classe base é ${finalStr}.
-BURMDiagnosticForEachExpectedInProblem=a palavra-chave '${k_each}' não é permitida sem um operador '${k_in}'
-BURMDiagnosticInvalidDecrementProblem=O operando do decremento deve ser uma referência.
-BURMDiagnosticNotAllowedHereProblem=${node} não é permitido aqui
-BURMPatternMatchFailureProblem=Não foi possível gerar um código para ${node}
-BURNDiagnosticInvalidIncrementProblem=O operando do incremento deve ser uma referência.
-CallUndefinedMethodProblem=Chamada de um método provavelmente indefinido ${methodName}.
-CannotDeleteSuperDescendantsProblem=Não é possível excluir descendentes super.
-CannotExtendClassProblem=Uma interface só pode estender outras interfaces, mas ${className} é uma classe.
-CannotExtendInterfaceProblem=Uma ${classStr} só pode estender outra ${classStr}, não uma ${interfaceStr}.
-CannotResolveConfigExpressionProblem=Não é possível solucionar uma constante de configuração: '${configName}'
-CircularTypeReferenceProblem=Uma referência do tipo circular foi detectada em ${className}
-ClassesMappedToSameRemoteAliasProblem=Encontrado mapeamento de '${existingClassName}' para alias da classe remote '${alias}' ao processar a classe '${className}'. O Flex gera agora um código para verificar se um alias já foi registrado. Quando dados remotos são deserializados, só um alias pode mapear para uma única classe.
-ClosureProblem=Closure error.
-CodegenInternalProblem=Erro interno do gerador de código: ${diagnostic}
-CompiledAsAComponentProblem=${className} é um módulo ou aplicativo referenciado diretamente. Isso faz com que ${className} e todas as suas dependências sejam ligadas a ${mainDefinition}. O uso de uma interface é uma prática recomendada para evitar isso.
-ConfigurationFileNotFoundProblem=Não é possível encontrar o arquivo de configuração: ${file}
-ConfigurationProblem=Problema na configuração: ${reason}.\n${location}
-ConflictingInheritedNameInNamespaceProblem=Existe um conflito com a definição de ${declName} herdada no namespace ${nsName}.
-ConflictingNameInNamespaceProblem=Existe um conflito com a definição de ${declName} no namespace ${nsName}.
-ConstructorCannotHaveReturnTypeProblem=Um construtor não pode especificar um tipo de retorno
-ConstructorIsGetterSetterProblem=Um construtor não pode ser um método getter ou setter
-ConstructorIsStaticProblem=As funções do construtor devem ser métodos de instância 
-ConstructorMustBePublicProblem=Um construtor só pode ser declarado ${modifier}
-CountedForLoopInitializerProblem=Erro de sintaxe: esperado ponto-e-vírgula antes de fecha- parênteses.
-CSSCodeGenProblem=Problema no codegen CSS. Motivo: '${reason}'
-CSSEmbedAssetProblem=Não é possível incorporar recursos de '${embed}'.
-CSSParserProblem=${reason}
-CSSUndefinedNamespacePrefixProblem=Prefixo do namespace indefinido '${prefix}'.
-CSSUndefinedTypeProblem='${type}' não está definido.
-CSSUnknownDefaultNamespaceProblem=O seletor de tipo sem prefixo do namespace requer a definição de um namespace padrão. ${selectorText}
-CSSUnresolvedClassReferenceProblem=${qname} não está definido.
-CyclicalIncludesProblem=Encontradas inclusões cíclicas no ${file}
-DependencyNotCompatibleProblem=A dependência ${definition} de ${swc} tem uma versão mínima suportada de ${swcMinimumVersion}, que é superior à versão de compatibilidade, ${compatibilityVersion}.
-DeprecatedConfigurationOptionProblem='${option}' foi deprecada desde ${since}. Use '${replacement}'
-DuplicateAttributeProblem=O atributo ${attrStr} foi especificado várias vezes.
-DuplicateClassDefinitionProblem=Definição de classe duplicada: ${className}.
-DuplicateConfigNameProblem=Namespace de configuração duplicado: '${configName}'
-DuplicateFunctionDefinitionProblem=Definição de função duplicada: ${methodName}
-DuplicateInterfaceDefinitionProblem=Definição de interface duplicada: ${interfaceName}.
-DuplicateInterfaceProblem=${classStr} ${className} implementa ${interfaceStr} ${interfaceName} várias vezes.
-DuplicateLabelProblem=Definição de rótulo duplicada.
-DuplicateNamespaceDefinitionProblem=Definição de namespace duplicada.
-DuplicateQNameInSourcePathProblem=${qName} é definido por vários arquivos: ${fileList} 
-DuplicateSkinStateProblem=Declaração duplicada de SkinState '${name}'
-DuplicateSourceFileProblem=${file} foi especificado mais de uma vez na lista de fontes de inclusão.
-DuplicateSourcePathProblem=${directory} foi especificado mais de uma vez no caminho de origem.
-DuplicateSwitchCaseProblem=Alternativa de switch duplicada ${caseName}.
-DynamicNotOnClassProblem=O atributo ${dynamicStr} só pode ser usado com definições de ${classStr}.
-EmbedAS2TagsModifiedProblem=As ações AS2 foram removidas da marca ${symbol}
-EmbedBadFontParameters=A transcodificação de fonte requer que você especfique 'fontName' e uma 'source', 'systemFont' ou 'sourceList'
-EmbedBadScalingGridTargetProblem=Não foi possível dimensionar o símbolo ${symbol} visto que não é do tipo Entidade gráfica
-EmbedCouldNotDetermineSampleFrameCountProblem=Não foi possível determinar a contagem de quadros na amostra no arquivo ${filename}
-EmbeddedFontShadowsDeviceFontProblem=a fonte incorporada '${alias}' pode criar uma sombra na fonte de dispositivo com o mesmo nome. Use fontName para substituir a fonte por um nome diferente
-EmbedExceptionWhileTranscodingProblem=exceção durante a transcodificação: ${exception}
-EmbedInitialValueProblem=Uma variável Embed não deve ter um valor existente.
-EmbedInvalidAttributeValueProblem=O valor ${value} é inválido para o atributo ${attribute}
-EmbedInvalidUnicodeRangeProblem=intervalo Unicode inválido '${range}'
-EmbedMissingSymbolProblem=Não foi possível encontrar o símbolo ${symbol} no arquivo ${swf}
-EmbedMovieScalingNoSymbolProblem=Especifica um símbolo ao dimensionar um filme incorporado
-EmbedMultipleMetaTagsProblem=Uma variável só pode ter uma marca de metadados Embed
-EmbedNoSkinClassProblem=Deve especificar o atributo skinClass ao incorporar ativos de capa
-EmbedNoSourceAttributeProblem=Embed requer o atributo do arquivo de origem
-EmbedQualityRequiresCompressionProblem=Não especifique ${quality}quando a compactação estiver desativada
-EmbedQualityValueProblem=O valor ${value} é inválido para o atributo ${quality}. Deve estar entre 0,0 e 100,0
-EmbedScalingGridProblem=os atributos scaleBottom, scaleLeft, scaleRight e scaleTop devem ser especificados juntos
-EmbedScalingGridValueProblem=O valor de dimensionamento ${value} deve ser maior que 0 para o atributo ${attr}
-EmbedSkinClassNotFoundProblem=Não foi possível encontrar a classe ${skinClass}
-EmbedSourceAttributeCouldNotBeReadProblem=Não foi possível ler o arquivo de origem Embed ${filename}
-EmbedSourceAttributeDoesNotExistProblem=Não foi possível encontrar o arquivo de origem Embed 
-EmbedSourceFileNotFoundProblem=Não é possível encontrar o arquivo de origem: ${file}
-EmbedTypeNotEmbeddableProblem=Não é possível incorporar o tipo ${typeName}
-EmbedUnableToBuildFontProblem=não foi possível criar a fonte '${fontName}'
-EmbedUnableToReadSourceProblem=não foi possível ler a origem de transcodificação '${source}'
-EmbedUnknownAttributeProblem=Atributo desconhecido: ${attr}
-EmbedUnknownMimeTypeProblem=Tipomime não manipulável ${mimeType}
-EmbedUnrecogniedFileTypeProblem=O arquivo ${file} é de um tipo desconhecido que não pode ser incorporado
-EmbedUnsupportedAttributeProblem=Não é possível usar o atributo ${attribute} com o tipo mime: ${mimeType}
-EmbedUnsupportedSamplingRateProblem=A frequência ${frequency} não é suportada no arquivo ${filename}
-FileNotFoundProblem=Arquivo não encontrado: ${file}
-FinalOutsideClassProblem=O atributo ${finalStr} só pode ser usado em um método definido em uma ${classStr}.
-FunctionNotMarkedOverrideProblem=Substituição de uma ${funcStr} que não é marcada para ${overrideStr}
-FunctionWithoutBodyProblem=A função não tem um corpo.
-FXGCompilerProblem=Problema na compilação de FXG: ${message}
-GetterCannotHaveParametersProblem=Uma definição de getter não deve ter parâmetros.
-GlobalBindablePropertyProblem=[${bindableStr}] não tem permissão em variáveis globais ou ${packageStr}
-HostComponentClassNotFoundProblem=Classe [HostComponent] '${className}' não encontrada.
-HostComponentMustHaveTypeProblem=[HostComponent] deve especificar um nome de tipo.
-IllegalAssignmentToClassProblem=Atribuição ilegal para a classe ${className}.
-ImplicitCoercionToSubtypeProblem=Coerção implícita de um valor com tipo estático ${baseType} para um tipo ${subType} provavelmente não relacionado.
-ImplicitCoercionToUnrelatedTypeProblem=Coerção implícita de um valor do tipo ${actualType} para um tipo ${expectedType} não relacionado.
-InaccessibleMethodReferenceProblem=Tentativa de acesso ao método inacessível ${methodName} por meio de uma referência com tipo estático ${className}.
-InaccessiblePropertyReferenceProblem=Tentativa de acesso à propriedade inacessível ${propertyName} por meio de uma referência com tipo estático ${className}.
-IncompatibleDefaultValueProblem=Valor padrão incompatível do tipo ${srcType} onde ${tgtType} é esperado.
-IncompatibleInterfaceMethodProblem=O método ${interfStr} ${methodName} no ${namespaceStr} ${namespaceName} é implementado com uma assinatura incompatível em ${className} ${classStr} 
-IncompatibleOverrideProblem=${overrideStr} incompatível.
-InterfaceBindablePropertyProblem=[${bindableStr}] não tem permissão dentro de uma definição de ${interfStr}.
-InterfaceCannotBeInstantiatedProblem=Não é possível iniciar uma instância das interfaces com o novo operador.
-InterfaceMethodWithBodyProblem=Métodos definidos em uma ${interfaceStr} não devem ter um corpo.
-InterfaceModifierProblem=Atributo de interface ${modifier} inválido.
-InterfaceNamespaceAttributeProblem=Os atributos do namespace não têm permissão em métodos da interface.
-InternalCompilerProblem=Erro interno de compilador
-InvalidABCByteCodeProblem=Código de bytes ABC inválido.
-InvalidBackgroundColorProblem=Cor de fundo inválida: ${backgroundColor}
-InvalidDecrementOperandProblem=O operando do decremento é inválido.
-InvalidEscapeSequenceProblem='${badSequence}' não é uma sequência de escape válida
-InvalidForInInitializerProblem=Erro de sintaxe: inicializador for-in inválido; somente uma expressão esperada.
-InvalidIncrementOperandProblem=O operando do incremento é inválido.
-InvalidLvalueProblem=O destino da atribuição deve ser um valor de referência.
-InvalidNamespaceInitializerProblem=Um inicializador de namespace deve ser uma sequência de caracteres literal ou outro namespace.
-InvalidNamespaceProblem=Um atributo de namespace definido pelo usuário só pode ser usado no nível superior de uma definição de ${classStr}.
-InvalidOverrideProblem=O atributo ${overrideStr} só pode ser usado em um método definido em uma ${classStr}.
-InvalidPrivateNamespaceAttrProblem=O atributo ${privateStr} só pode ser usado em definições de propriedade ${classStr}.
-InvalidPrivateNamespaceProblem=${privateStr} só pode ser usado como um namespace dentro de ${classStr}.
-InvalidProtectedNamespaceAttrProblem=O atributo ${protectedStr} só pode ser usado em definições de propriedade ${classStr}.
-InvalidProtectedNamespaceProblem=${protectedStr} só pode ser usado como um namespace dentro de ${classStr}.
-InvalidPublicNamespaceAttrProblem=O atributo ${publicStr} só pode ser usado dentro de um ${packageStr}.
-InvalidPublicNamespaceProblem=${publicStr} só pode ser usado como um namespace dentro de ${packageStr}.
-InvalidRestParameterDeclarationProblem=Os parâmetros especificados depois da palavra-chave de definição do parâmetro ...rest só podem ser do tipo de dados Array.
-InvalidSuperExpressionProblem=Uma expressão super só pode ser usada dentro de métodos da instância da classe.
-InvalidSuperStatementProblem=Uma instrução super só pode ser usada dentro de construtores da instância da classe.
-JSDataClassMethodError=ERROR: DataClass classes must not declare methods. 
-JSInternalCompilerProblem=Internal compiler error: ${message}. 
-JSUnsupportedFeatureProblem=Unsupported feature: ${feature}. 
-JSWarnClassInitProblem=PERFORMANCE: Avoid loose class initialization statements. Consider using singletons instead.
-JSWarnClosureAdvancedOptimizationsProblem=WARNING: Optimizing with ADVANCED_OPTIMIZATIONS will fail because of accessing properties via unknown strings.
-JSWarnRuntimeNameLookupProblem=PERFORMANCE: Forced to emit expensive runtime name lookup. Consider using strict types instead of generic objects and avoiding dynamic classes.
-LocalBindablePropertyProblem=[${bindableStr}] não tem permissão dentro de uma definição de ${funcStr}.
-LossyConversionProblem=Inicialização inválida: a conversão para o tipo ${targetType} perde dados.
-MethodCannotBeConstructorProblem=O método não pode ser usado como um construtor.
-MissingBuiltinProblem=Tipo embutido ${builtinType} ausente 
-MissingCatchOrFinallyProblem=Erro de sintaxe: cláusula catch ou finally esperada.
-MissingFactoryClassInFrameMetadataProblem=Esta unidade de compilação não tem uma factoryClass especificada nos metadados Quadro para carregar as bibliotecas compartilhadas em tempo de execução configuradas. Para compilar sem bibliotecas compartilhadas em tempo de execução, defina a opção -static-link-runtime-shared-libraries como verdadeiro ou remova a opção -runtime-shared-libraries.
-MissingRequirementConfigurationProblem=a variável de configuração '${required}' não foi definida
-MissingSignedDigestProblem=Não foi encontrada nenhuma compilação assinada no catalog.xml da biblioteca, ${libraryPath}.
-MissingSkinPartProblem=A parte de capa necessária '${skinPartName}' está ausente.
-MissingSkinStateProblem=O estado de capa necessário '${skinStateName}' está ausente.
-MissingUnsignedDigestProblem=Não foi encontrada nenhuma compilação não assinada no catalog.xml da biblioteca, ${libraryPath}.
-MultipleConfigNamespaceDecorationsProblem=Namespaces de configuração duplicados não são permitidos em uma definição
-MultipleSwitchDefaultsProblem=O switch tem mais de um padrão, mas somente um padrão é permitido.
-MXMLAttributeVersionProblem=O atributo '${name}' só pode ser usado em MXML ${version} ou superior. Será ignorado.
-MXMLClassNodeProblem='${qname}' não especifica uma classe ou interface. Será ignorado.
-MXMLDatabindingSourceNotBindableProblem=O vínculo de dados não conseguirá detectar atribuições para '${sourceName}'.
-MXMLDuplicateIDProblem=Esse id não é exclusivo. Será ignorado.
-MXMLFinalClassProblem='${qname}' é uma classe final e não pode ser usada como marca raiz.
-MXMLIncludeInAndExcludeFromProblem=Os atributos 'includeIn' e 'excludeFrom' não podem ser especificados na mesma marca. Ambos serão ignorados.
-MXMLIncompatibleArrayElementProblem=Um elemento de matriz de tipo '${actualType}' é incompatível com o [ArrayElementType] esperado de '${expectedType}' para a propriedade '${propertyName}'.
-MXMLIncompatibleVectorElementProblem=Esse elemento é incompatível com o tipo Vector. Será ignorado.
-MXMLInvalidEntityProblem=Encontrada a entidade desconhecida '{entity}'. Será ignorada.
-MXMLInvalidIDProblem=\ Esse id não é um identificador do ActionScript válido. Será ignorado.
-MXMLInvalidItemCreationPolicyProblem=Os valores válidos para itemCreationPolicy são 'imediato' ou 'adiado'. Esse atributo será ignorado.
-MXMLInvalidItemDestructionPolicyProblem=Os valores válidos para itemDestructionPolicy são 'automático' ou 'nunca'. Esse atributo será ignorado.
-MXMLInvalidPercentageProblem=Inicializador de '${property}': expressão de porcentagem inválida: '${text}'.
-MXMLInvalidTextForTypeProblem=Não é possível analisar o valor do tipo '${type}' a partir de '${text}'.
-MXMLInvalidVectorFixedAttributeProblem=O atributo 'fixed' deve ser 'verdadeiro' ou 'falso'. Será ignorado.
-MXMLInvalidVectorTypeAttributeProblem=O atributo 'type' não especifica uma classe conhecida. O tipo será assumido como '*'.
-MXMLMissingRootTagProblem=Nenhuma marca de raiz encontrada neste arquivo MXML.
-MXMLMissingVectorTypeAttributeProblem=O atributo 'type' é necessário em uma marca <Vector>. O tipo será assumido como '*'.
-MXMLNotAClassProblem='${qname}' não é uma classe. Essa marca será ignorada.
-MXMLOperationMissingNameProblem=A operação requer um atributo ${name}.
-MXMLOtherLanguageNamespaceProblem=Somente um namespace de idioma pode ser usado em um documento MXML. Esse atributo será ignorado.
-MXMLOuterDocumentAlreadyDeclaredProblem=A propriedade denominada ${outerDocument} já foi declarada, entrando em conflito com ${outerDocument} da marca ${fxComponent}.
-MXMLPercentageNotAllowedProblem=Inicializador de '${property}': porcentagem não permitida aqui: '${text}'.
-MXMLPrivateAttributeProblem=Esse atributo usa um namespace privativo e, portanto, será ignorado.
-MXMLPrivateTagLocationProblem=A marca <Private> deve ser a última marca filho da marca de raiz do arquivo. Será ignorada.
-MXMLSemanticProblem=Problema interno durante a análise semântica de MXML
-MXMLUnexpectedAttributeProblem=Esse atributo não é esperado. Será ignorado.
-MXMLUnexpectedDatabindingProblem=Essa expressão databinding não é esperada. Será ignorada.
-MXMLUnexpectedTagProblem=Essa marca não é esperada. Será ignorada.
-MXMLUnexpectedTextProblem=Esse texto não é esperado. Será ignorado.
-MXMLUnrecognizedCompilerDirectiveProblem=A função ${functionName} não é uma diretiva de tempo de compilação reconhecida
-MXMLUnresolvedTagProblem=Essa marca não podia ser solucionada para uma classe do ActionScript. Será ignorada.
-MXMLUnterminatedEntityProblem=Encontrada uma entidade não terminada. Será ignorada.
-MXMLXMLListMixedContentProblem=Não é permitido conteúdo misto aqui.
-MXMLXMLOnlyOneRootTagProblem=Somente é permitida uma marca de raiz
-MXMLXMLRequireContentProblem=O conteúdo XML é necessário
-NamespaceInInterfaceProblem=Declarações de namespaces não são permitidas em interfaces.
-NativeMethodWithBodyProblem=Os métodos nativos não podem ter um corpo.
-NativeNotOnFunctionProblem=O atributo ${nativeStr} só pode ser usado com definições ${functionStr}.
-NativeUsedInInterfaceProblem=O atributo ${nativeStr} não pode ser usado nas definições ${interfStr}.
-NativeVariableProblem=As variáveis não podem ser ${nativeStr}.
-NestedGetterSetterProblem=Os acessadores não podem ser aninhados dentro de outras funções.
-NestedPackageProblem=Os pacotes não podem ser aninhados.
-NoCompilationUnitForDefinitionProblem=Não foi encontrada nenhuma unidade de compilação com o nome '${qname}'.
-NoDefaultConstructorInBaseClassProblem=Não foi encontrado nenhum construtor padrão na classe base ${baseClass}.
-NoDefinitionForSWCDependencyProblem=A definição de ${qname} dependia de o SWC ${swcFilename} ser encontrado
-NoMainDefinitionProblem=Não foi encontrada nenhuma definição visível externamente com o nome '${qname}'.
-NonConstantNamespaceProblem=Um inicializador de namespace deve ser uma sequência de caracteres literal ou outro namespace.
-NonConstantParamInitializerProblem=O inicializador do parâmetro é desconhecido ou não é uma constante de tempo de compilação.
-NonDirectoryInSourcePathProblem=${file} foi especificado no caminho de origem e não é um diretório.
-NoScopesInABCCompilationUnitProblem=Não é possível encontrar escopos na unidade de compilação.
-OnlyOneHostComponentAllowedProblem=Somente é permitido um [HostComponent].
-OverlappingSourcePathProblem=Entradas com sobreposição no caminho de origem: ${ancestor} é um ancestral de ${descendant}
-OverrideFinalProblem=Não é possível redefinir um método ${finalStr}.
-OverrideNotFoundProblem=O método marcado ${overrideStr} deve substituir outro método.
-OverrideOutsideClassProblem=O atributo ${overrideStr} só pode ser usado em definições de propriedade na ${classStr}.
-PackageCannotBeUsedAsValueProblem=O pacote não pode ser usado como valor: ${packageName}.
-ParserProblem=Problema interno de análise
-PropertyIsWriteOnlyProblem=A propriedade ${name} é só de gravação.
-PrototypeInvalidAttributeProblem=O atributo prototype é inválido.
-RemovedConfigurationOptionProblem='${option}' não é mais suportada e não terá efeito.
-RequiredParameterAfterOptionalProblem=Parâmetros necessários não são permitidos depois dos parâmetros opcionais.
-ResourceBundleMalformedEncodingProblem=A codificação da sequência de carateres fornecida está mal formada: ${string}
-ResourceBundleNoBundleParameterProblem=Nenhum parâmetro de pacote fornecido para @Resource()
-ResourceBundleNoKeyParameterProblem=Nenhum parâmetro principal fornecido para @Resource()
-ResourceBundleNotFoundForLocaleProblem=Não foi possível solucionar o pacote de recursos '${bundleName}' do local '${locale}'
-ResourceBundleNotFoundProblem=Não foi possível solucionar o pacote de recursos '${bundleName}'
-RestParameterMustBeLastProblem=Os parâmetros ${rest} devem ser os últimos.
-ReturnCannotBeUsedInGlobalProblem=A instrução return não pode ser usada no código de inicialização global.
-ReturnCannotBeUsedInPackageProblem=A instrução return não pode ser usada no código de inicialização do pacote.
-ReturnCannotBeUsedInStaticProblem=A instrução return não pode ser usada no código de inicialização estática.
-ReturnMustReturnValueProblem=A função não retorna um valor.
-ReturnValueMustBeUndefinedProblem=O valor de retorno deve ser indefinido.
-SemanticProblem=Problema interno durante a análise semântica.
-SetterCannotHaveOptionalProblem=Uma definição de setter não pode ter parâmetros opcionais.
-SetterMustHaveOneParameterProblem=Uma definição de setter deve ter exatamente um parâmetro.
-SkinPartsMustBePublicProblem=As partes de capa devem ser públicas.
-StaticAndOverrideProblem=As funções não podem ser ${staticStr} e ${overrideStr}.
-StaticNamespaceDefinitionProblem=O atributo static não é permitido em definições ${namespaceKeyword}.
-StaticOutsideClassProblem=O atributo ${staticStr} só pode ser usado em definições dentro de uma ${classStr}.
-StrictUndefinedMethodProblem=Chamada de um método provavelmente indefinido ${methodName} por meio de uma referência com tipo estático ${className}.
-SyntaxProblem=Erro de sintaxe: '${tokenText}' não é permitido aqui
-ThisUsedInStaticFunctionProblem=A palavra-chave ${thisKeyword} não pode ser usada em métodos estáticos. Ela só pode ser usada em métodos de ocorrência, fechamentos de função e código global.
-TooFewFunctionParametersProblem=Número de argumentos incorreto. Eram esperados ${nParams}
-TooManyFunctionParametersProblem=Número incorreto de argumentos. Eram esperados não mais de ${nParams}
-UnableToBuildReportProblem=Não foi possível criar o relatório: ${message}
-UnableToBuildSWFProblem=Não foi possível criar SWF ${file}
-UnableToBuildSWFTagProblem=Não foi possível criar a marca SWF para ${name}
-UnableToListFilesProblem=Não foi possível listar o conteúdo do diretório: @{directory}
-UnboundMetadataProblem=Os metadados não estão vinculados a uma definição
-UndefinedConfigNameProblem=Constante de configuração indefinida: '${configName}'
-UndefinedConfigNamespaceProblem=Namespace de configuração indefinido: '${configName}'
-UnexpectedExceptionProblem=Exceção '${exceptionName}' não esperada.
-UnexpectedReturnProblem=A instrução return não pode ser usada aqui.
-UnexpectedTokenProblem=Erro de sintaxe: ${tokenKind} era esperado, mas se obteve '${tokenText}'
-UnfoundPropertyProblem=Acesso de propriedade indefinida ${property}
-UnimplementedInterfaceMethodProblem=Método ${interfStr}  ${methodName}no ${namespaceStr} ${namespaceName} não implementado por  ${classStr} ${className}
-UnknownBreakTargetProblem=O destino da instrução break não foi encontrado.
-UnknownContinueTargetProblem=O destino da instrução continue não foi encontrado.
-UnknownInterfaceProblem=${interfaceStr} ${interfaceName} não foi encontrado.
-UnknownNamespaceProblem=Namespace ${namespaceName} desconhecido.
-UnknownSuperclassProblem=A definição da classe base ${superclassName} não foi encontrada.
-UnknownTypeProblem=O tipo não foi encontrado ou não era uma constante de tempo de compilação: ${typeName}.
-UnresolvedClassReferenceProblem=Não foi possível encontrar a definição de ${qname}.
-UnresolvedNamespaceProblem=O namespace não foi encontrado ou não era uma constante de tempo de compilação.
-UnsupportedSourceFileProblem=${file} é um tipo não suportado: ${ext}
-VarInInterfaceProblem=As declarações ${varStr} não são permitidas na ${interfStr}.
-VoidTypeProblem=${voidStr} não é um tipo válido.
-WrongSkinPartProblem=O tipo da parte de capa'${skinPartTypeName}' deve ser atribuível a '${hostSkinPartTypeName}'.

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_zh_cn.properties
----------------------------------------------------------------------
diff --git a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_zh_cn.properties b/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_zh_cn.properties
deleted file mode 100644
index d195c65..0000000
--- a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_zh_cn.properties
+++ /dev/null
@@ -1,282 +0,0 @@
-################################################################################
-##
-##  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.
-##
-################################################################################
-
-ABCGeneratorProblem=在为 ${sourceFileName} 生成代码时,ABC 生成器子系统中发生内部错误: ${stackTrace}
-AccessorTypesMustMatchProblem=存取器类型必须相匹配。
-AccessUndefinedMemberProblem=通过静态类型为 ${className} 的引用来访问的属性 ${memberName} 可能未定义。
-AccessUndefinedPropertyInPackageProblem=包 ${packageName} 中所访问的属性 ${propertyName} 未定义。
-AccessUndefinedPropertyProblem=所访问的属性 ${propertyName} 可能未定义。
-AmbiguousReferenceProblem=对 ${property} 的引用不明确
-AssignToConstProblem=对指定为常量的变量进行的赋值非法。
-AssignToFunctionProblem=对函数 ${funcName} 的赋值非法。
-AssignToReadOnlyPropertyProblem=属性 ${name} 为只读。
-AttemptToDeleteFixedPropertyProblem=尝试删除的属性 ${name} 为固定属性。只能删除动态定义的属性。
-AttributesAreNotCallableProblem=属性不可调用。
-BadAccessInterfaceMemberProblem=接口成员不能声明为 public、private、protected 或 internal。
-BadCharacterProblem=意外字符错误: 此处不允许使用“${errorText}”
-BadSetterReturnTypeProblem=setter 定义的返回类型必须未指定或为 void。
-BaseClassIsFinalProblem=基类是 ${finalStr}。
-BURMDiagnosticForEachExpectedInProblem=不允许使用无“${k_in}”运算符的“${k_each}”关键字
-BURMDiagnosticInvalidDecrementProblem=减量的操作数必须是引用。
-BURMDiagnosticNotAllowedHereProblem=此处不允许使用 ${node}
-BURMPatternMatchFailureProblem=无法为 ${node} 生成代码
-BURNDiagnosticInvalidIncrementProblem=增量的操作数必须是引用。
-CallUndefinedMethodProblem=所调用的方法 ${methodName} 可能未定义。
-CannotDeleteSuperDescendantsProblem=无法删除 super 后代。
-CannotExtendClassProblem=接口只能扩展其他接口,而 ${className} 是类。
-CannotExtendInterfaceProblem=${classStr} 只能扩展其他 ${classStr},而非 ${interfaceStr}。
-CannotResolveConfigExpressionProblem=无法解析配置常量:“${configName}”
-CircularTypeReferenceProblem=在 ${className} 中检测到循环类型引用
-ClassesMappedToSameRemoteAliasProblem=在处理类“${className}”时发现“${existingClassName}”到远程类别名“${alias}”的映射。Flex 现在生成代码来检查是否已注册了别名。在对远程数据进行反序列化时,别名只能映射到单个类。
-ClosureProblem=Closure error.
-CodegenInternalProblem=代码生成器内部错误: ${diagnostic}
-CompiledAsAComponentProblem=${className} 是一个直接引用的模块或应用程序。这将导致使用 ${mainDefinition} 将 ${className} 及其所有依赖项链接到一起。为避免此问题,建议使用接口。
-ConfigurationFileNotFoundProblem=找不到配置文件: ${file}
-ConfigurationProblem=配置问题: ${reason}。\n${location}
-ConflictingInheritedNameInNamespaceProblem=与继承的定义 ${declName}(在命名空间 ${nsName} 中)存在冲突。
-ConflictingNameInNamespaceProblem=与定义 ${declName}(在命名空间 ${nsName} 中)存在冲突。
-ConstructorCannotHaveReturnTypeProblem=构造函数不能指定返回类型
-ConstructorIsGetterSetterProblem=构造函数不能是 getter 方法或 setter 方法
-ConstructorIsStaticProblem=构造函数必须是实例方法
-ConstructorMustBePublicProblem=构造函数只能声明为 ${modifier}
-CountedForLoopInitializerProblem=语法错误: 在右括号之前应该有分号。
-CSSCodeGenProblem=CSS 代码生成问题。原因:“${reason}”
-CSSEmbedAssetProblem=无法从“${embed}”嵌入资源。
-CSSParserProblem=${reason}
-CSSUndefinedNamespacePrefixProblem=命名空间前缀“${prefix}”未定义。
-CSSUndefinedTypeProblem=“${type}”未定义。
-CSSUnknownDefaultNamespaceProblem=无命名空间前缀的类型选择器需要定义一个默认的命名空间。${selectorText}
-CSSUnresolvedClassReferenceProblem=${qname} 未定义。
-CyclicalIncludesProblem=在 ${file} 中发现循环包含
-DependencyNotCompatibleProblem=${swc} 的依赖项 ${definition} 有一个受支持的最低版本的 ${swcMinimumVersion},该版本高于兼容版本 ${compatibilityVersion}。
-DeprecatedConfigurationOptionProblem=从 ${since} 起已不推荐使用“${option}”。请使用“${replacement}”
-DuplicateAttributeProblem=多次指定了属性 ${attrStr}。
-DuplicateClassDefinitionProblem=类定义 ${className} 重复。
-DuplicateConfigNameProblem=配置命名空间“${configName}”重复
-DuplicateFunctionDefinitionProblem=函数定义 ${methodName} 重复
-DuplicateInterfaceDefinitionProblem=接口定义 ${interfaceName} 重复。
-DuplicateInterfaceProblem=${classStr} ${className} 多次实现 ${interfaceStr} ${interfaceName}。
-DuplicateLabelProblem=标签定义重复。
-DuplicateNamespaceDefinitionProblem=命名空间定义重复。
-DuplicateQNameInSourcePathProblem=${qName} 由以下多个文件定义: ${fileList}
-DuplicateSkinStateProblem=重复声明 SkinState“${name}”
-DuplicateSourceFileProblem=在包含源列表中多次指定了 ${file}。
-DuplicateSourcePathProblem=在源路径中多次指定了 ${directory}。
-DuplicateSwitchCaseProblem=切换替代名 ${caseName} 重复。
-DynamicNotOnClassProblem=${dynamicStr} 属性只能与 ${classStr} 定义一起使用。
-EmbedAS2TagsModifiedProblem=已从 ${symbol} 标签中删除 AS2 操作
-EmbedBadFontParameters=字体转码需要您指定“fontName”和“source”、“systemFont”或“sourceList”之一
-EmbedBadScalingGridTargetProblem=无法缩放符号 ${symbol},因为它不属于类型 Sprite
-EmbedCouldNotDetermineSampleFrameCountProblem=无法确定文件 ${filename} 中的采样帧计数
-EmbeddedFontShadowsDeviceFontProblem=嵌入字体“${alias}”可能在同名的设备字体上投射阴影。请使用 fontName 将字体命名为其他名称
-EmbedExceptionWhileTranscodingProblem=在转码期间发生异常: ${exception}
-EmbedInitialValueProblem=Embed 变量不得存在现有值。
-EmbedInvalidAttributeValueProblem=值 ${value} 对于属性 ${attribute} 无效
-EmbedInvalidUnicodeRangeProblem=Unicode 范围“${range}”无效
-EmbedMissingSymbolProblem=在文件 ${swf} 中找不到符号 ${symbol}
-EmbedMovieScalingNoSymbolProblem=在缩放嵌入的影片时指定符号
-EmbedMultipleMetaTagsProblem=一个变量只能有一个 Embed 元数据标签
-EmbedNoSkinClassProblem=在嵌入外观资源时必须指定 skinClass 属性
-EmbedNoSourceAttributeProblem=Embed 要求使用源文件属性
-EmbedQualityRequiresCompressionProblem=在禁用压缩时不要指定 ${quality}
-EmbedQualityValueProblem=值 ${value} 对于 ${quality} 属性无效。该值必须介于 0.0 和 100.0 之间
-EmbedScalingGridProblem=属性 scaleBottom、scaleLeft、scaleRight 和 scaleTop 必须一起指定
-EmbedScalingGridValueProblem=属性 ${attr} 的缩放值 ${value} 必须大于 0
-EmbedSkinClassNotFoundProblem=找不到类 ${skinClass}
-EmbedSourceAttributeCouldNotBeReadProblem=无法读取嵌入源文件 ${filename}
-EmbedSourceAttributeDoesNotExistProblem=找不到嵌入源文件
-EmbedSourceFileNotFoundProblem=找不到嵌入源文件: ${file}
-EmbedTypeNotEmbeddableProblem=无法嵌入类型 ${typeName}
-EmbedUnableToBuildFontProblem=无法构建字体“${fontName}”
-EmbedUnableToReadSourceProblem=无法读取转码源“${source}”
-EmbedUnknownAttributeProblem=未知属性: ${attr}
-EmbedUnknownMimeTypeProblem=未处理的 mime 类型 ${mimeType}
-EmbedUnrecogniedFileTypeProblem=文件 ${file} 的文件类型未知,无法嵌入
-EmbedUnsupportedAttributeProblem=属性 ${attribute} 无法与 mime 类型 ${mimeType} 一起使用
-EmbedUnsupportedSamplingRateProblem=文件 {filename} 中不支持频率 ${frequency}
-FileNotFoundProblem=找不到文件: ${file}
-FinalOutsideClassProblem=属性 ${finalStr} 只能用于 ${classStr} 中定义的方法。
-FunctionNotMarkedOverrideProblem=正在覆盖未标记为 ${overrideStr} 的 ${funcStr}
-FunctionWithoutBodyProblem=函数没有过程体。
-FXGCompilerProblem=FXG 编译问题: ${message}
-GetterCannotHaveParametersProblem=getter 定义不能有参数。
-GlobalBindablePropertyProblem=在全局变量或 ${packageStr} 变量中不允许使用 [${bindableStr}]
-HostComponentClassNotFoundProblem=找不到 [HostComponent] 类“${className}”。
-HostComponentMustHaveTypeProblem=[HostComponent] 必须指定一个类型名。
-IllegalAssignmentToClassProblem=对类 ${className} 的赋值非法。
-ImplicitCoercionToSubtypeProblem=从静态类型为 ${baseType} 的值到可能不相关的类型 ${subType} 之间的隐式强制转换。
-ImplicitCoercionToUnrelatedTypeProblem=从类型 ${actualType} 的值到不相关类型 ${expectedType} 之间的隐式强制转换。
-InaccessibleMethodReferenceProblem=通过静态类型为 ${className} 的引用来尝试访问的方法 ${methodName} 不可访问。
-InaccessiblePropertyReferenceProblem=通过静态类型为 ${className} 的引用来尝试访问的属性 ${propertyName} 不可访问。
-IncompatibleDefaultValueProblem=类型 ${srcType}(应为 ${tgtType})的默认值不兼容。
-IncompatibleInterfaceMethodProblem=使用了 ${classStr} ${className} 中不兼容的签名来实现 ${namespaceStr} ${namespaceName} 中的 ${interfStr} 方法 ${methodName}
-IncompatibleOverrideProblem=${overrideStr} 不兼容。
-InterfaceBindablePropertyProblem=${interfStr} 定义中不允许使用 [${bindableStr}]。
-InterfaceCannotBeInstantiatedProblem=不能使用新的运算符对接口进行实例化。
-InterfaceMethodWithBodyProblem=${interfaceStr} 中定义的方法不得含有过程体。
-InterfaceModifierProblem=接口属性 ${modifier} 无效。
-InterfaceNamespaceAttributeProblem=不允许在接口方法中使用 namespace 属性。
-InternalCompilerProblem=内部编译器错误
-InvalidABCByteCodeProblem=ABC 字节代码无效。
-InvalidBackgroundColorProblem=背景颜色 ${backgroundColor} 无效
-InvalidDecrementOperandProblem=减量操作数无效。
-InvalidEscapeSequenceProblem=“${badSequence}”不是有效的转义序列
-InvalidForInInitializerProblem=语法错误: for-in 初始值设定项无效,应该只包含一个表达式。
-InvalidIncrementOperandProblem=增量操作数无效。
-InvalidLvalueProblem=赋值的目标必须是引用值。
-InvalidNamespaceInitializerProblem=命名空间的初始值设定项必须是一个文本字符串或者是另一个命名空间。
-InvalidNamespaceProblem=用户定义的 namespace 属性只能在 ${classStr} 定义的顶级使用。
-InvalidOverrideProblem=${overrideStr} 属性只能用于 ${classStr} 中定义的方法。
-InvalidPrivateNamespaceAttrProblem=${privateStr} 属性只能用于 ${classStr} 属性定义。
-InvalidPrivateNamespaceProblem=${privateStr} 只能用作 ${classStr} 内部的命名空间。
-InvalidProtectedNamespaceAttrProblem=${protectedStr} 属性只能用于 ${classStr} 属性定义。
-InvalidProtectedNamespaceProblem=${protectedStr} 只能用作 ${classStr} 内部的命名空间。
-InvalidPublicNamespaceAttrProblem=${publicStr} 属性只能在 ${packageStr} 的内部使用。
-InvalidPublicNamespaceProblem=${publicStr} 只能用作 ${packageStr} 内部的命名空间。
-InvalidRestParameterDeclarationProblem=在 ...rest 参数定义关键字之后指定的参数只能为 Array 数据类型。
-InvalidSuperExpressionProblem=super 表达式只能在类实例方法内部使用。
-InvalidSuperStatementProblem=super 语句只能在类实例构造函数内部使用。
-JSDataClassMethodError=ERROR: DataClass classes must not declare methods. 
-JSInternalCompilerProblem=Internal compiler error: ${message}. 
-JSUnsupportedFeatureProblem=Unsupported feature: ${feature}. 
-JSWarnClassInitProblem=PERFORMANCE: Avoid loose class initialization statements. Consider using singletons instead.
-JSWarnClosureAdvancedOptimizationsProblem=WARNING: Optimizing with ADVANCED_OPTIMIZATIONS will fail because of accessing properties via unknown strings.
-JSWarnRuntimeNameLookupProblem=PERFORMANCE: Forced to emit expensive runtime name lookup. Consider using strict types instead of generic objects and avoiding dynamic classes.
-LocalBindablePropertyProblem=${funcStr} 定义中不允许使用 [${bindableStr}]。
-LossyConversionProblem=初始化无效: 转换为类型 ${targetType} 时丢失数据。
-MethodCannotBeConstructorProblem=方法不能用作构造函数。
-MissingBuiltinProblem=缺少内置类型 ${builtinType}
-MissingCatchOrFinallyProblem=语法错误: 需要 catch 或 finally 子句。
-MissingFactoryClassInFrameMetadataProblem=此编译单元在 Frame 元数据中未指定 factoryClass,从而无法加载配置的运行时共享库。若要在没有运行时共享库的情况下进行编译,请将 -static-link-runtime-shared-libraries 选项设置为 true,或者删除 -runtime-shared-libraries 选项。
-MissingRequirementConfigurationProblem=未设置配置变量“${required}”
-MissingSignedDigestProblem=在 ${libraryPath} 库的 catalog.xml 中找不到已签名的摘要。
-MissingSkinPartProblem=缺少必要的外观部分“${skinPartName}”。
-MissingSkinStateProblem=缺少必要的外观状态“${skinStateName}”。
-MissingUnsignedDigestProblem=在 ${libraryPath} 库的 catalog.xml 中找不到未签名的摘要。
-MultipleConfigNamespaceDecorationsProblem=定义中不允许有重复的配置命名空间
-MultipleSwitchDefaultsProblem=switch 有多个默认值,但只允许有一个默认值。
-MXMLAttributeVersionProblem=“${name}”属性只能用于 MXML ${version} 或更高版本。将忽略此属性。
-MXMLClassNodeProblem=“${qname}”未指定类或接口。将忽略此属性。
-MXMLDatabindingSourceNotBindableProblem=数据绑定将无法检测对“${sourceName}”的赋值。
-MXMLDuplicateIDProblem=此 ID 不是唯一的。将忽略此 ID。
-MXMLFinalClassProblem=“${qname}”是一个最终类,无法用作根标签。
-MXMLIncludeInAndExcludeFromProblem=无法在此同一标签上指定“includeIn”和“excludeFrom”属性。将忽略这两个属性。
-MXMLIncompatibleArrayElementProblem=类型“${actualType}”的数组元素与“${propertyName}”属性的“${expectedType}”的预期 [ArrayElementType] 不兼容。
-MXMLIncompatibleVectorElementProblem=此元素与 Vector 类型不兼容。将忽略此元素。
-MXMLInvalidEntityProblem=发现未知实体“{entity}”。将忽略此实体。
-MXMLInvalidIDProblem=此 ID 不是有效的 ActionScript 标识符。将忽略此 ID。
-MXMLInvalidItemCreationPolicyProblem=itemCreationPolicy 的有效值为“immediate”或“deferred”。将忽略此属性。
-MXMLInvalidItemDestructionPolicyProblem=itemDestructionPolicy 的有效值为“auto”或“never”。将忽略此属性。
-MXMLInvalidPercentageProblem=“${property}”的初始值设定项: 无效的百分比表达式:“${text}”。
-MXMLInvalidTextForTypeProblem=无法从“${text}”中解析“${type}”类型的值。
-MXMLInvalidVectorFixedAttributeProblem=“fixed”属性必须为“true”或“false”。将忽略此属性。
-MXMLInvalidVectorTypeAttributeProblem=“type”属性未指定已知类。该类型将假定为“*”。
-MXMLMissingRootTagProblem=在此 MXML 文件中未发现根标签。
-MXMLMissingVectorTypeAttributeProblem=<Vector> 标签上需要“type”属性。该类型将假定为“*”。
-MXMLNotAClassProblem=“${qname}”不是一个类。将忽略此标签。
-MXMLOperationMissingNameProblem=操作需要一个 ${name} 属性。
-MXMLOtherLanguageNamespaceProblem=MXML 文档中只能使用一种语言命名空间。将忽略此属性。
-MXMLOuterDocumentAlreadyDeclaredProblem=已声明名为 ${outerDocument} 的属性,与 ${fxComponent} 标签的 ${outerDocument} 冲突。
-MXMLPercentageNotAllowedProblem=“${property}”的初始值设定项: 此处不允许使用百分比:“${text}”。
-MXMLPrivateAttributeProblem=此属性使用一个私有命名空间,因此将忽略此属性。
-MXMLPrivateTagLocationProblem=<Private> 标签必须是文件根标签的最后一个子标签。将忽略此标签。
-MXMLSemanticProblem=在 MXML 的语义分析期间发生内部问题
-MXMLUnexpectedAttributeProblem=此属性为意外属性。将忽略此属性。
-MXMLUnexpectedDatabindingProblem=此数据绑定表达式为意外表达式。将忽略此表达式。
-MXMLUnexpectedTagProblem=此标签为意外标签。将忽略此标签。
-MXMLUnexpectedTextProblem=此文本为意外文本。将忽略此文本。
-MXMLUnrecognizedCompilerDirectiveProblem=函数 ${functionName} 不是可识别的编译时指令
-MXMLUnresolvedTagProblem=无法将此标签解析为 ActionScript 类。将忽略此标签。
-MXMLUnterminatedEntityProblem=发现未终止的实体。将忽略此实体。
-MXMLXMLListMixedContentProblem=此处不允许使用混合内容。
-MXMLXMLOnlyOneRootTagProblem=仅允许一个根标签
-MXMLXMLRequireContentProblem=需要 XML 内容
-NamespaceInInterfaceProblem=不允许在接口中使用命名空间声明。
-NativeMethodWithBodyProblem=本机方法不能包含过程体。
-NativeNotOnFunctionProblem=${nativeStr} 属性只能与 ${functionStr} 定义一起使用。
-NativeUsedInInterfaceProblem=在 ${interfStr} 定义中不能使用 ${nativeStr} 属性。
-NativeVariableProblem=变量不能为 ${nativeStr}。
-NestedGetterSetterProblem=存取器不能嵌套在其他函数中。
-NestedPackageProblem=包不能嵌套。
-NoCompilationUnitForDefinitionProblem=找不到名为“${qname}”的编译单元。
-NoDefaultConstructorInBaseClassProblem=在基类 ${baseClass} 中找不到默认构造函数。
-NoDefinitionForSWCDependencyProblem=在 SWC ${swcFilename} 中找不到依赖的定义 ${qname}
-NoMainDefinitionProblem=找不到名为“${qname}”的外部可见定义。
-NonConstantNamespaceProblem=命名空间的初始值设定项必须是一个文本字符串或者是另一个命名空间。
-NonConstantParamInitializerProblem=参数初始值设定项未知或不是编译时常量。
-NonDirectoryInSourcePathProblem=在源路径中指定了 ${file},它不是一个目录。
-NoScopesInABCCompilationUnitProblem=在编译单元中找不到范围。
-OnlyOneHostComponentAllowedProblem=只允许一个 [HostComponent]。
-OverlappingSourcePathProblem=重叠的源路径条目 ${ancestor} 是 ${descendant} 的祖代
-OverrideFinalProblem=无法重定义 ${finalStr} 方法。
-OverrideNotFoundProblem=标记为 ${overrideStr} 的方法必须覆盖另一方法。
-OverrideOutsideClassProblem=${overrideStr} 属性只能用于 ${classStr} 属性定义。
-PackageCannotBeUsedAsValueProblem=包无法作为值 ${packageName} 使用。
-ParserProblem=内部解析问题
-PropertyIsWriteOnlyProblem=属性 ${name} 为只写。
-PrototypeInvalidAttributeProblem=prototype 属性无效。
-RemovedConfigurationOptionProblem=不再支持“${option}”,该选项无效。
-RequiredParameterAfterOptionalProblem=必选参数不得位于可选参数之后。
-ResourceBundleMalformedEncodingProblem=给定字符串的编码格式 ${string} 不正确
-ResourceBundleNoBundleParameterProblem=没有为 @Resource() 提供 bundle 参数
-ResourceBundleNoKeyParameterProblem=没有为 @Resource() 提供 key 参数
-ResourceBundleNotFoundForLocaleProblem=无法为区域设置“${locale}”解析资源绑定“${bundleName}”
-ResourceBundleNotFoundProblem=无法解析资源绑定“${bundleName}”
-RestParameterMustBeLastProblem=${rest} 参数必须位于最后。
-ReturnCannotBeUsedInGlobalProblem=不能在全局初始化代码中使用返回语句。
-ReturnCannotBeUsedInPackageProblem=不能在包初始化代码中使用返回语句。
-ReturnCannotBeUsedInStaticProblem=不能在静态初始化代码中使用返回语句。
-ReturnMustReturnValueProblem=函数没有返回值。
-ReturnValueMustBeUndefinedProblem=返回值必须未定义。
-SemanticProblem=在语义分析期间发生内部问题
-SetterCannotHaveOptionalProblem=setter 定义不能有可选参数。
-SetterMustHaveOneParameterProblem=setter 定义只能有一个参数。
-SkinPartsMustBePublicProblem=外观部分必须为公共元素。
-StaticAndOverrideProblem=函数不能同时为 ${staticStr} 和 ${overrideStr}。
-StaticNamespaceDefinitionProblem=${namespaceKeyword} 定义中不允许使用 static 属性。
-StaticOutsideClassProblem=${staticStr} 属性只能用于 ${classStr} 内部的定义。
-StrictUndefinedMethodProblem=通过静态类型为 ${className} 的引用来调用的方法 ${methodName} 可能未定义。
-SyntaxProblem=语法错误: 此处不允许使用“${tokenText}”
-ThisUsedInStaticFunctionProblem=静态方法中不能使用 ${thisKeyword} 关键字。它只能用于实例方法、函数结束项和全局代码。
-TooFewFunctionParametersProblem=参数的数量不正确。要求 ${nParams} 个
-TooManyFunctionParametersProblem=参数的数量不正确。要求不超过 ${nParams} 个
-UnableToBuildReportProblem=无法构建报告: ${message}
-UnableToBuildSWFProblem=无法构建 SWF ${file}
-UnableToBuildSWFTagProblem=无法为 ${name} 构建 SWF 标签
-UnableToListFilesProblem=无法列出目录内容: @{directory}
-UnboundMetadataProblem=元数据未绑定到定义
-UndefinedConfigNameProblem=未定义的配置常量:“${configName}”
-UndefinedConfigNamespaceProblem=未定义的配置命名空间:“${configName}”
-UnexpectedExceptionProblem=意外的例外项“${exceptionName}”。
-UnexpectedReturnProblem=此处不能使用返回语句。
-UnexpectedTokenProblem=语法错误: 要求 ${tokenKind} 但获取了“${tokenText}”
-UnfoundPropertyProblem=访问的 ${property} 属性未定义
-UnimplementedInterfaceMethodProblem=${classStr} ${className} 未实现 ${namespaceStr} ${namespaceName} 中的 ${interfStr} 方法 ${methodName}
-UnknownBreakTargetProblem=找不到 break 语句的目标。
-UnknownContinueTargetProblem=找不到 continue 语句的目标。
-UnknownInterfaceProblem=找不到 ${interfaceStr} ${interfaceName}。
-UnknownNamespaceProblem=未知命名空间 ${namespaceName}。
-UnknownSuperclassProblem=找不到基类 ${superclassName} 的定义。
-UnknownTypeProblem=找不到类型或类型不是编译时常量: ${typeName}。
-UnresolvedClassReferenceProblem=找不到定义 ${qname}。
-UnresolvedNamespaceProblem=找不到命名空间或命名空间不是编译时常量。
-UnsupportedSourceFileProblem=${file} 属于不受支持的类型: ${ext}
-VarInInterfaceProblem=${interfStr} 中不允许 ${varStr} 声明。
-VoidTypeProblem=${voidStr} 不是有效类型。
-WrongSkinPartProblem=外观部分类型“${skinPartTypeName}”必须可赋值给“${hostSkinPartTypeName}”。

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_zh_tw.properties
----------------------------------------------------------------------
diff --git a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_zh_tw.properties b/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_zh_tw.properties
deleted file mode 100644
index 4a0fef1..0000000
--- a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_zh_tw.properties
+++ /dev/null
@@ -1,282 +0,0 @@
-################################################################################
-##
-##  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.
-##
-################################################################################
-
-ABCGeneratorProblem=產生 ${sourceFileName} 的程式碼時,ABC 產生器子系統中發生內部錯誤: ${stackTrace}
-AccessorTypesMustMatchProblem=存取子類型必須相符。
-AccessUndefinedMemberProblem=存取可能未定義的屬性 ${memberName} (透過含有靜態類型 ${className} 的參照)。
-AccessUndefinedPropertyInPackageProblem=存取套件 ${packageName} 中未定義的屬性 ${propertyName}。
-AccessUndefinedPropertyProblem=存取可能未定義的屬性 ${propertyName}。
-AmbiguousReferenceProblem=${property} 的模稜兩可參照
-AssignToConstProblem=指定為常數之變數的不合法指定。
-AssignToFunctionProblem=函數 ${funcName} 的不合法指定。
-AssignToReadOnlyPropertyProblem=屬性 ${name} 是唯讀的。
-AttemptToDeleteFixedPropertyProblem=嘗試刪除固定屬性 ${name}。只能刪除動態定義的屬性。
-AttributesAreNotCallableProblem=無法呼叫屬性。
-BadAccessInterfaceMemberProblem=介面成員不能宣告為 public、private、protected 或 internal。
-BadCharacterProblem=未預期的字元錯誤: 這裡不允許使用「${errorText}」
-BadSetterReturnTypeProblem=setter 定義的傳回類型必須為未指定,或是 void。
-BaseClassIsFinalProblem=基底類別為 ${finalStr}。
-BURMDiagnosticForEachExpectedInProblem=如果沒有「${k_in}」運算子,就不允許使用關鍵字「${k_each}」
-BURMDiagnosticInvalidDecrementProblem=遞減運算元必須是參照。
-BURMDiagnosticNotAllowedHereProblem=這裡不允許 ${node}
-BURMPatternMatchFailureProblem=無法產生 ${node} 的程式碼
-BURNDiagnosticInvalidIncrementProblem=遞增運算元必須是參照。
-CallUndefinedMethodProblem=呼叫可能未定義的方法 ${methodName}。
-CannotDeleteSuperDescendantsProblem=無法刪除 super 後代。
-CannotExtendClassProblem=介面只能擴充其它介面,但 ${className} 為類別。
-CannotExtendInterfaceProblem=${classStr} 只能擴充其它 ${classStr},而非 ${interfaceStr}。
-CannotResolveConfigExpressionProblem=無法解析組態常數:「${configName}」
-CircularTypeReferenceProblem=在 ${className} 中偵測到循環類型參照
-ClassesMappedToSameRemoteAliasProblem=處理類別「${className}」時找到遠端類別別名「${alias}」的「${existingClassName}」對應。Flex 現在會產生程式碼,以檢查是否別名已經註冊。當還原序列化遠端資料時,別名只會對應至單一類別。
-ClosureProblem=Closure error.
-CodegenInternalProblem=程式碼產生器內部錯誤: ${diagnostic}
-CompiledAsAComponentProblem=${className} 是直接參照的模組或應用程式。這將導致 ${className} 及其所有相依項與 ${mainDefinition} 連結。建議使用介面以避免這種情形。
-ConfigurationFileNotFoundProblem=找不到組態檔: ${file}
-ConfigurationProblem=組態問題: ${reason}。\n${location}
-ConflictingInheritedNameInNamespaceProblem=與繼承而來的定義 ${declName} (命名空間 ${nsName} 內) 一同存在的衝突。
-ConflictingNameInNamespaceProblem=與定義 ${declName} (命名空間 ${nsName} 內) 一同存在的衝突。
-ConstructorCannotHaveReturnTypeProblem=建構函式不能指定傳回類型
-ConstructorIsGetterSetterProblem=建構函式不可以是 getter 或 setter 方法
-ConstructorIsStaticProblem=建構函數必須是實體方法
-ConstructorMustBePublicProblem=建構函式只能宣告為 ${modifier}
-CountedForLoopInitializerProblem=語法錯誤: rightparen 前面應為分號。
-CSSCodeGenProblem=CSS codegen 問題。原因:「${reason}」
-CSSEmbedAssetProblem=無法內嵌「${embed}」中的資源。
-CSSParserProblem=${reason}
-CSSUndefinedNamespacePrefixProblem=未定義的命名空間前置詞「${prefix}」。
-CSSUndefinedTypeProblem=「${type}」未定義。
-CSSUnknownDefaultNamespaceProblem=無命名空間前置詞的類型選取器要求必須定義預設命名空間。${selectorText}
-CSSUnresolvedClassReferenceProblem=${qname} 未定義。
-CyclicalIncludesProblem=在 ${file} 中找到循環內含
-DependencyNotCompatibleProblem=${swc} 中的相依項 ${definition} 最低支援 ${swcMinimumVersion} 版本,此版本高於相容版本 ${compatibilityVersion}。
-DeprecatedConfigurationOptionProblem=「${option}」已不建議使用 (從 ${since} 開始)。請使用「${replacement}」。
-DuplicateAttributeProblem=多次指定了屬性 ${attrStr}。
-DuplicateClassDefinitionProblem=重製類別定義: ${className}。
-DuplicateConfigNameProblem=重製組態命名空間:「${configName}」
-DuplicateFunctionDefinitionProblem=重製函數定義: ${methodName}
-DuplicateInterfaceDefinitionProblem=重製介面定義: ${interfaceName}。
-DuplicateInterfaceProblem=${classStr} ${className} 多次實作 ${interfaceStr} ${interfaceName}。
-DuplicateLabelProblem=重製標籤定義。
-DuplicateNamespaceDefinitionProblem=重製命名空間定義。
-DuplicateQNameInSourcePathProblem=${qName} 是由多個檔案所定義: ${fileList}
-DuplicateSkinStateProblem=重製 SkinState「${name}」的宣告
-DuplicateSourceFileProblem=${file} 已在包含的來源清單中指定一次以上。
-DuplicateSourcePathProblem=${directory} 已在來源路徑中指定一次以上。
-DuplicateSwitchCaseProblem=重製替代 switch ${caseName}。
-DynamicNotOnClassProblem=${dynamicStr} 屬性只能與 ${classStr} 定義搭配使用。
-EmbedAS2TagsModifiedProblem=AS2 動作已從 ${symbol} 標籤中移除。
-EmbedBadFontParameters=字體轉碼要求您必須指定「fontName」以及「source」、「systemFont」或「sourceList」其中一個
-EmbedBadScalingGridTargetProblem=無法縮放元件 ${symbol},因為它不是 Sprite 類型
-EmbedCouldNotDetermineSampleFrameCountProblem=無法判斷檔案 ${filename} 中的取樣影格計數
-EmbeddedFontShadowsDeviceFontProblem=內嵌的字體「${alias}」可能會遮蔽相同名稱的裝置字體。請使用 fontName 將字體命名為不同名稱
-EmbedExceptionWhileTranscodingProblem=轉碼期間發生例外狀況: ${exception}
-EmbedInitialValueProblem=Embed 變數不能使用現有值。
-EmbedInvalidAttributeValueProblem=值 ${value} 對屬性 ${attribute} 無效
-EmbedInvalidUnicodeRangeProblem=無效的 Unicode 範圍「${range}」
-EmbedMissingSymbolProblem=在檔案 ${swf} 中找不到元件 ${symbol}
-EmbedMovieScalingNoSymbolProblem=指定縮放內嵌影片時的元件
-EmbedMultipleMetaTagsProblem=變數只能有一個內嵌中繼資料標籤
-EmbedNoSkinClassProblem=內嵌外觀資源時必須指定 skinClass 屬性
-EmbedNoSourceAttributeProblem=內嵌需要原始檔案屬性
-EmbedQualityRequiresCompressionProblem=壓縮停用時,不要指定 ${quality}
-EmbedQualityValueProblem=值 ${value} 對 ${quality} 屬性無效,必須介於 0.0 到 100.0 之間
-EmbedScalingGridProblem=屬性 scaleBottom、scaleLeft、scaleRight 和 scaleTop 必須一起指定
-EmbedScalingGridValueProblem=屬性 ${attr} 的縮放值 ${value} 必須大於 0
-EmbedSkinClassNotFoundProblem=找不到類別 ${skinClass}
-EmbedSourceAttributeCouldNotBeReadProblem=無法讀取內嵌原始檔案 ${filename}
-EmbedSourceAttributeDoesNotExistProblem=找不到內嵌原始檔案
-EmbedSourceFileNotFoundProblem=找不到內嵌原始檔案: ${file}
-EmbedTypeNotEmbeddableProblem=無法內嵌類型 ${typeName}
-EmbedUnableToBuildFontProblem=無法建立字體「${fontName}」
-EmbedUnableToReadSourceProblem=無法讀取轉碼來源「${source}」
-EmbedUnknownAttributeProblem=未知的屬性: ${attr}
-EmbedUnknownMimeTypeProblem=未處理的 MIME 類型 ${mimeType}
-EmbedUnrecogniedFileTypeProblem=檔案 ${file} 是不可內嵌的未知檔案類型
-EmbedUnsupportedAttributeProblem=屬性 ${attribute} 無法與 MIME 類型 ${mimeType} 搭配使用
-EmbedUnsupportedSamplingRateProblem=檔案 ${filename} 中不支援頻率 ${frequency}
-FileNotFoundProblem=找不到檔案: ${file}
-FinalOutsideClassProblem=屬性 ${finalStr} 只能用在 ${classStr} 中所定義的方法中。
-FunctionNotMarkedOverrideProblem=覆寫沒有標記為 ${overrideStr} 的 ${funcStr}
-FunctionWithoutBodyProblem=函數沒有主體。
-FXGCompilerProblem=FXG 編譯問題: ${message}
-GetterCannotHaveParametersProblem=getter 定義不能有參數。
-GlobalBindablePropertyProblem=全域或 ${packageStr} 變數中不允許 [${bindableStr}]
-HostComponentClassNotFoundProblem=找不到 [HostComponent] 類別「${className}」。
-HostComponentMustHaveTypeProblem=[HostComponent] 必須指定類型名稱。
-IllegalAssignmentToClassProblem=類別 ${className} 的不合法指定。
-ImplicitCoercionToSubtypeProblem=將靜態類型 ${baseType} 的值隱含強制至可能不相關的類型 ${subType}。
-ImplicitCoercionToUnrelatedTypeProblem=將類型 ${actualType} 的值隱含強制至不相關的類型 ${expectedType}。
-InaccessibleMethodReferenceProblem=嘗試存取無法存取的方法 ${methodName} (透過含有靜態類型 ${className} 的參照)。
-InaccessiblePropertyReferenceProblem=嘗試存取無法存取的屬性 ${propertyName} (透過含有靜態類型 ${className} 的參照)。
-IncompatibleDefaultValueProblem=類型 ${srcType} 的不相容預設值,應為 ${tgtType}。
-IncompatibleInterfaceMethodProblem=${namespaceStr} ${namespaceName} 中的 ${interfStr} 方法 ${methodName} 是以 ${classStr} ${className} 中不相容的簽名實作
-IncompatibleOverrideProblem=不相容的 ${overrideStr}。
-InterfaceBindablePropertyProblem=${interfStr} 定義內不允許有 [${bindableStr}]。
-InterfaceCannotBeInstantiatedProblem=介面不能使用新的運算子來實體化。
-InterfaceMethodWithBodyProblem=在 ${interfaceStr} 中定義的方法不能有主體。
-InterfaceModifierProblem=Interface 屬性 ${modifier} 無效。
-InterfaceNamespaceAttributeProblem=介面方法中不允許 Namespace 屬性。
-InternalCompilerProblem=內部編譯器錯誤
-InvalidABCByteCodeProblem=無效的 ABC 位元組程式碼。
-InvalidBackgroundColorProblem=無效的背景顏色: ${backgroundColor}
-InvalidDecrementOperandProblem=遞減運算元無效。
-InvalidEscapeSequenceProblem=「${badSequence}」不是有效的逸出序列
-InvalidForInInitializerProblem=語法錯誤: for-in 初始設定式無效,應只有一個運算式。
-InvalidIncrementOperandProblem=遞增運算元無效。
-InvalidLvalueProblem=指定的目標必須是參照值。
-InvalidNamespaceInitializerProblem=命名空間初始設定式必須是字串常值或其它命名空間。
-InvalidNamespaceProblem=使用者定義的命名空間屬性只能用在 ${classStr} 定義的最上層。
-InvalidOverrideProblem=${overrideStr} 屬性只能用在 ${classStr} 中所定義的方法上。
-InvalidPrivateNamespaceAttrProblem=${privateStr} 屬性只能用在 ${classStr} 屬性定義中。
-InvalidPrivateNamespaceProblem=${privateStr} 只能當作 ${classStr} 內的命名空間使用。
-InvalidProtectedNamespaceAttrProblem=${protectedStr} 屬性只能用在 ${classStr} 屬性定義中。
-InvalidProtectedNamespaceProblem=${protectedStr} 只能當作 ${classStr} 內的命名空間使用。
-InvalidPublicNamespaceAttrProblem=${publicStr} 屬性只能用在 ${packageStr} 中。
-InvalidPublicNamespaceProblem=${publicStr} 只能當作 ${packageStr} 內的命名空間使用。
-InvalidRestParameterDeclarationProblem=在 ...rest 參數定義關鍵字後指定的參數只能為資料類型 Array。
-InvalidSuperExpressionProblem=super 運算式只能用在類別實體方法中。
-InvalidSuperStatementProblem=super 陳述式只能用在類別實體建構函式中。
-JSDataClassMethodError=ERROR: DataClass classes must not declare methods. 
-JSInternalCompilerProblem=Internal compiler error: ${message}. 
-JSUnsupportedFeatureProblem=Unsupported feature: ${feature}. 
-JSWarnClassInitProblem=PERFORMANCE: Avoid loose class initialization statements. Consider using singletons instead.
-JSWarnClosureAdvancedOptimizationsProblem=WARNING: Optimizing with ADVANCED_OPTIMIZATIONS will fail because of accessing properties via unknown strings.
-JSWarnRuntimeNameLookupProblem=PERFORMANCE: Forced to emit expensive runtime name lookup. Consider using strict types instead of generic objects and avoiding dynamic classes.
-LocalBindablePropertyProblem=${funcStr} 定義內不允許有 [${bindableStr}]。
-LossyConversionProblem=初始化無效: 轉換成類型 ${targetType} 將遺失資料。
-MethodCannotBeConstructorProblem=方法不可以當作建構函式。
-MissingBuiltinProblem=遺失內建類型 ${builtinType}
-MissingCatchOrFinallyProblem=語法錯誤: 應為 catch 或 finally 子句。
-MissingFactoryClassInFrameMetadataProblem=此編譯單位未在影格中繼資料中指定 factoryClass,此指定是用來載入設定的執行階段共用元件庫。若要在沒有執行階段共用元件庫的情況下進行編譯,請將 -static-link-runtime-shared-libraries 選項設定為 true,或者移除 -runtime-shared-libraries 選項。
-MissingRequirementConfigurationProblem=組態變數「${required}」未設定
-MissingSignedDigestProblem=在元件庫 ${libraryPath} 的 catalog.xml 中找不到簽署的摘要。
-MissingSkinPartProblem=必要的外觀部件「${skinPartName}」遺失。
-MissingSkinStateProblem=必要的外觀狀態「${skinStateName}」遺失。
-MissingUnsignedDigestProblem=在元件庫 ${libraryPath} 的 catalog.xml 中找不到未簽署的摘要。
-MultipleConfigNamespaceDecorationsProblem=定義中不允許重複的組態命名空間
-MultipleSwitchDefaultsProblem=switch 具有一個以上的預設值,但只允許一個預設值。
-MXMLAttributeVersionProblem=「${name}」屬性只能用在 MXML ${version} 或更新版本中。將予以忽略。
-MXMLClassNodeProblem=「${qname}」未指定類別或介面。將予以忽略。
-MXMLDatabindingSourceNotBindableProblem=資料繫結將無法偵測「${sourceName}」的指定。
-MXMLDuplicateIDProblem=此 ID 不是唯一的。將予以忽略。
-MXMLFinalClassProblem=「${qname}」是最終類別,不可當作根標籤使用。
-MXMLIncludeInAndExcludeFromProblem=「includeIn」和「excludeFrom」屬性不可在此相同標籤上指定,將忽略它們。
-MXMLIncompatibleArrayElementProblem=類型「${actualType}」的陣列元素與「${propertyName}」屬性之「${expectedType}」的預期 [ArrayElementType] 不相容。
-MXMLIncompatibleVectorElementProblem=此元素與 Vector 類型不相容。將予以忽略。
-MXMLInvalidEntityProblem=找到未知的實體「{entity}」。將予以忽略。
-MXMLInvalidIDProblem=此 ID 不是有效的 ActionScript 識別名稱。將予以忽略。
-MXMLInvalidItemCreationPolicyProblem=itemCreationPolicy 的有效值為「immediate」或「deferred」。將忽略此屬性。
-MXMLInvalidItemDestructionPolicyProblem=itemDestructionPolicy 的有效值為「auto」或「never」。將忽略此屬性。
-MXMLInvalidPercentageProblem=「${property}」的初始設定式: 無效的百分比運算式:「${text}」。
-MXMLInvalidTextForTypeProblem=無法剖析「${text}」中類型「${type}」的值。
-MXMLInvalidVectorFixedAttributeProblem=「fixed」屬性必須是「true」或「false」。將予以忽略。
-MXMLInvalidVectorTypeAttributeProblem=「type」屬性未指定已知的類別。將假設類型為「*」。
-MXMLMissingRootTagProblem=在此 MXML 檔案中找不到根標籤。
-MXMLMissingVectorTypeAttributeProblem=<Vector> 標籤需要「type」屬性。將假設類型為「*」。
-MXMLNotAClassProblem=「${qname}」不是類別。將忽略此標籤。
-MXMLOperationMissingNameProblem=操作需要 ${name} 屬性。
-MXMLOtherLanguageNamespaceProblem=MXML 文件中只能使用一個語言命名空間。將忽略此屬性。
-MXMLOuterDocumentAlreadyDeclaredProblem=已經宣告名為 ${outerDocument} 的屬性,其與 ${fxComponent} 標籤 ${outerDocument} 衝突。
-MXMLPercentageNotAllowedProblem=「${property}」的初始設定式: 這裡不允許使用百分比:「${text}」。
-MXMLPrivateAttributeProblem=此屬性使用私有命名空間,因此,將予以忽略。
-MXMLPrivateTagLocationProblem=<Private> 標籤必須是檔案根標籤的最後一個子標籤。將予以忽略。
-MXMLSemanticProblem=進行 MXML 語意分析期間發生內部問題
-MXMLUnexpectedAttributeProblem=這不是預期的屬性。將予以忽略。
-MXMLUnexpectedDatabindingProblem=這不是預期的資料繫結運算式。將予以忽略。
-MXMLUnexpectedTagProblem=這不是預期的標籤。將予以忽略。
-MXMLUnexpectedTextProblem=這不是預期的文字。將予以忽略。
-MXMLUnrecognizedCompilerDirectiveProblem=函數 ${functionName} 不是可辨識的編譯階段指令
-MXMLUnresolvedTagProblem=無法將此標籤解析為 ActionScript 類別。將予以忽略。
-MXMLUnterminatedEntityProblem=找到未結束的實體。將予以忽略。
-MXMLXMLListMixedContentProblem=這裡不允許使用混合的內容。
-MXMLXMLOnlyOneRootTagProblem=只允許有一個根標籤
-MXMLXMLRequireContentProblem=需要 XML 內容
-NamespaceInInterfaceProblem=介面中不允許命名空間宣告。
-NativeMethodWithBodyProblem=原生方法不能有主體。
-NativeNotOnFunctionProblem=${nativeStr} 屬性只能與 ${functionStr} 定義搭配使用。
-NativeUsedInInterfaceProblem=${nativeStr} 屬性不能用在 ${interfStr} 定義中。
-NativeVariableProblem=變數不可以是 ${nativeStr}。
-NestedGetterSetterProblem=存取子不能以巢狀方式放在其它函數內部。
-NestedPackageProblem=套件不可以是巢狀。
-NoCompilationUnitForDefinitionProblem=找不到名為「${qname}」的編譯單位。
-NoDefaultConstructorInBaseClassProblem=基底類別 ${baseClass} 中沒有預設的建構函式。
-NoDefinitionForSWCDependencyProblem=找不到相依於 SWC ${swcFilename} 的定義 ${qname}
-NoMainDefinitionProblem=找不到名為「${qname}」、外部可見的定義。
-NonConstantNamespaceProblem=命名空間初始設定式必須是字串常值或其它命名空間。
-NonConstantParamInitializerProblem=參數初始設定式為未知,或者不是編譯階段常數。
-NonDirectoryInSourcePathProblem=${file} 已在來源路徑中指定,並且不是目錄。
-NoScopesInABCCompilationUnitProblem=在編譯單位中找不到範圍。
-OnlyOneHostComponentAllowedProblem=只允許一個 [HostComponent]。
-OverlappingSourcePathProblem=重疊來源路徑項目: ${ancestor} 是 ${descendant} 的祖系
-OverrideFinalProblem=無法重新定義 ${finalStr} 方法。
-OverrideNotFoundProblem=標記為 ${overrideStr} 的方法必須覆寫另一個方法。
-OverrideOutsideClassProblem=${overrideStr} 屬性只能用在 ${classStr} 屬性定義中。
-PackageCannotBeUsedAsValueProblem=套件不可以當作值: ${packageName}。
-ParserProblem=內部剖析問題
-PropertyIsWriteOnlyProblem=屬性 ${name} 是唯寫的。
-PrototypeInvalidAttributeProblem=prototype 屬性無效。
-RemovedConfigurationOptionProblem=「${option}」不再受支援,將不會發生作用。
-RequiredParameterAfterOptionalProblem=必要的參數不可以放在選擇性參數後面。
-ResourceBundleMalformedEncodingProblem=指定之字串的編碼格式錯誤: ${string}
-ResourceBundleNoBundleParameterProblem=未提供組合包參數給 @Resource()
-ResourceBundleNoKeyParameterProblem=未提供索引鍵參數給 @Resource()
-ResourceBundleNotFoundForLocaleProblem=無法解析地區「${locale}」的資源組合包「${bundleName}」
-ResourceBundleNotFoundProblem=無法解析資源組合包「${bundleName}」
-RestParameterMustBeLastProblem=${rest} 參數必須是最後一個。
-ReturnCannotBeUsedInGlobalProblem=傳回陳述式不能用在全域初始化程式碼中。
-ReturnCannotBeUsedInPackageProblem=傳回陳述式不能用在套件初始化程式碼中。
-ReturnCannotBeUsedInStaticProblem=傳回陳述式不能用在靜態初始化程式碼中。
-ReturnMustReturnValueProblem=函數未傳回值。
-ReturnValueMustBeUndefinedProblem=傳回值必須為未定義。
-SemanticProblem=語意分析期間發生內部問題
-SetterCannotHaveOptionalProblem=setter 定義不能含有選擇性參數。
-SetterMustHaveOneParameterProblem=setter 定義必須剛好有一個參數。
-SkinPartsMustBePublicProblem=外觀部件必須是公用的。
-StaticAndOverrideProblem=函數不可以同時為 ${staticStr} 和 ${overrideStr}。
-StaticNamespaceDefinitionProblem=${namespaceKeyword} 定義不允許 static 屬性。
-StaticOutsideClassProblem=${staticStr} 屬性只能用在 ${classStr} 中的定義。
-StrictUndefinedMethodProblem=呼叫可能未定義的方法 ${methodName} (透過含有靜態類型 ${className} 的參照)。
-SyntaxProblem=語法錯誤: 這裡不允許使用「${tokenText}」
-ThisUsedInStaticFunctionProblem=關鍵字 ${thisKeyword} 不可以用在靜態方法中。它只能用在實體方法、函數結束項和全域程式碼中。
-TooFewFunctionParametersProblem=引數數目不正確。應為 ${nParams}
-TooManyFunctionParametersProblem=引數數目不正確。不能超過 ${nParams}
-UnableToBuildReportProblem=無法建立報表: ${message}
-UnableToBuildSWFProblem=無法建立 SWF ${file}
-UnableToBuildSWFTagProblem=無法建立 ${name} 的 SWF 標籤
-UnableToListFilesProblem=無法列出目錄內容: @{directory}
-UnboundMetadataProblem=中繼資料未繫結至定義
-UndefinedConfigNameProblem=未定義的組態常數:「${configName}」
-UndefinedConfigNamespaceProblem=未定義的組態命名空間:「${configName}」
-UnexpectedExceptionProblem=未預期的例外狀況「${exceptionName}」。
-UnexpectedReturnProblem=這裡不能使用傳回陳述式。
-UnexpectedTokenProblem=語法錯誤: 需要 ${tokenKind} 但收到「${tokenText}」
-UnfoundPropertyProblem=存取未定義的屬性 ${property}
-UnimplementedInterfaceMethodProblem=${namespaceStr} ${namespaceName} 中的 ${interfStr} 方法 ${methodName} 未由 ${classStr} ${className} 實作
-UnknownBreakTargetProblem=找不到 break 陳述式的目標。
-UnknownContinueTargetProblem=找不到 continue 陳述式的目標。
-UnknownInterfaceProblem=找不到 ${interfaceStr} ${interfaceName}。
-UnknownNamespaceProblem=未知的命名空間 ${namespaceName}。
-UnknownSuperclassProblem=找不到基底類別 ${superclassName} 的定義。
-UnknownTypeProblem=找不到類型,或者類型不是編譯階段常數: ${typeName}。
-UnresolvedClassReferenceProblem=找不到定義 ${qname}。
-UnresolvedNamespaceProblem=找不到命名空間,或者命名空間不是編譯階段常數。
-UnsupportedSourceFileProblem=${file} 不是支援的類型: ${ext}
-VarInInterfaceProblem=${interfStr} 中不允許 ${varStr} 宣告。
-VoidTypeProblem=${voidStr} 不是有效的類型。
-WrongSkinPartProblem=外觀部件類型「${skinPartTypeName}」必須可指定給「${hostSkinPartTypeName}」。

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/clients/JSCommandLineConfiguration.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/clients/JSCommandLineConfiguration.java b/compiler.js/src/org/apache/flex/compiler/clients/JSCommandLineConfiguration.java
deleted file mode 100644
index 6e6d6c9..0000000
--- a/compiler.js/src/org/apache/flex/compiler/clients/JSCommandLineConfiguration.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- *
- *  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.clients;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.flex.compiler.config.Configuration;
-import org.apache.flex.compiler.config.ConfigurationValue;
-import org.apache.flex.compiler.exceptions.ConfigurationException.CannotOpen;
-import org.apache.flex.compiler.internal.as.codegen.JSSharedData;
-import org.apache.flex.compiler.internal.config.annotations.Arguments;
-import org.apache.flex.compiler.internal.config.annotations.Config;
-import org.apache.flex.compiler.internal.config.annotations.InfiniteArguments;
-import org.apache.flex.compiler.internal.config.annotations.Mapping;
-
-import com.google.common.collect.ImmutableList;
-
-public class JSCommandLineConfiguration extends Configuration
-{
-    //
-    // js-builtin
-    //
-
-    public String getJsBuiltin()
-    {
-        return JSSharedData.BUILT_IN;
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-builtin")
-    @Arguments("name")
-    public void setJsBuiltin(ConfigurationValue cv, String name)
-    {
-        JSSharedData.BUILT_IN = name;
-    }
-
-    //
-    // js-framework
-    //
-
-    public String getJsFramework()
-    {
-        return JSSharedData.FRAMEWORK_CLASS;
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-framework")
-    @Arguments("name")
-    public void setJsFramework(ConfigurationValue cv, String name)
-    {
-        if (name.equals("jquery"))
-        {
-            JSSharedData.FRAMEWORK_CLASS = "browser.JQueryFramework";
-        }
-        else if (name.equals("goog") || name.equals("closure") || name.equals("google"))
-        {
-            JSSharedData.FRAMEWORK_CLASS = "browser.ClosureFramework";
-        }
-        else if (name.equals("none"))
-        {
-            JSSharedData.FRAMEWORK_CLASS = "browser.NoFramework";
-        }
-        else
-        {
-            JSSharedData.FRAMEWORK_CLASS = name;
-        }
-    }
-
-    //
-    // js-main
-    //
-
-    public String getJsMain()
-    {
-        return JSSharedData.MAIN;
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-main")
-    @Arguments("name")
-    public void setJsMain(ConfigurationValue cv, String name)
-    {
-        JSSharedData.MAIN = name;
-    }
-
-    //
-    // js-no-exports
-    //
-
-    public String getJsNoExports()
-    {
-        return JSSharedData.NO_EXPORTS ? "true" : "false";
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-no-exports")
-    @Arguments("value")
-    public void setJsNoExports(ConfigurationValue cv, String value)
-    {
-        JSSharedData.NO_EXPORTS = value.equals("true") ? true : false;
-    }
-
-    //
-    // js-no-timestamps 
-    //
-
-    public String getJsNoTimestamps()
-    {
-        return JSSharedData.OUTPUT_TIMESTAMPS ? "false" : "true";
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-no-timestamps")
-    @Arguments("value")
-    public void setJsNoTimestamps(ConfigurationValue cv, String value)
-    {
-        JSSharedData.OUTPUT_TIMESTAMPS = value.equals("false") ? true : false;
-    }
-
-    //
-    // js-isolated 
-    //
-
-    public String getJsIsolated()
-    {
-        return JSSharedData.OUTPUT_ISOLATED ? "true" : "false";
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-isolated")
-    @Arguments("value")
-    public void setJsIsolated(ConfigurationValue cv, String value)
-    {
-        JSSharedData.OUTPUT_ISOLATED = value.equals("true") ? true : false;
-    }
-
-    //
-    // js-generate-test-case 
-    //
-
-    public String getJsGenerateTestCase()
-    {
-        return JSSharedData.GENERATE_TEST_CASE ? "true" : "false";
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-generate-test-case")
-    @Arguments("value")
-    public void setJsGenerateTestCase(ConfigurationValue cv, String value)
-    {
-        JSSharedData.GENERATE_TEST_CASE = value.equals("true") ? true : false;
-    }
-
-    //
-    // js-warn-performance-loss
-    //
-
-    public String getJsWarnPerformanceLoss()
-    {
-        return JSSharedData.WARN_PERFORMANCE_LOSS ? "true" : "false";
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-warn-performance-loss")
-    @Arguments("value")
-    public void setJsWarnPerformanceLoss(ConfigurationValue cv, String value)
-    {
-        JSSharedData.WARN_PERFORMANCE_LOSS = value.equals("true") ? true : false;
-    }
-
-    //
-    // js-warn-runtime-name-lookup
-    //
-
-    public String getJsRuntimeNameLookup()
-    {
-        return JSSharedData.WARN_RUNTIME_NAME_LOOKUP ? "true" : "false";
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-warn-runtime-name-lookup")
-    @Arguments("value")
-    public void setJsRuntimeNameLookup(ConfigurationValue cv, String value)
-    {
-        JSSharedData.WARN_RUNTIME_NAME_LOOKUP = value.equals("true") ? true : false;
-    }
-
-    //
-    // js-warn-class-init
-    //
-
-    public String getJsWarnClassInit()
-    {
-        return JSSharedData.WARN_CLASS_INIT ? "true" : "false";
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-warn-class-init")
-    @Arguments("value")
-    public void setJsWarnClassInit(ConfigurationValue cv, String value)
-    {
-        JSSharedData.WARN_CLASS_INIT = value.equals("true") ? true : false;
-    }
-
-    //
-    // js-extend-dom
-    //
-
-    public String getJsExtendDom()
-    {
-        return JSSharedData.EXTEND_DOM ? "true" : "false";
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-extend-dom")
-    @Arguments("value")
-    public void setJsExtendDom(ConfigurationValue cv, String value)
-    {
-        JSSharedData.EXTEND_DOM = value.equals("true") ? true : false;
-    }
-
-    //
-    // js-closure-compilation-level 
-    //
-    public String getJsClosureCompilationLevel()
-    {
-        return JSSharedData.CLOSURE_compilation_level;
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-closure-compilation-level")
-    @Arguments("value")
-    public void setJsClosureCompilationLevel(ConfigurationValue cv, String value)
-    {
-        JSSharedData.CLOSURE_compilation_level = value;
-    }
-
-    //
-    // js-closure-externs 
-    //
-    public List<String> getJsClosureExterns()
-    {
-        return JSSharedData.CLOSURE_externs;
-    }
-
-    @Config(allowMultiple = true, isPath = true)
-    @Mapping({"js-closure-externs"})
-    @Arguments(Arguments.PATH_ELEMENT)
-    @InfiniteArguments
-    public void setJsClosureExterns(ConfigurationValue cv, String[] pathlist) throws CannotOpen
-    {
-        final ImmutableList<String> resolvedPaths = expandTokens(
-                Arrays.asList(pathlist),
-                getCompilerLocales(),
-                cv);
-        if (JSSharedData.CLOSURE_externs == null)
-            JSSharedData.CLOSURE_externs = new ArrayList<String>();
-        JSSharedData.CLOSURE_externs.addAll(resolvedPaths);
-    }
-
-    //
-    // js-closure-js 
-    //
-    public List<String> getJsClosureJs()
-    {
-        return JSSharedData.CLOSURE_js;
-    }
-
-    @Config(allowMultiple = true, isPath = true)
-    @Mapping({"js-closure-js"})
-    @Arguments(Arguments.PATH_ELEMENT)
-    @InfiniteArguments
-    public void setJsClosureJs(ConfigurationValue cv, String[] pathlist) throws CannotOpen
-    {
-        final ImmutableList<String> resolvedPaths = expandTokens(
-                Arrays.asList(pathlist),
-                getCompilerLocales(),
-                cv);
-        if (JSSharedData.CLOSURE_js == null)
-            JSSharedData.CLOSURE_js = new ArrayList<String>();
-        JSSharedData.CLOSURE_js.addAll(resolvedPaths);
-    }
-
-    //
-    // js-closure-create-source-map 
-    //
-    public String getJsClosureCreateSourceMap()
-    {
-        return JSSharedData.CLOSURE_create_source_map;
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-closure-create-source-map")
-    @Arguments("value")
-    public void setJsClosureCreateSourceMap(ConfigurationValue cv, String value)
-    {
-        JSSharedData.CLOSURE_create_source_map = value;
-    }
-
-    //
-    // js-closure-formatting 
-    //
-    public String getJsClosureFormatting()
-    {
-        return JSSharedData.CLOSURE_formatting;
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-closure-formatting")
-    @Arguments("value")
-    public void setJsClosureFormatting(ConfigurationValue cv, String value)
-    {
-        JSSharedData.CLOSURE_formatting = value;
-    }
-
-    //
-    // keep-generated-actionscript 
-    //
-
-    public String getJsKeepGeneratedJavaScript()
-    {
-        return JSSharedData.KEEP_GENERATED_AS ? "true" : "false";
-    }
-
-    @Config(advanced = true)
-    @Mapping("js-keep-generated-javascript")
-    @Arguments("value")
-    public void setJsKeepGeneratedJavaScript(ConfigurationValue cv, String value)
-    {
-        JSSharedData.KEEP_GENERATED_AS = value.equals("true") ? true : false;
-    }
-
-    public Boolean keepGeneratedJavaScript()
-    {
-        return JSSharedData.KEEP_GENERATED_AS;
-    }
-}


[27/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestStatements.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestStatements.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestStatements.java
new file mode 100644
index 0000000..00bfece
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestStatements.java
@@ -0,0 +1,469 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IIfNode;
+import org.apache.flex.compiler.tree.as.ISwitchNode;
+import org.apache.flex.compiler.tree.as.IThrowNode;
+import org.apache.flex.compiler.tree.as.ITryNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.tree.as.IWhileLoopNode;
+import org.apache.flex.compiler.tree.as.IWithNode;
+import org.junit.Test;
+
+/**
+ * @author Michael Schmalle
+ */
+public class TestStatements extends ASTestBase
+{
+    //--------------------------------------------------------------------------
+    // if
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    // var declaration
+    //----------------------------------
+
+    @Test
+    public void testVarDeclaration()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:*");
+    }
+
+    @Test
+    public void testVarDeclaration_withType()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a:int;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:int");
+    }
+
+    @Test
+    public void testVarDeclaration_withTypeAssignedValue()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a:int = 42;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:int = 42");
+    }
+
+    @Test
+    public void testVarDeclaration_withTypeAssignedValueComplex()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "var a:Foo = new Foo(42, 'goo');", IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:Foo = new Foo(42, 'goo')");
+    }
+
+    @Test
+    public void testVarDeclaration_withList()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "var a:int = 4, b:int = 11, c:int = 42;", IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var a:int = 4, b:int = 11, c:int = 42");
+    }
+
+    //----------------------------------
+    // const declaration
+    //----------------------------------
+
+    @Test
+    public void testConstDeclaration()
+    {
+        IVariableNode node = (IVariableNode) getNode("const a = 42;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("const a:* = 42");
+    }
+
+    @Test
+    public void testConstDeclaration_withType()
+    {
+        IVariableNode node = (IVariableNode) getNode("const a:int = 42;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("const a:int = 42");
+    }
+
+    @Test
+    public void testConstDeclaration_withList()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "const a:int = 4, b:int = 11, c:int = 42;", IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("const a:int = 4, b:int = 11, c:int = 42");
+    }
+
+    //----------------------------------
+    // if ()
+    //----------------------------------
+
+    @Test
+    public void testVisitIf_1()
+    {
+        IIfNode node = (IIfNode) getNode("if (a) b++;", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a)\n\tb++;");
+    }
+
+    @Test
+    public void testVisitIf_2()
+    {
+        IIfNode node = (IIfNode) getNode("if (a) b++; else c++;", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a)\n\tb++;\nelse\n\tc++;");
+    }
+
+    @Test
+    public void testVisitIf_4()
+    {
+        IIfNode node = (IIfNode) getNode(
+                "if (a) b++; else if (c) d++; else if(e) --f;", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a)\n\tb++;\nelse if (c)\n\td++;\nelse if (e)\n\t--f;");
+    }
+
+    //----------------------------------
+    // if () { }
+    //----------------------------------
+
+    @Test
+    public void testVisitIf_1a()
+    {
+        IIfNode node = (IIfNode) getNode("if (a) { b++; }", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a) {\n\tb++;\n}");
+    }
+
+    @Test
+    public void testVisitIf_1b()
+    {
+        IIfNode node = (IIfNode) getNode("if (a) { b++; } else { c++; }",
+                IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a) {\n\tb++;\n} else {\n\tc++;\n}");
+    }
+
+    @Test
+    public void testVisitIf_1c()
+    {
+        IIfNode node = (IIfNode) getNode(
+                "if (a) { b++; } else if (b) { c++; } else { d++; }",
+                IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a) {\n\tb++;\n} else if (b) {\n\tc++;\n} else {\n\td++;\n}");
+    }
+
+    @Test
+    public void testVisitIf_3()
+    {
+        IIfNode node = (IIfNode) getNode(
+                "if (a) b++; else if (c) d++; else --e;", IIfNode.class);
+        asBlockWalker.visitIf(node);
+        assertOut("if (a)\n\tb++;\nelse if (c)\n\td++;\nelse\n\t--e;");
+    }
+
+    //----------------------------------
+    // for () { }
+    //----------------------------------
+
+    @Test
+    public void testVisitFor_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int = 0; i < len; i++) { break; }",
+                IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var i:int = 0; i < len; i++) {\n\tbreak;\n}");
+    }
+
+    @Test
+    public void testVisitFor_1b()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int = 0; i < len; i++) break;", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var i:int = 0; i < len; i++)\n\tbreak;");
+    }
+
+    @Test
+    public void testVisitFor_2()
+    {
+        IForLoopNode node = (IForLoopNode) getNode("for (;;) { break; }",
+                IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (;;) {\n\tbreak;\n}");
+    }
+
+    @Test
+    public void testVisitForIn_1()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int in obj) { break; }", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var i:int in obj) {\n\tbreak;\n}");
+    }
+
+    @Test
+    public void testVisitForIn_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for (var i:int in obj)  break; ", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var i:int in obj)\n\tbreak;");
+    }
+
+    @Test
+    public void testVisitForEach_1()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for each(var i:int in obj) { break; }", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for each (var i:int in obj) {\n\tbreak;\n}");
+    }
+
+    @Test
+    public void testVisitForEach_1a()
+    {
+        IForLoopNode node = (IForLoopNode) getNode(
+                "for each(var i:int in obj)  break; ", IForLoopNode.class);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for each (var i:int in obj)\n\tbreak;");
+    }
+
+    //----------------------------------
+    // while () { }
+    //----------------------------------
+
+    @Test
+    public void testVisitWhileLoop_1()
+    {
+        IWhileLoopNode node = (IWhileLoopNode) getNode(
+                "while(a > b){a++;--b;}", IWhileLoopNode.class);
+        asBlockWalker.visitWhileLoop(node);
+        assertOut("while (a > b) {\n\ta++;\n\t--b;\n}");
+    }
+
+    @Test
+    public void testVisitWhileLoop_1a()
+    {
+        IWhileLoopNode node = (IWhileLoopNode) getNode("while(a > b) a++;",
+                IWhileLoopNode.class);
+        asBlockWalker.visitWhileLoop(node);
+        assertOut("while (a > b)\n\ta++;");
+    }
+
+    //----------------------------------
+    // do {} while ()
+    //----------------------------------
+
+    @Test
+    public void testVisitWhileLoop_Do_1()
+    {
+        IWhileLoopNode node = (IWhileLoopNode) getNode(
+                "do {a++;--b;} while(a > b);", IWhileLoopNode.class);
+        asBlockWalker.visitWhileLoop(node);
+        assertOut("do {\n\ta++;\n\t--b;\n} while (a > b);");
+    }
+
+    @Test
+    public void testVisitWhileLoop_Do_1a()
+    {
+        IWhileLoopNode node = (IWhileLoopNode) getNode("do a++; while(a > b);",
+                IWhileLoopNode.class);
+        asBlockWalker.visitWhileLoop(node);
+        assertOut("do\n\ta++;\nwhile (a > b);");
+    }
+
+    //----------------------------------
+    // throw ()
+    //----------------------------------
+
+    @Test
+    public void testVisitThrow()
+    {
+        IThrowNode node = (IThrowNode) getNode("throw new Error('foo');",
+                IThrowNode.class);
+        asBlockWalker.visitThrow(node);
+        assertOut("throw new Error('foo')");
+    }
+
+    //----------------------------------
+    // try {} catch () {} finally {}
+    //----------------------------------
+
+    @Test
+    public void testVisitTry_Catch()
+    {
+        ITryNode node = (ITryNode) getNode("try { a; } catch (e:Error) { b; }",
+                ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n\ta;\n} catch (e:Error) {\n\tb;\n}");
+    }
+
+    @Test
+    public void testVisitTry_Catch_Finally()
+    {
+        ITryNode node = (ITryNode) getNode(
+                "try { a; } catch (e:Error) { b; } finally { c; }",
+                ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n\ta;\n} catch (e:Error) {\n\tb;\n} finally {\n\tc;\n}");
+    }
+
+    @Test
+    public void testVisitTry_Catch_Catch_Finally()
+    {
+        ITryNode node = (ITryNode) getNode(
+                "try { a; } catch (e:Error) { b; } catch (f:Error) { c; } finally { d; }",
+                ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n\ta;\n} catch (e:Error) {\n\tb;\n} catch (f:Error) {\n\tc;\n} finally {\n\td;\n}");
+    }
+
+    @Test
+    public void testVisitTry_CatchEmpty_FinallyEmpty_()
+    {
+        ITryNode node = (ITryNode) getNode(
+                "try { a; } catch (e:Error) {  } finally {  }", ITryNode.class);
+        asBlockWalker.visitTry(node);
+        assertOut("try {\n\ta;\n} catch (e:Error) {\n} finally {\n}");
+    }
+
+    //----------------------------------
+    // switch {}
+    //----------------------------------
+
+    @Test
+    public void testVisitSwitch_1()
+    {
+        ISwitchNode node = (ISwitchNode) getNode("switch(i){case 1: break;}",
+                ISwitchNode.class);
+        asBlockWalker.visitSwitch(node);
+        assertOut("switch (i) {\n\tcase 1:\n\t\tbreak;\n}");
+    }
+
+    @Test
+    public void testVisitSwitch_1a()
+    {
+        ISwitchNode node = (ISwitchNode) getNode(
+                "switch(i){case 1: { break; }}", ISwitchNode.class);
+        asBlockWalker.visitSwitch(node);
+        // (erikdebruin) the code is valid without the extra braces, 
+        //               i.e. we're good, we "don't care"
+        assertOut("switch (i) {\n\tcase 1:\n\t\tbreak;\n}");
+    }
+
+    @Test
+    public void testVisitSwitch_2()
+    {
+        ISwitchNode node = (ISwitchNode) getNode(
+                "switch(i){case 1: break; default: return;}", ISwitchNode.class);
+        asBlockWalker.visitSwitch(node);
+        assertOut("switch (i) {\n\tcase 1:\n\t\tbreak;\n\tdefault:\n\t\treturn;\n}");
+    }
+
+    @Test
+    public void testVisitSwitch_3()
+    {
+        ISwitchNode node = (ISwitchNode) getNode(
+                "switch(i){case 1: { var x:int = 42; break; }; case 2: { var y:int = 66; break; }}", ISwitchNode.class);
+        asBlockWalker.visitSwitch(node);
+        assertOut("switch (i) {\n\tcase 1:\n\t\tvar x:int = 42;\n\t\tbreak;\n\tcase 2:\n\t\tvar y:int = 66;\n\t\tbreak;\n}");
+    }
+
+    //----------------------------------
+    // label : for () {}
+    //----------------------------------
+
+    @Test
+    public void testVisitLabel_1()
+    {
+        LabeledStatementNode node = (LabeledStatementNode) getNode(
+                "foo: for each(var i:int in obj) { break foo; }",
+                LabeledStatementNode.class);
+        asBlockWalker.visitLabeledStatement(node);
+        assertOut("foo : for each (var i:int in obj) {\n\tbreak foo;\n}");
+    }
+
+    @Test
+    public void testVisitLabel_1a()
+    {
+        // ([unknown]) LabelStatement messes up in finally{} block, something is wrong there
+        
+        // (erikdebruin) I don't see a finally block in the test code and the 
+        //               test passes... What's wrong?
+        
+        LabeledStatementNode node = (LabeledStatementNode) getNode(
+                "foo: for each(var i:int in obj) break foo;",
+                LabeledStatementNode.class);
+        asBlockWalker.visitLabeledStatement(node);
+        assertOut("foo : for each (var i:int in obj)\n\tbreak foo;");
+    }
+
+    //----------------------------------
+    // with () {}
+    //----------------------------------
+
+    @Test
+    public void testVisitWith()
+    {
+        IWithNode node = (IWithNode) getNode("with (a) { b; }", IWithNode.class);
+        asBlockWalker.visitWith(node);
+        assertOut("with (a) {\n\tb;\n}");
+    }
+
+    @Test
+    public void testVisitWith_1a()
+    {
+        IWithNode node = (IWithNode) getNode("with (a) b;", IWithNode.class);
+        asBlockWalker.visitWith(node);
+        assertOut("with (a)\n\tb;");
+    }
+
+    @Test
+    public void testVisit()
+    {
+        IFileNode node = (IFileNode) getNode(
+                "try { a; } catch (e:Error) { if (a) { if (b) { if (c) b; else if (f) a; else e; }} } finally {  }"
+                        + "if (d) for (var i:int = 0; i < len; i++) break;"
+                        + "if (a) { with (ab) { c(); } "
+                        + "do {a++;do a++; while(a > b);} while(c > d); }"
+                        + "if (b) { try { a; throw new Error('foo'); } catch (e:Error) { "
+                        + " switch(i){case 1: break; default: return;}"
+                        + " } catch (f:Error) { c; eee.dd; } finally { "
+                        + "  d;  var a:Object = function(foo:int, bar:String = 'goo'):int{return -1;};"
+                        + "  eee.dd; eee.dd; eee.dd; eee.dd;} }"
+                        + "foo: for each(var i:int in obj) break foo;",
+                IFileNode.class);
+        asBlockWalker.visitFile(node);
+        assertOut("package {\n\tpublic class FalconTest_A {\n\t\tfunction falconTest_a():void {\n\t\t\ttry {\n\t\t\t\ta;\n\t\t\t} catch (e:Error) {\n\t\t\t\tif (a) {\n\t\t\t\t\tif (b) {\n\t\t\t\t\t\tif (c)\n\t\t\t\t\t\t\tb;\n\t\t\t\t\t\telse if (f)\n\t\t\t\t\t\t\ta;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\te;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t}\n\t\t\tif (d)\n\t\t\t\tfor (var i:int = 0; i < len; i++)\n\t\t\t\t\tbreak;\n\t\t\tif (a) {\n\t\t\t\twith (ab) {\n\t\t\t\t\tc();\n\t\t\t\t}\n\t\t\t\tdo {\n\t\t\t\t\ta++;\n\t\t\t\t\tdo\n\t\t\t\t\t\ta++;\n\t\t\t\t\twhile (a > b);\n\t\t\t\t} while (c > d);\n\t\t\t}\n\t\t\tif (b) {\n\t\t\t\ttry {\n\t\t\t\t\ta;\n\t\t\t\t\tthrow new Error('foo');\n\t\t\t\t} catch (e:Error) {\n\t\t\t\t\tswitch (i) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} catch (f:Error) {\n\t\t\t\t\tc;\n\t\t\t\t\teee.dd;\n\t\t\t\t} finally {\n\t\t\t\t\td;\n\t\t\t\t\tvar a:Object = function(foo:int, bar:S
 tring = 'goo'):int {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t};\n\t\t\t\t\teee.dd;\n\t\t\t\t\teee.dd;\n\t\t\t\t\teee.dd;\n\t\t\t\t\teee.dd;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfoo : for each (var i:int in obj)\n\t\t\t\tbreak foo;;\n\t}\n}\n}");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/CompilerArguments.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/CompilerArguments.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/CompilerArguments.java
new file mode 100644
index 0000000..fa7ef1d
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/CompilerArguments.java
@@ -0,0 +1,408 @@
+/*
+ *
+ *  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.internal.codegen.externals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Michael Schmalle
+ */
+public class CompilerArguments
+{
+    private List<String> bundles = new ArrayList<String>();
+
+    private List<String> libraries = new ArrayList<String>();
+
+    private List<String> sources = new ArrayList<String>();
+
+    private List<String> includes = new ArrayList<String>();
+
+    private String sdkPath = "";
+
+    private String appName = "";
+
+    private String output;
+
+    private String jsLibraryPath = "";
+
+    private String jsBasePath = "";
+
+    private Boolean jsOutputAsFiles = null;
+
+    //    private List<MergedFileSettings> jsMergedFiles = new ArrayList<MergedFileSettings>();
+
+    public void addBundlePath(String path)
+    {
+        if (bundles.contains(path))
+            return;
+        bundles.add(path);
+    }
+
+    public void addLibraryPath(String path)
+    {
+        if (libraries.contains(path))
+            return;
+        libraries.add(path);
+    }
+
+    public void addSourcepath(String path)
+    {
+        if (sources.contains(path))
+            return;
+        sources.add(path);
+    }
+
+    public void addIncludedSources(String path)
+    {
+        if (includes.contains(path))
+            return;
+        includes.add(path);
+    }
+
+    public List<String> getBundles()
+    {
+        return bundles;
+    }
+
+    public List<String> getLibraries()
+    {
+        return libraries;
+    }
+
+    public List<String> getSources()
+    {
+        return sources;
+    }
+
+    public List<String> getIncludes()
+    {
+        return includes;
+    }
+
+    public String getSDKPath()
+    {
+        return sdkPath;
+    }
+
+    public void setSDKPath(String value)
+    {
+        sdkPath = value;
+    }
+
+    public String getAppName()
+    {
+        return appName;
+    }
+
+    public void setAppName(String value)
+    {
+        appName = value;
+    }
+
+    public String getOutput()
+    {
+        return output;
+    }
+
+    public void setOutput(String path)
+    {
+        output = path;
+    }
+
+    public String getJsLibraryPath()
+    {
+        return jsLibraryPath;
+    }
+
+    public void setJsLibraryPath(String jsLibraryPath)
+    {
+        this.jsLibraryPath = jsLibraryPath;
+    }
+
+    public String getJsBasePath()
+    {
+        return jsBasePath;
+    }
+
+    public void setJsBasePath(String jsBasePath)
+    {
+        this.jsBasePath = jsBasePath;
+    }
+
+    public Boolean isJsOutputAsFiles()
+    {
+        return jsOutputAsFiles;
+    }
+
+    public void setJsOutputAsFiles(Boolean jsOutputAsFiles)
+    {
+        this.jsOutputAsFiles = jsOutputAsFiles;
+    }
+
+    //    public void addJsMergedFiles(MergedFileSettings setting)
+    //    {
+    //        jsMergedFiles.add(setting);
+    //    }
+
+    //--------------------------------------------------------------------------
+    // SWC
+    //--------------------------------------------------------------------------
+
+    private List<String> metadatas = new ArrayList<String>();
+
+    // -keep-as3-metadata
+    public List<String> getKeepMetadata()
+    {
+        return metadatas;
+    }
+
+    public void addKeepMetadata(String metadata)
+    {
+        if (metadatas.contains(metadata))
+            return;
+        metadatas.add(metadata);
+    }
+
+    //--------------------------------------------------------------------------
+    // Doc
+    //--------------------------------------------------------------------------
+
+    private List<String> docMembers = new ArrayList<String>();
+
+    private List<String> docNamespace = new ArrayList<String>();
+
+    private String mainTitle;
+
+    public String getMainTitle()
+    {
+        return mainTitle;
+    }
+
+    public void setMainTitle(String value)
+    {
+        mainTitle = value;
+    }
+
+    private String footer;
+
+    public String getFooter()
+    {
+        return footer;
+    }
+
+    public void setFooter(String value)
+    {
+        footer = value;
+    }
+
+    public void addDocMember(String member)
+    {
+        if (docMembers.contains(member))
+            return;
+        docMembers.add(member);
+    }
+
+    public void addDocNamespace(String namespace)
+    {
+        if (docNamespace.contains(namespace))
+            return;
+        docNamespace.add(namespace);
+    }
+
+    public void clear()
+    {
+        jsBasePath = "";
+        jsLibraryPath = "";
+        jsOutputAsFiles = false;
+        output = "";
+        clearLibraries();
+        clearSourcePaths();
+        includes.clear();
+        //        jsMergedFiles.clear();
+    }
+
+    public void clearSourcePaths()
+    {
+        sources = new ArrayList<String>();
+    }
+
+    public void clearBundles()
+    {
+        bundles = new ArrayList<String>();
+    }
+
+    public void clearLibraries()
+    {
+        libraries = new ArrayList<String>();
+    }
+
+    public List<String> toArguments()
+    {
+        List<String> result = new ArrayList<String>();
+
+        for (String arg : bundles)
+        {
+            result.add("-bundle-path=" + arg);
+        }
+
+        for (String arg : libraries)
+        {
+            result.add("-library-path=" + arg);
+        }
+
+        for (String arg : sources)
+        {
+            result.add("-source-path=" + arg);
+        }
+
+        if (includes.size() > 0)
+        {
+            result.add("-include-sources=" + join(includes, ","));
+        }
+        if (metadatas.size() > 0)
+        {
+            result.add("-keep-as3-metadata=" + join(metadatas, ","));
+        }
+
+        //        if (jsMergedFiles.size() > 0)
+        //        {
+        //            final StringBuilder sb = new StringBuilder();
+        //            for (MergedFileSettings setting : jsMergedFiles)
+        //            {
+        //                sb.append("-js-merged-file=");
+        //                sb.append(setting.getFileName());
+        //                sb.append(",");
+        //                sb.append(StringUtils.join(
+        //                        setting.getQualifiedNames().toArray(new String[] {}),
+        //                        ","));
+        //                result.add(sb.toString());
+        //                sb.setLength(0);
+        //            }
+        //        }
+
+        String sdk = getSDKPath();
+        if (sdk != null && !sdk.equals(""))
+            result.add("-sdk-path=" + sdk);
+
+        String name = getAppName();
+        if (name != null && !name.equals(""))
+            result.add("-app-name=" + name);
+
+        String base = getJsBasePath();
+        if (!base.equals(""))
+            result.add("-js-base-path=" + base);
+
+        String library = getJsLibraryPath();
+        if (!library.equals(""))
+            result.add("-js-library-path=" + library);
+
+        if (isJsOutputAsFiles() != null)
+        {
+            result.add("-js-classes-as-files="
+                    + (isJsOutputAsFiles() ? "true" : "false"));
+        }
+
+        result.add("-output=" + getOutput());
+
+        addArguments(result);
+
+        return result;
+    }
+
+    protected void addArguments(List<String> arguments)
+    {
+        String mainTitle = getMainTitle();
+        if (mainTitle != null && !mainTitle.equals(""))
+            arguments.add("-main-title=" + mainTitle);
+
+        if (footer != null && !footer.equals(""))
+            arguments.add("-footer=" + footer);
+
+        if (docMembers.size() > 0)
+        {
+            arguments.add("-doc-member=" + join(docMembers, ","));
+        }
+
+        if (docNamespace.size() > 0)
+        {
+            arguments.add("-doc-namespace=" + join(docNamespace, ","));
+        }
+    }
+
+    private String join(List<String> items, String separator)
+    {
+        StringBuilder sb = new StringBuilder();
+        int len = items.size();
+        int index = 0;
+        for (String item : items)
+        {
+            sb.append(item);
+            if (index < len)
+                sb.append(separator);
+            index++;
+        }
+        return sb.toString();
+    }
+
+    public static class CompilerArgument
+    {
+        private String name;
+
+        private String value;
+
+        CompilerArgument(String name, String value)
+        {
+            this.name = name;
+            this.value = value;
+        }
+
+        public String getValue()
+        {
+            return value;
+        }
+
+        public void setValue(String value)
+        {
+            this.value = value;
+        }
+
+        public String getName()
+        {
+            return name;
+        }
+
+        public void setName(String name)
+        {
+            this.name = name;
+        }
+
+        public static CompilerArgument create(String name, String value)
+        {
+            return new CompilerArgument(name, value);
+        }
+    }
+
+    @Override
+    public String toString()
+    {
+        return join(toArguments(), " ");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestBase.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestBase.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestBase.java
new file mode 100644
index 0000000..c1526c0
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestBase.java
@@ -0,0 +1,108 @@
+/*
+ *
+ *  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.internal.codegen.externals;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.flex.compiler.clients.EXTERNC;
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.compiler.internal.codegen.externals.reference.MethodReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+
+import com.google.javascript.jscomp.Result;
+import com.google.javascript.rhino.jstype.JSType;
+
+public abstract class ExternalsTestBase
+{
+    private static File unitTestBaseDir =
+            new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(), "externals_unit_tests");
+
+    // Only used for testing, all configuration must happen in configure()
+    protected ExternCConfiguration config;
+    protected EXTERNC client;
+    protected ReferenceModel model;
+
+    @Before
+    public void setUp() throws IOException
+    {
+        config = new ExternCConfiguration();
+        configure(config);
+        client = new EXTERNC(config);
+        model = client.getModel();
+    }
+
+    protected abstract void configure(ExternCConfiguration config) throws IOException;
+
+    @After
+    public void tearDown()
+    {
+        model = null;
+    }
+
+    protected Result compile(String fileName) throws IOException
+    {
+        return compile(new File(unitTestBaseDir, fileName));
+    }
+
+    protected Result compile(File file) throws IOException
+    {
+        config.addExternal(file);
+        return compile();
+    }
+
+    protected Result compile() throws IOException
+    {
+        Result result = client.compile();
+        Assert.assertTrue(result.success);
+        return result;
+    }
+
+    protected JSType evaluateParam(MethodReference method, String paramName)
+    {
+        JSType jsType = method.getComment().getParameterType(paramName).evaluate(null,
+                client.getCompiler().getJSCompiler().getTypeRegistry());
+        return jsType;
+    }
+
+    /**
+     * Clean, compile a js file based on the test method name.
+     * 
+     * @param relativeTestDir unitTestBaseDir relative base test directory.
+     * @throws IOException
+     */
+    protected void assertCompileTestFileSuccess(String relativeTestDir) throws IOException
+    {
+        if (config.getAsRoot() != null)
+        {
+            client.cleanOutput();
+        }
+        final StackTraceElement[] ste = Thread.currentThread().getStackTrace();
+        final String methodName = ste[2].getMethodName();
+        Result result = compile(relativeTestDir + methodName + ".js");
+        assertTrue(result.success);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestUtils.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestUtils.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestUtils.java
new file mode 100644
index 0000000..7956e25
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestUtils.java
@@ -0,0 +1,173 @@
+/*
+ *
+ *  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.internal.codegen.externals;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.utils.FilenameNormalization;
+
+public class ExternalsTestUtils
+{
+    public static File TEMP_DIR = new File(
+            FilenameNormalization.normalize("temp"));
+
+    // XXX missing.js is a temp location until we can figure out where it should placed in the build
+    public static File MISSING_JS_FILE = FilenameNormalization.normalize(new File(
+            "../externs/js/missing.js"));
+
+    // XXX AS3.as is a namespace needed to override toString in some classes
+    public static File AS3_NAMESPACE_FILE = FilenameNormalization.normalize(new File(
+            "../externs/js/src/AS3.as"));
+
+    public static File EXTERNAL_JS_DIR = FilenameNormalization.normalize(new File(
+            "../externs/js/externs"));
+
+    public static File EXTERNAL_JQUERY_DIR = FilenameNormalization.normalize(new File(
+            "../externs/jquery/externs"));
+
+    public static File EXTERNAL_JASMINE_DIR = FilenameNormalization.normalize(new File(
+            "../externs/jasmine/externs"));
+
+    public static File AS_ROOT_DIR = new File(TEMP_DIR, "externals/as");
+
+    public static void addTestExcludesFull(ExternCConfiguration config)
+    {
+        config.addFieldExclude("Window", "focus");
+        config.addClassExclude("controlRange");
+
+        config.addExclude("Array", "toSource");
+        config.addExclude("Date", "valueOf");
+        config.addExclude("String", "valueOf");
+
+        config.addExclude("FontFaceSet", "delete");
+
+        config.addExclude("CSSStyleDeclaration", "cssText");
+        config.addExclude("CSSStyleRule", "style");
+        config.addExclude("CSSFontFaceRule", "style");
+        config.addExclude("CSSPageRule", "style");
+
+        config.addExclude("Generator", "throw");
+        config.addExclude("Generator", "return");
+        config.addExclude("HTMLMenuItemElement", "default");
+        config.addExclude("MessageEvent", "data"); // TODO returns T
+        config.addExclude("MessageEvent", "initMessageEventNS"); // TODO param T
+        config.addExclude("MessageEvent", "initMessageEvent"); // TODO param T
+        config.addExclude("MessageEvent", "default");
+        config.addExclude("Object", "is");
+        config.addExclude("Promise", "catch");
+
+        config.addExclude("IDBCursor", "continue");
+        config.addExclude("IDBCursor", "delete");
+        config.addExclude("IDBObjectStore", "delete");
+
+        // TODO method treated like field
+        config.addFieldExclude("Iterator", "next");
+        config.addExclude("Generator", "next");
+        config.addExclude("LinkStyle", "sheet");
+
+        // SVG
+        config.addExclude("SVGStylable", "className");
+        config.addExclude("SVGStylable", "style");
+        config.addExclude("SVGLocatable", "farthestViewportElement");
+        config.addExclude("SVGLocatable", "nearestViewportElement");
+
+        // jQuery XXX (these will need to be defined in some config when we get external libs
+        // working correctly with EXTERNC)
+        config.addClassToFunction("$");
+
+        config.addExclude("jQuery", "is");
+        config.addExclude("jQuery", "promise");
+        config.addExclude("jQuery", "getJSON");
+        config.addExclude("jQuery", "ajax");
+        config.addExclude("jQuery", "when");
+        config.addExclude("jQuery", "post");
+        config.addExclude("jQuery", "getScript");
+        config.addExclude("jQuery", "Callbacks");
+
+        config.addClassExclude("Deferred");
+        config.addClassExclude("jQuery.deferred");
+        config.addClassExclude("jQuery.Event");
+        config.addClassExclude("jQuery.Deferred");
+        config.addClassExclude("$.Event");
+        config.addClassExclude("$.Deferred");
+        config.addClassExclude("$.deferred");
+    }
+
+    public static void addTestExternalsFull(ExternCConfiguration config)
+            throws IOException
+    {
+        String coreRoot = ExternalsTestUtils.EXTERNAL_JS_DIR.getAbsolutePath();
+
+        config.addExternal(ExternalsTestUtils.MISSING_JS_FILE);
+        config.addExternal(coreRoot + "/es3.js");
+        config.addExternal(coreRoot + "/es5.js");
+        config.addExternal(coreRoot + "/es6.js");
+
+        config.addExternal(coreRoot + "/browser/w3c_anim_timing.js");
+        config.addExternal(coreRoot + "/browser/w3c_audio.js");
+        config.addExternal(coreRoot + "/browser/w3c_batterystatus.js");
+        config.addExternal(coreRoot + "/browser/w3c_css.js");
+        config.addExternal(coreRoot + "/browser/w3c_css3d.js");
+        config.addExternal(coreRoot + "/browser/w3c_device_sensor_event.js");
+        config.addExternal(coreRoot + "/browser/w3c_dom1.js");
+        config.addExternal(coreRoot + "/browser/w3c_dom2.js");
+        config.addExternal(coreRoot + "/browser/w3c_dom3.js");
+        config.addExternal(coreRoot + "/browser/w3c_elementtraversal.js");
+        config.addExternal(coreRoot + "/browser/w3c_encoding.js");
+        config.addExternal(coreRoot + "/browser/w3c_event.js");
+        config.addExternal(coreRoot + "/browser/w3c_event3.js");
+        config.addExternal(coreRoot + "/browser/w3c_geolocation.js");
+        config.addExternal(coreRoot + "/browser/w3c_indexeddb.js");
+        config.addExternal(coreRoot + "/browser/w3c_navigation_timing.js");
+        config.addExternal(coreRoot + "/browser/w3c_range.js");
+        config.addExternal(coreRoot + "/browser/w3c_rtc.js");
+        config.addExternal(coreRoot + "/browser/w3c_selectors.js");
+        //model.addExternal(coreRoot + "/w3c_serviceworker.js");
+        //model.addExternal(coreRoot + "/w3c_webcrypto.js");
+        config.addExternal(coreRoot + "/browser/w3c_xml.js");
+
+        //model.addExternal(coreRoot + "/fetchapi");
+
+        config.addExternal(coreRoot + "/browser/window.js");
+
+        config.addExternal(coreRoot + "/browser/ie_dom.js");
+        config.addExternal(coreRoot + "/browser/gecko_dom.js");
+
+        config.addExternal(coreRoot + "/browser/webkit_css.js");
+        config.addExternal(coreRoot + "/browser/webkit_dom.js");
+        config.addExternal(coreRoot + "/browser/webkit_event.js");
+        //model.addExternal(coreRoot + "/webkit_notifications.js");
+
+        config.addExternal(coreRoot + "/browser/iphone.js");
+        config.addExternal(coreRoot + "/browser/chrome.js");
+        config.addExternal(coreRoot + "/browser/flash.js");
+
+        config.addExternal(coreRoot + "/browser/page_visibility.js");
+        config.addExternal(coreRoot + "/browser/fileapi.js");
+        config.addExternal(coreRoot + "/browser/html5.js");
+
+        config.addExternal(coreRoot + "/browser/webgl.js");
+        config.addExternal(coreRoot + "/browser/webstorage.js");
+
+        config.addExternal(coreRoot + "/svg.js");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestAnnotationEnum.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestAnnotationEnum.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestAnnotationEnum.java
new file mode 100644
index 0000000..124e3ff
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestAnnotationEnum.java
@@ -0,0 +1,82 @@
+/*
+ *
+ *  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.internal.codegen.externals;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.junit.Test;
+
+public class TestAnnotationEnum extends ExternalsTestBase
+{
+    @Test
+    public void test_class_creation() throws IOException
+    {
+        compile("annotation_enum.js");
+
+        ClassReference FontFaceLoadStatus = model.getClassReference("FontFaceLoadStatus");
+        ClassReference FontFaceSetLoadStatus = model.getClassReference("FontFaceSetLoadStatus");
+        assertNotNull(FontFaceLoadStatus);
+        assertNotNull(FontFaceSetLoadStatus);
+
+        assertTrue(FontFaceLoadStatus.hasStaticField("ERROR"));
+        assertTrue(FontFaceLoadStatus.hasStaticField("LOADED"));
+        assertTrue(FontFaceLoadStatus.hasStaticField("LOADING"));
+        assertTrue(FontFaceLoadStatus.hasStaticField("UNLOADED"));
+
+        assertTrue(FontFaceSetLoadStatus.hasStaticField("FOO_LOADED"));
+        assertTrue(FontFaceSetLoadStatus.hasStaticField("FOO_LOADING"));
+
+        assertTrue(FontFaceLoadStatus.getStaticField("ERROR").isConst());
+
+        // TODO check values and value type IE String, Number
+
+        //String emit1 = client.getEmitter().emit(FontFaceLoadStatus);
+        //String emit2 = client.getEmitter().emit(FontFaceSetLoadStatus);
+    }
+
+    @Test
+    public void test_qualified_enum() throws IOException
+    {
+        compile("annotation_enum.js");
+
+        ClassReference QualifiedEnum = model.getClassReference("foo.bar.baz.QualifiedEnum");
+        assertNotNull(QualifiedEnum);
+        assertEquals("foo.bar.baz.QualifiedEnum",
+                QualifiedEnum.getQualifiedName());
+        assertEquals("foo.bar.baz", QualifiedEnum.getPackageName());
+        assertEquals("QualifiedEnum", QualifiedEnum.getBaseName());
+
+        assertTrue(QualifiedEnum.hasStaticField("One"));
+        assertTrue(QualifiedEnum.hasStaticField("Two"));
+
+        //String emit1 = client.getEmitter().emit(QualifiedEnum);
+    }
+
+    @Override
+    protected void configure(ExternCConfiguration config) throws IOException
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestCollectImports.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestCollectImports.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestCollectImports.java
new file mode 100644
index 0000000..a7ab2b8
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestCollectImports.java
@@ -0,0 +1,221 @@
+/*
+ *
+ *  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.internal.codegen.externals;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.FunctionReference;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+@RunWith(Parameterized.class)
+public class TestCollectImports extends ExternalsTestBase
+{
+    private static final String IMPORTS_TEST_DIR = "imports/";
+
+    private Boolean excludeClass;
+
+    @Parameterized.Parameters
+    public static Collection<Object[]> excludeClassYesNo()
+    {
+        return Arrays.asList(new Object[][] { { true }, { false } });
+    }
+
+    public TestCollectImports(final Boolean excludeClass)
+    {
+        this.excludeClass = excludeClass;
+    }
+
+    @Test
+    public void import_constructor_signatures() throws Exception
+    {
+        if (excludeClass)
+        {
+            config.addClassExclude("foo.Baz");
+        }
+
+        assertCompileTestFileSuccess(IMPORTS_TEST_DIR);
+
+        //client.emit();
+
+        ClassReference importConstructorSignature = model.getClassReference("ImportConstructorSignature");
+        assertNotNull(importConstructorSignature);
+
+        assertFalse(importConstructorSignature.hasImport("Number"));
+        assertFalse(importConstructorSignature.hasImport("foo.Qux"));
+
+        assertTrue(importConstructorSignature.hasImport("foo.Bar"));
+
+        if (excludeClass)
+        {
+            assertFalse(importConstructorSignature.hasImport("foo.Baz"));
+        }
+        else
+        {
+            assertTrue(importConstructorSignature.hasImport("foo.Baz"));
+        }
+    }
+
+    @Test
+    public void import_method_signatures() throws Exception
+    {
+        if (excludeClass)
+        {
+            config.addClassExclude("foo.Qux");
+        }
+
+        assertCompileTestFileSuccess(IMPORTS_TEST_DIR);
+
+        //client.emit();
+
+        ClassReference importMethodSignature = model.getClassReference("ImportMethodSignature");
+        assertNotNull(importMethodSignature);
+
+        assertFalse(importMethodSignature.hasImport("Number"));
+        assertFalse(importMethodSignature.hasImport("foo.Quux"));
+        assertFalse(importMethodSignature.hasImport("foo.Quuux"));
+
+        assertTrue(importMethodSignature.hasImport("foo.Bar"));
+        assertTrue(importMethodSignature.hasImport("foo.Baz"));
+
+        if (excludeClass)
+        {
+            assertFalse(importMethodSignature.hasImport("foo.Qux"));
+        }
+        else
+        {
+            assertTrue(importMethodSignature.hasImport("foo.Qux"));
+        }
+    }
+
+    @Test
+    public void import_interfaces() throws Exception
+    {
+        if (excludeClass)
+        {
+            config.addClassExclude("API.foo.Baz");
+        }
+
+        assertCompileTestFileSuccess(IMPORTS_TEST_DIR);
+
+        //client.emit();
+
+        ClassReference importInterfaces = model.getClassReference("ImportInterfaces");
+        assertNotNull(importInterfaces);
+
+        assertFalse(importInterfaces.hasImport("qux"));
+        assertTrue(importInterfaces.hasImport("API.Foo"));
+
+        ClassReference apiFoo = model.getClassReference("API.Foo");
+        assertNotNull(apiFoo);
+
+        assertFalse(apiFoo.hasImport("qux"));
+        assertFalse(apiFoo.hasImport("API.Bar"));
+
+        if (excludeClass)
+        {
+            assertFalse(apiFoo.hasImport("API.foo.Baz"));
+        }
+        else
+        {
+            assertTrue(apiFoo.hasImport("API.foo.Baz"));
+        }
+    }
+
+    @Test
+    public void import_superclasses() throws Exception
+    {
+        if (excludeClass)
+        {
+            config.addClassExclude("BASE.Foo");
+        }
+
+        assertCompileTestFileSuccess(IMPORTS_TEST_DIR);
+
+        //client.emit();
+
+        ClassReference importSuperClass1 = model.getClassReference("ImportSuperClass1");
+        assertNotNull(importSuperClass1);
+
+        assertFalse(importSuperClass1.hasImport("qux"));
+
+        ClassReference importSuperClass2 = model.getClassReference("ImportSuperClass2");
+        assertNotNull(importSuperClass2);
+
+        if (excludeClass)
+        {
+            assertFalse(importSuperClass2.hasImport("BASE.Foo"));
+        }
+        else
+        {
+            assertTrue(importSuperClass2.hasImport("BASE.Foo"));
+        }
+
+        ClassReference foo = model.getClassReference("BASE.Foo");
+        assertNotNull(foo);
+
+        assertFalse(foo.hasImport("BASE.Bar"));
+    }
+
+    @Test
+    public void import_functions() throws Exception
+    {
+        if (excludeClass)
+        {
+            config.addClassExclude("foo.Qux");
+        }
+
+        assertCompileTestFileSuccess(IMPORTS_TEST_DIR);
+
+        //client.emit();
+
+        FunctionReference importFunction = (FunctionReference) model.getFunctions().toArray()[0];
+        assertNotNull(importFunction);
+        assertTrue(importFunction.getQualifiedName().equals("ImportFunction"));
+
+        assertFalse(importFunction.hasImport("Quux"));
+
+        assertTrue(importFunction.hasImport("foo.Bar"));
+        assertTrue(importFunction.hasImport("foo.Baz"));
+
+        if (excludeClass)
+        {
+            assertFalse(importFunction.hasImport("foo.Qux"));
+        }
+        else
+        {
+            assertTrue(importFunction.hasImport("foo.Qux"));
+        }
+    }
+
+    @Override
+    protected void configure(ExternCConfiguration config) throws IOException
+    {
+        //config.setASRoot(ExternalsTestUtils.AS_ROOT_DIR);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestConstructor.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestConstructor.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestConstructor.java
new file mode 100644
index 0000000..a766576
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestConstructor.java
@@ -0,0 +1,119 @@
+/*
+ *
+ *  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.internal.codegen.externals;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.junit.Test;
+
+public class TestConstructor extends ExternalsTestBase
+{
+
+    @Test
+    public void test_const_object_literal() throws IOException
+    {
+        compile("constructor_params.js");
+
+        assertTrue(model.hasClass("FinalClass"));
+        //assertTrue(model.getClassReference("FinalClass").isFinal());
+        assertTrue(model.getClassReference("FinalClass").hasStaticMethod("bar"));
+        assertTrue(model.getClassReference("FinalClass").getStaticMethod("bar").isStatic());
+    }
+
+    @Test
+    public void test_constructor_args() throws IOException
+    {
+        compile("constructor_params.js");
+
+        ClassReference FooNoArgs = model.getClassReference("FooNoArgs");
+        ClassReference FooOptArgs = model.getClassReference("FooOptArgs");
+        ClassReference FooVarArgs = model.getClassReference("FooVarArgs");
+        ClassReference FooOptVarArgs = model.getClassReference("FooOptVarArgs");
+
+        assertNotNull(FooNoArgs.getConstructor());
+        assertNotNull(FooOptArgs.getConstructor());
+        assertNotNull(FooVarArgs.getConstructor());
+        assertNotNull(FooOptVarArgs.getConstructor());
+
+        assertEquals(0, FooNoArgs.getConstructor().getParameterNames().size());
+        assertEquals(2, FooOptArgs.getConstructor().getParameterNames().size());
+        assertEquals(2, FooVarArgs.getConstructor().getParameterNames().size());
+        assertEquals(3,
+                FooOptVarArgs.getConstructor().getParameterNames().size());
+
+        assertFalse(FooOptArgs.getConstructor().getComment().getParameterType(
+                "arg1").isOptionalArg());
+        assertTrue(FooOptArgs.getConstructor().getComment().getParameterType(
+                "opt_arg2").isOptionalArg());
+
+        assertFalse(FooVarArgs.getConstructor().getComment().getParameterType(
+                "arg1").isVarArgs());
+        assertTrue(FooVarArgs.getConstructor().getComment().getParameterType(
+                "var_args").isVarArgs());
+
+        assertTrue(FooOptVarArgs.getConstructor().getComment().getParameterType(
+                "opt_arg2").isOptionalArg());
+        assertTrue(FooOptVarArgs.getConstructor().getComment().getParameterType(
+                "var_args").isVarArgs());
+
+        assertEquals(
+                "number",
+                evaluateParam(FooOptVarArgs.getConstructor(), "arg1").toAnnotationString());
+        assertEquals(
+                "*",
+                evaluateParam(FooOptVarArgs.getConstructor(), "opt_arg2").toAnnotationString());
+        assertEquals(
+                "*",
+                evaluateParam(FooOptVarArgs.getConstructor(), "var_args").toAnnotationString());
+    }
+
+    @Test
+    public void test_constructor_comment() throws IOException
+    {
+        compile("constructor_params.js");
+
+        StringBuilder sb = new StringBuilder();
+
+        ClassReference FooOptVarArgs = model.getClassReference("FooOptVarArgs");
+        FooOptVarArgs.getConstructor().emit(sb);
+        String string = sb.toString();
+        assertEquals(
+                "    /**\n     * A constructor with arg, opt arg and var args.\n     *\n     "
+                        + "* @param arg1 [number] The arg 1.\n     * @param opt_arg2 [*] The arg  "
+                        + "that is wrapped by another line in the comment.\n     * @param var_args "
+                        + "[*] A var agr param.\n     * @see http://foo.bar.com \n     * @see "
+                        + "[constructor_params]\n     * @returns {(FooVarArgs|null)} Another instance.\n"
+                        + "     */\n    public function FooOptVarArgs(arg1:Number, opt_arg2:* = null, ...var_args) "
+                        + "{\n        super();\n    }\n", string);
+    }
+
+    @Override
+    protected void configure(ExternCConfiguration config) throws IOException
+    {
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternChrome.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternChrome.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternChrome.java
new file mode 100644
index 0000000..51afce9
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternChrome.java
@@ -0,0 +1,153 @@
+/*
+ *
+ *  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.internal.codegen.externals;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.junit.Test;
+
+import com.google.javascript.jscomp.Result;
+
+public class TestExternChrome extends ExternalsTestBase
+{
+    @Test
+    public void test_classes() throws IOException
+    {
+        client.cleanOutput();
+        Result result = compile();
+        assertTrue(result.success);
+
+        String[] classes = {
+                "chrome",
+                "chrome.app",
+                "chrome.webstore",
+                "chrome.runtime",
+                "chrome.runtime.lastError",
+
+                "Port",
+                "ChromeEvent",
+                "ChromeStringEvent",
+                "ChromeBooleanEvent",
+                "ChromeNumberEvent",
+                "ChromeObjectEvent",
+                "ChromeStringArrayEvent",
+                "ChromeStringStringEvent",
+                "MessageSender",
+                "Tab",
+                "ChromeLoadTimes",
+                "ChromeCsiInfo" };
+
+        assertEquals(17, model.getClasses().size());
+        for (String className : classes)
+        {
+            assertTrue(model.hasClass(className));
+        }
+
+        client.emit();
+    }
+
+    @Test
+    public void test_members() throws IOException
+    {
+        client.cleanOutput();
+        Result result = compile();
+        assertTrue(result.success);
+
+        // Port
+        ClassReference Port = model.getClassReference("Port");
+        assertNotNull(Port);
+        assertTrue(Port.hasInstanceField("name"));
+        assertTrue(Port.hasInstanceField("onDisconnect"));
+        assertTrue(Port.hasInstanceField("onMessage"));
+        assertTrue(Port.hasInstanceField("sender"));
+
+        assertTrue(Port.hasInstanceMethod("postMessage"));
+        assertTrue(Port.hasInstanceMethod("disconnect"));
+
+        assertEquals("string", Port.getInstanceField("name").toTypeAnnotationString());
+        assertEquals("ChromeEvent",
+                Port.getInstanceField("onDisconnect").toTypeAnnotationString());
+        assertEquals("ChromeEvent",
+                Port.getInstanceField("onMessage").toTypeAnnotationString());
+        assertEquals("(MessageSender|undefined)",
+                Port.getInstanceField("sender").toTypeAnnotationString());
+
+        // chrome
+        ClassReference chrome = model.getClassReference("chrome");
+        assertNotNull(chrome);
+        assertTrue(chrome.hasStaticMethod("loadTimes"));
+        assertTrue(chrome.hasStaticMethod("csi"));
+        assertEquals("ChromeLoadTimes",
+                chrome.getStaticMethod("loadTimes").toReturnTypeAnnotationString());
+        assertEquals("ChromeCsiInfo",
+                chrome.getStaticMethod("csi").toReturnTypeAnnotationString());
+
+        // chrome.app
+        ClassReference chrome_app = model.getClassReference("chrome.app");
+        assertNotNull(chrome_app);
+        assertTrue(chrome_app.hasStaticField("isInstalled"));
+        assertEquals("boolean",
+                chrome_app.getStaticField("isInstalled").toTypeAnnotationString());
+
+        // chrome.runtime
+        ClassReference chrome_runtime = model.getClassReference("chrome.runtime");
+        assertNotNull(chrome_runtime);
+        assertTrue(chrome_runtime.hasStaticMethod("connect"));
+        assertTrue(chrome_runtime.hasStaticMethod("sendMessage"));
+
+        // chrome.runtime.lastError
+        ClassReference chrome_runtime_lastError = model.getClassReference("chrome.runtime.lastError");
+        assertNotNull(chrome_runtime_lastError);
+        assertTrue(chrome_runtime_lastError.hasStaticField("message"));
+        assertEquals(
+                "(string|undefined)",
+                chrome_runtime_lastError.getStaticField("message").toTypeAnnotationString());
+
+        // chrome.webstore
+        ClassReference chrome_webstore = model.getClassReference("chrome.webstore");
+        assertNotNull(chrome_webstore);
+        assertTrue(chrome_webstore.hasStaticField("onInstallStageChanged"));
+        assertTrue(chrome_webstore.hasStaticField("onDownloadProgress"));
+        assertTrue(chrome_webstore.hasStaticMethod("install"));
+
+        // Code generated
+        assertTrue(chrome.hasStaticField("app"));
+        assertTrue(chrome.hasStaticField("runtime"));
+        assertTrue(chrome.hasStaticField("webstore"));
+
+        assertTrue(chrome_runtime.hasInstanceField("lastError"));
+    }
+
+    @Override
+    protected void configure(ExternCConfiguration install) throws IOException
+    {
+        config.setASRoot(ExternalsTestUtils.AS_ROOT_DIR);
+
+        String coreRoot = ExternalsTestUtils.EXTERNAL_JS_DIR.getAbsolutePath();
+        config.addExternal(coreRoot + "/browser/chrome.js");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternES3.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternES3.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternES3.java
new file mode 100644
index 0000000..29ac6fb
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternES3.java
@@ -0,0 +1,122 @@
+/*
+ *
+ *  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.internal.codegen.externals;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.MethodReference;
+import org.junit.Test;
+
+import com.google.javascript.jscomp.Result;
+
+public class TestExternES3 extends ExternalsTestBase
+{
+    @Test
+    public void test_classes() throws IOException
+    {
+        Result result = compile();
+        assertTrue(result.success);
+
+        String[] classes = {
+                "Arguments",
+                "Object",
+                "Function",
+                "Array",
+                "Boolean",
+                "Number",
+                "Date",
+                "String",
+                "RegExp",
+                "Error",
+                "EvalError",
+                "RangeError",
+                "ReferenceError",
+                "SyntaxError",
+                "TypeError",
+                "URIError",
+                "Math" };
+
+        // IObject and IArrayLike are two extras
+        assertEquals(19, model.getClasses().size());
+        for (String className : classes)
+        {
+            assertTrue(model.hasClass(className));
+        }
+    }
+
+    @Test
+    public void test_Object() throws IOException
+    {
+        Result result = compile();
+        assertTrue(result.success);
+
+        ClassReference Object = model.getClassReference("Object");
+        assertNotNull(Object);
+        assertTrue(Object.isDynamic());
+    }
+
+    @Test
+    public void test_Array() throws IOException
+    {
+        Result result = compile();
+        assertTrue(result.success);
+
+        ClassReference Array = model.getClassReference("Array");
+        assertNotNull(Array);
+
+        MethodReference constructor = Array.getConstructor();
+        StringBuilder sb = new StringBuilder();
+        constructor.emitCode(sb);
+        String emit = sb.toString();
+        assertEquals("    public function Array(...var_args):Array {  return null; }\n", emit);
+    }
+
+    @Test
+    public void test_Array_indexOf() throws IOException
+    {
+        Result result = compile();
+        assertTrue(result.success);
+
+        ClassReference Array = model.getClassReference("Array");
+        assertNotNull(Array);
+
+        MethodReference indexOf = Array.getInstanceMethod("indexOf");
+        StringBuilder sb = new StringBuilder();
+        indexOf.emitCode(sb);
+        String emit = sb.toString();
+        assertEquals("    public function indexOf(obj:Object, opt_fromIndex:Number = 0):Number { return 0; }\n", emit);
+    }
+
+    @Override
+    protected void configure(ExternCConfiguration config) throws IOException
+    {
+        config.setASRoot(ExternalsTestUtils.AS_ROOT_DIR);
+
+        String coreRoot = ExternalsTestUtils.EXTERNAL_JS_DIR.getAbsolutePath();
+        config.addExternal(coreRoot + "/es3.js");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternJQuery.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternJQuery.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternJQuery.java
new file mode 100644
index 0000000..7a2c1d0
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternJQuery.java
@@ -0,0 +1,67 @@
+/*
+ *
+ *  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.internal.codegen.externals;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.junit.Test;
+
+import com.google.javascript.jscomp.Result;
+
+public class TestExternJQuery extends ExternalsTestBase
+{
+    @SuppressWarnings("unused")
+    @Test
+    public void test_classes() throws IOException
+    {
+        Result result = compile();
+        assertTrue(result.success);
+
+        //        String[] classes = {};
+        //
+        //        assertEquals(17, model.getClasses().size());
+        //        for (String className : classes)
+        //        {
+        //            assertTrue(model.hasClass(className));
+        //        }
+
+        ClassReference jQuery_Promise = model.getInterfaceReference("jQuery.Promise");
+        assertNotNull(jQuery_Promise);
+
+        StringBuilder sb = new StringBuilder();
+        jQuery_Promise.emit(sb);
+        String r = sb.toString();
+    }
+
+    @Override
+    protected void configure(ExternCConfiguration config) throws IOException
+    {
+        config.setASRoot(ExternalsTestUtils.AS_ROOT_DIR);
+
+        String coreRoot = ExternalsTestUtils.EXTERNAL_JQUERY_DIR.getAbsolutePath();
+        config.addExternal(coreRoot + "/jquery-1.9.js");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternJasmine.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternJasmine.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternJasmine.java
new file mode 100644
index 0000000..9e2c805
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternJasmine.java
@@ -0,0 +1,83 @@
+/*
+ *
+ *  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.internal.codegen.externals;
+
+import com.google.javascript.jscomp.Result;
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.junit.Test;
+
+import java.io.IOException;
+
+import static org.junit.Assert.*;
+
+public class TestExternJasmine extends ExternalsTestBase
+{
+    @Test
+    public void test_classes() throws IOException
+    {
+        client.cleanOutput();
+        Result result = compile();
+        assertTrue(result.success);
+
+        String[] classes = {
+                "jasmine",
+                "jasmine.Clock"};
+
+        assertEquals(9, model.getClasses().size());
+        for (String className : classes)
+        {
+            assertTrue(model.hasClass(className));
+        }
+
+        client.emit();
+    }
+
+    @Test
+    public void test_members() throws IOException
+    {
+        client.cleanOutput();
+        Result result = compile();
+        assertTrue(result.success);
+
+        // jasmine
+        ClassReference jasmine = model.getClassReference("jasmine");
+        assertNotNull(jasmine);
+
+        assertTrue(jasmine.hasStaticMethod("clock"));
+        assertEquals("jasmine.Clock", jasmine.getStaticMethod("clock").toReturnTypeAnnotationString());
+
+        assertTrue(jasmine.hasImport("jasmine.Clock"));
+
+        //Clock
+        ClassReference Clock = model.getClassReference("jasmine.Clock");
+        assertNotNull(Clock);
+    }
+
+    @Override
+    protected void configure(ExternCConfiguration install) throws IOException
+    {
+        config.setASRoot(ExternalsTestUtils.AS_ROOT_DIR);
+
+        String coreRoot = ExternalsTestUtils.EXTERNAL_JASMINE_DIR.getAbsolutePath();
+        config.addExternal(coreRoot + "/jasmine-2.0.js");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternalsJSCompile.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternalsJSCompile.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternalsJSCompile.java
new file mode 100644
index 0000000..feff678
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternalsJSCompile.java
@@ -0,0 +1,287 @@
+/*
+ *
+ *  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.internal.codegen.externals;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.flex.compiler.clients.COMPC;
+import org.apache.flex.compiler.clients.EXTERNC;
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.internal.codegen.as.ASFilterWriter;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.projects.FlexProjectConfigurator;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.internal.workspaces.Workspace;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.as.IASBlockWalker;
+import org.apache.flex.utils.FilenameNormalization;
+import org.apache.flex.utils.ITestAdapter;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+
+public class TestExternalsJSCompile
+{
+    private static ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
+
+    private static File tempDir = new File(testAdapter.getTempDir());
+
+    private static File app1ASSrcDir = new File(testAdapter.getUnitTestBaseDir(), "externals/app1/as_src");
+
+    private static File app1AJSSrcDir = new File(testAdapter.getTempDir(), "externals/app1/js_src");
+
+    private static File jsSWCFile = new File(testAdapter.getTempDir(), "externals/bin/JS.swc");
+
+    protected static Workspace workspace = new Workspace();
+    protected FlexJSProject project;
+    private ArrayList<ICompilerProblem> errors;
+
+    private FlexJSBackend backend;
+    //private IJSEmitter emitter;
+    //private IASBlockWalker walker;
+    //private JSFilterWriter writer;
+
+    private ArrayList<File> sourcePaths;
+    private ArrayList<File> libraries;
+
+    private EXTERNC client;
+
+    private ExternCConfiguration config;
+
+    @Before
+    public void setUp() throws IOException
+    {
+        backend = new FlexJSBackend();
+
+        config = new ExternCConfiguration();
+        config.setASRoot(ExternalsTestUtils.AS_ROOT_DIR);
+        ExternalsTestUtils.addTestExcludesFull(config);
+        ExternalsTestUtils.addTestExternalsFull(config);
+
+        client = new EXTERNC(config);
+
+        if (project == null)
+            project = new FlexJSProject(workspace);
+        FlexProjectConfigurator.configure(project);
+
+        backend = new FlexJSBackend();
+        //writer = backend.createWriterBuffer(project);
+        //emitter = backend.createEmitter(writer);
+        //walker = backend.createWalker(project, errors, emitter);
+
+        sourcePaths = new ArrayList<File>();
+        libraries = new ArrayList<File>();
+
+        FileUtils.deleteQuietly(jsSWCFile);
+        FileUtils.deleteQuietly(app1AJSSrcDir);
+    }
+
+    @After
+    public void tearDown()
+    {
+        client = null;
+    }
+
+    @Test
+    public void test_full_compile() throws IOException
+    {
+        client.cleanOutput();
+        client.compile();
+        client.emit();
+
+        compileSWC();
+        assertTrue(jsSWCFile.exists());
+
+        compileProject("Main", app1ASSrcDir.getAbsolutePath());
+
+        assertTrue(new File(app1AJSSrcDir, "Main_output.js").exists());
+    }
+
+    private boolean compileSWC()
+    {
+        CompilerArguments arguments = new CompilerArguments();
+        configureCOMPCCompiler(arguments);
+
+        File destAS3File = new File(config.getAsClassRoot().getAbsolutePath() + File.separator + "AS3.as");
+        try {
+			FileUtils.copyFile(ExternalsTestUtils.AS3_NAMESPACE_FILE, destAS3File);
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+        COMPC compc = new COMPC();
+
+        final String[] args = arguments.toArguments().toArray(new String[] {});
+        @SuppressWarnings("unused")
+        int code = compc.mainNoExit(args);
+
+        @SuppressWarnings("unused")
+        List<ICompilerProblem> problems = compc.getProblems().getProblems();
+        //getProblemQuery().addAll(problems);
+        if (compc.getProblems().hasErrors())
+            return false;
+
+        return true;
+    }
+
+    protected List<String> compileProject(String inputFileName,
+            String inputDirName)
+    {
+        List<String> compiledFileNames = new ArrayList<String>();
+
+        String mainFileName = inputDirName + File.separator + inputFileName
+                + ".as";
+
+        addDependencies();
+
+        ICompilationUnit mainCU = Iterables.getOnlyElement(workspace.getCompilationUnits(
+                FilenameNormalization.normalize(mainFileName), project));
+
+        if (project instanceof FlexJSProject)
+            project.mainCU = mainCU;
+
+        Configurator projectConfigurator = backend.createConfigurator();
+
+        JSTarget target = backend.createTarget(project,
+                projectConfigurator.getTargetSettings(null), null);
+
+        target.build(mainCU, new ArrayList<ICompilerProblem>());
+
+        List<ICompilationUnit> reachableCompilationUnits = project.getReachableCompilationUnitsInSWFOrder(ImmutableSet.of(mainCU));
+        for (final ICompilationUnit cu : reachableCompilationUnits)
+        {
+            try
+            {
+                ICompilationUnit.UnitType cuType = cu.getCompilationUnitType();
+
+                if (cuType == ICompilationUnit.UnitType.AS_UNIT
+                        || cuType == ICompilationUnit.UnitType.MXML_UNIT)
+                {
+                    File outputRootDir = new File(
+                            FilenameNormalization.normalize(tempDir
+                                    + File.separator + inputDirName));
+
+                    String qname = cu.getQualifiedNames().get(0);
+
+                    compiledFileNames.add(qname.replace(".", "/"));
+
+                    final File outputClassFile = getOutputClassFile(qname
+                            + "_output", outputRootDir);
+
+                    System.out.println(outputClassFile);
+
+                    ASFilterWriter writer = backend.createWriterBuffer(project);
+                    IASEmitter emitter = backend.createEmitter(writer);
+                    IASBlockWalker walker = backend.createWalker(project,
+                            errors, emitter);
+
+                    walker.visitCompilationUnit(cu);
+
+                    System.out.println(writer.toString());
+
+                    BufferedOutputStream out = new BufferedOutputStream(
+                            new FileOutputStream(outputClassFile));
+
+                    out.write(writer.toString().getBytes());
+                    out.flush();
+                    out.close();
+                }
+            }
+            catch (Exception e)
+            {
+                //System.out.println(e.getMessage());
+                e.printStackTrace();
+            }
+        }
+
+        return compiledFileNames;
+    }
+
+    private void configureCOMPCCompiler(CompilerArguments arguments)
+    {
+        arguments.setOutput(jsSWCFile.getAbsolutePath());
+
+        File classes = config.getAsClassRoot();
+        File interfaces = config.getAsInterfaceRoot();
+        File constants = config.getAsConstantRoot();
+        File functions = config.getAsFunctionRoot();
+        File typedefs = config.getAsTypeDefRoot();
+
+        arguments.addSourcepath(classes.getAbsolutePath());
+        arguments.addSourcepath(interfaces.getAbsolutePath());
+        arguments.addSourcepath(constants.getAbsolutePath());
+        arguments.addSourcepath(functions.getAbsolutePath());
+        arguments.addSourcepath(typedefs.getAbsolutePath());
+
+        arguments.addIncludedSources(classes.getAbsolutePath());
+        arguments.addIncludedSources(interfaces.getAbsolutePath());
+        arguments.addIncludedSources(constants.getAbsolutePath());
+        arguments.addIncludedSources(functions.getAbsolutePath());
+        arguments.addIncludedSources(typedefs.getAbsolutePath());
+    }
+
+    protected File getOutputClassFile(String qname, File outputFolder)
+    {
+        File baseDir = app1AJSSrcDir;
+
+        String[] cname = qname.split("\\.");
+        String sdirPath = baseDir.getAbsolutePath() + File.separator;
+        if (cname.length > 0)
+        {
+            for (int i = 0, n = cname.length - 1; i < n; i++)
+            {
+                sdirPath += cname[i] + File.separator;
+            }
+
+            File sdir = new File(sdirPath);
+            if (!sdir.exists())
+                sdir.mkdirs();
+
+            qname = cname[cname.length - 1];
+        }
+
+        return new File(sdirPath + qname + "." + backend.getOutputExtension());
+    }
+
+    private void addDependencies()
+    {
+        libraries.add(jsSWCFile);
+        sourcePaths.add(app1ASSrcDir);
+
+        project.setSourcePath(sourcePaths);
+        project.setLibraries(libraries);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestPackageNamespace.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestPackageNamespace.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestPackageNamespace.java
new file mode 100644
index 0000000..c00d00b
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestPackageNamespace.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.internal.codegen.externals;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.junit.Test;
+
+public class TestPackageNamespace extends ExternalsTestBase
+{
+    @Test
+    public void test_pacakge1() throws IOException
+    {
+        compile("package_namespace.js");
+
+        ClassReference reference1 = model.getClassReference("Foo");
+        ClassReference reference2 = model.getClassReference("foo.bar.Baz");
+        ClassReference reference3 = model.getClassReference("Goo");
+
+        assertFalse(reference1.isQualifiedName());
+        assertEquals("Foo", reference1.getBaseName());
+        assertEquals("", reference1.getPackageName());
+        assertEquals("Foo", reference1.getQualifiedName());
+
+        assertTrue(reference2.isQualifiedName());
+        assertEquals("Baz", reference2.getBaseName());
+        assertEquals("foo.bar", reference2.getPackageName());
+        assertEquals("foo.bar.Baz", reference2.getQualifiedName());
+
+        assertFalse(reference3.isQualifiedName());
+        assertEquals("Goo", reference3.getBaseName());
+        assertEquals("", reference3.getPackageName());
+        assertEquals("Goo", reference3.getQualifiedName());
+    }
+
+    @Override
+    protected void configure(ExternCConfiguration config)
+    {
+    }
+
+}


[18/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/FlexJSTest_again.mxml
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/FlexJSTest_again.mxml b/compiler-jx/src/test/resources/flexjs/files/FlexJSTest_again.mxml
new file mode 100644
index 0000000..2f3cbbd
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/FlexJSTest_again.mxml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+				   xmlns:local="*"
+				   xmlns:basic="library://ns.apache.org/flexjs/basic" 
+				   xmlns:models="models.*" 
+				   xmlns:controllers="controllers.*"
+				   initialize="MyModel(model).labelText='Hello World'"
+				   >
+	<basic:valuesImpl>
+		<basic:SimpleCSSValuesImpl />
+	</basic:valuesImpl>
+	<basic:initialView>
+		<local:MyInitialView />
+	</basic:initialView>
+	<basic:model>
+		<models:MyModel />
+	</basic:model>
+	<basic:controller>
+		<controllers:MyController />
+	</basic:controller>
+    <basic:beads>
+        <basic:HTTPService id="service">
+            <basic:LazyCollection id="collection">
+                <basic:inputParser>
+                    <basic:JSONInputParser />
+                </basic:inputParser>
+                <basic:itemConverter>
+                    <local:StockDataJSONItemConverter />
+                </basic:itemConverter> 
+            </basic:LazyCollection>
+        </basic:HTTPService>
+    </basic:beads>
+</basic:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/FlexJSTest_again_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/FlexJSTest_again_result.js b/compiler-jx/src/test/resources/flexjs/files/FlexJSTest_again_result.js
new file mode 100644
index 0000000..71eb945
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/FlexJSTest_again_result.js
@@ -0,0 +1,212 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * FlexJSTest_again
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('FlexJSTest_again');
+
+goog.require('org.apache.flex.core.Application');
+goog.require('org.apache.flex.core.SimpleCSSValuesImpl');
+goog.require('MyInitialView');
+goog.require('models.MyModel');
+goog.require('controllers.MyController');
+goog.require('org.apache.flex.net.HTTPService');
+goog.require('org.apache.flex.collections.LazyCollection');
+goog.require('org.apache.flex.collections.parsers.JSONInputParser');
+goog.require('StockDataJSONItemConverter');
+goog.require('org.apache.flex.events.Event');
+
+
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.Application}
+ */
+FlexJSTest_again = function() {
+  FlexJSTest_again.base(this, 'constructor');
+  
+  /**
+   * @private
+   * @type {org.apache.flex.core.SimpleCSSValuesImpl}
+   */
+  this.$ID0_;
+  
+  /**
+   * @private
+   * @type {MyInitialView}
+   */
+  this.$ID1_;
+  
+  /**
+   * @private
+   * @type {models.MyModel}
+   */
+  this.$ID2_;
+  
+  /**
+   * @private
+   * @type {controllers.MyController}
+   */
+  this.$ID3_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.net.HTTPService}
+   */
+  this.service_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.collections.LazyCollection}
+   */
+  this.collection_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.collections.parsers.JSONInputParser}
+   */
+  this.$ID4_;
+  
+  /**
+   * @private
+   * @type {StockDataJSONItemConverter}
+   */
+  this.$ID5_;
+  
+  /**
+   * @private
+   * @type {Array}
+   */
+  this.mxmldd;
+  
+  /**
+   * @private
+   * @type {Array}
+   */
+  this.mxmldp;
+
+  this.generateMXMLAttributes
+  ([5,
+'model',
+false,
+[models.MyModel, 1, '_id', true, '$ID2', 0, 0, null],
+'valuesImpl',
+false,
+[org.apache.flex.core.SimpleCSSValuesImpl, 1, '_id', true, '$ID0', 0, 0, null],
+'initialView',
+false,
+[MyInitialView, 1, '_id', true, '$ID1', 0, 0, null],
+'controller',
+false,
+[controllers.MyController, 1, '_id', true, '$ID3', 0, 0, null],
+'beads',
+null, [org.apache.flex.net.HTTPService, 2, 'id', true, 'service', 'beads', null, [org.apache.flex.collections.LazyCollection, 3, 'id', true, 'collection', 'inputParser', false, [org.apache.flex.collections.parsers.JSONInputParser, 1, '_id', true, '$ID4', 0, 0, null], 'itemConverter', false, [StockDataJSONItemConverter, 1, '_id', true, '$ID5', 0, 0, null], 0, 0, null], 0, 0, null],
+0,
+1,
+'initialize',
+this.$EH0
+  ]);
+  
+};
+goog.inherits(FlexJSTest_again, org.apache.flex.core.Application);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+FlexJSTest_again.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'FlexJSTest_again', qName: 'FlexJSTest_again' }] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('FlexJSTest_again', FlexJSTest_again);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+FlexJSTest_again.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+        'service': { type: 'org.apache.flex.net.HTTPService', declaredBy: 'FlexJSTest_again'},
+        'collection': { type: 'org.apache.flex.collections.LazyCollection', declaredBy: 'FlexJSTest_again'}
+      };
+    },
+    methods: function () {
+      return {
+        '$EH0': { type: 'void', declaredBy: 'FlexJSTest_again'}
+      };
+    }
+  };
+};
+
+
+
+/**
+ * @export
+ * @param {org.apache.flex.events.Event} event
+ */
+FlexJSTest_again.prototype.$EH0 = function(event)
+{
+  org.apache.flex.utils.Language.as(this.model, models.MyModel, true).labelText = 'Hello World';
+};
+
+
+Object.defineProperties(FlexJSTest_again.prototype, /** @lends {FlexJSTest_again.prototype} */ {
+/** @export */
+    service: {
+    /** @this {FlexJSTest_again} */
+    get: function() {
+      return this.service_;
+    },
+    /** @this {FlexJSTest_again} */
+    set: function(value) {
+      if (value != this.service_) {
+        this.service_ = value;
+        this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(this, 'service', null, value));
+      }
+    }
+  },
+  /** @export */
+    collection: {
+    /** @this {FlexJSTest_again} */
+    get: function() {
+      return this.collection_;
+    },
+    /** @this {FlexJSTest_again} */
+    set: function(value) {
+      if (value != this.collection_) {
+        this.collection_ = value;
+        this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(this, 'collection', null, value));
+      }
+    }
+  }
+});
+

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/LocalFunction.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/LocalFunction.as b/compiler-jx/src/test/resources/flexjs/files/LocalFunction.as
new file mode 100644
index 0000000..70d3981
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/LocalFunction.as
@@ -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
+{
+	
+	public class LocalFunction
+	{
+		public function LocalFunction() {}
+		
+		private var myMemberProperty:String = "got it: ";
+		
+		private function myMemberMethod(value:int):void
+		{
+			function myLocalFunction(value:int):String
+			{
+				return myMemberProperty + value;
+			}
+			
+			trace("WOW! :: " + myLocalFunction(value + 42));
+		}
+		
+		public function doIt():void
+		{
+			myMemberMethod(624);
+		}
+	}
+	
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/LocalFunction_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/LocalFunction_result.js b/compiler-jx/src/test/resources/flexjs/files/LocalFunction_result.js
new file mode 100644
index 0000000..c86bba7
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/LocalFunction_result.js
@@ -0,0 +1,99 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * LocalFunction
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('LocalFunction');
+
+
+
+/**
+ * @constructor
+ */
+LocalFunction = function() {
+};
+
+
+/**
+ * @private
+ * @type {string}
+ */
+LocalFunction.prototype.myMemberProperty = "got it: ";
+
+
+/**
+ * @private
+ * @param {number} value
+ */
+LocalFunction.prototype.myMemberMethod = function(value) {
+  var self = this;
+  function myLocalFunction(value) {
+    return this.myMemberProperty + value;
+  };
+  org.apache.flex.utils.Language.trace("WOW! :: " + myLocalFunction(value + 42));
+};
+
+
+/**
+ * @export
+ */
+LocalFunction.prototype.doIt = function() {
+  this.myMemberMethod(624);
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+LocalFunction.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'LocalFunction', qName: 'LocalFunction'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('LocalFunction', LocalFunction);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+LocalFunction.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'LocalFunction': { type: '', declaredBy: 'LocalFunction'},
+        'doIt': { type: 'void', declaredBy: 'LocalFunction'}
+      };
+    }
+  };
+};
+

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/MyInitialView.mxml b/compiler-jx/src/test/resources/flexjs/files/MyInitialView.mxml
new file mode 100644
index 0000000..2c30fd6
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/MyInitialView.mxml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
+				xmlns:basic="library://ns.apache.org/flexjs/basic" 
+			   >
+    <fx:Script>
+        <![CDATA[            
+			import org.apache.flex.events.CustomEvent;
+			import org.apache.flex.events.Event;
+			import org.apache.flex.utils.Timer;
+			
+			private var timer:org.apache.flex.utils.Timer;
+			
+			public function get symbol():String
+			{
+				return list.selectedItem as String;
+			}
+			
+			public function get city():String
+			{
+				return cityList.selectedItem as String;
+			}
+			
+			public function get inputText():String
+			{
+				return input.text;
+			}
+			
+			public function get comboBoxValue():String
+			{
+				return String(comboBox.selectedItem);
+			}
+			
+			public function startTimer(event:org.apache.flex.events.Event):void
+			{
+				timer = new org.apache.flex.utils.Timer(1000);
+				timer.addEventListener('timer', timerHandler);
+				timer.start()				
+			}
+			
+			public function timerHandler(event:org.apache.flex.events.Event):void
+			{
+				timerLabel.text = timer.currentCount.toString();	
+			}
+        ]]>
+    </fx:Script>
+	<basic:Label id="lbl" x="100" y="25" >
+		<basic:beads>
+			<basic:SimpleBinding eventName="labelTextChanged"
+								 sourceID="applicationModel"
+								 sourcePropertyName="labelText"
+								 destinationPropertyName="text" />
+		</basic:beads>
+	</basic:Label>
+	<basic:TextButton text="Let's Start Timer" x="100" y="75" click="startTimer(event)" />
+	<basic:TextButton text="Stop Timer" x="100" y="100" click="timer.removeEventListener('timer', timerHandler);timer.stop()" />
+	<basic:Label id="timerLabel" x="100" y="125" />
+	
+	<basic:List id="cityList"  x="200" y="75" width="100" height="75" change="dispatchEvent(new CustomEvent('cityListChanged'))">
+		<basic:beads>
+			<basic:ConstantBinding
+				sourceID="applicationModel"
+				sourcePropertyName="cities"
+				destinationPropertyName="dataProvider" />
+		</basic:beads>
+	</basic:List>
+	
+	<basic:TextArea x="320" y="25" width="150" height="75">
+		<basic:beads>
+			<basic:SimpleBinding eventName="labelTextChanged"
+								 sourceID="applicationModel"
+								 sourcePropertyName="labelText"
+								 destinationPropertyName="text" />
+		</basic:beads>
+	</basic:TextArea>
+	<basic:TextInput id="input" x="320" y="110" />
+	<basic:TextButton text="Transfer" x="320" y="138" click="dispatchEvent(new CustomEvent('transferClicked'))" />
+	
+	<basic:CheckBox id="checkbox" x="320" y="170" text="Check Me" />
+	
+	<basic:RadioButton groupName="group1" text="Apples" value="0" x="100" y="150" />
+	<basic:RadioButton groupName="group1" text="Oranges" value="1" x="100" y="170" selected="true" />
+	<basic:RadioButton groupName="group1" text="Grapes" value="2" x="100" y="190" />
+	
+	<basic:RadioButton groupName="group2" text="Red" value="red" x="100" y="250" selected="true" />
+	<basic:RadioButton groupName="group2" text="Green" value="green" x="100" y="270" />
+	<basic:RadioButton groupName="group2" text="Blue" value="blue" x="100" y="290"  />
+	
+	<basic:DropDownList id="list" x="200" y="200" width="100" height="24" change="dispatchEvent(new CustomEvent('listChanged'))">
+		<basic:beads>
+			<basic:ConstantBinding
+				sourceID="applicationModel"
+				sourcePropertyName="strings"
+				destinationPropertyName="dataProvider" />
+		</basic:beads>
+	</basic:DropDownList>
+	<basic:TextButton text="OK" x="200" y="230" click="dispatchEvent(new CustomEvent('buttonClicked'))" />
+	
+	<basic:ComboBox id="comboBox" x="320" y="200" width="100" change="dispatchEvent(new CustomEvent('comboBoxChanged'))">
+		<basic:beads>
+			<basic:ConstantBinding
+				sourceID="applicationModel"
+				sourcePropertyName="cities"
+				destinationPropertyName="dataProvider" />
+		</basic:beads>
+	</basic:ComboBox>
+    
+</basic:ViewBase>

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/MyInitialView_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/MyInitialView_result.js b/compiler-jx/src/test/resources/flexjs/files/MyInitialView_result.js
new file mode 100644
index 0000000..95b90ce
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/MyInitialView_result.js
@@ -0,0 +1,889 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * MyInitialView
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('MyInitialView');
+
+goog.require('org.apache.flex.core.ViewBase');
+goog.require('org.apache.flex.html.Label');
+goog.require('org.apache.flex.binding.SimpleBinding');
+goog.require('org.apache.flex.html.TextButton');
+goog.require('org.apache.flex.html.List');
+goog.require('org.apache.flex.binding.ConstantBinding');
+goog.require('org.apache.flex.html.TextArea');
+goog.require('org.apache.flex.html.TextInput');
+goog.require('org.apache.flex.html.CheckBox');
+goog.require('org.apache.flex.html.RadioButton');
+goog.require('org.apache.flex.html.DropDownList');
+goog.require('org.apache.flex.html.ComboBox');
+goog.require('org.apache.flex.events.CustomEvent');
+goog.require('org.apache.flex.events.Event');
+goog.require('org.apache.flex.events.MouseEvent');
+goog.require('org.apache.flex.utils.Timer');
+
+
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.ViewBase}
+ */
+MyInitialView = function() {
+  MyInitialView.base(this, 'constructor');
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.Label}
+   */
+  this.lbl_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.binding.SimpleBinding}
+   */
+  this.$ID0_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.TextButton}
+   */
+  this.$ID1_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.TextButton}
+   */
+  this.$ID2_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.Label}
+   */
+  this.timerLabel_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.List}
+   */
+  this.cityList_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.binding.ConstantBinding}
+   */
+  this.$ID3_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.TextArea}
+   */
+  this.$ID5_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.binding.SimpleBinding}
+   */
+  this.$ID4_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.TextInput}
+   */
+  this.input_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.TextButton}
+   */
+  this.$ID6_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.CheckBox}
+   */
+  this.checkbox_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.RadioButton}
+   */
+  this.$ID7_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.RadioButton}
+   */
+  this.$ID8_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.RadioButton}
+   */
+  this.$ID9_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.RadioButton}
+   */
+  this.$ID10_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.RadioButton}
+   */
+  this.$ID11_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.RadioButton}
+   */
+  this.$ID12_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.DropDownList}
+   */
+  this.list_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.binding.ConstantBinding}
+   */
+  this.$ID13_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.TextButton}
+   */
+  this.$ID14_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.html.ComboBox}
+   */
+  this.comboBox_;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.binding.ConstantBinding}
+   */
+  this.$ID15_;
+  
+  /**
+   * @private
+   * @type {Array}
+   */
+  this.mxmldd;
+  
+  /**
+   * @private
+   * @type {Array}
+   */
+  this.mxmldp;
+};
+goog.inherits(MyInitialView, org.apache.flex.core.ViewBase);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+MyInitialView.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'MyInitialView', qName: 'MyInitialView' }] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('MyInitialView', MyInitialView);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+MyInitialView.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+        'symbol': { type: 'String', declaredBy: 'MyInitialView'},
+        'city': { type: 'String', declaredBy: 'MyInitialView'},
+        'inputText': { type: 'String', declaredBy: 'MyInitialView'},
+        'comboBoxValue': { type: 'String', declaredBy: 'MyInitialView'},
+        'lbl': { type: 'org.apache.flex.html.Label', declaredBy: 'MyInitialView'},
+        'timerLabel': { type: 'org.apache.flex.html.Label', declaredBy: 'MyInitialView'},
+        'cityList': { type: 'org.apache.flex.html.List', declaredBy: 'MyInitialView'},
+        'input': { type: 'org.apache.flex.html.TextInput', declaredBy: 'MyInitialView'},
+        'checkbox': { type: 'org.apache.flex.html.CheckBox', declaredBy: 'MyInitialView'},
+        'list': { type: 'org.apache.flex.html.DropDownList', declaredBy: 'MyInitialView'},
+        'comboBox': { type: 'org.apache.flex.html.ComboBox', declaredBy: 'MyInitialView'}
+      };
+    },
+    methods: function () {
+      return {
+        'startTimer': { type: 'void', declaredBy: 'MyInitialView'},
+        'timerHandler': { type: 'void', declaredBy: 'MyInitialView'},
+        '$EH0': { type: 'void', declaredBy: 'MyInitialView'},
+        '$EH1': { type: 'void', declaredBy: 'MyInitialView'},
+        '$EH2': { type: 'void', declaredBy: 'MyInitialView'},
+        '$EH3': { type: 'void', declaredBy: 'MyInitialView'},
+        '$EH4': { type: 'void', declaredBy: 'MyInitialView'},
+        '$EH5': { type: 'void', declaredBy: 'MyInitialView'},
+        '$EH6': { type: 'void', declaredBy: 'MyInitialView'}
+      };
+    }
+  };
+};
+
+
+
+/**
+ * @private
+ * @type {org.apache.flex.utils.Timer}
+ */
+MyInitialView.prototype.timer;
+
+
+;
+
+
+;
+
+
+;
+
+
+;
+
+
+/**
+ * @export
+ * @param {org.apache.flex.events.Event} event
+ */
+MyInitialView.prototype.startTimer = function(event) {
+  this.timer = new org.apache.flex.utils.Timer(1000);
+  this.timer.addEventListener('timer', org.apache.flex.utils.Language.closure(this.timerHandler, this, 'timerHandler'));
+  this.timer.start();
+};
+
+
+/**
+ * @export
+ * @param {org.apache.flex.events.Event} event
+ */
+MyInitialView.prototype.timerHandler = function(event) {
+  this.timerLabel.text = this.timer.currentCount.toString();
+};
+
+
+
+
+
+Object.defineProperties(MyInitialView.prototype, /** @lends {MyInitialView.prototype} */ {
+/** @export */
+symbol: {
+get: /** @this {MyInitialView} */ function() {
+  return org.apache.flex.utils.Language.as(this.list.selectedItem, String);
+}},
+/** @export */
+city: {
+get: /** @this {MyInitialView} */ function() {
+  return org.apache.flex.utils.Language.as(this.cityList.selectedItem, String);
+}},
+/** @export */
+inputText: {
+get: /** @this {MyInitialView} */ function() {
+  return this.input.text;
+}},
+/** @export */
+comboBoxValue: {
+get: /** @this {MyInitialView} */ function() {
+  return String(this.comboBox.selectedItem);
+}}}
+);/**
+ * @export
+ * @param {org.apache.flex.events.MouseEvent} event
+ */
+MyInitialView.prototype.$EH0 = function(event)
+{
+  this.startTimer(event);
+};
+
+
+/**
+ * @export
+ * @param {org.apache.flex.events.MouseEvent} event
+ */
+MyInitialView.prototype.$EH1 = function(event)
+{
+  this.timer.removeEventListener('timer', org.apache.flex.utils.Language.closure(this.timerHandler, this, 'timerHandler'));
+  this.timer.stop();
+};
+
+
+/**
+ * @export
+ * @param {org.apache.flex.events.Event} event
+ */
+MyInitialView.prototype.$EH2 = function(event)
+{
+  this.dispatchEvent(new org.apache.flex.events.CustomEvent('cityListChanged'));
+};
+
+
+/**
+ * @export
+ * @param {org.apache.flex.events.MouseEvent} event
+ */
+MyInitialView.prototype.$EH3 = function(event)
+{
+  this.dispatchEvent(new org.apache.flex.events.CustomEvent('transferClicked'));
+};
+
+
+/**
+ * @export
+ * @param {org.apache.flex.events.Event} event
+ */
+MyInitialView.prototype.$EH4 = function(event)
+{
+  this.dispatchEvent(new org.apache.flex.events.CustomEvent('listChanged'));
+};
+
+
+/**
+ * @export
+ * @param {org.apache.flex.events.MouseEvent} event
+ */
+MyInitialView.prototype.$EH5 = function(event)
+{
+  this.dispatchEvent(new org.apache.flex.events.CustomEvent('buttonClicked'));
+};
+
+
+/**
+ * @export
+ * @param {org.apache.flex.events.Event} event
+ */
+MyInitialView.prototype.$EH6 = function(event)
+{
+  this.dispatchEvent(new org.apache.flex.events.CustomEvent('comboBoxChanged'));
+};
+
+
+Object.defineProperties(MyInitialView.prototype, /** @lends {MyInitialView.prototype} */ {
+/** @export */
+    lbl: {
+    /** @this {MyInitialView} */
+    get: function() {
+      return this.lbl_;
+    },
+    /** @this {MyInitialView} */
+    set: function(value) {
+      if (value != this.lbl_) {
+        this.lbl_ = value;
+        this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(this, 'lbl', null, value));
+      }
+    }
+  },
+  /** @export */
+    timerLabel: {
+    /** @this {MyInitialView} */
+    get: function() {
+      return this.timerLabel_;
+    },
+    /** @this {MyInitialView} */
+    set: function(value) {
+      if (value != this.timerLabel_) {
+        this.timerLabel_ = value;
+        this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(this, 'timerLabel', null, value));
+      }
+    }
+  },
+  /** @export */
+    cityList: {
+    /** @this {MyInitialView} */
+    get: function() {
+      return this.cityList_;
+    },
+    /** @this {MyInitialView} */
+    set: function(value) {
+      if (value != this.cityList_) {
+        this.cityList_ = value;
+        this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(this, 'cityList', null, value));
+      }
+    }
+  },
+  /** @export */
+    input: {
+    /** @this {MyInitialView} */
+    get: function() {
+      return this.input_;
+    },
+    /** @this {MyInitialView} */
+    set: function(value) {
+      if (value != this.input_) {
+        this.input_ = value;
+        this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(this, 'input', null, value));
+      }
+    }
+  },
+  /** @export */
+    checkbox: {
+    /** @this {MyInitialView} */
+    get: function() {
+      return this.checkbox_;
+    },
+    /** @this {MyInitialView} */
+    set: function(value) {
+      if (value != this.checkbox_) {
+        this.checkbox_ = value;
+        this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(this, 'checkbox', null, value));
+      }
+    }
+  },
+  /** @export */
+    list: {
+    /** @this {MyInitialView} */
+    get: function() {
+      return this.list_;
+    },
+    /** @this {MyInitialView} */
+    set: function(value) {
+      if (value != this.list_) {
+        this.list_ = value;
+        this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(this, 'list', null, value));
+      }
+    }
+  },
+  /** @export */
+    comboBox: {
+    /** @this {MyInitialView} */
+    get: function() {
+      return this.comboBox_;
+    },
+    /** @this {MyInitialView} */
+    set: function(value) {
+      if (value != this.comboBox_) {
+        this.comboBox_ = value;
+        this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(this, 'comboBox', null, value));
+      }
+    }
+  },
+  'MXMLDescriptor': {
+    /** @this {MyInitialView} */
+    get: function() {
+      {
+        if (this.mxmldd == undefined)
+        {
+          /** @type {Array} */
+          var arr = org.apache.flex.utils.Language.superGetter(MyInitialView,this, 'MXMLDescriptor');
+          /** @type {Array} */
+          var data = [
+      org.apache.flex.html.Label,
+4,
+'id',
+true,
+'lbl',
+'x',
+true,
+100,
+'y',
+true,
+25,
+'beads',
+null, [org.apache.flex.binding.SimpleBinding, 5, '_id', true, '$ID0', 'eventName', true, 'labelTextChanged', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'labelText', 'destinationPropertyName', true, 'text', 0, 0, null],
+0,
+0,
+null,
+org.apache.flex.html.TextButton,
+4,
+'_id',
+true,
+'$ID1',
+'text',
+true,
+'Let\'s Start Timer',
+'x',
+true,
+100,
+'y',
+true,
+75,
+0,
+1,
+'click',
+this.$EH0,
+null,
+org.apache.flex.html.TextButton,
+4,
+'_id',
+true,
+'$ID2',
+'text',
+true,
+'Stop Timer',
+'x',
+true,
+100,
+'y',
+true,
+100,
+0,
+1,
+'click',
+this.$EH1,
+null,
+org.apache.flex.html.Label,
+3,
+'id',
+true,
+'timerLabel',
+'x',
+true,
+100,
+'y',
+true,
+125,
+0,
+0,
+null,
+org.apache.flex.html.List,
+6,
+'id',
+true,
+'cityList',
+'x',
+true,
+200,
+'y',
+true,
+75,
+'width',
+true,
+100,
+'height',
+true,
+75,
+'beads',
+null, [org.apache.flex.binding.ConstantBinding, 4, '_id', true, '$ID3', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'cities', 'destinationPropertyName', true, 'dataProvider', 0, 0, null],
+0,
+1,
+'change',
+this.$EH2,
+null,
+org.apache.flex.html.TextArea,
+6,
+'_id',
+true,
+'$ID5',
+'x',
+true,
+320,
+'y',
+true,
+25,
+'width',
+true,
+150,
+'height',
+true,
+75,
+'beads',
+null, [org.apache.flex.binding.SimpleBinding, 5, '_id', true, '$ID4', 'eventName', true, 'labelTextChanged', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'labelText', 'destinationPropertyName', true, 'text', 0, 0, null],
+0,
+0,
+null,
+org.apache.flex.html.TextInput,
+3,
+'id',
+true,
+'input',
+'x',
+true,
+320,
+'y',
+true,
+110,
+0,
+0,
+null,
+org.apache.flex.html.TextButton,
+4,
+'_id',
+true,
+'$ID6',
+'text',
+true,
+'Transfer',
+'x',
+true,
+320,
+'y',
+true,
+138,
+0,
+1,
+'click',
+this.$EH3,
+null,
+org.apache.flex.html.CheckBox,
+4,
+'id',
+true,
+'checkbox',
+'x',
+true,
+320,
+'y',
+true,
+170,
+'text',
+true,
+'Check Me',
+0,
+0,
+null,
+org.apache.flex.html.RadioButton,
+6,
+'_id',
+true,
+'$ID7',
+'groupName',
+true,
+'group1',
+'text',
+true,
+'Apples',
+'value',
+true,
+0,
+'x',
+true,
+100,
+'y',
+true,
+150,
+0,
+0,
+null,
+org.apache.flex.html.RadioButton,
+7,
+'_id',
+true,
+'$ID8',
+'groupName',
+true,
+'group1',
+'text',
+true,
+'Oranges',
+'value',
+true,
+1,
+'x',
+true,
+100,
+'y',
+true,
+170,
+'selected',
+true,
+true,
+0,
+0,
+null,
+org.apache.flex.html.RadioButton,
+6,
+'_id',
+true,
+'$ID9',
+'groupName',
+true,
+'group1',
+'text',
+true,
+'Grapes',
+'value',
+true,
+2,
+'x',
+true,
+100,
+'y',
+true,
+190,
+0,
+0,
+null,
+org.apache.flex.html.RadioButton,
+7,
+'_id',
+true,
+'$ID10',
+'groupName',
+true,
+'group2',
+'text',
+true,
+'Red',
+'value',
+true,
+16711680,
+'x',
+true,
+100,
+'y',
+true,
+250,
+'selected',
+true,
+true,
+0,
+0,
+null,
+org.apache.flex.html.RadioButton,
+6,
+'_id',
+true,
+'$ID11',
+'groupName',
+true,
+'group2',
+'text',
+true,
+'Green',
+'value',
+true,
+32768,
+'x',
+true,
+100,
+'y',
+true,
+270,
+0,
+0,
+null,
+org.apache.flex.html.RadioButton,
+6,
+'_id',
+true,
+'$ID12',
+'groupName',
+true,
+'group2',
+'text',
+true,
+'Blue',
+'value',
+true,
+255,
+'x',
+true,
+100,
+'y',
+true,
+290,
+0,
+0,
+null,
+org.apache.flex.html.DropDownList,
+6,
+'id',
+true,
+'list',
+'x',
+true,
+200,
+'y',
+true,
+200,
+'width',
+true,
+100,
+'height',
+true,
+24,
+'beads',
+null, [org.apache.flex.binding.ConstantBinding, 4, '_id', true, '$ID13', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'strings', 'destinationPropertyName', true, 'dataProvider', 0, 0, null],
+0,
+1,
+'change',
+this.$EH4,
+null,
+org.apache.flex.html.TextButton,
+4,
+'_id',
+true,
+'$ID14',
+'text',
+true,
+'OK',
+'x',
+true,
+200,
+'y',
+true,
+230,
+0,
+1,
+'click',
+this.$EH5,
+null,
+org.apache.flex.html.ComboBox,
+5,
+'id',
+true,
+'comboBox',
+'x',
+true,
+320,
+'y',
+true,
+200,
+'width',
+true,
+100,
+'beads',
+null, [org.apache.flex.binding.ConstantBinding, 4, '_id', true, '$ID15', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'cities', 'destinationPropertyName', true, 'dataProvider', 0, 0, null],
+0,
+1,
+'change',
+this.$EH6,
+null
+      ];
+        
+          if (arr)
+            this.mxmldd = arr.concat(data);
+          else
+            this.mxmldd = data;
+        }
+        return this.mxmldd;
+      }
+      }
+    }
+  });
+  

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/StockDataJSONItemConverter.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/StockDataJSONItemConverter.as b/compiler-jx/src/test/resources/flexjs/files/StockDataJSONItemConverter.as
new file mode 100644
index 0000000..a39606b
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/StockDataJSONItemConverter.as
@@ -0,0 +1,40 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+    import org.apache.flex.collections.converters.JSONItemConverter;
+    
+    public class StockDataJSONItemConverter extends JSONItemConverter
+    {
+        public function StockDataJSONItemConverter()
+        {
+            super();
+        }
+        
+        override public function convertItem(data:String):Object
+        {
+            var obj:Object = super.convertItem(data);
+			if (obj["query"]["count"] == 0)
+				return "No Data";
+			
+			obj = obj["query"]["results"]["quote"];
+			return obj;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/StockDataJSONItemConverter.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/StockDataJSONItemConverter.js b/compiler-jx/src/test/resources/flexjs/files/StockDataJSONItemConverter.js
new file mode 100644
index 0000000..8e8037e
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/StockDataJSONItemConverter.js
@@ -0,0 +1,39 @@
+/**
+ * Licensed 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.
+ */
+goog.provide('StockDataJSONItemConverter');
+
+goog.require('org.apache.flex.net.JSONItemConverter');
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.net.JSONItemConverter}
+ */
+StockDataJSONItemConverter = function() {
+	goog.base(this);
+}
+goog.inherits(StockDataJSONItemConverter, org.apache.flex.net.JSONItemConverter);
+
+/**
+ * @export
+ * @param {string} data
+ * @return {Object}
+ * @override
+ */
+StockDataJSONItemConverter.prototype.convertItem = function(data) {
+	var /** @type {Object} */ obj = goog.base(this, 'convertItem', data);
+	if (obj["query"]["count"] == 0)
+		return "No Data";
+	obj = obj["query"]["results"]["quote"];
+	return obj;
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/controllers/MyController.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/controllers/MyController.as b/compiler-jx/src/test/resources/flexjs/files/controllers/MyController.as
new file mode 100644
index 0000000..d7b0547
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/controllers/MyController.as
@@ -0,0 +1,92 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 controllers
+{
+	import org.apache.flex.core.Application;
+	import org.apache.flex.core.IDocument;
+	import org.apache.flex.events.Event;
+	
+	
+	import models.MyModel;
+	
+	public class MyController implements IDocument
+	{
+		public function MyController(app:Application = null)
+		{
+			if (app)
+			{
+				this.app = app as FlexJSTest_again;
+				app.addEventListener("viewChanged", viewChangeHandler);
+			}
+		}
+		
+		private var queryBegin:String = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22";
+		private var queryEnd:String = "%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env&format=json";
+		private var app:FlexJSTest_again;
+		
+		private function viewChangeHandler(event:Event):void
+		{
+			app.initialView.addEventListener("buttonClicked", buttonClickHandler);
+			app.initialView.addEventListener("listChanged", listChangedHandler);
+			app.initialView.addEventListener("cityListChanged", cityListChangeHandler);
+			app.initialView.addEventListener("transferClicked", transferClickHandler);
+			app.initialView.addEventListener("comboBoxChanged", comboBoxChangeHandler);
+		}
+		
+		private function buttonClickHandler(event:Event):void
+		{
+			var sym:String = MyInitialView(app.initialView).symbol;
+			app.service.url = queryBegin + sym + queryEnd;
+			app.service.send();
+			app.service.addEventListener("complete", completeHandler);
+		}
+		
+		private function completeHandler(event:Event):void
+		{
+			MyModel(app.model).labelText = app.collection.getItemAt(0) as String;
+		}
+		
+		private function listChangedHandler(event:Event):void
+		{
+			MyModel(app.model).labelText = MyInitialView(app.initialView).symbol;
+		}
+		
+		private function cityListChangeHandler(event:Event):void
+		{
+			MyModel(app.model).labelText = MyInitialView(app.initialView).city;
+		}
+		
+		private function transferClickHandler(event:Event):void
+		{
+			MyModel(app.model).labelText = MyInitialView(app.initialView).inputText;
+		}
+		
+		private function comboBoxChangeHandler(event:Event):void
+		{
+			MyModel(app.model).labelText = MyInitialView(app.initialView).comboBoxValue;
+		}
+		
+		public function setDocument(document:Object, id:String = null):void
+		{
+			this.app = document as FlexJSTest_again;
+			app.addEventListener("viewChanged", viewChangeHandler);
+		}
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/controllers/MyController_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/controllers/MyController_result.js b/compiler-jx/src/test/resources/flexjs/files/controllers/MyController_result.js
new file mode 100644
index 0000000..883b408
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/controllers/MyController_result.js
@@ -0,0 +1,181 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * controllers.MyController
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('controllers.MyController');
+
+
+
+/**
+ * @constructor
+ * @implements {org.apache.flex.core.IDocument}
+ * @param {org.apache.flex.core.Application=} app
+ */
+controllers.MyController = function(app) {
+  app = typeof app !== 'undefined' ? app : null;
+  if (app) {
+    this.app = org.apache.flex.utils.Language.as(app, FlexJSTest_again);
+    app.addEventListener("viewChanged", org.apache.flex.utils.Language.closure(this.viewChangeHandler, this, 'viewChangeHandler'));
+  }
+};
+
+
+/**
+ * @private
+ * @type {string}
+ */
+controllers.MyController.prototype.queryBegin = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22";
+
+
+/**
+ * @private
+ * @type {string}
+ */
+controllers.MyController.prototype.queryEnd = "%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env&format=json";
+
+
+/**
+ * @private
+ * @type {FlexJSTest_again}
+ */
+controllers.MyController.prototype.app;
+
+
+/**
+ * @private
+ * @param {org.apache.flex.events.Event} event
+ */
+controllers.MyController.prototype.viewChangeHandler = function(event) {
+  this.app.initialView.addEventListener("buttonClicked", org.apache.flex.utils.Language.closure(this.buttonClickHandler, this, 'buttonClickHandler'));
+  this.app.initialView.addEventListener("listChanged", org.apache.flex.utils.Language.closure(this.listChangedHandler, this, 'listChangedHandler'));
+  this.app.initialView.addEventListener("cityListChanged", org.apache.flex.utils.Language.closure(this.cityListChangeHandler, this, 'cityListChangeHandler'));
+  this.app.initialView.addEventListener("transferClicked", org.apache.flex.utils.Language.closure(this.transferClickHandler, this, 'transferClickHandler'));
+  this.app.initialView.addEventListener("comboBoxChanged", org.apache.flex.utils.Language.closure(this.comboBoxChangeHandler, this, 'comboBoxChangeHandler'));
+};
+
+
+/**
+ * @private
+ * @param {org.apache.flex.events.Event} event
+ */
+controllers.MyController.prototype.buttonClickHandler = function(event) {
+  var /** @type {string} */ sym = org.apache.flex.utils.Language.as(this.app.initialView, MyInitialView, true).symbol;
+  this.app.service.url = this.queryBegin + sym + this.queryEnd;
+  this.app.service.send();
+  this.app.service.addEventListener("complete", org.apache.flex.utils.Language.closure(this.completeHandler, this, 'completeHandler'));
+};
+
+
+/**
+ * @private
+ * @param {org.apache.flex.events.Event} event
+ */
+controllers.MyController.prototype.completeHandler = function(event) {
+  org.apache.flex.utils.Language.as(this.app.model, models.MyModel, true).labelText = org.apache.flex.utils.Language.as(this.app.collection.getItemAt(0), String);
+};
+
+
+/**
+ * @private
+ * @param {org.apache.flex.events.Event} event
+ */
+controllers.MyController.prototype.listChangedHandler = function(event) {
+  org.apache.flex.utils.Language.as(this.app.model, models.MyModel, true).labelText = org.apache.flex.utils.Language.as(this.app.initialView, MyInitialView, true).symbol;
+};
+
+
+/**
+ * @private
+ * @param {org.apache.flex.events.Event} event
+ */
+controllers.MyController.prototype.cityListChangeHandler = function(event) {
+  org.apache.flex.utils.Language.as(this.app.model, models.MyModel, true).labelText = org.apache.flex.utils.Language.as(this.app.initialView, MyInitialView, true).city;
+};
+
+
+/**
+ * @private
+ * @param {org.apache.flex.events.Event} event
+ */
+controllers.MyController.prototype.transferClickHandler = function(event) {
+  org.apache.flex.utils.Language.as(this.app.model, models.MyModel, true).labelText = org.apache.flex.utils.Language.as(this.app.initialView, MyInitialView, true).inputText;
+};
+
+
+/**
+ * @private
+ * @param {org.apache.flex.events.Event} event
+ */
+controllers.MyController.prototype.comboBoxChangeHandler = function(event) {
+  org.apache.flex.utils.Language.as(this.app.model, models.MyModel, true).labelText = org.apache.flex.utils.Language.as(this.app.initialView, MyInitialView, true).comboBoxValue;
+};
+
+
+/**
+ * @export
+ * @param {Object} document
+ * @param {string=} id
+ */
+controllers.MyController.prototype.setDocument = function(document, id) {
+  id = typeof id !== 'undefined' ? id : null;
+  this.app = org.apache.flex.utils.Language.as(document, FlexJSTest_again);
+  this.app.addEventListener("viewChanged", org.apache.flex.utils.Language.closure(this.viewChangeHandler, this, 'viewChangeHandler'));
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+controllers.MyController.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'MyController', qName: 'controllers.MyController'}], interfaces: [org.apache.flex.core.IDocument] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('controllers.MyController', controllers.MyController);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+controllers.MyController.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'MyController': { type: '', declaredBy: 'controllers.MyController'},
+        'setDocument': { type: 'void', declaredBy: 'controllers.MyController'}
+      };
+    }
+  };
+};
+

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/models/MyModel.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/models/MyModel.as b/compiler-jx/src/test/resources/flexjs/files/models/MyModel.as
new file mode 100644
index 0000000..1dc23e6
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/models/MyModel.as
@@ -0,0 +1,59 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 models
+{
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
+	
+	public class MyModel extends EventDispatcher
+	{
+		public function MyModel()
+		{
+		}
+		
+		private var _labelText:String;
+		
+		public function get labelText():String
+		{
+			return _labelText;
+		}
+		
+		public function set labelText(value:String):void
+		{
+			if (value != _labelText)
+			{
+				_labelText = value;
+				dispatchEvent(new Event("labelTextChanged"));
+			}
+		}
+        
+        private var _strings:Array = ["AAPL", "ADBE", "GOOG", "MSFT", "YHOO"];
+        public function get strings():Array
+        {
+            return _strings;
+        }
+		
+		private var _cities:Array = ["London", "Miami", "Paris", "Sydney", "Tokyo"];
+		public function get cities():Array
+		{
+			return _cities;
+		}
+
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/models/MyModel_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/models/MyModel_result.js b/compiler-jx/src/test/resources/flexjs/files/models/MyModel_result.js
new file mode 100644
index 0000000..7a26fe9
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/models/MyModel_result.js
@@ -0,0 +1,125 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * models.MyModel
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('models.MyModel');
+
+
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.events.EventDispatcher}
+ */
+models.MyModel = function() {
+  models.MyModel.base(this, 'constructor');
+
+this._strings = ["AAPL", "ADBE", "GOOG", "MSFT", "YHOO"];
+this._cities = ["London", "Miami", "Paris", "Sydney", "Tokyo"];
+};
+goog.inherits(models.MyModel, org.apache.flex.events.EventDispatcher);
+
+
+/**
+ * @private
+ * @type {string}
+ */
+models.MyModel.prototype._labelText;
+
+
+/**
+ * @private
+ * @type {Array}
+ */
+models.MyModel.prototype._strings;
+
+
+/**
+ * @private
+ * @type {Array}
+ */
+models.MyModel.prototype._cities;
+
+
+Object.defineProperties(models.MyModel.prototype, /** @lends {models.MyModel.prototype} */ {
+/** @export */
+labelText: {
+get: /** @this {models.MyModel} */ function() {
+  return this._labelText;
+},
+set: /** @this {models.MyModel} */ function(value) {
+  if (value != this._labelText) {
+    this._labelText = value;
+    this.dispatchEvent(new org.apache.flex.events.Event("labelTextChanged"));
+  }
+}},
+/** @export */
+strings: {
+get: /** @this {models.MyModel} */ function() {
+  return this._strings;
+}},
+/** @export */
+cities: {
+get: /** @this {models.MyModel} */ function() {
+  return this._cities;
+}}}
+);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+models.MyModel.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'MyModel', qName: 'models.MyModel'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('models.MyModel', models.MyModel);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+models.MyModel.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+        'labelText': { type: 'String', declaredBy: 'models.MyModel'},
+        'strings': { type: 'Array', declaredBy: 'models.MyModel'},
+        'cities': { type: 'Array', declaredBy: 'models.MyModel'}
+      };
+    },
+    methods: function () {
+      return {
+        'MyModel': { type: '', declaredBy: 'models.MyModel'}
+      };
+    }
+  };
+};
+

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/wildcard_import.mxml
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/wildcard_import.mxml b/compiler-jx/src/test/resources/flexjs/files/wildcard_import.mxml
new file mode 100644
index 0000000..99406bc
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/wildcard_import.mxml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<basic:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+				   xmlns:basic="library://ns.apache.org/flexjs/basic" 
+				   >
+	<fx:Script>
+		<![CDATA[
+			
+			import org.apache.flex.html.*;
+			
+			private function tmp():void
+			{
+				var myButton:Button;
+				
+				myButton = new Button();				
+			}
+			
+		]]>
+	</fx:Script>
+</basic:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/files/wildcard_import_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/files/wildcard_import_result.js b/compiler-jx/src/test/resources/flexjs/files/wildcard_import_result.js
new file mode 100644
index 0000000..4ef8a61
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/files/wildcard_import_result.js
@@ -0,0 +1,99 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * wildcard_import
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('wildcard_import');
+
+goog.require('org.apache.flex.core.Application');
+goog.require('org.apache.flex.html.Button');
+
+
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.Application}
+ */
+wildcard_import = function() {
+  wildcard_import.base(this, 'constructor');
+  
+  /**
+   * @private
+   * @type {Array}
+   */
+  this.mxmldd;
+  
+  /**
+   * @private
+   * @type {Array}
+   */
+  this.mxmldp;
+};
+goog.inherits(wildcard_import, org.apache.flex.core.Application);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+wildcard_import.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'wildcard_import', qName: 'wildcard_import' }] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('wildcard_import', wildcard_import);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+wildcard_import.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+      };
+    }
+  };
+};
+
+
+
+/**
+ * @private
+ */
+wildcard_import.prototype.tmp = function() {
+  var /** @type {org.apache.flex.html.Button} */ myButton;
+  myButton = new org.apache.flex.html.Button();
+};
+
+
+

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/Test.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/Test.as b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/Test.as
new file mode 100644
index 0000000..9190d6e
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/Test.as
@@ -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
+{
+	import classes.A;
+	import classes.C;
+	import interfaces.IC;
+
+  public class Test extends A
+  {
+    public function Test()
+    {
+      super();
+    }
+    
+    override public function someFunction():C
+    {
+		return null;
+    }
+	
+	override public function someOtherFunction():IC
+	{
+		return null;
+    }
+	
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/Test_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/Test_result.js b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/Test_result.js
new file mode 100644
index 0000000..8f8fd20
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/Test_result.js
@@ -0,0 +1,94 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Test
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Test');
+
+goog.require('classes.A');
+
+
+
+/**
+ * @constructor
+ * @extends {classes.A}
+ */
+Test = function() {
+  Test.base(this, 'constructor');
+};
+goog.inherits(Test, classes.A);
+
+
+/**
+ * @export
+ * @override
+ */
+Test.prototype.someFunction = function() {
+  return null;
+};
+
+
+/**
+ * @export
+ * @override
+ */
+Test.prototype.someOtherFunction = function() {
+  return null;
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Test.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Test', qName: 'Test'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Test', Test);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Test.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'Test': { type: '', declaredBy: 'Test'},
+        'someFunction': { type: 'C', declaredBy: 'Test'},
+        'someOtherFunction': { type: 'IC', declaredBy: 'Test'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/A.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/A.as b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/A.as
new file mode 100644
index 0000000..004a607
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/A.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 classes
+{
+  import interfaces.IA;
+  import interfaces.IB;
+  
+  public class A implements IA
+  {
+    public function A()
+    {
+    }
+	
+	public function someFunction():B
+	{
+		return null;
+	}
+	
+	public function someOtherFunction():IB
+	{
+		return null;
+	}
+
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/A_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/A_result.js b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/A_result.js
new file mode 100644
index 0000000..e3320af
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/A_result.js
@@ -0,0 +1,92 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * classes.A
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.A');
+
+goog.require('interfaces.IA');
+
+
+
+/**
+ * @constructor
+ * @implements {interfaces.IA}
+ */
+classes.A = function() {
+};
+
+
+/**
+ * @export
+ * @return {classes.B}
+ */
+classes.A.prototype.someFunction = function() {
+  return null;
+};
+
+
+/**
+ * @export
+ * @return {interfaces.IB}
+ */
+classes.A.prototype.someOtherFunction = function() {
+  return null;
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'classes.A'}], interfaces: [interfaces.IA] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.A', classes.A);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.A.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'A': { type: '', declaredBy: 'classes.A'},
+        'someFunction': { type: 'B', declaredBy: 'classes.A'},
+        'someOtherFunction': { type: 'IB', declaredBy: 'classes.A'}
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/B.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/B.as b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/B.as
new file mode 100644
index 0000000..b410e59
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/B.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 classes
+{
+    public class B
+    {
+        public function B() {}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/B_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/B_result.js b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/B_result.js
new file mode 100644
index 0000000..8aaa2f7
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/B_result.js
@@ -0,0 +1,69 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * classes.B
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.B');
+
+
+
+/**
+ * @constructor
+ */
+classes.B = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.B.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'B', qName: 'classes.B'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.B', classes.B);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.B.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'B': { type: '', declaredBy: 'classes.B'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/C.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/C.as b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/C.as
new file mode 100644
index 0000000..d414a26
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/C.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 classes
+{
+    public class C
+    {
+        public function C() {}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/C_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/C_result.js b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/C_result.js
new file mode 100644
index 0000000..46f094f
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/classes/C_result.js
@@ -0,0 +1,69 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * classes.C
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('classes.C');
+
+
+
+/**
+ * @constructor
+ */
+classes.C = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.C.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'C', qName: 'classes.C'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('classes.C', classes.C);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+classes.C.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'C': { type: '', declaredBy: 'classes.C'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IA.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IA.as b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IA.as
new file mode 100644
index 0000000..6f363bc
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IA.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+  import classes.B;
+  
+  public interface IA 
+  {
+	  function someFunction():B;
+	  function someOtherFunction():IB;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IA_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IA_result.js b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IA_result.js
new file mode 100644
index 0000000..04220e1
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IA_result.js
@@ -0,0 +1,69 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IA
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IA');
+
+
+
+
+/**
+ * @interface
+ */
+interfaces.IA = function() {
+};
+interfaces.IA.prototype.someFunction = function() {
+};
+interfaces.IA.prototype.someOtherFunction = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IA.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IA', qName: 'interfaces.IA'}] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IA.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'someFunction': { type: 'B', declaredBy: 'interfaces.IA'},
+        'someOtherFunction': { type: 'IB', declaredBy: 'interfaces.IA'}
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IB.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IB.as b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IB.as
new file mode 100644
index 0000000..a995635
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IB.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+    public interface IB {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IB_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IB_result.js b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IB_result.js
new file mode 100644
index 0000000..01a7fe6
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IB_result.js
@@ -0,0 +1,62 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IB
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IB');
+
+
+
+/**
+ * @interface
+ */
+interfaces.IB = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IB.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IB', qName: 'interfaces.IB'}] };
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IB.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+      };
+    }
+  };
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IC.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IC.as b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IC.as
new file mode 100644
index 0000000..3a650c7
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IC.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+  public interface IC {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IC_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IC_result.js b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IC_result.js
new file mode 100644
index 0000000..f9b77c6
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/bad_overrides/interfaces/IC_result.js
@@ -0,0 +1,62 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IC
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('interfaces.IC');
+
+
+
+/**
+ * @interface
+ */
+interfaces.IC = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IC.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IC', qName: 'interfaces.IC'}]};
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+interfaces.IC.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+      };
+    }
+  };
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/circular/Base.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular/Base.as b/compiler-jx/src/test/resources/flexjs/projects/circular/Base.as
new file mode 100644
index 0000000..64798d8
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/circular/Base.as
@@ -0,0 +1,30 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+	import Super;
+
+  public class Base extends Super
+  {
+    public function Base() 
+    {
+      super();
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/flexjs/projects/circular/Base_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/circular/Base_result.js b/compiler-jx/src/test/resources/flexjs/projects/circular/Base_result.js
new file mode 100644
index 0000000..e9f581c
--- /dev/null
+++ b/compiler-jx/src/test/resources/flexjs/projects/circular/Base_result.js
@@ -0,0 +1,74 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Base
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes|accessControls}
+ */
+
+goog.provide('Base');
+
+goog.require('Super');
+
+
+
+/**
+ * @constructor
+ * @extends {Super}
+ */
+Base = function() {
+  Base.base(this, 'constructor');
+};
+goog.inherits(Base, Super);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Base.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Base', qName: 'Base'}] };
+
+
+/**
+ * Prevent renaming of class. Needed for reflection.
+ */
+goog.exportSymbol('Base', Base);
+
+
+
+/**
+ * Reflection
+ *
+ * @return {Object.<string, Function>}
+ */
+Base.prototype.FLEXJS_REFLECTION_INFO = function () {
+  return {
+    variables: function () {
+      return {
+      };
+    },
+    accessors: function () {
+      return {
+      };
+    },
+    methods: function () {
+      return {
+        'Base': { type: '', declaredBy: 'Base'}
+      };
+    }
+  };
+};


[22/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogClass.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogClass.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogClass.java
new file mode 100644
index 0000000..2bad420
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogClass.java
@@ -0,0 +1,260 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.TestClass;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of 'goog' JS code for Classes.
+ * 
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class TestGoogClass extends TestClass
+{
+    @Override
+    @Test
+    public void testSimple()
+    {
+        IClassNode node = getClassNode("public class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleInternal()
+    {
+        // (erikdebruin) the AS compiler will enforce 'internal' namespace, 
+        //               in JS we ignore it
+        IClassNode node = getClassNode("internal class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleFinal()
+    {
+        // (erikdebruin) the AS compiler will enforce the 'final' keyword, 
+        //               in JS we ignore it
+        IClassNode node = getClassNode("public final class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleDynamic()
+    {
+        // (erikdebruin) all JS objects are 'dynamic' by design
+        IClassNode node = getClassNode("public dynamic class A{}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleExtends()
+    {
+        IClassNode node = getClassNode("public class A extends EventTarget {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n */\norg.apache.flex.A = function() {\n\torg.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Override
+    @Test
+    public void testSimpleImplements()
+    {
+        IClassNode node = getClassNode("public class A implements IEventDispatcher {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @implements {flash.events.IEventDispatcher}\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public class A implements IEventDispatcher, ListenableKey {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @implements {flash.events.IEventDispatcher}\n * @implements {goog.events.ListenableKey}\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleExtendsImplements()
+    {
+        IClassNode node = getClassNode("public class A extends EventTarget implements IEventDispatcher {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n * @implements {flash.events.IEventDispatcher}\n */\norg.apache.flex.A = function() {\n\torg.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Override
+    @Test
+    public void testSimpleExtendsImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public class A extends EventTarget implements IEventDispatcher, ListenableKey {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n * @implements {flash.events.IEventDispatcher}\n * @implements {goog.events.ListenableKey}\n */\norg.apache.flex.A = function() {\n\torg.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Override
+    @Test
+    public void testSimpleFinalExtendsImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public final class A extends EventTarget implements IEventDispatcher, ListenableKey {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n * @implements {flash.events.IEventDispatcher}\n * @implements {goog.events.ListenableKey}\n */\norg.apache.flex.A = function() {\n\torg.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Override
+    @Test
+    public void testQualifiedExtendsImplementsMultiple()
+    {
+        IClassNode node = getClassNode("public class A extends goog.events.EventTarget implements flash.events.IEventDispatcher, goog.events.ListenableKey {public function A() {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n * @implements {flash.events.IEventDispatcher}\n * @implements {goog.events.ListenableKey}\n */\norg.apache.flex.A = function() {\n\torg.apache.flex.A.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Override
+    @Test
+    public void testConstructor()
+    {
+        IClassNode node = getClassNode("public class A {public function A() { }}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};");
+    }
+
+    @Test
+    public void testConstructor_super()
+    {
+        IClassNode node = getClassNode("public class A {public function A() { super(); }}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n\tvar self = this;\n\t;\n};");
+    }
+
+    @Test
+    public void testExtendsConstructor_super()
+    {
+        IClassNode node = getClassNode("public class A extends goog.events.EventTarget { public function A() { super('foo', 42);}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n */\norg.apache.flex.A = function() {\n\tvar self = this;\n\torg.apache.flex.A.base(this, 'constructor', 'foo', 42);\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Override
+    @Test
+    public void testConstructor_withArguments()
+    {
+        IClassNode node = getClassNode("public class A {public function A(arg1:String, arg2:int) {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @param {string} arg1\n * @param {number} arg2\n */\norg.apache.flex.A = function(arg1, arg2) {\n};");
+    }
+
+    @Override
+    @Test
+    public void testExtendsConstructor_withArguments()
+    {
+        IClassNode node = getClassNode("public class A extends goog.events.EventTarget {public function A(arg1:String, arg2:int) {}}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n * @extends {goog.events.EventTarget}\n * @param {string} arg1\n * @param {number} arg2\n */\norg.apache.flex.A = function(arg1, arg2) {\n\torg.apache.flex.A.base(this, 'constructor', arg1, arg2);\n};\ngoog.inherits(org.apache.flex.A, goog.events.EventTarget);");
+    }
+
+    @Override
+    @Test
+    public void testFields()
+    {
+        IClassNode node = getClassNode("public class A {public var a:Object;protected var b:String; "
+                + "private var c:int; internal var d:uint; var e:Number}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n/**\n * @type {Object}\n */\norg.apache.flex.A.prototype.a;\n\n/**\n * @protected\n * @type {string}\n */\norg.apache.flex.A.prototype.b;\n\n/**\n * @private\n * @type {number}\n */\norg.apache.flex.A.prototype.c;\n\n/**\n * @type {number}\n */\norg.apache.flex.A.prototype.d;\n\n/**\n * @type {number}\n */\norg.apache.flex.A.prototype.e;");
+    }
+
+    @Override
+    @Test
+    public void testConstants()
+    {
+        IClassNode node = getClassNode("public class A {"
+                + "public static const A:int = 42;"
+                + "protected static const B:Number = 42;"
+                + "private static const C:Number = 42;"
+                + "foo_bar static const C:String = 'me' + 'you';");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n/**\n * @const\n * @type {number}\n */\norg.apache.flex.A.A = 42;\n\n/**\n * @protected\n * @const\n * @type {number}\n */\norg.apache.flex.A.B = 42;\n\n/**\n * @private\n * @const\n * @type {number}\n */\norg.apache.flex.A.C = 42;\n\n/**\n * @const\n * @type {string}\n */\norg.apache.flex.A.C = 'me' + 'you';");
+    }
+
+    @Override
+    @Test
+    public void testAccessors()
+    {
+        IClassNode node = getClassNode("public class A {"
+                + "public function get foo1():Object{return null;}"
+                + "public function set foo1(value:Object):void{}"
+                + "protected function get foo2():Object{return null;}"
+                + "protected function set foo2(value:Object):void{}"
+                + "private function get foo3():Object{return null;}"
+                + "private function set foo3(value:Object):void{}"
+                + "internal function get foo5():Object{return null;}"
+                + "internal function set foo5(value:Object):void{}"
+                + "foo_bar function get foo6():Object{return null;}"
+                + "foo_bar function set foo6(value:Object):void{}" + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n/**\n * @type {Object}\n */\norg.apache.flex.A.prototype.foo1;\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo1', \n\t{get:function() {\n\t\tvar self = this;\n\t\treturn null;\n\t}, configurable:true}\n);\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo1', \n\t{set:function(value) {\n\t}, configurable:true}\n);\n\n/**\n * @protected\n * @type {Object}\n */\norg.apache.flex.A.prototype.foo2;\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo2', \n\t{get:function() {\n\t\tvar self = this;\n\t\treturn null;\n\t}, configurable:true}\n);\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo2', \n\t{set:function(value) {\n\t}, configurable:true}\n);\n\n/**\n * @private\n * @type {Object}\n */\norg.apache.flex.A.prototype.foo3;\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo3', \n\t{get:function() {\n\t\tvar self = this;\
 n\t\treturn null;\n\t}, configurable:true}\n);\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo3', \n\t{set:function(value) {\n\t}, configurable:true}\n);\n\n/**\n * @type {Object}\n */\norg.apache.flex.A.prototype.foo5;\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo5', \n\t{get:function() {\n\t\tvar self = this;\n\t\treturn null;\n\t}, configurable:true}\n);\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo5', \n\t{set:function(value) {\n\t}, configurable:true}\n);\n\n/**\n * @type {Object}\n */\norg.apache.flex.A.prototype.foo6;\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo6', \n\t{get:function() {\n\t\tvar self = this;\n\t\treturn null;\n\t}, configurable:true}\n);\n\nObject.defineProperty(\n\torg.apache.flex.A.prototype, \n\t'foo6', \n\t{set:function(value) {\n\t}, configurable:true}\n);");
+    }
+
+    @Override
+    @Test
+    public void testMethods()
+    {
+        IClassNode node = getClassNode("public class A {"
+                + "public function foo1():Object{return null;}"
+                + "public final function foo1a():Object{return null;}"
+                + "override public function foo1b():Object{return super.foo1b();}"
+                + "protected function foo2(value:Object):void{}"
+                + "private function foo3(value:Object):void{}"
+                + "internal function foo5(value:Object):void{}"
+                + "foo_bar function foo6(value:Object):void{}"
+                + "public static function foo7(value:Object):void{}"
+                + "foo_bar static function foo7(value:Object):void{}" + "}");
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n/**\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1 = function() {\n\tvar self = this;\n\treturn null;\n};\n\n/**\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1a = function() {\n\tvar self = this;\n\treturn null;\n};\n\n/**\n * @return {Object}\n * @override\n */\norg.apache.flex.A.prototype.foo1b = function() {\n\tvar self = this;\n\treturn org.apache.flex.A.base(this, 'foo1b');\n};\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo2 = function(value) {\n};\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo3 = function(value) {\n};\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo5 = function(value) {\n};\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo6 = function(value) {\n};\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.foo7 = function(value) {\n};\n\n/**\n * @param {Object} va
 lue\n */\norg.apache.flex.A.foo7 = function(value) {\n};");
+    }
+
+    @Override
+    protected IClassNode getClassNode(String code)
+    {
+        String source = "package org.apache.flex {import flash.events.IEventDispatcher;import goog.events.EventTarget;import goog.events.Event;import goog.events.ListenableKey;"
+                + code + "}";
+        IFileNode node = compileAS(source);
+        IClassNode child = (IClassNode) findFirstDescendantOfType(node,
+                IClassNode.class);
+        return child;
+    }
+
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogEmiter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogEmiter.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogEmiter.java
new file mode 100644
index 0000000..21a9c90
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogEmiter.java
@@ -0,0 +1,153 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of 'goog' JavaScript output.
+ * <p>
+ * Note; this is a complete prototype more used in figuring out where
+ * abstraction and indirection is needed concerning the AS -> JS translations.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestGoogEmiter extends ASTestBase
+{
+
+    @Test
+    public void testSimple()
+    {
+        String code = "package com.example.components {"
+                + "import goog.events.EventTarget;"
+                + "public class MyEventTarget extends EventTarget {"
+                + "public function MyEventTarget() {if (foo() != 42) { bar(); } }"
+                + "private var _privateVar:String = \"do \";"
+                + "public var publicProperty:Number = 100;"
+                + "public function myFunction(value: String): String{"
+                + "return \"Don't \" + _privateVar + value; }";
+        IFileNode node = compileAS(code);
+        asBlockWalker.visitFile(node);
+        assertOut("goog.provide('com.example.components.MyEventTarget');\n\ngoog.require('goog.events.EventTarget');\n\n/**\n * @constructor\n * @extends {goog.events.EventTarget}\n */\ncom.example.components.MyEventTarget = function() {\n\tvar self = this;\n\tcom.example.components.MyEventTarget.base(this, 'constructor');\n\tif (foo() != 42) {\n\t\tbar();\n\t}\n};\ngoog.inherits(com.example.components.MyEventTarget, goog.events.EventTarget);\n\n/**\n * @private\n * @type {string}\n */\ncom.example.components.MyEventTarget.prototype._privateVar = \"do \";\n\n/**\n * @type {number}\n */\ncom.example.components.MyEventTarget.prototype.publicProperty = 100;\n\n/**\n * @param {string} value\n * @return {string}\n */\ncom.example.components.MyEventTarget.prototype.myFunction = function(value) {\n\tvar self = this;\n\treturn \"Don't \" + self._privateVar + value;\n};");
+    }
+
+    @Test
+    public void testSimpleInterface()
+    {
+        String code = "package com.example.components {"
+                + "public interface TestInterface { } }";
+        IFileNode node = compileAS(code);
+        asBlockWalker.visitFile(node);
+        assertOut("goog.provide('com.example.components.TestInterface');\n\n/**\n * @interface\n */\ncom.example.components.TestInterface = function() {\n};");
+    }
+
+    @Test
+    public void testSimpleClass()
+    {
+        String code = "package com.example.components {"
+                + "public class TestClass { } }";
+        IFileNode node = compileAS(code);
+        asBlockWalker.visitFile(node);
+        assertOut("goog.provide('com.example.components.TestClass');\n\n/**\n * @constructor\n */\ncom.example.components.TestClass = function() {\n};");
+    }
+
+    @Test
+    public void testSimpleMethod()
+    {
+        IFunctionNode node = getMethod("function method1():void{\n}");
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.method1 = function() {\n}");
+    }
+
+    @Test
+    public void testSimpleParameterReturnType()
+    {
+        IFunctionNode node = getMethodWithPackage("function method1(bar:int):int{\n}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {number} bar\n * @return {number}\n */\n"
+                + "foo.bar.FalconTest_A.prototype.method1 = function(bar) {\n}");
+    }
+
+    @Test
+    public void testSimpleMultipleParameter()
+    {
+        IFunctionNode node = getMethodWithPackage("function method1(bar:int, baz:String, goo:Array):void{\n}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {number} bar\n * @param {string} baz\n * @param {Array} goo\n */\n"
+                + "foo.bar.FalconTest_A.prototype.method1 = function(bar, baz, goo) {\n}");
+    }
+
+    @Test
+    public void testSimpleMultipleParameter_JSDoc()
+    {
+        IFunctionNode node = getMethodWithPackage("function method1(bar:int, baz:String, goo:Array):void{\n}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {number} bar\n * @param {string} baz\n * @param {Array} goo\n */\n"
+                + "foo.bar.FalconTest_A.prototype.method1 = function(bar, baz, goo) {\n}");
+    }
+
+    @Test
+    public void testDefaultParameter()
+    {
+        IFunctionNode node = getMethodWithPackage("function method1(p1:int, p2:int, p3:int = 3, p4:int = 4):int{return p1 + p2 + p3 + p4;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {number} p1\n * @param {number} p2\n * @param {number=} p3\n * @param {number=} p4\n * @return {number}\n */\n"
+                + "foo.bar.FalconTest_A.prototype.method1 = function(p1, p2, p3, p4) {\n"
+                + "\tvar self = this;\n"
+                + "\tp3 = typeof p3 !== 'undefined' ? p3 : 3;\n"
+                + "\tp4 = typeof p4 !== 'undefined' ? p4 : 4;\n"
+                + "\treturn p1 + p2 + p3 + p4;\n}");
+    }
+
+    @Test
+    public void testDefaultParameter_Body()
+    {
+        IFunctionNode node = getMethodWithPackage("function method1(bar:int = 42, bax:int = 4):void{if (a) foo();}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {number=} bar\n * @param {number=} bax\n */\n"
+                + "foo.bar.FalconTest_A.prototype.method1 = function(bar, bax) {\n"
+                + "\tvar self = this;\n"
+                + "\tbar = typeof bar !== 'undefined' ? bar : 42;\n"
+                + "\tbax = typeof bax !== 'undefined' ? bax : 4;\n"
+                + "\tif (a)\n\t\tfoo();\n}");
+    }
+
+    @Test
+    public void testDefaultParameter_NoBody()
+    {
+        IFunctionNode node = getMethodWithPackage("function method1(p1:int, p2:int, p3:int = 3, p4:int = 4):int{}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {number} p1\n * @param {number} p2\n * @param {number=} p3\n * @param {number=} p4\n * @return {number}\n */\n"
+                + "foo.bar.FalconTest_A.prototype.method1 = function(p1, p2, p3, p4) {\n"
+                + "\tp3 = typeof p3 !== 'undefined' ? p3 : 3;\n"
+                + "\tp4 = typeof p4 !== 'undefined' ? p4 : 4;\n}");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogExpressions.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogExpressions.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogExpressions.java
new file mode 100644
index 0000000..df0c1cc
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogExpressions.java
@@ -0,0 +1,195 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.TestExpressions;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.INamespaceAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class TestGoogExpressions extends TestExpressions
+{
+    @Override
+    @Test
+    public void testVisitLanguageIdentifierNode_SuperMethod_1()
+    {
+        IFunctionNode node = getMethod("function foo(){if (a) super.foo();}");
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.foo = function() {\n\tvar self = this;\n\tif (a)\n\t\tFalconTest_A.base(this, 'foo');\n}");
+    }
+
+    @Override
+    @Test
+    public void testVisitLanguageIdentifierNode_SuperMethod_2()
+    {
+        IFunctionNode node = getMethod("function foo(){if (a) super.foo(a, b, c);}");
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.foo = function() {\n\tvar self = this;\n\tif (a)\n\t\tFalconTest_A.base(this, 'foo', a, b, c);\n}");
+    }
+
+    //----------------------------------
+    // Primary expression keywords
+    //----------------------------------
+
+    //----------------------------------
+    // Logical
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testVisitBinaryOperatorNode_LogicalAndAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a &&= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a = a && b");
+    }
+
+    @Override
+    @Test
+    public void testVisitBinaryOperatorNode_LogicalOrAssignment()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a ||= b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a = a || b");
+    }
+
+    //----------------------------------
+    // Other
+    //----------------------------------
+
+    @Test
+    public void testParentheses_1()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a = (a + b);",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {*} */ a = (a + b)");
+    }
+
+    @Test
+    public void testParentheses_2()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a = (a + b) - c;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {*} */ a = (a + b) - c");
+    }
+
+    @Test
+    public void testParentheses_3()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "var a = ((a + b) - (c + d)) * e;", IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {*} */ a = ((a + b) - (c + d)) * e");
+    }
+
+    @Override
+    @Test
+    public void testAnonymousFunction()
+    {
+        IVariableNode node = (IVariableNode) getNode("var a = function(){};",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {*} */ a = function() {\n}");
+    }
+
+    @Override
+    @Test
+    public void testAnonymousFunctionWithParamsReturn()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "var a:Object = function(foo:int, bar:String = 'goo'):int{return -1;};",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Object} */ a = function(foo, bar) {\n\tbar = typeof bar !== 'undefined' ? bar : 'goo';\n\treturn -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testAnonymousFunctionAsArgument()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode(
+                "addListener('foo', function(event:Object):void{doit();})",
+                IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("addListener('foo', function(event) {\n\tdoit();\n})");
+    }
+
+    @Override
+    @Test
+    public void testVisitAs()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a as b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("(is(a, b) ? a : null)");
+    }
+
+    @Override
+    @Test
+    public void testVisitBinaryOperator_Instancof()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a instanceof b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a instanceof b");
+    }
+
+    @Override
+    @Test
+    public void testVisitBinaryOperator_Is()
+    {
+        IBinaryOperatorNode node = getBinaryNode("a is b");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("is(a, b)");
+    }
+
+    @Override
+    @Test
+    public void testVisitBinaryOperator_NamespaceAccess_1()
+    {
+        INamespaceAccessExpressionNode node = getNamespaceAccessExpressionNode("a::b");
+        asBlockWalker.visitNamespaceAccessExpression(node);
+        assertOut("a.b");
+    }
+
+    @Override
+    @Test
+    public void testVisitBinaryOperator_NamespaceAccess_2()
+    {
+        INamespaceAccessExpressionNode node = getNamespaceAccessExpressionNode("a::b::c");
+        asBlockWalker.visitNamespaceAccessExpression(node);
+        assertOut("a.b.c");
+    }
+
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogFieldMembers.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogFieldMembers.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogFieldMembers.java
new file mode 100644
index 0000000..e4ead99
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogFieldMembers.java
@@ -0,0 +1,261 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.TestFieldMembers;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of 'goog' JavaScript for Class Field members.
+ * 
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class TestGoogFieldMembers extends TestFieldMembers
+{
+    //--------------------------------------------------------------------------
+    // Fields
+    //--------------------------------------------------------------------------
+
+    @Override
+    @Test
+    public void testField()
+    {
+        IVariableNode node = getField("var foo;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @type {*}\n */\nFalconTest_A.prototype.foo");
+    }
+
+    @Override
+    @Test
+    public void testField_withType()
+    {
+        IVariableNode node = getField("var foo:int;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @type {number}\n */\nFalconTest_A.prototype.foo");
+    }
+
+    @Override
+    @Test
+    public void testField_withTypeValue()
+    {
+        IVariableNode node = getField("var foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @type {number}\n */\nFalconTest_A.prototype.foo = 420");
+    }
+
+    @Test
+    public void testField_withTypeValue_Negative()
+    {
+        IVariableNode node = getField("var foo:int = -420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @type {number}\n */\nFalconTest_A.prototype.foo = -420");
+    }
+
+    @Override
+    @Test
+    public void testField_withNamespaceTypeValue()
+    {
+        IVariableNode node = getField("private var foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @private\n * @type {number}\n */\nFalconTest_A.prototype.foo = 420");
+    }
+
+    @Override
+    @Test
+    public void testField_withCustomNamespaceTypeValue()
+    {
+        IVariableNode node = getField("mx_internal var foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        // (erikdebruin) we ignore custom namespaces completely (are there side effects I'm missing?)
+        assertOut("/**\n * @type {number}\n */\nFalconTest_A.prototype.foo = 420");
+    }
+
+    @Override
+    @Test
+    public void testField_withNamespaceTypeCollection()
+    {
+        IVariableNode node = getField("protected var foo:Vector.<Foo>;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @protected\n * @type {Vector.<Foo>}\n */\nFalconTest_A.prototype.foo");
+    }
+
+    @Override
+    @Test
+    public void testField_withNamespaceTypeCollectionComplex()
+    {
+        IVariableNode node = getField("protected var foo:Vector.<Vector.<Vector.<Foo>>>;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @protected\n * @type {Vector.<Vector.<Vector.<Foo>>>}\n */\nFalconTest_A.prototype.foo");
+    }
+
+    @Override
+    @Test
+    public void testField_withNamespaceTypeValueComplex()
+    {
+        IVariableNode node = getField("protected var foo:Foo = new Foo('bar', 42);");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @protected\n * @type {Foo}\n */\nFalconTest_A.prototype.foo = new Foo('bar', 42)");
+    }
+
+    @Override
+    @Test
+    public void testField_withList()
+    {
+        IVariableNode node = getField("protected var a:int = 4, b:int = 11, c:int = 42;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @protected\n * @type {number}\n */\nFalconTest_A.prototype.a = 4;\n\n/**\n * @protected\n * @type {number}\n */\nFalconTest_A.prototype.b = 11;\n\n/**\n * @protected\n * @type {number}\n */\nFalconTest_A.prototype.c = 42");
+    }
+
+    //--------------------------------------------------------------------------
+    // Constants
+    //--------------------------------------------------------------------------
+
+    @Override
+    @Test
+    public void testConstant()
+    {
+        IVariableNode node = getField("static const foo;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @const\n * @type {*}\n */\nFalconTest_A.foo");
+    }
+
+    @Test
+    public void testConstant_nonStatic()
+    {
+        IVariableNode node = getField("const foo;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @const\n * @type {*}\n */\nFalconTest_A.prototype.foo");
+    }
+
+    @Override
+    @Test
+    public void testConstant_withType()
+    {
+        IVariableNode node = getField("static const foo:int;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @const\n * @type {number}\n */\nFalconTest_A.foo");
+    }
+
+    @Test
+    public void testConstant_withType_nonStatic()
+    {
+        IVariableNode node = getField("const foo:int;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @const\n * @type {number}\n */\nFalconTest_A.prototype.foo");
+    }
+
+    @Override
+    @Test
+    public void testConstant_withTypeValue()
+    {
+        IVariableNode node = getField("static const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @const\n * @type {number}\n */\nFalconTest_A.foo = 420");
+    }
+
+    @Test
+    public void testConstant_withTypeValue_nonStatic()
+    {
+        IVariableNode node = getField("const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @const\n * @type {number}\n */\nFalconTest_A.prototype.foo = 420");
+    }
+
+    @Override
+    @Test
+    public void testConstant_withNamespaceTypeValue()
+    {
+        IVariableNode node = getField("private static const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @private\n * @const\n * @type {number}\n */\nFalconTest_A.foo = 420");
+    }
+
+    @Test
+    public void testConstant_withNamespaceTypeValue_nonStatic()
+    {
+        IVariableNode node = getField("private const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @private\n * @const\n * @type {number}\n */\nFalconTest_A.prototype.foo = 420");
+    }
+
+    @Override
+    @Test
+    public void testConstant_withCustomNamespaceTypeValue()
+    {
+        IVariableNode node = getField("mx_internal static const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        // (erikdebruin) we ignore custom namespaces completely (are there side effects I'm missing?)
+        assertOut("/**\n * @const\n * @type {number}\n */\nFalconTest_A.foo = 420");
+    }
+
+    @Test
+    public void testConstant_withCustomNamespaceTypeValue_nonStatic()
+    {
+        IVariableNode node = getField("mx_internal const foo:int = 420;");
+        asBlockWalker.visitVariable(node);
+        // (erikdebruin) we ignore custom namespaces completely (are there side effects I'm missing?)
+        assertOut("/**\n * @const\n * @type {number}\n */\nFalconTest_A.prototype.foo = 420");
+    }
+
+    //--------------------------------------------------------------------------
+    // Namespace
+    //--------------------------------------------------------------------------
+
+    // TODO (erikdebruin) not sure what to do with these when emitting JS...
+    
+    @Override
+    @Test
+    public void testNamespace()
+    {
+//        INamespaceNode node = getNamespace("namespace ns = \"http://whatever\";");
+//        asBlockWalker.visitNamespace(node);
+//        assertOut("namespace ns = \"http://whatever\"");
+    }
+
+    @Override
+    @Test
+    public void testNamespace_public()
+    {
+//        INamespaceNode node = getNamespace("public namespace ns = \"http://whatever\";");
+//        asBlockWalker.visitNamespace(node);
+//        assertOut("public namespace ns = \"http://whatever\"");
+    }
+
+    @Override
+    @Test
+    public void testNamespace_protected()
+    {
+//        INamespaceNode node = getNamespace("protected namespace ns = \"http://whatever\";");
+//        asBlockWalker.visitNamespace(node);
+//        assertOut("protected namespace ns = \"http://whatever\"");
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogFile.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogFile.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogFile.java
new file mode 100644
index 0000000..dcfacb2
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogFile.java
@@ -0,0 +1,93 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import java.io.File;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid 'goog' JS code from an external
+ * file.
+ * 
+ * @author Erik de Bruin
+ */
+public class TestGoogFile extends ASTestBase
+{
+    @Test
+    public void testFile_plain()
+    {
+        IFileNode node = compileAS("input", true, "goog" + File.separator
+                + "files");
+        asBlockWalker.visitFile(node);
+        assertOut(getCodeFromFile("output", true, "goog" + File.separator
+                + "files"));
+    }
+
+    @Test
+    public void testFile_getset()
+    {
+        IFileNode node = compileAS("get-set", true, "goog" + File.separator
+                + "files");
+        asBlockWalker.visitFile(node);
+        assertOut(getCodeFromFile("get-set_result", true, "goog"
+                + File.separator + "files"));
+    }
+
+    @Test
+    public void testFile_callsuper()
+    {
+        IFileNode node = compileAS("call-super", true, "goog" + File.separator
+                + "files");
+        asBlockWalker.visitFile(node);
+        assertOut(getCodeFromFile("call-super_result", true, "goog"
+                + File.separator + "files"));
+    }
+
+    @Test
+    public void testFile_qualifynewobject()
+    {
+        IFileNode node = compileAS("qualify-new-object", true, "goog"
+                + File.separator + "files");
+        asBlockWalker.visitFile(node);
+        assertOut(getCodeFromFile("qualify-new-object_result", true, "goog"
+                + File.separator + "files"));
+    }
+
+    @Test
+    public void testFile_poc()
+    {
+        IFileNode node = compileAS("poc", true, "goog" + File.separator
+                + "files");
+        asBlockWalker.visitFile(node);
+        assertOut(getCodeFromFile("poc_result", true, "goog" + File.separator
+                + "files"));
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalClasses.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalClasses.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalClasses.java
new file mode 100644
index 0000000..fc9e523
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalClasses.java
@@ -0,0 +1,309 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.TestGlobalClasses;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestGoogGlobalClasses extends TestGlobalClasses
+{
+    @Override
+    @Test
+    public void testArgumentError()
+    {
+        IVariableNode node = getVariable("var a:ArgumentError = new ArgumentError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {ArgumentError} */ a = new ArgumentError()");
+    }
+
+    @Override
+    @Test
+    public void testArguments()
+    {
+        IFunctionNode node = getMethod("function a():void {\ttrace(arguments);}");
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.a = function() {\n\tvar self = this;\n\ttrace(arguments);\n}");
+    }
+
+    @Override
+    @Test
+    public void testArray()
+    {
+        IVariableNode node = getVariable("var a:Array = new Array(1);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = new Array(1)");
+    }
+
+    @Override
+    @Test
+    public void testBoolean()
+    {
+        IVariableNode node = getVariable("var a:Boolean = new Boolean(1);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {boolean} */ a = new Boolean(1)");
+    }
+
+    @Override
+    @Test
+    public void testClass()
+    {
+        IVariableNode node = getVariable("var a:Class = new Class();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Object} */ a = new Class()");
+    }
+
+    @Override
+    @Test
+    public void testDate()
+    {
+        IVariableNode node = getVariable("var a:Date = new Date();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Date} */ a = new Date()");
+    }
+
+    @Override
+    @Test
+    public void testDefinitionError()
+    {
+        IVariableNode node = getVariable("var a:DefinitionError = new DefinitionError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {DefinitionError} */ a = new DefinitionError()");
+    }
+
+    @Override
+    @Test
+    public void testError()
+    {
+        IVariableNode node = getVariable("var a:Error = new Error();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Error} */ a = new Error()");
+    }
+
+    @Override
+    @Test
+    public void testEvalError()
+    {
+        IVariableNode node = getVariable("var a:EvalError = new EvalError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {EvalError} */ a = new EvalError()");
+    }
+
+    @Override
+    @Test
+    public void testFunction()
+    {
+        IVariableNode node = getVariable("var a:Function = new Function();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Function} */ a = new Function()");
+    }
+
+    @Override
+    @Test
+    public void testInt()
+    {
+        IVariableNode node = getVariable("var a:int = new int(1.8);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = new int(1.8)");
+    }
+
+    @Override
+    @Test
+    public void testJSON()
+    {
+        IVariableNode node = getVariable("var a:JSON = new JSON();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {JSON} */ a = new JSON()");
+    }
+
+    @Override
+    @Test
+    public void testMath()
+    {
+        IVariableNode node = getVariable("var a:Number = Math.PI;");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = Math.PI");
+    }
+
+    @Override
+    @Test
+    public void testNamespace()
+    {
+        IVariableNode node = getVariable("var a:Namespace = new Namespace(\"http://example.com\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Namespace} */ a = new Namespace(\"http://example.com\")");
+    }
+
+    @Override
+    @Test
+    public void testNumber()
+    {
+        IVariableNode node = getVariable("var a:Number = new Number(\"1\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = new Number(\"1\")");
+    }
+
+    @Override
+    @Test
+    public void testObject()
+    {
+        IVariableNode node = getVariable("var a:Object = new Object();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Object} */ a = new Object()");
+    }
+
+    @Override
+    @Test
+    public void testQName()
+    {
+        IVariableNode node = getVariable("var a:QName = new QName();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {QName} */ a = new QName()");
+    }
+
+    @Override
+    @Test
+    public void testRangeError()
+    {
+        IVariableNode node = getVariable("var a:RangeError = new RangeError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {RangeError} */ a = new RangeError()");
+    }
+
+    @Override
+    @Test
+    public void testReferenceError()
+    {
+        IVariableNode node = getVariable("var a:ReferenceError = new ReferenceError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {ReferenceError} */ a = new ReferenceError()");
+    }
+
+    @Override
+    @Test
+    public void testRegExp_Literal()
+    {
+        IVariableNode node = getVariable("var a:RegExp = /test-\\d/i;");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {RegExp} */ a = /test-\\d/i");
+    }
+
+    @Override
+    @Test
+    public void testSecurityError()
+    {
+        IVariableNode node = getVariable("var a:SecurityError = new SecurityError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {SecurityError} */ a = new SecurityError()");
+    }
+
+    @Override
+    @Test
+    public void testString()
+    {
+        IVariableNode node = getVariable("var a:String = new String(\"100\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {string} */ a = new String(\"100\")");
+    }
+
+    @Override
+    @Test
+    public void testSyntaxError()
+    {
+        IVariableNode node = getVariable("var a:SyntaxError = new SyntaxError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {SyntaxError} */ a = new SyntaxError()");
+    }
+
+    @Override
+    @Test
+    public void testTypeError()
+    {
+        IVariableNode node = getVariable("var a:TypeError = new TypeError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {TypeError} */ a = new TypeError()");
+    }
+
+    @Override
+    @Test
+    public void testUint()
+    {
+        IVariableNode node = getVariable("var a:uint = new uint(-100);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = new uint(-100)");
+    }
+
+    @Override
+    @Test
+    public void testURIError()
+    {
+        IVariableNode node = getVariable("var a:URIError = new URIError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {URIError} */ a = new URIError()");
+    }
+
+    @Override
+    @Test
+    public void testVector()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = new Vector.<String>(['Hello', 'World']);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Vector.<string>} */ a = new Array(['Hello', 'World'])");
+    }
+
+    @Override
+    @Test
+    public void testVerifyError()
+    {
+        IVariableNode node = getVariable("var a:VerifyError = new VerifyError();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {VerifyError} */ a = new VerifyError()");
+    }
+
+    @Override
+    @Test
+    public void testXML()
+    {
+        IVariableNode node = getVariable("var a:XML = new XML('@');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {XML} */ a = new XML('@')");
+    }
+
+    @Override
+    @Test
+    public void testXMLList()
+    {
+        IVariableNode node = getVariable("var a:XMLList = new XMLList('<!-- comment -->');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {XMLList} */ a = new XMLList('<!-- comment -->')");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalConstants.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalConstants.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalConstants.java
new file mode 100644
index 0000000..4bb2186
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalConstants.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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.TestGlobalConstants;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestGoogGlobalConstants extends TestGlobalConstants
+{
+    @Override
+    @Test
+    public void testInfinity()
+    {
+        IVariableNode node = getField("var a:Number = Infinity;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @type {number}\n */\nFalconTest_A.prototype.a = Infinity");
+    }
+
+    @Override
+    @Test
+    public void testNegativeInfinity()
+    {
+        IVariableNode node = getField("var a:Number = -Infinity;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @type {number}\n */\nFalconTest_A.prototype.a = -Infinity");
+    }
+
+    @Override
+    @Test
+    public void testNaN()
+    {
+        IVariableNode node = getField("var a:Number = NaN;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @type {number}\n */\nFalconTest_A.prototype.a = NaN");
+    }
+
+    @Override
+    @Test
+    public void testUndefined()
+    {
+        IVariableNode node = getField("var a:* = undefined;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @type {*}\n */\nFalconTest_A.prototype.a = undefined");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalFunctions.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalFunctions.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalFunctions.java
new file mode 100644
index 0000000..614edd5
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogGlobalFunctions.java
@@ -0,0 +1,238 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.TestGlobalFunctions;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestGoogGlobalFunctions extends TestGlobalFunctions
+{
+    @Override
+    @Test
+    public void testArray()
+    {
+        IVariableNode node = getVariable("var a:Array = Array(1);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = Array(1)");
+    }
+
+    @Override
+    @Test
+    public void testBoolean()
+    {
+        IVariableNode node = getVariable("var a:Boolean = Boolean(1);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {boolean} */ a = Boolean(1)");
+    }
+
+    @Override
+    @Test
+    public void testDecodeURI()
+    {
+        IVariableNode node = getVariable("var a:String = decodeURI('http://whatever.com');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {string} */ a = decodeURI('http://whatever.com')");
+    }
+
+    @Override
+    @Test
+    public void testDecodeURIComponent()
+    {
+        IVariableNode node = getVariable("var a:String = decodeURIComponent('http://whatever.com');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {string} */ a = decodeURIComponent('http://whatever.com')");
+    }
+
+    @Override
+    @Test
+    public void testEncodeURI()
+    {
+        IVariableNode node = getVariable("var a:String = encodeURI('http://whatever.com');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {string} */ a = encodeURI('http://whatever.com')");
+    }
+
+    @Override
+    @Test
+    public void testEncodeURIComponent()
+    {
+        IVariableNode node = getVariable("var a:String = encodeURIComponent('http://whatever.com');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {string} */ a = encodeURIComponent('http://whatever.com')");
+    }
+
+    @Override
+    @Test
+    public void testEscape()
+    {
+        IVariableNode node = getVariable("var a:String = escape('http://whatever.com');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {string} */ a = escape('http://whatever.com')");
+    }
+
+    @Override
+    @Test
+    public void testInt()
+    {
+        IVariableNode node = getVariable("var a:int = int(1.8);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = int(1.8)");
+    }
+
+    @Override
+    @Test
+    public void testIsFinite()
+    {
+        IVariableNode node = getVariable("var a:Boolean = isFinite(1000000.9);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {boolean} */ a = isFinite(1000000.9)");
+    }
+
+    @Override
+    @Test
+    public void testIsNaN()
+    {
+        IVariableNode node = getVariable("var a:Boolean = isNaN(NaN);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {boolean} */ a = isNaN(NaN)");
+    }
+
+    @Override
+    @Test
+    public void testIsXMLName()
+    {
+        IVariableNode node = getVariable("var a:Boolean = isXMLName(\"?\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {boolean} */ a = isXMLName(\"?\")");
+    }
+
+    @Override
+    @Test
+    public void testNumber()
+    {
+        IVariableNode node = getVariable("var a:Number = Number(\"1\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = Number(\"1\")");
+    }
+
+    @Override
+    @Test
+    public void testObject()
+    {
+        IVariableNode node = getVariable("var a:Object = Object(\"1\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Object} */ a = Object(\"1\")");
+    }
+
+    @Override
+    @Test
+    public void testParseFloat()
+    {
+        IVariableNode node = getVariable("var a:Number = parseFloat(\"1.8\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = parseFloat(\"1.8\")");
+    }
+
+    @Override
+    @Test
+    public void testParseInt()
+    {
+        IVariableNode node = getVariable("var a:Number = parseInt(\"666\", 10);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = parseInt(\"666\", 10)");
+    }
+
+    @Override
+    @Test
+    public void testString()
+    {
+        IVariableNode node = getVariable("var a:String = String(100);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {string} */ a = String(100)");
+    }
+
+    @Override
+    @Test
+    public void testTrace()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode(
+                "trace('Hello World');", IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("trace('Hello World')");
+    }
+
+    @Override
+    @Test
+    public void testUint()
+    {
+        IVariableNode node = getVariable("var a:uint = uint(-100);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = uint(-100)");
+    }
+
+    @Override
+    @Test
+    public void testUnescape()
+    {
+        IVariableNode node = getVariable("var a:String = unescape('%25');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {string} */ a = unescape('%25')");
+    }
+
+    @Override
+    @Test
+    public void testVector()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = Vector.<String>(['Hello', 'World']);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Vector.<string>} */ a = Array(['Hello', 'World'])");
+    }
+
+    @Override
+    @Test
+    public void testXML()
+    {
+        IVariableNode node = getVariable("var a:XML = XML('@');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {XML} */ a = XML('@')");
+    }
+
+    @Override
+    @Test
+    public void testXMLList()
+    {
+        IVariableNode node = getVariable("var a:XMLList = XMLList('<!-- comment -->');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {XMLList} */ a = XMLList('<!-- comment -->')");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogInterface.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogInterface.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogInterface.java
new file mode 100644
index 0000000..460515a
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogInterface.java
@@ -0,0 +1,113 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.TestInterface;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid 'goog' JS code for Interface
+ * production.
+ * 
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class TestGoogInterface extends TestInterface
+{
+    @Override
+    @Test
+    public void testSimple()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA{}");
+        asBlockWalker.visitInterface(node);
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleExtends()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA extends IB{}");
+        asBlockWalker.visitInterface(node);
+        assertOut("/**\n * @interface\n * @extends {IB}\n */\nIA = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testSimpleExtendsMultiple()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA extends IB, IC, ID {}");
+        asBlockWalker.visitInterface(node);
+        assertOut("/**\n * @interface\n * @extends {IB}\n * @extends {IC}\n * @extends {ID}\n */\nIA = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testQualifiedExtendsMultiple()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA extends foo.bar.IB, baz.goo.IC, foo.ID {}");
+        asBlockWalker.visitInterface(node);
+        assertOut("/**\n * @interface\n * @extends {foo.bar.IB}\n * @extends {baz.goo.IC}\n * @extends {foo.ID}\n */\nIA = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testAccessors()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA {"
+                + "function get foo1():Object;"
+                + "function set foo1(value:Object):void;}");
+        asBlockWalker.visitInterface(node);
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\nIA.prototype.foo1;");
+    }
+
+    @Override
+    @Test
+    public void testMethods()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA {"
+                + "function baz1():Object;"
+                + "function baz2(value:Object):void;}");
+        asBlockWalker.visitInterface(node);
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\nIA.prototype.baz1 = function() {\n};\nIA.prototype.baz2 = function(value) {\n};");
+    }
+
+    @Override
+    @Test
+    public void testAccessorsMethods()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA {"
+                + "function get foo1():Object;"
+                + "function set foo1(value:Object):void;"
+                + "function baz1():Object;"
+                + "function baz2(value:Object):void;}");
+        asBlockWalker.visitInterface(node);
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\nIA.prototype.foo1;\nIA.prototype.baz1 = function() {\n};\nIA.prototype.baz2 = function(value) {\n};");
+    }
+
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogMethodMembers.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogMethodMembers.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogMethodMembers.java
new file mode 100644
index 0000000..95234ea
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogMethodMembers.java
@@ -0,0 +1,183 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.TestMethodMembers;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of 'goog'-ified JS code for Class Method
+ * members.
+ * 
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class TestGoogMethodMembers extends TestMethodMembers
+{
+    @Override
+    @Test
+    public void testMethod()
+    {
+        IFunctionNode node = getMethod("function foo(){}");
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.foo = function() {\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withReturnType()
+    {
+        IFunctionNode node = getMethod("function foo():int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @return {number}\n */\nFalconTest_A.prototype.foo = function() {\n\tvar self = this;\n\treturn -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withParameterReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {*} bar\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar) {\n\tvar self = this;\n\treturn -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withParameterTypeReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar:String):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {string} bar\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar) {\n\tvar self = this;\n\treturn -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withDefaultParameterTypeReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar:String = \"baz\"):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {string=} bar\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar) {\n\tvar self = this;\n\tbar = typeof bar !== 'undefined' ? bar : \"baz\";\n\treturn -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withMultipleDefaultParameterTypeReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar:String, baz:int = null):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {string} bar\n * @param {number=} baz\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar, baz) {\n\tvar self = this;\n\tbaz = typeof baz !== 'undefined' ? baz : null;\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testMethod_withRestParameterTypeReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar:String, ...rest):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {string} bar\n * @param {...} rest\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar, rest) {\n\tvar self = this;\n\trest = Array.prototype.slice.call(arguments, 1);\n\treturn -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withNamespace()
+    {
+        IFunctionNode node = getMethod("public function foo(bar:String, baz:int = null):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        // we ignore the 'public' namespace completely
+        assertOut("/**\n * @param {string} bar\n * @param {number=} baz\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar, baz) {\n\tvar self = this;\n\tbaz = typeof baz !== 'undefined' ? baz : null;\n\treturn -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withNamespaceCustom()
+    {
+        IFunctionNode node = getMethod("mx_internal function foo(bar:String, baz:int = null):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {string} bar\n * @param {number=} baz\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar, baz) {\n\tvar self = this;\n\tbaz = typeof baz !== 'undefined' ? baz : null;\n\treturn -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withNamespaceModifiers()
+    {
+        IFunctionNode node = getMethod("public static function foo(bar:String, baz:int = null):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        // (erikdebruin) here we actually DO want to declare the method
+        //               directly on the 'class' constructor instead of the
+        //               prototype!
+        assertOut("/**\n * @param {string} bar\n * @param {number=} baz\n * @return {number}\n */\nFalconTest_A.foo = function(bar, baz) {\n\tbaz = typeof baz !== 'undefined' ? baz : null;\n\treturn -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withNamespaceModifierOverride()
+    {
+        IFunctionNode node = getMethod("public override function foo(bar:String, baz:int = null):int{\treturn -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {string} bar\n * @param {number=} baz\n * @return {number}\n * @override\n */\nFalconTest_A.prototype.foo = function(bar, baz) {\n\tvar self = this;\n\tbaz = typeof baz !== 'undefined' ? baz : null;\n\treturn -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withNamespaceModifierOverrideBackwards()
+    {
+        IFunctionNode node = getMethod("override public function foo(bar:String, baz:int = null):int{return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {string} bar\n * @param {number=} baz\n * @return {number}\n * @override\n */\nFalconTest_A.prototype.foo = function(bar, baz) {\n\tvar self = this;\n\tbaz = typeof baz !== 'undefined' ? baz : null;\n\treturn -1;\n}");
+    }
+
+    //--------------------------------------------------------------------------
+    // Doc Specific Tests 
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void testConstructor_withThisInBody()
+    {
+        IClassNode node = (IClassNode) getNode("public function FalconTest_A() {this.foo;}", IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n\tvar self = this;\n\tthis.foo;\n};");
+    }
+
+    @Test
+    public void testMethod_withThisInBody()
+    {
+        IFunctionNode node = getMethod("function foo(){this.foo;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @this {FalconTest_A}\n */\nFalconTest_A.prototype.foo = function() {\n\tvar self = this;\n\tthis.foo;\n}");
+    }
+
+    @Test
+    public void testMethod_withThisInBodyComplex()
+    {
+        IFunctionNode node = getMethod("function foo(){if(true){while(i){this.bar(42);}}}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @this {FalconTest_A}\n */\nFalconTest_A.prototype.foo = function() {\n\tvar self = this;\n\tif (true) "
+                + "{\n\t\twhile (i) {\n\t\t\tthis.bar(42);\n\t\t}\n\t}\n}");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogPackage.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogPackage.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogPackage.java
new file mode 100644
index 0000000..51c4ef2
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogPackage.java
@@ -0,0 +1,112 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.as.TestPackage;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of 'goog' JavaScript for AS package.
+ * 
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class TestGoogPackage extends TestPackage
+{
+    @Override
+    @Test
+    public void testPackage_Simple()
+    {
+        IFileNode node = compileAS("package{}");
+        asBlockWalker.visitFile(node);
+        assertOut("");
+    }
+
+    @Test
+    public void testPackage_SimpleName()
+    {
+        IFileNode node = compileAS("package foo {}");
+        asBlockWalker.visitFile(node);
+        assertOut("");
+    }
+
+    @Override
+    @Test
+    public void testPackage_Name()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {}");
+        asBlockWalker.visitFile(node);
+        assertOut("");
+    }
+
+    @Override
+    @Test
+    public void testPackageSimple_Class()
+    {
+        // does JS need a implicit constructor function? ... always?
+        // All class nodes in AST get either an implicit or explicit constructor
+        // this is an implicit and the way I have the before/after handler working
+        // with block disallows implicit blocks from getting { }
+
+        // (erikdebruin) the constuctor IS the class definition, in 'goog' JS,
+        //               therefor we need to write out implicit constructors 
+        //               (if I understand the term correctly)
+
+        IFileNode node = compileAS("package {public class A{}}");
+        asBlockWalker.visitFile(node);
+        assertOut("goog.provide('A');\n\n/**\n * @constructor\n */\nA = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testPackageQualified_Class()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {public class A{}}");
+        asBlockWalker.visitFile(node);
+        assertOut("goog.provide('foo.bar.baz.A');\n\n/**\n * @constructor\n */\nfoo.bar.baz.A = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testPackageQualified_ClassBody()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {public class A{public function A(){}}}");
+        asBlockWalker.visitFile(node);
+        assertOut("goog.provide('foo.bar.baz.A');\n\n/**\n * @constructor\n */\nfoo.bar.baz.A = function() {\n};");
+    }
+
+    @Override
+    @Test
+    public void testPackageQualified_ClassBodyMethodContents()
+    {
+        IFileNode node = compileAS("package foo.bar.baz {public class A{public function A(){if (a){for (var i:Object in obj){doit();}}}}}");
+        asBlockWalker.visitFile(node);
+        assertOut("goog.provide('foo.bar.baz.A');\n\n/**\n * @constructor\n */\nfoo.bar.baz.A = function() {\n\tvar self = this;\n\tif (a) {\n\t\tfor (var /** @type {Object} */ i in obj) {\n\t\t\tdoit();\n\t\t}\n\t}\n};");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
new file mode 100644
index 0000000..a120ec0
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/goog/TestGoogProject.java
@@ -0,0 +1,98 @@
+/*
+ *
+ *  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.internal.codegen.js.goog;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.utils.TestAdapterFactory;
+import org.junit.Test;
+
+import java.io.File;
+import java.util.List;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+/**
+ * This class tests the production of valid 'goog' JS code from an external
+ * project.
+ * 
+ * @author Erik de Bruin
+ */
+public class TestGoogProject extends ASTestBase
+{
+
+    private static String projectDirPath = "goog/projects";
+
+    @Test
+    public void test_imports()
+    {
+        String testDirPath = projectDirPath + "/imports";
+
+        String fileName = "Case";
+
+        List<String> compiledFileNames = compileProject(fileName, testDirPath);
+
+        assertProjectOut(compiledFileNames, testDirPath);
+    }
+
+    @Override
+    protected void addSourcePaths(List<File> sourcePaths)
+    {
+        sourcePaths.add(new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                projectDirPath + "/imports"));
+
+        super.addSourcePaths(sourcePaths);
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new GoogBackend();
+    }
+
+    protected void assertProjectOut(List<String> compiledFileNames,
+            String testDirPath)
+    {
+    	if (compiledFileNames.size() == 0)
+    	{
+            fail("Expected compiled files");
+    	}
+        for (String compiledFileName : compiledFileNames)
+        {
+            String compiledFilePath = tempDir.getAbsolutePath()
+                    + File.separator + testDirPath + File.separator
+                    + compiledFileName + "_output" + "."
+                    + backend.getOutputExtension();
+            String compiledResult = readCodeFile(new File(compiledFilePath));
+
+            //System.out.println(compiledResult);
+
+            String expectedFilePath = new File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(),
+                    testDirPath +  "/" + compiledFileName + "_result" + "." + backend.getOutputExtension()).getPath();
+            String expectedResult = readCodeFile(new File(expectedFilePath));
+
+            assertThat(compiledResult, is(expectedResult));
+        }
+    }
+
+}


[13/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_es.properties
----------------------------------------------------------------------
diff --git a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_es.properties b/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_es.properties
deleted file mode 100644
index b12a48d..0000000
--- a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_es.properties
+++ /dev/null
@@ -1,282 +0,0 @@
-################################################################################
-##
-##  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.
-##
-################################################################################
-
-ABCGeneratorProblem=Error interno en el subsistema generador ABC al generar el código para: ${sourceFileName}: ${stackTrace}
-AccessorTypesMustMatchProblem=Los tipos de descriptor de acceso deben coincidir.
-AccessUndefinedMemberProblem=Acceso a una propiedad ${memberName} posiblemente indefinida a través de una referencia con tipo estático ${className}.
-AccessUndefinedPropertyInPackageProblem=Acceso de propiedad no definida ${propertyName} en el paquete ${packageName}.
-AccessUndefinedPropertyProblem=Acceso de propiedad posiblemente no definida ${propertyName}.
-AmbiguousReferenceProblem=Referencia ambigua a ${property}
-AssignToConstProblem=Asignación no válida a una variable especificada como constante.
-AssignToFunctionProblem=Asignación no permitida a la función ${funcName}.
-AssignToReadOnlyPropertyProblem=La propiedad ${name} es de sólo lectura.
-AttemptToDeleteFixedPropertyProblem=Se intentó eliminar la propiedad fija ${name}. Sólo se pueden eliminar las propiedades definidas dinámicamente.
-AttributesAreNotCallableProblem=No se puede llamar a los atributos.
-BadAccessInterfaceMemberProblem=Los miembros de la interfaz no se pueden declarar como public, private, protected ni internal.
-BadCharacterProblem=Error char inesperado: '${errorText}' no se permite aquí
-BadSetterReturnTypeProblem=El tipo devuelto de una definición de establecimiento debe ser unspecified o void.
-BaseClassIsFinalProblem=La clase base es ${finalStr}.
-BURMDiagnosticForEachExpectedInProblem=la palabra clave '${k_each}' no está permitida sin un operador '${k_in}'
-BURMDiagnosticInvalidDecrementProblem=El operando de decremento debe ser una referencia.
-BURMDiagnosticNotAllowedHereProblem=${node} no se permite aquí
-BURMPatternMatchFailureProblem=No se puede generar código para ${node}
-BURNDiagnosticInvalidIncrementProblem=El operando de incremento debe ser una referencia.
-CallUndefinedMethodProblem=Llamada a un método ${methodName}. posiblemente indefinido.
-CannotDeleteSuperDescendantsProblem=No se pueden eliminar los descendientes de super.
-CannotExtendClassProblem=Una interfaz sólo puede ampliar otras interfaces, pero no ${className} en una clase.
-CannotExtendInterfaceProblem=Una ${classStr} sólo puede ampliar a otra ${classStr}, no a una ${interfaceStr}.
-CannotResolveConfigExpressionProblem=No se puede resolver la constante config: '${configName}'
-CircularTypeReferenceProblem=Se detectó una referencia de tipo circular en ${className}
-ClassesMappedToSameRemoteAliasProblem=Se encontró una asignación para '${existingClassName}' en el alias de clase remota '${alias}' durante el procesamiento de la clase '${className}'. Flex ahora generará código para comprobar si ya hay registrado un alias. Mientras se deserializan datos remotos, un alias sólo puede asignarse a una sola clase.
-ClosureProblem=Closure error.
-CodegenInternalProblem=Error interno de generador de código: ${diagnostic}
-CompiledAsAComponentProblem=${className} es un módulo o una aplicación con una referencia directa. Esto hará que ${className} y todas sus dependencias se vinculen con ${mainDefinition}. Usar una interfaz es la práctica recomendada para evitar esto.
-ConfigurationFileNotFoundProblem=No se puede encontrar el archivo config: ${file}
-ConfigurationProblem=Problema de configuración: ${reason}.\n${location}
-ConflictingInheritedNameInNamespaceProblem=Hay un conflicto con la definición heredada ${declName} en el espacio de nombres ${nsName}.
-ConflictingNameInNamespaceProblem=Hay un conflicto con la definición ${declName} en el espacio de nombres ${nsName}.
-ConstructorCannotHaveReturnTypeProblem=Un constructor no puede especificar un tipo devuelto
-ConstructorIsGetterSetterProblem=Un constructor no puede ser un método getter o setter
-ConstructorIsStaticProblem=Las funciones constructoras deben ser métodos de instancia
-ConstructorMustBePublicProblem=Un constructor sólo se puede declarar ${modifier}
-CountedForLoopInitializerProblem=Error de sintaxis: se esperaba un punto y coma antes de rightparen.
-CSSCodeGenProblem=Problema de generación de código CSS. Razón: '${reason}'
-CSSEmbedAssetProblem=No se puede incrustar un activo desde '${embed}'.
-CSSParserProblem=${reason}
-CSSUndefinedNamespacePrefixProblem=Prefijo de espacio de nombres no definido '${prefix}'.
-CSSUndefinedTypeProblem='${type}' no está definido.
-CSSUnknownDefaultNamespaceProblem=El selector de tipo sin prefijo de espacio de nombres requiere la definición de un espacio de nombres predefinido. ${selectorText}
-CSSUnresolvedClassReferenceProblem=${qname} no está definido.
-CyclicalIncludesProblem=Elementos cíclicos encontrados en ${file}
-DependencyNotCompatibleProblem=La ${definition} de dependencia desde ${swc} tiene una versión mínima admitida de ${swcMinimumVersion} que es mayor que la versión de compatibilidad ${compatibilityVersion}.
-DeprecatedConfigurationOptionProblem='${option}' se ha desechado desde ${since}. Utilice '${replacement}'
-DuplicateAttributeProblem=El atributo ${attrStr} se ha especificado varias veces.
-DuplicateClassDefinitionProblem=Definición de clase duplicada: ${className}.
-DuplicateConfigNameProblem=Espacio de nombres config duplicado: '${configName}'
-DuplicateFunctionDefinitionProblem=Definición de función duplicada: ${methodName}
-DuplicateInterfaceDefinitionProblem=Definición de interfaz duplicada: ${interfaceName}.
-DuplicateInterfaceProblem=${classStr} ${className} implementa ${interfaceStr} ${interfaceName} varias veces.
-DuplicateLabelProblem=Definición de etiqueta duplicada.
-DuplicateNamespaceDefinitionProblem=Definición de espacio de nombres duplicada.
-DuplicateQNameInSourcePathProblem=${qName} está definido por varios archivos: ${fileList} 
-DuplicateSkinStateProblem=Declaración duplicada de SkinState '${name}'
-DuplicateSourceFileProblem=${file} se ha especificado más de una vez en la lista de orígenes incluidos.
-DuplicateSourcePathProblem=${directory} se ha especificado más de una vez en la ruta de acceso de origen.
-DuplicateSwitchCaseProblem=Alternativa switch duplicada ${caseName}.
-DynamicNotOnClassProblem=El atributo ${dynamicStr} sólo puede utilizarse con definiciones de ${classStr}.
-EmbedAS2TagsModifiedProblem=Las acciones de AS2 se han eliminado de la etiqueta ${symbol}
-EmbedBadFontParameters=la transcodificación de fuentes requiere especificar 'fontName' y un 'source', 'systemFont' o 'sourceList'
-EmbedBadScalingGridTargetProblem=No se pudo escalar el símbolo ${symbol}, ya que no es de tipo Sprite
-EmbedCouldNotDetermineSampleFrameCountProblem=No se pudo determinar el recuento de fotogramas de muestreo en el archivo ${filename}
-EmbeddedFontShadowsDeviceFontProblem=la fuente incrustada '${alias}' puede ocultar otra fuente de dispositivo con el mismo nombre. Utilice fontName como alias para la fuente con nombre distinto
-EmbedExceptionWhileTranscodingProblem=excepción durante la transcodificación: ${exception}
-EmbedInitialValueProblem=Una variable Embed no debe tener un valor existente.
-EmbedInvalidAttributeValueProblem=El valor ${value} no es válido para el atributo ${attribute}
-EmbedInvalidUnicodeRangeProblem=rango Unicode no válido '${range}'
-EmbedMissingSymbolProblem=No se pudo encontrar el símbolo ${symbol} en el archivo ${swf}
-EmbedMovieScalingNoSymbolProblem=Especifique un símbolo cuando escale un vídeo incrustado
-EmbedMultipleMetaTagsProblem=Una variable sólo puede tener una etiqueta de metadatos Embed
-EmbedNoSkinClassProblem=Debe especificar un atributo skinClass cuando incruste activos de aspecto
-EmbedNoSourceAttributeProblem=Embed requiere un atributo de archivo de origen
-EmbedQualityRequiresCompressionProblem=No especifique el atributo quality si la compresión está desactivada
-EmbedQualityValueProblem=El valor ${value} no es válido para el atributo quality. Debe estar entre 0,0 y 100,0
-EmbedScalingGridProblem=los atributos scaleBottom, scaleLeft, scaleRight y scaleTop deben especificarse juntos
-EmbedScalingGridValueProblem=El valor de escala ${value} debe ser mayor que 0 para el atributo ${attr}
-EmbedSkinClassNotFoundProblem=No se encontró la clase ${skinClass}
-EmbedSourceAttributeCouldNotBeReadProblem=No se pudo leer el archivo de origen Embed ${filename}
-EmbedSourceAttributeDoesNotExistProblem=No se pudo encontrar el archivo de origen Embed
-EmbedSourceFileNotFoundProblem=No se puede encontrar el archivo de origen Embed: ${file}
-EmbedTypeNotEmbeddableProblem=No se puede incrustar el tipo ${typeName}
-EmbedUnableToBuildFontProblem=no se puede crear la fuente '${fontName}'
-EmbedUnableToReadSourceProblem=no se puede leer el origen de transcodificación '${source}'
-EmbedUnknownAttributeProblem=Atributo desconocido: ${attr}
-EmbedUnknownMimeTypeProblem=Tipo mime no gestionado ${mimeType}
-EmbedUnrecogniedFileTypeProblem=El archivo ${file} tiene un tipo de archivo desconocido que no se puede incrustar
-EmbedUnsupportedAttributeProblem=El atributo ${attribute} no se puede utilizar con el tipo mime: ${mimeType}
-EmbedUnsupportedSamplingRateProblem=La frecuencia ${frequency} no se admite en el archivo ${filename}
-FileNotFoundProblem=Archivo no encontrado: ${file}
-FinalOutsideClassProblem=El atributo ${finalStr} sólo se puede utilizar en un método definido en una ${classStr}.
-FunctionNotMarkedOverrideProblem=Anulación de una ${funcStr} no marcada para ${overrideStr}
-FunctionWithoutBodyProblem=La función no tiene cuerpo.
-FXGCompilerProblem=Problema de compilación FXG: ${message}
-GetterCannotHaveParametersProblem=Una definición captadora no debe tener parámetros.
-GlobalBindablePropertyProblem=[${bindableStr}] no se permite en variables global o ${packageStr}
-HostComponentClassNotFoundProblem=Clase [HostComponent] '${className}' no encontrada.
-HostComponentMustHaveTypeProblem=[HostComponent] debe especificar un nombre de tipo.
-IllegalAssignmentToClassProblem=Asignación no permitida a la clase ${className}.
-ImplicitCoercionToSubtypeProblem=Coerción implícita de un valor con tipo estático ${baseType} a un tipo ${subType} posiblemente no relacionado.
-ImplicitCoercionToUnrelatedTypeProblem=Coerción implícita de un valor de tipo ${actualType} a un tipo ${expectedType} no relacionado.
-InaccessibleMethodReferenceProblem=Intento de acceso a un método ${methodName} inaccesible a través de una referencia con tipo estático ${className}.
-InaccessiblePropertyReferenceProblem=Intento de acceso a una propiedad ${propertyName} inaccesible a través de una referencia con tipo estático ${className}.
-IncompatibleDefaultValueProblem=Valor predeterminado incompatible de tipo ${srcType} donde se espera ${tgtType}.
-IncompatibleInterfaceMethodProblem=El método ${interfStr} ${methodName} de ${namespaceStr} ${namespaceName} se implementa con una firma incompatible en ${classStr} ${className}
-IncompatibleOverrideProblem=${overrideStr} incompatible.
-InterfaceBindablePropertyProblem=[${bindableStr}] no está permitido dentro de una definición ${interfStr}.
-InterfaceCannotBeInstantiatedProblem=No se pueden crear instancias de las interfaces con el nuevo operador.
-InterfaceMethodWithBodyProblem=Los métodos definidos en una ${interfaceStr} no deben tener cuerpo.
-InterfaceModifierProblem=El atributo de interfaz ${modifier} no es válido.
-InterfaceNamespaceAttributeProblem=Los métodos de interfaz no admiten atributos de espacio de nombres.
-InternalCompilerProblem=Error de compilador interno
-InvalidABCByteCodeProblem=Código de bytes ABC no válido.
-InvalidBackgroundColorProblem=Color de fondo no válido: ${backgroundColor}
-InvalidDecrementOperandProblem=El operando de decremento no es válido.
-InvalidEscapeSequenceProblem='${badSequence}' no es una secuencia de escape válida
-InvalidForInInitializerProblem=Error de sintaxis: inicializador for-in no válido, sólo se esperaba 1 expresión.
-InvalidIncrementOperandProblem=El operando de incremento no es válido.
-InvalidLvalueProblem=El destino de la asignación debe ser un valor de referencia.
-InvalidNamespaceInitializerProblem=Un inicializador de espacio de nombres debe ser un literal de cadena u otro espacio de nombres.
-InvalidNamespaceProblem=Un atributo de espacio de nombres definido por el usuario sólo se puede utilizar en el nivel superior de una definición de ${classStr}.
-InvalidOverrideProblem=El atributo ${overrideStr} sólo se puede utilizar en un método definido en una ${classStr}.
-InvalidPrivateNamespaceAttrProblem=El atributo ${privateStr} sólo se puede utilizar en definiciones de propiedad ${classStr}.
-InvalidPrivateNamespaceProblem=${privateStr} sólo se puede utilizar como espacio de nombres dentro de una ${classStr}.
-InvalidProtectedNamespaceAttrProblem=El atributo ${protectedStr} sólo se puede utilizar en definiciones de propiedad ${classStr}.
-InvalidProtectedNamespaceProblem=${protectedStr} sólo se puede utilizar como espacio de nombres dentro de una ${classStr}.
-InvalidPublicNamespaceAttrProblem=El atributo ${publicStr} sólo se puede utilizar dentro de un ${packageStr}.
-InvalidPublicNamespaceProblem=${publicStr} sólo se puede utilizar como espacio de nombres dentro de un ${packageStr}.
-InvalidRestParameterDeclarationProblem=Los parámetros especificados después de la palabra clave de definición de parámetro ...rest sólo pueden ser un tipo de datos Array.
-InvalidSuperExpressionProblem=Una expresión super sólo se puede utilizar dentro de métodos de instancia de clase.
-InvalidSuperStatementProblem=Una sentencia super sólo se puede utilizar dentro de constructores de instancia de clase.
-JSDataClassMethodError=ERROR: DataClass classes must not declare methods. 
-JSInternalCompilerProblem=Internal compiler error: ${message}. 
-JSUnsupportedFeatureProblem=Unsupported feature: ${feature}. 
-JSWarnClassInitProblem=PERFORMANCE: Avoid loose class initialization statements. Consider using singletons instead.
-JSWarnClosureAdvancedOptimizationsProblem=WARNING: Optimizing with ADVANCED_OPTIMIZATIONS will fail because of accessing properties via unknown strings.
-JSWarnRuntimeNameLookupProblem=PERFORMANCE: Forced to emit expensive runtime name lookup. Consider using strict types instead of generic objects and avoiding dynamic classes.
-LocalBindablePropertyProblem=[${bindableStr}] no está permitido dentro de una definición ${funcStr}.
-LossyConversionProblem=Inicialización no válida: la conversión a tipo ${targetType} pierde datos.
-MethodCannotBeConstructorProblem=No se puede utilizar el método como constructor.
-MissingBuiltinProblem=Falta el tipo integrado ${builtinType}
-MissingCatchOrFinallyProblem=Error de sintaxis: se esperaba una cláusula catch o finally.
-MissingFactoryClassInFrameMetadataProblem=Esta unidad de compilación no tiene un elemento factoryClass especificado en los metadatos de Frame para cargar las bibliotecas compartidas en tiempo de ejecución que se han configurado. Para compilar sin bibliotecas compartidas en tiempo de ejecución, puede establecer la opción -static-link-runtime-shared-libraries como true, o bien eliminar la opción -runtime-shared-libraries.
-MissingRequirementConfigurationProblem=no se estableció la variable de configuración '${required}'
-MissingSignedDigestProblem=No se encontró ningún digest con firma en catalog.xml de la biblioteca, ${libraryPath}.
-MissingSkinPartProblem=Falta la parte de aspecto requerida '${skinPartName}'.
-MissingSkinStateProblem=Falta el estado de aspecto requerido '${skinStateName}'.
-MissingUnsignedDigestProblem=No se encontró ningún digest sin firma en catalog.xml de la biblioteca, ${libraryPath}.
-MultipleConfigNamespaceDecorationsProblem=No se permiten espacios de nombres config duplicados en una definición
-MultipleSwitchDefaultsProblem=switch tiene más de un valor predeterminado y sólo se permite uno.
-MXMLAttributeVersionProblem=El atributo '${name}' sólo se puede utilizar en MXML ${version} o versión posterior. Se omitirá.
-MXMLClassNodeProblem='${qname}' no especifica una clase ni una interfaz. Se omitirá.
-MXMLDatabindingSourceNotBindableProblem=La vinculación de datos no puede detectar asignaciones a '${sourceName}'.
-MXMLDuplicateIDProblem=Este identificador es exclusivo. Se omitirá.
-MXMLFinalClassProblem='${qname}' es una clase final y no se puede utilizar como etiqueta raíz.
-MXMLIncludeInAndExcludeFromProblem=Los atributos 'includeIn' y 'excludeFrom' no se pueden especificar en la misma etiqueta. Ambos se omitirán.
-MXMLIncompatibleArrayElementProblem=Un elemento de conjunto de tipo '${actualType}' es incompatible con el [ArrayElementType] de '${expectedType}' para la propiedad '${propertyName}'.
-MXMLIncompatibleVectorElementProblem=Este elemento es incompatible con el tipo Vector. Se omitirá.
-MXMLInvalidEntityProblem=Entidad '{entity}' desconocida encontrada. Se omitirá.
-MXMLInvalidIDProblem=Este identificador no es un identificador de ActionScript válido. Se omitirá.
-MXMLInvalidItemCreationPolicyProblem=Los valores válidos de itemCreationPolicy son 'immediate' o 'deferred'. Este atributo se omitirá.
-MXMLInvalidItemDestructionPolicyProblem=Los valores válidos de itemDestructionPolicy son 'auto' o 'never'. Este atributo se omitirá.
-MXMLInvalidPercentageProblem=Inicializador para '${property}': expresión de porcentaje no válida: '${text}'.
-MXMLInvalidTextForTypeProblem=No se puede analizar un valor de tipo '${type}' desde '${text}'.
-MXMLInvalidVectorFixedAttributeProblem=El atributo 'fixed' debe ser 'true' o 'false'. Se omitirá.
-MXMLInvalidVectorTypeAttributeProblem=El atributo 'type' no especifica una clase conocida. Se asumirá que el tipo es '*'.
-MXMLMissingRootTagProblem=No se encontró ninguna etiqueta raíz en este archivo MXML.
-MXMLMissingVectorTypeAttributeProblem=Se requiere el atributo 'type' en una etiqueta <Vector>. Se asumirá que el tipo es '*'.
-MXMLNotAClassProblem='${qname}' no es una clase. Esta etiqueta se omitirá.
-MXMLOperationMissingNameProblem=La operación requiere un atributo name.
-MXMLOtherLanguageNamespaceProblem=Sólo se puede utilizar un espacio de nombres de idioma en un documento MXML. Este atributo se omitirá.
-MXMLOuterDocumentAlreadyDeclaredProblem=Ya se ha declarado una propiedad llamada outerDocument y está en conflicto con el elemento outerDocument de la etiqueta fx:Component.
-MXMLPercentageNotAllowedProblem=Inicializador para '${property}': porcentaje no permitido aquí: '${text}'.
-MXMLPrivateAttributeProblem=Este atributo utiliza un espacio de nombres privado, por lo que se omitirá.
-MXMLPrivateTagLocationProblem=La etiqueta <Private> debe ser la última etiqueta secundaria de la etiqueta raíz del archivo. Se omitirá.
-MXMLSemanticProblem=Problema interno durante el análisis semántico del MXML
-MXMLUnexpectedAttributeProblem=Este atributo no se esperaba. Se omitirá.
-MXMLUnexpectedDatabindingProblem=Esta expresión de vinculación de datos no se esperaba. Se omitirá.
-MXMLUnexpectedTagProblem=Esta etiqueta no se esperaba. Se omitirá.
-MXMLUnexpectedTextProblem=Este texto no se esperaba. Se omitirá.
-MXMLUnrecognizedCompilerDirectiveProblem=La función ${functionName} no es una directiva de tiempo de compilación reconocida
-MXMLUnresolvedTagProblem=Esta etiqueta no se ha podido resolver como una clase de ActionScript. Se omitirá.
-MXMLUnterminatedEntityProblem=Entidad sin terminar encontrada. Se omitirá.
-MXMLXMLListMixedContentProblem=No se permite contenido mixto aquí.
-MXMLXMLOnlyOneRootTagProblem=Sólo se permite una etiqueta raíz
-MXMLXMLRequireContentProblem=Se requiere contenido XML
-NamespaceInInterfaceProblem=Las declaraciones de espacio de nombres no se permiten en las interfaces.
-NativeMethodWithBodyProblem=Los métodos nativos no pueden tener cuerpo.
-NativeNotOnFunctionProblem=El atributo ${nativeStr} sólo se puede utilizar con definiciones ${functionStr}.
-NativeUsedInInterfaceProblem=El atributo ${nativeStr} no se puede utilizar en definiciones ${interfStr}.
-NativeVariableProblem=Las variables no pueden ser ${nativeStr}.
-NestedGetterSetterProblem=Los descriptores de acceso no se pueden anidar dentro de otras funciones.
-NestedPackageProblem=Los paquetes no se pueden anidar.
-NoCompilationUnitForDefinitionProblem=No se encontró ninguna unidad de compilación con el nombre '${qname}'.
-NoDefaultConstructorInBaseClassProblem=No se encontró ningún constructor predeterminado en la clase ${baseClass}.
-NoDefinitionForSWCDependencyProblem=No se encontró a definición ${qname} dependiente del ${swcFilename} SWC
-NoMainDefinitionProblem=No se encontró ninguna definición visible externa con el nombre '${qname}'.
-NonConstantNamespaceProblem=Un inicializador de espacio de nombres debe ser un literal de cadena u otro espacio de nombres.
-NonConstantParamInitializerProblem=El inicializador del parámetro es desconocido o no es una constante de tiempo de compilación.
-NonDirectoryInSourcePathProblem=${file} se especificó en la ruta de acceso de origen y no es un directorio.
-NoScopesInABCCompilationUnitProblem=No se pueden encontrar ámbitos en la unidad de compilación.
-OnlyOneHostComponentAllowedProblem=Sólo se permite un [HostComponent].
-OverlappingSourcePathProblem=Entradas de ruta de acceso de origen solapadas: ${ancestor} es un ascendiente de ${descendant}
-OverrideFinalProblem=No se puede redefinir un método ${finalStr}
-OverrideNotFoundProblem=El método marcado ${overrideStr} anula otro método.
-OverrideOutsideClassProblem=El atributo ${overrideStr} sólo se puede utilizar en definiciones de propiedad ${classStr}.
-PackageCannotBeUsedAsValueProblem=El paquete no se puede utilizar como un valor: ${packageName}.
-ParserProblem=Problema de análisis interno
-PropertyIsWriteOnlyProblem=La propiedad ${name} es de sólo escritura.
-PrototypeInvalidAttributeProblem=El atributo prototype no es válido.
-RemovedConfigurationOptionProblem='${option}' ya no se admite y no surte ningún efecto.
-RequiredParameterAfterOptionalProblem=Los parámetros necesarios no se permiten después de los parámetros opcionales.
-ResourceBundleMalformedEncodingProblem=La codificación de la cadena dada no está bien formada: ${string}
-ResourceBundleNoBundleParameterProblem=No hay ningún parámetro de paquete dado para @Resource()
-ResourceBundleNoKeyParameterProblem=No hay ningún parámetro de clave dado para @Resource()
-ResourceBundleNotFoundForLocaleProblem=No se puede resolver el paquete de recursos '${bundleName}' para la configuración local '${locale}'
-ResourceBundleNotFoundProblem=No se puede resolver el paquete de recursos '${bundleName}'
-RestParameterMustBeLastProblem=Los parámetros rest deben ser los últimos.
-ReturnCannotBeUsedInGlobalProblem=La sentencia devuelta no se puede utilizar en código de inicialización global.
-ReturnCannotBeUsedInPackageProblem=La sentencia devuelta no se puede utilizar en código de inicialización de paquetes.
-ReturnCannotBeUsedInStaticProblem=La sentencia devuelta no se puede utilizar en código de inicialización estático.
-ReturnMustReturnValueProblem=La función no devuelve un valor.
-ReturnValueMustBeUndefinedProblem=El valor devuelto no debe estar definido.
-SemanticProblem=Problema interno durante el análisis semántico
-SetterCannotHaveOptionalProblem=Una definición de establecimiento no puede tener parámetros opcionales.
-SetterMustHaveOneParameterProblem=Una definición de establecimiento debe tener exactamente un parámetro.
-SkinPartsMustBePublicProblem=Las partes del aspecto deben ser públicas.
-StaticAndOverrideProblem=La función no puede ser ${staticStr} y ${overrideStr} al mismo tiempo.
-StaticNamespaceDefinitionProblem=El atributo static no se admite en definiciones de ${namespaceKeyword}.
-StaticOutsideClassProblem=El atributo ${staticStr} sólo se puede utilizar en definiciones dentro de una ${classStr}.
-StrictUndefinedMethodProblem=Llamada a un método ${methodName} posiblemente no definido a través de una referencia con tipo estático ${className}.
-SyntaxProblem=Error de sintaxis: '${tokenText}' no se permite aquí
-ThisUsedInStaticFunctionProblem=La palabra clave ${thisKeyword} no se puede utilizar en métodos estático. Sólo se puede usar en métodos de instancias, cierres de funciones y código global.
-TooFewFunctionParametersProblem=Número incorrecto de argumentos. Se esperaba ${nParams}
-TooManyFunctionParametersProblem=Número incorrecto de argumentos. No se esperaba más de ${nParams}
-UnableToBuildReportProblem=No se puede crear informe: ${message}
-UnableToBuildSWFProblem=No se puede crear el ${file} SWF
-UnableToBuildSWFTagProblem=No se puede crear etiqueta SWF para ${name}
-UnableToListFilesProblem=No se puede enumerar el contenido del directorio: @{directory}
-UnboundMetadataProblem=No se encontraron metadatos vinculados a una definición
-UndefinedConfigNameProblem=Constante config no definida: '${configName}'
-UndefinedConfigNamespaceProblem=Espacio de nombres config no definido: '${configName}'
-UnexpectedExceptionProblem=Excepción inesperada '${exceptionName}'.
-UnexpectedReturnProblem=La sentencia return no se puede utilizar aquí.
-UnexpectedTokenProblem=Error de sintaxis: se esperaba ${tokenKind} pero se obtuvo '${tokenText}'
-UnfoundPropertyProblem=Acceso de propiedad no definida ${property}
-UnimplementedInterfaceMethodProblem=El método ${interfStr} ${methodName} en ${namespaceStr} ${namespaceName} no se implementa con ${classStr} ${className}
-UnknownBreakTargetProblem=No se encontró el destino de la sentencia break.
-UnknownContinueTargetProblem=No se encontró el destino de la sentencia continue.
-UnknownInterfaceProblem=No se encontró ${interfaceStr} ${interfaceName}.
-UnknownNamespaceProblem=Espacio de nombres desconocido ${namespaceName}.
-UnknownSuperclassProblem=No se encontró la definición de la clase base ${superclassName}.
-UnknownTypeProblem=No se encontró el tipo o no es una constante de tiempo de compilación: ${typeName}.
-UnresolvedClassReferenceProblem=No se encontró la definición ${qname}.
-UnresolvedNamespaceProblem=No se encontró el espacio de nombres o no es una constante en tiempo de compilación.
-UnsupportedSourceFileProblem=${file} es de tipo no admitido: ${ext}
-VarInInterfaceProblem=Las declaraciones ${varStr} no están permitidas en ${interfStr}.
-VoidTypeProblem=${voidStr} no es un tipo válido.
-WrongSkinPartProblem=El tipo de parte de aspecto '${skinPartTypeName}' debe poder asignarse a '${hostSkinPartTypeName}'.

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_fr.properties
----------------------------------------------------------------------
diff --git a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_fr.properties b/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_fr.properties
deleted file mode 100644
index 91d64d5..0000000
--- a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_fr.properties
+++ /dev/null
@@ -1,282 +0,0 @@
-################################################################################
-##
-##  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.
-##
-################################################################################
-
-ABCGeneratorProblem=Erreur interne dans le sous-système du générateur ABC lors de la génération de code pour : ${sourceFileName} : ${stackTrace}
-AccessorTypesMustMatchProblem=Les types d’accesseur doivent concorder.
-AccessUndefinedMemberProblem=Accès d’une propriété probablement non définie ${memberName} via une référence avec ${className} de type statique.
-AccessUndefinedPropertyInPackageProblem=Accès de la propriété non définie ${propertyName} dans le package ${packageName}.
-AccessUndefinedPropertyProblem=Accès de la propriété probablement non définie ${propertyName}.
-AmbiguousReferenceProblem=Référence ambiguë à la ${property}
-AssignToConstProblem=Affectation non autorisée à une variable spécifiée en tant que constante.
-AssignToFunctionProblem=Affectation non autorisée à la fonction ${funcName}.
-AssignToReadOnlyPropertyProblem=La propriété ${name} est en lecture seule.
-AttemptToDeleteFixedPropertyProblem=Tentative de suppression de la propriété fixe ${name}. Seules les propriétés définies dynamiquement peuvent être supprimées.
-AttributesAreNotCallableProblem=Les attributs ne peuvent pas être appelés.
-BadAccessInterfaceMemberProblem=Les membres d’une interface ne peuvent pas être déclarés public, private, protected ou internal.
-BadCharacterProblem=Erreur de caractère inattendue : "${errorText}" n’est pas autorisé ici
-BadSetterReturnTypeProblem=Le type renvoyé par une fonction de définition doit être non spécifié ou void.
-BaseClassIsFinalProblem=La classe de base est ${finalStr}.
-BURMDiagnosticForEachExpectedInProblem=Le mot-clé "${k_each}" n’est pas autorisé sans un opérateur "${k_in}".
-BURMDiagnosticInvalidDecrementProblem=L’opérande de décrémentation doit être une référence.
-BURMDiagnosticNotAllowedHereProblem=${node} n’est pas autorisé ici
-BURMPatternMatchFailureProblem=Impossible de générer le code pour ${node}
-BURNDiagnosticInvalidIncrementProblem=L’opérande d’incrémentation doit être une référence.
-CallUndefinedMethodProblem=Appel à une méthode qui ne semble pas définie ${methodName}.
-CannotDeleteSuperDescendantsProblem=Impossible de supprimer les descendants super.
-CannotExtendClassProblem=Une interface peut étendre uniquement d’autres interfaces, mais ${className} est une classe.
-CannotExtendInterfaceProblem=Une ${classStr} peut étendre uniquement une autre ${classStr} et non une ${interfaceStr}.
-CannotResolveConfigExpressionProblem=Impossible de résoudre la constante de configuration : "${configName}"
-CircularTypeReferenceProblem=Une référence de type circulaire a été détectée dans ${className}
-ClassesMappedToSameRemoteAliasProblem=Un mappage de "${existingClassName}" sur l’alias de classe distante "${alias}" a été détecté lors du traitement de la classe "${className}". A présent, Flex génère un code pour vérifier si un alias a déjà été enregistré. Lors de la désérialisation de données distantes, un alias peut uniquement être mappé sur une seule classe.
-ClosureProblem=Closure error.
-CodegenInternalProblem=Erreur interne du générateur de code : ${diagnostic}
-CompiledAsAComponentProblem=${className} est un module ou une application directement référencé(e). Par conséquent, ${className} et toutes ses dépendances sont liées à la ${mainDefinition}. L’utilisation d’une interface est recommandée pour éviter ce problème.
-ConfigurationFileNotFoundProblem=Fichier de configuration introuvable : ${file}
-ConfigurationProblem=Problème de configuration : ${reason}.\n${location}
-ConflictingInheritedNameInNamespaceProblem=Il existe un conflit avec la définition héritée ${declName} dans l’espace de noms ${nsName}.
-ConflictingNameInNamespaceProblem=Il existe un conflit avec la définition ${declName} dans l’espace de noms ${nsName}.
-ConstructorCannotHaveReturnTypeProblem=Un constructeur ne peut pas spécifier de type de renvoi
-ConstructorIsGetterSetterProblem=La méthode d’accesseur Get ou Set ne peut pas être un constructeur
-ConstructorIsStaticProblem=Les fonctions du constructeur doivent être des méthodes d’occurrence
-ConstructorMustBePublicProblem=Un constructeur ne peut être déclaré que comme ${modifier}
-CountedForLoopInitializerProblem=Erreur de syntaxe : un point-virgule est attendu avant la parenthèse droite.
-CSSCodeGenProblem=Problème de génération du code CSS. Raison : "${reason}"
-CSSEmbedAssetProblem=Impossible d’intégrer l’actif depuis "${embed}".
-CSSParserProblem=${reason}
-CSSUndefinedNamespacePrefixProblem=Préfixe d’espace de noms non défini "${prefix}".
-CSSUndefinedTypeProblem="${type}" non défini.
-CSSUnknownDefaultNamespaceProblem=Le sélecteur de type sans préfixe d’espace de noms requiert la définition d’un espace de noms par défaut. ${selectorText}
-CSSUnresolvedClassReferenceProblem=${qname} non défini.
-CyclicalIncludesProblem=Inclusions cycliques détectées dans ${file}
-DependencyNotCompatibleProblem=La ${definition} de dépendance de ${swc} comporte une version prise en charge minimale de ${swcMinimumVersion}, qui est supérieure à la version de compatibilité, ${compatibilityVersion}.
-DeprecatedConfigurationOptionProblem="${option}" est obsolète depuis ${since}. Utilisez "${replacement}".
-DuplicateAttributeProblem=L’attribut ${attrStr} a été spécifié à plusieurs reprises.
-DuplicateClassDefinitionProblem=Définition de classe en double : ${className}.
-DuplicateConfigNameProblem=Espace de noms de configuration en double : "${configName}"
-DuplicateFunctionDefinitionProblem=Définition de fonction en double : ${methodName}
-DuplicateInterfaceDefinitionProblem=Définition d’interface en double : ${interfaceName}.
-DuplicateInterfaceProblem=La ${classStr} ${className} implémente l’${interfaceStr} ${interfaceName} à plusieurs reprises.
-DuplicateLabelProblem=Définition d’étiquette en double.
-DuplicateNamespaceDefinitionProblem=Définition d’espace de noms en double.
-DuplicateQNameInSourcePathProblem=${qName} est défini par plusieurs fichiers : ${fileList} 
-DuplicateSkinStateProblem=Déclaration en double de SkinState "${name}"
-DuplicateSourceFileProblem=${file} a été spécifié plusieurs fois dans la liste des sources à inclure.
-DuplicateSourcePathProblem=${directory} a été spécifié plusieurs fois dans le chemin source.
-DuplicateSwitchCaseProblem=Alternative switch en double ${caseName}.
-DynamicNotOnClassProblem=L’attribut ${dynamicStr} ne peut être utilisé qu’avec des définitions de ${classStr}.
-EmbedAS2TagsModifiedProblem=Les actions AS2 ont été supprimées de la balise ${symbol}
-EmbedBadFontParameters=le transcodage de polices implique la définition de "fontName" et d’un élément "source", "systemFont" ou "sourceList".
-EmbedBadScalingGridTargetProblem=Impossible de mettre à l’échelle le symbole ${symbol} car il n’est pas de type Sprite
-EmbedCouldNotDetermineSampleFrameCountProblem=Impossible de déterminer le nombre d’images d’exemple dans le fichier ${filename}
-EmbeddedFontShadowsDeviceFontProblem=la police incorporée '${alias}' peut masquer une police de périphérique portant le même nom. Utilisez fontName pour attribuer un autre alias à la police
-EmbedExceptionWhileTranscodingProblem=exception lors du transcodage : ${exception}
-EmbedInitialValueProblem=Une variable Embed ne doit pas avoir de valeur existante.
-EmbedInvalidAttributeValueProblem=La valeur ${value} n’est pas valide pour l’attribut ${attribute}
-EmbedInvalidUnicodeRangeProblem=plage Unicode non valide "${range}"
-EmbedMissingSymbolProblem=Symbole ${symbol} introuvable dans le fichier ${swf}
-EmbedMovieScalingNoSymbolProblem=Spécifiez un symbole lors de la mise à l’échelle d’une animation intégrée
-EmbedMultipleMetaTagsProblem=Une variable ne peut disposer que d’une seule balise de métadonnées Embed
-EmbedNoSkinClassProblem=Vous devez spécifier un attribut skinClass lors de l’intégration d’actifs d’habillage
-EmbedNoSourceAttributeProblem=Embed requiert un attribut de fichier source
-EmbedQualityRequiresCompressionProblem=Ne spécifiez pas l’élément quality lorsque la compression est désactivée
-EmbedQualityValueProblem=La valeur ${value} n’est pas valide pour l’attribut quality. Elle doit être comprise entre 0.0 et 100.0
-EmbedScalingGridProblem=les attributs scaleBottom, scaleLeft, scaleRight et scaleTop doivent être spécifiés ensemble
-EmbedScalingGridValueProblem=La valeur de mise à l’échelle ${value} doit être supérieure à 0 pour l’attribut ${attr}
-EmbedSkinClassNotFoundProblem=La classe ${skinClass} est introuvable.
-EmbedSourceAttributeCouldNotBeReadProblem=Le fichier source Embed ${filename} est illisible
-EmbedSourceAttributeDoesNotExistProblem=Le fichier source Embed est introuvable
-EmbedSourceFileNotFoundProblem=Le fichier source Embed est introuvable : ${file}
-EmbedTypeNotEmbeddableProblem=Le type ${typeName} ne peut pas être intégré
-EmbedUnableToBuildFontProblem=impossible de créer la police "${fontName}"
-EmbedUnableToReadSourceProblem=impossible de lire la source de transcodage "${source}"
-EmbedUnknownAttributeProblem=Attribut inconnu : ${attr}
-EmbedUnknownMimeTypeProblem=Type MIME non pris en charge ${mimeType}
-EmbedUnrecogniedFileTypeProblem=Le fichier ${file} est un type de fichier inconnu qui ne peut pas être intégré
-EmbedUnsupportedAttributeProblem=L’attribut ${attribute} ne peut pas être utilisé avec le type MIME : ${mimeType}
-EmbedUnsupportedSamplingRateProblem=La fréquence ${frequency} n’est pas prise en charge dans le fichier ${filename}
-FileNotFoundProblem=Fichier introuvable : ${file}
-FinalOutsideClassProblem=L’attribut ${finalStr} ne peut être utilisé que dans une méthode définie dans une ${classStr}.
-FunctionNotMarkedOverrideProblem=Remplacement d’une ${funcStr} qui ne porte pas la mention ${overrideStr}
-FunctionWithoutBodyProblem=La fonction ne comporte pas d’élément body.
-FXGCompilerProblem=Problème de compilation FXG : ${message}
-GetterCannotHaveParametersProblem=Une définition d’accesseur Get ne doit disposer d’aucun paramètre.
-GlobalBindablePropertyProblem=[${bindableStr}] non autorisé sur les variables globales ou les variables ${packageStr}
-HostComponentClassNotFoundProblem=La classe du [HostComponent] "${className}" est introuvable.
-HostComponentMustHaveTypeProblem=Le [HostComponent] doit spécifier un nom de type.
-IllegalAssignmentToClassProblem=Affectation non autorisée à la classe ${className}.
-ImplicitCoercionToSubtypeProblem=Contrainte implicite d’une valeur de type statique ${baseType} pour obtenir un type probablement non lié ${subType}.
-ImplicitCoercionToUnrelatedTypeProblem=Contrainte implicite d’une valeur de type ${actualType} à un type non lié ${expectedType}.
-InaccessibleMethodReferenceProblem=Tentative d’accès de la méthode inaccessible ${methodName}, via une référence avec ${className} de type statique.
-InaccessiblePropertyReferenceProblem=Tentative d’accès de la propriété inaccessible ${propertyName}, via une référence avec ${className} de type statique.
-IncompatibleDefaultValueProblem=Valeur par défaut non compatible de type ${srcType}, alors que ${tgtType} est attendu.
-IncompatibleInterfaceMethodProblem=La méthode ${interfStr} ${methodName} dans l'${namespaceStr} ${namespaceName} est implémentée avec une signature incompatible dans la ${classStr} ${className}
-IncompatibleOverrideProblem=${overrideStr} incompatible.
-InterfaceBindablePropertyProblem=[${bindableStr}] non autorisé dans une définition d’${interfStr}.
-InterfaceCannotBeInstantiatedProblem=Les interfaces ne peuvent pas être instanciées avec l’opérateur new.
-InterfaceMethodWithBodyProblem=Les méthodes définies dans une ${interfaceStr} ne doivent pas avoir d’élément body.
-InterfaceModifierProblem=Attribut d’interface ${modifier} non valide.
-InterfaceNamespaceAttributeProblem=Les attributs d’espace de noms ne sont pas autorisés dans les méthodes d’interface.
-InternalCompilerProblem=Erreur de compilateur interne
-InvalidABCByteCodeProblem=Pseudo-code ABC non valide.
-InvalidBackgroundColorProblem=Couleur d’arrière-plan non valide : ${backgroundColor}
-InvalidDecrementOperandProblem=L’opérande de décrémentation n’est pas valide.
-InvalidEscapeSequenceProblem="${badSequence}" n’est pas une séquence d’échappement valide.
-InvalidForInInitializerProblem=Erreur de syntaxe : initialiseur for-in non valide, une seule expression attendue.
-InvalidIncrementOperandProblem=L’opérande d’incrémentation n’est pas valide.
-InvalidLvalueProblem=La cible de l’affectation doit être une valeur de référence.
-InvalidNamespaceInitializerProblem=L’initialiseur d’un espace de noms doit être une chaîne littérale ou un autre espace de noms.
-InvalidNamespaceProblem=Un attribut d’espace de noms défini par l’utilisateur ne peut être utilisé qu’au niveau supérieur d’une définition de ${classStr}.
-InvalidOverrideProblem=L’attribut ${overrideStr} ne peut être utilisé que sur une méthode définie dans une ${classStr}.
-InvalidPrivateNamespaceAttrProblem=L’attribut ${privateStr} ne peut être utilisé que dans des définitions de propriétés de ${classStr}.
-InvalidPrivateNamespaceProblem=${privateStr} peut être utilisé uniquement en tant qu’espace de noms à l’intérieur d’une ${classStr}.
-InvalidProtectedNamespaceAttrProblem=L’attribut ${protectedStr} ne peut être utilisé que dans des définitions de propriétés de ${classStr}.
-InvalidProtectedNamespaceProblem=${protectedStr} peut être utilisé uniquement en tant qu’espace de noms à l’intérieur d’une ${classStr}.
-InvalidPublicNamespaceAttrProblem=L’attribut ${publicStr} ne peut être utilisé que dans un ${packageStr}.
-InvalidPublicNamespaceProblem=${publicStr} peut être utilisé uniquement en tant qu’espace de noms à l’intérieur d’un ${packageStr}.
-InvalidRestParameterDeclarationProblem=Les paramètres spécifiés après le mot-clé de définition du paramètre ...rest sont obligatoirement de type Array.
-InvalidSuperExpressionProblem=Une expression super ne peut être utilisée que dans des méthodes d’occurrence de classe.
-InvalidSuperStatementProblem=Une instruction super ne peut être utilisée que dans des constructeurs d’occurrence de classe.
-JSDataClassMethodError=ERROR: DataClass classes must not declare methods. 
-JSInternalCompilerProblem=Internal compiler error: ${message}. 
-JSUnsupportedFeatureProblem=Unsupported feature: ${feature}. 
-JSWarnClassInitProblem=PERFORMANCE: Avoid loose class initialization statements. Consider using singletons instead.
-JSWarnClosureAdvancedOptimizationsProblem=WARNING: Optimizing with ADVANCED_OPTIMIZATIONS will fail because of accessing properties via unknown strings.
-JSWarnRuntimeNameLookupProblem=PERFORMANCE: Forced to emit expensive runtime name lookup. Consider using strict types instead of generic objects and avoiding dynamic classes.
-LocalBindablePropertyProblem=[${bindableStr}] n’est pas autorisé dans une définition ${funcStr}.
-LossyConversionProblem=Initialisation non valide : la conversion en type ${targetType} entraîne la perte de données.
-MethodCannotBeConstructorProblem=La méthode ne peut pas être utilisée en tant que constructeur.
-MissingBuiltinProblem=Type de construction manquant ${builtinType}
-MissingCatchOrFinallyProblem=Erreur de syntaxe : instruction catch ou clause finally attendue.
-MissingFactoryClassInFrameMetadataProblem=Cette unité de compilation ne disposait pas de classe factoryClass spécifiée dans les métadonnées Frame en vue de charger les bibliothèques partagées d’exécution configurées. Pour effectuer la compilation sans bibliothèque partagée d’exécution, définissez l’option -static-link-runtime-shared-libraries sur true ou supprimez l’option -runtime-shared-libraries.
-MissingRequirementConfigurationProblem=la variable de configuration "${required}" n’a pas été définie
-MissingSignedDigestProblem=Digest signé introuvable dans catalog.xml de la bibliothèque, ${libraryPath}.
-MissingSkinPartProblem=La partie d’habillage requise "${skinPartName}" est manquante.
-MissingSkinStateProblem=L’état d’habillage requis "${skinStateName}" est manquant.
-MissingUnsignedDigestProblem=Digest non signé introuvable dans catalog.xml de la bibliothèque, ${libraryPath}.
-MultipleConfigNamespaceDecorationsProblem=Les espaces de noms de configuration en double ne sont pas autorisés dans une définition.
-MultipleSwitchDefaultsProblem=L’instruction switch comporte plusieurs valeurs par défaut, mais une seule valeur par défaut est autorisée.
-MXMLAttributeVersionProblem=L’attribut "${name}" peut être utilisé uniquement dans MXML ${version} ou version ultérieure. Il sera ignoré.
-MXMLClassNodeProblem="${qname}" ne spécifie pas une classe ou une interface. Il sera ignoré.
-MXMLDatabindingSourceNotBindableProblem=La liaison de données ne pourra pas détecter les affectations à "${sourceName}".
-MXMLDuplicateIDProblem=Cet ID n’est pas unique. Il sera ignoré.
-MXMLFinalClassProblem="${qname}" est une classe finale, elle ne peut pas être utilisée comme balise racine.
-MXMLIncludeInAndExcludeFromProblem=Les attributs "includeIn" et "excludeFrom" ne peuvent pas être spécifiés sur cette même balise. Ils seront tous les deux ignorés.
-MXMLIncompatibleArrayElementProblem=Un élément de tableau de type "${actualType}" est incompatible avec le type [ArrayElementType] attendu de "${expectedType}" pour la propriété "${propertyName}".
-MXMLIncompatibleVectorElementProblem=Cet élément n’est pas compatible avec le type Vector. Il sera ignoré.
-MXMLInvalidEntityProblem=Entité inconnue "{entity}" détectée. Elle sera ignorée.
-MXMLInvalidIDProblem=Cet ID n’est pas un identifiant ActionScript valide. Il sera ignoré.
-MXMLInvalidItemCreationPolicyProblem=Les valeurs valides pour itemCreationPolicy sont "immediate" ou "deferred". Cet attribut sera ignoré.
-MXMLInvalidItemDestructionPolicyProblem=Les valeurs valides pour itemDestructionPolicy sont "auto" ou "never". Cet attribut sera ignoré.
-MXMLInvalidPercentageProblem=Initialiseur pour "${property}" : expression de pourcentage non valide : "${text}".
-MXMLInvalidTextForTypeProblem=Impossible d’analyser une valeur de type "${type}" depuis "${text}".
-MXMLInvalidVectorFixedAttributeProblem=L’attribut "fixed" doit être "true" ou "false". Il sera ignoré.
-MXMLInvalidVectorTypeAttributeProblem=L’attribut "type" ne spécifie pas une classe connue. Le type sera pris en compte comme "*".
-MXMLMissingRootTagProblem=Balise racine introuvable dans ce fichier MXML.
-MXMLMissingVectorTypeAttributeProblem=Un attribut "type" est requis sur une balise <Vector>. Le type sera pris en compte comme "*".
-MXMLNotAClassProblem="${qname}" n’est pas une classe. Cette balise sera ignorée.
-MXMLOperationMissingNameProblem=Cette opération requiert un attribut name.
-MXMLOtherLanguageNamespaceProblem=Un seul espace de noms de langage peut être utilisé dans un document MXML. Cet attribut sera ignoré.
-MXMLOuterDocumentAlreadyDeclaredProblem=Une propriété intitulée outerDocument a déjà été déclarée, ce qui crée un conflit avec la propriété outerDocument de la balise fx:Component.
-MXMLPercentageNotAllowedProblem=Initialiseur pour "${property}" : pourcentage non autorisé ici : "${text}".
-MXMLPrivateAttributeProblem=L’attribut utilise un espace de noms privé. Il sera donc ignoré.
-MXMLPrivateTagLocationProblem=La balise <Private> doit être la dernière balise enfant de la balise racine du fichier. Elle sera ignorée.
-MXMLSemanticProblem=Problème interne lors de l’analyse sémantique de MXML
-MXMLUnexpectedAttributeProblem=Cet attribut est inattendu. Il sera ignoré.
-MXMLUnexpectedDatabindingProblem=Cette expression de liaison de données est inattendue. Elle sera ignorée.
-MXMLUnexpectedTagProblem=Cette balise est inattendue. Elle sera ignorée.
-MXMLUnexpectedTextProblem=Ce texte est inattendu. Il sera ignoré.
-MXMLUnrecognizedCompilerDirectiveProblem=La fonction ${functionName} n’est pas une directive de compilation reconnue.
-MXMLUnresolvedTagProblem=Cette balise n’a pas pu être résolue dans une classe ActionScript. Elle sera ignorée.
-MXMLUnterminatedEntityProblem=Entité inachevée détectée. Elle sera ignorée.
-MXMLXMLListMixedContentProblem=Contenu mixte non autorisé ici.
-MXMLXMLOnlyOneRootTagProblem=Une seule balise racine est autorisée.
-MXMLXMLRequireContentProblem=Le contenu XML est requis.
-NamespaceInInterfaceProblem=Déclarations d’espaces de noms interdites dans les interfaces.
-NativeMethodWithBodyProblem=Les méthodes natives ne peuvent pas comporter d’élément body.
-NativeNotOnFunctionProblem=L’attribut ${nativeStr} ne peut être utilisé qu’avec des définitions de ${functionStr}.
-NativeUsedInInterfaceProblem=L’attribut ${nativeStr} ne peut pas être utilisé dans des définitions d’${interfStr}.
-NativeVariableProblem=Les variables ne peuvent pas être de type ${nativeStr}.
-NestedGetterSetterProblem=Les accesseurs ne peuvent pas être imbriqués dans d’autres fonctions.
-NestedPackageProblem=Les packages ne peuvent pas être imbriqués.
-NoCompilationUnitForDefinitionProblem=Unité de compilation nommée "${qname}" introuvable.
-NoDefaultConstructorInBaseClassProblem=Aucun constructeur par défaut détecté dans la classe de base ${baseClass}.
-NoDefinitionForSWCDependencyProblem=La définition ${qname} qui dépendait du fichier SWC ${swcFilename} est introuvable.
-NoMainDefinitionProblem=La définition visible de l’extérieur nommée "${qname}" est introuvable.
-NonConstantNamespaceProblem=L’initialiseur d’un espace de noms doit être une chaîne littérale ou un autre espace de noms.
-NonConstantParamInitializerProblem=L’initialiseur de paramètres est inconnu ou il ne s’agit pas d’une constante de compilation.
-NonDirectoryInSourcePathProblem=${file} a été spécifié dans le chemin source et n’est pas un répertoire.
-NoScopesInABCCompilationUnitProblem=Domaines introuvables dans l’unité de compilation.
-OnlyOneHostComponentAllowedProblem=Un seul [HostComponent] est autorisé.
-OverlappingSourcePathProblem=Chevauchement des entrées de chemin source : ${ancestor} est un ancêtre de ${descendant}
-OverrideFinalProblem=Impossible de redéfinir une méthode de type ${finalStr}.
-OverrideNotFoundProblem=La méthode indiquée ${overrideStr} doit remplacer une autre méthode.
-OverrideOutsideClassProblem=L’attribut ${overrideStr} ne peut être utilisé que dans des définitions de propriétés de ${classStr}.
-PackageCannotBeUsedAsValueProblem=Impossible d’utiliser le package comme une valeur : ${packageName}
-ParserProblem=Problème d’analyse interne
-PropertyIsWriteOnlyProblem=La propriété ${name} est en écriture seule.
-PrototypeInvalidAttributeProblem=Attribut prototype non valide.
-RemovedConfigurationOptionProblem="${option}" n’est plus prise en charge et n’a aucun effet.
-RequiredParameterAfterOptionalProblem=Les paramètres obligatoires sont interdits après les paramètres facultatifs.
-ResourceBundleMalformedEncodingProblem=Le codage de la chaîne donnée est incorrectement formé : ${string}
-ResourceBundleNoBundleParameterProblem=Aucun paramètre de regroupement donné pour @Resource()
-ResourceBundleNoKeyParameterProblem=Aucun paramètre de clé donné pour @Resource()
-ResourceBundleNotFoundForLocaleProblem=Impossible de résoudre le regroupement de ressources "${bundleName}" pour les paramètres régionaux "${locale}"
-ResourceBundleNotFoundProblem=Impossible de résoudre le regroupement de ressources "${bundleName}"
-RestParameterMustBeLastProblem=Les paramètres rest doivent être les derniers.
-ReturnCannotBeUsedInGlobalProblem=L’instruction return ne peut pas être utilisée dans du code d’initialisation global.
-ReturnCannotBeUsedInPackageProblem=L’instruction return ne peut pas être utilisée dans du code d’initialisation de package.
-ReturnCannotBeUsedInStaticProblem=L’instruction return ne peut pas être utilisée dans du code d’initialisation statique.
-ReturnMustReturnValueProblem=La fonction ne renvoie pas de valeur.
-ReturnValueMustBeUndefinedProblem=La valeur renvoyée doit être de type non défini.
-SemanticProblem=Problème interne lors de l’analyse sémantique
-SetterCannotHaveOptionalProblem=Une définition d’accesseur Set ne doit disposer d’aucun paramètre facultatif.
-SetterMustHaveOneParameterProblem=Une définition d’accesseur Set doit disposer d’exactement un paramètre.
-SkinPartsMustBePublicProblem=Les parties d’habillage doivent être publiques.
-StaticAndOverrideProblem=Les fonctions ne peuvent pas être à la fois ${staticStr} et ${overrideStr}.
-StaticNamespaceDefinitionProblem=L’attribut static n’est pas autorisé dans les définitions d’${namespaceKeyword}.
-StaticOutsideClassProblem=L’attribut ${staticStr} ne peut être utilisé que pour les définitions au sein d’une ${classStr}.
-StrictUndefinedMethodProblem=Appel à une méthode ${methodName} probablement non définie via une référence avec ${className} de type statique.
-SyntaxProblem=Erreur de syntaxe : "${tokenText}" non autorisé ici
-ThisUsedInStaticFunctionProblem=Le mot-clé ${thisKeyword} ne peut pas être utilisé dans les méthodes statiques. Il peut uniquement être utilisé dans des méthodes d’occurrence, des fermetures de fonctions et du code global.
-TooFewFunctionParametersProblem=Nombre incorrect d’arguments. ${nParams} attendus
-TooManyFunctionParametersProblem=Nombre incorrect d’arguments. ${nParams} maximum attendus
-UnableToBuildReportProblem=Impossible de créer le rapport : ${message}
-UnableToBuildSWFProblem=Impossible de créer le fichier SWF ${file}
-UnableToBuildSWFTagProblem=Impossible de créer la balise SWF pour ${name}
-UnableToListFilesProblem=Impossible de répertorier le contenu du répertoire : @{directory}
-UnboundMetadataProblem=Les métadonnées n’étaient liées à aucune définition.
-UndefinedConfigNameProblem=Constante de configuration non définie : "${configName}"
-UndefinedConfigNamespaceProblem=Espace de noms de configuration non défini : "${configName}"
-UnexpectedExceptionProblem=Exception inattendue "${exceptionName}".
-UnexpectedReturnProblem=L’instruction return ne peut pas être utilisée ici.
-UnexpectedTokenProblem=Erreur de syntaxe : ${tokenKind} attendu, mais "${tokenText}" obtenu
-UnfoundPropertyProblem=Accès d’une propriété non définie ${property}
-UnimplementedInterfaceMethodProblem=La méthode ${interfStr} ${methodName} dans l’${namespaceStr} ${namespaceName} n’est pas implémentée par la ${classStr} ${className}.
-UnknownBreakTargetProblem=La cible de l’instruction break est introuvable.
-UnknownContinueTargetProblem=La cible de l’instruction continue est introuvable.
-UnknownInterfaceProblem=L’${interfaceStr} ${interfaceName} est introuvable.
-UnknownNamespaceProblem=Espace de noms inconnu ${namespaceName}.
-UnknownSuperclassProblem=La définition de la classe de base ${superclassName} est introuvable.
-UnknownTypeProblem=Le type est introuvable ou n’est pas une constante de compilation : ${typeName}
-UnresolvedClassReferenceProblem=La définition ${qname} est introuvable.
-UnresolvedNamespaceProblem=L’espace de noms est introuvable ou n’est pas une constante de compilation.
-UnsupportedSourceFileProblem=${file} n’utilise pas un type de fichier pris en charge : ${ext}
-VarInInterfaceProblem=Les déclarations ${varStr} ne sont pas autorisées dans ${interfStr}.
-VoidTypeProblem=${voidStr} n’est pas un type valide.
-WrongSkinPartProblem=Le type de partie d’habillage "${skinPartTypeName}" doit être attribuable à "${hostSkinPartTypeName}".

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_it.properties
----------------------------------------------------------------------
diff --git a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_it.properties b/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_it.properties
deleted file mode 100644
index 7499c77..0000000
--- a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_it.properties
+++ /dev/null
@@ -1,282 +0,0 @@
-################################################################################
-##
-##  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.
-##
-################################################################################
-
-ABCGeneratorProblem=Errore interno nel sottosistema generatore ABC durante la generazione del codice per: ${sourceFileName}: ${stackTrace}
-AccessorTypesMustMatchProblem=I tipi di accessor devono corrispondere.
-AccessUndefinedMemberProblem=Accesso a una proprietà possibilmente non definita ${memberName} mediante un riferimento con tipo statico ${className}.
-AccessUndefinedPropertyInPackageProblem=Accesso alla proprietà possibilmente non definita ${propertyName} nel pacchetto ${packageName}.
-AccessUndefinedPropertyProblem=Accesso alla proprietà possibilmente non definita ${propertyName}.
-AmbiguousReferenceProblem=Riferimento ambiguo a ${property}
-AssignToConstProblem=Assegnazione non valida a una variabile specificata come costante.
-AssignToFunctionProblem=Assegnazione non valida alla funzione ${funcName}.
-AssignToReadOnlyPropertyProblem=La proprietà ${name} è di sola lettura.
-AttemptToDeleteFixedPropertyProblem=Tentativo di eliminare la proprietà fissa ${name}. Solo le proprietà definite dinamicamente possono essere eliminate.
-AttributesAreNotCallableProblem=Gli attributi non sono richiamabili.
-BadAccessInterfaceMemberProblem=I membri di interfaccia non possono essere dichiarati public, private, protected o internal.
-BadCharacterProblem=Errore di carattere imprevisto: '${errorText}' non è consentito in questo punto
-BadSetterReturnTypeProblem=Il tipo restituito di una definizione setter non deve essere specificato o deve essere void.
-BaseClassIsFinalProblem=La classe base è ${finalStr}.
-BURMDiagnosticForEachExpectedInProblem=La parola chiave '${k_each}' non è consentita senza un operatore '${k_in}'
-BURMDiagnosticInvalidDecrementProblem=L'operando di decremento deve essere un riferimento.
-BURMDiagnosticNotAllowedHereProblem=${node} non consentito qui
-BURMPatternMatchFailureProblem=Impossibile generare il codice per ${node}
-BURNDiagnosticInvalidIncrementProblem=L'operando di incremento deve essere un riferimento.
-CallUndefinedMethodProblem=Chiamata al metodo possibilmente non definito ${methodName}.
-CannotDeleteSuperDescendantsProblem=Impossibile eliminare discendenti super.
-CannotExtendClassProblem=Un'interfaccia può estendere solo altre interfacce, ma ${className} è una classe.
-CannotExtendInterfaceProblem=Una ${classStr} può estendere solo un'altra ${classStr}, non un'${interfaceStr}.
-CannotResolveConfigExpressionProblem=Impossibile risolvere la costante di configurazione: '${configName}'
-CircularTypeReferenceProblem=Tipo di riferimento circolare rilevato in ${className}
-ClassesMappedToSameRemoteAliasProblem=È stata trovata una mappatura per '${existingClassName}' all'alias di classe remota '${alias}' durante l'elaborazione della classe '${className}'. Flex ora genera codice per verificare se un alias è già stato registrato. Durante la deserializzazione di dati remoti, un alias può essere mappato a una sola classe.
-ClosureProblem=Closure error.
-CodegenInternalProblem=Errore interno del generatore di codice: ${diagnostic}
-CompiledAsAComponentProblem=${className} è un modulo o un'applicazione con riferimento diretto. Di conseguenza ${className} e tutte le sue dipendenze saranno collegate con ${mainDefinition}. È consigliato l'uso di un'interfaccia per evitare questa situazione.
-ConfigurationFileNotFoundProblem=Impossibile trovare il file di configurazione: ${file}
-ConfigurationProblem=Problema di configurazione: ${reason}.\n${location}
-ConflictingInheritedNameInNamespaceProblem=Esiste un conflitto con la definizione ereditata ${declName} nello spazio dei nomi ${nsName}.
-ConflictingNameInNamespaceProblem=Esiste un conflitto con la definizione ${declName} nello spazio dei nomi ${nsName}.
-ConstructorCannotHaveReturnTypeProblem=Una funzione di costruzione non può specificare un tipo restituito
-ConstructorIsGetterSetterProblem=Una funzione di costruzione non può essere un metodo getter o setter
-ConstructorIsStaticProblem=Le funzioni di costruzione devono essere metodi di istanze
-ConstructorMustBePublicProblem=Una funzione di costruzione può essere dichiarata solo ${modifier}
-CountedForLoopInitializerProblem=Errore di sintassi: è previsto un punto e virgola prima di rightparen.
-CSSCodeGenProblem=Problema di generazione codice CSS. Motivo: '${reason}'
-CSSEmbedAssetProblem=Impossibile incorporare la risorsa da '${embed}'.
-CSSParserProblem=${reason}
-CSSUndefinedNamespacePrefixProblem=Prefisso spazio dei nomi non definito '${prefix}'.
-CSSUndefinedTypeProblem='${type}' non definito.
-CSSUnknownDefaultNamespaceProblem=Un selettore di tipo senza prefisso di spazio dei nomi richiede la definizione di uno spazio dei nomi predefinito. ${selectorText}
-CSSUnresolvedClassReferenceProblem=${qname} non definito.
-CyclicalIncludesProblem=Include cicliche trovate in ${file}
-DependencyNotCompatibleProblem=La dipendenza ${definition} di ${swc} prevede la versione minima supportata ${swcMinimumVersion}, che è successiva alla versione di compatibilità ${compatibilityVersion}.
-DeprecatedConfigurationOptionProblem='${option}' è stata dichiarata obsoleta a partire da ${since}. Utilizzate '${replacement}'
-DuplicateAttributeProblem=L'attributo ${attrStr} è stato specificato più volte.
-DuplicateClassDefinitionProblem=Definizione di classe duplicata: ${className}.
-DuplicateConfigNameProblem=Spazio dei nomi di configurazione duplicato: '${configName}'
-DuplicateFunctionDefinitionProblem=Definizione di funzione duplicata: ${methodName}
-DuplicateInterfaceDefinitionProblem=Definizione di interfaccia duplicata: ${interfaceName}.
-DuplicateInterfaceProblem=${classStr} ${className} implementa ${interfaceStr} ${interfaceName} più volte.
-DuplicateLabelProblem=Definizione di etichetta duplicata.
-DuplicateNamespaceDefinitionProblem=Definizione dello spazio dei nomi duplicata.
-DuplicateQNameInSourcePathProblem=${qName} è definito da più file: ${fileList} 
-DuplicateSkinStateProblem=Dichiarazione duplicata di SkinState '${name}'
-DuplicateSourceFileProblem=${file} è stato specificato più di una volta nell'elenco delle origini di include.
-DuplicateSourcePathProblem=${directory} è stata specificata più di una volta nel percorso di origine.
-DuplicateSwitchCaseProblem=Alternativa switch duplicata ${caseName}.
-DynamicNotOnClassProblem=L'attributo ${dynamicStr} può essere utilizzato solo nelle definizioni di ${classStr}.
-EmbedAS2TagsModifiedProblem=Le azioni AS2 sono state rimosse dal tag ${symbol}
-EmbedBadFontParameters=La transcodifica dei caratteri richiede che venga specificato 'fontName' e uno tra 'source', 'systemFont' e 'sourceList'
-EmbedBadScalingGridTargetProblem=Impossibile ridimensionare il simbolo ${symbol} perché non è del tipo Sprite
-EmbedCouldNotDetermineSampleFrameCountProblem=Impossibile determinare il numero di fotogrammi campione nel file ${filename}
-EmbeddedFontShadowsDeviceFontProblem=Il carattere incorporato '${alias}' può sovrapporsi a un carattere dispositivo con lo stesso nome. Specificate fontName come alias per indicare il carattere con un nome differente
-EmbedExceptionWhileTranscodingProblem=Eccezione durante la transcodifica: ${exception}
-EmbedInitialValueProblem=Una variabile Embed non può avere un valore esistente.
-EmbedInvalidAttributeValueProblem=Il valore ${value} non è valido per l'attributo ${attribute}
-EmbedInvalidUnicodeRangeProblem=Intervallo Unicode non valido '${range}'
-EmbedMissingSymbolProblem=Impossibile trovare il simbolo ${symbol} nel file ${swf}
-EmbedMovieScalingNoSymbolProblem=Specificate un simbolo quando ridimensionate un filmato incorporato
-EmbedMultipleMetaTagsProblem=Una variabile può avere un solo tag di metadati Embed
-EmbedNoSkinClassProblem=Specificate un attributo skinClass quando incorporate risorse skin
-EmbedNoSourceAttributeProblem=Embed richiede un attributo di file di origine
-EmbedQualityRequiresCompressionProblem=Non specificate quality se la compressione è disattivata
-EmbedQualityValueProblem=Il valore ${value} non è valido per l'attributo quality. Deve essere compreso tra 0.0 e 100.0
-EmbedScalingGridProblem=Gli attributi scaleBottom, scaleLeft, scaleRight e scaleTop devono essere specificati insieme
-EmbedScalingGridValueProblem=Il valore di ridimensionamento ${value} deve essere maggiore di 0 per l'attributo ${attr}
-EmbedSkinClassNotFoundProblem=Impossibile trovare la classe ${skinClass}
-EmbedSourceAttributeCouldNotBeReadProblem=Impossibile leggere il file di origine Embed ${filename}
-EmbedSourceAttributeDoesNotExistProblem=Impossibile trovare il file di origine Embed
-EmbedSourceFileNotFoundProblem=Impossibile trovare il file di origine Embed: ${file}
-EmbedTypeNotEmbeddableProblem=Impossibile incorporare il tipo ${typeName}
-EmbedUnableToBuildFontProblem=Impossibile generare il carattere '${fontName}'
-EmbedUnableToReadSourceProblem=Impossibile leggere l'origine di transcodifica '${source}'
-EmbedUnknownAttributeProblem=Attributo sconosciuto: ${attr}
-EmbedUnknownMimeTypeProblem=Tipo mime non gestito ${mimeType}
-EmbedUnrecogniedFileTypeProblem=Il file ${file} è di un tipo sconosciuto che non può essere incorporato
-EmbedUnsupportedAttributeProblem=L'attributo ${attribute} non può essere utilizzato con il tipo mime: ${mimeType}
-EmbedUnsupportedSamplingRateProblem=La frequenza ${frequency} non è supportata nel file ${filename}
-FileNotFoundProblem=File non trovato: ${file}
-FinalOutsideClassProblem=L'attributo ${finalStr} può essere utilizzato solo in un metodo definito in una ${classStr}.
-FunctionNotMarkedOverrideProblem=Override di una ${funcStr} non contrassegnata per l'${overrideStr}
-FunctionWithoutBodyProblem=La funzione non ha un corpo.
-FXGCompilerProblem=Problema di compilazione FXG: ${message}
-GetterCannotHaveParametersProblem=Una definizione getter non può avere parametri.
-GlobalBindablePropertyProblem=[${bindableStr}] non consentito sulle variabili globali o ${packageStr}
-HostComponentClassNotFoundProblem=[HostComponent] classe '${className}' non trovata.
-HostComponentMustHaveTypeProblem=[HostComponent] deve specificare un nome di tipo.
-IllegalAssignmentToClassProblem=Assegnazione non valida alla classe ${className}.
-ImplicitCoercionToSubtypeProblem=Assegnazione forzata implicita di un valore di tipo statico ${baseType} a un tipo ${subType} possibilmente non correlato.
-ImplicitCoercionToUnrelatedTypeProblem=Assegnazione forzata implicita di un valore del tipo ${actualType} a un tipo ${expectedType} non correlato.
-InaccessibleMethodReferenceProblem=Tentativo di accesso al metodo non accessibile ${methodName} mediante un riferimento con tipo statico ${className}.
-InaccessiblePropertyReferenceProblem=Tentativo di accesso alla proprietà non accessibile ${propertyName} mediante un riferimento con tipo statico ${className}.
-IncompatibleDefaultValueProblem=Valore predefinito non compatibile del tipo ${srcType} invece del tipo previsto ${tgtType}.
-IncompatibleInterfaceMethodProblem=Il metodo ${methodName} di ${interfStr} in ${namespaceStr} ${namespaceName} è implementato con una firma incompatibile in ${classStr} ${className}
-IncompatibleOverrideProblem=${overrideStr} incompatibile.
-InterfaceBindablePropertyProblem=[${bindableStr}] non è consentito in una definizione ${interfStr}.
-InterfaceCannotBeInstantiatedProblem=Non è possibile creare istanze di interfacce con l'operatore new.
-InterfaceMethodWithBodyProblem=I metodi definiti in una ${interfaceStr} non possono avere un corpo.
-InterfaceModifierProblem=L'attributo di interfaccia ${modifier} non è valido.
-InterfaceNamespaceAttributeProblem=Gli attributi namespace non sono consentiti nei metodi di interfaccia.
-InternalCompilerProblem=Errore interno del compilatore
-InvalidABCByteCodeProblem=Codice byte ABC non valido.
-InvalidBackgroundColorProblem=Colore di sfondo non valido: ${backgroundColor}
-InvalidDecrementOperandProblem=L'operando di decremento non è valido.
-InvalidEscapeSequenceProblem='${badSequence}' non è una sequenza di escape valida
-InvalidForInInitializerProblem=Errore di sintassi: inizializzatore for-in non valido; è prevista una sola espressione.
-InvalidIncrementOperandProblem=L'operando di incremento non è valido.
-InvalidLvalueProblem=La destinazione dell'assegnazione deve essere un valore di riferimento.
-InvalidNamespaceInitializerProblem=Un inizializzatore di spazio dei nomi deve essere una stringa letterale o un altro spazio dei nomi.
-InvalidNamespaceProblem=Un attributo namespace definito dall'utente può essere utilizzato solo al livello principale di una definizione di ${classStr}.
-InvalidOverrideProblem=L'attributo ${overrideStr} può essere utilizzato solo in un metodo definito in una classe.
-InvalidPrivateNamespaceAttrProblem=L'attributo ${privateStr} può essere utilizzato solo nelle definizioni delle proprietà di ${classStr}.
-InvalidPrivateNamespaceProblem=${privateStr} può essere utilizzato come spazio dei nomi solo all'interno di una ${classStr}.
-InvalidProtectedNamespaceAttrProblem=L'attributo ${protectedStr} può essere utilizzato solo nelle definizioni delle proprietà di ${classStr}.
-InvalidProtectedNamespaceProblem=${protectedStr} può essere utilizzato come spazio dei nomi solo all'interno di una ${classStr}.
-InvalidPublicNamespaceAttrProblem=L'attributo ${publicStr} può essere utilizzato solo all'interno di un ${packageStr}.
-InvalidPublicNamespaceProblem=${publicStr} può essere utilizzato come spazio dei nomi solo all'interno di una ${packageStr}.
-InvalidRestParameterDeclarationProblem=I parametri specificati dopo la parola chiave di definizione parametro ...rest possono essere solo del tipo di dati Array.
-InvalidSuperExpressionProblem=Un'espressione super può essere utilizzata solo nei metodi di istanze di classe.
-InvalidSuperStatementProblem=Un'istruzione super può essere utilizzata solo nelle funzioni di costruzione di istanze di classe.
-JSDataClassMethodError=ERROR: DataClass classes must not declare methods. 
-JSInternalCompilerProblem=Internal compiler error: ${message}. 
-JSUnsupportedFeatureProblem=Unsupported feature: ${feature}. 
-JSWarnClassInitProblem=PERFORMANCE: Avoid loose class initialization statements. Consider using singletons instead.
-JSWarnClosureAdvancedOptimizationsProblem=WARNING: Optimizing with ADVANCED_OPTIMIZATIONS will fail because of accessing properties via unknown strings.
-JSWarnRuntimeNameLookupProblem=PERFORMANCE: Forced to emit expensive runtime name lookup. Consider using strict types instead of generic objects and avoiding dynamic classes.
-LocalBindablePropertyProblem=[${bindableStr}] non è consentito in una definizione ${funcStr}.
-LossyConversionProblem=Inizializzazione non valida: la conversione al tipo ${targetType} determina una perdita di dati.
-MethodCannotBeConstructorProblem=Il metodo non può essere utilizzato come funzione di costruzione.
-MissingBuiltinProblem=Tipo incorporato mancante ${builtinType}
-MissingCatchOrFinallyProblem=Errore di sintassi: è prevista una clausola catch o finally.
-MissingFactoryClassInFrameMetadataProblem=In questa unità di compilazione non è specificata una factoryClass nei metadati Frame per il caricamento delle librerie condivise in runtime. Per compilare senza librerie condivise in runtime, impostate l'opzione -static-link-runtime-shared-libraries su true oppure rimuovete l'opzione -runtime-shared-libraries.
-MissingRequirementConfigurationProblem=Variabile di configurazione '${required}' non impostata
-MissingSignedDigestProblem=Nessun digest firmato trovato nel file catalog.xml della libreria, ${libraryPath}.
-MissingSkinPartProblem=La parte skin richiesta '${skinPartName}' è mancante.
-MissingSkinStateProblem=Lo stato skin richiesto '${skinPartName}' è mancante.
-MissingUnsignedDigestProblem=Nessun digest non firmato trovato nel file catalog.xml della libreria, ${libraryPath}.
-MultipleConfigNamespaceDecorationsProblem=Gli spazi dei nomi di configurazione duplicati non sono consentiti in una definizione
-MultipleSwitchDefaultsProblem=L'istruzione switch ha più valori predefiniti, mentre ne è consentito solo uno.
-MXMLAttributeVersionProblem=L'attributo '${name}' può essere utilizzato solo in MXML ${version} e versioni successive. Verrà ignorato.
-MXMLClassNodeProblem='${qname}' non specifica una classe o un'interfaccia. Verrà ignorato.
-MXMLDatabindingSourceNotBindableProblem=La funzione di associazione dati non sarà in grado di rilevare le assegnazioni a '${sourceName}'.
-MXMLDuplicateIDProblem=Questo ID non è univoco. Verrà ignorato.
-MXMLFinalClassProblem='${qname}' è una classe finale e quindi non può essere utilizzata come tag principale.
-MXMLIncludeInAndExcludeFromProblem=Gli attributi 'includeIn' e 'excludeFrom' non possono essere specificati nello stesso tag. Verranno entrambi ignorati.
-MXMLIncompatibleArrayElementProblem=Un elemento array di tipo '${actualType}' è incompatibile con il [ArrayElementType] di '${expectedType}' previsto per la proprietà '${propertyName}'.
-MXMLIncompatibleVectorElementProblem=Questo elemento è incompatibile con il tipo Vector. Verrà ignorato.
-MXMLInvalidEntityProblem=Entità sconosciuta '{entity}' trovata. Verrà ignorata.
-MXMLInvalidIDProblem=Questo ID non è un identificatore ActionScript valido. Verrà ignorato.
-MXMLInvalidItemCreationPolicyProblem=I valori validi per itemCreationPolicy sono 'immediate' e 'deferred'. Questo attributo verrà ignorato.
-MXMLInvalidItemDestructionPolicyProblem=I valori validi per itemDestructionPolicy sono 'auto' e 'never'. Questo attributo verrà ignorato.
-MXMLInvalidPercentageProblem=Inizializzatore per '${property}': espressione percentuale non valida: '${text}'.
-MXMLInvalidTextForTypeProblem=Impossibile analizzare un valore di tipo '${type}' da '${text}'.
-MXMLInvalidVectorFixedAttributeProblem=L'attributo 'fixed' deve essere 'true' o 'false'. Verrà ignorato.
-MXMLInvalidVectorTypeAttributeProblem=L'attributo 'type' non specifica una classe nota. Verrà utilizzato il tipo '*'.
-MXMLMissingRootTagProblem=Nessun tag principale trovato in questo file MXML.
-MXMLMissingVectorTypeAttributeProblem=È richiesto un attributo 'type' in un tag <Vector>. Verrà utilizzato il tipo '*'.
-MXMLNotAClassProblem='${qname}' non è una classe. Questo tag verrà ignorato.
-MXMLOperationMissingNameProblem=L'operazione richiede un attributo name.
-MXMLOtherLanguageNamespaceProblem=È possibile utilizzare un solo spazio dei nomi language in un documento MXML. Questo attributo verrà ignorato.
-MXMLOuterDocumentAlreadyDeclaredProblem=È già stata dichiarata una proprietà denominata outerDocument, in conflitto con la proprietà outerDocument del tag fx:Component.
-MXMLPercentageNotAllowedProblem=Inizializzatore per '${property}': espressione percentuale non consentita qui: '${text}'.
-MXMLPrivateAttributeProblem=Questo attributo usa uno spazio dei nomi privato e verrà quindi ignorato.
-MXMLPrivateTagLocationProblem=Il tag <Private> deve essere l'ultimo tag secondario del tag principale del file. Verrà ignorato.
-MXMLSemanticProblem=Problema interno durante l'analisi semantica del codice MXML
-MXMLUnexpectedAttributeProblem=Attributo non previsto. Verrà ignorato.
-MXMLUnexpectedDatabindingProblem=Espressione di associazione dati non prevista. Verrà ignorata.
-MXMLUnexpectedTagProblem=Tag non previsto. Verrà ignorato.
-MXMLUnexpectedTextProblem=Testo non previsto. Verrà ignorato.
-MXMLUnrecognizedCompilerDirectiveProblem=La funzione ${functionName} non è una direttiva di compilazione riconosciuta
-MXMLUnresolvedTagProblem=Questo tag non può essere risolto in una classe ActionScript. Verrà ignorato.
-MXMLUnterminatedEntityProblem=Entità non terminata trovata. Verrà ignorata.
-MXMLXMLListMixedContentProblem=Contenuto misto non consentito qui.
-MXMLXMLOnlyOneRootTagProblem=È consentito un solo tag principale
-MXMLXMLRequireContentProblem=È richiesto un contenuto XML
-NamespaceInInterfaceProblem=Le dichiarazioni degli spazi dei nomi non sono consentite nelle interfacce.
-NativeMethodWithBodyProblem=I metodi nativi non possono avere un corpo.
-NativeNotOnFunctionProblem=L'attributo ${nativeStr} può essere utilizzato solo nelle definizioni di ${functionStr}.
-NativeUsedInInterfaceProblem=L'attributo ${nativeStr} non può essere utilizzato nelle definizioni di ${interfStr}.
-NativeVariableProblem=Le variabili non possono essere ${nativeStr}.
-NestedGetterSetterProblem=Le proprietà accessor non possono essere nidificate all'interno di altre funzioni.
-NestedPackageProblem=I pacchetti non possono essere nidificati.
-NoCompilationUnitForDefinitionProblem=Non è stata trovata alcuna unità di compilazione con il nome '${qname}'.
-NoDefaultConstructorInBaseClassProblem=Nessuna funzione di costruzione predefinita trovata nella classe base ${baseClass}.
-NoDefinitionForSWCDependencyProblem=Impossibile trovare la definizione ${qname} nel file SWC ${swcFilename}
-NoMainDefinitionProblem=Non è stata trovata nessuna definizione visibile esternamente con il nome '${qname}'.
-NonConstantNamespaceProblem=Un inizializzatore di spazio dei nomi deve essere una stringa letterale o un altro spazio dei nomi.
-NonConstantParamInitializerProblem=L'inizializzatore di parametro non è noto oppure non è una costante della fase di compilazione.
-NonDirectoryInSourcePathProblem=${file} è stato specificato nel percorso di origine e non è una directory.
-NoScopesInABCCompilationUnitProblem=Impossibile trovare gli ambiti nell'unità di compilazione.
-OnlyOneHostComponentAllowedProblem=È consentito un solo [HostComponent].
-OverlappingSourcePathProblem=Voci sovrapposte nel percorso di origine: ${ancestor} è un antenato di ${descendant}
-OverrideFinalProblem=Impossibile ridefinire un metodo ${finalStr}.
-OverrideNotFoundProblem=Il metodo contrassegnato con ${overrideStr} deve eseguire l'${overrideStr} di un altro metodo.
-OverrideOutsideClassProblem=L'attributo ${overrideStr} può essere utilizzato solo nelle definizioni delle proprietà di ${classStr}.
-PackageCannotBeUsedAsValueProblem=Il pacchetto non può essere utilizzato come valore: ${packageName}.
-ParserProblem=Problema interno di analisi sintattica
-PropertyIsWriteOnlyProblem=La proprietà ${name} è di sola scrittura.
-PrototypeInvalidAttributeProblem=L'attributo prototype non è valido.
-RemovedConfigurationOptionProblem='${option}' non è più supportata e non avrà alcun effetto.
-RequiredParameterAfterOptionalProblem=I parametri obbligatori non sono consentiti dopo i parametri opzionali.
-ResourceBundleMalformedEncodingProblem=La codifica della stringa specificata ha una struttura non corretta: ${string}
-ResourceBundleNoBundleParameterProblem=Nessun parametro bundle fornito per @Resource()
-ResourceBundleNoKeyParameterProblem=Nessun parametro key fornito per @Resource()
-ResourceBundleNotFoundForLocaleProblem=Impossibile risolvere il pacchetto di risorse '${bundleName}' per l'impostazione internazionale '${locale}'
-ResourceBundleNotFoundProblem=Impossibile risolvere il pacchetto di risorse '${bundleName}'
-RestParameterMustBeLastProblem=I parametri rest devono essere specificati per ultimi.
-ReturnCannotBeUsedInGlobalProblem=L'istruzione return non può essere utilizzata nel codice di inizializzazione globale.
-ReturnCannotBeUsedInPackageProblem=L'istruzione return non può essere utilizzata nel codice di inizializzazione di un pacchetto.
-ReturnCannotBeUsedInStaticProblem=L'istruzione return non può essere utilizzata nel codice di inizializzazione statico.
-ReturnMustReturnValueProblem=La funzione non restituisce un valore.
-ReturnValueMustBeUndefinedProblem=Il valore restituito deve essere undefined.
-SemanticProblem=Problema interno durante l'analisi semantica
-SetterCannotHaveOptionalProblem=Una definizione setter non può avere parametri opzionali.
-SetterMustHaveOneParameterProblem=Una definizione setter deve avere un solo parametro.
-SkinPartsMustBePublicProblem=Le parti skin devono essere pubbliche.
-StaticAndOverrideProblem=Le funzioni non possono essere sia ${staticStr} che ${overrideStr}.
-StaticNamespaceDefinitionProblem=L'attributo static non è consentito nelle definizioni ${namespaceKeyword}.
-StaticOutsideClassProblem=L'attributo ${staticStr} può essere utilizzato solo nelle definizioni all'interno di una ${classStr}.
-StrictUndefinedMethodProblem=Chiamata a un metodo possibilmente non definito ${methodName} mediante un riferimento con tipo statico ${className}.
-SyntaxProblem=Errore di sintassi: '${tokenText}' non è consentito in questo punto
-ThisUsedInStaticFunctionProblem=La parola chiave ${thisKeyword} non può essere usata nei metodi statici, bensì soltanto nei metodi di istanza, nelle chiusure di funzioni e nel codice global.
-TooFewFunctionParametersProblem=Numero di argomenti non corretto. Ne erano previsti ${nParams}
-TooManyFunctionParametersProblem=Numero di argomenti non corretto. Ne erano previsti non più di ${nParams}
-UnableToBuildReportProblem=Impossibile generare il rapporto: ${message}
-UnableToBuildSWFProblem=Impossibile generare il file SWF ${file}
-UnableToBuildSWFTagProblem=Impossibile generare il tag SWF per ${name}
-UnableToListFilesProblem=Impossibile elencare il contenuto della directory: @{directory}
-UnboundMetadataProblem=Metadati non associati a una definizione
-UndefinedConfigNameProblem=Costante di configurazione non definita: '${configName}'
-UndefinedConfigNamespaceProblem=Spazio dei nomi di configurazione non definito: '${configName}'
-UnexpectedExceptionProblem=Eccezione imprevista '${exceptionName}'.
-UnexpectedReturnProblem=L'istruzione return non può essere usata qui.
-UnexpectedTokenProblem=Errore di sintassi: previsto ${tokenKind}, ricevuto invece '${tokenText}'
-UnfoundPropertyProblem=Accesso alla proprietà non definita ${property}
-UnimplementedInterfaceMethodProblem=Il metodo ${methodName} di ${interfStr} in ${namespaceStr} ${namespaceName} non è implementato da ${classStr} ${className}
-UnknownBreakTargetProblem=Impossibile trovare la destinazione dell'istruzione break.
-UnknownContinueTargetProblem=Impossibile trovare la destinazione dell'istruzione continue.
-UnknownInterfaceProblem=${interfaceStr} ${interfaceName} non trovata.
-UnknownNamespaceProblem=Spazio dei nomi sconosciuto ${namespaceName}.
-UnknownSuperclassProblem=Impossibile trovare la definizione della classe base ${superclassName}.
-UnknownTypeProblem=Tipo non trovato o non è una costante della fase di compilazione: ${typeName}.
-UnresolvedClassReferenceProblem=Impossibile trovare la definizione ${qname}.
-UnresolvedNamespaceProblem=Spazio dei nomi non trovato o non è una costante della fase di compilazione.
-UnsupportedSourceFileProblem=Il ${file} è di un tipo non supportato: ${ext}
-VarInInterfaceProblem=Le dichiarazioni ${varStr} non sono consentite in ${interfStr}.
-VoidTypeProblem=${voidStr} non è un tipo valido.
-WrongSkinPartProblem=Il tipo di parte skin '${skinPartTypeName}' deve essere assegnabile a '${hostSkinPartTypeName}'.


[07/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGeneratingReducer.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGeneratingReducer.java b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGeneratingReducer.java
deleted file mode 100644
index 6bc7bd4..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGeneratingReducer.java
+++ /dev/null
@@ -1,11683 +0,0 @@
-/*
- *
- *  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.internal.as.codegen;
-
-import static org.apache.flex.abc.ABCConstants.*;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.text.SimpleDateFormat;
-import java.util.TreeSet;
-import java.util.Vector;
-
-import org.apache.flex.abc.ABCConstants;
-import org.apache.flex.abc.instructionlist.InstructionList;
-import org.apache.flex.abc.semantics.ECMASupport;
-import org.apache.flex.abc.semantics.Instruction;
-import org.apache.flex.abc.semantics.MethodBodyInfo;
-import org.apache.flex.abc.semantics.MethodInfo;
-import org.apache.flex.abc.semantics.Name;
-import org.apache.flex.abc.semantics.Namespace;
-import org.apache.flex.abc.semantics.Nsset;
-import org.apache.flex.abc.semantics.PooledValue;
-import org.apache.flex.abc.visitors.IMethodBodyVisitor;
-import org.apache.flex.abc.visitors.IMethodVisitor;
-import org.apache.flex.abc.visitors.ITraitsVisitor;
-import org.apache.flex.compiler.common.ASModifier;
-import org.apache.flex.compiler.common.DependencyType;
-import org.apache.flex.compiler.constants.IASLanguageConstants;
-import org.apache.flex.compiler.constants.IASLanguageConstants.BuiltinType;
-import org.apache.flex.compiler.definitions.IAccessorDefinition;
-import org.apache.flex.compiler.definitions.IAppliedVectorDefinition;
-import org.apache.flex.compiler.definitions.IClassDefinition;
-import org.apache.flex.compiler.definitions.IDefinition;
-import org.apache.flex.compiler.definitions.IFunctionDefinition;
-import org.apache.flex.compiler.definitions.IGetterDefinition;
-import org.apache.flex.compiler.definitions.IInterfaceDefinition;
-import org.apache.flex.compiler.definitions.INamespaceDefinition;
-import org.apache.flex.compiler.definitions.IParameterDefinition;
-import org.apache.flex.compiler.definitions.ISetterDefinition;
-import org.apache.flex.compiler.definitions.ITypeDefinition;
-import org.apache.flex.compiler.definitions.IVariableDefinition;
-import org.apache.flex.compiler.definitions.metadata.IMetaTag;
-import org.apache.flex.compiler.definitions.references.INamespaceReference;
-import org.apache.flex.compiler.definitions.references.IReference;
-import org.apache.flex.compiler.exceptions.DuplicateLabelException;
-import org.apache.flex.compiler.filespecs.IFileSpecification;
-import org.apache.flex.compiler.internal.definitions.AmbiguousDefinition;
-import org.apache.flex.compiler.internal.definitions.AppliedVectorDefinition;
-import org.apache.flex.compiler.internal.definitions.ClassDefinition;
-import org.apache.flex.compiler.internal.definitions.DefinitionBase;
-import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
-import org.apache.flex.compiler.internal.definitions.GetterDefinition;
-import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
-import org.apache.flex.compiler.internal.definitions.MemberedDefinition;
-import org.apache.flex.compiler.internal.definitions.NamespaceDefinition;
-import org.apache.flex.compiler.internal.definitions.PackageDefinition;
-import org.apache.flex.compiler.internal.definitions.ParameterDefinition;
-import org.apache.flex.compiler.internal.definitions.SetterDefinition;
-import org.apache.flex.compiler.internal.definitions.TypeDefinitionBase;
-import org.apache.flex.compiler.internal.definitions.VariableDefinition;
-import org.apache.flex.compiler.internal.legacy.ASDefinitionFilter;
-import org.apache.flex.compiler.internal.legacy.ASDefinitionFilter.AccessValue;
-import org.apache.flex.compiler.internal.legacy.ASDefinitionFilter.ClassificationValue;
-import org.apache.flex.compiler.internal.legacy.ASDefinitionFilter.SearchScopeValue;
-import org.apache.flex.compiler.internal.legacy.ASScopeUtils;
-import org.apache.flex.compiler.internal.legacy.MemberedDefinitionUtils;
-import org.apache.flex.compiler.internal.projects.CompilerProject;
-import org.apache.flex.compiler.internal.scopes.ASFileScope;
-import org.apache.flex.compiler.internal.scopes.ASProjectScope;
-import org.apache.flex.compiler.internal.scopes.ASScope;
-import org.apache.flex.compiler.internal.scopes.ASScopeBase;
-import org.apache.flex.compiler.internal.scopes.CatchScope;
-import org.apache.flex.compiler.internal.semantics.SemanticUtils;
-import org.apache.flex.compiler.internal.tree.as.BaseDefinitionNode;
-import org.apache.flex.compiler.internal.tree.as.BaseVariableNode;
-import org.apache.flex.compiler.internal.tree.as.ExpressionNodeBase;
-import org.apache.flex.compiler.internal.tree.as.ForLoopNode;
-import org.apache.flex.compiler.internal.tree.as.FunctionCallNode;
-import org.apache.flex.compiler.internal.tree.as.FunctionNode;
-import org.apache.flex.compiler.internal.tree.as.FunctionObjectNode;
-import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
-import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
-import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
-import org.apache.flex.compiler.internal.tree.as.NamespaceNode;
-import org.apache.flex.compiler.internal.tree.as.NodeBase;
-import org.apache.flex.compiler.internal.tree.as.ParameterNode;
-import org.apache.flex.compiler.internal.tree.as.SwitchNode;
-import org.apache.flex.compiler.internal.tree.as.VariableExpressionNode;
-import org.apache.flex.compiler.internal.tree.as.VariableNode;
-import org.apache.flex.compiler.problems.CodegenInternalProblem;
-import org.apache.flex.compiler.problems.CodegenProblem;
-import org.apache.flex.compiler.problems.CompilerProblem;
-import org.apache.flex.compiler.problems.DuplicateLabelProblem;
-import org.apache.flex.compiler.problems.DuplicateNamespaceDefinitionProblem;
-import org.apache.flex.compiler.problems.ICompilerProblem;
-import org.apache.flex.compiler.problems.InvalidLvalueProblem;
-import org.apache.flex.compiler.problems.InvalidOverrideProblem;
-import org.apache.flex.compiler.problems.PackageCannotBeUsedAsValueProblem;
-import org.apache.flex.compiler.problems.UnknownNamespaceProblem;
-import org.apache.flex.compiler.problems.VoidTypeProblem;
-import org.apache.flex.compiler.projects.ICompilerProject;
-import org.apache.flex.compiler.scopes.IASScope;
-import org.apache.flex.compiler.tree.ASTNodeID;
-import org.apache.flex.compiler.tree.as.IASNode;
-import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
-import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
-import org.apache.flex.compiler.tree.as.ICatchNode;
-import org.apache.flex.compiler.tree.as.IClassNode;
-import org.apache.flex.compiler.tree.as.IExpressionNode;
-import org.apache.flex.compiler.tree.as.IForLoopNode;
-import org.apache.flex.compiler.tree.as.IFunctionCallNode;
-import org.apache.flex.compiler.tree.as.IFunctionNode;
-import org.apache.flex.compiler.tree.as.IIdentifierNode;
-import org.apache.flex.compiler.tree.as.IImportNode;
-import org.apache.flex.compiler.tree.as.ILiteralNode;
-import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
-import org.apache.flex.compiler.tree.as.INumericLiteralNode;
-import org.apache.flex.compiler.tree.as.IObjectLiteralValuePairNode;
-import org.apache.flex.compiler.tree.as.IParameterNode;
-import org.apache.flex.compiler.tree.as.IRegExpLiteralNode;
-import org.apache.flex.compiler.tree.as.IScopedNode;
-import org.apache.flex.compiler.tree.as.ITryNode;
-import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
-import org.apache.flex.compiler.tree.as.IVariableNode;
-import org.apache.flex.compiler.tree.as.IWhileLoopNode;
-import org.apache.flex.compiler.tree.as.IWithNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLEventSpecifierNode;
-import org.apache.flex.compiler.units.ICompilationUnit;
-import org.apache.flex.compiler.units.ICompilationUnit.Operation;
-
-/**
- * JSGeneratingReducer is modeled after from ABCGeneratingReducer and called by
- * the generated CmcJSEmitter (see cmc-js.jbg). This is the "meat" of FalconJS.
- * This implementation is part of FalconJS. For more details on FalconJS see
- * org.apache.flex.compiler.JSDriver
- */
-@SuppressWarnings("nls")
-public class JSGeneratingReducer
-{
-    /**
-     * A very high cost, used to trap errors but otherwise well outside normal
-     * bounds.
-     */
-    static final int ERROR_TRAP = 268435456;
-
-    private static final Name NAME_Vector = new Name(IASLanguageConstants.Vector);
-
-    /**
-     * A struct for the decoded pieces of a catch block.
-     */
-    public class CatchPrototype
-    {
-        Name catchType;
-        Name catchVarName;
-        String catchBody;
-    }
-
-    /**
-     * ConditionalFragment holds the disparate elements of a conditional
-     * statement fragment.
-     */
-    public class ConditionalFragment
-    {
-        IASNode site;
-        String condition;
-        String statement;
-
-        // private Label statementLabel = null;
-
-        /**
-         * Construct a ConditionalFragment with a single statement.
-         */
-        ConditionalFragment(IASNode site, String condition, String statement)
-        {
-            this.site = site;
-            this.condition = condition;
-            this.statement = statement;
-        }
-
-        /**
-         * Construct a ConditionalFragment with a list of statements, coalescing
-         * them into a composite statement.
-         */
-        ConditionalFragment(IASNode site, String condition, Vector<String> statements)
-        {
-            this.site = site;
-            this.condition = condition;
-            this.statement = createInstruction(site);
-
-            for (String stmt : statements)
-            {
-                this.statement += stmt;
-            }
-        }
-
-        /**
-         * @return the label of the fragment's condition, or its statement label
-         * if it's the default alternative.
-         */
-        /*
-         * Label getLabel() { if ( !this.isUnconditionalAlternative() ) return
-         * this.condition.getLabel(); else return getStatementLabel(); }
-         */
-
-        /**
-         * Cache and return the label of this conditional fragment's statement
-         * so it can be retrieved after the statement's been added to the
-         * overall conditional statement and this.statement is invalidated.
-         */
-        /*
-         * Label getStatementLabel() { if ( null == this.statementLabel )
-         * this.statementLabel = this.statement.getLabel(); return
-         * this.statementLabel; }
-         */
-
-        /**
-         * @return true if this is an unconditional alternative, i.e. a default
-         * case or the last else in an if/else if/else.
-         */
-        boolean isUnconditionalAlternative()
-        {
-            return null == this.condition;
-        }
-    }
-
-    /**
-     * The RuntimeMultiname class holds the components of the various types of
-     * runtime multiname, and puts them together in the right order to generate
-     * the names and instruction sequences to jamble up the AVM. Only some
-     * permutations of the compile-time/runtime qualifier::name possibilities
-     * are valid: Name::expression generates MultinameL expression::expression
-     * generates RTQnameL expression::name generates RTQname (name::name is a
-     * plain Multiname)
-     */
-    public class RuntimeMultiname
-    {
-        /**
-         * The compile-time qualifier of a MultinameL. compileTimeName isn't
-         * valid (this would be a compile-time constant Multiname).
-         */
-        Name compileTimeQualifier;
-
-        /**
-         * The runtime qualifier of a RTQname or RTQNameL. Compile-time and
-         * runtime names are valid.
-         */
-        String runtimeQualifier;
-
-        /**
-         * The compile-time constant name of a RTQName. compileTimeQualifier
-         * isn't valid (this would be a compile-time constant Multiname).
-         */
-        Name compileTimeName;
-
-        /**
-         * The runtime name of a MultinameL or RTQnameL.
-         */
-        String runtimeName;
-
-        /**
-         * Construct a RTQnameL-type runtime name.
-         * 
-         * @param qualifier - the runtime qualifier.
-         * @param name - the runtime name.
-         */
-        RuntimeMultiname(String qualifier, String runtime_name)
-        {
-            this.runtimeQualifier = qualifier;
-            this.runtimeName = runtime_name;
-        }
-
-        /**
-         * Construct a RTQname-type runtime name.
-         * 
-         * @param qualifier - the runtime qualifier.
-         * @param name - the compile-time name.
-         */
-        RuntimeMultiname(String qualifier, Name name)
-        {
-            this.runtimeQualifier = qualifier;
-            this.compileTimeName = name;
-        }
-
-        /**
-         * Construct a MultinameL-type runtime name.
-         * 
-         * @param qualifier - the Multiname. Note this is the only kind of
-         * runtime name that receives a qualifying name.
-         * @param nameL - the runtime expression that yields the base name.
-         */
-        RuntimeMultiname(Name qualifier, String nameL)
-        {
-            assert (qualifier.getKind() == CONSTANT_MultinameL || qualifier.getKind() == CONSTANT_MultinameLA) : "Bad qualifier kind " + qualifier.getKind() + " on name " + qualifier.toString();
-            this.compileTimeQualifier = qualifier;
-            this.runtimeName = nameL;
-        }
-
-        /**
-         * Assemble the ingredients into an expression.
-         * 
-         * @param opcode - one of OP_getproperty or OP_setproperty.
-         * @param rhs - the value of a setproperty call. Passed to this routine
-         * because there may be name-specific instructions before and after the
-         * value.
-         */
-        private String generateGetOrSet(IASNode iNode, int opcode, String rhs)
-        {
-            //  TODO: Optimize InstructionList size.
-            String result = createInstruction(iNode);
-
-            //  Note: numerous microoptimization opportunities here
-            //  to avoid storing values in temps by creative use of
-            //  OP_dup and OP_swap, especially in getproperty gen.
-
-            if (this.compileTimeQualifier != null && this.runtimeName != null)
-            {
-                result += runtimeName;
-                if (rhs != null)
-                    result += rhs;
-
-                /*
-                 * // Generate MultinameL type code. Binding name_temp =
-                 * currentScope.allocateTemp(); result.addAll(this.runtimeName);
-                 * result.addInstruction(OP_dup);
-                 * result.addInstruction(name_temp.setlocal()); //
-                 * findprop(MultinameL) consumes a name from the value stack.
-                 * result.addInstruction(OP_findpropstrict,
-                 * this.compileTimeQualifier);
-                 * result.addInstruction(name_temp.getlocal()); if ( rhs != null
-                 * ) result.addAll(rhs); // get/setprop(MultinameL) consumes a
-                 * name from the value stack. result.addInstruction(opcode,
-                 * this.compileTimeQualifier);
-                 */
-
-            }
-            else if (this.runtimeQualifier != null && this.runtimeName != null)
-            {
-                /*
-                 * // Generate RTQnameL type code. Binding name_temp =
-                 * currentScope.allocateTemp(); Binding qual_temp =
-                 * currentScope.allocateTemp(); Name rtqnl = new
-                 * Name(CONSTANT_RTQnameL, null, null);
-                 * result.addAll(getRuntimeName(iNode));
-                 * result.addInstruction(name_temp.setlocal());
-                 * result.addAll(getRuntimeQualifier(iNode));
-                 * result.addInstruction(OP_dup);
-                 * result.addInstruction(qual_temp.setlocal());
-                 * result.addInstruction(name_temp.getlocal()); //
-                 * findprop(RTQNameL) consumes namespace and name from the value
-                 * stack. result.addInstruction(OP_findpropstrict, rtqnl);
-                 * result.addInstruction(qual_temp.getlocal());
-                 * result.addInstruction(name_temp.getlocal()); if ( rhs != null
-                 * ) result.addAll(rhs); // get/setprop(RTQNameL) consumes
-                 * namespace and name from the value stack.
-                 * result.addInstruction(opcode, rtqnl);
-                 * result.addAll(currentScope.releaseTemp(name_temp));
-                 */
-
-                result += getRuntimeName(iNode);
-                if (rhs != null)
-                    result += rhs;
-            }
-            else
-            {
-                //  Last valid combination generates a RTQname.
-                assert (this.runtimeQualifier != null && this.compileTimeName != null) : "Unknown runtime name configuration: " + this.toString();
-
-                result += getRuntimeName(iNode);
-                if (rhs != null)
-                    result += rhs;
-
-                /*
-                 * Name rtqn = new Name(CONSTANT_RTQname, null,
-                 * this.compileTimeName.getBaseName());
-                 * result.addAll(getRuntimeQualifier(iNode));
-                 * result.addInstruction(OP_dup); // findprop(RTQName) consumes
-                 * a namespace from the value stack.
-                 * result.addInstruction(OP_findpropstrict, rtqn);
-                 * result.addInstruction(OP_swap); if ( rhs != null )
-                 * result.addAll(rhs); // get/setprop(RTQName) consumes a
-                 * namespace from the value stack. result.addInstruction(opcode,
-                 * rtqn);
-                 */
-            }
-
-            return result;
-        }
-
-        /**
-         * Generate the InstructionList that expresses this RuntimeName's
-         * qualifier.
-         * 
-         * @param iNode - an IASNode to contribute debug info to the result
-         * InstructionList.
-         * @return the runtime qualifier setup instructions.
-         */
-        public String getRuntimeQualifier(IASNode iNode)
-        {
-            assert (hasRuntimeQualifier());
-            String result = createInstruction(iNode);
-
-            result += this.runtimeQualifier;
-
-            /*
-             * // Ensure the last instruction is an OP_coerce to Namespace.
-             * Instruction last = result.lastElement(); if ( last.getOpcode() !=
-             * OP_coerce || last.getOperandCount() == 0 || !
-             * namespaceType.equals(last.getOperand(0)) ) {
-             * result.addInstruction(OP_coerce, namespaceType); }
-             */
-            return result;
-        }
-
-        /**
-         * @return true if this RuntimeName has a runtime qualifier.
-         */
-        public boolean hasRuntimeQualifier()
-        {
-            return this.runtimeQualifier != null;
-        }
-
-        /**
-         * @return true if this RuntimeName has a runtime name.
-         */
-        public boolean hasRuntimeName()
-        {
-            return this.runtimeName != null;
-        }
-
-        /**
-         * Generate the InstructionList that expresses this RuntimeName's name.
-         * 
-         * @param iNode - an IASNode to contribute debug info to the result
-         * InstructionList.
-         * @return the runtime name setup instructions.
-         */
-        public String getRuntimeName(IASNode iNode)
-        {
-            assert (hasRuntimeName());
-
-            String result = createInstructionList(iNode);
-
-            /*
-             * result.addAll(replicate(this.runtimeName)); if (
-             * result.lastElement().getOpcode() != OP_coerce_s)
-             * result.addInstruction(OP_coerce_s);
-             */
-
-            result += this.runtimeName;
-
-            return result;
-        }
-
-        /**
-         * Generate the runtime name appropriate to this qualifier/name
-         * combination.
-         * 
-         * @return the runtime name appropriate to this qualifier/name
-         * combination.
-         */
-        public Name generateName()
-        {
-            Name result;
-
-            if (this.compileTimeQualifier != null)
-            {
-                result = this.compileTimeQualifier;
-            }
-            else if (this.runtimeQualifier != null && this.runtimeName != null)
-            {
-                result = new Name(CONSTANT_RTQnameL, null, null);
-            }
-            else
-            {
-                //  Last valid combination generates a RTQname.
-                assert (this.runtimeQualifier != null && this.compileTimeName != null) : "Unknown runtime name configuration: " + this.toString();
-
-                result = new Name(CONSTANT_RTQname, null, this.compileTimeName.getBaseName());
-            }
-
-            return result;
-        }
-
-        /**
-         * Convenience method generates an assignment
-         * 
-         * @param value - the value to set.
-         * @return the instruction sequence to set a the given multiname's
-         * value.
-         */
-        String generateAssignment(IASNode iNode, String value)
-        {
-            return generateGetOrSet(iNode, OP_setproperty, value);
-        }
-
-        /**
-         * Convenience method generates an r-value.
-         * 
-         * @return the instruction sequence to look up the given multiname.
-         */
-        String generateRvalue(IASNode iNode)
-        {
-            return generateGetOrSet(iNode, OP_getproperty, null);
-        }
-
-        /**
-         * Diagnostic toString() method, used primarily to debug the assertion
-         * in generate().
-         */
-        @Override
-        public String toString()
-        {
-            return "\n\t" + compileTimeQualifier + ",\n\t" + runtimeQualifier + ",\n\t" + compileTimeName + ",\n\t" + runtimeName;
-        }
-    }
-
-    /**
-     * The current LexicalScope. Set by the caller, changes during reduction
-     * when a scoped construct such as an embedded function or a with statement
-     * is encountered.
-     */
-    private LexicalScope currentScope;
-
-    /**
-     * Strings sent by the caller to be added to a function definition. Usually
-     * these are field initialization expressions in a constructor.
-     */
-    // private String instanceInitializers;
-
-    /**
-     * A shared name for the Namespace type.
-     */
-    public static final Name namespaceType = new Name("Namespace");
-
-    /**
-     * A shared name for the XML type.
-     */
-    public static final Name xmlType = new Name("XML");
-
-    /**
-     * A shared name for the XMLList type.
-     */
-    public static final Name xmlListType = new Name("XMLList");
-
-    /**
-     * A shared name for the RegExp type.
-     */
-    public static final Name regexType = new Name("RegExp");
-
-    /**
-     * A shared name for the void type.
-     */
-    public static final Name voidType = new Name("void");
-
-    /**
-     * Generate code to push a numeric constant.
-     */
-    public static void pushNumericConstant(long value, String result_list)
-    {
-        // do nothing
-        // result_list.pushNumericConstant(value);
-    }
-
-    /**
-     * Active labeled control-flow region's substatements. Populated by the
-     * labeledStmt Prologue, and winnowed by the labeledStmt reduction's
-     * epilogue.
-     */
-    private Set<IASNode> labeledNodes = new HashSet<IASNode>();
-
-    /**
-     * @return the currently active collection of problems.
-     */
-    public Collection<ICompilerProblem> getProblems()
-    {
-        return currentScope.getProblems();
-    }
-
-    /**
-     * Generate a binary operator.
-     * 
-     * @param l - the left-hand operand.
-     * @param r - the right-hand operand.
-     * @param opcode - the operator's opcode.
-     * @return the combined String sequence with the operator appended.
-     */
-    String binaryOp(IASNode iNode, String l, String r, int opcode)
-    {
-        checkBinaryOp(iNode, opcode);
-
-        switch (opcode)
-        {
-            //  Binary logical operators.
-            case OP_istypelate:
-                return reduce_istypeExprLate(iNode, l, r);
-            case OP_astypelate:
-                return reduce_astypeExprLate(iNode, l, r);
-            case OP_instanceof:
-                return reduce_instanceofExpr(iNode, l, r);
-            case OP_in:
-                return reduce_inExpr(iNode, l, r);
-        }
-
-        if (l == null)
-        	l = "null";
-        if (r == null)
-        	r = "null";
-        final String operator = opToString(iNode, opcode);
-        String result = createInstruction(iNode, l.length() + r.length() + 1);
-        result += binaryOp(l.toString(), r.toString(), operator);
-        return result;
-
-        /*
-         * String result = createInstruction(iNode, l.size() + r.size() + 1);
-         * result.addAll(l); result.addAll(r); result.addInstruction(opcode);
-         * return result;
-         */
-    }
-
-    public void checkBinaryOp(IASNode iNode, int opcode)
-    {
-        currentScope.getMethodBodySemanticChecker().checkBinaryOperator(iNode, opcode);
-    }
-
-    public String conditionalJump(IASNode iNode, String l, String r, int opcode)
-    {
-        return binaryOp(iNode, l, r, opcode);
-    }
-
-    String binaryOp(String l, String r, String operator)
-    {
-    	if (l == null)
-    		l = "null";
-    	if (r == null)
-    		r = "null";
-        String result = "(" + stripTabs(stripNS(l.toString())) + " " + operator + " " + stripTabs(stripNS(r.toString())) + ")";
-        return result;
-    }
-
-    /**
-     * Resolve a dotted name, e.g., foo.bar.baz
-     */
-    Binding dottedName(IASNode iNode, String qualifiers, String base_name)
-    {
-        if (iNode instanceof IdentifierNode)
-        {
-            return currentScope.resolveName((IdentifierNode)iNode);
-        }
-        else if (iNode instanceof ExpressionNodeBase)
-        {
-            ExpressionNodeBase expr = (ExpressionNodeBase)iNode;
-            ICompilerProject project = currentScope.getProject();
-            Name n = expr.getMName(project);
-
-            if (n == null)
-            {
-                currentScope.addProblem(new CodegenInternalProblem(iNode, "Unable to resove member name: " + iNode.toString()));
-                n = new Name(CONSTANT_Qname, new Nsset(new Namespace(CONSTANT_PackageNs, qualifiers)), base_name);
-            }
-
-            return currentScope.getBinding(iNode, n, expr.resolve(project));
-        }
-
-        //else
-        currentScope.addProblem(new CodegenInternalProblem(iNode, "Unable to resove to a dotted name: " + iNode.toString()));
-        return new Binding(iNode, new Name(CONSTANT_Qname, new Nsset(new Namespace(CONSTANT_PackageNs, qualifiers)), base_name), null);
-    }
-
-    /**
-     * Resolve a dotted name, e.g., foo.bar.baz, where the whole dotted name is
-     * a package this is an error, and a diagnostic will be emitted
-     */
-    Binding errorPackageName(IASNode iNode, String qualifiers, String base_name)
-    {
-        currentScope.addProblem(new PackageCannotBeUsedAsValueProblem(iNode, qualifiers + "." + base_name));
-        return new Binding(iNode, new Name(qualifiers + "." + base_name), null);
-    }
-
-    /**
-     * Common routine used by reductions that need an empty list.
-     * 
-     * @param iNode - the current AST node.
-     */
-    public String createInstruction(IASNode iNode)
-    {
-        return createInstruction(iNode, 0);
-    }
-
-    /**
-     * Common routine used by reductions that need an empty list.
-     * 
-     * @param iNode - the current AST node.
-     * @param capacity - requested capacity of the new list. May be adjusted to
-     * accomodate debug Strings.
-     */
-    public String createInstruction(IASNode iNode, int capacity)
-    {
-        String result = "";
-
-        String file_name = iNode.getSourcePath();
-
-        if (file_name == null)
-        {
-            //  Fall back on the file specification.
-            //  This may also be null (or assert if it's feeling moody),
-            //  in which case the file name remains null and file/line
-            //  processing noops.
-            try
-            {
-                IFileSpecification fs = iNode.getFileSpecification();
-                if (fs != null)
-                    file_name = fs.getPath();
-            }
-            catch (Throwable no_fs)
-            {
-                //  No file specification available, probably
-                //  because this node is some kind of syntho.
-            }
-        }
-
-        //  Note: getLine() uses zero-based counting.
-        int line_num = iNode.getLine() + 1;
-
-        //  Adjust the capacity requirement if debug
-        //  Strings are to be emitted.
-        if (currentScope.emitFile(file_name))
-            capacity++;
-        if (currentScope.emitLine(line_num))
-            capacity++;
-
-        //  If the required capacity is less than three
-        //  Strings, the String can hold 
-        //  them organically.  Specifying a capacity to
-        //  the String ctor causes it to allocate
-        //  a separate ArrayList.
-        if (capacity > 3)
-            result = new String(/* capacity */);
-        else
-            result = new String();
-
-        if (currentScope.emitFile(file_name))
-        {
-            // result.addInstruction(OP_debugfile, file_name);
-            currentScope.setDebugFile(file_name);
-        }
-
-        if (currentScope.emitLine(line_num))
-        {
-            // result.addInstruction(OP_debugline, line_num);
-            currentScope.setDebugLine(line_num);
-        }
-
-        return result;
-    }
-
-    /**
-     * Error trap.
-     */
-    public Binding error_namespaceAccess(IASNode iNode, IASNode raw_qualifier, Binding qualified_name)
-    {
-        String qualifier = ((IdentifierNode)raw_qualifier).getName();
-
-        //  TODO: In some circumstances, the namespace qualifier
-        //  may be an invalid attribute on a declaration.
-        currentScope.addProblem(new UnknownNamespaceProblem(raw_qualifier, qualifier));
-
-        return qualified_name;
-    }
-
-    /**
-     * Error trap.
-     */
-    public String error_reduce_Op_AssignId(IASNode iNode, String non_lvalue, String rvalue)
-    {
-        currentScope.addProblem(new InvalidLvalueProblem(iNode));
-        return createInstruction(iNode);
-    }
-
-    /**
-     * Generate access to a named entity.
-     * 
-     * @param name - the entity's name.
-     * @return an instruction sequence to access the entity.
-     */
-    String generateAccess(IASNode iNode, Binding name)
-    {
-        StringBuilder result = new StringBuilder();
-        generateAccess(iNode, name, result);
-        return result.toString();
-    }
-
-    /**
-     * Generate access to a named entity.
-     * 
-     * @param name - the entity's name.
-     * @param result - the instruction sequence to generate into.
-     */
-    void generateAccess(IASNode iNode, Binding binding, StringBuilder result)
-    {
-        if (binding.isLocal())
-        {
-            final String name = bindingToString(iNode, binding, false, false);
-            result.append(name);
-        }
-        else
-        {
-            assert (binding.getName() != null) : "non-local Binding " + binding + " must have a name";
-            currentScope.getMethodBodySemanticChecker().checkGetProperty(binding);
-            // generateAccess( iNode, binding.getName(), result);
-            final String name = bindingToString(iNode, binding, true, true);
-            result.append(name);
-        }
-    }
-
-    /**
-     * Generate access to a named entity.
-     * 
-     * @param name - the entity's name.
-     * @param result - the instruction sequence to generate into.
-     */
-    void generateAccess(IASNode iNode, Name name, StringBuilder result)
-    {
-        final String str = nameToString(iNode, name, true, true);
-        result.append(str);
-
-        /*
-         * if ( name.isTypeName() ) { generateAccess(name.getTypeNameBase(),
-         * result); generateTypeNameParameter(name.getTypeNameParameter(),
-         * result); result.addInstruction(OP_applytype, 1); } else {
-         * result.addInstruction(OP_findpropstrict, name);
-         * result.addInstruction(OP_getproperty, name); }
-         */
-    }
-
-    /**
-     * Generate code to assign to a named entity.
-     * 
-     * @param target - the entity to be assigned to.
-     * @param rvalue - the value to assign.
-     * @return an String sequence that stores the given rvalue in the target.
-     */
-    String generateAssignment(IASNode iNode, Binding target, String rvalue)
-    {
-        return generateAssignment(iNode, target, rvalue, false);
-    }
-
-    /**
-     * Generate code to assign to a named entity.
-     * 
-     * @param target - the entity to be assigned to.
-     * @param rvalue - the value to assign.
-     * @param need_value - when true, leave a DUP of the rvalue on the stack.
-     * @return an String sequence that stores the given rvalue in the target,
-     * and leaves a DUP of the rvalue on the stack if need_value is set.
-     */
-    String generateAssignment(IASNode iNode, Binding target, String rvalue, boolean need_value)
-    {
-        String result = createInstruction(iNode, rvalue.length() + 4);
-
-        result += rvalue;
-
-        /*
-         * result.addAll(rvalue); if ( need_value )
-         * result.addInstruction(OP_dup); if ( target.isLocal() ) { if (
-         * target.getDefinition() != null ) { ITypeDefinition type =
-         * target.getDefinition
-         * ().resolveType(currentScope.getDefinitionCache()); if ( type != null
-         * && type != ClassDefinition.getAnyTypeClassDefinition() ) {
-         * result.addInstruction(OP_coerce,
-         * ((DefinitionBase)type).getMName(currentScope.getProject())); } }
-         * result.addInstruction(target.setlocal()); } else {
-         * result.addInstruction(OP_findproperty, target.getName());
-         * result.addInstruction(OP_swap); result.addInstruction(OP_setproperty,
-         * target.getName()); }
-         */
-        return result;
-    }
-
-    /**
-     * Generate a catch block.
-     * 
-     * @param catch_proto - the catch block's prototype.
-     */
-    /*
-     * String generateCatchBlock( Label try_start, Label try_end, CatchPrototype
-     * catch_proto) { String scope_reinit =
-     * currentScope.getFlowManager().getScopeStackReinit(); String current_catch
-     * = new String(catch_proto.catchBody.size() + scope_reinit.size() + 15); //
-     * Common prologue code. current_catch.addInstruction(OP_getlocal0);
-     * current_catch.addInstruction(OP_pushscope); if(
-     * currentScope.needsActivation() ) { // Restore the activation object.
-     * current_catch
-     * .addInstruction(currentScope.getActivationStorage().getlocal());
-     * current_catch.addInstruction(OP_pushscope); } // Re-establish enclosing
-     * exception scopes. current_catch.addAll(scope_reinit); int handler_number
-     * = currentScope.getMethodBodyVisitor().visitException(try_start, try_end,
-     * current_catch.getLabel(), catch_proto.catchType,
-     * catch_proto.catchVarName); Binding exception_storage =
-     * currentScope.getFlowManager().getFinallyContext().getExceptionStorage();
-     * current_catch.addInstruction(OP_newcatch, handler_number);
-     * current_catch.addInstruction(OP_dup); if ( exception_storage != null ) {
-     * current_catch.addInstruction(exception_storage.setlocal());
-     * current_catch.addInstruction(OP_dup); }
-     * current_catch.addInstruction(OP_pushscope);
-     * current_catch.addInstruction(OP_swap);
-     * current_catch.addInstruction(OP_setslot, 1);
-     * current_catch.addAll(catch_proto.catchBody); if (
-     * current_catch.canFallThrough() || current_catch.hasPendingLabels() ) {
-     * current_catch.addInstruction(OP_popscope); } return current_catch; }
-     */
-
-    /**
-     * Generate a compound assignment statement.
-     */
-    String generateCompoundAssignment(IASNode iNode, Binding operand, String expr, int opcode, boolean need_value)
-    {
-        String result = createInstruction(iNode, expr.length() + (operand.isLocal() ? 4 : 8));
-        /*
-         * if ( operand.isLocal() ) { result.addInstruction(operand.getlocal());
-         * result.addAll(expr); result.addInstruction(opcode); if ( need_value )
-         * result.addInstruction(OP_dup);
-         * result.addInstruction(operand.setlocal()); } else { Binding
-         * value_temp = null; result.addInstruction(OP_findpropstrict,
-         * operand.getName()); result.addInstruction(OP_dup);
-         * result.addInstruction(OP_getproperty, operand.getName());
-         * result.addAll(expr); result.addInstruction(opcode); if ( need_value )
-         * { value_temp = currentScope.allocateTemp();
-         * result.addInstruction(OP_dup);
-         * result.addInstruction(value_temp.setlocal()); }
-         * result.addInstruction(OP_setproperty, operand.getName()); if (
-         * need_value ) { result.addInstruction(value_temp.getlocal());
-         * result.addInstruction(value_temp.kill()); } }
-         */
-        final String op = opToString(iNode, opcode);
-        final String methodName = bindingToString(iNode, operand, true, true);
-        if (methodName.contains("."))
-        {
-            final String stem = methodName.substring(0, methodName.lastIndexOf("."));
-            final String member = getBasenameFromBinding(operand);
-            result += resolveSetterName(iNode, stem, makeMemberBinding(iNode, stem, member), op + "=", expr, false, true);
-        }
-        else
-        {
-            result += binaryOp(methodName, expr, op + "=");
-        }
-
-        if (need_value)
-            result = "(" + result + ")";
-        else
-            result += ";" + endl();
-
-        return result;
-    }
-
-    String generateCompoundBracketAssignment(IASNode iNode, String stem, String index, String expr, int opcode, boolean need_value)
-    {
-        String result = createInstruction(iNode, stem.length() * 2 + index.length() + expr.length() + 11);
-
-        /*
-         * // Although ASC evaluates the stem twice, it only evaluates the index
-         * once. // TODO: Inspect the index expression for side effects so the
-         * temp can be // elided in most cases. Binding index_temp =
-         * currentScope.allocateTemp(); result.addAll(index);
-         * result.addInstruction(index_temp.setlocal());
-         * result.addAll(replicate(stem));
-         * result.addInstruction(index_temp.getlocal());
-         * result.addInstruction(OP_getproperty); result.addAll(expr);
-         * result.addInstruction(opcode); Binding value_temp =
-         * currentScope.allocateTemp();
-         * result.addInstruction(value_temp.setlocal()); result.addAll(stem);
-         * result.addInstruction(index_temp.getlocal());
-         * result.addInstruction(value_temp.getlocal());
-         * result.addInstruction(OP_setproperty); if ( need_value )
-         * result.addInstruction(value_temp.getlocal());
-         * result.addAll(currentScope.releaseTemp(value_temp));
-         * result.addAll(currentScope.releaseTemp(index_temp));
-         */
-
-        // String result = binaryOp(stem + "[" + index + "]", expr, opcode + "="); 
-        final String op = opToString(iNode, opcode);
-        result += resolveSetterName(iNode, stem, makeMemberBinding(iNode, stem, index), op + "=", expr, true, true);
-        if (need_value)
-            result = "(" + result + ")";
-        else
-            result += ";" + endl();
-        return result;
-    }
-
-    String generateCompoundMemberAssignment(IASNode iNode, String stem, Binding member, String expr, int fetch_opcode, int assign_opcode, boolean need_value)
-    {
-        String result = createInstruction(iNode, stem.length() * 2 + expr.length() + 5);
-
-        /*
-         * // TODO: Depending on the resolution of ASC-4159 and // the
-         * corresponding Falcon backwards compatibility // issue, cache the stem
-         * expression in a local to avoid // multiple evaluations.
-         * result.addAll(replicate(stem)); result.addInstruction(fetch_opcode,
-         * member.getName()); result.addAll(expr);
-         * result.addInstruction(assign_opcode); if ( need_value ) {
-         * result.addInstruction(OP_dup); } result.addAll(stem);
-         * result.addInstruction(OP_swap); result.addInstruction(OP_setproperty,
-         * member.getName());
-         */
-
-        // String result = binaryOp(stem + "." + getBasenameFromBinding( member ), expr, opcode + "="); 
-        final String op = opToString(iNode, assign_opcode);
-        result += resolveSetterName(iNode, stem, member, op + "=", expr, false, true);
-        if (need_value)
-            result = "(" + result + ")";
-        else
-            result += ";" + endl();
-        return result;
-    }
-
-    String generateCompoundAssignmentToRuntimeName(IASNode iNode, RuntimeMultiname name, String expr, int opcode, boolean need_value)
-    {
-        String rhs = opToString(iNode, opcode) + "= " + expr;
-
-        return name.generateAssignment(iNode, rhs);
-    }
-
-    /**
-     * Generate a compound logical assignment expression to a named lvalue.
-     * 
-     * @param iNode - the assignment operator (root of the subtree).
-     * @param lvalue - the lvalue's name.
-     * @param expr - the expression to assign.
-     * @param is_and - true if the expression is &amp;&amp;=, false if it's ||=.
-     * @param need_value - true if the expression's not used in a void context.
-     */
-    String generateCompoundLogicalAssignment(IASNode iNode, Binding lvalue, String expr, boolean is_and, boolean need_value)
-    {
-        String result = createInstructionList(iNode);
-
-        /*
-         * Label tail = new Label(); int failure_test = is_and? OP_iffalse :
-         * OP_iftrue; if ( lvalue.isLocal() ) { // Fetch and test the current
-         * value. result.addInstruction(lvalue.getlocal()); // The current value
-         * may not be the result value, // but for now assume it is. if (
-         * need_value ) result.addInstruction( OP_dup); result.addInstruction(
-         * failure_test, tail ); // Test succeeded: reset the value, but first
-         * // pop the value speculatively dup'd above. if ( need_value )
-         * result.addInstruction(OP_pop); result.addAll(expr); if ( need_value )
-         * result.addInstruction(OP_dup);
-         * result.addInstruction(lvalue.setlocal()); } else { // Fetch,
-         * speculatively dup, and test the current value.
-         * result.addInstruction(OP_findpropstrict, lvalue.getName());
-         * result.addInstruction(OP_getproperty, lvalue.getName()); if (
-         * need_value ) result.addInstruction(OP_dup);
-         * result.addInstruction(failure_test, tail); if ( need_value )
-         * result.addInstruction(OP_pop); result.addAll(expr); if ( need_value )
-         * { result.addInstruction(OP_dup); }
-         * result.addInstruction(OP_findpropstrict, lvalue.getName());
-         * result.addInstruction(OP_swap); result.addInstruction(OP_setproperty,
-         * lvalue.getName()); } result.labelNext(tail);
-         */
-
-        final String lvalStr = bindingToString(iNode, lvalue, true, true);
-        result += lvalStr + " = (" + lvalStr + ") ";
-        if (is_and)
-            result += "&& ";
-        else
-            result += "|| ";
-        result += "(" + expr + ");\n";
-
-        return result;
-    }
-
-    /**
-     * Generate compound logical assignment to a runtime name, e.g., n::x ||=
-     * foo;
-     * 
-     * @param iNode - the root of the assignment subtree.
-     * @param name - the runtime name.
-     * @param expr - the second operand of the implied binary expression.
-     * @param is_and - true if the result is set to the second operand iff the
-     * first operand is true.
-     * @param need_value - true if the value of the assignment is required.
-     */
-    String generateCompoundLogicalRuntimeNameAssignment(IASNode iNode, RuntimeMultiname name, String expr, boolean is_and, boolean need_value)
-    {
-        return (is_and) ?
-                String.format("%s &&= %s", name.generateRvalue(iNode), expr)
-                :
-                String.format("%s ||= %s", name.generateRvalue(iNode), expr);
-    }
-
-    /**
-     * Generate a compound logical assignment expression to a a[i] type lvalue.
-     * 
-     * @param iNode - the assignment operator (root of the subtree).
-     * @param stem - the expression that generates the lvalue's stem, e.g., a in
-     * a[i]
-     * @param index - the index expression.
-     * @param expr - the expression to assign.
-     * @param is_and - true if the expression is &amp;&amp;=, false if it's ||=.
-     * @param need_value - true if the expression's not used in a void context.
-     */
-    String generateCompoundLogicalBracketAssignment(IASNode iNode, String stem, String index, String expr, boolean is_and, boolean need_value)
-    {
-        String result = createInstructionList(iNode);
-
-        /*
-         * String result = createInstructionList(iNode, stem.size() * 2 +
-         * index.size() + expr.size() + 11 ); Label tail = new Label(); int
-         * failure_test = is_and? OP_iffalse : OP_iftrue; // Although ASC
-         * evaluates the stem twice, it only evaluates the index once. // TODO:
-         * Inspect the index expression for side effects so the temp can be //
-         * elided in most cases. Binding index_temp =
-         * currentScope.allocateTemp(); result.addAll(index);
-         * result.addInstruction(index_temp.setlocal());
-         * result.addAll(replicate(stem));
-         * result.addInstruction(index_temp.getlocal()); result.addAll(stem);
-         * result.addInstruction(index_temp.getlocal());
-         * result.addInstruction(OP_getproperty); // Assume this is the result.
-         * result.addInstruction(OP_dup); result.addInstruction(failure_test,
-         * tail); // Pop the speculative result and assign the correct one.
-         * result.addInstruction(OP_pop); result.addAll(expr);
-         * result.labelNext(tail); Binding value_temp = null; if ( need_value )
-         * { value_temp = currentScope.allocateTemp();
-         * result.addInstruction(OP_dup);
-         * result.addInstruction(value_temp.setlocal()); }
-         * result.addInstruction(OP_setproperty); if ( need_value ) {
-         * result.addInstruction(value_temp.getlocal());
-         * result.addAll(currentScope.releaseTemp(value_temp)); }
-         * result.addAll(currentScope.releaseTemp(index_temp));
-         */
-
-        currentScope.addProblem(new JSUnsupportedFeatureProblem(iNode, "logical bracket assignment"));
-        return result;
-    }
-
-    /**
-     * Generate a compound logical assignment expression to a foo.bar type
-     * lvalue
-     * 
-     * @param iNode - the assignment operator (root of the subtree).
-     * @param stem - the expression that generates the lvalue's stem, e.g., a in
-     * a[i]
-     * @param index - the index expression.
-     * @param expr - the expression to assign.
-     * @param is_and - true if the expression is &amp;&amp;=, false if it's ||=.
-     * @param need_value - true if the expression's not used in a void context.
-     */
-    String generateCompoundLogicalMemberAssignment(IASNode iNode, String stem, Binding member, String expr, int fetch_opcode, boolean is_and, boolean need_value)
-    {
-        String result = createInstructionList(iNode);
-
-        /*
-         * Label tail = new Label(); int failure_test = is_and? OP_iffalse :
-         * OP_iftrue; result.addAll(replicate(stem)); result.addAll(stem);
-         * result.addInstruction(OP_getproperty, member.getName()); // Assume
-         * this is the result. result.addInstruction(OP_dup);
-         * result.addInstruction(failure_test, tail);
-         * result.addInstruction(OP_pop); result.addAll(expr);
-         * result.labelNext(tail); Binding value_temp = null; if ( need_value )
-         * { value_temp = currentScope.allocateTemp();
-         * result.addInstruction(OP_dup);
-         * result.addInstruction(value_temp.setlocal()); }
-         * result.addInstruction(OP_setproperty, member.getName()); if (
-         * need_value ) { result.addInstruction(value_temp.getlocal());
-         * result.addAll(currentScope.releaseTemp(value_temp)); }
-         */
-
-        currentScope.addProblem(new JSUnsupportedFeatureProblem(iNode, "logical member assignment"));
-        return result;
-
-    }
-
-    /**
-     * Generate a for/in or for each/in loop.
-     * 
-     * @param iNode - the for/in or for/each node.
-     * @param opcode - OP_nextname or OP_nextvalue.
-     * @param it - the name of the iterator variable, e.g., v in for (v in foo)
-     * {f(v);}.
-     * @param base - the source of names/values, e.g., foo in for (v in foo)
-     * {f(v);}.
-     * @param body - the loop body, e.g., {f(v);} in for (v in foo) {f(v);}.
-     */
-    private String generateForKeyOrValueLoop(IASNode iNode, int opcode, Binding it, String base, String body)
-    {
-        /*
-         * String result = new String(body.size() + base.size() + 15); Label
-         * test = new Label(); Label loop = new Label(); // Set up the object
-         * and index registers. LexicalScope.Hasnext2Wrapper hasnext =
-         * currentScope.hasnext2(); result.addInstruction(OP_pushbyte, 0);
-         * result.addInstruction(hasnext.index_temp.setlocal());
-         * result.addAll(base); result.addInstruction(OP_coerce_a);
-         * result.addInstruction(hasnext.stem_temp.setlocal()); // Go to the
-         * loop test. result.addInstruction(OP_jump, test); // Top of loop
-         * processing. result.addInstruction(OP_label);
-         * result.labelCurrent(loop); String nextvalue = new String(3);
-         * result.addInstruction(hasnext.stem_temp.getlocal());
-         * result.addInstruction(hasnext.index_temp.getlocal());
-         * nextvalue.addInstruction(opcode);
-         * result.addAll(generateAssignment(iNode, it, nextvalue));
-         * result.addAll(body); // Loop test. // It needs its own list so the
-         * continue target // can be properly resolved; this label is always //
-         * attached to the head of an String. String test_list = new String(1);
-         * test_list.addInstruction(hasnext.String);
-         * test_list.labelCurrent(test);
-         * currentScope.getFlowManager().resolveContinueLabel(test_list);
-         * test_list.addInstruction(OP_iftrue, loop); result.addAll(test_list);
-         * result.addAll(hasnext.release());
-         */
-
-        String result = new String();
-        return result;
-    }
-
-    HashMap<IASNode, Boolean> nestedFunctions = new HashMap<IASNode, Boolean>();
-    
-    /**
-     * generateFunctionBody() wrapper suitable for calling from the BURM. See
-     * JBurg ENHRQ <N> : the grammar that accepts the BURM's parameters to a
-     * JBurg.Reduction routine doesn't grok function calls, so the BURM cannot
-     * call generateFunctionBody(body, name.getName());
-     */
-    String generateFunctionBody(IASNode iNode, String function_body, Binding return_type)
-    {
-        return generateFunctionBody(iNode, function_body, return_type != null ? return_type.getName() : null);
-    }
-
-    /**
-     * Generate boilerplate function prolog/epilog code.
-     * 
-     * @param block - the actual CFG.
-     * @param return_type - the function's return type. Not presently used.
-     */
-    String generateFunctionBody(IASNode iNode, String function_body, Name return_type)
-    {
-        currentScope.getMethodInfo().setReturnType(return_type);
-        String result = "";
-        final String methodName = getMethodName();
-        final Boolean isAnonymousFunction = isAnonymousFunction(methodName);
-        final Boolean isCtor = methodName != null && methodName.equals(getCurrentClassName());
-
-        if (return_type != null)
-            usedTypes.add(getBasenameFromName(return_type));
-
-        final Boolean isNestedFunction = nestedFunctions.containsKey(iNode);
-        
-        /*
-         * !isAnonymousFunction is necessary. AS and JS are different in the way
-         * "this" is being treated in anonymous functions. i.e. public function
-         * whoIsThis() : void { const localFunction : Function = funciton():void
-         * { this.callMe(); }; } In this example this.callMe() refers to the
-         * callMe method of the class. In JS "this" refers to the local
-         * function! By supressing "var self = this;" for anonymous functions
-         * we'll emulate the AS behavior. The JS result then looks like this:
-         * tests.Test.whoIsThis.prototype = function() { var self = this; const
-         * localFunction : Function = funciton():void { // NOT EMITTED: var self
-         * = this; self.callMe(); }; };
-         */
-        if (//!JSSharedData.m_useSelfParameter && !isAnonymousFunction && 
-                /* TODO: !needsSelfParameter(createFullClassName(false)) && */ !isNestedFunction && function_body.contains("self."))
-        {
-            // final Binding fullClassName = makeBinding(createFullClassName(false));
-            // this.registerLocalVariable(currentScope, makeBinding("self"), fullClassName, fullClassName);
-
-           final Binding fullClassName = new Binding(iNode, makeName(createFullClassName(false)), null);
-           this.registerLocalVariable(currentScope, new Binding(iNode, makeName("self"), null), fullClassName, fullClassName);
-           result += indentBlock("/** @type {" + createFullClassName(true) + "} */" + endl(), 1);
-           result += indentBlock("var self = this;" + endl(), 1);
-        }
-
-        //  Constructor-specific processing: add the instance initializers,
-        //  add a constructsuper call if none exists.
-        if (haveAPrioriInstructions() && !isAnonymousFunction)
-        {
-            result += indentBlock(aPrioriInstructions, 1);
-
-            //  If this is a constructor and there's no explicit
-            //  super() call, synthesize one.
-            //  Note that this may be a semantic error if the 
-            //  superclass' constructor needs arguments.
-            /*
-             * if ( isCtor && !block.contains("super(") ) { // Call the
-             * superclass' constructor after the instance // init instructions;
-             * this doesn't seem like an abstractly // correct sequence, but
-             * it's what ASC does. result += "" // TODO: //
-             * result.addInstruction(OP_getlocal0); //
-             * result.addInstruction(OP_constructsuper, 0); }
-             */
-        }
-
-        if (!function_body.isEmpty())
-        	result += indentBlock(function_body, 1);
-
-        // popIndent();
-        // result += indent() + "}";
-        return result;
-    }
-
-    private IFunctionNode getFunctionNodeFromNode(IASNode iNode)
-    {
-        IFunctionNode fn = null;
-        if (iNode instanceof FunctionObjectNode)
-        {
-            FunctionObjectNode afn = (FunctionObjectNode)iNode;
-            fn = afn.getFunctionNode();
-        }
-        else if (iNode instanceof IFunctionNode)
-        {
-            fn = (IFunctionNode)iNode;
-        }
-
-        if (fn == null)
-            currentScope.addProblem(new JSInternalCompilerProblem(iNode, "cannot extract function node"));
-
-        return fn;
-    }
-
-    private IFunctionDefinition getFunctionDefinitionFromNode(IASNode iNode)
-    {
-        final IFunctionNode fn = getFunctionNodeFromNode(iNode);
-        return fn.getDefinition();
-    }
-
-    /**
-     * Generate a named nested function.
-     * 
-     * @param func_name - the function's name.
-     * @param return_type - the function's return type.
-     * @param function_body - the body of the function.
-     * @pre the function's lexical scope must be at the top of the lexical scope
-     * stack, with the declaring function's lexical scope under it.
-     * @post the nested function's MethodInfo is filled in, the function body is
-     * attached to its MethodBodyInfo, and the declaring function's
-     * initialization sequence gets code to declare the function.
-     */
-    private String generateNestedFunction(IASNode iNode, Binding func_name, Name return_type, String function_body)
-    {
-    	nestedFunctions.put(iNode, true);
-    	
-        final Boolean isAnonymousFunction = func_name == null && iNode instanceof FunctionObjectNode;
-
-        // only the outer function of a nested function should be converted to 
-        final Boolean convertLocalVarsToMembers = !isAnonymousFunction && convertLocalVarsToMembers(iNode);
-
-        String result = "";
-        if (!isAnonymousFunction)
-        {
-            currentScope.setFunctionName(getBasenameFromBinding(func_name));
-            result = generateFunctionBody(iNode, function_body, new Binding(iNode, return_type, null));
-        }
-
-        currentScope.generateNestedFunction(null);
-        //  Pull the nested function's MethodInfo out of its scope before we pop it.
-        MethodInfo nested_method_info = currentScope.getMethodInfo();
-
-        currentScope = currentScope.popFrame();
-
-        //  Intiialize the nested function; add a variable 
-        //  to the containing function scope and add 
-        //  newfunction/setproperty logic to the containing
-        //  function's hoisted initialization instructions.
-        if (!isAnonymousFunction && !convertLocalVarsToMembers)
-            currentScope.makeVariable(func_name);
-
-        /*
-         * String init_insns = currentScope.getHoistedInitInstructions();
-         * init_insns.addInstruction(OP_findproperty, func_name); //
-         * Optimization: declare the function at global scope // (in a utility
-         * namespace) and only new it once.
-         * init_insns.addInstruction(OP_newfunction, nested_method_info);
-         * init_insns.addInstruction(OP_setproperty, func_name);
-         */
-
-        {
-            final FunctionNode fn = (FunctionNode)getFunctionNodeFromNode(iNode);
-
-            // Workaround for Falcon bug.
-            // In theory, just using 
-            //     MethodInfo mi = currentScope.methodInfo;
-            // should work. But in 307387 the parameter names and types are empty.
-            // currentScope.methodInfo does contain the default values, because
-            // reduce_optionalParameter got called
-            if (!nested_method_info.hasParamNames())
-            {
-                MethodInfo miRepaired = JSGenerator.createMethodInfo(this, getEmitter(), currentScope, fn);
-                final Vector<PooledValue> defaultValues = nested_method_info.getDefaultValues();
-                for (PooledValue pv : defaultValues)
-                {
-                    miRepaired.addDefaultValue(pv);
-                }
-                nested_method_info = miRepaired;
-            }
-
-            String[] chunk = null;
-            try
-            {
-                // chunk = emitParameters(currentScope.getProject(), fn.getDefinition());
-                chunk = emitParameters(nested_method_info);
-            }
-            catch (Exception e)
-            {
-
-            }
-
-            final String a_priori_insns = chunk[0];
-            final String params = chunk[1];
-            final String baseName = getBasenameFromBinding(func_name);
-
-            // String result = generateFunction((IFunctionNode)__p, null, n, block, return_type );
-            result = "";
-
-            /*
-             * internal compiler error generated with optimize enabled compiling
-             * as3_enumerate.fla and fails to release the JS file
-             * http://watsonexp.corp.adobe.com/#bug=3047880 We have to emit
-             * something, otherwise you'd get:
-             * @type {function(, , )} as that happened in as3_enumerate
-             * MainTimeline. In the original MainTimeline.as change() is a local
-             * function with untyped parameters: function change(identifier,
-             * object, correct) which gets promoted to a method via
-             * [ConvertLocalVarsToMembers] of frame0(). It seems that there are
-             * two bugs: 1. JSDoc comments for functions with untyped parameters
-             * should use "*" instead:
-             * @type {function(*, *, *)} 2. JSDoc comments for promoted local
-             * functions should be omitted. The change below addresses #2.
-             */
-
-            // JSDoc
-            if (!convertLocalVarsToMembers)
-                result += getJSDocForFunction(nested_method_info);
-
-            /*
-             * @@@ if( !isAnonymousFunction && convertLocalVarsToMembers ) {
-             * result += getCurrentFullClassName() + ".prototype." + baseName +
-             * " = "; }
-             */
-
-            // support for [ConvertLocalVarsToMembers]
-            if (convertLocalVarsToMembers)
-            {
-                result += "\n";
-                if (a_priori_insns != null && !a_priori_insns.isEmpty())
-                    result += a_priori_insns + "\n";
-
-                if (!JSSharedData.m_useSelfParameter &&
-                        /*
-                         * TODO: !needsSelfParameter(createFullClassName(false))
-                         * &&
-                         */function_body.contains(JSSharedData.THIS) &&
-                        !function_body.contains("var " + JSSharedData.THIS))
-                {
-                    // final Binding fullClassName = makeBinding(createFullClassName(false));
-                    // this.registerLocalVariable(currentScope, makeBinding("self"), fullClassName, fullClassName);
-
-                    final Binding fullClassName = new Binding(iNode, makeName(createFullClassName(false)), null);
-                    this.registerLocalVariable(currentScope, new Binding(iNode, makeName("self"), null), fullClassName, fullClassName);
-                    result += indentBlock("/** @type {" + createFullClassName(true) + "} */" + endl(), 1);
-                    result += indentBlock("var " + JSSharedData.THIS + " = this;" + endl(), 1);
-                }
-
-                result += function_body;
-
-                final JSEmitter emitter = getEmitter();
-                final FunctionNode func = (FunctionNode)iNode;
-                final ITraitsVisitor itraits = emitter.getCurrentClassVisitor().visitInstanceTraits();
-                itraits.visitMethodTrait(DirectiveProcessor.functionTraitKind(func, TRAIT_Method), getNameFromBinding(func_name), 0, nested_method_info);
-
-                IMethodVisitor mv = emitter.visitMethod(nested_method_info);
-                mv.visit();
-
-                MethodBodyInfo mbi = new MethodBodyInfo();
-                mbi.setMethodInfo(nested_method_info);
-
-                IMethodBodyVisitor mbv = mv.visitBody(mbi);
-                mbv.visit();
-
-                InstructionList insns = new InstructionList();
-                insns.addInstruction(JSSharedData.OP_JS, result);
-
-                mbv.visitInstructionList(insns);
-
-                mbv.visitEnd();
-                mv.visitEnd();
-
-                result = "";
-
-                /*
-                 * internal compiler error generated with optimize enabled
-                 * compiling as3_enumerate.fla and fails to release the JS file
-                 * We have to emit something, otherwise you'd get:
-                 * @type {function(, , )} as that happened in as3_enumerate
-                 * MainTimeline. In the original MainTimeline.as change() is a
-                 * local function with untyped parameters: function
-                 * change(identifier, object, correct) which gets promoted to a
-                 * method via [ConvertLocalVarsToMembers] of frame0(). It seems
-                 * that there are two bugs: 1. JSDoc comments for functions with
-                 * untyped parameters should use "*" instead:
-                 * @type {function(*, *, *)} 2. JSDoc comments for promoted
-                 * local functions should be omitted. The change below addresses
-                 * #2.
-                 */
-                // result += getJSDocForFunction(nested_method_info);
-
-                this.registerConvertedMember(baseName);
-
-                // result += "\nvar " + baseName + " /* : Function */ = " + JSSharedData.THIS + "." + baseName + ";\n";
-            }
-            else
-            {
-                if (isAnonymousFunction)
-                    result += "function";
-                else
-                    result += "\nfunction " + baseName;
-
-                result += "(" + params + ")";
-
-                final Name retType = nested_method_info.getReturnType();
-                if (retType != null)
-                    result += " /* : " + getBasenameFromName(retType) + " */";
-                else
-                    result += " /* : void */";
-
-                result += indent() + "\n";
-                result += indent() + "{\n";
-                if (a_priori_insns != null && !a_priori_insns.isEmpty())
-                    result += indentBlock(a_priori_insns, 1) + "\n";
-                result += indentBlock(function_body, 1);
-                result += indent() + "}";
-                if (!isAnonymousFunction)
-                    result += "\n";
-            }
-        }
-
-        // nested functions use "self" to get at instance vars
-        if (result.contains("this."))
-        {
-        	result = result.replace("this.", "self.");
-        }
-        return result;
-    }
-
-    /**
-     * Generate a try/catch/finally (or try/finally) compound statement.
-     * 
-     * @param try_stmt - the body of the try block.
-     * @param catch_blocks - associated catch blocks. May be null if no catch
-     * blocks are present.
-     * @param finally_stmt - the body of the finally block.
-     */
-    String generateTryCatchFinally(IASNode iNode, String try_stmt, Vector<CatchPrototype> catch_blocks, String finally_stmt)
-    {
-        /*
-         * // TODO: Optimize these String sizes. String normal_flow_fixup = new
-         * String(); String catch_insns = new String(); String final_catch = new
-         * String(); String finally_insns = new String(); String final_throw =
-         * new String(); ExceptionHandlingContext finally_context =
-         * currentScope.getFlowManager().getFinallyContext(); Label
-         * final_catch_target = final_catch.getLabel(); // We need a local to
-         * store the caught exception. Binding exception_storage =
-         * finally_context.getExceptionStorage(); Collection<Label>
-         * pending_normal_control_flow = try_stmt.stripPendingLabels(); if (
-         * try_stmt.canFallThrough() || pending_normal_control_flow != null ) {
-         * normal_flow_fixup.addInstruction(OP_jump,
-         * finally_context.finallyBlock); } else { // Extend the region past a
-         * terminating // throw statement to give the AVM a // little buffer to
-         * figure out its // exception-handling regions.
-         * normal_flow_fixup.addInstruction(OP_nop); } Label try_start =
-         * try_stmt.getLabel(); Label try_end =
-         * normal_flow_fixup.getLastLabel(); Label finally_region_end = null; if
-         * ( null == catch_blocks ) { finally_region_end = try_end; } else { for
-         * ( CatchPrototype catch_proto: catch_blocks ) { String catch_body =
-         * generateCatchBlock(try_start, try_end, catch_proto); boolean
-         * is_last_catch = catch_proto.equals(catch_blocks.lastElement()); if (
-         * catch_body.canFallThrough() ) { // Signal the finally block that this
-         * execution succeeded. catch_body.addInstruction(OP_pushbyte, 0);
-         * catch_body.addInstruction(OP_coerce_a);
-         * catch_body.addInstruction(finally_context
-         * .finallyReturnStorage.setlocal()); catch_body.addInstruction(OP_jump,
-         * finally_context.finallyBlock); } else if ( is_last_catch ) { //
-         * Extend the region past a terminating throw // insn to give the AVM a
-         * little buffer. catch_body.addInstruction(OP_nop); } if (
-         * is_last_catch ) finally_region_end = catch_body.getLastLabel();
-         * catch_insns.addAll(catch_body); } } // Set up the exception handler
-         * for the finally block.
-         * currentScope.getMethodBodyVisitor().visitException(try_start,
-         * finally_region_end, final_catch_target, null, null); // The final
-         * catch block only needs to save the // caught exception for a rethrow.
-         * final_catch.addInstruction(OP_getlocal0);
-         * final_catch.addInstruction(OP_pushscope); if(
-         * currentScope.needsActivation() ) { // Restore the activation object
-         * final_catch
-         * .addInstruction(currentScope.getActivationStorage().getlocal());
-         * final_catch.addInstruction(OP_pushscope); }
-         * final_catch.addAll(currentScope
-         * .getFlowManager().getScopeStackReinit());
-         * final_catch.addInstruction(exception_storage.setlocal()); // Signal
-         * the finally epilog that this execution failed // and should rethrow.
-         * final_catch.addInstruction(OP_pushbyte,
-         * currentScope.getFlowManager().getFinallyAlternativesSize() + 1);
-         * final_catch.addInstruction(OP_coerce_a);
-         * final_catch.addInstruction(finally_context
-         * .finallyReturnStorage.setlocal()); // falls through //
-         * final_catch.addInstruction(OP_jump, finally_head);
-         * finally_insns.addInstruction
-         * (finally_context.finallyReturnStorage.getlocal());
-         * finally_insns.addInstruction(OP_convert_i);
-         * finally_insns.addInstruction
-         * (finally_context.finallyReturnStorage.kill());
-         * finally_insns.addAll(currentScope
-         * .getFlowManager().getFinallySwitch()); // Label the start of the
-         * final set of Strings. if (!finally_stmt.isEmpty()) {
-         * finally_stmt.labelFirst(finally_context.finallyBlock); } else // This
-         * is just an expedient for this degenerate finally.
-         * finally_insns.labelFirst(finally_context.finallyBlock);
-         * final_throw.addInstruction(exception_storage.getlocal());
-         * final_throw.labelCurrent(finally_context.finallyDoRethrow);
-         * final_throw.addInstruction(OP_throw); // Assemble the statement.
-         * String result = new String(); // Initialize the finally return
-         * storage location to appease // legacy verifiers. // TODO: This could
-         * travel on the value stack. // See:
-         * http://bugs.adobe.com/jira/browse/CMP-104
-         * result.addInstruction(OP_pushbyte, 0);
-         * result.addInstruction(OP_coerce_a);
-         * result.addInstruction(finally_context
-         * .finallyReturnStorage.setlocal()); result.addAll(try_stmt); // Send
-         * all "next statement" type control flow into the finally block.
-         * result.addAllPendingLabels(pending_normal_control_flow);
-         * result.addAll(normal_flow_fixup); result.addAll(catch_insns);
-         * result.addAll(final_catch); result.addAll(finally_stmt);
-         * result.addAll(finally_insns); result.addAll(final_throw); for (
-         * ExceptionHandlingContext.FinallyReturn retblock:
-         * finally_context.finallyReturns )
-         * result.addAll(retblock.getStrings()); // TODO: Need more analysis of
-         * how this temp travels through // the system before it can be safely
-         * released. For now // just leak it.
-         * //result.addAll(currentScope.releaseTemp(exception_storage)); //
-         * TODO: Removing a hanging kill exposed a latent bug // in
-         * hasPendingLabels() and end-of-routine processing. // Give the CG a
-         * harmless String that will generate // a returnvoid if this is the
-         * last statement in the routine. result.addInstruction(OP_nop); //
-         * Fallthrough out of the finally block.
-         * result.labelNext(finally_context.finallyDoFallthrough);
-         */
-
-        // statement = Pattern tryCatchFinallyStmt
-        String result = "";
-
-        //  Do nothing if the try statement's empty.
-        if (try_stmt.length() == 0)
-            return result;
-
-        result = indent() + "try" + endl();
-        result += indent() + "{" + endl();
-        result += indentBlock(try_stmt, 1);
-        result += indent() + "}" + endl();
-
-        if (catch_blocks != null)
-        {
-            for (CatchPrototype catch_proto : (Vector<CatchPrototype>)catch_blocks)
-            {
-                final Binding nameBinding = new Binding(iNode, catch_proto.catchVarName, null);
-                Binding typeBinding;
-                if (catch_proto.catchType == null)
-                    typeBinding = new Binding(iNode, makeName("*"), null);
-                else
-                    typeBinding = new Binding(iNode, catch_proto.catchType, null);
-
-                registerLocalVariable(currentScope, nameBinding, typeBinding, typeBinding);
-
-                result += indent() + "catch(";
-                if (catch_proto.catchType != null)
-                {
-                    final StringBuilder sb = new StringBuilder();
-                    if (!nameToJSDocType(iNode, typeBinding.getName(), sb))
-                        m_needsSecondPass = true;
-                    result += "/** @type {" + sb.toString() + "}*/ ";
-                }
-                result += getBasenameFromName(catch_proto.catchVarName);
-                if (catch_proto.catchType != null)
-                    result += " /* : " + getBasenameFromBinding(typeBinding) + "*/";
-                result += ")" + endl();
-                result += indent() + "{" + endl();
-
-                if (catch_proto.catchBody.length() > 0)
-                    result += indentBlock(catch_proto.catchBody, 1);
-
-                // boolean is_last_catch = catch_proto.equals(catch_blocks.lastElement());
-                //if( !is_last_catch && canFallThrough(catch_body) )
-                //    catch_body.addInstruction(OP_jump, catch_tail);
-
-                result += indent() + "}" + endl();
-            }
-        }
-
-        if (finally_stmt != null && finally_stmt.length() != 0)
-        {
-            result += indent() + "finally" + endl();
-            result += indent() + "{" + endl();
-            result += indentBlock(finally_stmt, 1);
-            result += indent() + "}" + endl();
-        }
-
-        return result;
-    }
-
-    public String reduce_typeNameParameter(IASNode iNode, Binding param_name)
-    {
-        StringBuilder result = new StringBuilder();
-
-        generateTypeNameParameter(iNode, param_name.getName(), result);
-
-        return result.toString();
-    }
-
-    /**
-     * Generate the String sequence that designates the parameter of a
-     * parameterized type, e.g., String in Vector.&lt;String&gt; or * in
-     * Vector.&lt;*&gt;.
-     * 
-     * @param name - the type parameter's name. May be null in the * case.
-     * @param result - the String sequence to generate into.
-     */
-    void generateTypeNameParameter(IASNode iNode, Name param_name, StringBuilder result)
-    {
-        if (param_name == null || param_name.couldBeAnyType())
-            result.append("null");
-        else
-            generateAccess(iNode, param_name, result);
-    }
-
-    /**
-     * Find the specified break target.
-     * 
-     * @param criterion - the search criterion.
-     * @throws UnknownControlFlowTargetException if the criterion is not on the
-     * control-flow stack.
-     */
-    /*
-     * private String getBreakTarget(Object criterion) throws
-     * UnknownControlFlowTargetException { return
-     * currentScope.getFlowManager().getBreakTarget(criterion); }
-     */
-
-    /**
-     * Find the specified continue label.
-     * 
-     * @param criterion - the search criterion.
-     * @throws UnknownControlFlowTargetException if the criterion is not on the
-     * control-flow stack.
-     */
-    /*
-     * private String getContinueLabel(Object criterion) throws
-     * UnknownControlFlowTargetException { return
-     * currentScope.getFlowManager().getContinueLabel(criterion); }
-     */
-
-    /**
-     * @return the double content of a numeric literal.
-     * @param iNode - the literal node.
-     */
-    Double getDoubleContent(IASNode iNode)
-    {
-        return new Double(((INumericLiteralNode)iNode).getNumericValue().toNumber());
-    }
-
-    /**
-     * @return the name of an identifier.
-     * @param iNode - the IIdentifier node.
-     */
-    String getIdentifierContent(IASNode iNode)
-    {
-        return ((IIdentifierNode)iNode).getName();
-    }
-
-    /**
-     * @return the int content of a numeric literal.
-     * @param iNode - the literal node.
-     */
-    Integer getIntegerContent(IASNode iNode)
-    {
-        return new Integer(((INumericLiteralNode)iNode).getNumericValue().toInt32());
-    }
-
-    /**
-     * @return always zero.
-     * @param iNode - the literal node.
-     */
-    Integer getIntegerZeroContent(IASNode iNode)
-    {
-        return 0;
-    }
-
-    /**
-     * @return always zero.
-     * @param iNode - the literal node.
-     */
-    Long getIntegerZeroContentAsLong(IASNode iNode)
-    {
-        return 0L;
-    }
-
-    /**
-     * @return a node cast to MXMLEventSpecifierNode type.
-     * @param iNode - the MXMLEventSpecifierNode node.
-     */
-    IMXMLEventSpecifierNode getMXMLEventSpecifierContent(IASNode iNode)
-    {
-        return (IMXMLEventSpecifierNode)iNode;
-    }
-
-    /**
-     * Find all active exception handling blocks or scopes, and set up finally
-     * return sequences and/or popscopes.
-     * 
-     * @param original - the original control-flow sequence.
-     * @param criterion - the search criterion that identifies the boundary of
-     * the region to be exited.
-     * @return a control-flow sequence that is either the original sequence or
-     * the start of a trampoline of finally blocks, popscopes, and whatever else
-     * is necessary to exit the control-flow region.
-     * @throws UnknownControlFlowTargetException if the criterion is not on the
-     * control-flow stack.
-     */
-    /*
-     * private String getNonLocalControlFlow(String original, Object criterion)
-     * throws UnknownControlFlowTargetException { return
-     * currentScope.getFlowManager().getNonLocalControlFlow(original,
-     * criterion); }
-     */
-
-    /**
-     * @return a parameter's definition.
-     * @param iNode - the parameter node.
-     */
-    IDefinition getParameterContent(IASNode iNode)
-    {
-        return (((IParameterNode)iNode).getDefinition());
-    }
-
-    /**
-     * @return the string content of a literal.
-     * @param iNode - the literal node.
-     */
-    String getStringLiteralContent(IASNode iNode)
-    {
-        // Literals.
-        // Pattern stringLiteral
-        // LiteralStringID(void);
-        String s = ((ILiteralNode)iNode).getValue();
-        if (s == null || s.length() == 0)
-            return "''";
-
-        s = s.replaceAll("\n", "__NEWLINE_PLACEHOLDER__");
-        s = s.replaceAll("\r", "__CR_PLACEHOLDER__");
-        s = s.replaceAll("\t", "__TAB_PLACEHOLDER__");
-        s = s.replaceAll("\f", "__FORMFEED_PLACEHOLDER__");
-        s = s.replaceAll("\b", "__BACKSPACE_PLACEHOLDER__");
-        s = s.replaceAll("\\\\\"", "__QUOTE_PLACEHOLDER__");
-        s = s.replaceAll("\\\\", "__ESCAPE_PLACEHOLDER__");
-        s = "\"" + s.replaceAll("\"", "\\\\\"") + "\"";
-        s = s.replaceAll("__ESCAPE_PLACEHOLDER__", "\\\\\\\\");
-        s = s.replaceAll("__QUOTE_PLACEHOLDER__", "\\\\\"");
-        s = s.replaceAll("__BACKSPACE_PLACEHOLDER__", "\\\\b");
-        s = s.replaceAll("__FORMFEED_PLACEHOLDER__", "\\\\f");
-        s = s.replaceAll("__TAB_PLACEHOLDER__", "\\\\t");
-        s = s.replaceAll("__CR_PLACEHOLDER__", "\\\\r");
-        s = s.replaceAll("__NEWLINE_PLACEHOLDER__", "\\\\n");
-
-        // Note: we don't try to preserve \ u NNNN or \ x NN escape codes, since the actual Unicode chars can appear
-        // inside the literal just fine (unless they translate to one of the above chars, e.g. CR, in which case
-        // the above substitutions will occur.
-
-        return s;
-    }
-
-    /**
-     * @return the uint content of a numeric literal.
-     * @param iNode - the literal node.
-     */
-    Long getUintContent(IASNode iNode)
-    {
-        return new Long(((INumericLiteralNode)iNode).getNumericValue().toUint32());
-    }
-
-    /**
-     * @return the Boolean content of a BOOLEAN literal.
-     * @param iNode - the literal node.
-     */
-    boolean getBooleanContent(IASNode iNode)
-    {
-        return SemanticUtils.getBooleanContent(iNode);
-    }
-
-    /**
-     * @return true if a priori Strings are present.
-     */
-    /*
-     * private boolean haveinstanceInitializers() { return instanceInitializers
-     * != null; }
-     */
-
-    /*
-     * *******************************
-     * ** Cost/Decision Functions ** *******************************
-     */
-
-    /**
-     * Explore a MemberAccessNode and decide if its stem is a reference to a
-     * package.
-     */
-    int isDottedName(IASNode n)
-    {
-        int result = Integer.MAX_VALUE;
-
-        if (n instanceof MemberAccessExpressionNode)
-        {
-            MemberAccessExpressionNode ma = (MemberAccessExpressionNode)n;
-
-            if (ma.stemIsPackage())
-                // This needs to be greater than the value returned from isPackageName,
-                // so that isPackageName wins
-                result = 2;
-        }
-
-        return result;
-    }
-
-    /**
-     * Explore a MemberAccessNode and decide if it is a reference to a package.
-     */
-    int isPackageName(IASNode n)
-    {
-        int result = Integer.MAX_VALUE;
-
-        if (n instanceof MemberAccessExpressionNode)
-        {
-            MemberAccessExpressionNode ma = (MemberAccessExpressionNode)n;
-
-            if (ma.isPackageReference())
-                // This needs to be less than the value returned from isDottedName,
-                // so that isPackageName wins
-                result = 1;
-        }
-
-        return result;
-    }
-
-    /**
-     * Check if the given AST (the root AST of a looping construct) is in the
-     * set of active labeled control-flow contexts. If it is, then its
-     * control-flow context is being managed by the labeledStatement production
-     * that's reducing the loop's LabeledStatementNode, and the loop should use
-     * that context so that the labeled context's continue label is resolved to
-     * the correct top-of-loop location.
-     * 
-     * @param loop_node - the AST at the root of the loop.
-     * @return true if loop_node is known to be the substatment of a labeled
-     * statement.
-     */
-    private boolean isLabeledSubstatement(IASNode loop_node)
-    {
-        return labeledNodes.contains(loop_node);
-    }
-
-    /**
-     * Get the definition associated with a node's qualifier and decide if the
-     * qualifier is a compile-time constant.
-     * 
-     * @param iNode - the node to check.
-     * @pre - the node has an IdentifierNode 0th child.
-     * @return an attractive cost if the child has a known namespace, i.e., it's
-     * a compile-time constant qualifier.
-     */
-    int qualifierIsCompileTimeConstant(IASNode iNode)
-    {
-        IdentifierNode qualifier = (IdentifierNode)SemanticUtils.getNthChild(iNode, 0);
-        IDefinition def = qualifier.resolve(currentScope.getProject());
-
-        int result = def instanceof NamespaceDefinition ? 1 : Integer.MAX_VALUE;
-        return result;
-    }
-
-    /**
-     * Get the definition associated with a node's qualifier and decide if the
-     * qualifier is an interface name.
-     * 
-     * @param iNode - the node to check.
-     * @pre - the node has an IdentifierNode 0th child.
-     * @return an attractive cost if the child is an interface.
-     */
-    int qualifierIsInterface(IASNode iNode)
-    {
-        IdentifierNode qualifier = (IdentifierNode)SemanticUtils.getNthChild(iNode, 0);
-        IDefinition def = qualifier.resolve(currentScope.getProject());
-
-        int result = def instanceof InterfaceDefinition ? 1 : Integer.MAX_VALUE;
-        return result;
-
-    }
-
-    /**
-     * @return a feasible cost if a node has a compile-time constant defintion.
-     */
-    int isCompileTimeConstant(IASNode iNode)
-    {
-        if (SemanticUtils.transformNameToConstantValue(iNode, currentScope.getProject()) != null)
-            return 1;
-        else
-            return Integer.MAX_VALUE;
-    }
-
-    /**
-     * @return a feasible cost if the function call node is a call to a constant
-     * function.
-     */
-    int isCompileTimeConstantFunction(IASNode iNode)
-    {
-        //if ( SemanticUtils.isConstantFunction(currentScope.getProject(), iNode)  )
-        //    return 1;
-        // else
-        return Integer.MAX_VALUE;
-    }
-
-    /**
-     * @return a feasible cost if a parameterized type's base and parameter
-     * types are resolved types, ERROR_TRAP if not.
-     */
-    int parameterTypeIsConstant(IASNode iNode)
-    {
-        return Math.max(
-                isKnownType(SemanticUtils.getNthChild(iNode, 0)),
-                isKnownType(SemanticUtils.getNthChild(iNode, 1))
-                );
-    }
-
-    /**
-     * @return a feasible cost if the type's parameter is a resolved type,
-     * ERROR_TRAP if not.
-     */
-    int isKnownType(IASNode iNode)
-    {
-        boolean isConstant = false;
-
-        if (iNode instanceof IExpressionNode)
-        {
-            IExpressionNode qualifier = (IExpressionNode)iNode;
-            isConstant = qualifier.resolve(currentScope.getProject()) instanceof ITypeDefinition;
-        }
-
-        return isConstant ? 1 : ERROR_TRAP;
-    }
-
-    public Object transform_constant_function_to_value(IASNode iNode, Binding method, Vector<Object> constant_args)
-    {
-        assert false : "attempting to reduce a non-constant function as a constant.  " +
-                       "isCompileTimeConstantFunction Should have guarded against this";
-
-        return null;
-    }
-
-    /**
-     * Check a Binding to decide if its referent is statically known to be a
-     * Namespace.
-     * 
-     * @param b - the Binding to check.
-     * @return true if the given Binding refers to a namespace.
-     */
-    /*
-     * private boolean isNamespace(Binding b) { return b.getDefinition()
-     * instanceof NamespaceDefinition; }
-     */
-
-    /**
-     * Check a Binding to see if it's (often incorrectly) defined as the
-     * ANY_TYPE.
-     * 
-     * @param b - the Binding to check.
-     * @return true if the Binding's definition is the ANY_TYPE definition.
-     */
-    /*
-     * private boolean isAnyType(Binding b) { return b.getDefinition() ==
-     * ClassDefinition.getAnyTypeClassDefinition(); }
-     */
-
-    /**
-     * @return a feasible cost (1) if the node is for 'new Array()'
-     */
-    int isEmptyArrayConstructor(IASNode iNode)
-    {
-        ICompilerProject project = currentScope.ge

<TRUNCATED>

[32/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java
new file mode 100644
index 0000000..164806c
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSPublisher.java
@@ -0,0 +1,600 @@
+/*
+ *
+ *  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.internal.codegen.mxml.vf2js;
+
+import java.io.*;
+import java.net.URL;
+import java.util.*;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.filefilter.DirectoryFileFilter;
+import org.apache.commons.io.filefilter.FileFileFilter;
+import org.apache.commons.io.filefilter.FileFilterUtils;
+import org.apache.commons.io.filefilter.IOFileFilter;
+import org.apache.commons.io.filefilter.RegexFileFilter;
+import org.apache.flex.compiler.clients.problems.ProblemQuery;
+import org.apache.flex.compiler.codegen.js.IJSPublisher;
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.internal.codegen.js.JSSharedData;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogPublisher;
+import org.apache.flex.compiler.internal.driver.js.flexjs.JSCSSCompilationSession;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.graph.VF2JSDepsWriter;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.utils.VF2JSClosureCompilerWrapper;
+
+public class MXMLVF2JSPublisher extends JSGoogPublisher implements
+        IJSPublisher
+{
+
+    public static final String FLEXJS_OUTPUT_DIR_NAME = "bin";
+    public static final String FLEXJS_INTERMEDIATE_DIR_NAME = "js-debug";
+    public static final String FLEXJS_RELEASE_DIR_NAME = "js-release";
+
+    class DependencyRecord
+    {
+        String path;
+        String deps;
+        String line;
+        int lineNumber;
+    }
+    
+    class DependencyLineComparator implements Comparator<DependencyRecord> {
+        @Override
+        public int compare(DependencyRecord o1, DependencyRecord o2) {
+            return new Integer(o1.lineNumber).compareTo(o2.lineNumber);
+        }
+    }
+    
+    public MXMLVF2JSPublisher(Configuration config, FlexJSProject project)
+    {
+        super(config);
+
+        this.isMarmotinniRun = ((JSGoogConfiguration) configuration)
+                .getMarmotinni() != null;
+        this.outputPathParameter = configuration.getOutput();
+        this.useStrictPublishing = ((JSGoogConfiguration) configuration)
+                .getStrictPublish();
+
+        this.project = project;
+    }
+
+    private FlexJSProject project;
+
+    private boolean isMarmotinniRun;
+    private String outputPathParameter;
+    private boolean useStrictPublishing;
+
+    @Override
+    public File getOutputFolder()
+    {
+        // (erikdebruin) - If there is a -marmotinni switch, we want
+        //                 the output redirected to the directory it specifies.
+        //               - If there is an -output switch, use that path as the 
+        //                 output parent folder.
+        if (isMarmotinniRun)
+        {
+            outputParentFolder = new File(
+                    ((JSGoogConfiguration) configuration).getMarmotinni());
+        }
+        else if (outputPathParameter != null)
+        {
+            outputParentFolder = new File(outputPathParameter);
+            // FB usually specified -output <project-path>/bin-release/app.swf
+            if (outputPathParameter.contains(".swf"))
+                outputParentFolder = outputParentFolder.getParentFile().getParentFile();
+        }
+        else
+        {
+            outputParentFolder = new File(
+                    configuration.getTargetFileDirectory()).getParentFile();
+        }
+
+        outputParentFolder = new File(outputParentFolder,
+                FLEXJS_OUTPUT_DIR_NAME);
+
+        outputFolder = new File(outputParentFolder, File.separator
+                + FLEXJS_INTERMEDIATE_DIR_NAME);
+
+        // (erikdebruin) Marmotinni handles file management, so we 
+        //               bypass the setup.
+        if (!isMarmotinniRun)
+            setupOutputFolder();
+
+        return outputFolder;
+    }
+
+    @Override
+    public boolean publish(ProblemQuery problems) throws IOException
+    {
+        boolean ok;
+        boolean subsetGoog = true;
+        
+        final String intermediateDirPath = outputFolder.getPath();
+        final File intermediateDir = new File(intermediateDirPath);
+        File srcDir = new File(configuration.getTargetFile());
+        srcDir = srcDir.getParentFile();
+
+        final String projectName = FilenameUtils.getBaseName(configuration
+                .getTargetFile());
+        final String outputFileName = projectName
+                + "." + JSSharedData.OUTPUT_EXTENSION;
+
+        File releaseDir = new File(outputParentFolder, FLEXJS_RELEASE_DIR_NAME);
+        final String releaseDirPath = releaseDir.getPath();
+
+        if (!isMarmotinniRun)
+        {
+            if (releaseDir.exists())
+                org.apache.commons.io.FileUtils.deleteQuietly(releaseDir);
+
+            releaseDir.mkdirs();
+        }
+
+        // If the closure-lib parameter is empty we'll try to find the resources
+        // in the classpath, dump its content to the output directory and use this
+        // as closure-lib parameter.
+        final String closureLibDirPath;
+        if(((JSGoogConfiguration) configuration).isClosureLibSet()) {
+            closureLibDirPath = ((JSGoogConfiguration) configuration).getClosureLib();
+        } else {
+            // Check if the "goog/deps.js" is available in the classpath.
+            URL resource = Thread.currentThread().getContextClassLoader().getResource("goog/deps.js");
+            if(resource != null) {
+                File closureLibDir = new File(intermediateDir.getParent(), "closure");
+
+                // Only create and dump the content, if the directory does not exists.
+                if(!closureLibDir.exists()) {
+                    if(!closureLibDir.mkdirs()) {
+                        throw new IOException(
+                                "Unable to create directory for closure-lib at " + closureLibDir.getAbsolutePath());
+                    }
+
+                    // Strip the url of the parts we don't need.
+                    // Unless we are not using some insanely complex setup
+                    // the resource will always be on the same machine.
+                    String resourceJarPath = resource.getFile();
+                    if(resourceJarPath.contains(":")) {
+                        resourceJarPath = resourceJarPath.substring(resourceJarPath.lastIndexOf(":") + 1);
+                    }
+                    if(resourceJarPath.contains("!")) {
+                        resourceJarPath = resourceJarPath.substring(0, resourceJarPath.indexOf("!"));
+                    }
+                    File resourceJar = new File(resourceJarPath);
+
+                    // Dump the closure lib from classpath.
+                    dumpJar(resourceJar, closureLibDir);
+                }
+                // The compiler automatically adds a "closure" to the lib dir path,
+                // so we omit this here.
+                closureLibDirPath = intermediateDir.getParentFile().getPath();
+            }
+            // Fallback to the default.
+            else {
+                closureLibDirPath = ((JSGoogConfiguration) configuration).getClosureLib();
+            }
+        }
+
+        final String closureGoogSrcLibDirPath = closureLibDirPath
+                + "/closure/goog/";
+        final String closureGoogTgtLibDirPath = intermediateDirPath
+                + "/library/closure/goog";
+        final String depsSrcFilePath = intermediateDirPath
+                + "/library/closure/goog/deps.js";
+        final String depsTgtFilePath = intermediateDirPath + "/deps.js";
+        final String projectIntermediateJSFilePath = intermediateDirPath
+                + File.separator + outputFileName;
+        final String projectReleaseJSFilePath = releaseDirPath
+                + File.separator + outputFileName;
+
+        appendExportSymbol(projectIntermediateJSFilePath, projectName);
+        appendEncodedCSS(projectIntermediateJSFilePath, projectName);
+
+        if (!subsetGoog)
+        {
+            // (erikdebruin) We need to leave the 'goog' files and dependencies well
+            //               enough alone. We copy the entire library over so the
+            //               'goog' dependencies will resolve without our help.
+            FileUtils.copyDirectory(new File(closureGoogSrcLibDirPath), new File(closureGoogTgtLibDirPath));
+        }
+        
+        VF2JSClosureCompilerWrapper compilerWrapper = new VF2JSClosureCompilerWrapper();
+
+        VF2JSDepsWriter gdw = new VF2JSDepsWriter(intermediateDir, projectName, (JSGoogConfiguration) configuration);
+        try
+        {
+            StringBuilder depsFileData = new StringBuilder();
+            ok = gdw.generateDeps(problems, depsFileData);
+            if (!subsetGoog)
+            {
+                writeFile(depsTgtFilePath, depsFileData.toString(), false); 
+            }
+            else
+            {
+                String s = depsFileData.toString();
+                int c = s.indexOf("'goog.");
+                ArrayList<String> googreqs = new ArrayList<String>();
+                while (c != -1)
+                {
+                    int c2 = s.indexOf("'", c + 1);
+                    String googreq = s.substring(c, c2 + 1);
+                    googreqs.add(googreq);
+                    c = s.indexOf("'goog.", c2);
+                }
+                HashMap<String, DependencyRecord> defmap = new HashMap<String, DependencyRecord>();
+                // read in goog's deps.js
+                FileInputStream fis = new FileInputStream(closureGoogSrcLibDirPath + "/deps.js");
+                Scanner scanner = new Scanner(fis, "UTF-8");
+                String addDependency = "goog.addDependency('";
+                int currentLine = 0;
+                while (scanner.hasNextLine())
+                {
+                    String googline = scanner.nextLine();
+                    if (googline.indexOf(addDependency) == 0)
+                    {
+                        int c1 = googline.indexOf("'", addDependency.length() + 1);
+                        String googpath = googline.substring(addDependency.length(), c1);
+                        String googdefs = googline.substring(googline.indexOf("[") + 1, googline.indexOf("]"));
+                        String googdeps = googline.substring(googline.lastIndexOf("[") + 1, googline.lastIndexOf("]"));
+                        String[] thedefs = googdefs.split(",");
+                        DependencyRecord deprec = new DependencyRecord();
+                        deprec.path = googpath;
+                        deprec.deps = googdeps;
+                        deprec.line = googline;
+                        deprec.lineNumber = currentLine;
+                        for (String def : thedefs)
+                        {
+                            def = def.trim();
+                            defmap.put(def, deprec);
+                        }
+                    }
+                    currentLine++;
+                }
+                // (erikdebruin) Prevent 'Resource leak' warning on line 212:
+                scanner.close();      
+                ArrayList<DependencyRecord> subsetdeps = new ArrayList<DependencyRecord>();
+                HashMap<String, String> gotgoog = new HashMap<String, String>();
+                for (String req : googreqs)
+                {
+                    DependencyRecord deprec = defmap.get(req);
+                    // if we've already processed this file, skip
+                    if (!gotgoog.containsKey(deprec.path))
+                    {
+                        gotgoog.put(deprec.path, null);
+                        subsetdeps.add(deprec);
+                        addDeps(subsetdeps, gotgoog, defmap, deprec.deps);                        
+                    }
+                }
+                // now we should have the subset of files we need in the order needed
+                StringBuilder sb = new StringBuilder();
+                sb.append("goog.addDependency('base.js', ['goog'], []);\n");
+                File file = new File(closureGoogSrcLibDirPath + "/base.js");
+                FileUtils.copyFileToDirectory(file, new File(closureGoogTgtLibDirPath));
+                compilerWrapper.addJSSourceFile(file.getCanonicalPath());
+                Collections.sort(subsetdeps, new DependencyLineComparator());
+                for (DependencyRecord subsetdeprec : subsetdeps)
+                {
+                    sb.append(subsetdeprec.line).append("\n");
+                }
+                writeFile(depsTgtFilePath, sb.toString() + depsFileData.toString(), false);
+                // copy the required files
+                for (String googfn : gotgoog.keySet())
+                {
+                    file = new File(closureGoogSrcLibDirPath + File.separator + googfn);
+                    String dir = closureGoogTgtLibDirPath;
+                    if (googfn.contains("/"))
+                    {
+                        dir += File.separator + googfn.substring(0, googfn.lastIndexOf("/"));
+                    }
+                    FileUtils.copyFileToDirectory(file, new File(dir));
+                    compilerWrapper.addJSSourceFile(file.getCanonicalPath());
+                }
+            }
+        }
+        catch (InterruptedException e)
+        {
+            e.printStackTrace();
+            return false;
+        }
+        
+        IOFileFilter pngSuffixFilter = FileFilterUtils.and(FileFileFilter.FILE,
+                FileFilterUtils.suffixFileFilter(".png"));
+        IOFileFilter gifSuffixFilter = FileFilterUtils.and(FileFileFilter.FILE,
+                FileFilterUtils.suffixFileFilter(".gif"));
+        IOFileFilter jpgSuffixFilter = FileFilterUtils.and(FileFileFilter.FILE,
+                FileFilterUtils.suffixFileFilter(".jpg"));
+        IOFileFilter assetFiles = FileFilterUtils.or(pngSuffixFilter,
+                jpgSuffixFilter, gifSuffixFilter);
+
+        FileUtils.copyDirectory(srcDir, intermediateDir, assetFiles);
+        FileUtils.copyDirectory(srcDir, releaseDir, assetFiles);
+
+        File srcDeps = new File(depsSrcFilePath);
+
+        // ToDo (erikdebruin): yeah, right, hard coded the path, nice!
+        File sdkDepsFile = new File("/Users/erik/Documents/ApacheFlex/git/flex-asjs/vf2js/frameworks/js/sdk-deps.js");
+        if (sdkDepsFile.exists())
+        	FileUtils.copyFile(sdkDepsFile, new File(intermediateDirPath + File.separator + "sdk-deps.js"));
+        
+        writeHTML("intermediate", projectName, intermediateDirPath, gdw.additionalHTML);
+        writeHTML("release", projectName, releaseDirPath, gdw.additionalHTML);
+        writeCSS(projectName, intermediateDirPath);
+        writeCSS(projectName, releaseDirPath);
+
+        if (!subsetGoog)
+        {
+            // (erikdebruin) add 'goog' files
+            Collection<File> files = org.apache.commons.io.FileUtils.listFiles(new File(
+                    closureGoogTgtLibDirPath), new RegexFileFilter("^.*(\\.js)"),
+                    DirectoryFileFilter.DIRECTORY);
+            for (File file : files)
+            {
+                compilerWrapper.addJSSourceFile(file.getCanonicalPath());
+            }
+        }
+        
+        // (erikdebruin) add project files
+        for (String filePath : gdw.filePathsInOrder)
+        {
+            compilerWrapper.addJSSourceFile(
+                    new File(filePath).getCanonicalPath());   
+        }
+        
+        compilerWrapper.setOptions(
+                projectReleaseJSFilePath, useStrictPublishing);
+        
+        // (erikdebruin) Include the 'goog' deps to allow the compiler to resolve
+        //               dependencies.
+        compilerWrapper.addJSSourceFile(
+                closureGoogSrcLibDirPath + File.separator + "deps.js");
+        
+        List<String> externs = ((JSGoogConfiguration)configuration).getExternalJSLib();
+        for (String extern : externs)
+        {
+            compilerWrapper.addJSExternsFile(extern);
+        }
+        
+        compilerWrapper.targetFilePath = projectReleaseJSFilePath;
+        compilerWrapper.compile();
+        
+        appendSourceMapLocation(projectReleaseJSFilePath, projectName);
+
+        if (!isMarmotinniRun)
+        {
+            String allDeps = "";
+            if (!subsetGoog)
+                allDeps += FileUtils.readFileToString(srcDeps);
+            allDeps += FileUtils.readFileToString(new File(depsTgtFilePath));
+            
+            FileUtils.writeStringToFile(srcDeps, allDeps);
+            
+            org.apache.commons.io.FileUtils.deleteQuietly(new File(depsTgtFilePath));
+        }
+
+        if (ok)
+            System.out.println("The project '"
+                + projectName
+                + "' has been successfully compiled and optimized.");
+        
+        return true;
+    }
+
+    private void addDeps(ArrayList<DependencyRecord> subsetdeps, HashMap<String, String> gotgoog, 
+                            HashMap<String, DependencyRecord> defmap, String deps)
+    {
+        if (deps.length() == 0)
+            return;
+        
+        String[] deplist = deps.split(",");
+        for (String dep : deplist)
+        {
+            dep = dep.trim();
+            DependencyRecord deprec = defmap.get(dep);
+            if (!gotgoog.containsKey(deprec.path))
+            {
+                gotgoog.put(deprec.path, null);
+                // put addDependencyLine in subset file
+                subsetdeps.add(deprec);
+                addDeps(subsetdeps, gotgoog, defmap, deprec.deps);                        
+            }
+        }
+    }
+    
+    private void appendExportSymbol(String path, String projectName)
+            throws IOException
+    {
+        StringBuilder appendString = new StringBuilder();
+        appendString
+                .append("\n\n// Ensures the symbol will be visible after compiler renaming.\n");
+        appendString.append("goog.exportSymbol('");
+        appendString.append(projectName);
+        appendString.append("', ");
+        appendString.append(projectName);
+        appendString.append(");\n");
+        writeFile(path, appendString.toString(), true);
+    }
+
+    private void appendEncodedCSS(String path, String projectName)
+            throws IOException
+    {
+        StringBuilder appendString = new StringBuilder();
+        appendString.append("\n\n");
+        appendString.append(projectName);
+        appendString.append(".prototype.cssData = [");
+        JSCSSCompilationSession cssSession = (JSCSSCompilationSession) project.getCSSCompilationSession();
+        String s = cssSession.getEncodedCSS();
+        int reqidx = s.indexOf("goog.require");
+        if (reqidx != -1)
+        {
+            String reqs = s.substring(reqidx);
+            s = s.substring(0, reqidx - 1);
+            String fileData = readCode(new File(path));
+            reqidx = fileData.indexOf("goog.require");
+            String after = fileData.substring(reqidx);
+            String before = fileData.substring(0, reqidx - 1);
+            s = before + reqs + after + appendString.toString() + s;
+            writeFile(path, s, false);
+        }
+        else
+        {
+            appendString.append(s);
+            writeFile(path, appendString.toString(), true);
+        }
+    }
+        
+    protected String readCode(File file)
+    {
+        String code = "";
+        try
+        {
+            BufferedReader in = new BufferedReader(new InputStreamReader(
+                    new FileInputStream(file), "UTF8"));
+
+            String line = in.readLine();
+
+            while (line != null)
+            {
+                code += line + "\n";
+                line = in.readLine();
+            }
+            code = code.substring(0, code.length() - 1);
+
+            in.close();
+        }
+        catch (Exception e)
+        {
+            // nothing to see, move along...
+        }
+
+        return code;
+    }
+
+    private void writeHTML(String type, String projectName, String dirPath, List<String> additionalHTML)
+            throws IOException
+    {
+        StringBuilder htmlFile = new StringBuilder();
+        htmlFile.append("<!DOCTYPE html>\n");
+        htmlFile.append("<html>\n");
+        htmlFile.append("<head>\n");
+        htmlFile.append("\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n");
+        htmlFile.append("\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
+        htmlFile.append("\t<link rel=\"stylesheet\" type=\"text/css\" href=\"");
+        htmlFile.append(projectName);
+        htmlFile.append(".css\">\n");
+
+        for (String s : additionalHTML)
+            htmlFile.append(s).append("\n");
+        
+        if ("intermediate".equals(type))
+        {
+            htmlFile.append("\t<script type=\"text/javascript\" src=\"./library/closure/goog/base.js\"></script>\n");
+            htmlFile.append("\t<script type=\"text/javascript\" src=\"./sdk-deps.js\"></script>\n");
+            htmlFile.append("\t<script type=\"text/javascript\">\n");
+            //htmlFile.append("\t\tgoog.require('mx.styles.StyleProtoChain');\n");
+            htmlFile.append("\t\tgoog.require('mx.managers.SystemManager');\n");
+            htmlFile.append("\t\tgoog.require('mx.managers.systemClasses.ChildManager');\n");
+            //htmlFile.append("\t\tgoog.require('" + projectName + "');\n");
+            htmlFile.append("\t</script>\n");
+        }
+        else
+        {
+            htmlFile.append("\t<script type=\"text/javascript\" src=\"./");
+            htmlFile.append(projectName);
+            htmlFile.append(".js\"></script>\n");
+        }
+
+        htmlFile.append("</head>\n");
+        htmlFile.append("<body onload=\"init();\">\n");
+        htmlFile.append("\t<script type=\"text/javascript\">\n");
+        htmlFile.append("\t\t'use strict';\n");
+        htmlFile.append("\t\t\n");
+        htmlFile.append("\t\tfunction init() {\n");
+        htmlFile.append("\t\t\tvar /** @type {flash.display.LoaderInfo} */ loaderInfo,\n");
+        htmlFile.append("\t\t\t    /** @type {flash.display.Stage} */ stage,\n");
+        htmlFile.append("\t\t\t    /** @type {mx.managers.SystemManager} */ systemManager,\n");
+        htmlFile.append("\t\t\t    /** @type {mx.managers.systemClasses.ChildManager} */ childManager;\n");
+        htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\tstage = new flash.display.Stage();\n");
+        htmlFile.append("\t\t\twindow['apache-flex_stage'] = stage;\n");
+        htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\twindow['apache-flex_loaderInfo'] = new flash.display.LoaderInfo();\n");
+        htmlFile.append("\t\t\twindow['apache-flex_loaderInfo'].get_parameters = function () {\n");
+        htmlFile.append("\t\t\t\tvar /** @type {Object} */ infoObject;\n");
+        htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\t	infoObject = {};\n");
+        htmlFile.append("\t\t\t	infoObject[\"resourceModuleURLs\"] = '';\n");
+        htmlFile.append("\t\t\t	\n");
+        htmlFile.append("\t\t\t	return infoObject;\n");
+        htmlFile.append("\t\t\t}\n");
+        htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\tsystemManager = new mx.managers.SystemManager();\n");
+        htmlFile.append("\t\t\tsystemManager.info = function () {\n");
+        htmlFile.append("\t\t\t\tvar /** @type {Object} */ infoObject;\n");
+        htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\t	infoObject = {};\n");
+        htmlFile.append("\t\t\t	infoObject[\"applicationDPI\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"backgroundAlpha\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"backgroundColor\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"backgroundImage\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"backgroundSize\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"cdRsls\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"compiledLocales\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"compiledResourceBundleNames\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"currentDomain\"] = new flash.system.ApplicationDomain();\n");
+        htmlFile.append("\t\t\t	infoObject[\"fonts\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"frames\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"mainClassName\"] = '").append(projectName).append("';\n");
+        htmlFile.append("\t\t\t	infoObject[\"mixins\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"preloader\"] = new mx.preloaders.DownloadProgressBar();\n");
+        htmlFile.append("\t\t\t	infoObject[\"rsls\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"runtimeDPIProvider\"] = new mx.core.RuntimeDPIProvider();\n");
+        htmlFile.append("\t\t\t	infoObject[\"useNativeDragManager\"] = '';\n");
+        htmlFile.append("\t\t\t	infoObject[\"usePreloader\"] = false; // we're not showing a preloader in JS\n");
+        htmlFile.append("\t\t\t	\n");
+        htmlFile.append("\t\t\t	return infoObject;\n");
+        htmlFile.append("\t\t\t}\n");
+        htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\tchildManager = new mx.managers.systemClasses.ChildManager(systemManager);\n");
+        htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\tmx.managers.DragManagerImpl.sm = window['apache-flex_system-manager'];\n");
+        htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\tmx.core.FlexGlobals.topLevelApplication = {};\n");
+        htmlFile.append("\t\t\t\n");
+        htmlFile.append("\t\t\twindow['apache-flex_loaderInfo'].dispatchEvent(new flash.events.Event(flash.events.Event.INIT));\n");
+        htmlFile.append("\t\t}\n");
+        htmlFile.append("\t</script>\n");
+        htmlFile.append("</body>\n");
+        htmlFile.append("</html>");
+
+        writeFile(dirPath + File.separator + "index.html", htmlFile.toString(),
+                false);
+    }
+
+    private void writeCSS(String projectName, String dirPath)
+            throws IOException
+    {
+        StringBuilder cssFile = new StringBuilder();
+        JSCSSCompilationSession cssSession = (JSCSSCompilationSession) project.getCSSCompilationSession();
+        cssFile.append(cssSession.emitCSS());
+
+        writeFile(dirPath + File.separator + projectName + ".css",
+                cssFile.toString(), false);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/as/ASBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/as/ASBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/as/ASBackend.java
new file mode 100644
index 0000000..647efa5
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/as/ASBackend.java
@@ -0,0 +1,159 @@
+/*
+ *
+ *  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.internal.driver.as;
+
+import java.io.FilterWriter;
+import java.io.StringWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.as.IASWriter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.driver.IPublisher;
+import org.apache.flex.compiler.internal.codegen.as.ASAfterNodeStrategy;
+import org.apache.flex.compiler.internal.codegen.as.ASBeforeNodeStrategy;
+import org.apache.flex.compiler.internal.codegen.as.ASBlockWalker;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASFilterWriter;
+import org.apache.flex.compiler.internal.codegen.as.ASWriter;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLEmitter;
+import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
+import org.apache.flex.compiler.internal.visitor.as.ASNodeSwitch;
+import org.apache.flex.compiler.internal.visitor.as.BeforeAfterStrategy;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.ITarget;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.as.IASBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * A concrete implementation of the {@link IBackend} API where the
+ * {@link ASBlockWalker} is used to traverse the {@link IFileNode} AST.
+ * 
+ * @author Michael Schmalle
+ */
+public class ASBackend implements IBackend
+{
+    @Override
+    public String getOutputExtension()
+    {
+        return "as";
+    }
+
+    @Override
+    public ISourceFileHandler getSourceFileHandlerInstance()
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Configurator createConfigurator()
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ITarget createTarget(IASProject project, ITargetSettings settings,
+            ITargetProgressMonitor monitor)
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public IASBlockWalker createWalker(IASProject project,
+            List<ICompilerProblem> errors, IASEmitter emitter)
+    {
+        ASBlockWalker walker = new ASBlockWalker(errors, project, emitter);
+
+        BeforeAfterStrategy strategy = new BeforeAfterStrategy(
+                new ASNodeSwitch(walker), new ASBeforeNodeStrategy(emitter),
+                new ASAfterNodeStrategy(emitter));
+
+        walker.setStrategy(strategy);
+
+        return walker;
+    }
+
+    @Override
+    public IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter mxmlEmitter,
+            IASEmitter asEmitter, IBlockWalker asBlockWalker)
+    {
+        return null;
+    }
+
+    @Override
+    public ASFilterWriter createWriterBuffer(IASProject project)
+    {
+        StringWriter out = new StringWriter();
+        ASFilterWriter writer = new ASFilterWriter(out);
+        return writer;
+    }
+
+    @Override
+    public IASEmitter createEmitter(FilterWriter writer)
+    {
+        return new ASEmitter(writer);
+    }
+
+    @Override
+    public IMXMLEmitter createMXMLEmitter(FilterWriter writer)
+    {
+        return new MXMLEmitter(writer);
+    }
+
+    @Override
+    public IASWriter createWriter(IASProject project,
+            List<ICompilerProblem> problems, ICompilationUnit compilationUnit,
+            boolean enableDebug)
+    {
+        return new ASWriter(project, problems, compilationUnit, enableDebug);
+    }
+
+    @Override
+    public IASWriter createMXMLWriter(IASProject project,
+            List<ICompilerProblem> problems, ICompilationUnit compilationUnit,
+            boolean enableDebug)
+    {
+        return null;
+    }
+
+    @Override
+    public IDocEmitter createDocEmitter(IASEmitter emitter)
+    {
+        return null;
+    }
+
+    @Override
+    public IPublisher createPublisher(IASProject project,
+            List<ICompilerProblem> errors, Configuration config)
+    {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSApplication.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSApplication.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSApplication.java
new file mode 100644
index 0000000..edfd686
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSApplication.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.internal.driver.js;
+
+import org.apache.flex.compiler.driver.js.IJSApplication;
+
+/**
+ * @author Michael Schmalle
+ */
+public class JSApplication implements IJSApplication
+{
+    public JSApplication()
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSBackend.java
new file mode 100644
index 0000000..a8b7737
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSBackend.java
@@ -0,0 +1,171 @@
+/*
+ *
+ *  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.internal.driver.js;
+
+import java.io.FilterWriter;
+import java.io.StringWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.clients.JSConfiguration;
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.ISourceMapEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.codegen.js.IJSWriter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.driver.IPublisher;
+import org.apache.flex.compiler.driver.js.IJSBackend;
+import org.apache.flex.compiler.internal.codegen.as.ASAfterNodeStrategy;
+import org.apache.flex.compiler.internal.codegen.as.ASBeforeNodeStrategy;
+import org.apache.flex.compiler.internal.codegen.as.ASBlockWalker;
+import org.apache.flex.compiler.internal.codegen.js.JSDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.JSFilterWriter;
+import org.apache.flex.compiler.internal.codegen.js.JSPublisher;
+import org.apache.flex.compiler.internal.codegen.js.JSSourceMapEmitter;
+import org.apache.flex.compiler.internal.codegen.js.JSWriter;
+import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.internal.visitor.as.ASNodeSwitch;
+import org.apache.flex.compiler.internal.visitor.as.BeforeAfterStrategy;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.as.IASBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * A concrete implementation of the {@link IBackend} API where the
+ * {@link ASBlockWalker} is used to traverse the {@link IFileNode} AST.
+ * 
+ * @author Michael Schmalle
+ */
+public class JSBackend implements IJSBackend
+{
+    @Override
+    public String getOutputExtension()
+    {
+        return "js";
+    }
+
+    @Override
+    public ISourceFileHandler getSourceFileHandlerInstance()
+    {
+        return JSSourceFileHandler.INSTANCE;
+    }
+
+    @Override
+    public Configurator createConfigurator()
+    {
+        return new Configurator(JSConfiguration.class);
+    }
+
+    @Override
+    public JSTarget createTarget(IASProject project, ITargetSettings settings,
+            ITargetProgressMonitor monitor)
+    {
+        return new JSTarget(project, settings, monitor);
+    }
+
+    @Override
+    public IASBlockWalker createWalker(IASProject project,
+            List<ICompilerProblem> errors, IASEmitter emitter)
+    {
+        ASBlockWalker walker = new ASBlockWalker(errors, project, emitter);
+
+        BeforeAfterStrategy strategy = new BeforeAfterStrategy(
+                new ASNodeSwitch(walker), new ASBeforeNodeStrategy(emitter),
+                new ASAfterNodeStrategy(emitter));
+
+        walker.setStrategy(strategy);
+
+        return walker;
+    }
+
+    @Override
+    public IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter mxmlEmitter,
+            IASEmitter asEmitter, IBlockWalker asBlockWalker)
+    {
+        return null;
+    }
+
+    @Override
+    public JSFilterWriter createWriterBuffer(IASProject project)
+    {
+        StringWriter out = new StringWriter();
+        JSFilterWriter writer = new JSFilterWriter(out);
+        return writer;
+    }
+
+    @Override
+    public IJSWriter createWriter(IASProject project,
+            List<ICompilerProblem> problems, ICompilationUnit compilationUnit,
+            boolean enableDebug)
+    {
+        return new JSWriter(project, problems, compilationUnit, enableDebug);
+    }
+
+    @Override
+    public IJSWriter createMXMLWriter(IASProject project,
+            List<ICompilerProblem> problems, ICompilationUnit compilationUnit,
+            boolean enableDebug)
+    {
+        return null;
+    }
+
+    @Override
+    public ISourceMapEmitter createSourceMapEmitter(IJSEmitter emitter)
+    {
+        return new JSSourceMapEmitter(emitter);
+    }
+
+    @Override
+    public IDocEmitter createDocEmitter(IASEmitter emitter)
+    {
+        return new JSDocEmitter((IJSEmitter) emitter);
+    }
+
+    @Override
+    public IASEmitter createEmitter(FilterWriter out)
+    {
+        return new JSEmitter(out);
+    }
+
+    @Override
+    public IMXMLEmitter createMXMLEmitter(FilterWriter out)
+    {
+        return null;
+    }
+
+    @Override
+    public IPublisher createPublisher(IASProject project,
+            List<ICompilerProblem> errors, Configuration config)
+    {
+        return new JSPublisher(config);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSCompilationUnit.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSCompilationUnit.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSCompilationUnit.java
new file mode 100644
index 0000000..6583f3a
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSCompilationUnit.java
@@ -0,0 +1,217 @@
+/*
+ *
+ *  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.internal.driver.js;
+
+import java.io.IOException;
+import java.util.Collection;
+
+import org.apache.flex.compiler.common.DependencyType;
+import org.apache.flex.compiler.internal.projects.CompilerProject;
+import org.apache.flex.compiler.internal.projects.DefinitionPriority;
+import org.apache.flex.compiler.internal.units.ASCompilationUnit;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.targets.ITarget.TargetType;
+import org.apache.flex.compiler.units.requests.IOutgoingDependenciesRequestResult;
+
+/**
+ * JSCompilationUnit is the CompilationUnit for compiling ActionScript source
+ * files to JavasScript.
+ * <p>
+ * JSCompilationUnit is derived from ASCompilationUnit and overrides the parts
+ * that generate the code.
+ */
+public class JSCompilationUnit extends ASCompilationUnit
+{
+    @SuppressWarnings("unused")
+    private Boolean inCodeGen = false;
+
+    /**
+     * Create a compilation unit from an ABC file.
+     * 
+     * @param project compiler project
+     * @param path ABC file path
+     * @throws IOException error
+     */
+    public JSCompilationUnit(CompilerProject project, String path)
+            throws IOException
+    {
+        this(project, path, DefinitionPriority.BasePriority.LIBRARY_PATH);
+    }
+
+    public JSCompilationUnit(CompilerProject project, String path,
+            DefinitionPriority.BasePriority basePriority)
+    {
+        super(project, path, basePriority);
+    }
+
+    public JSCompilationUnit(CompilerProject project, String path,
+            DefinitionPriority.BasePriority basePriority, String qname)
+    {
+        super(project, path, basePriority, 0, qname);
+    }
+
+    //    protected IABCBytesRequestResult _handleABCBytesRequest(Operation buildPhase) throws InterruptedException
+    //    {
+    //        // If JSEmitter.needsSecondPass() returns true, JSGenerator.generate() will return null during scanning, 
+    //        // which will result in JSCompilationUnit::handleSemanticProblemsRequest not caching any abcBytes for 
+    //        // handleABCBytesRequest. The net result is that JSGenerator.generate() will be called again in handleABCBytesRequest. 
+    //        // This mechanic will ensure selective two-pass compilation. 
+    //        if (m_abcBytes != null &&
+    //            !JSSharedData.instance.hasSymbols() && // Symbol support
+    //            !JSSharedData.instance.hasAnyClassInit()) // support for class inits 
+    //            return m_abcBytes;
+    //
+    //        JSGenerator jsGenerator = new JSGenerator();
+    //        jsGenerator.m_compilationUnit = this;
+    //        jsGenerator.setBuildPhase(buildPhase);
+    //
+    //        // Need to force the file scope request to happen first to get the ASFileScope
+    //        // for this compilation unit registered with the project.
+    //        // ** TODO this is a hack!
+    //        getFileScopeRequest().get();
+    //
+    //        // This is also a hack!  If there are embed directives, need to ensure
+    //        // semantic pass has finished, as that is what will generate the embed classes
+    //        // which are needed by codegen
+    //        if (buildPhase != Operation.GET_SEMANTIC_PROBLEMS)
+    //        {
+    //        	// AJH this was deadlocking as getOutgoingDependencies calls handleABCBytes
+    //        	if (buildPhase != Operation.GET_ABC_BYTES)
+    //        		getOutgoingDependenciesRequest().get();
+    //        }
+    //
+    //        final ISyntaxTreeRequestResult fsr = getSyntaxTreeRequest().get();
+    //        final IASNode rootNode = fsr.getAST();
+    //
+    //        startProfile(buildPhase);
+    //        IABCBytesRequestResult result = jsGenerator.generate(getFilenameNoPath(), rootNode, this.getProject());
+    //        stopProfile(buildPhase);
+    //
+    //        m_needsSecondPass = jsGenerator.needsSecondPass();
+    //
+    //        return result;
+    //    }
+
+    //   @Override
+    //    protected IABCBytesRequestResult handleABCBytesRequest() throws InterruptedException
+    //    {
+    //        final IABCBytesRequestResult result = _handleABCBytesRequest(Operation.GET_ABC_BYTES);
+    //
+    //        /*
+    //         * // explicitly reference all classes this class depends on if(
+    //         * result.getProblems() == null || result.getProblems().length == 0 ) {
+    //         * final String code = new String( result.getABCBytes() ); if(
+    //         * code.contains(JSSharedData.REQUIRED_TAG_MARKER) ) { final
+    //         * ICompilationUnit cu = this; final Set<ICompilationUnit> deps = new
+    //         * HashSet<ICompilationUnit>(); deps.addAll(
+    //         * getProject().getDependencies(cu) ); if( !deps.isEmpty() ) { String
+    //         * depNames = ""; Boolean separator = false; final List<IDefinition>
+    //         * defs = MXMLJSC.getClassDefinitions( cu ); for( IDefinition def: defs
+    //         * ) { if( def instanceof ClassDefinition ) { final String defName =
+    //         * JSGeneratingReducer.createFullNameFromDefinition(def); if( defName !=
+    //         * null && !defName.isEmpty() ) { if( separator ) depNames += ":"; else
+    //         * separator = true; depNames += defName; } } }
+    //         * code.replaceFirst(JSSharedData.REQUIRED_TAG_MARKER, depNames); return
+    //         * new ABCBytesRequestResult(code.getBytes(), result.getProblems()); } }
+    //         * }
+    //         */
+    //        return result;
+    //    }
+
+    @Override
+    protected IOutgoingDependenciesRequestResult handleOutgoingDependenciesRequest()
+            throws InterruptedException
+    {
+        //        // Every CU is dependent on the class glue, which is implemented in browser.adobe.
+        //        // Add dependency from this JSCompilationUnit to browser.adobe's JSCompilationUnit.
+        //        addDependency(JSSharedData.JS_FRAMEWORK_NAME, DependencyType.INHERITANCE);
+        //        addDependency(JSSharedData.FRAMEWORK_CLASS, DependencyType.INHERITANCE);
+
+        IOutgoingDependenciesRequestResult result = super
+                .handleOutgoingDependenciesRequest();
+
+        //        // SWFTarget::startBuildAndFindAllCompilationUnits() is called by SWFTarget::collectProblems(), which is called by SWFTarget::addToSWF() in JSDriver::main().
+        //        // This is our first pass. jsGenerator.generate() will return null if JSGeneratingReducer.getMember 
+        //        // If JSEmitter.needsSecondPass() returns true, JSGenerator.generate() will return null during scanning, 
+        //        // which will result in JSCompilationUnit::handleSemanticProblemsRequest not caching any abcBytes for 
+        //        // handleABCBytesRequest. The net result is that JSGenerator.generate() will be called again in handleABCBytesRequest. 
+        //        // This mechanic will ensure selective two-pass compilation. 
+        //        if (result.getProblems().length == 0)
+        //        {
+        //            m_needsSecondPass = false;
+        //            m_abcBytes = _handleABCBytesRequest(Operation.GET_SEMANTIC_PROBLEMS);
+        //            if (m_needsSecondPass)
+        //                m_abcBytes = null;
+        //        }
+
+        return result;
+    }
+
+    public Boolean addDependency(String className, DependencyType dt)
+    {
+        //        if (JSGeneratingReducer.isReservedDataType(className))
+        //            return false;
+        //
+        //        final ICompilationUnit fromCU = this;
+        //        final CompilerProject compilerProject = this.getProject();
+        //        final ASProjectScope projectScope = compilerProject.getScope();
+        //
+        //        final IDefinition classDef = projectScope.findDefinitionByName(className);
+        //        if (classDef == null)
+        //            return false;
+        //
+        //        final ICompilationUnit toCU = projectScope.getCompilationUnitForDefinition(classDef);
+        //        if (fromCU == toCU)
+        //            return false;
+        //
+        //        // sharedData.verboseMessage( "Adding dependency: " + className );
+        //        compilerProject.addDependency(fromCU, toCU, dt);
+
+        return true;
+    }
+
+    @Override
+    public void startBuildAsync(TargetType targetType)
+    {
+        // super.startBuildAsync(targetType);
+
+        getSyntaxTreeRequest();
+        getFileScopeRequest();
+        getOutgoingDependenciesRequest();
+
+        //        // scanning and code generating phases need to be separated
+        //        // in order to create two distinct passes for m_needSecondPass.
+        //        if (m_inCodeGen)
+        //        {
+        //            getABCBytesRequest();
+        //            getSWFTagsRequest();
+        //        }
+    }
+
+    @Override
+    public void waitForBuildFinish(final Collection<ICompilerProblem> problems,
+            TargetType targetType) throws InterruptedException
+    {
+        inCodeGen = true;
+        super.waitForBuildFinish(problems, targetType);
+        inCodeGen = false;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSSourceFileHandler.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSSourceFileHandler.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSSourceFileHandler.java
new file mode 100644
index 0000000..d2dd3c3
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/JSSourceFileHandler.java
@@ -0,0 +1,83 @@
+/*
+ *
+ *  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.internal.driver.js;
+
+import org.apache.flex.compiler.internal.projects.CompilerProject;
+import org.apache.flex.compiler.internal.projects.DefinitionPriority;
+import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
+import org.apache.flex.compiler.internal.units.ASCompilationUnit;
+import org.apache.flex.compiler.units.ICompilationUnit;
+
+/**
+ * Implementation of ISourceFileHandler that constructs
+ * {@link ASCompilationUnit}'s. JSSourceFileHandler is the SourceFileHandler
+ * that provides JSCompilationUnit for *.as files. JSDriver registers
+ * JSSourceFileHandler at FlexApplicationProject. This implementation is part of
+ * FalconJS. For more details on FalconJS see org.apache.flex.compiler.JSDriver
+ */
+public final class JSSourceFileHandler implements ISourceFileHandler
+{
+
+    public static final String EXTENSION = "as"; //$NON-NLS-1$
+    public static final JSSourceFileHandler INSTANCE = new JSSourceFileHandler();
+
+    private JSSourceFileHandler()
+    {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String[] getExtensions()
+    {
+        return new String[] { EXTENSION };
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ICompilationUnit createCompilationUnit(CompilerProject proj,
+            String path, DefinitionPriority.BasePriority basePriority,
+            int order, String qname, String locale)
+    {
+        return new JSCompilationUnit(proj, path, basePriority, qname);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean needCompilationUnit(CompilerProject project, String path,
+            String qname, String locale)
+    {
+        return true;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean canCreateInvisibleCompilationUnit()
+    {
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/amd/AMDBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/amd/AMDBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/amd/AMDBackend.java
new file mode 100644
index 0000000..e3c68de
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/amd/AMDBackend.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.internal.driver.js.amd;
+
+import java.io.FilterWriter;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.amd.JSAMDDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.amd.JSAMDEmitter;
+import org.apache.flex.compiler.internal.driver.js.JSBackend;
+
+/**
+ * A concrete implementation of the {@link IBackend} API for 'AMD' code
+ * production.
+ * 
+ * @author Michael Schmalle
+ */
+public class AMDBackend extends JSBackend
+{
+    @Override
+    public IDocEmitter createDocEmitter(IASEmitter emitter)
+    {
+        return new JSAMDDocEmitter((IJSEmitter) emitter);
+    }
+
+    @Override
+    public IJSEmitter createEmitter(FilterWriter out)
+    {
+        IJSEmitter emitter = new JSAMDEmitter(out);
+        emitter.setDocEmitter(createDocEmitter(emitter));
+        return emitter;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/flexjs/FlexJSBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/flexjs/FlexJSBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/flexjs/FlexJSBackend.java
new file mode 100644
index 0000000..cccbe71
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/flexjs/FlexJSBackend.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.internal.driver.js.flexjs;
+
+import java.io.FilterWriter;
+
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.internal.targets.FlexJSTarget;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+
+/**
+ * @author Erik de Bruin
+ */
+public class FlexJSBackend extends GoogBackend
+{
+
+    @Override
+    public IJSEmitter createEmitter(FilterWriter out)
+    {
+        IJSEmitter emitter = new JSFlexJSEmitter(out);
+        emitter.setDocEmitter(createDocEmitter(emitter));
+        return emitter;
+    }
+
+    @Override
+    public JSTarget createTarget(IASProject project, ITargetSettings settings,
+            ITargetProgressMonitor monitor)
+    {
+        return new FlexJSTarget(project, settings, monitor);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java
new file mode 100644
index 0000000..b61bbf5
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/flexjs/JSCSSCompilationSession.java
@@ -0,0 +1,414 @@
+/*
+ *
+ *  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.internal.driver.js.flexjs;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.flex.compiler.constants.IASLanguageConstants;
+import org.apache.flex.compiler.css.ICSSDocument;
+import org.apache.flex.compiler.css.ICSSMediaQueryCondition;
+import org.apache.flex.compiler.css.ICSSProperty;
+import org.apache.flex.compiler.css.ICSSPropertyValue;
+import org.apache.flex.compiler.css.ICSSRule;
+import org.apache.flex.compiler.css.ICSSSelector;
+import org.apache.flex.compiler.css.ICSSSelectorCondition;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.css.CSSArrayPropertyValue;
+import org.apache.flex.compiler.internal.css.CSSColorPropertyValue;
+import org.apache.flex.compiler.internal.css.CSSFontFace;
+import org.apache.flex.compiler.internal.css.CSSFunctionCallPropertyValue;
+import org.apache.flex.compiler.internal.css.CSSKeywordPropertyValue;
+import org.apache.flex.compiler.internal.css.CSSNumberPropertyValue;
+import org.apache.flex.compiler.internal.css.CSSProperty;
+import org.apache.flex.compiler.internal.css.CSSRgbColorPropertyValue;
+import org.apache.flex.compiler.internal.css.CSSStringPropertyValue;
+import org.apache.flex.compiler.internal.css.codegen.CSSCompilationSession;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.ImmutableList;
+
+public class JSCSSCompilationSession extends CSSCompilationSession
+{
+
+    private ArrayList<String> requires;
+    
+    public String getEncodedCSS()
+    {
+        final ICSSDocument css = synthesisNormalizedCSS();
+        StringBuilder sb = new StringBuilder();
+        requires = new ArrayList<String>();
+        encodeCSS(css, sb);
+        sb.append("];\n");
+        for (String r : requires)
+        {
+            sb.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken() + "('" + formatQualifiedName(r) + "');\n");
+        }
+
+        return sb.toString();        
+    }
+    
+    public String emitCSS()
+    {
+        final ICSSDocument css = synthesisNormalizedCSS();
+        StringBuilder sb = new StringBuilder();
+        sb.append("/* Generated by Apache Flex Cross-Compiler */\n");
+        walkCSS(css, sb);
+        return sb.toString();
+    }
+    
+    private String fontFaceToString(CSSFontFace fontFace)
+    {
+        final StringBuilder result = new StringBuilder();
+        result.append("@font-face {\n");
+        result.append("    ");
+        result.append("font-family: ");
+        result.append(fontFace.getFontFamily() + ";\n");
+        result.append("    ");
+        result.append("font-style: ");
+        result.append(fontFace.getFontStyle() + ";\n");
+        result.append("    ");
+        result.append("font-weight: ");
+        result.append(fontFace.getFontStyle() + ";\n");
+        result.append("    ");
+        ArrayList<ICSSPropertyValue> sources = fontFace.getSources();
+        for (ICSSPropertyValue src : sources)
+        {
+        	result.append("src: ");
+        	result.append(src.toString() + ";\n");
+        }
+       	result.append("}\n");
+        return result.toString();
+    }
+    
+    private String cssRuleToString(ICSSRule rule)
+    {
+        final StringBuilder result = new StringBuilder();
+
+        ImmutableList<ICSSMediaQueryCondition> mqList = rule.getMediaQueryConditions();
+        boolean hasMediaQuery = !mqList.isEmpty();
+        if (hasMediaQuery)
+        {
+            result.append("@media ");
+            result.append(Joiner.on(" and ").join(rule.getMediaQueryConditions()));
+            result.append(" {\n");
+            result.append("    ");
+        }
+
+        ImmutableList<ICSSSelector> selectors = rule.getSelectorGroup();
+        boolean firstOne = true;
+        for (ICSSSelector selector : selectors)
+        {
+        	String s = selector.toString();
+	        // add "." to type selectors that don't map cleanly
+	        // to CSS type selectors to convert them to class
+	    	// selectors.
+	        if (!s.startsWith(".") && !s.startsWith("*") && !s.startsWith("#"))
+	        {
+	        	String condition = null;
+        		int colon = s.indexOf(":");
+	        	if (colon != -1)
+	        	{
+	        		condition = s.substring(colon);
+	        		s = s.substring(0, colon);
+	        	}
+	        	if (!htmlElementNames.contains(s.toLowerCase()))
+	        	{
+	        		int pipe = s.indexOf("|");
+	        		if (pipe != -1)
+	        			s = s.substring(pipe + 1);
+	        		s = "." + s;
+	        	}
+	        	if (condition != null)
+	        		s = s + condition;
+	        }
+	        if (!firstOne)
+	        	result.append(",\n");
+	        result.append(s);
+        }
+
+        result.append(" {\n");
+        for (final ICSSProperty prop : rule.getProperties())
+        {
+            if (!hasMediaQuery)
+                result.append("    ");
+
+            String propString = ((CSSProperty)prop).toCSSString();
+            // skip class references since the won't work in CSS
+            if (propString.contains("ClassReference"))
+            	continue;
+            result.append("    ").append(propString).append("\n");
+        }
+        if (hasMediaQuery)
+            result.append("    }\n");
+
+        result.append("}\n");
+
+        return result.toString();
+    }
+    
+    private void walkCSS(ICSSDocument css, StringBuilder sb)
+    {
+    	for (CSSFontFace fontFace : fontFaces)
+    	{
+    		sb.append(fontFaceToString(fontFace));
+    	}
+    	if (fontFaces.size() > 0)
+    		sb.append("\n\n");
+        ImmutableList<ICSSRule> rules = css.getRules();
+        for (ICSSRule rule : rules)
+        {
+        	String s = cssRuleToString(rule);
+        	if (s.startsWith("@media -flex-flash"))
+        		continue;
+        	if (s.startsWith(".global {"))
+        		s = s.replace(".global {", "* {");
+            sb.append(s);
+            sb.append("\n\n");
+        }
+    }
+    
+    private void encodeCSS(ICSSDocument css, StringBuilder sb)
+    {
+        ImmutableList<ICSSRule> rules = css.getRules();
+        boolean skipcomma = true;
+        for (ICSSRule rule : rules)
+        {
+            String s = encodeRule(rule);
+            if (s != null)
+            {
+                if (skipcomma)
+                    skipcomma = false;
+                else
+                    sb.append(",\n");
+                sb.append(s);
+            }
+        }
+    }
+    
+    List<String> htmlElementNames = Arrays.asList(
+    		"body",
+    		"button",
+    		"span"
+    );
+    
+    private String encodeRule(ICSSRule rule)
+    {
+        final StringBuilder result = new StringBuilder();
+
+        ImmutableList<ICSSMediaQueryCondition> mqlist = rule.getMediaQueryConditions();
+        int n = mqlist.size();
+        if (n > 0)
+        {
+            if (mqlist.get(0).toString().equals("-flex-flash"))
+                return null;
+            
+            result.append(n);
+            
+            for (ICSSMediaQueryCondition mqcond : mqlist)
+            {
+                result.append(",\n");
+                result.append("\"" + mqcond.toString() + "\"");
+            }
+        }
+        else
+            result.append(n);
+
+        result.append(",\n");
+
+        ImmutableList<ICSSSelector> slist = rule.getSelectorGroup();
+        result.append(slist.size());
+
+        for (ICSSSelector sel : slist)
+        {
+            result.append(",\n");
+            String selName = this.resolvedSelectors.get(sel);
+            if (selName == null || selName.equals("null"))
+                result.append("\"" + sel.toString() + "\"");
+            else
+            {
+            	selName = formatQualifiedName(selName);
+                ImmutableList<ICSSSelectorCondition> conds = sel.getConditions();
+                for (ICSSSelectorCondition cond : conds)
+                    selName += cond.toString();
+                result.append("\"" + selName + "\"");
+            }
+        }
+        result.append(",\n");
+        
+        ImmutableList<ICSSProperty> plist = rule.getProperties();
+        result.append(plist.size());
+        
+        for (final ICSSProperty prop : plist)
+        {
+            result.append(",\n");
+            result.append("\"" + prop.getName() + "\"");
+            result.append(",\n");
+            ICSSPropertyValue value = prop.getValue();
+            if (value instanceof CSSArrayPropertyValue)
+            {
+                ImmutableList<? extends ICSSPropertyValue> values = ((CSSArrayPropertyValue)value).getElements();
+                result.append("[");
+                boolean firstone = true;
+                for (ICSSPropertyValue val : values)
+                {
+                    if (firstone)
+                        firstone = false;
+                    else
+                        result.append(", ");
+                    if (val instanceof CSSStringPropertyValue)
+                    {
+                        result.append("\"" + ((CSSStringPropertyValue)val).getValue() + "\"");
+                    }
+                    else if (val instanceof CSSColorPropertyValue)
+                    {
+                        result.append(new Integer(((CSSColorPropertyValue)val).getColorAsInt()));
+                    }
+                    else if (val instanceof CSSRgbColorPropertyValue)
+                    {
+                        result.append(new Integer(((CSSRgbColorPropertyValue)val).getColorAsInt()));
+                    }
+                    else if (val instanceof CSSKeywordPropertyValue)
+                    {
+                        CSSKeywordPropertyValue keywordValue = (CSSKeywordPropertyValue)val;
+                        String keywordString = keywordValue.getKeyword();
+                        if (IASLanguageConstants.TRUE.equals(keywordString))
+                            result.append("true");
+                        else if (IASLanguageConstants.FALSE.equals(keywordString))
+                            result.append("false");
+                        else
+                            result.append("\"" + ((CSSKeywordPropertyValue)val).getKeyword() + "\"");
+                    }
+                    else if (val instanceof CSSNumberPropertyValue)
+                    {
+                        result.append(new Double(((CSSNumberPropertyValue)val).getNumber().doubleValue()));
+                    }
+                    else
+                    {
+                        result.append("unexpected value type: " + val.toString());
+                    }
+                }
+                result.append("]");
+            }
+            else if (value instanceof CSSStringPropertyValue)
+            {
+                result.append("\"" + ((CSSStringPropertyValue)value).getValue() + "\"");
+            }
+            else if (value instanceof CSSColorPropertyValue)
+            {
+                result.append(new Integer(((CSSColorPropertyValue)value).getColorAsInt()));
+            }
+            else if (value instanceof CSSRgbColorPropertyValue)
+            {
+                result.append(new Integer(((CSSRgbColorPropertyValue)value).getColorAsInt()));
+            }
+            else if (value instanceof CSSKeywordPropertyValue)
+            {
+                CSSKeywordPropertyValue keywordValue = (CSSKeywordPropertyValue)value;
+                String keywordString = keywordValue.getKeyword();
+                if (IASLanguageConstants.TRUE.equals(keywordString))
+                    result.append("true");
+                else if (IASLanguageConstants.FALSE.equals(keywordString))
+                    result.append("false");
+                else
+                    result.append("\"" + ((CSSKeywordPropertyValue)value).getKeyword() + "\"");
+            }
+            else if (value instanceof CSSNumberPropertyValue)
+            {
+                result.append(new Double(((CSSNumberPropertyValue)value).getNumber().doubleValue()));
+            }
+            else if (value instanceof CSSFunctionCallPropertyValue)
+            {
+                final CSSFunctionCallPropertyValue functionCall = (CSSFunctionCallPropertyValue)value;
+                if ("ClassReference".equals(functionCall.name))
+                {
+                    final String className = CSSFunctionCallPropertyValue.getSingleArgumentFromRaw(functionCall.rawArguments);
+                    if ("null".equals(className))
+                    {
+                        // ClassReference(null) resets the property's class reference.
+                        result.append("null");
+                    }
+                    else
+                    {
+                        result.append(formatQualifiedName(className));
+                        requires.add(className);
+                    }
+                }
+                else if ("url".equals(functionCall.name))
+                {
+                    final String urlString = CSSFunctionCallPropertyValue.getSingleArgumentFromRaw(functionCall.rawArguments);
+                    result.append("\"" + urlString + "\"");
+                }
+                else if ("PropertyReference".equals(functionCall.name))
+                {
+                    // TODO: implement me
+                }
+                else if ("Embed".equals(functionCall.name))
+                {
+                    // TODO: implement me
+                    /*
+                    final ICompilerProblem e = new CSSCodeGenProblem(
+                            new IllegalStateException("Unable to find compilation unit for " + functionCall));
+                    problems.add(e);
+                    */
+                }
+                else
+                {
+                    assert false : "CSS parser bug: unexpected function call property value: " + functionCall;
+                    throw new IllegalStateException("Unexpected function call property value: " + functionCall);
+                }
+            }
+        }
+
+        return result.toString();
+
+    }
+    
+    @Override
+    protected boolean keepRule(ICSSRule newRule)
+    {
+    	if (super.keepRule(newRule))
+    		return true;
+    	
+    	// include all rules not found in defaults.css
+    	// theoretically, defaults.css rules were
+    	// properly added in the super call.
+    	String sp = newRule.getSourcePath();
+    	if (!sp.contains("defaults.css"))
+    		return true;
+    	
+        return false;
+    }
+
+    private String formatQualifiedName(String name)
+    {
+    	/*
+    	if (name.contains("goog.") || name.startsWith("Vector."))
+    		return name;
+    	if (name.startsWith("."))
+    	{
+    		return "." + name.substring(1).replaceAll("\\.", "_");
+    	}
+    	name = name.replaceAll("\\.", "_");
+    	*/
+    	return name;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/goog/GoogBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/goog/GoogBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/goog/GoogBackend.java
new file mode 100644
index 0000000..af8129a
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/goog/GoogBackend.java
@@ -0,0 +1,73 @@
+/*
+ *
+ *  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.internal.driver.js.goog;
+
+import java.io.FilterWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitter;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogPublisher;
+import org.apache.flex.compiler.internal.driver.js.JSBackend;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+
+/**
+ * A concrete implementation of the {@link IBackend} API for the 'goog' code
+ * production.
+ * 
+ * @author Michael Schmalle
+ */
+public class GoogBackend extends JSBackend
+{
+
+    @Override
+    public Configurator createConfigurator()
+    {
+        return new Configurator(JSGoogConfiguration.class);
+    }
+
+    @Override
+    public IDocEmitter createDocEmitter(IASEmitter emitter)
+    {
+        return new JSGoogDocEmitter((IJSEmitter) emitter);
+    }
+
+    @Override
+    public IJSEmitter createEmitter(FilterWriter out)
+    {
+        IJSEmitter emitter = new JSGoogEmitter(out);
+        emitter.setDocEmitter(createDocEmitter(emitter));
+        return emitter;
+    }
+
+    @Override
+    public JSGoogPublisher createPublisher(IASProject project,
+            List<ICompilerProblem> errors, Configuration config)
+    {
+        return new JSGoogPublisher(config);
+    }
+}


[34/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitterTokens.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitterTokens.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitterTokens.java
new file mode 100644
index 0000000..88a1163
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitterTokens.java
@@ -0,0 +1,42 @@
+/*
+ *
+ *  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.internal.codegen.mxml.flexjs;
+
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+
+/**
+ * @author Erik de Bruin
+ */
+public enum MXMLFlexJSEmitterTokens implements IEmitterTokens
+{
+    EVENT_PREFIX("$EH"), ID_PREFIX("$ID"), BINDING_PREFIX("$BID");
+
+    private String token;
+
+    private MXMLFlexJSEmitterTokens(String value)
+    {
+        token = value;
+    }
+
+    public String getToken()
+    {
+        return token;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
new file mode 100644
index 0000000..5f5387c
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
@@ -0,0 +1,656 @@
+/*
+ *
+ *  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.internal.codegen.mxml.flexjs;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.filefilter.DirectoryFileFilter;
+import org.apache.commons.io.filefilter.FileFileFilter;
+import org.apache.commons.io.filefilter.FileFilterUtils;
+import org.apache.commons.io.filefilter.IOFileFilter;
+import org.apache.commons.io.filefilter.RegexFileFilter;
+import org.apache.flex.compiler.clients.problems.ProblemQuery;
+import org.apache.flex.compiler.codegen.js.IJSPublisher;
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.css.ICSSPropertyValue;
+import org.apache.flex.compiler.internal.codegen.js.JSSharedData;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogPublisher;
+import org.apache.flex.compiler.internal.css.CSSArrayPropertyValue;
+import org.apache.flex.compiler.internal.css.CSSFontFace;
+import org.apache.flex.compiler.internal.css.CSSFunctionCallPropertyValue;
+import org.apache.flex.compiler.internal.driver.js.flexjs.JSCSSCompilationSession;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.graph.GoogDepsWriter;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.utils.JSClosureCompilerWrapper;
+import org.apache.flex.swc.ISWC;
+import org.apache.flex.swc.ISWCFileEntry;
+
+public class MXMLFlexJSPublisher extends JSGoogPublisher implements IJSPublisher
+{
+
+    public static final String FLEXJS_OUTPUT_DIR_NAME = "bin";
+    public static final String FLEXJS_INTERMEDIATE_DIR_NAME = "js-debug";
+    public static final String FLEXJS_RELEASE_DIR_NAME = "js-release";
+
+    private static final String FLEXJS_EXTERNS = "externs";
+
+    class DependencyRecord
+    {
+        String path;
+        String deps;
+        String line;
+        int lineNumber;
+    }
+
+    class DependencyLineComparator implements Comparator<DependencyRecord>
+    {
+        @Override
+        public int compare(DependencyRecord o1, DependencyRecord o2)
+        {
+            return new Integer(o1.lineNumber).compareTo(o2.lineNumber);
+        }
+    }
+
+    public MXMLFlexJSPublisher(Configuration config, FlexJSProject project)
+    {
+        super(config);
+
+        this.isMarmotinniRun = ((JSGoogConfiguration) configuration).getMarmotinni() != null;
+        this.outputPathParameter = configuration.getOutput();
+        this.useStrictPublishing = ((JSGoogConfiguration) configuration).getStrictPublish();
+
+        this.project = project;
+    }
+
+    private FlexJSProject project;
+
+    private boolean isMarmotinniRun;
+    private String outputPathParameter;
+    private boolean useStrictPublishing;
+    private String closureLibDirPath;
+
+    @Override
+    public File getOutputFolder()
+    {
+        // (erikdebruin) - If there is a -marmotinni switch, we want
+        // the output redirected to the directory it specifies.
+        // - If there is an -output switch, use that path as the
+        // output parent folder.
+        if (isMarmotinniRun)
+        {
+            outputParentFolder = new File(((JSGoogConfiguration) configuration).getMarmotinni());
+        }
+        else if (outputPathParameter != null)
+        {
+            outputParentFolder = new File(outputPathParameter);
+            // FB usually specified -output <project-path>/bin-release/app.swf
+            if (outputPathParameter.contains(".swf"))
+                outputParentFolder = outputParentFolder.getParentFile().getParentFile();
+        }
+        else
+        {
+            outputParentFolder = new File(configuration.getTargetFileDirectory()).getParentFile();
+        }
+
+        outputParentFolder = new File(outputParentFolder, FLEXJS_OUTPUT_DIR_NAME);
+
+        outputFolder = new File(outputParentFolder, File.separator + FLEXJS_INTERMEDIATE_DIR_NAME);
+
+        // (erikdebruin) Marmotinni handles file management, so we
+        // bypass the setup.
+        if (!isMarmotinniRun)
+            setupOutputFolder();
+
+        return outputFolder;
+    }
+
+    @Override
+    public boolean publish(ProblemQuery problems) throws IOException
+    {
+        @SuppressWarnings("unused")
+        boolean ok;
+        // boolean subsetGoog = true;
+
+        final String intermediateDirPath = outputFolder.getPath();
+        final File intermediateDir = new File(intermediateDirPath);
+        File srcDir = new File(configuration.getTargetFile());
+        srcDir = srcDir.getAbsoluteFile();
+        srcDir = srcDir.getParentFile();
+
+        final String projectName = FilenameUtils.getBaseName(configuration.getTargetFile());
+        final String outputFileName = projectName + "." + JSSharedData.OUTPUT_EXTENSION;
+
+        File releaseDir = new File(outputParentFolder, FLEXJS_RELEASE_DIR_NAME);
+        final String releaseDirPath = releaseDir.getPath();
+
+        if (!isMarmotinniRun)
+        {
+            if (releaseDir.exists())
+            {
+                org.apache.commons.io.FileUtils.deleteQuietly(releaseDir);
+            }
+
+            if (!releaseDir.mkdirs())
+            {
+                throw new IOException("Unable to create release directory at " + releaseDir.getAbsolutePath());
+            }
+        }
+
+        // If the closure-lib parameter is empty we'll try to find the resources
+        // in the classpath, dump its content to the output directory and use
+        // this
+        // as closure-lib parameter.
+        if (((JSGoogConfiguration) configuration).isClosureLibSet())
+        {
+            closureLibDirPath = ((JSGoogConfiguration) configuration).getClosureLib();
+        }
+        else
+        {
+            // Check if the "goog/deps.js" is available in the classpath.
+            URL resource = Thread.currentThread().getContextClassLoader().getResource("goog/deps.js");
+            if (resource != null)
+            {
+                File closureLibDir = new File(intermediateDir.getParent(), "closure");
+
+                // Only create and dump the content, if the directory does not
+                // exists.
+                if (!closureLibDir.exists())
+                {
+                    if (!closureLibDir.mkdirs())
+                    {
+                        throw new IOException("Unable to create directory for closure-lib at "
+                                + closureLibDir.getAbsolutePath());
+                    }
+
+                    // Strip the url of the parts we don't need.
+                    // Unless we are not using some insanely complex setup
+                    // the resource will always be on the same machine.
+                    String resourceJarPath = resource.getFile();
+                    if (resourceJarPath.contains(":"))
+                    {
+                        resourceJarPath = resourceJarPath.substring(resourceJarPath.lastIndexOf(":") + 1);
+                    }
+                    if (resourceJarPath.contains("!"))
+                    {
+                        resourceJarPath = resourceJarPath.substring(0, resourceJarPath.indexOf("!"));
+                    }
+                    File resourceJar = new File(resourceJarPath);
+
+                    // Dump the closure lib from classpath.
+                    dumpJar(resourceJar, closureLibDir);
+                }
+                // The compiler automatically adds a "closure" to the lib dir
+                // path,
+                // so we omit this here.
+                closureLibDirPath = intermediateDir.getParentFile().getPath();
+            }
+            // Fallback to the default.
+            else
+            {
+                closureLibDirPath = ((JSGoogConfiguration) configuration).getClosureLib();
+            }
+        }
+
+        // Dump FlexJS to the target directory.
+        @SuppressWarnings("unused")
+        String flexJsLibDirPath;
+        // Check if the "FlexJS/src/createjs_externals.js" is available in the
+        // classpath.
+        URL resource = Thread.currentThread().getContextClassLoader().getResource("FlexJS/src/createjs_externals.js");
+        if (resource != null)
+        {
+            File flexJsLibDir = new File(intermediateDir.getParent(), "flexjs");
+
+            // Only create and dump the content, if the directory does not
+            // exists.
+            if (!flexJsLibDir.exists())
+            {
+                if (!flexJsLibDir.mkdirs())
+                {
+                    throw new IOException("Unable to create directory for flexjs-lib at "
+                            + flexJsLibDir.getAbsolutePath());
+                }
+
+                // Strip the url of the parts we don't need.
+                // Unless we are not using some insanely complex setup
+                // the resource will always be on the same machine.
+                String resourceJarPath = resource.getFile();
+                if (resourceJarPath.contains(":"))
+                {
+                    resourceJarPath = resourceJarPath.substring(resourceJarPath.lastIndexOf(":") + 1);
+                }
+                if (resourceJarPath.contains("!"))
+                {
+                    resourceJarPath = resourceJarPath.substring(0, resourceJarPath.indexOf("!"));
+                }
+                File resourceJar = new File(resourceJarPath);
+
+                // Dump the closure lib from classpath.
+                dumpJar(resourceJar, flexJsLibDir);
+            }
+            // The compiler automatically adds a "closure" to the lib dir path,
+            // so we omit this here.
+            flexJsLibDirPath = intermediateDir.getParentFile().getPath();
+        }
+
+        final String closureGoogSrcLibDirPath = closureLibDirPath + "/closure/goog/";
+        final String closureGoogTgtLibDirPath = intermediateDirPath + "/library/closure/goog";
+        // final String depsSrcFilePath = intermediateDirPath
+        // + "/library/closure/goog/deps.js";
+        @SuppressWarnings("unused")
+        final String depsTgtFilePath = intermediateDirPath + "/deps.js";
+        final String projectIntermediateJSFilePath = intermediateDirPath + File.separator + outputFileName;
+        final String projectReleaseJSFilePath = releaseDirPath + File.separator + outputFileName;
+
+        appendExportSymbol(projectIntermediateJSFilePath, projectName);
+        appendEncodedCSS(projectIntermediateJSFilePath, projectName);
+
+        // if (!subsetGoog)
+        // {
+        // (erikdebruin) We need to leave the 'goog' files and dependencies well
+        // enough alone. We copy the entire library over so the
+        // 'goog' dependencies will resolve without our help.
+        FileUtils.copyDirectory(new File(closureGoogSrcLibDirPath), new File(closureGoogTgtLibDirPath));
+        // }
+
+        JSClosureCompilerWrapper compilerWrapper = new JSClosureCompilerWrapper(((JSGoogConfiguration) configuration).getJSCompilerOptions());
+
+        List<ISWC> swcs = project.getLibraries();
+
+        // (erikdebruin) We don't want to forget that we need to tell the GCC
+        //               about them fancy externs we've been working so hard on
+        for (ISWC swc : swcs)
+        {
+        	Map<String, ISWCFileEntry> files = swc.getFiles();
+        	for (String key : files.keySet())
+        	{
+        		if (key.startsWith(FLEXJS_EXTERNS))
+        		{
+                    ISWCFileEntry fileEntry = swc.getFile(key);
+                    if (fileEntry != null)
+                    {
+                        File destFile = new File(intermediateDirPath + File.separator + key);
+                        InputStream inStream = fileEntry.createInputStream();
+                        OutputStream outStream = FileUtils.openOutputStream(destFile);
+                        byte[] b = new byte[1024 * 1024];
+                        int bytes_read;
+                        while ((bytes_read = inStream.read(b)) != -1)
+                        {
+                            outStream.write(b, 0, bytes_read);
+                        }
+                        outStream.flush();
+                        outStream.close();
+                        inStream.close();
+
+                        String destPath = destFile.getAbsolutePath();
+
+                        System.out.println("using extern: " + destPath);
+
+                        compilerWrapper.addJSExternsFile(destPath);
+                    }
+        		}
+        	}
+        }
+
+        GoogDepsWriter gdw = new GoogDepsWriter(intermediateDir, projectName, (JSGoogConfiguration) configuration, swcs);
+        StringBuilder depsFileData = new StringBuilder();
+        try
+        {
+            ArrayList<String> fileList = gdw.getListOfFiles(problems);
+            for (String file : fileList)
+            {
+                compilerWrapper.addJSSourceFile(file);
+            }
+            ok = gdw.generateDeps(problems, depsFileData);
+            /*
+             * if (!subsetGoog) { writeFile(depsTgtFilePath,
+             * depsFileData.toString(), false); } else { String s =
+             * depsFileData.toString(); int c = s.indexOf("'goog.");
+             * ArrayList<String> googreqs = new ArrayList<String>(); while (c !=
+             * -1) { int c2 = s.indexOf("'", c + 1); String googreq =
+             * s.substring(c, c2 + 1); googreqs.add(googreq); c =
+             * s.indexOf("'goog.", c2); } HashMap<String, DependencyRecord>
+             * defmap = new HashMap<String, DependencyRecord>(); // read in
+             * goog's deps.js FileInputStream fis = new
+             * FileInputStream(closureGoogSrcLibDirPath + "/deps.js"); Scanner
+             * scanner = new Scanner(fis, "UTF-8"); String addDependency =
+             * "goog.addDependency('"; int currentLine = 0; while
+             * (scanner.hasNextLine()) { String googline = scanner.nextLine();
+             * if (googline.indexOf(addDependency) == 0) { int c1 =
+             * googline.indexOf("'", addDependency.length() + 1); String
+             * googpath = googline.substring(addDependency.length(), c1); String
+             * googdefs = googline.substring(googline.indexOf("[") + 1,
+             * googline.indexOf("]")); String googdeps =
+             * googline.substring(googline.lastIndexOf("[") + 1,
+             * googline.lastIndexOf("]")); String[] thedefs =
+             * googdefs.split(","); DependencyRecord deprec = new
+             * DependencyRecord(); deprec.path = googpath; deprec.deps =
+             * googdeps; deprec.line = googline; deprec.lineNumber =
+             * currentLine; for (String def : thedefs) { def = def.trim();
+             * defmap.put(def, deprec); } } currentLine++; } // (erikdebruin)
+             * Prevent 'Resource leak' warning on line 212: scanner.close();
+             * ArrayList<DependencyRecord> subsetdeps = new
+             * ArrayList<DependencyRecord>(); HashMap<String, String> gotgoog =
+             * new HashMap<String, String>(); for (String req : googreqs) {
+             * DependencyRecord deprec = defmap.get(req); // if we've already
+             * processed this file, skip if (!gotgoog.containsKey(deprec.path))
+             * { gotgoog.put(deprec.path, null); subsetdeps.add(deprec);
+             * addDeps(subsetdeps, gotgoog, defmap, deprec.deps); } } // now we
+             * should have the subset of files we need in the order needed
+             * StringBuilder sb = new StringBuilder();
+             * sb.append("goog.addDependency('base.js', ['goog'], []);\n"); File
+             * file = new File(closureGoogSrcLibDirPath + "/base.js");
+             * FileUtils.copyFileToDirectory(file, new
+             * File(closureGoogTgtLibDirPath));
+             * compilerWrapper.addJSSourceFile(file.getCanonicalPath());
+             * Collections.sort(subsetdeps, new DependencyLineComparator()); for
+             * (DependencyRecord subsetdeprec : subsetdeps) {
+             * sb.append(subsetdeprec.line).append("\n"); }
+             * writeFile(depsTgtFilePath, sb.toString() +
+             * depsFileData.toString(), false); // copy the required files for
+             * (String googfn : gotgoog.keySet()) { file = new
+             * File(closureGoogSrcLibDirPath + File.separator + googfn); String
+             * dir = closureGoogTgtLibDirPath; if (googfn.contains("/")) { dir
+             * += File.separator + googfn.substring(0, googfn.lastIndexOf("/"));
+             * } FileUtils.copyFileToDirectory(file, new File(dir));
+             * compilerWrapper.addJSSourceFile(file.getCanonicalPath()); } }
+             */
+        }
+        catch (InterruptedException e)
+        {
+            e.printStackTrace();
+            return false;
+        }
+
+        IOFileFilter pngSuffixFilter = FileFilterUtils.and(FileFileFilter.FILE,
+                FileFilterUtils.suffixFileFilter(".png"));
+        IOFileFilter gifSuffixFilter = FileFilterUtils.and(FileFileFilter.FILE,
+                FileFilterUtils.suffixFileFilter(".gif"));
+        IOFileFilter jpgSuffixFilter = FileFilterUtils.and(FileFileFilter.FILE,
+                FileFilterUtils.suffixFileFilter(".jpg"));
+        IOFileFilter jsonSuffixFilter = FileFilterUtils.and(FileFileFilter.FILE,
+                FileFilterUtils.suffixFileFilter(".json"));
+        IOFileFilter assetFiles = FileFilterUtils.or(pngSuffixFilter, jpgSuffixFilter, gifSuffixFilter,
+                jsonSuffixFilter);
+        IOFileFilter subdirs = FileFilterUtils.or(DirectoryFileFilter.DIRECTORY, assetFiles);
+
+        FileUtils.copyDirectory(srcDir, intermediateDir, subdirs);
+        FileUtils.copyDirectory(srcDir, releaseDir, subdirs);
+
+        // File srcDeps = new File(depsSrcFilePath);
+
+        writeHTML("intermediate", projectName, intermediateDirPath, depsFileData.toString(), gdw.additionalHTML);
+        writeHTML("release", projectName, releaseDirPath, null, gdw.additionalHTML);
+        if (project.needCSS)
+        {
+            writeCSS(projectName, intermediateDirPath);
+            writeCSS(projectName, releaseDirPath);
+        }
+
+        /*
+         * if (!subsetGoog) { // (erikdebruin) add 'goog' files Collection<File>
+         * files = org.apache.commons.io.FileUtils.listFiles(new File(
+         * closureGoogTgtLibDirPath), new RegexFileFilter("^.*(\\.js)"),
+         * DirectoryFileFilter.DIRECTORY); for (File file : files) {
+         * compilerWrapper.addJSSourceFile(file.getCanonicalPath()); } }
+         */
+        Collection<File> files = org.apache.commons.io.FileUtils.listFiles(new File(closureGoogSrcLibDirPath),
+                new RegexFileFilter("^.*(\\.js)"), DirectoryFileFilter.DIRECTORY);
+        for (File file : files)
+        {
+            compilerWrapper.addJSSourceFile(file.getCanonicalPath());
+        }
+
+        /*
+         * // (erikdebruin) add project files for (String filePath :
+         * gdw.filePathsInOrder) { compilerWrapper.addJSSourceFile( new
+         * File(filePath).getCanonicalPath()); }
+         */
+
+        compilerWrapper.setOptions(projectReleaseJSFilePath, useStrictPublishing, projectName);
+
+        /*
+         * // (erikdebruin) Include the 'goog' deps to allow the compiler to
+         * resolve // dependencies. compilerWrapper.addJSSourceFile(
+         * closureGoogSrcLibDirPath + File.separator + "deps.js");
+         */
+        List<String> externs = ((JSGoogConfiguration) configuration).getExternalJSLib();
+        for (String extern : externs)
+        {
+            compilerWrapper.addJSExternsFile(extern);
+        }
+
+        compilerWrapper.targetFilePath = projectReleaseJSFilePath;
+        compilerWrapper.compile();
+
+        appendSourceMapLocation(projectReleaseJSFilePath, projectName);
+
+        /*
+         * if (!isMarmotinniRun) { String allDeps = ""; if (!subsetGoog) {
+         * allDeps += FileUtils.readFileToString(srcDeps); } allDeps +=
+         * FileUtils.readFileToString(new File(depsTgtFilePath));
+         * 
+         * FileUtils.writeStringToFile(srcDeps, allDeps);
+         * 
+         * org.apache.commons.io.FileUtils.deleteQuietly(new
+         * File(depsTgtFilePath)); }
+         */
+
+        // if (ok)
+        System.out.println("The project '" + projectName + "' has been successfully compiled and optimized.");
+
+        return true;
+    }
+
+    /*
+     * private void addDeps(ArrayList<DependencyRecord> subsetdeps,
+     * HashMap<String, String> gotgoog, HashMap<String, DependencyRecord>
+     * defmap, String deps) { if (deps.length() == 0) { return; }
+     * 
+     * String[] deplist = deps.split(","); for (String dep : deplist) { dep =
+     * dep.trim(); DependencyRecord deprec = defmap.get(dep); if
+     * (!gotgoog.containsKey(deprec.path)) { gotgoog.put(deprec.path, null); //
+     * put addDependencyLine in subset file subsetdeps.add(deprec);
+     * addDeps(subsetdeps, gotgoog, defmap, deprec.deps); } } }
+     */
+
+    private void appendExportSymbol(String path, String projectName) throws IOException
+    {
+    	//every file should already have exportsymbol
+        //writeFile(path, "\n\n// Ensures the symbol will be visible after compiler renaming.\n" + "goog.exportSymbol('"
+        //        + projectName + "', " + projectName + ");\n", true);
+    }
+
+    private void appendEncodedCSS(String path, String projectName) throws IOException
+    {
+        if (!project.needCSS)
+            return;
+
+        StringBuilder appendString = new StringBuilder();
+        appendString.append("\n\n");
+        appendString.append(projectName);
+        appendString.append(".prototype.cssData = [");
+        JSCSSCompilationSession cssSession = (JSCSSCompilationSession) project.getCSSCompilationSession();
+        String s = cssSession.getEncodedCSS();
+        int reqidx = s.indexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+        if (reqidx != -1)
+        {
+            String reqs = s.substring(reqidx);
+            s = s.substring(0, reqidx - 1);
+            String fileData = readCode(new File(path));
+            reqidx = fileData.indexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+            String after = fileData.substring(reqidx);
+            String before = fileData.substring(0, reqidx - 1);
+            s = before + reqs + after + appendString.toString() + s;
+            writeFile(path, s, false);
+        }
+        else
+        {
+            appendString.append(s);
+            writeFile(path, appendString.toString(), true);
+        }
+    }
+
+    protected String readCode(File file)
+    {
+        String code = "";
+        try
+        {
+            BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF8"));
+
+            String line = in.readLine();
+
+            while (line != null)
+            {
+                code += line + "\n";
+                line = in.readLine();
+            }
+            code = code.substring(0, code.length() - 1);
+
+            in.close();
+        }
+        catch (Exception e)
+        {
+            // nothing to see, move along...
+        }
+
+        return code;
+    }
+
+    protected void writeHTML(String type, String projectName, String dirPath, String deps, List<String> additionalHTML)
+            throws IOException
+    {
+        StringBuilder htmlFile = new StringBuilder();
+        htmlFile.append("<!DOCTYPE html>\n");
+        htmlFile.append("<html>\n");
+        htmlFile.append("<head>\n");
+        htmlFile.append("\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n");
+        htmlFile.append("\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n");
+        htmlFile.append("\t<link rel=\"stylesheet\" type=\"text/css\" href=\"").append(projectName).append(".css\">\n");
+
+        for (String s : additionalHTML)
+            htmlFile.append(s).append("\n");
+
+        if ("intermediate".equals(type))
+        {
+            htmlFile.append("\t<script type=\"text/javascript\" src=\"./library/closure/goog/base.js\"></script>\n");
+            htmlFile.append("\t<script type=\"text/javascript\">\n");
+            htmlFile.append(deps);
+            htmlFile.append("\t\tgoog.require(\"");
+            htmlFile.append(projectName);
+            htmlFile.append("\");\n");
+            htmlFile.append("\t</script>\n");
+        }
+        else
+        {
+            htmlFile.append("\t<script type=\"text/javascript\" src=\"./");
+            htmlFile.append(projectName);
+            htmlFile.append(".js\"></script>\n");
+        }
+
+        htmlFile.append("</head>\n");
+        htmlFile.append("<body>\n");
+        htmlFile.append("\t<script type=\"text/javascript\">\n");
+        htmlFile.append("\t\tnew ");
+        htmlFile.append(projectName);
+        htmlFile.append("()");
+        htmlFile.append(".start();\n");
+        htmlFile.append("\t</script>\n");
+        htmlFile.append("</body>\n");
+        htmlFile.append("</html>");
+
+        writeFile(dirPath + File.separator + "index.html", htmlFile.toString(), false);
+    }
+
+    private void writeCSS(String projectName, String dirPath) throws IOException
+    {
+        JSCSSCompilationSession cssSession = (JSCSSCompilationSession) project.getCSSCompilationSession();
+        writeFile(dirPath + File.separator + projectName + ".css", cssSession.emitCSS(), false);
+        for (CSSFontFace fontFace : cssSession.fontFaces)
+        {
+        	// check frameworks/fonts folder
+        	String configdir = ((JSGoogConfiguration) configuration).getLoadConfig();
+        	File dir = new File(configdir);
+        	dir = dir.getParentFile();
+        	for (ICSSPropertyValue prop : fontFace.getSources())
+        	{
+        		if (prop instanceof CSSArrayPropertyValue)
+        		{
+        			for (ICSSPropertyValue value : ((CSSArrayPropertyValue)prop).getElements())
+        			{
+        				CSSFunctionCallPropertyValue fn = (CSSFunctionCallPropertyValue)value;
+        				String fontPath = fn.rawArguments;
+        				if (fontPath.startsWith("'"))
+        					fontPath = fontPath.substring(1, fontPath.length() - 1);
+        				if (fontPath.startsWith("\""))
+        					fontPath = fontPath.substring(1, fontPath.length() - 1);
+        				int c = fontPath.indexOf("?");
+        				if (c != -1)
+        					fontPath = fontPath.substring(0, c);
+        				File fontFile = new File(dir.getAbsolutePath() + File.separator + fontPath);
+        				File destFile = new File(dirPath + File.separator + fontPath);
+        				if (fontFile.exists())
+        				{
+        					if (!destFile.exists())
+        						FileUtils.copyFile(fontFile, destFile);
+        				}
+        			}
+        		}
+        		else
+        		{
+        	        if (prop instanceof CSSFunctionCallPropertyValue)
+        	        {
+        				CSSFunctionCallPropertyValue fn = (CSSFunctionCallPropertyValue)prop;
+        				String fontPath = fn.rawArguments;
+        				if (fontPath.startsWith("'"))
+        					fontPath = fontPath.substring(1, fontPath.length() - 1);
+        				if (fontPath.startsWith("\""))
+        					fontPath = fontPath.substring(1, fontPath.length() - 1);
+        				int c = fontPath.indexOf("?");
+        				if (c != -1)
+        					fontPath = fontPath.substring(0, c);
+        				File fontFile = new File(dir.getAbsolutePath() + File.separator + fontPath);
+        				File destFile = new File(dirPath + File.separator + fontPath);
+        				if (fontFile.exists())
+        				{
+        					if (!destFile.exists())
+        						FileUtils.copyFile(fontFile, destFile);
+        				}
+        	        }
+        		}
+        	}
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLNodeSpecifier.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLNodeSpecifier.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLNodeSpecifier.java
new file mode 100644
index 0000000..12fb7f6
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLNodeSpecifier.java
@@ -0,0 +1,170 @@
+/*
+ *
+ *  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.internal.codegen.mxml.flexjs;
+
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+
+/**
+ * @author Erik de Bruin
+ */
+public class MXMLNodeSpecifier
+{
+
+    //--------------------------------------------------------------------------
+    //
+    //    Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    public MXMLNodeSpecifier()
+    {
+        sb = new StringBuilder();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //    Variables
+    //
+    //--------------------------------------------------------------------------
+
+    //---------------------------------
+    //    sb
+    //---------------------------------
+
+    protected StringBuilder sb;
+    
+    //--------------------------------------------------------------------------
+    //
+    //    Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //---------------------------------
+    //    name
+    //---------------------------------
+
+    public String name;
+
+    //---------------------------------
+    //    value
+    //---------------------------------
+
+    public String value;
+
+    //---------------------------------
+    //    valueNeedsQuotes
+    //---------------------------------
+
+    public boolean valueNeedsQuotes;
+
+    //--------------------------------------------------------------------------
+    //
+    //    Methods
+    //
+    //--------------------------------------------------------------------------
+
+    //---------------------------------
+    //    output
+    //---------------------------------
+
+    public String output(boolean writeNewline)
+    {
+        return "";
+    }
+
+    //---------------------------------
+    //    write
+    //---------------------------------
+
+    protected void write(IEmitterTokens value)
+    {
+        write(value.getToken());
+    }
+
+    protected void write(String value)
+    {
+        sb.append(value);
+    }
+
+    //---------------------------------
+    //    writeDelimiter
+    //---------------------------------
+
+    protected void writeDelimiter(boolean writeNewline)
+    {
+        if (writeNewline)
+            writeNewline(ASEmitterTokens.COMMA);
+        else
+            writeToken(ASEmitterTokens.COMMA);
+    }
+
+    //---------------------------------
+    //    writeNewline
+    //---------------------------------
+
+    protected void writeNewline(IEmitterTokens value)
+    {
+        writeNewline(value.getToken());
+    }
+
+    protected void writeNewline(String value)
+    {
+        write(value);
+        write(ASEmitterTokens.NEW_LINE);
+    }
+
+    //---------------------------------
+    //    writeSimpleDescriptor
+    //---------------------------------
+
+    protected void writeSimpleDescriptor(String name, String type, String value,
+            boolean writeNewline)
+    {
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(name);
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        writeDelimiter(writeNewline);
+
+        if (type != null)
+        {
+            write(type);
+            writeDelimiter(writeNewline);
+        }
+
+        write(value);
+    }
+
+    //---------------------------------
+    //    writeToken
+    //---------------------------------
+
+    protected void writeToken(IEmitterTokens value)
+    {
+        writeToken(value.getToken());
+    }
+
+    protected void writeToken(String value)
+    {
+        write(value);
+        write(ASEmitterTokens.SPACE);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLScriptSpecifier.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLScriptSpecifier.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLScriptSpecifier.java
new file mode 100644
index 0000000..c2f3824
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLScriptSpecifier.java
@@ -0,0 +1,67 @@
+/*
+ *
+ *  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.internal.codegen.mxml.flexjs;
+
+
+/**
+ * @author Erik de Bruin
+ */
+public class MXMLScriptSpecifier extends MXMLNodeSpecifier
+{
+
+    //--------------------------------------------------------------------------
+    //
+    //    Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    public MXMLScriptSpecifier()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //    Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //---------------------------------
+    //    fragment
+    //---------------------------------
+
+    public String fragment;
+
+    //--------------------------------------------------------------------------
+    //
+    //    Methods
+    //
+    //--------------------------------------------------------------------------
+
+    //---------------------------------
+    //    output
+    //---------------------------------
+
+    public String output()
+    {
+        return this.fragment;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/jsc/MXMLJSCJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/jsc/MXMLJSCJSEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/jsc/MXMLJSCJSEmitter.java
new file mode 100644
index 0000000..088ee62
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/jsc/MXMLJSCJSEmitter.java
@@ -0,0 +1,46 @@
+/*
+ *
+ *  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.internal.codegen.mxml.jsc;
+
+
+import java.io.FilterWriter;
+
+import org.apache.flex.compiler.codegen.mxml.flexjs.IMXMLFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSEmitter;
+
+/**
+ * @author Erik de Bruin
+ */
+public class MXMLJSCJSEmitter extends MXMLFlexJSEmitter implements
+        IMXMLFlexJSEmitter
+{
+
+	public MXMLJSCJSEmitter(FilterWriter out) {
+		super(out);
+		// TODO Auto-generated constructor stub
+	}
+
+	@Override
+	public String formatQualifiedName(String name)
+    {
+    	return name;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSDescriptorSpecifier.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSDescriptorSpecifier.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSDescriptorSpecifier.java
new file mode 100644
index 0000000..8fef083
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/vf2js/MXMLVF2JSDescriptorSpecifier.java
@@ -0,0 +1,337 @@
+/*
+ *
+ *  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.internal.codegen.mxml.vf2js;
+
+import java.util.ArrayList;
+
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLEventSpecifier;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLNodeSpecifier;
+
+/**
+ * @author Erik de Bruin
+ */
+public class MXMLVF2JSDescriptorSpecifier extends MXMLNodeSpecifier
+{
+
+    //--------------------------------------------------------------------------
+    //
+    //    Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    public MXMLVF2JSDescriptorSpecifier()
+    {
+        super();
+        
+        eventSpecifiers = new ArrayList<MXMLEventSpecifier>();
+        propertySpecifiers = new ArrayList<MXMLVF2JSDescriptorSpecifier>();
+
+        valueNeedsQuotes = false;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //    Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //---------------------------------
+    //    children
+    //---------------------------------
+
+    public MXMLVF2JSDescriptorSpecifier childrenSpecifier;
+
+    //---------------------------------
+    //    properties
+    //---------------------------------
+
+    public ArrayList<MXMLVF2JSDescriptorSpecifier> propertySpecifiers;
+
+    //---------------------------------
+    //    events
+    //---------------------------------
+
+    public ArrayList<MXMLEventSpecifier> eventSpecifiers;
+
+    //---------------------------------
+    //    hasArray
+    //---------------------------------
+
+    public boolean hasArray;
+
+    //---------------------------------
+    //    id
+    //---------------------------------
+
+    public String id;
+
+    //---------------------------------
+    //    isTopNode
+    //---------------------------------
+
+    public boolean isTopNode;
+
+    //---------------------------------
+    //    isProperty
+    //---------------------------------
+    
+    public boolean isProperty;
+    
+    //---------------------------------
+    //    parent
+    //---------------------------------
+
+    public MXMLVF2JSDescriptorSpecifier parent;
+
+    //--------------------------------------------------------------------------
+    //
+    //    Methods
+    //
+    //--------------------------------------------------------------------------
+
+    //---------------------------------
+    //    outputEventSpecifier
+    //---------------------------------
+
+	@SuppressWarnings("unused")
+    private void outputEventSpecifier(boolean writeNewline)
+    {
+        // number of events
+        int count = 0;
+        for (MXMLEventSpecifier me : eventSpecifiers)
+        {
+            if (me.name != null)
+                count++;
+        }
+        write(count + "");
+        
+        for (MXMLEventSpecifier me : eventSpecifiers)
+        {
+            writeDelimiter(writeNewline);
+            write(me.output(writeNewline));
+        }
+    }
+
+    //---------------------------------
+    //    outputPropertySpecifier
+    //---------------------------------
+
+    private String outputPropertySpecifier(boolean writeNewline)
+    {
+        /*
+        write((isProperty) ? ASEmitterTokens.SINGLE_QUOTE.getToken() : "");
+        write(name);
+        write((isProperty) ? ASEmitterTokens.SINGLE_QUOTE.getToken() : "");
+        */
+        //writeDelimiter(writeNewline);
+
+        if (isProperty)
+        {
+            if (value != null)
+            {
+                write(ASEmitterTokens.THIS);
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                write(parent.id);
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                writeToken(name);
+                writeToken(ASEmitterTokens.EQUAL);
+                write(value);
+                write(ASEmitterTokens.SEMICOLON);
+            }
+            else
+            {
+                //write((hasArray) ? ASEmitterTokens.NULL : ASEmitterTokens.FALSE);
+                //writeDelimiter(writeNewline && !hasArray);
+
+                //write(ASEmitterTokens.SQUARE_OPEN);
+                output(false);
+                //write(ASEmitterTokens.SQUARE_CLOSE);
+            }
+
+            if (parent != null)
+            {
+                //writeDelimiter(writeNewline);
+            }
+            
+            writeNewline("");
+        }
+        else
+        {
+            write(ASEmitterTokens.THIS);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            writeToken(id);
+            writeToken(ASEmitterTokens.EQUAL);
+            writeToken(ASEmitterTokens.NEW);
+            write(name);
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(ASEmitterTokens.PAREN_CLOSE);
+            write(ASEmitterTokens.SEMICOLON);
+            
+            for (MXMLVF2JSDescriptorSpecifier md : propertySpecifiers)
+            {
+                if (md.name != null && md.name.equals("mxmlContent"))
+                {
+                    childrenSpecifier = md;
+                    propertySpecifiers.remove(md);
+                    break;
+                }
+            }
+
+            /*
+            if (id != null)
+            {
+                write(propertySpecifiers.size() + 1 + "");
+                writeDelimiter(writeNewline);
+                String idPropName = (id
+                        .startsWith(MXMLFlexJSEmitterTokens.ID_PREFIX.getToken())) ? "_id"
+                        : "id";
+                writeSimpleDescriptor(idPropName, ASEmitterTokens.TRUE.getToken(),
+                        ASEmitterTokens.SINGLE_QUOTE.getToken()
+                                + id + ASEmitterTokens.SINGLE_QUOTE.getToken(),
+                        writeNewline);
+    
+                writeDelimiter(writeNewline);
+            }
+            else
+            {
+                write(propertySpecifiers.size() + "");
+                writeDelimiter(writeNewline);
+            }
+            */
+            writeNewline("");
+            
+            output(writeNewline);
+            
+            writeNewline("this." + id + ".render();");
+        }
+
+        return sb.toString();
+    }
+
+    //---------------------------------
+    //    outputStyleSpecifier
+    //---------------------------------
+
+	@SuppressWarnings("unused")
+    private void outputStyleSpecifier(boolean writeNewline)
+    {
+        // TODO (erikdebruin) not yet implemented in FlexJS
+
+        write("0");
+        writeDelimiter(writeNewline);
+    }
+
+    //---------------------------------
+    //    output
+    //---------------------------------
+
+    @Override
+    public String output(boolean writeNewline)
+    {
+        for (MXMLVF2JSDescriptorSpecifier md : propertySpecifiers)
+        {
+            write(md.outputPropertySpecifier(writeNewline));
+        }
+
+        /*
+        if (isTopNode)
+        {
+            int count = 0;
+            for (MXMLVF2JSDescriptorSpecifier md : propertySpecifiers)
+            {
+                if (md.name != null)
+                    count++;
+            }
+
+            write(count + "");
+            writeNewline(ASEmitterTokens.COMMA);
+        }
+        
+        MXMLVF2JSDescriptorSpecifier model = null; // model goes first
+        MXMLVF2JSDescriptorSpecifier beads = null; // beads go last
+
+        for (MXMLVF2JSDescriptorSpecifier md : propertySpecifiers)
+        {
+            if (md.name != null && md.name.equals("model"))
+            {
+                model = md;
+
+                break;
+            }
+        }
+
+        if (model != null)
+            write(model.outputPropertySpecifier(true));
+
+        for (MXMLVF2JSDescriptorSpecifier md : propertySpecifiers)
+        {
+            if (md.name != null)
+            {
+                if (!md.name.equals("model") && !md.name.equals("beads"))
+                    write(md.outputPropertySpecifier(writeNewline));
+                else if (md.name.equals("beads"))
+                    beads = md;
+            }
+        }
+
+        if (beads != null)
+            write(beads.outputPropertySpecifier(writeNewline));
+
+        if (!isProperty)
+        {
+            outputStyleSpecifier(writeNewline);
+
+            // TODO (erikdebruin) not yet implemented in FlexJS
+            //outputEffectSpecifier(writeNewline);
+
+            outputEventSpecifier(writeNewline);
+            
+            if (!isTopNode)
+            {
+                writeDelimiter(writeNewline);
+                
+                if (childrenSpecifier == null)
+                    write(ASEmitterTokens.NULL);
+                else
+                    outputChildren(childrenSpecifier, writeNewline);
+            }
+            
+            boolean isLastChild = parent != null
+                    && parent.propertySpecifiers.indexOf(this) == parent.propertySpecifiers
+                            .size() - 1;
+
+            if (!isLastChild && !isTopNode)
+                writeDelimiter(writeNewline);
+        }
+        //*/
+        
+        return sb.toString();
+    }
+    
+	@SuppressWarnings("unused")
+    private void outputChildren(MXMLVF2JSDescriptorSpecifier children, boolean writeNewline)
+    {
+        write(ASEmitterTokens.SQUARE_OPEN.getToken());
+        write(children.output(false));
+        write(ASEmitterTokens.SQUARE_CLOSE.getToken());
+    }
+
+}


[29/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/mxml/MXMLNodeSwitch.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/mxml/MXMLNodeSwitch.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/mxml/MXMLNodeSwitch.java
new file mode 100644
index 0000000..9576e24
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/visitor/mxml/MXMLNodeSwitch.java
@@ -0,0 +1,187 @@
+/*
+ *
+ *  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.internal.visitor.mxml;
+
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLArrayNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLBindingNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLBooleanNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLComponentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDataBindingNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDeclarationsNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDeferredInstanceNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLEmbedNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLEventSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFactoryNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLImplementsNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLInstanceNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLIntNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLLiteralNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLMetadataNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLNumberNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLObjectNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLScriptNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStringNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStyleNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStyleSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLUintNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLVectorNode;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+import org.apache.flex.compiler.visitor.IBlockVisitor;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockVisitor;
+
+/**
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class MXMLNodeSwitch implements IASNodeStrategy
+{
+    private final IMXMLBlockVisitor visitor;
+
+    public MXMLNodeSwitch(IBlockVisitor visitor)
+    {
+        this.visitor = (IMXMLBlockVisitor) visitor;
+    }
+
+    @Override
+    public void handle(IASNode node)
+    {
+        switch (node.getNodeID())
+        {
+        case MXMLArrayID:
+            visitor.visitArray((IMXMLArrayNode) node);
+            break;
+        case MXMLBooleanID:
+            visitor.visitBoolean((IMXMLBooleanNode) node);
+            break;
+        case MXMLDeclarationsID:
+            visitor.visitDeclarations((IMXMLDeclarationsNode) node);
+            break;
+        case MXMLDeferredInstanceID:
+            visitor.visitDeferredInstance((IMXMLDeferredInstanceNode) node);
+            break;
+        case MXMLDocumentID:
+            visitor.visitDocument((IMXMLDocumentNode) node);
+            break;
+        case MXMLEventSpecifierID:
+            visitor.visitEventSpecifier((IMXMLEventSpecifierNode) node);
+            break;
+        case MXMLFileID:
+            visitor.visitFile((IMXMLFileNode) node);
+            break;
+        case MXMLIntID:
+            visitor.visitInt((IMXMLIntNode) node);
+            break;
+        case MXMLInstanceID:
+            visitor.visitInstance((IMXMLInstanceNode) node);
+            break;
+        case MXMLLiteralID:
+            visitor.visitLiteral((IMXMLLiteralNode) node);
+            break;
+        case MXMLNumberID:
+            visitor.visitNumber((IMXMLNumberNode) node);
+            break;
+        case MXMLPropertySpecifierID:
+            visitor.visitPropertySpecifier((IMXMLPropertySpecifierNode) node);
+            break;
+        case MXMLScriptID:
+            visitor.visitScript((IMXMLScriptNode) node);
+            break;
+        case MXMLStringID:
+            visitor.visitString((IMXMLStringNode) node);
+            break;
+        case MXMLStyleSpecifierID:
+            visitor.visitStyleSpecifier((IMXMLStyleSpecifierNode) node);
+            break;
+        case MXMLUintID:
+            visitor.visitUint((IMXMLUintNode) node);
+            break;
+        case MXMLStyleID:
+            visitor.visitStyleBlock((IMXMLStyleNode)node);
+            break;
+        case MXMLStateID:
+            visitor.visitInstance((IMXMLInstanceNode) node);
+            break;
+        case MXMLFactoryID:
+            visitor.visitFactory((IMXMLFactoryNode) node);
+            break;
+        case MXMLComponentID:
+            visitor.visitComponent((IMXMLComponentNode) node);
+            break;
+        case MXMLMetadataID:
+            visitor.visitMetadata((IMXMLMetadataNode) node);
+            break;
+        case MXMLEmbedID:
+            visitor.visitEmbed((IMXMLEmbedNode) node);
+            break;
+        case MXMLImplementsID:
+            visitor.visitImplements((IMXMLImplementsNode) node);
+            break;
+        case MXMLVectorID:
+            visitor.visitVector((IMXMLVectorNode) node);
+            break;
+        case MXMLDataBindingID:
+            visitor.visitDatabinding((IMXMLDataBindingNode) node);
+            break;
+        case MXMLBindingID:
+            visitor.visitBinding((IMXMLBindingNode) node);
+        	break;
+        case MXMLObjectID:
+            visitor.visitObject((IMXMLObjectNode) node);
+        	break;
+        case MXMLApplicationID:
+        case MXMLBindingAttributeID:
+        case MXMLClassID:
+        case MXMLClassDefinitionID:
+        case MXMLClearID:
+        case MXMLConcatenatedDataBindingID:
+        case MXMLDateID:
+        case MXMLDefinitionID:
+        case MXMLDesignLayerID:
+        case MXMLEffectSpecifierID:
+        case MXMLFunctionID:
+        case MXMLHTTPServiceID:
+        case MXMLHTTPServiceRequestID:
+        case MXMLLibraryID:
+        case MXMLModelID:
+        case MXMLModelPropertyID:
+        case MXMLModelRootID:
+        case MXMLPrivateID:
+        case MXMLRegExpID:
+        case MXMLRemoteObjectID:
+        case MXMLRemoteObjectMethodID:
+        case MXMLReparentID:
+        //case MXMLRepeaterID:
+        case MXMLResourceID:
+        case MXMLWebServiceID:
+        case MXMLWebServiceOperationID:
+        case MXMLXMLID:
+        case MXMLXMLListID:
+        default:
+            throw new IllegalArgumentException(
+                    "No handler specified for nodes of type '"
+                            + node.getNodeID().getParaphrase() + "'");
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/problems/UnsupportedLanguageFeatureProblem.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/problems/UnsupportedLanguageFeatureProblem.java b/compiler-jx/src/main/java/org/apache/flex/compiler/problems/UnsupportedLanguageFeatureProblem.java
new file mode 100644
index 0000000..fbd55cd
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/problems/UnsupportedLanguageFeatureProblem.java
@@ -0,0 +1,37 @@
+/*  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.problems;
+
+import org.apache.flex.compiler.common.ISourceLocation;
+import org.apache.flex.compiler.problems.annotations.ProblemClassification;
+
+@ProblemClassification(CompilerProblemClassification.SYNTAX_ERROR)
+public class UnsupportedLanguageFeatureProblem extends CodegenProblem
+{
+
+    public static final String DESCRIPTION =
+        "'${tokenText}' cannot be cross-compiled.";
+    
+    public UnsupportedLanguageFeatureProblem(ISourceLocation site, String text)
+    {
+        super(site);
+        tokenText = text;
+    }
+        
+    public final String tokenText;
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/targets/IJSTarget.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/targets/IJSTarget.java b/compiler-jx/src/main/java/org/apache/flex/compiler/targets/IJSTarget.java
new file mode 100644
index 0000000..1fb4508
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/targets/IJSTarget.java
@@ -0,0 +1,52 @@
+/*
+ *
+ *  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.targets;
+
+import java.util.Collection;
+
+import org.apache.flex.compiler.clients.JSConfiguration;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.driver.js.IJSApplication;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+
+/**
+ * The {@link IJSTarget} interface allows the compiler an abstraction to
+ * <em>how</em> the actual JavaScript is built.
+ * <p>
+ * The interface ties into the {@link IBackend} and is created at the start of
+ * compile before the {@link JSConfiguration} class is configured.
+ * 
+ * @author Michael Schmalle
+ * 
+ * @see IBackend#createJSTarget(IASProject, ITargetSettings,
+ * ITargetProgressMonitor)
+ */
+public interface IJSTarget extends ITarget
+{
+    /**
+     * Build the target JavaScript application and collect problems. Every time
+     * the method is called, a new {@link IJSApplication} model is created.
+     * 
+     * @param problems compilation problems output
+     * @return IJSApplication if build is a success.
+     */
+    IJSApplication build(Collection<ICompilerProblem> problems);
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/utils/ASNodeUtils.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/utils/ASNodeUtils.java b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/ASNodeUtils.java
new file mode 100644
index 0000000..b7c524e
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/ASNodeUtils.java
@@ -0,0 +1,93 @@
+/*
+ *
+ *  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.utils;
+
+import java.util.ArrayList;
+
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IBlockNode;
+import org.apache.flex.compiler.tree.as.IConditionalNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IOperatorNode;
+import org.apache.flex.compiler.tree.as.ISwitchNode;
+import org.apache.flex.compiler.tree.as.ITerminalNode;
+
+/**
+ * @author Michael Schmalle
+ */
+public class ASNodeUtils
+{
+    //--------------------------------------------------------------------------
+    // Temp: These need JIRA tickets
+    //--------------------------------------------------------------------------
+
+    // there seems to be a bug in the ISwitchNode.getCaseNodes(), need to file a bug
+    public static final IConditionalNode[] getCaseNodes(ISwitchNode node)
+    {
+        IBlockNode block = (IBlockNode) node.getChild(1);
+        int childCount = block.getChildCount();
+        ArrayList<IConditionalNode> retVal = new ArrayList<IConditionalNode>(
+                childCount);
+
+        for (int i = 0; i < childCount; i++)
+        {
+            IASNode child = block.getChild(i);
+            if (child instanceof IConditionalNode)
+                retVal.add((IConditionalNode) child);
+        }
+
+        return retVal.toArray(new IConditionalNode[0]);
+    }
+
+    // there seems to be a bug in the ISwitchNode.getDefaultNode(), need to file a bug
+    public static final ITerminalNode getDefaultNode(ISwitchNode node)
+    {
+        IBlockNode block = (IBlockNode) node.getChild(1);
+        int childCount = block.getChildCount();
+        for (int i = childCount - 1; i >= 0; i--)
+        {
+            IASNode child = block.getChild(i);
+            if (child instanceof ITerminalNode)
+                return (ITerminalNode) child;
+        }
+
+        return null;
+    }
+
+    public static boolean hasParenOpen(IOperatorNode node)
+    {
+        return node.hasParenthesis();
+        //return node.getParent() instanceof IBinaryOperatorNode
+        //        && !ASNodeUtils.isString(node.getRightOperandNode());
+    }
+    
+    public static boolean hasParenClose(IOperatorNode node)
+    {
+        return node.hasParenthesis();
+        //return node.getParent() instanceof IBinaryOperatorNode
+        //        && !ASNodeUtils.isString(node.getRightOperandNode());
+    }
+
+    public static boolean isString(IExpressionNode node)
+    {
+        return node.getNodeID() == ASTNodeID.LiteralStringID;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/utils/DefinitionUtils.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/utils/DefinitionUtils.java b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/DefinitionUtils.java
new file mode 100644
index 0000000..f13c427
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/DefinitionUtils.java
@@ -0,0 +1,37 @@
+/*
+ *
+ *  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.utils;
+
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IInterfaceDefinition;
+
+/**
+ * @author Michael Schmalle
+ */
+public class DefinitionUtils
+{
+    public static final boolean isMemberDefinition(IDefinition definition)
+    {
+        return definition != null
+                && (definition.getParent() instanceof IClassDefinition || definition
+                        .getParent() instanceof IInterfaceDefinition);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/utils/JSClosureCompilerUtil.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/utils/JSClosureCompilerUtil.java b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/JSClosureCompilerUtil.java
new file mode 100644
index 0000000..cab0752
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/JSClosureCompilerUtil.java
@@ -0,0 +1,98 @@
+/*
+ *
+ *  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.utils;
+
+import java.security.Permission;
+
+import com.google.javascript.jscomp.CommandLineRunner;
+
+public class JSClosureCompilerUtil
+{
+
+    public static void run(String[] options)
+    {
+        forbidSystemExitCall();
+        try
+        {
+            JSClosureCommandLineRunner.main(options);
+        }
+        catch (ExitTrappedException e)
+        {
+            // (erikdebruin) the CLR issued an System.Exit(), but we have 
+            //               denied the request ;-)
+        }
+        finally
+        {
+            enableSystemExitCall();
+        }
+    }
+
+    private static class JSClosureCommandLineRunner extends CommandLineRunner
+    {
+        JSClosureCommandLineRunner(String[] args)
+        {
+            super(args);
+        }
+
+        public static void main(String[] args)
+        {
+            JSClosureCommandLineRunner runner = new JSClosureCommandLineRunner(
+                    args);
+
+            if (runner.shouldRunCompiler())
+            {
+                runner.run();
+            }
+            else
+            {
+                System.exit(-1);
+            }
+        }
+    }
+
+    private static class ExitTrappedException extends SecurityException
+    {
+        private static final long serialVersionUID = 666;
+    }
+
+    private static void forbidSystemExitCall()
+    {
+        final SecurityManager securityManager = new SecurityManager() {
+            @Override
+            public void checkPermission(Permission permission)
+            {
+            }
+
+            @Override
+            public void checkExit(int status)
+            {
+                throw new ExitTrappedException();
+            }
+        };
+
+        System.setSecurityManager(securityManager);
+    }
+
+    private static void enableSystemExitCall()
+    {
+        System.setSecurityManager(null);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
new file mode 100644
index 0000000..4008b01
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/JSClosureCompilerWrapper.java
@@ -0,0 +1,305 @@
+/*
+ *
+ *  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.utils;
+
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.logging.Level;
+
+import com.google.javascript.jscomp.CheckLevel;
+import com.google.javascript.jscomp.CommandLineRunner;
+import com.google.javascript.jscomp.CompilationLevel;
+import com.google.javascript.jscomp.Compiler;
+import com.google.javascript.jscomp.CompilerOptions;
+import com.google.javascript.jscomp.CompilerOptions.LanguageMode;
+import com.google.javascript.jscomp.DependencyOptions;
+import com.google.javascript.jscomp.DiagnosticGroups;
+import com.google.javascript.jscomp.FlexJSDiagnosticGroups;
+import com.google.javascript.jscomp.SourceFile;
+import com.google.javascript.jscomp.SourceMap;
+import com.google.javascript.jscomp.WarningLevel;
+
+public class JSClosureCompilerWrapper
+{
+
+    public JSClosureCompilerWrapper(List<String> args)
+    {
+        Compiler.setLoggingLevel(Level.INFO);
+
+        compiler_ = new Compiler();
+
+        ArrayList<String> splitArgs = new ArrayList<String>();
+        for (String s : args)
+        {
+        	if (s.contains(" "))
+        	{
+        		String[] parts = s.split(" ");
+        		for (String part : parts)
+        			splitArgs.add(part);
+        	}
+        	else
+        		splitArgs.add(s);
+        }
+		String[] stringArgs = new String[splitArgs.size()];
+		splitArgs.toArray(stringArgs);
+        options_ = new CompilerOptionsParser(stringArgs).getOptions();
+        
+        jsSourceFiles_ = new ArrayList<SourceFile>();
+        jsExternsFiles_ = new ArrayList<SourceFile>();
+        
+        initOptions(args);
+        initExterns();
+
+    }
+
+    private Compiler compiler_;
+    private CompilerOptions options_;
+    private List<SourceFile> jsExternsFiles_;
+    private List<SourceFile> jsSourceFiles_;
+    
+    public String targetFilePath;
+    
+    public void addJSExternsFile(String fileName)
+    {
+        addJSExternsFile(SourceFile.fromFile(fileName));
+    }
+    
+    public void addJSExternsFile(SourceFile file)
+    {
+        jsExternsFiles_.add(file);
+    }
+    
+    public void addJSSourceFile(String fileName)
+    {
+        jsSourceFiles_.add(SourceFile.fromFile(fileName));
+    }
+    
+    public void compile()
+    {
+        compiler_.compile(jsExternsFiles_, jsSourceFiles_, options_);
+
+        try
+        {
+            FileWriter targetFile = new FileWriter(targetFilePath);
+            targetFile.write(compiler_.toSource());
+            targetFile.close();
+            
+            FileWriter sourceMapFile = new FileWriter(options_.sourceMapOutputPath);
+            compiler_.getSourceMap().appendTo(sourceMapFile, "");
+            sourceMapFile.close();
+        }
+        catch (IOException error)
+        {
+            System.out.println(error);
+        }
+        
+        /*
+        for (JSError message : compiler_.getWarnings())
+        {
+            System.err.println("Warning message: " + message.toString());
+        }
+     
+        for (JSError message : compiler_.getErrors())
+        {
+            System.err.println("Error message: " + message.toString());
+        }
+        */
+    }
+    
+    @SuppressWarnings( "deprecation" )
+    private void initExterns()
+    {
+        try
+        {
+            List<SourceFile> defaultExterns = CommandLineRunner.getDefaultExterns();
+            for (SourceFile defaultExtern : defaultExterns)
+            {
+                this.addJSExternsFile(defaultExtern);
+            }
+        }
+        catch (IOException error)
+        {
+            System.out.println(error);
+        }
+    }
+    
+    private void initOptions(List<String> args)
+    {
+    	final String JS_FLAG = "--js ";
+    	
+    	boolean hasCompilationLevel = false;
+    	boolean hasWarningLevel = false;
+    	for (String s : args)
+    	{
+    		if (s.startsWith(JS_FLAG))
+    			addJSSourceFile(s.substring(JS_FLAG.length()));
+    		
+    		if (s.startsWith("--compilation_level ") ||
+    			s.startsWith("-O "))
+    			hasCompilationLevel = true;
+    		
+    		if (s.startsWith("--warning_level ") ||
+    			s.startsWith("-W "))
+    			hasWarningLevel = true;
+    	}
+    	if (!hasCompilationLevel)
+    		CompilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(
+                options_);
+        
+    	if (!hasWarningLevel)
+    		WarningLevel.VERBOSE.setOptionsForWarningLevel(options_);
+        
+        String[] asdocTags = new String[] {"productversion", 
+        		"playerversion", "langversion", "copy", 
+        		"asparam", "asreturn", "asprivate",
+        		"flexjsignoreimport", "flexjsignorecoercion"};
+        options_.setExtraAnnotationNames(Arrays.asList(asdocTags));
+    }
+    
+    public void setOptions(String sourceMapPath, boolean useStrictPublishing, String projectName)
+    {
+        if (useStrictPublishing)
+        {
+            // (erikdebruin) set compiler flags to 'strictest' to allow maximum
+            //               code optimization
+
+            options_.setDefineToBooleanLiteral("goog.DEBUG", true);
+            
+            // ToDo (erikdebruin): re-evaluate this option on future GC release
+            options_.setLanguageIn(LanguageMode.ECMASCRIPT5_STRICT);
+            
+            options_.setPreferSingleQuotes(true);
+            
+            options_.setFoldConstants(true);
+            options_.setDeadAssignmentElimination(true);
+            options_.setInlineConstantVars(true);
+            options_.setInlineFunctions(true);
+            options_.setInlineLocalFunctions(true);
+            options_.setCrossModuleCodeMotion(true);
+            options_.setCoalesceVariableNames(true);
+            options_.setCrossModuleMethodMotion(true);
+            options_.setInlineGetters(true);
+            options_.setInlineVariables(true);
+            options_.setSmartNameRemoval(true);
+            options_.setRemoveDeadCode(true);
+            options_.setCheckMissingReturn(CheckLevel.WARNING);
+            options_.setExtractPrototypeMemberDeclarations(true);
+            options_.setRemoveUnusedPrototypeProperties(true);
+            options_.setRemoveUnusedPrototypePropertiesInExterns(false);
+            options_.setRemoveUnusedClassProperties(true);
+            options_.setRemoveUnusedVars(true);
+            options_.setRemoveUnusedLocalVars(true);
+            options_.setCollapseVariableDeclarations(true);
+            options_.setCollapseAnonymousFunctions(true);
+            options_.setAliasAllStrings(true);
+            options_.setConvertToDottedProperties(true);
+            options_.setRewriteFunctionExpressions(true);
+            options_.setOptimizeParameters(true);
+            options_.setOptimizeReturns(true);
+            options_.setOptimizeCalls(true);
+            options_.setOptimizeArgumentsArray(true);
+            options_.setGenerateExports(true);
+            options_.setExportLocalPropertyDefinitions(true);
+            
+            DependencyOptions dopts = new DependencyOptions();
+            ArrayList<String> entryPoints = new ArrayList<String>();
+            entryPoints.add(projectName);
+            dopts.setDependencyPruning(true)
+                 .setDependencySorting(true)
+                 .setMoocherDropping(true)
+                 .setEntryPoints(entryPoints);
+            options_.setDependencyOptions(dopts);
+            
+            // warnings already activated in previous incarnation
+            options_.setWarningLevel(DiagnosticGroups.ACCESS_CONTROLS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CONST, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CONSTANT_PROPERTY, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.STRICT_MODULE_DEP_CHECK, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.VISIBILITY, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.DEPRECATED, CheckLevel.OFF); // OFF
+            
+            // the 'full' set of warnings
+            options_.setWarningLevel(DiagnosticGroups.AMBIGUOUS_FUNCTION_DECL, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_EVENTFUL_OBJECT_DISPOSAL, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_PROVIDE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_REGEXP, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_TYPES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_USELESS_CODE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_VARIABLES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.DEBUGGER_STATEMENT_PRESENT, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.DUPLICATE_MESSAGE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.DUPLICATE_VARS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.ES3, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.ES5_STRICT, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.EXTERNS_VALIDATION, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.GLOBAL_THIS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.FILEOVERVIEW_JSDOC, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.INTERNET_EXPLORER_CHECKS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.INVALID_CASTS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.LINT_CHECKS, CheckLevel.OFF); // OFF
+            options_.setWarningLevel(DiagnosticGroups.MISPLACED_TYPE_ANNOTATION, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_PROPERTIES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_PROVIDE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_REQUIRE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_RETURN, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.NEW_CHECK_TYPES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.NON_STANDARD_JSDOC, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.REPORT_UNKNOWN_TYPES, CheckLevel.OFF); // OFF
+            options_.setWarningLevel(DiagnosticGroups.SUSPICIOUS_CODE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.TWEAKS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.TYPE_INVALIDATION, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.UNDEFINED_NAMES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.UNDEFINED_VARIABLES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.UNKNOWN_DEFINES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.UNNECESSARY_CASTS, CheckLevel.OFF); // OFF
+            options_.setWarningLevel(DiagnosticGroups.USE_OF_GOOG_BASE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.VIOLATED_MODULE_DEP, CheckLevel.WARNING);
+            
+            // TODO (erikdebruin) Need to figure out how we can replace @expose
+            options_.setWarningLevel(DiagnosticGroups.DEPRECATED_ANNOTATIONS, CheckLevel.OFF);
+
+            // create custom DiagnosticGroups to shut off some individual warnings when we
+            // still want warnings for others in the group.
+            options_.setWarningLevel(FlexJSDiagnosticGroups.FLEXJS_NOT_A_CONSTRUCTOR, CheckLevel.OFF);
+            options_.setWarningLevel(FlexJSDiagnosticGroups.FLEXJS_SUPER_CALL_TO_DIFFERENT_NAME, CheckLevel.OFF);
+            options_.setWarningLevel(FlexJSDiagnosticGroups.FLEXJS_UNKNOWN_JSDOC_TYPE_NAME, CheckLevel.OFF);
+//            options_.setWarningLevel(FlexJSDiagnosticGroups.FLEXJS_REFERENCE_BEFORE_DECLARE, CheckLevel.OFF);
+        }
+        
+        options_.sourceMapFormat = SourceMap.Format.V3;
+        options_.sourceMapOutputPath = sourceMapPath + ".map";
+    }
+
+    private static class CompilerOptionsParser extends CommandLineRunner
+    {
+    	public CompilerOptionsParser(String[] args)
+    	{
+    		super(args);
+    	}
+    	
+    	public CompilerOptions getOptions()
+    	{
+    		return createOptions();
+    	}
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/utils/NativeUtils.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/utils/NativeUtils.java b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/NativeUtils.java
new file mode 100644
index 0000000..9ea630b
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/NativeUtils.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.utils;
+
+/**
+ * @author Michael Schmalle
+ */
+public class NativeUtils
+{
+    public enum NativeASType
+    {
+        Any("*"), // not JS but use full in the context of native
+
+        Argument("Argument"),
+        Array("Array"),
+        Boolean("Boolean"),
+        Class("Class"),
+        Date("Date"),
+        Error("Error"),
+        EvalError("EvalError"),
+        Function("Function"),
+        Infinity("Infinity"),
+        Math("Math"),
+        JSON("JSON"),
+        NaN("NaN"),
+        Namespace("Namespace"),
+        Number("Number"),
+        Object("Object"),
+        QName("QName"),
+        RangeError("RangeError"),
+        ReferenceError("ReferenceError"),
+        RegExp("RegExp"),
+        String("String"),
+        SyntaxError("SyntaxError"),
+        TypeError("TypeError"),
+        URIError("URIError"),
+        Vector("Vector"),
+        XML("XML"),
+        XMLList("XMLList"),
+        _assert("assert"),
+        decodeURI("decodeURI"),
+        decodeURIComponent("decodeURIComponent"),
+        encodeURI("encodeURI"),
+        encodeURIComponent("encodeURIComponent"),
+        escape("escape"),
+        _int("int"),
+        isFinite("isFinite"),
+        isNaN("isNaN"),
+        isXMLName("isXMLName"),
+        parseFloat("parseFloat"),
+        parseInt("parseInt"),
+        trace("trace"),
+        uint("uint"),
+        undefined("undefined"),
+        unescape("unescape");
+
+        private final String value;
+
+        NativeASType(String value)
+        {
+            this.value = value;
+        }
+
+        public String getValue()
+        {
+            return value;
+        }
+    }
+
+    public enum NativeJSType
+    {
+        // (erikdebruin) Ref.: https://cwiki.apache.org/confluence/display/FLEX/Full+Table
+        
+        Array("Array"),
+        Boolean("Boolean"),
+        decodeURI("decodeURI"),
+        decodeURIComponent("decodeURIComponent"),
+        encodeURI("encodeURI"),
+        encodeURIComponent("encodeURIComponent"),
+        escape("escape"),
+        isFinite("isFinite"),
+        isNaN("isNaN"),
+        Number("Number"),
+        Object("Object"),
+        parseFloat("parseFloat"),
+        parseInt("parseInt"),
+        String("String"),
+        unescape("unescape"),
+
+        // (erikdebruin) These aren't strictly 'native' to JS, but the 
+        //               Publisher provides global functions, so, for all 
+        //               intends and purposes they behave like they are.
+        _int("int"),
+        trace("trace"),
+        uint("uint"),
+        
+        // (erikdebruin) These are left out, but should, at some point, be
+        //               treated as if they actually are 'native'.
+        /*
+        isXMLName("isXMLName"),
+        Vector("Vector"),
+        XML("XML"),
+        XMLList("XMLList"),
+        */
+        
+        _byte("byte"),
+        
+        ;
+        private final String value;
+
+        NativeJSType(String value)
+        {
+            this.value = value;
+        }
+
+        public String getValue()
+        {
+            return value;
+        }
+    }
+    
+    public static boolean isNative(String type)
+    {
+        for (NativeASType test : NativeASType.values())
+        {
+            if (test.getValue().equals(type))
+                return true;
+        }
+        if (type.startsWith("Vector.<"))
+            return true;
+        return false;
+    }
+
+    public static boolean isJSNative(String type)
+    {
+        for (NativeJSType test : NativeJSType.values())
+        {
+            if (test.getValue().equals(type))
+                return true;
+        }
+        return false;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/utils/VF2JSClosureCompilerWrapper.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/utils/VF2JSClosureCompilerWrapper.java b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/VF2JSClosureCompilerWrapper.java
new file mode 100644
index 0000000..f1240e4
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/VF2JSClosureCompilerWrapper.java
@@ -0,0 +1,224 @@
+/*
+ *
+ *  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.utils;
+
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.logging.Level;
+
+import com.google.javascript.jscomp.CheckLevel;
+import com.google.javascript.jscomp.CommandLineRunner;
+import com.google.javascript.jscomp.CompilationLevel;
+import com.google.javascript.jscomp.Compiler;
+import com.google.javascript.jscomp.CompilerOptions;
+import com.google.javascript.jscomp.DiagnosticGroups;
+import com.google.javascript.jscomp.SourceFile;
+import com.google.javascript.jscomp.SourceMap;
+import com.google.javascript.jscomp.WarningLevel;
+import com.google.javascript.rhino.Node;
+import com.google.javascript.rhino.Token;
+
+public class VF2JSClosureCompilerWrapper
+{
+
+    public VF2JSClosureCompilerWrapper()
+    {
+        Compiler.setLoggingLevel(Level.ALL);
+
+        compiler_ = new Compiler();
+
+        options_ = new CompilerOptions();
+        initOptions();
+        
+        jsExternsFiles_ = new ArrayList<SourceFile>();
+        initExterns();
+
+        jsSourceFiles_ = new ArrayList<SourceFile>();
+    }
+
+    private Compiler compiler_;
+    private CompilerOptions options_;
+    private List<SourceFile> jsExternsFiles_;
+    private List<SourceFile> jsSourceFiles_;
+    
+    public String targetFilePath;
+    
+    public void addJSExternsFile(String fileName)
+    {
+        addJSExternsFile(SourceFile.fromFile(fileName));
+    }
+    
+    public void addJSExternsFile(SourceFile file)
+    {
+        jsExternsFiles_.add(file);
+    }
+    
+    public void addJSSourceFile(String fileName)
+    {
+        jsSourceFiles_.add(SourceFile.fromFile(fileName));
+    }
+    
+    public void compile()
+    {
+        compiler_.compile(jsExternsFiles_, jsSourceFiles_, options_);
+
+        try
+        {
+            FileWriter targetFile = new FileWriter(targetFilePath);
+            targetFile.write(compiler_.toSource());
+            targetFile.close();
+            
+            FileWriter sourceMapFile = new FileWriter(options_.sourceMapOutputPath);
+            compiler_.getSourceMap().appendTo(sourceMapFile, "");
+            sourceMapFile.close();
+        }
+        catch (IOException error)
+        {
+            System.out.println(error);
+        }
+    }
+    
+    @SuppressWarnings( "deprecation" )
+    private void initExterns()
+    {
+        try
+        {
+            List<SourceFile> defaultExterns = CommandLineRunner.getDefaultExterns();
+            for (SourceFile defaultExtern : defaultExterns)
+            {
+                this.addJSExternsFile(defaultExtern);
+            }
+        }
+        catch (IOException error)
+        {
+            System.out.println(error);
+        }
+    }
+    
+    private void initOptions()
+    {
+        CompilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(
+                options_);
+        
+        WarningLevel.VERBOSE.setOptionsForWarningLevel(options_);
+        
+        String[] asdocTags = new String[] {"productversion", 
+        		"playerversion", "langversion", "copy"};
+        options_.setExtraAnnotationNames(Arrays.asList(asdocTags));
+    }
+    
+    public void setOptions(String sourceMapPath, boolean useStrictPublishing)
+    {
+        if (useStrictPublishing)
+        {
+            // (erikdebruin) set compiler flags to 'strictest' to allow maximum
+            //               code optimization
+
+            options_.getDefineReplacements().put(
+                    "goog.DEBUG", new Node(Token.TRUE));
+            
+            // ToDo (erikdebruin): re-evaluate this option on future GC release
+            //options_.setLanguageIn(LanguageMode.ECMASCRIPT6_STRICT);
+            
+            options_.setPreferSingleQuotes(true);
+            
+            options_.setFoldConstants(true);
+            options_.setDeadAssignmentElimination(true);
+            options_.setInlineConstantVars(true);
+            options_.setInlineFunctions(true);
+            options_.setInlineLocalFunctions(true);
+            options_.setCrossModuleCodeMotion(true);
+            options_.setCoalesceVariableNames(true);
+            options_.setCrossModuleMethodMotion(true);
+            options_.setInlineGetters(true);
+            options_.setInlineVariables(true);
+            options_.setSmartNameRemoval(true);
+            options_.setRemoveDeadCode(true);
+            options_.setCheckMissingReturn(CheckLevel.WARNING);
+            options_.setExtractPrototypeMemberDeclarations(true);
+            options_.setRemoveUnusedPrototypeProperties(true);
+            options_.setRemoveUnusedPrototypePropertiesInExterns(true);
+            options_.setRemoveUnusedClassProperties(true);
+            options_.setRemoveUnusedVars(true);
+            options_.setRemoveUnusedLocalVars(true);
+            options_.setCollapseVariableDeclarations(true);
+            options_.setCollapseAnonymousFunctions(true);
+            options_.setAliasAllStrings(true);
+            options_.setConvertToDottedProperties(true);
+            options_.setRewriteFunctionExpressions(true);
+            options_.setOptimizeParameters(true);
+            options_.setOptimizeReturns(true);
+            options_.setOptimizeCalls(true);
+            options_.setOptimizeArgumentsArray(true);
+            
+            // warnings already activated in previous incarnation
+            options_.setWarningLevel(DiagnosticGroups.ACCESS_CONTROLS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CONST, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CONSTANT_PROPERTY, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.STRICT_MODULE_DEP_CHECK, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.VISIBILITY, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.DEPRECATED, CheckLevel.OFF); // OFF
+            
+            // the 'full' set of warnings
+            options_.setWarningLevel(DiagnosticGroups.AMBIGUOUS_FUNCTION_DECL, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_EVENTFUL_OBJECT_DISPOSAL, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_PROVIDE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_REGEXP, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_TYPES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_USELESS_CODE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.CHECK_VARIABLES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.DEBUGGER_STATEMENT_PRESENT, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.DUPLICATE_MESSAGE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.DUPLICATE_VARS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.ES3, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.ES5_STRICT, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.EXTERNS_VALIDATION, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.GLOBAL_THIS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.FILEOVERVIEW_JSDOC, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.INTERNET_EXPLORER_CHECKS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.INVALID_CASTS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.LINT_CHECKS, CheckLevel.OFF); // OFF
+            options_.setWarningLevel(DiagnosticGroups.MISPLACED_TYPE_ANNOTATION, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_PROPERTIES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_PROVIDE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_REQUIRE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.MISSING_RETURN, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.NEW_CHECK_TYPES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.NON_STANDARD_JSDOC, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.REPORT_UNKNOWN_TYPES, CheckLevel.OFF); // OFF
+            options_.setWarningLevel(DiagnosticGroups.SUSPICIOUS_CODE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.TWEAKS, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.TYPE_INVALIDATION, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.UNDEFINED_NAMES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.UNDEFINED_VARIABLES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.UNKNOWN_DEFINES, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.UNNECESSARY_CASTS, CheckLevel.OFF); // OFF
+            options_.setWarningLevel(DiagnosticGroups.USE_OF_GOOG_BASE, CheckLevel.WARNING);
+            options_.setWarningLevel(DiagnosticGroups.VIOLATED_MODULE_DEP, CheckLevel.WARNING);
+        }
+        
+        options_.sourceMapFormat = SourceMap.Format.V3;
+        options_.sourceMapOutputPath = sourceMapPath + ".map";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/utils/VF2JSProjectUtils.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/utils/VF2JSProjectUtils.java b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/VF2JSProjectUtils.java
new file mode 100644
index 0000000..0542097
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/utils/VF2JSProjectUtils.java
@@ -0,0 +1,132 @@
+/*
+ *
+ *  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.utils;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.io.FileUtils;
+
+import com.google.common.io.Files;
+
+
+public class VF2JSProjectUtils
+{
+
+    private static File tempDir;
+    
+    public static final String createTempProject(String projectFilePath,
+            boolean isFlashBuilderProject)
+    {
+        tempDir = Files.createTempDir();
+        
+        String fileName = projectFilePath.substring(projectFilePath.lastIndexOf(File.separator) + 1, projectFilePath.length());
+        
+        String path = projectFilePath.substring(0, projectFilePath.lastIndexOf(File.separator));
+        
+        createTempProjectDir(new File(path).listFiles(), "");
+        
+        return tempDir.getAbsolutePath() + File.separator + fileName;
+    }
+
+    private static void createTempProjectDir(File[] files, String parentPath)
+    {
+        for (File file : files) 
+        {
+            if (file.isDirectory()) 
+            {
+                String path = parentPath + File.separator + file.getName(); 
+                
+                new File(tempDir + File.separator + path).mkdirs();
+
+                createTempProjectDir(file.listFiles(), path);
+            } 
+            else 
+            {
+                String fileName = file.getName();
+
+                if (fileName.contains(".") && fileName.charAt(0) != '.')
+                {
+                    String extension = fileName.substring(fileName.lastIndexOf("."), fileName.length());
+    
+                    if (extension.equals(".mxml") || extension.equals(".as"))
+                    {
+                        File intermediateFile = file;
+                        String tempFileName = fileName.substring(0, fileName.indexOf("."));
+                        File targetDir = new File(tempDir + File.separator + parentPath);
+                        
+                        createTempFileWithVF2JSNamespace(intermediateFile, 
+                                tempFileName, false, targetDir, extension);
+                    }
+                }
+            }
+        }
+    }
+    
+    private static File createTempFileWithVF2JSNamespace(File intermediateFile,
+            String tempFileName, boolean createTempFile, File targetDir,
+            String extension)
+    {
+        File tempFile = null;
+        
+        try 
+        {
+            String content = FileUtils.readFileToString(intermediateFile, "UTF-8");
+
+            // mx (MXML)
+            content = content.replace(
+                    "xmlns:mx=\"library://ns.adobe.com/flex/mx\"", 
+                    "xmlns:vf2js_mx=\"http://flex.apache.org/vf2js_mx/ns\"");
+            content = content.replace("<mx:", "<vf2js_mx:");
+            content = content.replace("</mx:", "</vf2js_mx:");
+
+            // mx (AS)
+            content = content.replace("mx.", "vf2js_mx.");
+
+            // s (MXML)
+            content = content.replace(
+                    "xmlns:s=\"library://ns.adobe.com/flex/spark\"", 
+                    "xmlns:vf2js_s=\"http://flex.apache.org/vf2js_s/ns\"");
+            content = content.replace("<s:", "<vf2js_s:");
+            content = content.replace("</s:", "</vf2js_s:");
+
+            // s (AS)
+            content = content.replace("spark.", "vf2js_s.");
+
+            if (createTempFile)
+            {
+                tempFile = File.createTempFile(tempFileName, extension,
+                        targetDir);
+                tempFile.deleteOnExit();
+            }
+            else
+            {
+                tempFile = new File(targetDir.getAbsolutePath(),
+                        tempFileName + extension);
+            }
+            FileUtils.writeStringToFile(tempFile, content, "UTF-8");
+        } 
+        catch (IOException e) 
+        {
+            throw new RuntimeException("Generating file failed", e);
+        }
+
+        return tempFile;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/IASNodeStrategy.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/IASNodeStrategy.java b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/IASNodeStrategy.java
new file mode 100644
index 0000000..589e00e
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/IASNodeStrategy.java
@@ -0,0 +1,38 @@
+/*
+ *
+ *  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.visitor;
+
+import org.apache.flex.compiler.tree.as.IASNode;
+
+/**
+ * A simple strategy to allow composition of {@link IASNode} handling when
+ * walking the AST node tree.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IASNodeStrategy
+{
+    /**
+     * The strategy will handle the specific {@link IASNode}.
+     * 
+     * @param node The {@link IASNode} to handle.
+     */
+    void handle(IASNode node);
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/IBlockVisitor.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/IBlockVisitor.java b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/IBlockVisitor.java
new file mode 100644
index 0000000..5681b21
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/IBlockVisitor.java
@@ -0,0 +1,28 @@
+/*
+ *
+ *  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.visitor;
+
+/**
+ * @author Erik de Bruin
+ */
+public interface IBlockVisitor
+{
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/IBlockWalker.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/IBlockWalker.java b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/IBlockWalker.java
new file mode 100644
index 0000000..3bba54c
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/IBlockWalker.java
@@ -0,0 +1,47 @@
+/*
+ *
+ *  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.visitor;
+
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.as.IASNode;
+
+/**
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public interface IBlockWalker
+{
+
+    /**
+     * Returns the current {@link ICompilerProject} for the traverse state.
+     */
+    ICompilerProject getProject();
+
+    /**
+     * Traverses an {@link IASNode} based on the semantics of the known node.
+     * <p>
+     * Typically uses the {@link IASNodeStrategy#handle(IASNode)} to delegate
+     * how the node will be traversed.
+     * 
+     * @param node The {@link IASNode} to traverse using the current strategy
+     */
+    void walk(IASNode node);
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/as/IASBlockVisitor.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/as/IASBlockVisitor.java b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/as/IASBlockVisitor.java
new file mode 100644
index 0000000..db3cda0
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/as/IASBlockVisitor.java
@@ -0,0 +1,229 @@
+/*
+ *
+ *  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.visitor.as;
+
+import org.apache.flex.compiler.internal.codegen.as.ASBlockWalker;
+import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IBlockNode;
+import org.apache.flex.compiler.tree.as.ICatchNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IDefaultXMLNamespaceNode;
+import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
+import org.apache.flex.compiler.tree.as.IEmbedNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IFunctionObjectNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IIfNode;
+import org.apache.flex.compiler.tree.as.IImportNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.IIterationFlowNode;
+import org.apache.flex.compiler.tree.as.IKeywordNode;
+import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
+import org.apache.flex.compiler.tree.as.ILiteralNode;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.INamespaceAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.INamespaceNode;
+import org.apache.flex.compiler.tree.as.INumericLiteralNode;
+import org.apache.flex.compiler.tree.as.IObjectLiteralValuePairNode;
+import org.apache.flex.compiler.tree.as.IPackageNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.IReturnNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.apache.flex.compiler.tree.as.ISwitchNode;
+import org.apache.flex.compiler.tree.as.ITerminalNode;
+import org.apache.flex.compiler.tree.as.ITernaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IThrowNode;
+import org.apache.flex.compiler.tree.as.ITryNode;
+import org.apache.flex.compiler.tree.as.ITypedExpressionNode;
+import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IUseNamespaceNode;
+import org.apache.flex.compiler.tree.as.IVariableExpressionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.tree.as.IWhileLoopNode;
+import org.apache.flex.compiler.tree.as.IWithNode;
+import org.apache.flex.compiler.tree.metadata.IMetaTagNode;
+import org.apache.flex.compiler.tree.metadata.IMetaTagsNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+import org.apache.flex.compiler.visitor.IBlockVisitor;
+
+/**
+ * The {@link IASBlockVisitor} interface allows an {@link IASNodeStrategy} to
+ * delegate within it's {@link IASNodeStrategy#handle(IASNode)} method to this
+ * API's visitor method.
+ * <p>
+ * <strong>Note</strong> This API is not complete.
+ * 
+ * @author Michael Schmalle
+ * 
+ * @see ASBlockWalker
+ */
+public interface IASBlockVisitor extends IBlockVisitor
+{
+    //--------------------------------------------------------------------------
+    // Top level nodes
+    //--------------------------------------------------------------------------
+
+    void visitCompilationUnit(ICompilationUnit unit);
+
+    void visitFile(IFileNode node);
+
+    void visitPackage(IPackageNode node);
+
+    void visitClass(IClassNode node);
+
+    void visitInterface(IInterfaceNode node);
+
+    //--------------------------------------------------------------------------
+    // Member nodes
+    //--------------------------------------------------------------------------
+
+    // block var or field
+    void visitVariable(IVariableNode node);
+
+    void visitFunction(IFunctionNode node);
+
+    void visitGetter(IGetterNode node);
+
+    void visitSetter(ISetterNode node);
+
+    void visitNamespace(INamespaceNode node);
+
+    //--------------------------------------------------------------------------
+    // Statement nodes
+    //--------------------------------------------------------------------------
+
+    void visitIf(IIfNode node);
+
+    void visitForLoop(IForLoopNode node);
+
+    void visitWhileLoop(IWhileLoopNode node);
+
+    void visitTry(ITryNode node);
+
+    void visitCatch(ICatchNode node);
+
+    void visitSwitch(ISwitchNode node);
+
+    void visitLabeledStatement(LabeledStatementNode node);
+
+    void visitWith(IWithNode node);
+
+    void visitThrow(IThrowNode node);
+
+    //--------------------------------------------------------------------------
+    // Statement helper nodes
+    //--------------------------------------------------------------------------
+
+    void visitIterationFlow(IIterationFlowNode node);
+
+    // is a IVariableNode
+    void visitParameter(IParameterNode node);
+
+    void visitObjectLiteralValuePair(IObjectLiteralValuePairNode node);
+
+    //--------------------------------------------------------------------------
+    // Expression Statement nodes
+    //--------------------------------------------------------------------------
+
+    void visitMemberAccessExpression(IMemberAccessExpressionNode node);
+
+    void visitNamespaceAccessExpression(INamespaceAccessExpressionNode node);
+    
+    void visitVariableExpression(IVariableExpressionNode node);
+
+    void visitLanguageIdentifierNode(ILanguageIdentifierNode node);
+
+    void visitReturn(IReturnNode node);
+
+    void visitDefaultXMLNamespace(IDefaultXMLNamespaceNode node);
+
+    void visitTypedExpression(ITypedExpressionNode node);
+
+    // this is a IBinaryOperatorNode goes before
+    void visitDynamicAccess(IDynamicAccessNode node);
+
+    void visitTernaryOperator(ITernaryOperatorNode node);
+
+    //--------------------------------------------------------------------------
+    // Container nodes
+    //--------------------------------------------------------------------------
+
+    void visitBlock(IBlockNode node);
+
+    //--------------------------------------------------------------------------
+    // Expression nodes
+    //--------------------------------------------------------------------------
+
+    void visitFunctionObject(IFunctionObjectNode node);
+    
+    void visitFunctionCall(IFunctionCallNode node);
+
+    void visitAsOperator(IBinaryOperatorNode node);
+
+    void visitIsOperator(IBinaryOperatorNode node);
+
+    void visitBinaryOperator(IBinaryOperatorNode node);
+
+    void visitUnaryOperator(IUnaryOperatorNode node);
+
+    void visitExpression(IExpressionNode node);
+
+    //--------------------------------------------------------------------------
+    // Terminal like Expression nodes
+    //--------------------------------------------------------------------------
+
+    void visitIdentifier(IIdentifierNode node);
+
+    void visitKeyword(IKeywordNode node);
+
+    void visitLiteral(ILiteralNode node);
+
+    void visitNumericLiteral(INumericLiteralNode node);
+
+    void visitTerminal(ITerminalNode node);
+
+    //--------------------------------------------------------------------------
+    // Various nodes
+    //--------------------------------------------------------------------------
+
+    void visitImport(IImportNode node);
+
+    void visitMetaTags(IMetaTagsNode node);
+
+    void visitMetaTag(IMetaTagNode node);
+
+    void visitUseNamespace(IUseNamespaceNode node);
+
+    void visitEmbed(IEmbedNode node);
+
+    void visitContainer(IContainerNode node);
+
+    void visitE4XFilter(IMemberAccessExpressionNode node);
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/as/IASBlockWalker.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/as/IASBlockWalker.java b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/as/IASBlockWalker.java
new file mode 100644
index 0000000..f97b9ad
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/as/IASBlockWalker.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.visitor.as;
+
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+
+/**
+ * @author Michael Schmalle
+ */
+public interface IASBlockWalker extends IASBlockVisitor, IBlockWalker
+{
+
+    /**
+     * The current code emitter.
+     */
+    IASEmitter getEmitter();
+
+    /**
+     * The current project errors.
+     */
+    List<ICompilerProblem> getErrors();
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/mxml/IMXMLBlockVisitor.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/mxml/IMXMLBlockVisitor.java b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/mxml/IMXMLBlockVisitor.java
new file mode 100644
index 0000000..d6c45a8
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/mxml/IMXMLBlockVisitor.java
@@ -0,0 +1,138 @@
+/*
+ *
+ *  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.visitor.mxml;
+
+import org.apache.flex.compiler.tree.mxml.IMXMLArrayNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLBindingNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLBooleanNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLClassDefinitionNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLComponentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDataBindingNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDeclarationsNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDeferredInstanceNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLEmbedNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLEventSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFactoryNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLImplementsNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLInstanceNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLIntNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLLiteralNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLMetadataNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLNumberNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLObjectNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLScriptNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStringNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStyleNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStyleSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLUintNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLVectorNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IBlockVisitor;
+
+/**
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public interface IMXMLBlockVisitor extends IBlockVisitor
+{
+
+    //--------------------------------------------------------------------------
+
+    void visitCompilationUnit(ICompilationUnit unit);
+
+    void visitFile(IMXMLFileNode node);
+
+    void visitDocument(IMXMLDocumentNode node);
+
+    void visitClassDefinition(IMXMLClassDefinitionNode node);
+
+    void visitDeclarations(IMXMLDeclarationsNode node);
+
+    //--------------------------------------------------------------------------
+
+    void visitDeferredInstance(IMXMLDeferredInstanceNode node);
+
+    //--------------------------------------------------------------------------
+
+    void visitEventSpecifier(IMXMLEventSpecifierNode node);
+
+    void visitInstance(IMXMLInstanceNode node);
+
+    void visitPropertySpecifier(IMXMLPropertySpecifierNode node);
+
+    void visitScript(IMXMLScriptNode node);
+
+    void visitStyleBlock(IMXMLStyleNode node);
+
+    void visitStyleSpecifier(IMXMLStyleSpecifierNode node);
+
+    //--------------------------------------------------------------------------
+
+    void visitArray(IMXMLArrayNode node);
+
+    void visitBoolean(IMXMLBooleanNode node);
+
+    void visitInt(IMXMLIntNode node);
+
+    void visitNumber(IMXMLNumberNode node);
+
+    void visitString(IMXMLStringNode node);
+
+    void visitUint(IMXMLUintNode node);
+
+    //--------------------------------------------------------------------------
+
+    void visitLiteral(IMXMLLiteralNode node);
+
+    void visitFactory(IMXMLFactoryNode node);
+
+    void visitComponent(IMXMLComponentNode node);
+    
+    //--------------------------------------------------------------------------
+
+    void visitMetadata(IMXMLMetadataNode node);
+    
+    //--------------------------------------------------------------------------
+
+    void visitEmbed(IMXMLEmbedNode node);
+    
+    //--------------------------------------------------------------------------
+
+    void visitImplements(IMXMLImplementsNode node);
+    
+    //--------------------------------------------------------------------------
+
+    void visitVector(IMXMLVectorNode node);
+
+    //--------------------------------------------------------------------------
+    
+    void visitDatabinding(IMXMLDataBindingNode node);
+    
+    //--------------------------------------------------------------------------
+    
+    void visitBinding(IMXMLBindingNode node);
+    
+    //--------------------------------------------------------------------------
+    
+    void visitObject(IMXMLObjectNode node);
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/mxml/IMXMLBlockWalker.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/mxml/IMXMLBlockWalker.java b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/mxml/IMXMLBlockWalker.java
new file mode 100644
index 0000000..1aab260
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/visitor/mxml/IMXMLBlockWalker.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.visitor.mxml;
+
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+
+/**
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public interface IMXMLBlockWalker extends IMXMLBlockVisitor, IBlockWalker
+{
+
+    /**
+     * The current code emitter.
+     */
+    IASEmitter getASEmitter();
+
+    /**
+     * The current code emitter.
+     */
+    IMXMLEmitter getMXMLEmitter();
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/resources/META-INF/services/org.apache.flex.tools.FlexToolGroup
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/resources/META-INF/services/org.apache.flex.tools.FlexToolGroup b/compiler-jx/src/main/resources/META-INF/services/org.apache.flex.tools.FlexToolGroup
new file mode 100644
index 0000000..b2ad16f
--- /dev/null
+++ b/compiler-jx/src/main/resources/META-INF/services/org.apache.flex.tools.FlexToolGroup
@@ -0,0 +1,2 @@
+org.apache.flex.compiler.clients.FlexJSToolGroup
+org.apache.flex.compiler.clients.VF2JSToolGroup

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestAccessorMembers.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestAccessorMembers.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestAccessorMembers.java
new file mode 100644
index 0000000..922af9c
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/as/TestAccessorMembers.java
@@ -0,0 +1,101 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.internal.test.ASTestBase;
+import org.apache.flex.compiler.tree.as.IAccessorNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid ActionScript3 code for Class
+ * Accessor members.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestAccessorMembers extends ASTestBase
+{
+    //--------------------------------------------------------------------------
+    // Accessor
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void testGetAccessor()
+    {
+        IAccessorNode node = getAccessor("function get foo():int{return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("function get foo():int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testGetAccessor_withNamespace()
+    {
+        IAccessorNode node = getAccessor("public function get foo():int{return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("public function get foo():int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testGetAccessor_withNamespaceOverride()
+    {
+        IAccessorNode node = getAccessor("public override function get foo():int{return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("public override function get foo():int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testGetAccessor_withStatic()
+    {
+        IAccessorNode node = getAccessor("public static function get foo():int{return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("public static function get foo():int {\n\treturn -1;\n}");
+    }
+
+    @Test
+    public void testSetAccessor()
+    {
+        IAccessorNode node = getAccessor("function set foo(value:int):void{}");
+        asBlockWalker.visitFunction(node);
+        assertOut("function set foo(value:int):void {\n}");
+    }
+
+    @Test
+    public void testSetAccessor_withNamespace()
+    {
+        IAccessorNode node = getAccessor("public function set foo(value:int):void{}");
+        asBlockWalker.visitFunction(node);
+        assertOut("public function set foo(value:int):void {\n}");
+    }
+
+    @Test
+    public void testSetAccessor_withNamespaceOverride()
+    {
+        IAccessorNode node = getAccessor("public override function set foo(value:int):void{}");
+        asBlockWalker.visitFunction(node);
+        assertOut("public override function set foo(value:int):void {\n}");
+    }
+
+    @Test
+    public void testSetAccessor_withStatic()
+    {
+        IAccessorNode node = getAccessor("public static function set foo(value:int):void{}");
+        asBlockWalker.visitFunction(node);
+        assertOut("public static function set foo(value:int):void {\n}");
+    }
+}


[35/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
new file mode 100644
index 0000000..094f5c7
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
@@ -0,0 +1,2320 @@
+/*
+ *
+ *  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.internal.codegen.mxml.flexjs;
+
+
+import java.io.File;
+import java.io.FilterWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.apache.flex.abc.semantics.MethodInfo;
+import org.apache.flex.abc.semantics.Name;
+import org.apache.flex.abc.semantics.Namespace;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.mxml.flexjs.IMXMLFlexJSEmitter;
+import org.apache.flex.compiler.constants.IASKeywordConstants;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.databinding.BindingDatabase;
+import org.apache.flex.compiler.internal.codegen.databinding.BindingInfo;
+import org.apache.flex.compiler.internal.codegen.databinding.FunctionWatcherInfo;
+import org.apache.flex.compiler.internal.codegen.databinding.PropertyWatcherInfo;
+import org.apache.flex.compiler.internal.codegen.databinding.StaticPropertyWatcherInfo;
+import org.apache.flex.compiler.internal.codegen.databinding.WatcherInfoBase;
+import org.apache.flex.compiler.internal.codegen.databinding.WatcherInfoBase.WatcherType;
+import org.apache.flex.compiler.internal.codegen.databinding.XMLWatcherInfo;
+import org.apache.flex.compiler.internal.codegen.js.JSSessionModel.PropertyNodes;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.jx.PackageFooterEmitter;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLEmitter;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.projects.FlexProject;
+import org.apache.flex.compiler.internal.scopes.ASProjectScope;
+import org.apache.flex.compiler.internal.tree.as.FunctionCallNode;
+import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
+import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IImportNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.tree.metadata.IMetaTagNode;
+import org.apache.flex.compiler.tree.metadata.IMetaTagsNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLArrayNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLClassDefinitionNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLClassNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLComponentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDataBindingNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDeclarationsNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLEventSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFactoryNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLImplementsNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLInstanceNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLLiteralNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLMetadataNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLObjectNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLScriptNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStateNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStringNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStyleSpecifierNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.utils.NativeUtils;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+import com.google.common.base.Joiner;
+
+/**
+ * @author Erik de Bruin
+ */
+public class MXMLFlexJSEmitter extends MXMLEmitter implements
+        IMXMLFlexJSEmitter
+{
+
+	// the instances in a container
+    private ArrayList<MXMLDescriptorSpecifier> currentInstances;
+    private ArrayList<MXMLDescriptorSpecifier> currentPropertySpecifiers;
+    private ArrayList<MXMLDescriptorSpecifier> descriptorTree;
+    private MXMLDescriptorSpecifier propertiesTree;
+    private MXMLDescriptorSpecifier currentStateOverrides;
+    private ArrayList<MXMLEventSpecifier> events;
+    // all instances in the current document or subdocument
+    private ArrayList<MXMLDescriptorSpecifier> instances;
+    // all instances in the document AND its subdocuments
+    private ArrayList<MXMLDescriptorSpecifier> allInstances = new ArrayList<MXMLDescriptorSpecifier>();
+    private ArrayList<MXMLScriptSpecifier> scripts;
+    //private ArrayList<MXMLStyleSpecifier> styles;
+    private IClassDefinition classDefinition;
+    private IClassDefinition documentDefinition;
+    private ArrayList<String> usedNames = new ArrayList<String>();
+    private ArrayList<IMXMLMetadataNode> metadataNodes = new ArrayList<IMXMLMetadataNode>();
+    
+    private int eventCounter;
+    private int idCounter;
+    private int bindingCounter;
+
+    private boolean inMXMLContent;
+    private boolean inStatesOverride;
+    private boolean makingSimpleArray;
+    
+    private StringBuilder subDocuments = new StringBuilder();
+    private ArrayList<String> subDocumentNames = new ArrayList<String>();
+    private String interfaceList;
+    
+    /**
+     * This keeps track of the entries in our temporary array of 
+     * DeferredInstanceFromFunction objects that we CG to help with
+     * State override CG.
+     * 
+     * Keys are Instance nodes,
+     * values are the array index where the deferred instance is:
+     * 
+     *  deferred instance = local3[ nodeToIndexMap.get(an instance) ]
+     */
+    protected Map<IMXMLNode, Integer> nodeToIndexMap;
+    
+    public MXMLFlexJSEmitter(FilterWriter out)
+    {
+        super(out);
+    }
+
+    @Override
+    public String postProcess(String output)
+    {
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker()).getASEmitter();
+        usedNames.addAll(((JSFlexJSEmitter)asEmitter).usedNames);
+        
+        boolean foundXML = false;
+    	String[] lines = output.split("\n");
+    	ArrayList<String> finalLines = new ArrayList<String>();
+    	int endRequires = -1;
+    	boolean sawRequires = false;
+    	boolean stillSearching = true;
+    	for (String line : lines)
+    	{
+    		if (stillSearching)
+    		{
+	            int c = line.indexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+	            if (c > -1)
+	            {
+	                int c2 = line.indexOf(")");
+	                String s = line.substring(c + 14, c2 - 1);
+                    if (s.equals(IASLanguageConstants.XML))
+                    {
+                        foundXML = true;
+                    }
+	    			sawRequires = true;
+	    			if (!usedNames.contains(s))
+	    				continue;
+	    		}
+	    		else if (sawRequires)
+	    		{
+	    			stillSearching = false;
+	    			endRequires = finalLines.size();
+	    		}
+    		}
+    		finalLines.add(line);
+    	}
+        boolean needXML = ((FlexJSProject)(((IMXMLBlockWalker) getMXMLWalker()).getProject())).needXML;
+        if (needXML && !foundXML)
+        {
+            StringBuilder appendString = new StringBuilder();
+            appendString.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+            appendString.append(ASEmitterTokens.PAREN_OPEN.getToken());
+            appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+            appendString.append(IASLanguageConstants.XML);
+            appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+            appendString.append(ASEmitterTokens.PAREN_CLOSE.getToken());
+            appendString.append(ASEmitterTokens.SEMICOLON.getToken());
+            finalLines.add(endRequires, appendString.toString());
+            // TODO (aharui) addLineToMappings(finalLines.size());
+        }
+    	// append info() structure if main CU
+        ICompilerProject project = getMXMLWalker().getProject();
+        if (project instanceof FlexJSProject)
+        {
+            FlexJSProject flexJSProject = (FlexJSProject) project;
+            String mainDef = null;
+			try {
+				mainDef = flexJSProject.mainCU.getQualifiedNames().get(0);
+			} catch (InterruptedException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+            String thisDef = documentDefinition.getQualifiedName();
+            if (mainDef != null && mainDef.equals(thisDef))
+            {
+            	Set<String> mixins = flexJSProject.config.getIncludes();
+            	if (mixins.size() > 0)
+            	{
+	            	String infoInject = "\n\n" + thisDef + ".prototype.info = function() {\n" +
+	            						"  return { mixins: [";
+	            	boolean firstOne = true;
+	            	for (String mixin : mixins)
+	            	{
+	            		if (!firstOne)
+	            			infoInject += ", "; 
+	            		infoInject += mixin;
+	            		firstOne = false;
+	                    StringBuilder appendString = new StringBuilder();
+	                    appendString.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+	                    appendString.append(ASEmitterTokens.PAREN_OPEN.getToken());
+	                    appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+	                    appendString.append(mixin);
+	                    appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken());
+	                    appendString.append(ASEmitterTokens.PAREN_CLOSE.getToken());
+	                    appendString.append(ASEmitterTokens.SEMICOLON.getToken());
+                        finalLines.add(endRequires, appendString.toString());
+                        //addLineToMappings(finalLines.size());
+	            	}
+	            	infoInject += "]}};";
+                    finalLines.add(infoInject);
+                    //addLineToMappings(finalLines.size());	            	
+            	}
+            }
+        }
+    	return Joiner.on("\n").join(finalLines);
+    }
+    
+    @Override
+    protected String getIndent(int numIndent)
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < numIndent; i++)
+            sb.append(JSFlexJSEmitterTokens.INDENT.getToken());
+        return sb.toString();
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitDeclarations(IMXMLDeclarationsNode node)
+    {
+    	inMXMLContent = true;
+        MXMLDescriptorSpecifier currentInstance = getCurrentDescriptor("i");
+
+        MXMLDescriptorSpecifier currentPropertySpecifier = new MXMLDescriptorSpecifier();
+        currentPropertySpecifier.isProperty = true;
+        currentPropertySpecifier.name = "mxmlContent";
+        currentPropertySpecifier.parent = currentInstance;
+        descriptorTree.add(currentPropertySpecifier);
+        moveDown(false, currentInstance, currentPropertySpecifier);
+    	super.emitDeclarations(node);
+        moveUp(false, false);
+    	inMXMLContent = false;
+    }
+    
+    @Override
+    public void emitDocument(IMXMLDocumentNode node)
+    {
+        descriptorTree = new ArrayList<MXMLDescriptorSpecifier>();
+        propertiesTree = new MXMLDescriptorSpecifier();
+
+        events = new ArrayList<MXMLEventSpecifier>();
+        instances = new ArrayList<MXMLDescriptorSpecifier>();
+        scripts = new ArrayList<MXMLScriptSpecifier>();
+        //styles = new ArrayList<MXMLStyleSpecifier>();
+
+        currentInstances = new ArrayList<MXMLDescriptorSpecifier>();
+        currentStateOverrides = new MXMLDescriptorSpecifier();
+        currentPropertySpecifiers = new ArrayList<MXMLDescriptorSpecifier>();
+
+        eventCounter = 0;
+        idCounter = 0;
+        bindingCounter = 0;
+        
+        // visit MXML
+        IClassDefinition cdef = node.getClassDefinition();
+        classDefinition = cdef;
+        documentDefinition = cdef;
+        
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) ((IMXMLBlockWalker) getMXMLWalker())
+                .getASEmitter();
+
+        fjs.getModel().setCurrentClass(cdef);
+
+        // visit tags
+        final int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            getMXMLWalker().walk(node.getChild(i));
+        }
+
+        String cname = node.getFileNode().getName();
+
+        emitHeader(node);
+
+        emitClassDeclStart(cname, node.getBaseClassName(), false);
+
+        emitComplexInitializers(node);
+
+        emitPropertyDecls();
+        
+        emitClassDeclEnd(cname, node.getBaseClassName());
+
+        emitMetaData(cdef);
+
+        write(subDocuments.toString());
+        writeNewline();
+
+        emitScripts();
+
+        fjs.getBindableEmitter().emit(cdef);
+        fjs.getAccessorEmitter().emit(cdef);
+        
+        emitEvents(cname);
+
+        emitPropertyGetterSetters(cname);
+
+        emitMXMLDescriptorFuncs(cname);
+
+        emitBindingData(cname, cdef);
+    }
+
+    public void emitSubDocument(IMXMLComponentNode node)
+    {
+        ArrayList<MXMLDescriptorSpecifier> oldDescriptorTree;
+        MXMLDescriptorSpecifier oldPropertiesTree;
+        ArrayList<MXMLEventSpecifier> oldEvents;
+        ArrayList<MXMLScriptSpecifier> oldScripts;
+        ArrayList<MXMLDescriptorSpecifier> oldCurrentInstances;
+        ArrayList<MXMLDescriptorSpecifier> oldInstances;
+        ArrayList<MXMLDescriptorSpecifier> oldCurrentPropertySpecifiers;
+        int oldEventCounter;
+        int oldIdCounter;
+        boolean oldInMXMLContent;
+        
+        oldDescriptorTree = descriptorTree;
+        descriptorTree = new ArrayList<MXMLDescriptorSpecifier>();
+        oldPropertiesTree = propertiesTree;
+        propertiesTree = new MXMLDescriptorSpecifier();
+
+        oldInMXMLContent = inMXMLContent;
+        inMXMLContent = false;
+        oldEvents = events;
+        events = new ArrayList<MXMLEventSpecifier>();
+        oldInstances = instances;
+        instances = new ArrayList<MXMLDescriptorSpecifier>();
+        oldScripts = scripts;
+        scripts = new ArrayList<MXMLScriptSpecifier>();
+        //styles = new ArrayList<MXMLStyleSpecifier>();
+
+        oldCurrentInstances = currentInstances;
+        currentInstances = new ArrayList<MXMLDescriptorSpecifier>();
+        oldCurrentPropertySpecifiers = currentPropertySpecifiers;
+        currentPropertySpecifiers = new ArrayList<MXMLDescriptorSpecifier>();
+
+        oldEventCounter = eventCounter;
+        eventCounter = 0;
+        oldIdCounter = idCounter;
+        idCounter = 0;
+
+        // visit MXML
+        IClassDefinition oldClassDef = classDefinition;
+        IClassDefinition cdef = node.getContainedClassDefinition();
+        classDefinition = cdef;
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+                .getASEmitter();
+        ((JSFlexJSEmitter) asEmitter).getModel().pushClass(cdef);
+        
+        IASNode classNode = node.getContainedClassDefinitionNode();
+        // visit tags
+        final int len = classNode.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            getMXMLWalker().walk(classNode.getChild(i));
+        }
+
+        String cname = cdef.getQualifiedName();
+        subDocumentNames.add(cname);
+        ((JSFlexJSEmitter) asEmitter).mxmlEmitter = this;
+        String baseClassName = cdef.getBaseClassAsDisplayString();
+
+        emitClassDeclStart(cname, baseClassName, false);
+
+        emitComplexInitializers(classNode);
+        
+        emitPropertyDecls();
+        
+        emitClassDeclEnd(cname, baseClassName);
+
+        emitMetaData(cdef);
+
+        emitScripts();
+
+        emitEvents(cname);
+
+        emitPropertyGetterSetters(cname);
+
+        emitMXMLDescriptorFuncs(cname);
+
+        emitBindingData(cname, cdef);
+
+        write(((JSFlexJSEmitter) asEmitter).stringifyDefineProperties(cdef));
+        
+        descriptorTree = oldDescriptorTree;
+        propertiesTree = oldPropertiesTree;
+        events = oldEvents;
+        scripts = oldScripts;
+        currentInstances = oldCurrentInstances;
+        allInstances.addAll(instances);
+        instances = oldInstances;
+        currentPropertySpecifiers = oldCurrentPropertySpecifiers;
+        eventCounter = oldEventCounter;
+        idCounter = oldIdCounter;
+        inMXMLContent = oldInMXMLContent;
+        classDefinition = oldClassDef;
+        ((JSFlexJSEmitter) asEmitter).getModel().popClass();
+        ((JSFlexJSEmitter) asEmitter).mxmlEmitter = null;
+
+    }
+
+    @Override
+    public void emitMetadata(IMXMLMetadataNode node)
+    {
+        metadataNodes.add(node);
+    }
+
+    //--------------------------------------------------------------------------
+
+    protected void emitClassDeclStart(String cname, String baseClassName,
+            boolean indent)
+    {
+        writeNewline();
+        writeNewline("/**");
+        writeNewline(" * @constructor");
+        writeNewline(" * @extends {" + formatQualifiedName(baseClassName) + "}");
+        writeNewline(" */");
+        writeToken(formatQualifiedName(cname));
+        writeToken(ASEmitterTokens.EQUAL);
+        write(ASEmitterTokens.FUNCTION);
+        write(ASEmitterTokens.PAREN_OPEN);
+        writeToken(ASEmitterTokens.PAREN_CLOSE);
+        if (indent)
+            indentPush();
+        writeNewline(ASEmitterTokens.BLOCK_OPEN, true);
+        write(formatQualifiedName(cname));
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        write(JSGoogEmitterTokens.GOOG_BASE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(ASEmitterTokens.THIS);
+        writeToken(ASEmitterTokens.COMMA);
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(JSGoogEmitterTokens.GOOG_CONSTRUCTOR);
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline(ASEmitterTokens.SEMICOLON);        
+    }
+
+    //--------------------------------------------------------------------------
+
+    protected void emitClassDeclEnd(String cname, String baseClassName)
+    {
+        writeNewline();
+        writeNewline("/**");
+        writeNewline(" * @private");
+        writeNewline(" * @type {Array}");
+        writeNewline(" */");
+        writeNewline("this.mxmldd;");
+
+        // top level is 'mxmlContent', skip it...
+        if (currentStateOverrides.propertySpecifiers.size() > 0)
+        {
+            MXMLDescriptorSpecifier root = currentStateOverrides;
+            root.isTopNode = true;
+    
+	        writeNewline("/**");
+	        writeNewline(" * @export");
+	        writeNewline(" * @type {Array}");
+	        writeNewline(" */");
+	        writeNewline("this.mxmlsd = " + ASEmitterTokens.SQUARE_OPEN.getToken());
+	        indentPush();
+	        write(root.outputStateDescriptors());
+	        write("null");
+	        write(ASEmitterTokens.SQUARE_CLOSE);
+	        indentPop();
+	        writeNewline(ASEmitterTokens.SEMICOLON);
+        }
+        
+        writeNewline();
+        writeNewline("/**");
+        writeNewline(" * @private");
+        writeNewline(" * @type {Array}");
+        writeNewline(" */");
+
+        indentPop();
+        writeNewline("this.mxmldp;");
+
+        if (propertiesTree.propertySpecifiers.size() > 0 ||
+                propertiesTree.eventSpecifiers.size() > 0)
+        {
+            indentPush();
+            writeNewline();
+            writeNewline("this.generateMXMLAttributes");
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(ASEmitterTokens.SQUARE_OPEN);
+    
+            MXMLDescriptorSpecifier root = propertiesTree;
+            root.isTopNode = true;
+            writeNewline(root.output(true));
+    
+            write(ASEmitterTokens.SQUARE_CLOSE);
+            write(ASEmitterTokens.PAREN_CLOSE);
+            writeNewline(ASEmitterTokens.SEMICOLON);
+            indentPop();
+            writeNewline();
+        }
+
+        write(ASEmitterTokens.BLOCK_CLOSE);
+        writeNewline(ASEmitterTokens.SEMICOLON);
+        write(JSGoogEmitterTokens.GOOG_INHERITS);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(formatQualifiedName(cname));
+        writeToken(ASEmitterTokens.COMMA);
+        write(formatQualifiedName(baseClassName));
+        write(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline(ASEmitterTokens.SEMICOLON);
+        writeNewline();
+        writeNewline();
+    }
+
+    //--------------------------------------------------------------------------
+
+    protected void emitMetaData(IClassDefinition cdef)
+    {
+        String cname = cdef.getQualifiedName();
+        
+        writeNewline("/**");
+        writeNewline(" * Metadata");
+        writeNewline(" *");
+        writeNewline(" * @type {Object.<string, Array.<Object>>}");
+        writeNewline(" */");
+        write(formatQualifiedName(cname) + ".prototype.FLEXJS_CLASS_INFO = { names: [{ name: '");
+        write(cdef.getBaseName());
+        write("', qName: '");
+        write(formatQualifiedName(cname));
+        write("' }]");
+        if (interfaceList != null)
+        {
+        	write(", interfaces: [");
+        	write(interfaceList);
+        	write("]");
+        }
+        write(" };");
+        
+	    writeNewline();
+	    writeNewline();
+	    writeNewline();
+        writeNewline("/**");
+	    writeNewline(" * Prevent renaming of class. Needed for reflection.");
+        writeNewline(" */");
+	    write(JSFlexJSEmitterTokens.GOOG_EXPORT_SYMBOL);
+	    write(ASEmitterTokens.PAREN_OPEN);
+	    write(ASEmitterTokens.SINGLE_QUOTE);
+	    write(formatQualifiedName(cname));
+	    write(ASEmitterTokens.SINGLE_QUOTE);
+	    write(ASEmitterTokens.COMMA);
+	    write(ASEmitterTokens.SPACE);
+	    write(formatQualifiedName(cname));
+	    write(ASEmitterTokens.PAREN_CLOSE);
+	    write(ASEmitterTokens.SEMICOLON);
+
+        emitReflectionData(cdef);
+        writeNewline();
+        writeNewline();
+        
+    }
+    
+    private void emitReflectionData(IClassDefinition cdef)
+    {
+        JSFlexJSEmitter asEmitter = (JSFlexJSEmitter)((IMXMLBlockWalker) getMXMLWalker()).getASEmitter();
+
+        ArrayList<PackageFooterEmitter.VariableData> varData = new ArrayList<PackageFooterEmitter.VariableData>();
+        // vars can only come from script blocks?
+        List<IVariableNode> vars = asEmitter.getModel().getVars();
+        for (IVariableNode varNode : vars)
+        {
+            String ns = varNode.getNamespace();
+            if (ns == IASKeywordConstants.PUBLIC)
+            {
+            	PackageFooterEmitter.VariableData data = asEmitter.packageFooterEmitter.new VariableData();
+            	varData.add(data);
+            	data.name = varNode.getName();
+        	    data.type = formatQualifiedName(varNode.getVariableType());
+        	    IMetaTagsNode metaData = varNode.getMetaTags();
+        	    if (metaData != null)
+        	    {
+        	    	IMetaTagNode[] tags = metaData.getAllTags();
+        	    	if (tags.length > 0)
+        	    		data.metaData = tags;
+        	    }
+            }
+        }
+        
+        ArrayList<PackageFooterEmitter.MethodData> accessorData = new ArrayList<PackageFooterEmitter.MethodData>();
+        HashMap<String, PropertyNodes> accessors = asEmitter.getModel().getPropertyMap();
+        for (String propName : accessors.keySet())
+        {
+        	PropertyNodes p = accessors.get(propName);
+        	IFunctionNode accessorNode = p.getter;
+        	if (accessorNode == null)
+        		accessorNode = p.setter;
+            String ns = accessorNode.getNamespace();
+            if (ns == IASKeywordConstants.PUBLIC)
+            {
+            	PackageFooterEmitter.MethodData data = asEmitter.packageFooterEmitter.new MethodData();
+            	accessorData.add(data);
+            	data.name = accessorNode.getName();
+            	if (p.getter != null)
+            		data.type = formatQualifiedName(p.getter.getReturnType());
+            	else
+            		data.type = formatQualifiedName(p.setter.getVariableType());
+	    	    data.declaredBy = formatQualifiedName(cdef.getQualifiedName());
+        	    IMetaTagsNode metaData = accessorNode.getMetaTags();
+        	    if (metaData != null)
+        	    {
+        	    	IMetaTagNode[] tags = metaData.getAllTags();
+        	    	if (tags.length > 0)
+        	    		data.metaData = tags;
+        	    }
+            }
+        }
+        
+        for (MXMLDescriptorSpecifier instance : instances)
+        {
+            if (!instance.id.startsWith(MXMLFlexJSEmitterTokens.ID_PREFIX
+                    .getToken()))
+            {
+	        	PackageFooterEmitter.MethodData data = asEmitter.packageFooterEmitter.new MethodData();
+	        	accessorData.add(data);
+	        	data.name = instance.id;
+	        	data.type = formatQualifiedName(instance.name);
+	    	    data.declaredBy = formatQualifiedName(cdef.getQualifiedName());
+            }	        	
+        }
+        
+        ArrayList<PackageFooterEmitter.MethodData> methodData = new ArrayList<PackageFooterEmitter.MethodData>();
+        List<IFunctionNode> methods = asEmitter.getModel().getMethods();
+        for (IFunctionNode methodNode : methods)
+        {
+            String ns = methodNode.getNamespace();
+            if (ns == IASKeywordConstants.PUBLIC)
+            {
+            	PackageFooterEmitter.MethodData data = asEmitter.packageFooterEmitter.new MethodData();
+            	methodData.add(data);
+            	data.name = methodNode.getName();
+            	data.type = formatQualifiedName(methodNode.getReturnType());
+        	    data.declaredBy = formatQualifiedName(cdef.getQualifiedName());
+        	    IMetaTagsNode metaData = methodNode.getMetaTags();
+        	    if (metaData != null)
+        	    {
+        	    	IMetaTagNode[] tags = metaData.getAllTags();
+        	    	if (tags.length > 0)
+        	    		data.metaData = tags;
+        	    }
+            }
+        }
+        
+        for (MXMLEventSpecifier event : events)
+        {
+        	PackageFooterEmitter.MethodData data = asEmitter.packageFooterEmitter.new MethodData();
+        	methodData.add(data);
+        	data.name = event.eventHandler;
+        	data.type = ASEmitterTokens.VOID.getToken();
+    	    data.declaredBy = formatQualifiedName(cdef.getQualifiedName());
+        }
+        
+        ArrayList<IMetaTagNode> metadataTagNodes = new ArrayList<IMetaTagNode>();
+        for (IMXMLMetadataNode metadataTag : metadataNodes)
+        {
+        	IMetaTagNode[] tags = metadataTag.getMetaTagNodes();
+        	for (IMetaTagNode tag : tags)
+        	{
+        		metadataTagNodes.add(tag);
+        	}
+        }
+        IMetaTagNode[] metaDataTags = new IMetaTagNode[metadataTagNodes.size()];
+        asEmitter.packageFooterEmitter.emitReflectionData(formatQualifiedName(cdef.getQualifiedName()), varData, 
+        		accessorData, methodData, metadataTagNodes.toArray(metaDataTags));
+    }
+
+    //--------------------------------------------------------------------------
+
+    protected void emitPropertyDecls()
+    {
+        for (MXMLDescriptorSpecifier instance : instances)
+        {
+            writeNewline();
+            writeNewline("/**");
+            writeNewline(" * @private");
+            writeNewline(" * @type {" + instance.name + "}");
+            writeNewline(" */");
+            write(ASEmitterTokens.THIS);
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(instance.id + "_");
+            writeNewline(ASEmitterTokens.SEMICOLON);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+
+    protected void emitBindingData(String cname, IClassDefinition cdef)
+    {
+        BindingDatabase bd = BindingDatabase.bindingMap.get(cdef);
+        if (bd == null)
+            return;
+        if (bd.getBindingInfo().isEmpty())
+            return;
+
+        outputBindingInfoAsData(cname, bd);
+    }
+
+    private void outputBindingInfoAsData(String cname, BindingDatabase bindingDataBase)
+    {
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+        .getASEmitter();
+
+        writeNewline("/**");
+        writeNewline(" * @export");
+        writeNewline(" */");
+        writeNewline(formatQualifiedName(cname)
+                + ".prototype._bindings = [");
+        
+        Set<BindingInfo> bindingInfo = bindingDataBase.getBindingInfo();
+        writeNewline(bindingInfo.size() + ","); // number of bindings
+        
+        for (BindingInfo bi : bindingInfo)
+        {
+            String s;
+            s = bi.getSourceString();
+            if (s == null)
+                s = getSourceStringFromGetter(bi.getExpressionNodesForGetter());
+            if (s.contains("."))
+            {
+                String[] parts = s.split("\\.");
+                write(ASEmitterTokens.SQUARE_OPEN.getToken() + ASEmitterTokens.DOUBLE_QUOTE.getToken() + 
+                        parts[0] + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+                int n = parts.length;
+                for (int i = 1; i < n; i++)
+                {
+                    String part = parts[i];
+                    write(", " +  ASEmitterTokens.DOUBLE_QUOTE.getToken() + part + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+                }
+                writeNewline(ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.COMMA.getToken());
+            }
+            else if (s == null || s.length() == 0)
+            {
+                List<IExpressionNode> getterNodes = bi.getExpressionNodesForGetter();
+                StringBuilder sb = new StringBuilder();
+                sb.append("function() { return ");
+                int n = getterNodes.size();
+                for (int i = 0; i < n; i++)
+                {
+                	IExpressionNode getterNode = getterNodes.get(i);
+                	if (getterNode.getNodeID() == ASTNodeID.LiteralStringID)
+                	{
+                		sb.append(ASEmitterTokens.DOUBLE_QUOTE.getToken());
+                		sb.append(asEmitter.stringifyNode(getterNode));
+                		sb.append(ASEmitterTokens.DOUBLE_QUOTE.getToken());
+                	}
+                	else
+                		sb.append(asEmitter.stringifyNode(getterNode));
+                    if (i < n - 1)
+                    	sb.append(ASEmitterTokens.SPACE.getToken() + ASEmitterTokens.PLUS.getToken() + ASEmitterTokens.SPACE.getToken());
+                }
+                sb.append("; },");
+                writeNewline(sb.toString());
+            }
+            else
+                writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + s + 
+                        ASEmitterTokens.DOUBLE_QUOTE.getToken() + ASEmitterTokens.COMMA.getToken());
+            
+            IExpressionNode destNode = bi.getExpressionNodeForDestination();
+            if (destNode != null)
+            {
+                StringBuilder sb = new StringBuilder();
+                sb.append(generateSetterFunction(destNode));
+                writeNewline(sb.toString() + ASEmitterTokens.COMMA.getToken());
+            }
+            else
+                writeNewline(ASEmitterTokens.NULL.getToken() + ASEmitterTokens.COMMA.getToken());
+            
+            s = bi.getDestinationString();
+            if (s == null)
+            {
+                writeNewline(ASEmitterTokens.NULL.getToken() + ASEmitterTokens.COMMA.getToken());            	
+            }
+            else if (s.contains("."))
+            {
+                String[] parts = s.split("\\.");
+                write(ASEmitterTokens.SQUARE_OPEN.getToken() + ASEmitterTokens.DOUBLE_QUOTE.getToken() + 
+                        parts[0] + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+                int n = parts.length;
+                for (int i = 1; i < n; i++)
+                {
+                    String part = parts[i];
+                    write(", " + ASEmitterTokens.DOUBLE_QUOTE.getToken() + part + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+                }
+                writeNewline(ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.COMMA.getToken());
+            }
+            else
+                writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + s +
+                        ASEmitterTokens.DOUBLE_QUOTE.getToken() + ASEmitterTokens.COMMA.getToken());
+        }
+        Set<Entry<Object, WatcherInfoBase>> watcherChains = bindingDataBase.getWatcherChains();
+        if (watcherChains != null)
+        {
+            for (Entry<Object, WatcherInfoBase> entry : watcherChains)
+            {
+                WatcherInfoBase watcherInfoBase = entry.getValue();
+                encodeWatcher(watcherInfoBase);
+            }
+        }
+        // add a trailing null for now so I don't have to have logic where the watcher figures out not to add
+        // a comma
+        writeNewline("null" + ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.SEMICOLON.getToken());
+    }
+
+    private String generateSetterFunction(IExpressionNode destNode) {
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+        	.getASEmitter();
+		String body = asEmitter.stringifyNode(destNode);
+        
+		StringBuilder sb = new StringBuilder();
+		sb.append("function (value) { ");
+		int lastGet = body.lastIndexOf("get_");
+		int lastDot = body.lastIndexOf(".");
+		if (lastDot == lastGet - 1)
+		{
+			String object = body.substring(0, lastDot);
+			String getter = body.substring(lastDot);
+			String setter = getter.replace("get_", "set_");
+			setter = setter.replace("()", "(value)");
+			body = object + setter;
+			sb.append(body);
+		}
+		else
+		{
+			sb.append(body);
+			sb.append(" = value;");
+		}
+		sb.append(";}");
+		return sb.toString();
+	}
+
+	private void encodeWatcher(WatcherInfoBase watcherInfoBase)
+    {
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+        .getASEmitter();
+
+        writeNewline(watcherInfoBase.getIndex() + ASEmitterTokens.COMMA.getToken());
+        WatcherType type = watcherInfoBase.getType();
+        if (type == WatcherType.FUNCTION)
+        {
+            writeNewline("0" + ASEmitterTokens.COMMA.getToken());
+
+            FunctionWatcherInfo functionWatcherInfo = (FunctionWatcherInfo)watcherInfoBase;
+           
+            writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + functionWatcherInfo.getFunctionName() + 
+                    ASEmitterTokens.DOUBLE_QUOTE.getToken());
+            IExpressionNode params[] = functionWatcherInfo.params;
+            StringBuilder sb = new StringBuilder();
+            sb.append("function() { return [");
+            boolean firstone = true;
+            for (IExpressionNode param : params)
+            {
+                if (firstone)
+                    firstone = false;
+                sb.append(ASEmitterTokens.COMMA.getToken());
+                sb.append(asEmitter.stringifyNode(param));   
+            }
+            sb.append("]; },");
+            outputEventNames(functionWatcherInfo.getEventNames());
+            outputBindings(functionWatcherInfo.getBindings());
+        }
+        else if ((type == WatcherType.STATIC_PROPERTY) || (type == WatcherType.PROPERTY))
+        {
+            writeNewline((type == WatcherType.STATIC_PROPERTY ? "1" : "2") + 
+                    ASEmitterTokens.COMMA.getToken());
+
+            PropertyWatcherInfo propertyWatcherInfo = (PropertyWatcherInfo)watcherInfoBase;
+           
+            boolean makeStaticWatcher = (watcherInfoBase.getType() == WatcherType.STATIC_PROPERTY);
+            
+            // round up the getter function for the watcher, or null if we don't need one
+            MethodInfo propertyGetterFunction = null;
+            if (watcherInfoBase.isRoot && !makeStaticWatcher)
+            {
+                // TODO: figure out what this looks like
+                // propertyGetterFunction = this.propertyGetter;
+                // assert propertyGetterFunction != null;
+            }
+            else if (watcherInfoBase.isRoot && makeStaticWatcher)
+            {
+                 // TODO: implement getter func for static watcher.
+            }
+            writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + propertyWatcherInfo.getPropertyName() +
+                    ASEmitterTokens.DOUBLE_QUOTE.getToken() + ASEmitterTokens.COMMA.getToken());
+            outputEventNames(propertyWatcherInfo.getEventNames());
+            outputBindings(propertyWatcherInfo.getBindings());
+            if (propertyGetterFunction == null)
+                writeNewline("null" + ASEmitterTokens.COMMA.getToken()); // null is valid
+            if (type == WatcherType.STATIC_PROPERTY)
+            {
+                StaticPropertyWatcherInfo pwinfo = (StaticPropertyWatcherInfo)watcherInfoBase;
+                Name classMName = pwinfo.getContainingClass(getMXMLWalker().getProject());
+                writeNewline(nameToString(classMName));
+            }
+        }
+        else if (type == WatcherType.XML)
+        {
+            writeNewline("3" + ASEmitterTokens.COMMA.getToken());
+
+            XMLWatcherInfo xmlWatcherInfo = (XMLWatcherInfo)watcherInfoBase;
+            writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + xmlWatcherInfo.getPropertyName() +
+                    ASEmitterTokens.DOUBLE_QUOTE.getToken() + ASEmitterTokens.COMMA.getToken());
+            outputBindings(xmlWatcherInfo.getBindings());
+        }
+        else assert false;     
+
+        // then recurse into children
+        Set<Entry<Object, WatcherInfoBase>> children = watcherInfoBase.getChildren();
+        if (children != null)
+        {
+            writeNewline(ASEmitterTokens.SQUARE_OPEN.getToken());
+            for ( Entry<Object, WatcherInfoBase> ent : children)
+            {
+                encodeWatcher(ent.getValue());
+            }
+            writeNewline("null" + ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.COMMA.getToken());
+        }
+        else
+        {
+            writeNewline("null" + ASEmitterTokens.COMMA.getToken());
+        }
+    }
+    
+    private String getSourceStringFromMemberAccessExpressionNode(MemberAccessExpressionNode node)
+    {
+        String s = "";
+        
+        IExpressionNode left = node.getLeftOperandNode();
+        if (left instanceof FunctionCallNode) //  probably a cast
+        {
+            IASNode child = ((FunctionCallNode)left).getArgumentsNode().getChild(0);
+            if (child instanceof IdentifierNode)
+                s = getSourceStringFromIdentifierNode((IdentifierNode)child);
+            else if (child instanceof MemberAccessExpressionNode)
+                s = getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)child);
+        }
+        else if (left instanceof MemberAccessExpressionNode)
+            s = getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)left);
+        else if (left instanceof IdentifierNode)
+            s = getSourceStringFromIdentifierNode((IdentifierNode)left);
+        else
+            System.out.println("expected binding member access left node" + node.toString());
+        s += ".";
+        
+        IExpressionNode right = node.getRightOperandNode();
+        if (right instanceof FunctionCallNode) //  probably a cast
+        {
+            IASNode child = ((FunctionCallNode)right).getArgumentsNode().getChild(0);
+            if (child instanceof IdentifierNode)
+                s += getSourceStringFromIdentifierNode((IdentifierNode)child);
+            else if (child instanceof MemberAccessExpressionNode)
+                s += getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)child);
+        }
+        else if (right instanceof MemberAccessExpressionNode)
+            s += getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)right);
+        else if (right instanceof IdentifierNode)
+            s += getSourceStringFromIdentifierNode((IdentifierNode)right);
+        else
+            System.out.println("expected binding member access right node" + node.toString());
+        
+        return s;
+    }
+    
+    private String getSourceStringFromIdentifierNode(IdentifierNode node)
+    {
+        return node.getName();
+    }
+    
+    private String getSourceStringFromGetter(List<IExpressionNode> nodes)
+    {
+        String s = "";
+        IExpressionNode node = nodes.get(0);
+        if (node instanceof MemberAccessExpressionNode)
+        {
+            s = getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)node);
+        }
+        else if (node instanceof IdentifierNode)
+        {
+            s = ((IdentifierNode)node).getName();
+        }
+        return s;
+    }
+    
+    private void outputEventNames(List<String> events)
+    {
+        if (events.size() > 1)
+        {
+            int n = events.size();
+            write(ASEmitterTokens.SQUARE_OPEN.getToken() + ASEmitterTokens.DOUBLE_QUOTE.getToken() +
+                    events.get(0) + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+            for (int i = 1; i < n; i++)
+            {
+                String event = events.get(i);
+                write(ASEmitterTokens.COMMA.getToken() + ASEmitterTokens.DOUBLE_QUOTE.getToken() + 
+                        event + ASEmitterTokens.DOUBLE_QUOTE.getToken());
+            }
+            writeNewline(ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.COMMA.getToken());
+        }
+        else if (events.size() == 1)
+            writeNewline(ASEmitterTokens.DOUBLE_QUOTE.getToken() + events.get(0) +
+                    ASEmitterTokens.DOUBLE_QUOTE.getToken() + ASEmitterTokens.COMMA.getToken());
+        else
+            writeNewline("null" + ASEmitterTokens.COMMA.getToken());
+    }
+    
+    private void outputBindings(List<BindingInfo> bindings)
+    {
+        if (bindings.size() > 1)
+        {
+            int n = bindings.size();
+            write(ASEmitterTokens.SQUARE_OPEN.getToken() + bindings.get(0).getIndex());
+            for (int i = 1; i < n; i++)
+            {
+                BindingInfo binding = bindings.get(i);
+                write(ASEmitterTokens.COMMA.getToken() + binding.getIndex());
+            }
+            writeNewline(ASEmitterTokens.SQUARE_CLOSE.getToken() + ASEmitterTokens.COMMA.getToken());
+        }
+        else if (bindings.size() == 1)
+            writeNewline(bindings.get(0).getIndex() + ASEmitterTokens.COMMA.getToken());
+        else
+            writeNewline("null" + ASEmitterTokens.COMMA.getToken());
+        
+    }
+
+    //--------------------------------------------------------------------------    
+
+    protected void emitScripts()
+    {
+        for (MXMLScriptSpecifier script : scripts)
+        {
+            String output = script.output();
+
+            if (!output.equals(""))
+            {
+                writeNewline(output);
+            }
+        }
+    }
+
+    //--------------------------------------------------------------------------    
+
+    protected void emitEvents(String cname)
+    {
+        for (MXMLEventSpecifier event : events)
+        {
+            writeNewline("/**");
+            writeNewline(" * @export");
+            writeNewline(" * @param {" + formatQualifiedName(event.type) + "} event");
+            writeNewline(" */");
+            writeNewline(formatQualifiedName(cname)
+                    + ".prototype." + event.eventHandler + " = function(event)");
+            writeNewline(ASEmitterTokens.BLOCK_OPEN, true);
+
+            writeNewline(event.value + ASEmitterTokens.SEMICOLON.getToken(),
+                    false);
+
+            write(ASEmitterTokens.BLOCK_CLOSE);
+            writeNewline(";");
+            writeNewline();
+            writeNewline();
+        }
+    }
+
+    //--------------------------------------------------------------------------    
+
+    protected void emitPropertyGetterSetters(String cname)
+    {
+    	int n = 0;
+        for (MXMLDescriptorSpecifier instance : instances)
+        {
+            if (!instance.id.startsWith(MXMLFlexJSEmitterTokens.ID_PREFIX
+                    .getToken()))
+            {
+            	n++;
+            }
+        }
+    	if (n == 0 && descriptorTree.size() == 0)
+    		return;
+    	
+    	String formattedCName = formatQualifiedName(cname);
+    	
+    	write("Object.defineProperties(");
+    	write(formattedCName);
+    	writeNewline(".prototype, /** @lends {" + formattedCName + ".prototype} */ {");
+        indentPush();
+        int i = 0;
+        for (MXMLDescriptorSpecifier instance : instances)
+        {
+            if (!instance.id.startsWith(MXMLFlexJSEmitterTokens.ID_PREFIX
+                    .getToken()))
+            {
+                indentPush();
+                writeNewline("/** @export */");
+                writeNewline(instance.id + ": {");
+                writeNewline("/** @this {" + formattedCName + "} */");
+                indentPush();
+                writeNewline("get: function() {");
+                indentPop();
+                writeNewline("return this." + instance.id + "_;");
+                writeNewline("},");
+                writeNewline("/** @this {" + formattedCName + "} */");
+                indentPush();
+                writeNewline("set: function(value) {");
+                indentPush();
+                writeNewline("if (value != this." + instance.id + "_) {");
+                writeNewline("this." + instance.id + "_ = value;");
+                write("this.dispatchEvent(org.apache.flex.events.ValueChangeEvent.createUpdateEvent(this, '");
+                indentPop();
+                writeNewline(instance.id + "', null, value));");
+                indentPop();
+                writeNewline("}");
+                indentPop();
+                writeNewline("}");
+                if (i < n - 1 || descriptorTree.size() > 0)
+                	writeNewline("},");
+                else
+                {
+                    indentPop();
+                    writeNewline("}");
+                }
+                i++;
+            }
+        }
+        if (descriptorTree.size() == 0)
+        	writeNewline("});");
+    }
+
+    //--------------------------------------------------------------------------    
+
+    protected void emitMXMLDescriptorFuncs(String cname)
+    {
+        // top level is 'mxmlContent', skip it...
+        if (descriptorTree.size() > 0)
+        {
+            FlexJSProject project = (FlexJSProject) getMXMLWalker().getProject();
+            project.needLanguage = true;
+            MXMLDescriptorSpecifier root = descriptorTree.get(0);
+            root.isTopNode = false;
+    
+            indentPush();
+            writeNewline("'MXMLDescriptor': {");
+            writeNewline("/** @this {" + formatQualifiedName(cname) + "} */");
+            indentPush();
+            writeNewline("get: function() {");
+            indentPush();
+            writeNewline("{");
+            writeNewline("if (this.mxmldd == undefined)");
+            indentPush();
+            writeNewline("{");
+            writeNewline("/** @type {Array} */");
+            writeNewline("var arr = org.apache.flex.utils.Language.superGetter(" + formatQualifiedName(cname) + ",this, 'MXMLDescriptor');");
+            writeNewline("/** @type {Array} */");
+            indentPop();
+            indentPop();
+            writeNewline("var data = [");
+    
+            writeNewline(root.output(true));
+    
+            indentPush();
+            writeNewline("];");
+            indentPush();
+            writeNewline("");
+            indentPush();
+            writeNewline("if (arr)");
+            indentPop();
+            writeNewline("this.mxmldd = arr.concat(data);");
+            indentPush();
+            writeNewline("else");
+            indentPop();
+            indentPop();
+            writeNewline("this.mxmldd = data;");
+            writeNewline("}");
+            indentPop();
+            writeNewline("return this.mxmldd;");
+            writeNewline("}");
+            indentPop();
+            writeNewline("}");
+            indentPop();
+            writeNewline("}");
+        	writeNewline("});");
+        }
+   
+    }
+
+    //--------------------------------------------------------------------------    
+
+    private HashMap<IMXMLEventSpecifierNode, String> eventHandlerNameMap = new HashMap<IMXMLEventSpecifierNode, String>();
+    
+    @Override
+    public void emitEventSpecifier(IMXMLEventSpecifierNode node)
+    {
+    	if (isStateDependent(node) && !inStatesOverride)
+    		return;
+    	
+        IDefinition cdef = node.getDefinition();
+
+        MXMLDescriptorSpecifier currentDescriptor = getCurrentDescriptor("i");
+
+        MXMLEventSpecifier eventSpecifier = new MXMLEventSpecifier();
+        eventSpecifier.eventHandler = MXMLFlexJSEmitterTokens.EVENT_PREFIX
+                .getToken() + eventCounter++;
+        eventSpecifier.name = cdef.getBaseName();
+        eventSpecifier.type = node.getEventParameterDefinition()
+                .getTypeAsDisplayString();
+
+        eventHandlerNameMap.put(node, eventSpecifier.eventHandler);
+        
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+                .getASEmitter();
+
+        StringBuilder sb = null;
+        int len = node.getChildCount();
+        if (len > 0)
+        {
+            sb = new StringBuilder();
+            for (int i = 0; i < len; i++)
+            {
+                sb.append(getIndent((i > 0) ? 1 : 0)
+                        + asEmitter.stringifyNode(node.getChild(i)));
+                if (i < len - 1)
+                {
+                    sb.append(ASEmitterTokens.SEMICOLON.getToken());
+                    sb.append(ASEmitterTokens.NEW_LINE.getToken());
+                }
+            }
+        }
+        eventSpecifier.value = sb.toString();
+
+	    if (currentDescriptor != null)
+	        currentDescriptor.eventSpecifiers.add(eventSpecifier);
+	    else if (!inStatesOverride) // in theory, if no currentdescriptor must be top tag event
+	        propertiesTree.eventSpecifiers.add(eventSpecifier);
+        events.add(eventSpecifier);
+    }
+
+    @Override
+    public void emitInstance(IMXMLInstanceNode node)
+    {
+        if (isStateDependent(node) && !inStatesOverride)
+            return;
+        
+        IClassDefinition cdef = node
+                .getClassReference((ICompilerProject) getMXMLWalker()
+                        .getProject());
+
+        MXMLDescriptorSpecifier currentPropertySpecifier = getCurrentDescriptor("ps");
+
+        String id = node.getID();
+        if (id == null)
+            id = node.getEffectiveID();
+        if (id == null)
+            id = MXMLFlexJSEmitterTokens.ID_PREFIX.getToken() + idCounter++;
+
+        MXMLDescriptorSpecifier currentInstance = new MXMLDescriptorSpecifier();
+        currentInstance.isProperty = false;
+        currentInstance.id = id;
+        currentInstance.name = formatQualifiedName(cdef.getQualifiedName());
+        currentInstance.parent = currentPropertySpecifier;
+
+        if (currentPropertySpecifier != null)
+            currentPropertySpecifier.propertySpecifiers.add(currentInstance);
+        else if (inMXMLContent)
+            descriptorTree.add(currentInstance);
+        else
+        {
+            currentInstance.parent = propertiesTree;
+            propertiesTree.propertySpecifiers.add(currentInstance);
+        }
+
+        instances.add(currentInstance);
+
+        IMXMLPropertySpecifierNode[] pnodes = node.getPropertySpecifierNodes();
+        if (pnodes != null)
+        {
+            moveDown(false, currentInstance, null);
+
+            for (IMXMLPropertySpecifierNode pnode : pnodes)
+            {
+                getMXMLWalker().walk(pnode); // Property Specifier
+            }
+
+            moveUp(false, true);
+        }
+        else if (node instanceof IMXMLStateNode)
+        {
+            IMXMLStateNode stateNode = (IMXMLStateNode)node;
+            String name = stateNode.getStateName();
+            if (name != null)
+            {
+                MXMLDescriptorSpecifier stateName = new MXMLDescriptorSpecifier();
+                stateName.isProperty = true;
+                stateName.id = id;
+                stateName.name = "name";
+                stateName.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + name + ASEmitterTokens.SINGLE_QUOTE.getToken();
+                stateName.parent = currentInstance;
+                currentInstance.propertySpecifiers.add(stateName);
+            }
+            MXMLDescriptorSpecifier overrides = new MXMLDescriptorSpecifier();
+            overrides.isProperty = true;
+            overrides.hasArray = true;
+            overrides.id = id;
+            overrides.name = "overrides";
+            overrides.parent = currentInstance;
+            currentInstance.propertySpecifiers.add(overrides);
+            moveDown(false, null, overrides);
+
+            IMXMLClassDefinitionNode classDefinitionNode = stateNode.getClassDefinitionNode();
+            List<IMXMLNode> snodes = classDefinitionNode.getNodesDependentOnState(stateNode.getStateName());
+            if (snodes != null)
+            {
+                for (int i=snodes.size()-1; i>=0; --i)
+                {
+                    IMXMLNode inode = snodes.get(i);
+                    if (inode.getNodeID() == ASTNodeID.MXMLInstanceID)
+                    {
+                        emitInstanceOverride((IMXMLInstanceNode)inode);
+                    }
+                }
+                // Next process the non-instance overrides dependent on this state.
+                // Each one will generate code to push an IOverride instance.
+                for (IMXMLNode anode : snodes)
+                {
+                    switch (anode.getNodeID())
+                    {
+                        case MXMLPropertySpecifierID:
+                        {
+                            emitPropertyOverride((IMXMLPropertySpecifierNode)anode);
+                            break;
+                        }
+                        case MXMLStyleSpecifierID:
+                        {
+                            emitStyleOverride((IMXMLStyleSpecifierNode)anode);
+                            break;
+                        }
+                        case MXMLEventSpecifierID:
+                        {
+                            emitEventOverride((IMXMLEventSpecifierNode)anode);
+                            break;
+                        }
+                        default:
+                        {
+                            break;
+                        }
+                    }
+                }
+            }
+            
+            moveUp(false, false);
+        }
+
+        IMXMLEventSpecifierNode[] enodes = node.getEventSpecifierNodes();
+        if (enodes != null)
+        {
+            moveDown(false, currentInstance, null);
+
+            for (IMXMLEventSpecifierNode enode : enodes)
+            {
+                getMXMLWalker().walk(enode); // Event Specifier
+            }
+
+            moveUp(false, true);
+        }
+    }
+
+    public void emitPropertyOverride(IMXMLPropertySpecifierNode propertyNode)
+    {
+        FlexProject project = (FlexProject) getMXMLWalker().getProject();
+        Name propertyOverride = project.getPropertyOverrideClassName();
+        emitPropertyOrStyleOverride(propertyOverride, propertyNode);
+    }
+    
+    /**
+     * Generates instructions in the current context
+     * to create an instance of mx.states.SetStyle
+     * with its <code>target</code>, <code>name</code>,
+     * and <code>value</code> properties set.
+     */
+    void emitStyleOverride(IMXMLStyleSpecifierNode styleNode)
+    {
+        FlexProject project = (FlexProject) getMXMLWalker().getProject();
+        Name styleOverride = project.getStyleOverrideClassName();
+        emitPropertyOrStyleOverride(styleOverride, styleNode);
+    }
+    
+    void emitPropertyOrStyleOverride(Name overrideName, IMXMLPropertySpecifierNode propertyOrStyleNode)
+    {
+        MXMLDescriptorSpecifier currentInstance = getCurrentDescriptor("ps");
+        IASNode parentNode = propertyOrStyleNode.getParent();
+        String id = parentNode instanceof IMXMLInstanceNode ?
+                    ((IMXMLInstanceNode)parentNode).getEffectiveID() :
+                    null;
+        
+        String name = propertyOrStyleNode.getName();        
+        
+        boolean valueIsDataBound = isDataBindingNode(propertyOrStyleNode.getChild(0));
+        IMXMLInstanceNode propertyOrStyleValueNode = propertyOrStyleNode.getInstanceNode();
+        
+        MXMLDescriptorSpecifier setProp = new MXMLDescriptorSpecifier();
+        setProp.isProperty = false;
+        setProp.name = formatQualifiedName(nameToString(overrideName));
+        setProp.parent = currentInstance;
+        currentInstance.propertySpecifiers.add(setProp);
+        
+        if (id != null)
+        {
+	            // Set its 'target' property to the id of the object
+	            // whose property or style this override will set.
+	        MXMLDescriptorSpecifier target = new MXMLDescriptorSpecifier();
+	        target.isProperty = true;
+	        target.name = "target";
+	        target.parent = setProp;
+	        target.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + id + ASEmitterTokens.SINGLE_QUOTE.getToken();
+	        setProp.propertySpecifiers.add(target);
+        }
+        
+            // Set its 'name' property to the name of the property or style.
+        MXMLDescriptorSpecifier pname = new MXMLDescriptorSpecifier();
+        pname.isProperty = true;
+        pname.name = "name";
+        pname.parent = setProp;
+        pname.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + name + ASEmitterTokens.SINGLE_QUOTE.getToken();
+        setProp.propertySpecifiers.add(pname);
+
+        if (!valueIsDataBound)
+        {
+	            // Set its 'value' property to the value of the property or style.
+	        MXMLDescriptorSpecifier value = new MXMLDescriptorSpecifier();
+	        value.isProperty = true;
+	        value.name = "value";
+	        value.parent = setProp;
+	        setProp.propertySpecifiers.add(value);
+	        moveDown(false, null, value);
+	        getMXMLWalker().walk(propertyOrStyleValueNode); // instance node
+	        moveUp(false, false);
+        }
+        else
+        {
+            String overrideID = MXMLFlexJSEmitterTokens.BINDING_PREFIX.getToken() + bindingCounter++;
+	        setProp.id = overrideID;
+	        instances.add(setProp);
+	        BindingDatabase bd = BindingDatabase.bindingMap.get(classDefinition);
+	        Set<BindingInfo> bindingInfo = bd.getBindingInfo();
+	        IMXMLDataBindingNode bindingNode = (IMXMLDataBindingNode)propertyOrStyleNode.getChild(0);
+	        for (BindingInfo bi : bindingInfo)
+	        {
+	        	if (bi.node == bindingNode)
+	        	{
+	                bi.setDestinationString(overrideID + ".value");
+	                break;
+	        	}
+	        }
+        }
+    }
+        
+    /**
+     * Generates instructions in the current context
+     * to create an instance of mx.states.SetEventHandler
+     * with its <code>target</code>, <code>name</code>,
+     * and <code>handlerFunction</code> properties set.
+     */
+    void emitEventOverride(IMXMLEventSpecifierNode eventNode)
+    {
+        inStatesOverride = true;
+        
+        MXMLDescriptorSpecifier currentInstance = getCurrentDescriptor("ps");
+        FlexProject project = (FlexProject) getMXMLWalker().getProject();
+        Name eventOverride = project.getEventOverrideClassName();
+        
+        IASNode parentNode = eventNode.getParent();
+        String id = parentNode instanceof IMXMLInstanceNode ?
+                    ((IMXMLInstanceNode)parentNode).getEffectiveID() :
+                    "";
+        
+        String name = MXMLEventSpecifier.getJSEventName(eventNode.getName());
+        
+        String eventHandler = eventHandlerNameMap.get(eventNode);
+        if (eventHandler == null)
+        {
+        	emitEventSpecifier(eventNode);
+        	eventHandler = eventHandlerNameMap.get(eventNode);
+        }
+
+        MXMLDescriptorSpecifier setEvent = new MXMLDescriptorSpecifier();
+        setEvent.isProperty = false;
+        setEvent.name = formatQualifiedName(nameToString(eventOverride));
+        setEvent.parent = currentInstance;
+        currentInstance.propertySpecifiers.add(setEvent);
+        // Set its 'target' property to the id of the object
+        // whose event this override will set.
+        MXMLDescriptorSpecifier target = new MXMLDescriptorSpecifier();
+        target.isProperty = true;
+        target.name = "target";
+        target.parent = setEvent;
+        target.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + id + ASEmitterTokens.SINGLE_QUOTE.getToken();
+        setEvent.propertySpecifiers.add(target);
+
+        // Set its 'name' property to the name of the event.
+        MXMLDescriptorSpecifier pname = new MXMLDescriptorSpecifier();
+        pname.isProperty = true;
+        pname.name = "name";
+        pname.parent = setEvent;
+        pname.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + name + ASEmitterTokens.SINGLE_QUOTE.getToken();
+        setEvent.propertySpecifiers.add(pname);
+        
+        // Set its 'handlerFunction' property to the autogenerated event handler.
+        MXMLDescriptorSpecifier handler = new MXMLDescriptorSpecifier();
+        handler.isProperty = true;
+        handler.name = "handlerFunction";
+        handler.parent = setEvent;
+        handler.value = JSFlexJSEmitterTokens.CLOSURE_FUNCTION_NAME.getToken() + ASEmitterTokens.PAREN_OPEN.getToken() + 
+        		ASEmitterTokens.THIS.getToken() + ASEmitterTokens.MEMBER_ACCESS.getToken() + eventHandler +
+        		ASEmitterTokens.COMMA.getToken() + ASEmitterTokens.SPACE.getToken() + ASEmitterTokens.THIS.getToken() +
+        		ASEmitterTokens.COMMA.getToken() + ASEmitterTokens.SPACE.getToken() + ASEmitterTokens.SINGLE_QUOTE.getToken() +
+        			eventHandler + ASEmitterTokens.SINGLE_QUOTE.getToken() +
+        		ASEmitterTokens.PAREN_CLOSE.getToken();
+        setEvent.propertySpecifiers.add(handler);
+        
+        inStatesOverride = false;
+    }
+
+    public void emitInstanceOverride(IMXMLInstanceNode instanceNode)
+    {
+        inStatesOverride = true;
+        
+        MXMLDescriptorSpecifier currentInstance = getCurrentDescriptor("ps");
+        FlexProject project = (FlexProject) getMXMLWalker().getProject();
+        Name instanceOverrideName = project.getInstanceOverrideClassName();
+
+        MXMLDescriptorSpecifier overrideInstances = getCurrentDescriptor("so");
+        int index = overrideInstances.propertySpecifiers.size();
+        if (nodeToIndexMap == null)
+        	nodeToIndexMap = new HashMap<IMXMLNode, Integer>();
+        if (nodeToIndexMap.containsKey(instanceNode))
+        {
+        	index = nodeToIndexMap.get(instanceNode);
+        }
+        else
+        {
+        	nodeToIndexMap.put(instanceNode, index);
+            MXMLDescriptorSpecifier itemsDesc = new MXMLDescriptorSpecifier();
+            itemsDesc.isProperty = true;
+            itemsDesc.hasArray = true;
+            itemsDesc.name = "itemsDescriptor";
+            itemsDesc.parent = overrideInstances;
+            overrideInstances.propertySpecifiers.add(itemsDesc);
+            boolean oldInMXMLContent = inMXMLContent;
+            moveDown(false, null, itemsDesc);
+            inMXMLContent = true;
+            getMXMLWalker().walk(instanceNode); // instance node
+            inMXMLContent = oldInMXMLContent;
+            moveUp(false, false);
+        }
+
+        MXMLDescriptorSpecifier addItems = new MXMLDescriptorSpecifier();
+        addItems.isProperty = false;
+        addItems.name = formatQualifiedName(nameToString(instanceOverrideName));
+        addItems.parent = currentInstance;
+        currentInstance.propertySpecifiers.add(addItems);
+        MXMLDescriptorSpecifier itemsDescIndex = new MXMLDescriptorSpecifier();
+        itemsDescIndex.isProperty = true;
+        itemsDescIndex.hasArray = true;
+        itemsDescIndex.name = "itemsDescriptorIndex";
+        itemsDescIndex.parent = addItems;
+        itemsDescIndex.value = Integer.toString(index);
+        addItems.propertySpecifiers.add(itemsDescIndex);
+        
+        //-----------------------------------------------------------------------------
+        // Second property set: maybe set destination and propertyName
+        
+        // get the property specifier node for the property the instanceNode represents
+        IMXMLPropertySpecifierNode propertySpecifier = (IMXMLPropertySpecifierNode) 
+            instanceNode.getAncestorOfType( IMXMLPropertySpecifierNode.class);
+    
+        if (propertySpecifier == null)
+        {
+           assert false;        // I think this indicates an invalid tree...
+        }
+        else
+        {
+            // Check the parent - if it's an instance then we want to use these
+            // nodes to get our property values from. If not, then it's the root
+            // and we don't need to specify destination
+            
+            IASNode parent = propertySpecifier.getParent();
+            if (parent instanceof IMXMLInstanceNode)
+            {
+               IMXMLInstanceNode parentInstance = (IMXMLInstanceNode)parent;
+               String parentId = parentInstance.getEffectiveID();
+               assert parentId != null;
+               String propName = propertySpecifier.getName();
+               
+               MXMLDescriptorSpecifier dest = new MXMLDescriptorSpecifier();
+               dest.isProperty = true;
+               dest.name = "destination";
+               dest.parent = addItems;
+               dest.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + parentId + ASEmitterTokens.SINGLE_QUOTE.getToken();
+               addItems.propertySpecifiers.add(dest);
+
+               MXMLDescriptorSpecifier prop = new MXMLDescriptorSpecifier();
+               prop.isProperty = true;
+               prop.name = "propertyName";
+               prop.parent = addItems;
+               prop.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + propName + ASEmitterTokens.SINGLE_QUOTE.getToken();
+               addItems.propertySpecifiers.add(prop);
+            }
+        }  
+        
+        //---------------------------------------------------------------
+        // Third property set: position and relativeTo
+        String positionPropertyValue = null;
+        String relativeToPropertyValue = null;
+       
+        // look to see if we have any sibling nodes that are not state dependent
+        // that come BEFORE us
+        IASNode instanceParent = instanceNode.getParent();
+        IASNode prevStatelessSibling=null;
+        for (int i=0; i< instanceParent.getChildCount(); ++i)
+        {
+            IASNode sib = instanceParent.getChild(i);
+            assert sib instanceof IMXMLInstanceNode;    // surely our siblings are also instances?
+           
+            // stop looking for previous nodes when we find ourself
+            if (sib == instanceNode)
+                break;
+
+            if (sib instanceof IMXMLInstanceNode && !isStateDependent(sib))
+            {
+                prevStatelessSibling = sib;
+            }
+        }
+        
+        if (prevStatelessSibling == null) {
+            positionPropertyValue = "first";        // TODO: these should be named constants
+        }
+        else {
+            positionPropertyValue = "after";
+            relativeToPropertyValue = ((IMXMLInstanceNode)prevStatelessSibling).getEffectiveID();
+        }
+       
+        MXMLDescriptorSpecifier pos = new MXMLDescriptorSpecifier();
+        pos.isProperty = true;
+        pos.name = "position";
+        pos.parent = addItems;
+        pos.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + positionPropertyValue + ASEmitterTokens.SINGLE_QUOTE.getToken();
+        addItems.propertySpecifiers.add(pos);
+        
+        if (relativeToPropertyValue != null)
+        {
+            MXMLDescriptorSpecifier rel = new MXMLDescriptorSpecifier();
+            rel.isProperty = true;
+            rel.name = "relativeTo";
+            rel.parent = addItems;
+            rel.value = ASEmitterTokens.SINGLE_QUOTE.getToken() + relativeToPropertyValue + ASEmitterTokens.SINGLE_QUOTE.getToken();
+            addItems.propertySpecifiers.add(rel);
+        }
+        
+        inStatesOverride = false;
+    }
+
+    private String nameToString(Name name)
+    {
+        String s = "";
+        Namespace ns = name.getSingleQualifier();
+        s = ns.getName() + ASEmitterTokens.MEMBER_ACCESS.getToken() + name.getBaseName();
+        return s;
+    }
+    /**
+     * Determines whether a node is state-dependent.
+     * TODO: we should move to IMXMLNode
+     */
+    protected boolean isStateDependent(IASNode node)
+    {
+        if (node instanceof IMXMLSpecifierNode)
+        {
+            String suffix = ((IMXMLSpecifierNode)node).getSuffix();
+            return suffix != null && suffix.length() > 0;
+        }
+        else if (isStateDependentInstance(node))
+            return true;
+        return false;
+    }
+    
+    /**
+     * Determines whether the geven node is an instance node, as is state dependent
+     */
+    protected boolean isStateDependentInstance(IASNode node)
+    {
+        if (node instanceof IMXMLInstanceNode)
+        {
+            String[] includeIn = ((IMXMLInstanceNode)node).getIncludeIn();
+            String[] excludeFrom = ((IMXMLInstanceNode)node).getExcludeFrom();
+            return includeIn != null || excludeFrom != null;
+        }
+        return false;
+    }
+    
+    /**
+     * Is a give node a "databinding node"?
+     */
+    public static boolean isDataBindingNode(IASNode node)
+    {
+        return node instanceof IMXMLDataBindingNode;
+    }
+    
+    protected static boolean isDataboundProp(IMXMLPropertySpecifierNode propertyNode)
+    {
+        boolean ret = propertyNode.getChildCount() > 0 && isDataBindingNode(propertyNode.getInstanceNode());
+        
+        // Sanity check that we based our conclusion about databinding on the correct node.
+        // (code assumes only one child if databinding)
+        int n = propertyNode.getChildCount();
+        for (int i = 0; i < n; i++)
+        {
+            boolean db = isDataBindingNode(propertyNode.getChild(i));
+            assert db == ret;
+        }
+        
+        return ret;
+    }
+
+    @Override
+    public void emitPropertySpecifier(IMXMLPropertySpecifierNode node)
+    {
+        if (isDataboundProp(node))
+            return;
+        
+        if (isStateDependent(node))
+            return;
+        
+        IDefinition cdef = node.getDefinition();
+
+        IASNode cnode = node.getChild(0);
+
+        MXMLDescriptorSpecifier currentInstance = getCurrentDescriptor("i");
+
+        MXMLDescriptorSpecifier currentPropertySpecifier = new MXMLDescriptorSpecifier();
+        currentPropertySpecifier.isProperty = true;
+        currentPropertySpecifier.name = cdef.getQualifiedName();
+        currentPropertySpecifier.parent = currentInstance;
+
+        boolean oldInMXMLContent = inMXMLContent;
+        boolean reusingDescriptor = false;
+        if (currentPropertySpecifier.name.equals("mxmlContent"))
+        {
+            inMXMLContent = true;
+            ArrayList<MXMLDescriptorSpecifier> specList = 
+            	(currentInstance == null) ? descriptorTree : currentInstance.propertySpecifiers;
+            for (MXMLDescriptorSpecifier ds : specList)
+            {
+            	if (ds.name.equals("mxmlContent"))
+            	{
+            		currentPropertySpecifier = ds;
+            		reusingDescriptor = true;
+            		break;
+            	}
+            }
+        }
+        
+        if (currentInstance != null)
+        {
+        	// we end up here for children of tags
+        	if (!reusingDescriptor)
+        		currentInstance.propertySpecifiers.add(currentPropertySpecifier);
+        }
+        else if (inMXMLContent)
+        {
+        	// we end up here for top tags?
+        	if (!reusingDescriptor)
+        		descriptorTree.add(currentPropertySpecifier);
+        }
+        else
+        {
+            currentPropertySpecifier.parent = propertiesTree;
+            propertiesTree.propertySpecifiers.add(currentPropertySpecifier);
+        }
+
+        boolean valueIsArray = cnode != null && cnode instanceof IMXMLArrayNode;
+        boolean valueIsObject = cnode != null && cnode instanceof IMXMLObjectNode;
+
+        currentPropertySpecifier.hasArray = valueIsArray;
+        currentPropertySpecifier.hasObject = valueIsObject;
+
+        moveDown(valueIsArray || valueIsObject, null, currentPropertySpecifier);
+
+        getMXMLWalker().walk(cnode); // Array or Instance
+
+        moveUp(valueIsArray || valueIsObject, false);
+        
+        inMXMLContent = oldInMXMLContent;
+    }
+
+    @Override
+    public void emitScript(IMXMLScriptNode node)
+    {
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker())
+                .getASEmitter();
+
+        String nl = ASEmitterTokens.NEW_LINE.getToken();
+
+        StringBuilder sb = null;
+        MXMLScriptSpecifier scriptSpecifier = null;
+
+        int len = node.getChildCount();
+        if (len > 0)
+        {
+            for (int i = 0; i < len; i++)
+            {
+                IASNode cnode = node.getChild(i);
+
+                if (!(cnode instanceof IImportNode))
+                {
+                    sb = new StringBuilder();
+                    scriptSpecifier = new MXMLScriptSpecifier();
+
+                    sb.append(asEmitter.stringifyNode(cnode));
+
+                    sb.append(ASEmitterTokens.SEMICOLON.getToken());
+
+                    if (i == len - 1)
+                        indentPop();
+
+                    sb.append(nl);
+                    sb.append(nl);
+
+                    scriptSpecifier.fragment = sb.toString();
+
+                    scripts.add(scriptSpecifier);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void emitStyleSpecifier(IMXMLStyleSpecifierNode node)
+    {
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitObject(IMXMLObjectNode node)
+    {
+        final int len = node.getChildCount();
+    	if (!makingSimpleArray)
+    	{
+            for (int i = 0; i < len; i++)
+            {
+                getMXMLWalker().walk(node.getChild(i)); // props in object
+            }    		
+    	}
+    	else
+    	{
+            MXMLDescriptorSpecifier ps = getCurrentDescriptor("ps");
+            if (ps.value == null)
+            	ps.value = "";
+            ps.value += "{";	
+            for (int i = 0; i < len; i++)
+            {
+                IMXMLPropertySpecifierNode propName = (IMXMLPropertySpecifierNode)node.getChild(i);
+                ps.value += propName.getName() + ": ";	                
+                getMXMLWalker().walk(propName.getChild(0));
+                if (i < len - 1)
+                    ps.value += ", ";	                                	
+            }    		
+            ps.value += "}";	
+    	}
+    }
+    
+    @Override
+    public void emitArray(IMXMLArrayNode node)
+    {
+        moveDown(false, null, null);
+
+        boolean isSimple = true;
+        final int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            final IASNode child = node.getChild(i);
+            ASTNodeID nodeID = child.getNodeID();
+            if (nodeID == ASTNodeID.MXMLArrayID || nodeID == ASTNodeID.MXMLInstanceID || nodeID == ASTNodeID.MXMLStateID)
+            {
+                isSimple = false;
+                break;
+            }
+        }
+        boolean oldMakingSimpleArray = makingSimpleArray;
+        MXMLDescriptorSpecifier ps = getCurrentDescriptor("ps");
+        if (isSimple)
+        {
+        	makingSimpleArray = true;
+        	ps.value = ASEmitterTokens.SQUARE_OPEN.getToken();
+        }
+        for (int i = 0; i < len; i++)
+        {
+            getMXMLWalker().walk(node.getChild(i)); // Instance
+            if (isSimple && i < len - 1)
+            	ps.value += ASEmitterTokens.COMMA.getToken();
+        }
+        if (isSimple)
+        {
+        	ps.value += ASEmitterTokens.SQUARE_CLOSE.getToken();        	
+        }
+        makingSimpleArray = oldMakingSimpleArray;
+
+        moveUp(false, false);
+    }
+
+    @Override
+    public void emitString(IMXMLStringNode node)
+    {
+        getCurrentDescriptor("ps").valueNeedsQuotes = true;
+
+        emitAttributeValue(node);
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitLiteral(IMXMLLiteralNode node)
+    {
+        MXMLDescriptorSpecifier ps = getCurrentDescriptor("ps");
+        if (ps.value == null) // might be non-null if makingSimpleArray
+        	ps.value = "";
+
+        if (ps.valueNeedsQuotes)
+            ps.value += ASEmitterTokens.SINGLE_QUOTE.getToken();
+
+        String s = node.getValue().toString();
+        if (ps.valueNeedsQuotes)
+        {
+            // escape all single quotes found within the string
+            s = s.replace(ASEmitterTokens.SINGLE_QUOTE.getToken(), 
+                    "\\" + ASEmitterTokens.SINGLE_QUOTE.getToken());
+        }
+        ps.value += s;
+        
+        if (ps.valueNeedsQuotes)
+            ps.value += ASEmitterTokens.SINGLE_QUOTE.getToken();
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitFactory(IMXMLFactoryNode node)
+    {
+        MXMLDescriptorSpecifier ps = getCurrentDescriptor("ps");
+        ps.value = "new " + formatQualifiedName("org.apache.flex.core.ClassFactory") + "(";
+
+        IASNode cnode = node.getChild(0);
+        if (cnode instanceof IMXMLClassNode)
+        {
+            ps.value += formatQualifiedName(((IMXMLClassNode)cnode).getValue(getMXMLWalker().getProject()).getQualifiedName());
+        }
+        ps.value += ")";
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitComponent(IMXMLComponentNode node)
+    {
+        MXMLDescriptorSpecifier ps = getCurrentDescriptor("ps");
+        ps.value = "new " + formatQualifiedName("org.apache.flex.core.ClassFactory") + "(";
+
+        ps.value += formatQualifiedName(documentDefinition.getQualifiedName()) + ".";
+        ps.value += formatQualifiedName(node.getName());
+        ps.value += ")";
+        
+        setBufferWrite(true);
+        emitSubDocument(node);
+        subDocuments.append(getBuilder().toString());
+        getBuilder().setLength(0);
+        setBufferWrite(false);
+    }
+
+    @Override
+    protected void setBufferWrite(boolean value)
+    {
+    	super.setBufferWrite(value);
+        IASEmitter asEmitter = ((IMXMLBlockWalker) getMXMLWalker()).getASEmitter();
+        ((JSFlexJSEmitter)asEmitter).setBufferWrite(value);
+    }
+    
+    //--------------------------------------------------------------------------
+    //    JS output
+    //--------------------------------------------------------------------------
+    
+    private void emitHeader(IMXMLDocumentNode node)
+    {
+        String cname = node.getFileNode().getName();
+        String bcname = node.getBaseClassName();
+
+        FlexJSProject project = (FlexJSProject) getMXMLWalker().getProject();
+        List<File> sourcePaths = project.getSourcePath();
+        String sourceName = node.getSourcePath();
+        for (File sourcePath : sourcePaths)
+        {
+            if (sourceName.startsWith(sourcePath.getAbsolutePath())) 
+            {
+            	sourceName = sourceName.substring(sourcePath.getAbsolutePath().length() + 1);        	
+            }
+        }
+        writeNewline("/**");
+        writeNewline(" * Generated by Apache Flex Cross-Compiler from " + sourceName);
+        writeNewline(" * " + cname);
+        writeNewline(" *");
+        writeNewline(" * @fileoverview");
+        writeNewline(" *");
+        writeNewline(" * @suppress {checkTypes|accessControls}");
+        writeNewline(" */");
+        writeNewline();
+        
+        ArrayList<String> writtenInstances = new ArrayList<String>();
+        emitHeaderLine(cname, true); // provide
+        for (String subDocumentName : subDocumentNames)
+        {
+            emitHeaderLine(subDocumentName, true);
+            writtenInstances.add(formatQualifiedName(subDocumentName));
+        }
+        writeNewline();
+        emitHeaderLine(bcname);
+        writtenInstances.add(formatQualifiedName(cname)); // make sure we don't add ourselves
+        writtenInstances.add(formatQualifiedName(bcname)); // make sure we don't add the baseclass twice
+        allInstances.addAll(0, instances);
+        for (MXMLDescriptorSpecifier instance : allInstances)
+        {
+            String name = instance.name;
+            if (writtenInstances.indexOf(name) == -1)
+            {
+                emitHeaderLine(name);
+                writtenInstances.add(name);
+            }
+        }
+        ASProjectScope projectScope = (ASProjectScope) project.getScope();
+        IDefinition cdef = node.getDefinition();
+        ICompilationUnit cu = projectScope
+                .getCompilationUnitForDefinition(cdef);
+        ArrayList<String> deps = project.getRequires(cu);
+
+        if (interfaceList != null)
+        {
+        	String[] interfaces = interfaceList.split(", ");
+        	for (String iface : interfaces)
+        	{
+        		deps.add(iface);
+        		usedNames.add(iface);
+        	}
+        }
+        if (deps != null)
+        {
+        	Collections.sort(deps);
+            for (String imp : deps)
+            {
+                if (imp.indexOf(JSGoogEmitterTokens.AS3.getToken()) != -1)
+                    continue;
+    
+                if (imp.equals(cname))
+                    continue;
+    
+                if (imp.equals("mx.binding.Binding"))
+                    continue;
+                if (imp.equals("mx.binding.BindingManager"))
+                    continue;
+                if (imp.equals("mx.binding.FunctionReturnWatcher"))
+                    continue;
+                if (imp.equals("mx.binding.PropertyWatcher"))
+                    continue;
+                if (imp.equals("mx.binding.StaticPropertyWatcher"))
+                    continue;
+                if (imp.equals("mx.binding.XMLWatcher"))
+                    continue;
+                if (imp.equals("mx.events.PropertyChangeEvent"))
+                    continue;
+                if (imp.equals("mx.events.PropertyChangeEventKind"))
+                    continue;
+                if (imp.equals("mx.core.DeferredInstanceFromFunction"))
+                    continue;
+    
+                if (NativeUtils.isNative(imp))
+                    continue;
+    
+                String formatted = formatQualifiedName(imp, false);
+                if (writtenInstances.indexOf(formatted) == -1)
+                {
+                    emitHeaderLine(imp);
+                    writtenInstances.add(formatted);
+                }
+            }
+        }
+
+        // erikdebruin: Add missing language feature support, like the 'is' and 
+        //              'as' operators. We don't need to worry about requiring
+        //              this in every project: ADVANCED_OPTIMISATIONS will NOT
+        //              include any of the code if it is not used in the project.
+        if (project.mainCU != null &&
+                cu.getName().equals(project.mainCU.getName()))
+        {
+            if (project instanceof FlexJSProject)
+            {
+            	if (((FlexJSProject)project).needLanguage)
+            		emitHeaderLine(JSFlexJSEmitterTokens.LANGUAGE_QNAME.getToken());
+            }
+        }
+
+        writeNewline();
+        writeNewline();
+    }
+
+    private void emitHeaderLine(String qname)
+    {
+        emitHeaderLine(qname, false);
+    }
+
+    private void emitHeaderLine(String qname, boolean isProvide)
+    {
+        write((isProvide) ? JSGoogEmitterTokens.GOOG_PROVIDE
+                : JSGoogEmitterTokens.GOOG_REQUIRE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(formatQualifiedName(qname, false));
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline(ASEmitterTokens.SEMICOLON);
+    }
+
+    //--------------------------------------------------------------------------
+    //    Utils
+    //--------------------------------------------------------------------------
+
+    @Override
+    protected void emitAttributeValue(IASNode node)
+    {
+        IMXMLLiteralNode cnode = (IMXMLLiteralNode) node.getChild(0);
+
+        if (cnode.getValue() != null)
+            getMXMLWalker().walk((IASNode) cnode); // Literal
+    }
+
+    private MXMLDescriptorSpecifier getCurrentDescriptor(String type)
+    {
+        MXMLDescriptorSpecifier currentDescriptor = null;
+
+        int index;
+
+        if (type.equals("i"))
+        {
+            index = currentInstances.size() - 1;
+            if (index > -1)
+                currentDescriptor = currentInstances.get(index);
+        }
+        else if (type.equals("so"))
+        {
+            return currentStateOverrides;
+        }
+        else
+        {
+            index = currentPropertySpecifiers.size() - 1;
+            if (index > -1)
+                currentDescriptor = currentPropertySpecifiers.get(index);
+        }
+
+        return currentDescriptor;
+    }
+
+    protected void moveDown(boolean byPass,
+            MXMLDescriptorSpecifier currentInstance,
+            MXMLDescriptorSpecifier currentPropertySpecifier)
+    {
+        if (!byPass)
+        {
+            if (currentInstance != null)
+                currentInstances.add(currentInstance);
+        }
+
+        if (currentPropertySpecifier != null)
+            currentPropertySpecifiers.add(currentPropertySpecifier);
+    }
+
+    protected void moveUp(boolean byPass, boolean isInstance)
+    {
+        if (!byPass)
+        {
+            int index;
+
+            if (isInstance)
+            {
+                index = currentInstances.size() - 1;
+

<TRUNCATED>

[15/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/input.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/files/input.as b/compiler-jx/src/test/resources/goog/files/input.as
new file mode 100644
index 0000000..81a4de6
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/files/input.as
@@ -0,0 +1,39 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+
+import flash.events.IEventDispatcher;
+
+import goog.events.EventTarget;
+
+public dynamic class A extends goog.events.EventTarget implements IEventDispatcher
+{
+	public static const MY_CLASS_CONST:String = "myClassConst";
+	
+	public function A()
+	{
+		trace(typeof "a");
+	}
+	
+	private var _a:ArgumentError = new ArgumentError();
+
+	public const MY_INSTANCE_CONST:String = "myInstanceConst";
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/output.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/files/output.js b/compiler-jx/src/test/resources/goog/files/output.js
new file mode 100644
index 0000000..b046100
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/files/output.js
@@ -0,0 +1,47 @@
+/**
+ * Licensed 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.
+ */
+goog.provide('org.apache.flex.A');
+
+goog.require('flash.events.IEventDispatcher');
+goog.require('goog.events.EventTarget');
+
+/**
+ * @constructor
+ * @extends {goog.events.EventTarget}
+ * @implements {flash.events.IEventDispatcher}
+ */
+org.apache.flex.A = function() {
+	var self = this;
+	org.apache.flex.A.base(this, 'constructor');
+	self.trace(typeof("a"));
+};
+goog.inherits(org.apache.flex.A, goog.events.EventTarget);
+
+/**
+ * @const
+ * @type {string}
+ */
+org.apache.flex.A.MY_CLASS_CONST = "myClassConst";
+
+/**
+ * @private
+ * @type {ArgumentError}
+ */
+org.apache.flex.A.prototype._a = new ArgumentError();
+
+/**
+ * @const
+ * @type {string}
+ */
+org.apache.flex.A.prototype.MY_INSTANCE_CONST = "myInstanceConst";

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/poc.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/files/poc.as b/compiler-jx/src/test/resources/goog/files/poc.as
new file mode 100644
index 0000000..38ba0df
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/files/poc.as
@@ -0,0 +1,107 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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  
+{
+
+import flash.events.MouseEvent;
+
+import goog.events.BrowserEvent;
+import goog.events.Event;
+import goog.events.EventTarget;
+
+public class Example extends EventTarget
+{
+	private static const BYEBYE:String = "Bye Bye";
+	private static const HELLOWORLD:String = "Hello World";
+	
+	private static var counter:int = 100;
+
+	public function Example() 
+	{
+		init();
+	}
+	
+	private var _btn1:Event;
+	private var _btn2:Event;
+	private var _btn3:Event;
+	private var _lbl1:BrowserEvent;
+	private var _lbl2:BrowserEvent;
+	private var _et1:EventTarget;
+	private var _et2:EventTarget;
+	private var _et3:EventTarget;
+	
+	public function init():void
+	{
+		_et1 = new EventTarget();
+		_et2 = new EventTarget();
+		_et3 = new EventTarget();
+		
+		_lbl1 = new BrowserEvent();
+		_lbl1.clientX = 100;
+		_lbl1.clientY = 25;
+		_lbl1.type = Example.HELLOWORLD;
+		
+		dispatchEvent(_lbl1);
+		
+		_lbl2 = new BrowserEvent();
+		_lbl2.clientX = 200;
+		_lbl2.clientY = 25;
+		_lbl2.type = Example.counter + "";
+		
+		dispatchEvent(_lbl2);
+		
+		_btn1 = new Event();
+		_btn1.type = "Click me";
+		_et1.addEventListener(MouseEvent.CLICK, btn1clickHandler);
+		
+		_et1.dispatchEvent(_btn1);
+
+		_btn2 = new Event();
+		_btn2.type = "Add it";
+		_et2.addEventListener(MouseEvent.CLICK, btn2clickHandler);
+		
+		_et2.dispatchEvent(_btn2);
+		
+		_btn3 = new Event();
+		_btn3.type = "Move it";
+		_et3.addEventListener(MouseEvent.CLICK, btn3clickHandler);
+		
+		_et3.dispatchEvent(_btn3);
+	}
+	
+	protected function btn1clickHandler(event:MouseEvent):void
+	{
+		if (_lbl1.type == Example.HELLOWORLD)
+			_lbl1.type = Example.BYEBYE;
+		else
+			_lbl1.type = Example.HELLOWORLD;
+	}
+	
+	protected function btn2clickHandler(event:MouseEvent):void
+	{
+		_lbl2.type = --Example.counter + "";
+	}
+	
+	protected function btn3clickHandler(event:MouseEvent):void
+	{
+		_lbl2.clientX += 10;
+	}
+	
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/poc_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/files/poc_result.js b/compiler-jx/src/test/resources/goog/files/poc_result.js
new file mode 100644
index 0000000..a7e0f28
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/files/poc_result.js
@@ -0,0 +1,154 @@
+/**
+ * Licensed 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.
+ */
+goog.provide('Example');
+
+goog.require('flash.events.MouseEvent');
+goog.require('goog.events.BrowserEvent');
+goog.require('goog.events.Event');
+goog.require('goog.events.EventTarget');
+
+/**
+ * @constructor
+ * @extends {goog.events.EventTarget}
+ */
+Example = function() {
+	var self = this;
+	Example.base(this, 'constructor');
+	self.init();
+};
+goog.inherits(Example, goog.events.EventTarget);
+
+/**
+ * @private
+ * @const
+ * @type {string}
+ */
+Example.BYEBYE = "Bye Bye";
+
+/**
+ * @private
+ * @const
+ * @type {string}
+ */
+Example.HELLOWORLD = "Hello World";
+
+/**
+ * @private
+ * @type {number}
+ */
+Example.counter = 100;
+
+/**
+ * @private
+ * @type {goog.events.Event}
+ */
+Example.prototype._btn1;
+
+/**
+ * @private
+ * @type {goog.events.Event}
+ */
+Example.prototype._btn2;
+
+/**
+ * @private
+ * @type {goog.events.Event}
+ */
+Example.prototype._btn3;
+
+/**
+ * @private
+ * @type {goog.events.BrowserEvent}
+ */
+Example.prototype._lbl1;
+
+/**
+ * @private
+ * @type {goog.events.BrowserEvent}
+ */
+Example.prototype._lbl2;
+
+/**
+ * @private
+ * @type {goog.events.EventTarget}
+ */
+Example.prototype._et1;
+
+/**
+ * @private
+ * @type {goog.events.EventTarget}
+ */
+Example.prototype._et2;
+
+/**
+ * @private
+ * @type {goog.events.EventTarget}
+ */
+Example.prototype._et3;
+
+Example.prototype.init = function() {
+	var self = this;
+	self._et1 = new goog.events.EventTarget();
+	self._et2 = new goog.events.EventTarget();
+	self._et3 = new goog.events.EventTarget();
+	self._lbl1 = new goog.events.BrowserEvent();
+	self._lbl1.clientX = 100;
+	self._lbl1.clientY = 25;
+	self._lbl1.type = Example.HELLOWORLD;
+	self.dispatchEvent(self._lbl1);
+	self._lbl2 = new goog.events.BrowserEvent();
+	self._lbl2.clientX = 200;
+	self._lbl2.clientY = 25;
+	self._lbl2.type = Example.counter + "";
+	self.dispatchEvent(self._lbl2);
+	self._btn1 = new goog.events.Event();
+	self._btn1.type = "Click me";
+	self._et1.addEventListener(flash.events.MouseEvent.CLICK, self.btn1clickHandler);
+	self._et1.dispatchEvent(self._btn1);
+	self._btn2 = new goog.events.Event();
+	self._btn2.type = "Add it";
+	self._et2.addEventListener(flash.events.MouseEvent.CLICK, self.btn2clickHandler);
+	self._et2.dispatchEvent(self._btn2);
+	self._btn3 = new goog.events.Event();
+	self._btn3.type = "Move it";
+	self._et3.addEventListener(flash.events.MouseEvent.CLICK, self.btn3clickHandler);
+	self._et3.dispatchEvent(self._btn3);
+};
+
+/**
+ * @param {flash.events.MouseEvent} event
+ */
+Example.prototype.btn1clickHandler = function(event) {
+	var self = this;
+	if (self._lbl1.type == Example.HELLOWORLD)
+		self._lbl1.type = Example.BYEBYE;
+	else
+		self._lbl1.type = Example.HELLOWORLD;
+};
+
+/**
+ * @param {flash.events.MouseEvent} event
+ */
+Example.prototype.btn2clickHandler = function(event) {
+	var self = this;
+	self._lbl2.type = --Example.counter + "";
+};
+
+/**
+ * @param {flash.events.MouseEvent} event
+ */
+Example.prototype.btn3clickHandler = function(event) {
+	var self = this;
+	self._lbl2.clientX += 10;
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/qualify-new-object.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/files/qualify-new-object.as b/compiler-jx/src/test/resources/goog/files/qualify-new-object.as
new file mode 100644
index 0000000..d9e6a10
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/files/qualify-new-object.as
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+
+import flash.events.EventDispatcher;
+
+import goog.events.EventTarget;
+
+public class A extends EventDispatcher
+{
+	public function A() 
+	{
+		init();
+	}
+	
+	private var _privateVar:EventTarget;
+	
+	public function init():void
+	{
+		var btn:EventTarget = new EventTarget();
+		
+		_privateVar = new EventTarget();
+		
+		addEventListener("click", function () {});
+	}
+	
+	public function start():void
+	{
+		var localVar:String = _privateVar.label;
+		init();
+		doIt();
+	}
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/files/qualify-new-object_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/files/qualify-new-object_result.js b/compiler-jx/src/test/resources/goog/files/qualify-new-object_result.js
new file mode 100644
index 0000000..1ba905f
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/files/qualify-new-object_result.js
@@ -0,0 +1,49 @@
+/**
+ * Licensed 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.
+ */
+goog.provide('org.apache.flex.A');
+
+goog.require('flash.events.EventDispatcher');
+goog.require('goog.events.EventTarget');
+
+/**
+ * @constructor
+ * @extends {flash.events.EventDispatcher}
+ */
+org.apache.flex.A = function() {
+	var self = this;
+	org.apache.flex.A.base(this, 'constructor');
+	self.init();
+};
+goog.inherits(org.apache.flex.A, flash.events.EventDispatcher);
+
+/**
+ * @private
+ * @type {goog.events.EventTarget}
+ */
+org.apache.flex.A.prototype._privateVar;
+
+org.apache.flex.A.prototype.init = function() {
+	var self = this;
+	var /** @type {goog.events.EventTarget} */ btn = new goog.events.EventTarget();
+	self._privateVar = new goog.events.EventTarget();
+	self.addEventListener("click", function() {
+	});
+};
+
+org.apache.flex.A.prototype.start = function() {
+	var self = this;
+	var /** @type {string} */ localVar = self._privateVar.label;
+	self.init();
+	doIt();
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/projects/imports/Case.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/projects/imports/Case.as b/compiler-jx/src/test/resources/goog/projects/imports/Case.as
new file mode 100644
index 0000000..1922d4d
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/projects/imports/Case.as
@@ -0,0 +1,30 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+	import comps.A;
+
+    public class Case
+    {
+        public function Case()
+        {
+            var bar:A = new A();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/projects/imports/Case_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/projects/imports/Case_result.js b/compiler-jx/src/test/resources/goog/projects/imports/Case_result.js
new file mode 100644
index 0000000..2d090e9
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/projects/imports/Case_result.js
@@ -0,0 +1,24 @@
+/**
+ * Licensed 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.
+ */
+goog.provide('Case');
+
+goog.require('comps.A');
+
+/**
+ * @constructor
+ */
+Case = function() {
+	var self = this;
+	var /** @type {comps.A} */ bar = new comps.A();
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/projects/imports/comps/A.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/projects/imports/comps/A.as b/compiler-jx/src/test/resources/goog/projects/imports/comps/A.as
new file mode 100644
index 0000000..e8f39c4
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/projects/imports/comps/A.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 comps
+{
+    public class A
+    {
+        public function A()
+        {
+            var foo:B = new B();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/projects/imports/comps/A_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/projects/imports/comps/A_result.js b/compiler-jx/src/test/resources/goog/projects/imports/comps/A_result.js
new file mode 100644
index 0000000..5d128a5
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/projects/imports/comps/A_result.js
@@ -0,0 +1,22 @@
+/**
+ * Licensed 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.
+ */
+goog.provide('comps.A');
+
+/**
+ * @constructor
+ */
+comps.A = function() {
+	var self = this;
+	var /** @type {comps.B} */ foo = new B();
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/projects/imports/comps/B.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/projects/imports/comps/B.as b/compiler-jx/src/test/resources/goog/projects/imports/comps/B.as
new file mode 100644
index 0000000..551b279
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/projects/imports/comps/B.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 comps
+{
+    public class B
+    {
+        public function B()
+        {
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/goog/projects/imports/comps/B_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/goog/projects/imports/comps/B_result.js b/compiler-jx/src/test/resources/goog/projects/imports/comps/B_result.js
new file mode 100644
index 0000000..643887e
--- /dev/null
+++ b/compiler-jx/src/test/resources/goog/projects/imports/comps/B_result.js
@@ -0,0 +1,20 @@
+/**
+ * Licensed 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.
+ */
+goog.provide('comps.B');
+
+/**
+ * @constructor
+ */
+comps.B = function() {
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/files/SimpleAS.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/files/SimpleAS.as b/compiler-jx/src/test/resources/vf2js/files/SimpleAS.as
new file mode 100644
index 0000000..c4bd427
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/files/SimpleAS.as
@@ -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
+{
+
+import flash.events.IEventDispatcher;
+
+import mx.components.Button;
+
+import spark.components.Button;
+
+public dynamic class A extends spark.components.Button implements IEventDispatcher
+{
+	public static const MY_CLASS_CONST:String = "myClassConst";
+	
+	public function A()
+	{
+		trace(typeof "a");
+	}
+	
+	private var _a:ArgumentError = new ArgumentError();
+
+	private var _mxButton:mx.components.Button = new mx.components.Button();
+
+	public const MY_INSTANCE_CONST:String = "myInstanceConst";
+}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/files/SimpleAS_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/files/SimpleAS_result.js b/compiler-jx/src/test/resources/vf2js/files/SimpleAS_result.js
new file mode 100644
index 0000000..a063d87
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/files/SimpleAS_result.js
@@ -0,0 +1,72 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * org.apache.flex.A
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('org.apache.flex.A');
+
+
+
+/**
+ * @constructor
+ * @extends {vf2js_s.components.Button}
+ * @implements {flash.events.IEventDispatcher}
+ */
+org.apache.flex.A = function() {
+  org.apache.flex.A.base(this, 'constructor');
+  org.apache.flex.utils.Language.trace(typeof("a"));
+};
+goog.inherits(org.apache.flex.A, vf2js_s.components.Button);
+
+
+/**
+ * @const
+ * @type {string}
+ */
+org.apache.flex.A.MY_CLASS_CONST = "myClassConst";
+
+
+/**
+ * @private
+ * @type {ArgumentError}
+ */
+org.apache.flex.A.prototype._a = new ArgumentError();
+
+
+/**
+ * @private
+ * @type {vf2js_mx.components.Button}
+ */
+org.apache.flex.A.prototype._mxButton = new vf2js_mx.components.Button();
+
+
+/**
+ * @const
+ * @type {string}
+ */
+org.apache.flex.A.prototype.MY_INSTANCE_CONST = "myInstanceConst";
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'org.apache.flex.A'}], interfaces: [flash.events.IEventDispatcher] };
+

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/files/SimpleMXML.mxml
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/files/SimpleMXML.mxml b/compiler-jx/src/test/resources/vf2js/files/SimpleMXML.mxml
new file mode 100644
index 0000000..a403052
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/files/SimpleMXML.mxml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+               xmlns:s="library://ns.adobe.com/flex/spark"
+               xmlns:mx="library://ns.adobe.com/flex/mx">
+
+  <s:Button label="hello" x="100" />
+
+  <s:Button label="bye" x="200" />
+
+</vf2js_s:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/files/SimpleMXML_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/files/SimpleMXML_result.js b/compiler-jx/src/test/resources/vf2js/files/SimpleMXML_result.js
new file mode 100644
index 0000000..0beed58
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/files/SimpleMXML_result.js
@@ -0,0 +1,67 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * SimpleMXML
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('SimpleMXML');
+
+goog.require('spark.components.Application');
+goog.require('spark.components.Button');
+
+
+
+
+/**
+ * @constructor
+ * @extends {spark.components.Application}
+ */
+SimpleMXML = function() {
+  SimpleMXML.base(this, 'constructor');
+  
+  /**
+   * @private
+   * @type {spark.components.Button}
+   */
+  this.$ID0;
+
+  /**
+   * @private
+   * @type {spark.components.Button}
+   */
+  this.$ID1;
+};
+goog.inherits(SimpleMXML, spark.components.Application);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+SimpleMXML.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'SimpleMXML', qName: 'SimpleMXML' }] };
+
+
+/**
+ * start
+ *
+ * @export
+ */
+SimpleMXML.prototype.start = function () {
+};
+

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/files/Version.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/files/Version.as b/compiler-jx/src/test/resources/vf2js/files/Version.as
new file mode 100644
index 0000000..496ab63
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/files/Version.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+import mx.core.mx_internal;
+
+/**
+ *  @private
+ *  Version string for this class.
+ */
+mx_internal static const VERSION:String = "4.14.0.0";

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test.as
new file mode 100644
index 0000000..d89743e
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test.as
@@ -0,0 +1,46 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+	import classes.A;
+	import interfaces.IA;
+	import interfaces.IC;
+	import interfaces.IE;
+
+  public class Test extends A implements IA, IE
+  {
+    public function Test()
+    {
+      super();
+      
+      var ia:IA = doSomething(IC) as IA
+    }
+    
+    public function doSomething(ic:IC):IC
+    {
+      for (var i:int = 0; i < 3; i++ {
+        var a:A = null;
+      }
+      
+	  super.doStuff();
+	  
+      return ic;
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test_result.js
new file mode 100644
index 0000000..f547b18
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/Test_result.js
@@ -0,0 +1,64 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Test
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('Test');
+
+goog.require('classes.A');
+goog.require('interfaces.IA');
+goog.require('interfaces.IC');
+goog.require('interfaces.IE');
+goog.require('org.apache.flex.utils.Language');
+
+
+
+/**
+ * @constructor
+ * @extends {classes.A}
+ * @implements {interfaces.IA}
+ * @implements {interfaces.IE}
+ */
+Test = function() {
+  Test.base(this, 'constructor');
+  var /** @type {interfaces.IA} */ ia = org.apache.flex.utils.Language.as(this.doSomething(interfaces.IC), interfaces.IA);
+};
+goog.inherits(Test, classes.A);
+
+
+/**
+ * @export
+ * @param {interfaces.IC} ic
+ * @return {interfaces.IC}
+ */
+Test.prototype.doSomething = function(ic) {
+  for (var /** @type {number} */ i = 0; i < 3; i++) {
+    var /** @type {classes.A} */ a = null;
+  }
+  this.superClass_.doStuff.call(this);
+  return ic;
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Test.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Test', qName: 'Test'}], interfaces: [interfaces.IA, interfaces.IE] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A.as
new file mode 100644
index 0000000..20a6a11
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A.as
@@ -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 classes
+{
+  public class A extends C
+  {
+    public function A()
+    {
+      super();
+    }
+	
+	public function doStuff():void{
+		trace("STUFF!!!");
+	}
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A_result.js
new file mode 100644
index 0000000..842e665
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/A_result.js
@@ -0,0 +1,51 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * classes.A
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('classes.A');
+
+goog.require('classes.C');
+
+
+
+/**
+ * @constructor
+ * @extends {classes.C}
+ */
+classes.A = function() {
+  classes.A.base(this, 'constructor');
+};
+goog.inherits(classes.A, classes.C);
+
+
+/**
+ * @export
+ */
+classes.A.prototype.doStuff = function() {
+  org.apache.flex.utils.Language.trace("STUFF!!!");
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.A.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'A', qName: 'classes.A'}] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B.as
new file mode 100644
index 0000000..b410e59
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 classes
+{
+    public class B
+    {
+        public function B() {}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B_result.js
new file mode 100644
index 0000000..d8e3b89
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/B_result.js
@@ -0,0 +1,37 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * classes.B
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('classes.B');
+
+
+
+/**
+ * @constructor
+ */
+classes.B = function() {};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.B.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'B', qName: 'classes.B'}] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C.as
new file mode 100644
index 0000000..d414a26
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 classes
+{
+    public class C
+    {
+        public function C() {}
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C_result.js
new file mode 100644
index 0000000..c3b72f4
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/classes/C_result.js
@@ -0,0 +1,37 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * classes.C
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('classes.C');
+
+
+
+/**
+ * @constructor
+ */
+classes.C = function() {};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+classes.C.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'C', qName: 'classes.C'}] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA.as
new file mode 100644
index 0000000..5fbd6c2
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+  public interface IA extends IC {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA_result.js
new file mode 100644
index 0000000..2a00144
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IA_result.js
@@ -0,0 +1,41 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IA
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('interfaces.IA');
+
+goog.require('interfaces.IC');
+
+
+
+/**
+ * @interface
+ * @extends {interfaces.IC}
+ */
+interfaces.IA = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IA.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IA', qName: 'interfaces.IA'}], interfaces: [interfaces.IC] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB.as
new file mode 100644
index 0000000..a995635
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+    public interface IB {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB_result.js
new file mode 100644
index 0000000..d4933c8
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IB_result.js
@@ -0,0 +1,38 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IB
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('interfaces.IB');
+
+
+
+/**
+ * @interface
+ */
+interfaces.IB = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IB.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IB', qName: 'interfaces.IB'}] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC.as
new file mode 100644
index 0000000..9183bac
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+  public interface IC extends ID {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC_result.js
new file mode 100644
index 0000000..9e5298b
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IC_result.js
@@ -0,0 +1,41 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IC
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('interfaces.IC');
+
+goog.require('interfaces.ID');
+
+
+
+/**
+ * @interface
+ * @extends {interfaces.ID}
+ */
+interfaces.IC = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IC.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IC', qName: 'interfaces.IC'}], interfaces: [interfaces.ID] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID.as
new file mode 100644
index 0000000..d5e9543
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID.as
@@ -0,0 +1,22 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 interfaces
+{
+    public interface ID {}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID_result.js
new file mode 100644
index 0000000..a730bbb
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/ID_result.js
@@ -0,0 +1,38 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.ID
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('interfaces.ID');
+
+
+
+/**
+ * @interface
+ */
+interfaces.ID = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.ID.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'ID', qName: 'interfaces.ID'}] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE.as b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE.as
new file mode 100644
index 0000000..d2c7ce1
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE.as
@@ -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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package interfaces
+{
+    public interface IE {
+      function myMethod():void;
+      function get myProp():String;
+      function set myProp(value:String):void;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE_result.js b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE_result.js
new file mode 100644
index 0000000..63d68c7
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/interfaces/interfaces/IE_result.js
@@ -0,0 +1,53 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * interfaces.IE
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('interfaces.IE');
+
+
+
+/**
+ * @interface
+ */
+interfaces.IE = function() {
+};
+
+
+interfaces.IE.prototype.myMethod = function() {};
+
+
+/**
+ * @return {string}
+ */
+interfaces.IE.prototype.get_myProp = function() {};
+
+
+/**
+ * @param {string} value
+ */
+interfaces.IE.prototype.set_myProp = function(value) {};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+interfaces.IE.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IE', qName: 'interfaces.IE'}] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass.as b/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass.as
new file mode 100644
index 0000000..52541c2
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass.as
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//	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
+{
+
+import mx.core.mx_internal;
+
+import bases.HelperBaseClass;
+
+use namespace mx_internal;
+
+public class SomeSDKClass
+{
+	public function SomeSDKClass() {}; 
+
+	private var number:Number = 'Got it: ' + this.getString(); 
+
+	public function getString():String
+	{
+		return Helper.helperFunction();
+	}
+
+	public function someFunction():String
+	{
+		helperBaseClass.doSomething();
+	}
+
+	mx_internal var helperBaseClass:HelperBaseClass = new HelperBaseClass();
+}
+
+}
+
+import bases.HelperBaseClass;
+
+class Helper extends HelperBaseClass
+{
+
+	public static function helperFunction():String {
+		return "Hello world";
+	}
+	
+	public function Helper(url:String) {
+	  url_ = url;
+	}
+	
+	private var url_:String;
+	
+	public function get url():String {
+		return url_;
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass_result.js b/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass_result.js
new file mode 100644
index 0000000..fd32667
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/sdk/SomeSDKClass_result.js
@@ -0,0 +1,114 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * SomeSDKClass
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('SomeSDKClass');
+
+goog.require('bases.HelperBaseClass');
+goog.require('mx.core.mx_internal');
+goog.require('org.apache.flex.utils.Language');
+
+
+
+/**
+ * @constructor
+ */
+SomeSDKClass = function() {
+  this.number = 'Got it: ' + this.getString();
+
+  this.helperBaseClass = new bases.HelperBaseClass();
+};
+
+
+/**
+ * @private
+ * @type {number}
+ */
+SomeSDKClass.prototype.number;
+
+
+/**
+ * @export
+ * @return {string}
+ */
+SomeSDKClass.prototype.getString = function() {
+  return Helper.helperFunction();
+};
+
+
+/**
+ * @export
+ * @return {string}
+ */
+SomeSDKClass.prototype.someFunction = function() {
+  this.helperBaseClass.doSomething();
+};
+
+
+/**
+ * @type {bases.HelperBaseClass}
+ */
+SomeSDKClass.prototype.helperBaseClass;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+SomeSDKClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'SomeSDKClass', qName: 'SomeSDKClass'}] };
+
+
+
+/**
+ * @constructor
+ * @extends {bases.HelperBaseClass}
+ * @param {string} url
+ */
+Helper = function(url) {
+  Helper.base(this, 'constructor', url);
+  this.url_ = url;
+};
+goog.inherits(Helper, bases.HelperBaseClass);
+
+
+/**
+ * @export
+ * @return {string}
+ */
+Helper.helperFunction = function() {
+  return "Hello world";
+};
+
+
+/**
+ * @private
+ * @type {string}
+ */
+Helper.prototype.url_;
+
+
+/**
+ * @export
+ * @return {string}
+ */
+Helper.prototype.get_url = function() {
+  return this.url_;
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass.as b/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass.as
new file mode 100644
index 0000000..487990a
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass.as
@@ -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 bases
+{
+
+public class HelperBaseClass
+{
+	
+	public function HelperBaseClass() {};
+	
+	public function doSomething():String {
+		return 'doneSomething';
+	}
+
+}
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass_result.js b/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass_result.js
new file mode 100644
index 0000000..2460bb0
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/sdk/bases/HelperBaseClass_result.js
@@ -0,0 +1,46 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * bases.HelperBaseClass
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('bases.HelperBaseClass');
+
+
+
+/**
+ * @constructor
+ */
+bases.HelperBaseClass = function() {};
+
+
+/**
+ * @export
+ * @return {string}
+ */
+bases.HelperBaseClass.prototype.doSomething = function() {
+  return 'doneSomething';
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+bases.HelperBaseClass.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'HelperBaseClass', qName: 'bases.HelperBaseClass'}] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project.mxml
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project.mxml b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project.mxml
new file mode 100644
index 0000000..160b7c9
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project.mxml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" 
+			   xmlns:example="example.*"
+			   minHeight="600"
+			   minWidth="955">
+	
+	<fx:Script><![CDATA[
+		
+		private var myComponent:Component = new Component();
+		
+	]]></fx:Script>
+	
+	<fx:Declarations>
+		<example:Component myProperty="oops" />
+	</fx:Declarations>
+	
+</s:Application>

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js
new file mode 100644
index 0000000..0acd486
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js
@@ -0,0 +1,68 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * SimpleMXML_Project
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('SimpleMXML_Project');
+
+goog.require('spark.components.Application');
+goog.require('example.Component');
+goog.require('org.apache.flex.utils.Language');
+
+
+
+
+/**
+ * @constructor
+ * @extends {spark.components.Application}
+ */
+SimpleMXML_Project = function() {
+  SimpleMXML_Project.base(this, 'constructor');
+  
+  /**
+   * @private
+   * @type {example.Component}
+   */
+  this.$ID0;
+};
+goog.inherits(SimpleMXML_Project, spark.components.Application);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+SimpleMXML_Project.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'SimpleMXML_Project', qName: 'SimpleMXML_Project' }] };
+
+
+/**
+ * @private
+ * @type {example.Component}
+ */
+SimpleMXML_Project.prototype.myComponent;
+
+
+/**
+ * start
+ *
+ * @export
+ */
+SimpleMXML_Project.prototype.start = function () {
+};

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component.as b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component.as
new file mode 100644
index 0000000..02c03c3
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component.as
@@ -0,0 +1,31 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 example
+{
+
+	public class Component
+	{
+		public function Component()
+		{
+			super();
+		}
+		
+		public var myProperty:Object = {};
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component_result.js b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component_result.js
new file mode 100644
index 0000000..89b829f
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/simpleMXML/src/example/Component_result.js
@@ -0,0 +1,45 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * example.Component
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('example.Component');
+
+
+
+/**
+ * @constructor
+ */
+example.Component = function() {
+  ;
+};
+
+
+/**
+ * @type {Object}
+ */
+example.Component.prototype.myProperty = {};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+example.Component.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Component', qName: 'example.Component'}] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/super/Base.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/super/Base.as b/compiler-jx/src/test/resources/vf2js/projects/super/Base.as
new file mode 100644
index 0000000..ee69d65
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/super/Base.as
@@ -0,0 +1,65 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//	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
+{
+
+import Super;
+
+public class Base extends Super
+{
+	public static var myClassConst:String = new Number();
+	
+	public function Base() 
+	{
+		super();
+	}; 
+
+	private var number:Number = this.getNumber(); 
+	
+	private var newText:String = this.text; 
+	
+	private var newTextAgain:String = text; 
+	
+	override public function get text():String 
+	{
+		return "A" + super.text;
+	};
+
+	override public function set text(value:String):void 
+	{
+		if (value != super.text)
+		{
+			super.text = "B" + value;
+		}
+	};
+	
+	public function getNumber():void
+	{
+		alert(super.doStuff());
+		
+		var x:Number = super.x;
+	}
+	
+	override public function doStuff():Number 
+	{
+		throw new Error("No way!");
+	};
+
+}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/super/Base_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/super/Base_result.js b/compiler-jx/src/test/resources/vf2js/projects/super/Base_result.js
new file mode 100644
index 0000000..7ca1ad1
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/super/Base_result.js
@@ -0,0 +1,120 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Base
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('Base');
+
+goog.require('Super');
+goog.require('org.apache.flex.utils.Language');
+
+
+
+/**
+ * @constructor
+ * @extends {Super}
+ */
+Base = function() {
+  
+    Base.myClassConst = new Number();
+  
+    this.number = this.getNumber();
+  
+    this.newText = this.get_text();
+  
+    this.newTextAgain = this.get_text();
+  Base.base(this, 'constructor');
+};
+goog.inherits(Base, Super);
+
+
+/**
+ * @type {string}
+ */
+Base.myClassConst;
+
+
+/**
+ * @private
+ * @type {number}
+ */
+Base.prototype.number;
+
+
+/**
+ * @private
+ * @type {string}
+ */
+Base.prototype.newText;
+
+
+/**
+ * @private
+ * @type {string}
+ */
+Base.prototype.newTextAgain;
+
+
+/**
+ * @export
+ * @return {string}
+ * @override
+ */
+Base.prototype.get_text = function() {
+  return "A" + Base.base(this, 'get_text');
+};
+
+
+/**
+ * @export
+ * @param {string} value
+ * @override
+ */
+Base.prototype.set_text = function(value) {
+  if (value != Base.base(this, 'get_text')) {
+    Base.base(this, 'set_text', "B" + value);
+  }
+};
+
+
+/**
+ * @export
+ */
+Base.prototype.getNumber = function() {
+  alert(this.superClass_.doStuff.call(this));
+  var /** @type {number} */ x = this.get_x();
+};
+
+
+/**
+ * @export
+ * @return {number}
+ * @override
+ */
+Base.prototype.doStuff = function() {
+  throw new Error("No way!");
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Base.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Base', qName: 'Base'}] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/super/Super.as
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/super/Super.as b/compiler-jx/src/test/resources/vf2js/projects/super/Super.as
new file mode 100644
index 0000000..3a2bca2
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/super/Super.as
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//	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
+{
+
+public class Super
+{
+	public function Super() {}; 
+
+	private var _text:String = '';
+
+	public function get text():String 
+	{
+		return _text;
+	};
+
+	public function set text(value:String):void 
+	{
+		if (value != _text)
+		{
+			_text = value;
+		}
+	};
+	
+	private var _x:Number = 5;
+	
+	public function get x():Number 
+	{
+		return _x;
+	};
+	
+	public function doStuff():Number 
+	{
+		return "Stuff is done";
+	};
+	
+}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/resources/vf2js/projects/super/Super_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/vf2js/projects/super/Super_result.js b/compiler-jx/src/test/resources/vf2js/projects/super/Super_result.js
new file mode 100644
index 0000000..d8bfa78
--- /dev/null
+++ b/compiler-jx/src/test/resources/vf2js/projects/super/Super_result.js
@@ -0,0 +1,89 @@
+/**
+ * Licensed 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.
+ */
+/**
+ * Super
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('Super');
+
+
+
+/**
+ * @constructor
+ */
+Super = function() {};
+
+
+/**
+ * @private
+ * @type {string}
+ */
+Super.prototype._text = '';
+
+
+/**
+ * @export
+ * @return {string}
+ */
+Super.prototype.get_text = function() {
+  return this._text;
+};
+
+
+/**
+ * @export
+ * @param {string} value
+ */
+Super.prototype.set_text = function(value) {
+  if (value != this._text) {
+    this._text = value;
+  }
+};
+
+
+/**
+ * @private
+ * @type {number}
+ */
+Super.prototype._x = 5;
+
+
+/**
+ * @export
+ * @return {number}
+ */
+Super.prototype.get_x = function() {
+  return this._x;
+};
+
+
+/**
+ * @export
+ * @return {number}
+ */
+Super.prototype.doStuff = function() {
+  return "Stuff is done";
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+Super.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'Super', qName: 'Super'}] };

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/.classpath
----------------------------------------------------------------------
diff --git a/compiler.js/.classpath b/compiler.js/.classpath
deleted file mode 100644
index bfc5a23..0000000
--- a/compiler.js/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="build/generatedSrc/as3.codegen"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="lib" path="lib/google/closure-compiler/compiler.jar"/>
-	<classpathentry kind="lib" path="lib/org.apache.felix.framework-3.0.2.jar"/>
-	<classpathentry kind="lib" path="lib/antlr.jar"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/compiler"/>
-	<classpathentry kind="lib" path="lib/commons-cli.jar"/>
-	<classpathentry kind="lib" path="lib/commons-io.jar"/>
-	<classpathentry kind="output" path="classes"/>
-</classpath>

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/.gitignore
----------------------------------------------------------------------
diff --git a/compiler.js/.gitignore b/compiler.js/.gitignore
deleted file mode 100644
index d3bc09e..0000000
--- a/compiler.js/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-# ignored files/directories for the 'compiler.js' project
-/build
-/classes
-/in
-/intermediates
-/lib
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/.project
----------------------------------------------------------------------
diff --git a/compiler.js/.project b/compiler.js/.project
deleted file mode 100644
index ceb17b3..0000000
--- a/compiler.js/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>compiler.js</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>


[38/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
new file mode 100644
index 0000000..d47c6dc
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
@@ -0,0 +1,290 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.flex.compiler.asdoc.flexjs.ASDocComment;
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.definitions.IPackageDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.definitions.IVariableDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.scopes.ASProjectScope;
+import org.apache.flex.compiler.internal.scopes.PackageScope;
+import org.apache.flex.compiler.internal.tree.as.ClassNode;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.scopes.IASScope;
+import org.apache.flex.compiler.targets.ITarget.TargetType;
+import org.apache.flex.compiler.tree.as.ITypeNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.utils.NativeUtils;
+
+public class PackageHeaderEmitter extends JSSubEmitter implements
+        ISubEmitter<IPackageDefinition>
+{
+
+    public PackageHeaderEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IPackageDefinition definition)
+    {
+        IASScope containedScope = definition.getContainedScope();
+        ITypeDefinition type = EmitterUtils.findType(containedScope
+                .getAllLocalDefinitions());
+        String qname = null;
+        if (type != null)
+        {
+            qname = type.getQualifiedName();
+        }
+        if (qname == null)
+        {
+            IFunctionDefinition fn = EmitterUtils.findFunction(containedScope
+                    .getAllLocalDefinitions());
+            if(fn != null)
+            {
+                qname = fn.getQualifiedName();
+            }
+        }
+        if (qname == null)
+        {
+            IVariableDefinition variable = EmitterUtils.findVariable(containedScope
+                    .getAllLocalDefinitions());
+            if(variable != null)
+            {
+                qname = variable.getQualifiedName();
+            }
+        }
+        if (qname == null)
+        {
+            return;
+        }
+        
+        FlexJSProject project = (FlexJSProject) getProject();
+        List<File> sourcePaths = project.getSourcePath();
+        String sourceName = definition.getSourcePath();
+        for (File sourcePath : sourcePaths)
+        {
+            if (sourceName.startsWith(sourcePath.getAbsolutePath())) 
+            {
+            	sourceName = sourceName.substring(sourcePath.getAbsolutePath().length() + 1);        	
+            }
+        }
+
+        writeNewline("/**");
+        writeNewline(" * Generated by Apache Flex Cross-Compiler from " + sourceName);
+        writeNewline(" * " + qname);
+        writeNewline(" *");
+        writeNewline(" * @fileoverview");
+        writeNewline(" *");
+        // need to suppress access controls so access to protected/private from defineProperties
+        // doesn't generate warnings. 
+        writeNewline(" * @suppress {checkTypes|accessControls}");
+        writeNewline(" */");
+        writeNewline();
+
+        /* goog.provide('x');\n\n */
+        write(JSGoogEmitterTokens.GOOG_PROVIDE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(getEmitter().formatQualifiedName(qname));
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline(ASEmitterTokens.SEMICOLON);
+        writeNewline();
+    }
+
+    public void emitContents(IPackageDefinition definition)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+        
+        getEmitter().pushSourceMapName(definition.getNode());
+
+        PackageScope containedScope = (PackageScope) definition
+                .getContainedScope();
+
+        ArrayList<String> writtenRequires = new ArrayList<String>();
+
+        Collection<IDefinition> localDefinitions = containedScope.getAllLocalDefinitions();
+        ITypeDefinition type = EmitterUtils.findType(localDefinitions);
+        IDefinition otherMainDefinition = null;
+        if (type == null)
+        {
+        	if (localDefinitions.isEmpty())
+        		return;
+        	// function or variable definition
+        	otherMainDefinition = localDefinitions.iterator().next();
+        }
+        else
+        {
+	        ITypeNode typeNode = type.getNode();
+	        if (typeNode instanceof ClassNode)
+	        {
+	            ClassNode classNode = (ClassNode) typeNode;
+	            ASDocComment asDoc = (ASDocComment) classNode.getASDocComment();
+	            if (asDoc != null)
+	            {
+	                String asDocString = asDoc.commentNoEnd();
+	                String ignoreToken = JSFlexJSEmitterTokens.IGNORE_IMPORT
+	                        .getToken();
+	                int ignoreIndex = asDocString.indexOf(ignoreToken);
+	                while (ignoreIndex != -1)
+	                {
+	                    String ignorable = asDocString.substring(ignoreIndex
+	                            + ignoreToken.length());
+	                    int endIndex = ignorable.indexOf("\n");
+	                    ignorable = ignorable.substring(0, endIndex);
+	                    ignorable = ignorable.trim();
+	                    // pretend we've already written the goog.requires for this
+	                    writtenRequires.add(ignorable);
+	                    ignoreIndex = asDocString.indexOf(ignoreToken,
+	                            ignoreIndex + ignoreToken.length());
+	                }
+	            }
+	        }
+        }
+        
+        //        if (project == null)
+        //            project = getWalker().getProject();
+
+        FlexJSProject flexProject = (FlexJSProject) getProject();
+        ASProjectScope projectScope = (ASProjectScope) flexProject.getScope();
+        ICompilationUnit cu = projectScope
+                .getCompilationUnitForDefinition(type != null ? type : otherMainDefinition);
+        ArrayList<String> requiresList = flexProject.getRequires(cu);
+        ArrayList<String> interfacesList = flexProject.getInterfaces(cu);
+        
+        String cname = (type != null) ? type.getQualifiedName() : otherMainDefinition.getQualifiedName();
+        writtenRequires.add(cname); // make sure we don't add ourselves
+
+        boolean emitsRequires = false;
+        if (requiresList != null)
+        {
+            Collections.sort(requiresList);
+            for (String imp : requiresList)
+            {
+                if (imp.contains(JSGoogEmitterTokens.AS3.getToken()))
+                    continue;
+
+                if (imp.equals(JSGoogEmitterTokens.GOOG_BIND.getToken()))
+                    continue;
+
+                if (imp.equals(cname))
+                    continue;
+
+                if (NativeUtils.isNative(imp))
+                {
+                	if (!(imp.equals("QName") || imp.equals("Namespace") || imp.equals("XML") || imp.equals("XMLList")))
+                		continue;                	
+                }
+
+                if (writtenRequires.indexOf(imp) == -1)
+                {
+
+                    /* goog.require('x');\n */
+                    write(JSGoogEmitterTokens.GOOG_REQUIRE);
+                    write(ASEmitterTokens.PAREN_OPEN);
+                    write(ASEmitterTokens.SINGLE_QUOTE);
+                    write(fjs.formatQualifiedName(imp));
+                    write(ASEmitterTokens.SINGLE_QUOTE);
+                    write(ASEmitterTokens.PAREN_CLOSE);
+                    writeNewline(ASEmitterTokens.SEMICOLON);
+
+                    writtenRequires.add(imp);
+
+                    emitsRequires = true;
+                }
+            }
+        }
+
+        boolean emitsInterfaces = false;
+        if (interfacesList != null)
+        {
+            Collections.sort(interfacesList);
+            for (String imp : interfacesList)
+            {
+                if (writtenRequires.indexOf(imp) == -1)
+                {
+                    write(JSGoogEmitterTokens.GOOG_REQUIRE);
+                    write(ASEmitterTokens.PAREN_OPEN);
+                    write(ASEmitterTokens.SINGLE_QUOTE);
+                    write(fjs.formatQualifiedName(imp));
+                    write(ASEmitterTokens.SINGLE_QUOTE);
+                    write(ASEmitterTokens.PAREN_CLOSE);
+                    writeNewline(ASEmitterTokens.SEMICOLON);
+
+                    emitsInterfaces = true;
+                }
+            }
+        }
+
+        // erikdebruin: Add missing language feature support, with e.g. 'is' and 
+        //              'as' operators. We don't need to worry about requiring
+        //              this in every project: ADVANCED_OPTIMISATIONS will NOT
+        //              include any of the code if it is not used in the project.
+        boolean makingSWC = flexProject.getSWFTarget() != null && 
+        					flexProject.getSWFTarget().getTargetType() == TargetType.SWC;
+        boolean isMainCU = flexProject.mainCU != null
+                && cu.getName().equals(flexProject.mainCU.getName());
+        if (isMainCU || makingSWC)
+        {
+            ICompilerProject project = this.getProject();
+            if (project instanceof FlexJSProject)
+            {
+            	if (((FlexJSProject)project).needLanguage)
+            	{
+		            write(JSGoogEmitterTokens.GOOG_REQUIRE);
+		            write(ASEmitterTokens.PAREN_OPEN);
+		            write(ASEmitterTokens.SINGLE_QUOTE);
+		            write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+		            write(ASEmitterTokens.SINGLE_QUOTE);
+		            write(ASEmitterTokens.PAREN_CLOSE);
+		            writeNewline(ASEmitterTokens.SEMICOLON);
+            	}
+            }
+        }
+
+        if (emitsRequires || emitsInterfaces || isMainCU)
+        {
+            writeNewline();
+        }
+
+        writeNewline();
+        writeNewline();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ParameterEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ParameterEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ParameterEmitter.java
new file mode 100644
index 0000000..832d691
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ParameterEmitter.java
@@ -0,0 +1,61 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+
+public class ParameterEmitter extends JSSubEmitter implements
+        ISubEmitter<IParameterNode>
+{
+    public ParameterEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IParameterNode node)
+    {
+        startMapping(node);
+        if (node.isRest())
+        {
+            write(ASEmitterTokens.ELLIPSIS);
+            write(node.getName());
+        }
+        else
+        {
+            getWalker().walk(node.getNameExpressionNode());
+            write(ASEmitterTokens.COLON);
+            getWalker().walk(node.getVariableTypeNode());
+            IExpressionNode anode = node.getAssignedValueNode();
+            if (anode != null)
+            {
+                write(ASEmitterTokens.SPACE);
+                writeToken(ASEmitterTokens.EQUAL);
+                getWalker().walk(anode);
+            }
+        }
+        endMapping(node);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ParametersEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ParametersEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ParametersEmitter.java
new file mode 100644
index 0000000..01e1f25
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ParametersEmitter.java
@@ -0,0 +1,64 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+
+public class ParametersEmitter extends JSSubEmitter implements
+        ISubEmitter<IContainerNode>
+{
+    public ParametersEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IContainerNode node)
+    {
+        startMapping(node);
+        write(ASEmitterTokens.PAREN_OPEN);
+        endMapping(node);
+
+        int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            IParameterNode parameterNode = (IParameterNode) node.getChild(i);
+            getWalker().walk(parameterNode); //emitParameter
+            if (i < len - 1)
+            {
+                //we're mapping the comma to the container, but we use the
+                //parameter line/column in case the comma is not on the same
+                //line as the opening (
+                startMapping(node, parameterNode);
+                writeToken(ASEmitterTokens.COMMA);
+                endMapping(node);
+            }
+        }
+
+        startMapping(node, node.getLine(), node.getColumn() + node.getAbsoluteEnd() - node.getAbsoluteStart() - 1);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        endMapping(node);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ReturnEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ReturnEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ReturnEmitter.java
new file mode 100644
index 0000000..407b80c
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ReturnEmitter.java
@@ -0,0 +1,57 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IReturnNode;
+
+public class ReturnEmitter extends JSSubEmitter implements
+        ISubEmitter<IReturnNode>
+{
+    public ReturnEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IReturnNode node)
+    {
+        IExpressionNode rnode = node.getReturnValueNode();
+        boolean hasReturnValue = rnode != null && rnode.getNodeID() != ASTNodeID.NilID;
+
+        startMapping(node);
+        write(ASEmitterTokens.RETURN);
+        if (hasReturnValue)
+        {
+            write(ASEmitterTokens.SPACE);
+        }
+        endMapping(node);
+
+        if (hasReturnValue)
+        {
+            getWalker().walk(rnode);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SelfReferenceEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SelfReferenceEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SelfReferenceEmitter.java
new file mode 100644
index 0000000..6e662ce
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SelfReferenceEmitter.java
@@ -0,0 +1,52 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+
+public class SelfReferenceEmitter extends JSSubEmitter implements
+        ISubEmitter<IFunctionNode>
+{
+
+    public SelfReferenceEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IFunctionNode node)
+    {
+        // we don't want 'var self = this;' in FlexJS
+        // unless there are anonymous functions
+        if (node.containsLocalFunctions())
+        {
+            writeToken(ASEmitterTokens.VAR);
+            writeToken(JSGoogEmitterTokens.SELF);
+            writeToken(ASEmitterTokens.EQUAL);
+            write(ASEmitterTokens.THIS);
+            writeNewline(ASEmitterTokens.SEMICOLON);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SourceMapDirectiveEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SourceMapDirectiveEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SourceMapDirectiveEmitter.java
new file mode 100644
index 0000000..14674de
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SourceMapDirectiveEmitter.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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.clients.JSConfiguration;
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.tree.as.ITypeNode;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+
+public class SourceMapDirectiveEmitter extends JSSubEmitter implements
+        ISubEmitter<ITypeNode>
+{
+    public SourceMapDirectiveEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(ITypeNode node)
+    {
+        boolean sourceMap = false;
+
+        IBlockWalker walker = getWalker();
+        FlexJSProject project = (FlexJSProject) walker.getProject();
+        if (project != null)
+        {
+            JSConfiguration config = project.config;
+            if (config != null)
+            {
+                sourceMap = config.getSourceMap();
+            }
+        }
+
+        if (sourceMap)
+        {
+            writeNewline();
+            write("//# sourceMappingURL=./" + node.getName() + ".js.map");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/StatementEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/StatementEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/StatementEmitter.java
new file mode 100644
index 0000000..7cf897c
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/StatementEmitter.java
@@ -0,0 +1,55 @@
+package org.apache.flex.compiler.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IStatementNode;
+
+public class StatementEmitter extends JSSubEmitter implements
+        ISubEmitter<IASNode>
+{
+    public StatementEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IASNode node)
+    {
+        getWalker().walk(node);
+
+        // XXX (mschmalle) this should be in the after handler?
+        if (node.getParent().getNodeID() != ASTNodeID.LabledStatementID
+                && node.getNodeID() != ASTNodeID.ConfigBlockID
+                && !(node instanceof IStatementNode))
+        {
+            startMapping(node, node);
+            write(ASEmitterTokens.SEMICOLON);
+            endMapping(node);
+        }
+
+        if (!isLastStatement(node))
+            writeNewline();
+    }
+
+    protected static boolean isLastStatement(IASNode node)
+    {
+        return getChildIndex(node.getParent(), node) == node.getParent()
+                .getChildCount() - 1;
+    }
+
+    // this is not fair that we have to do this if (i < len - 1)
+    private static int getChildIndex(IASNode parent, IASNode node)
+    {
+        final int len = parent.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            if (parent.getChild(i) == node)
+                return i;
+        }
+        return -1;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java
new file mode 100644
index 0000000..5546ee0
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java
@@ -0,0 +1,268 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.clients.MXMLJSC;
+import org.apache.flex.compiler.clients.MXMLJSC.JSOutputType;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSessionModel;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.tree.as.BinaryOperatorAssignmentNode;
+import org.apache.flex.compiler.internal.tree.as.FunctionCallNode;
+import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
+import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+
+public class SuperCallEmitter extends JSSubEmitter
+{
+
+    public SuperCallEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    public void emit(IASNode node, String type)
+    {
+        IFunctionNode fnode = (node instanceof IFunctionNode) ? (IFunctionNode) node
+                : null;
+        IFunctionCallNode fcnode = (node instanceof IFunctionCallNode) ? (FunctionCallNode) node
+                : null;
+
+        final IClassDefinition thisClass = getModel().getCurrentClass();
+
+        if (type == JSSessionModel.SUPER_FUNCTION_CALL)
+        {
+            if (fnode == null)
+                fnode = (IFunctionNode) fcnode
+                        .getAncestorOfType(IFunctionNode.class);
+
+            if (fnode != null && fnode.isConstructor()
+                    && !EmitterUtils.hasSuperClass(getProject(), fnode))
+                return;
+
+            IClassNode cnode = (IClassNode) node
+                    .getAncestorOfType(IClassNode.class);
+
+            // ToDo (erikdebruin): add VF2JS conditional -> only use check during full SDK compilation
+            if (cnode == null && MXMLJSC.jsOutputType == JSOutputType.VF2JS)
+                return;
+
+            if (fnode != null
+                    && (fnode.getNodeID() == ASTNodeID.GetterID || fnode
+                            .getNodeID() == ASTNodeID.SetterID))
+            {
+                ICompilerProject project = this.getProject();
+                if (project instanceof FlexJSProject)
+                	((FlexJSProject)project).needLanguage = true;
+                write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                if (fnode.getNodeID() == ASTNodeID.GetterID)
+                    write(JSFlexJSEmitterTokens.SUPERGETTER);
+                else
+                    write(JSFlexJSEmitterTokens.SUPERSETTER);
+                write(ASEmitterTokens.PAREN_OPEN);
+                if (cnode == null && thisClass != null)
+                    write(getEmitter().formatQualifiedName(
+                            thisClass.getQualifiedName()));
+                else
+                    write(getEmitter().formatQualifiedName(
+                            cnode.getQualifiedName()));
+                writeToken(ASEmitterTokens.COMMA);
+                write(ASEmitterTokens.THIS);
+                writeToken(ASEmitterTokens.COMMA);
+                write(ASEmitterTokens.SINGLE_QUOTE);
+                write(fnode.getName());
+                write(ASEmitterTokens.SINGLE_QUOTE);
+
+                IASNode[] anodes = null;
+                boolean writeArguments = false;
+                if (fcnode != null)
+                {
+                    anodes = fcnode.getArgumentNodes();
+
+                    writeArguments = anodes.length > 0;
+                }
+                else if (fnode != null && fnode.isConstructor())
+                {
+                    anodes = fnode.getParameterNodes();
+
+                    writeArguments = (anodes != null && anodes.length > 0);
+                }
+                else if (node instanceof IFunctionNode
+                        && node instanceof BinaryOperatorAssignmentNode)
+                {
+                    BinaryOperatorAssignmentNode bnode = (BinaryOperatorAssignmentNode) node;
+
+                    IFunctionNode pnode = (IFunctionNode) bnode
+                            .getAncestorOfType(IFunctionNode.class);
+
+                    if (pnode.getNodeID() == ASTNodeID.SetterID)
+                    {
+                        writeToken(ASEmitterTokens.COMMA);
+                        getWalker().walk(bnode.getRightOperandNode());
+                    }
+                }
+
+                if (writeArguments)
+                {
+                    int len = anodes.length;
+                    for (int i = 0; i < len; i++)
+                    {
+                        writeToken(ASEmitterTokens.COMMA);
+
+                        getWalker().walk(anodes[i]);
+                    }
+                }
+
+                write(ASEmitterTokens.PAREN_CLOSE);
+                return;
+            }
+        }
+        super_emitSuperCall(node, type);
+    }
+
+    protected void super_emitSuperCall(IASNode node, String type)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+
+        IFunctionNode fnode = (node instanceof IFunctionNode) ? (IFunctionNode) node
+                : null;
+        IFunctionCallNode fcnode = (node instanceof IFunctionCallNode) ? (FunctionCallNode) node
+                : null;
+
+        if (type == JSSessionModel.CONSTRUCTOR_EMPTY)
+        {
+            indentPush();
+            writeNewline();
+            indentPop();
+        }
+        else if (type == JSSessionModel.SUPER_FUNCTION_CALL)
+        {
+            if (fnode == null)
+                fnode = (IFunctionNode) fcnode
+                        .getAncestorOfType(IFunctionNode.class);
+        }
+
+        if (fnode.isConstructor()
+                && !EmitterUtils.hasSuperClass(getProject(), fnode))
+            return;
+
+        IClassNode cnode = (IClassNode) node
+                .getAncestorOfType(IClassNode.class);
+
+        if (cnode == null)
+        {
+            IDefinition cdef = getModel().getCurrentClass();
+            write(fjs.formatQualifiedName(cdef.getQualifiedName()));
+        }
+        else
+            write(fjs.formatQualifiedName(cnode.getQualifiedName()));
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        write(JSGoogEmitterTokens.GOOG_BASE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(ASEmitterTokens.THIS);
+
+        if (fnode.isConstructor())
+        {
+            writeToken(ASEmitterTokens.COMMA);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+            write(JSGoogEmitterTokens.GOOG_CONSTRUCTOR);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+        }
+
+        if (fnode != null && !fnode.isConstructor())
+        {
+            writeToken(ASEmitterTokens.COMMA);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+            IExpressionNode namenode = fcnode.getNameNode();
+            String superName = fnode.getName();
+            if (namenode instanceof MemberAccessExpressionNode)
+            {
+            	namenode = ((MemberAccessExpressionNode)namenode).getRightOperandNode();
+            	if (namenode instanceof IdentifierNode)
+            	{
+            		superName = ((IdentifierNode)namenode).getName();
+            	}
+            }
+            write(superName);
+            write(ASEmitterTokens.SINGLE_QUOTE);
+        }
+
+        IASNode[] anodes = null;
+        boolean writeArguments = false;
+        if (fcnode != null)
+        {
+            anodes = fcnode.getArgumentNodes();
+
+            writeArguments = anodes.length > 0;
+        }
+        else if (fnode.isConstructor())
+        {
+        	// I think we only get here for implicit super calls
+        	// (when there is no mention of super() in the constructor
+        	// code and the compiler autogenerates the super() call)
+        	// and implicit super calls do not have parameters passed
+        	// to them.
+        	/*
+            anodes = fnode.getParameterNodes();
+
+            writeArguments = (anodes != null && anodes.length > 0);
+            */
+        }
+
+        if (writeArguments)
+        {
+            int len = anodes.length;
+            for (int i = 0; i < len; i++)
+            {
+                writeToken(ASEmitterTokens.COMMA);
+
+                getWalker().walk(anodes[i]);
+            }
+        }
+
+        write(ASEmitterTokens.PAREN_CLOSE);
+
+        if (type == JSSessionModel.CONSTRUCTOR_FULL)
+        {
+            write(ASEmitterTokens.SEMICOLON);
+            writeNewline();
+        }
+        else if (type == JSSessionModel.CONSTRUCTOR_EMPTY)
+        {
+            write(ASEmitterTokens.SEMICOLON);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/TernaryOperatorEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/TernaryOperatorEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/TernaryOperatorEmitter.java
new file mode 100644
index 0000000..8273e1b
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/TernaryOperatorEmitter.java
@@ -0,0 +1,67 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IOperatorNode;
+import org.apache.flex.compiler.tree.as.ITernaryOperatorNode;
+import org.apache.flex.compiler.utils.ASNodeUtils;
+
+public class TernaryOperatorEmitter extends JSSubEmitter implements
+        ISubEmitter<ITernaryOperatorNode>
+{
+    public TernaryOperatorEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(ITernaryOperatorNode node)
+    {
+        if (ASNodeUtils.hasParenOpen((IOperatorNode) node))
+            write(ASEmitterTokens.PAREN_OPEN);
+
+        IExpressionNode conditionalNode = node.getConditionalNode();
+        getWalker().walk(conditionalNode);
+
+        IExpressionNode leftOperandNode = node.getLeftOperandNode();
+        startMapping(node, conditionalNode);
+        write(ASEmitterTokens.SPACE);
+        writeToken(ASEmitterTokens.TERNARY);
+        endMapping(node);
+
+        getWalker().walk(leftOperandNode);
+
+        IExpressionNode rightOperandNode = node.getRightOperandNode();
+        startMapping(node, leftOperandNode);
+        write(ASEmitterTokens.SPACE);
+        writeToken(ASEmitterTokens.COLON);
+        endMapping(node);
+
+        getWalker().walk(rightOperandNode);
+
+        if (ASNodeUtils.hasParenClose((IOperatorNode) node))
+            write(ASEmitterTokens.PAREN_CLOSE);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/UnaryOperatorEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/UnaryOperatorEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/UnaryOperatorEmitter.java
new file mode 100644
index 0000000..88bb154
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/UnaryOperatorEmitter.java
@@ -0,0 +1,122 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.utils.ASNodeUtils;
+
+public class UnaryOperatorEmitter extends JSSubEmitter implements
+        ISubEmitter<IUnaryOperatorNode>
+{
+    public UnaryOperatorEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IUnaryOperatorNode node)
+    {
+        if (ASNodeUtils.hasParenOpen(node))
+            write(ASEmitterTokens.PAREN_OPEN);
+
+        if (node.getNodeID() == ASTNodeID.Op_PreIncrID
+                || node.getNodeID() == ASTNodeID.Op_PreDecrID
+                || node.getNodeID() == ASTNodeID.Op_BitwiseNotID
+                || node.getNodeID() == ASTNodeID.Op_LogicalNotID
+                || node.getNodeID() == ASTNodeID.Op_SubtractID
+                || node.getNodeID() == ASTNodeID.Op_AddID)
+        {
+            emitPreUnaryOperator(node);
+        }
+        else if (node.getNodeID() == ASTNodeID.Op_PostIncrID
+                || node.getNodeID() == ASTNodeID.Op_PostDecrID)
+        {
+            emitPostUnaryOperator(node);
+        }
+        else if (node.getNodeID() == ASTNodeID.Op_DeleteID)
+        {
+            emitDeleteOperator(node);
+        }
+        else if (node.getNodeID() == ASTNodeID.Op_VoidID)
+        {
+            emitVoidOperator(node);
+        }
+        else if (node.getNodeID() == ASTNodeID.Op_TypeOfID)
+        {
+            emitTypeOfOperator(node);
+        }
+
+        if (ASNodeUtils.hasParenClose(node))
+            write(ASEmitterTokens.PAREN_CLOSE);
+    }
+
+    public void emitPreUnaryOperator(IUnaryOperatorNode node)
+    {
+        startMapping(node);
+        write(node.getOperator().getOperatorText());
+        IExpressionNode opNode = node.getOperandNode();
+        endMapping(node);
+        getWalker().walk(opNode);
+    }
+
+    protected void emitPostUnaryOperator(IUnaryOperatorNode node)
+    {
+        IExpressionNode operandNode = node.getOperandNode();
+        getWalker().walk(operandNode);
+        startMapping(node, operandNode);
+        write(node.getOperator().getOperatorText());
+        endMapping(node);
+    }
+
+    protected void emitDeleteOperator(IUnaryOperatorNode node)
+    {
+        startMapping(node);
+        writeToken(node.getOperator().getOperatorText());
+        endMapping(node);
+        getWalker().walk(node.getOperandNode());
+    }
+
+    protected void emitVoidOperator(IUnaryOperatorNode node)
+    {
+        startMapping(node);
+        writeToken(node.getOperator().getOperatorText());
+        endMapping(node);
+        getWalker().walk(node.getOperandNode());
+    }
+
+    protected void emitTypeOfOperator(IUnaryOperatorNode node)
+    {
+        startMapping(node);
+        write(node.getOperator().getOperatorText());
+        write(ASEmitterTokens.PAREN_OPEN);
+        endMapping(node);
+        IExpressionNode operandNode = node.getOperandNode();
+        getWalker().walk(operandNode);
+        startMapping(node);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        endMapping(node);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/VarDeclarationEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/VarDeclarationEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/VarDeclarationEmitter.java
new file mode 100644
index 0000000..f43b288
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/VarDeclarationEmitter.java
@@ -0,0 +1,123 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.tree.as.ChainedVariableNode;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IEmbedNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+
+public class VarDeclarationEmitter extends JSSubEmitter implements
+        ISubEmitter<IVariableNode>
+{
+
+    public VarDeclarationEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IVariableNode node)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+
+        getModel().getVars().add(node);
+        
+        if (!(node instanceof ChainedVariableNode) && !node.isConst())
+        {
+            fjs.emitMemberKeyword(node);
+        }
+
+        IExpressionNode variableTypeNode = node.getVariableTypeNode();
+        if(variableTypeNode.getLine() >= 0)
+        {
+            startMapping(variableTypeNode,
+                    variableTypeNode.getLine(),
+                    variableTypeNode.getColumn() - 1); //include the :
+        }
+        else
+        {
+            //the result of getVariableTypeNode() may not have a line and
+            //column. this can happen when the type is omitted in the code, and
+            //the compiler generates a node for type *.
+            //in this case, put it at the end of the name expression.
+            IExpressionNode nameExpressionNode = node.getNameExpressionNode();
+            startMapping(variableTypeNode, nameExpressionNode.getLine(),
+                    nameExpressionNode.getColumn() + nameExpressionNode.getAbsoluteEnd() - nameExpressionNode.getAbsoluteStart());
+        }
+        IExpressionNode avnode = node.getAssignedValueNode();
+        if (avnode != null)
+        {
+            IDefinition def = avnode.resolveType(getWalker().getProject());
+
+            String opcode = avnode.getNodeID().getParaphrase();
+            if (opcode != "AnonymousFunction")
+            {
+                fjs.getDocEmitter().emitVarDoc(node, def, getWalker().getProject());
+            }
+        }
+        else
+        {
+            fjs.getDocEmitter().emitVarDoc(node, null, getWalker().getProject());
+        }
+        endMapping(variableTypeNode);
+
+        if (!(node instanceof ChainedVariableNode) && node.isConst())
+        {
+            fjs.emitMemberKeyword(node);
+        }
+
+        fjs.emitDeclarationName(node);
+        if (avnode != null && !(avnode instanceof IEmbedNode))
+        {
+            startMapping(node, node.getVariableTypeNode());
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            endMapping(node);
+            fjs.emitAssignedValue(avnode);
+        }
+
+        if (!(node instanceof ChainedVariableNode))
+        {
+            // check for chained variables
+            int len = node.getChildCount();
+            for (int i = 0; i < len; i++)
+            {
+                IASNode child = node.getChild(i);
+                if (child instanceof ChainedVariableNode)
+                {
+                    startMapping(node, node.getChild(i - 1));
+                    writeToken(ASEmitterTokens.COMMA);
+                    endMapping(node);
+                    fjs.emitVarDeclaration((IVariableNode) child);
+                }
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/WhileLoopEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/WhileLoopEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/WhileLoopEmitter.java
new file mode 100644
index 0000000..54f663d
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/WhileLoopEmitter.java
@@ -0,0 +1,61 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IWhileLoopNode;
+
+public class WhileLoopEmitter extends JSSubEmitter implements
+        ISubEmitter<IWhileLoopNode>
+{
+    public WhileLoopEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IWhileLoopNode node)
+    {
+        IContainerNode cnode = (IContainerNode) node.getChild(1);
+
+        startMapping(node);
+        writeToken(ASEmitterTokens.WHILE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        endMapping(node);
+
+        IASNode conditionalExpression = node.getConditionalExpressionNode();
+        getWalker().walk(conditionalExpression);
+
+        IASNode statementContentsNode = node.getStatementContentsNode();
+        startMapping(node, conditionalExpression);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        if (!EmitterUtils.isImplicit(cnode))
+            write(ASEmitterTokens.SPACE);
+        endMapping(node);
+
+        getWalker().walk(statementContentsNode);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/node/NodePublisher.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/node/NodePublisher.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/node/NodePublisher.java
new file mode 100644
index 0000000..88b379a
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/node/NodePublisher.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.internal.codegen.js.node;
+
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.internal.codegen.js.jsc.JSCPublisher;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+public class NodePublisher extends JSCPublisher
+{
+    public NodePublisher(Configuration config, FlexJSProject project)
+    {
+        super(config, project);
+    }
+
+    @Override
+    protected void writeHTML(String type, String projectName, String dirPath,
+                             String deps, List<String> additionalHTML) throws IOException
+    {
+        StringBuilder contents = new StringBuilder();
+        if ("intermediate".equals(type))
+        {
+            contents.append("require(\"./library/closure/goog/bootstrap/nodejs\");\n");
+            contents.append(deps);
+            contents.append("goog.require(\"");
+            contents.append(projectName);
+            contents.append("\");\n");
+            contents.append("new " + projectName + "();");
+        }
+        else 
+        {
+            contents.append("new ");
+            contents.append("require(\"./");
+            contents.append(projectName);
+            contents.append("\")");
+            contents.append(".");
+            contents.append(projectName);
+            contents.append("();");
+        }
+        writeFile(dirPath + File.separator + "index.js", contents.toString(), false);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/utils/DocEmitterUtils.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/utils/DocEmitterUtils.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/utils/DocEmitterUtils.java
new file mode 100644
index 0000000..7d7bf16
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/utils/DocEmitterUtils.java
@@ -0,0 +1,49 @@
+/*
+ *
+ *  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.internal.codegen.js.utils;
+
+import java.util.ArrayList;
+
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
+
+public class DocEmitterUtils
+{
+    public static void loadImportIgnores(JSFlexJSEmitter emitter, String doc)
+    {
+        ArrayList<String> ignoreList = new ArrayList<String>();
+        String ignoreToken = JSFlexJSEmitterTokens.IGNORE_IMPORT.getToken();
+        int index = doc.indexOf(ignoreToken);
+        while (index != -1)
+        {
+            String ignorable = doc.substring(index + ignoreToken.length());
+            int endIndex = ignorable.indexOf("\n");
+            ignorable = ignorable.substring(0, endIndex);
+            ignorable = ignorable.trim();
+            ignoreList.add(ignorable);
+            System.out.println("Found ignorable: " + ignorable);
+            index = doc.indexOf(ignoreToken, index + endIndex);
+        }
+        
+        // TODO (mschmalle)
+        ((JSFlexJSDocEmitter)emitter.getDocEmitter()).setClassIgnoreList(ignoreList);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/utils/EmitterUtils.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/utils/EmitterUtils.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/utils/EmitterUtils.java
new file mode 100644
index 0000000..ebe21ee
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/utils/EmitterUtils.java
@@ -0,0 +1,513 @@
+/*
+ *
+ *  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.internal.codegen.js.utils;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.flex.compiler.constants.IASLanguageConstants;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition.FunctionClassification;
+import org.apache.flex.compiler.definitions.INamespaceDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.definitions.IVariableDefinition;
+import org.apache.flex.compiler.internal.codegen.js.JSSessionModel;
+import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
+import org.apache.flex.compiler.internal.definitions.ClassDefinition;
+import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
+import org.apache.flex.compiler.internal.definitions.ParameterDefinition;
+import org.apache.flex.compiler.internal.definitions.VariableDefinition;
+import org.apache.flex.compiler.internal.projects.CompilerProject;
+import org.apache.flex.compiler.internal.scopes.TypeScope;
+import org.apache.flex.compiler.internal.tree.as.ContainerNode;
+import org.apache.flex.compiler.internal.tree.as.NodeBase;
+import org.apache.flex.compiler.internal.tree.as.ParameterNode;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IPackageNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.IScopedNode;
+import org.apache.flex.compiler.tree.as.ITypeNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.utils.NativeUtils;
+
+/**
+ * Various static methods used in shared emitter logic.
+ */
+public class EmitterUtils
+{
+    public static ITypeNode findTypeNode(IPackageNode node)
+    {
+        IScopedNode scope = node.getScopedNode();
+        for (int i = 0; i < scope.getChildCount(); i++)
+        {
+            IASNode child = scope.getChild(i);
+            if (child instanceof ITypeNode)
+                return (ITypeNode) child;
+        }
+        return null;
+    }
+
+    public static ITypeDefinition findType(Collection<IDefinition> definitions)
+    {
+        for (IDefinition definition : definitions)
+        {
+            if (definition instanceof ITypeDefinition)
+                return (ITypeDefinition) definition;
+        }
+        return null;
+    }
+
+    public static IFunctionDefinition findFunction(Collection<IDefinition> definitions)
+    {
+        for (IDefinition definition : definitions)
+        {
+            if (definition instanceof IFunctionDefinition)
+                return (IFunctionDefinition) definition;
+        }
+        return null;
+    }
+
+    public static IFunctionNode findFunctionNode(IPackageNode node)
+    {
+        IScopedNode scope = node.getScopedNode();
+        for (int i = 0; i < scope.getChildCount(); i++)
+        {
+            IASNode child = scope.getChild(i);
+            if (child instanceof IFunctionNode)
+                return (IFunctionNode) child;
+        }
+        return null;
+    }
+
+    public static IVariableNode findVariableNode(IPackageNode node)
+    {
+        IScopedNode scope = node.getScopedNode();
+        for (int i = 0; i < scope.getChildCount(); i++)
+        {
+            IASNode child = scope.getChild(i);
+            if (child instanceof IVariableNode)
+                return (IVariableNode) child;
+        }
+        return null;
+    }
+
+    public static IVariableDefinition findVariable(Collection<IDefinition> definitions)
+    {
+        for (IDefinition definition : definitions)
+        {
+            if (definition instanceof IVariableDefinition)
+                return (IVariableDefinition) definition;
+        }
+        return null;
+    }
+
+    public static ITypeDefinition getTypeDefinition(IDefinitionNode node)
+    {
+        ITypeNode tnode = (ITypeNode) node.getAncestorOfType(ITypeNode.class);
+        if (tnode != null)
+        {
+            return (ITypeDefinition) tnode.getDefinition();
+        }
+        return null;
+    }
+
+    public static boolean isSameClass(IDefinition pdef, IDefinition thisClass,
+            ICompilerProject project)
+    {
+        if (pdef == thisClass)
+            return true;
+
+        IDefinition cdef = ((ClassDefinition) thisClass)
+                .resolveBaseClass(project);
+        while (cdef != null)
+        {
+            // needs to be a loop
+            if (cdef == pdef)
+                return true;
+            cdef = ((ClassDefinition) cdef).resolveBaseClass(project);
+        }
+        return false;
+    }
+
+    public static boolean hasSuperClass(ICompilerProject project,
+            IDefinitionNode node)
+    {
+        IClassDefinition superClassDefinition = getSuperClassDefinition(node,
+                project);
+        // XXX (mschmalle) this is nulling for MXML super class, figure out why
+        if (superClassDefinition == null)
+            return false;
+        String qname = superClassDefinition.getQualifiedName();
+        return superClassDefinition != null
+                && !qname.equals(IASLanguageConstants.Object);
+    }
+
+    public static boolean hasSuperCall(IScopedNode node)
+    {
+        for (int i = node.getChildCount() - 1; i > -1; i--)
+        {
+            IASNode cnode = node.getChild(i);
+            if (cnode.getNodeID() == ASTNodeID.FunctionCallID
+                    && cnode.getChild(0).getNodeID() == ASTNodeID.SuperID)
+                return true;
+        }
+
+        return false;
+    }
+
+    public static boolean hasBody(IFunctionNode node)
+    {
+        IScopedNode scope = node.getScopedNode();
+        return scope.getChildCount() > 0;
+    }
+
+    public static IClassDefinition getSuperClassDefinition(
+            IDefinitionNode node, ICompilerProject project)
+    {
+        IDefinition parent = node.getDefinition().getParent();
+        if (parent instanceof IClassDefinition)
+        {
+            IClassDefinition parentClassDef = (IClassDefinition) parent;
+            IClassDefinition superClass = parentClassDef.resolveBaseClass(project);
+            return superClass;
+        }
+        return null;
+    }
+
+    public static List<String> resolveImports(ITypeDefinition type)
+    {
+        ArrayList<String> list = new ArrayList<String>();
+        IScopedNode scopeNode = type.getContainedScope().getScopeNode();
+        if (scopeNode != null)
+        {
+            scopeNode.getAllImports(list);
+        }
+        else
+        {
+            // MXML
+            ClassDefinition cdefinition = (ClassDefinition) type;
+            String[] implicitImports = cdefinition.getImplicitImports();
+            for (String imp : implicitImports)
+            {
+                list.add(imp);
+            }
+        }
+        return list;
+    }
+
+    public static IClassDefinition getClassDefinition(IDefinitionNode node)
+    {
+        IClassNode tnode = (IClassNode) node
+                .getAncestorOfType(IClassNode.class);
+        return (tnode != null) ? tnode.getDefinition() : null;
+    }
+
+    public static IParameterNode getRest(IParameterNode[] nodes)
+    {
+        for (IParameterNode node : nodes)
+        {
+            if (node.isRest())
+                return node;
+        }
+
+        return null;
+    }
+
+    public static Map<Integer, IParameterNode> getDefaults(
+            IParameterNode[] nodes)
+    {
+        Map<Integer, IParameterNode> result = new HashMap<Integer, IParameterNode>();
+        int i = 0;
+        boolean hasDefaults = false;
+        for (IParameterNode node : nodes)
+        {
+            if (node.hasDefaultValue())
+            {
+                hasDefaults = true;
+                result.put(i, node);
+            }
+            else
+            {
+                result.put(i, null);
+            }
+            i++;
+        }
+
+        if (!hasDefaults)
+            return null;
+
+        return result;
+    }
+
+    public static boolean writeThis(ICompilerProject project,
+            JSSessionModel model, IIdentifierNode node)
+    {
+        IClassNode classNode = (IClassNode) node
+                .getAncestorOfType(IClassNode.class);
+
+        IDefinition nodeDef = node.resolve(project);
+
+        IASNode parentNode = node.getParent();
+        ASTNodeID parentNodeId = parentNode.getNodeID();
+
+        IASNode firstChild = parentNode.getChild(0);
+
+        final IClassDefinition thisClass = model.getCurrentClass();
+
+        boolean identifierIsMemberAccess = parentNodeId == ASTNodeID.MemberAccessExpressionID;
+
+        if (nodeDef instanceof ParameterDefinition)
+            return false;
+        
+        if (classNode == null) // script in MXML and AS interface definitions
+        {
+            if (nodeDef instanceof VariableDefinition)
+            {
+                IDefinition pdef = ((VariableDefinition) nodeDef).getParent();
+
+                if (thisClass == null || !isSameClass(pdef, thisClass, project))
+                    return false;
+
+                if (identifierIsMemberAccess)
+                    return node == firstChild;
+
+                return parentNodeId == ASTNodeID.ContainerID
+                        || !(parentNode instanceof ParameterNode);
+            }
+            else if (nodeDef instanceof AccessorDefinition)
+            {
+                IDefinition pdef = ((AccessorDefinition) nodeDef).getParent();
+
+                if (thisClass == null || !isSameClass(pdef, thisClass, project))
+                    return false;
+
+                if (identifierIsMemberAccess)
+                    return node == firstChild;
+
+                return true;
+            }
+            else if (parentNodeId == ASTNodeID.ContainerID
+                    && nodeDef instanceof FunctionDefinition)
+            {
+                return ((FunctionDefinition) nodeDef)
+                        .getFunctionClassification() == FunctionClassification.CLASS_MEMBER; // for 'goog.bind'
+            }
+            else
+            {
+                boolean isFileOrPackageMember = false;
+                if(nodeDef instanceof FunctionDefinition)
+                {
+                    FunctionClassification classification = ((FunctionDefinition) nodeDef).getFunctionClassification();
+                    if(classification == FunctionClassification.FILE_MEMBER ||
+                            classification == FunctionClassification.PACKAGE_MEMBER)
+                    {
+                        isFileOrPackageMember = true;
+                    }
+                }
+                return parentNodeId == ASTNodeID.FunctionCallID
+                        && !(nodeDef instanceof AccessorDefinition)
+                        && !identifierIsMemberAccess
+                        && !isFileOrPackageMember;
+            }
+        }
+        else
+        {
+            if (nodeDef != null && !nodeDef.isInternal()
+                    && isClassMember(project, nodeDef, classNode))
+            {
+                if (identifierIsMemberAccess)
+                {
+                    return node == firstChild;
+                }
+                else
+                {
+                    boolean identifierIsLocalFunction = nodeDef instanceof FunctionDefinition
+                            && !(nodeDef instanceof AccessorDefinition)
+                            && ((FunctionDefinition) nodeDef)
+                                    .getFunctionClassification() == IFunctionDefinition.FunctionClassification.LOCAL;
+
+                    return !identifierIsLocalFunction;
+                }
+            }
+        }
+
+        return false;
+    }
+
+    public static boolean isClassMember(ICompilerProject project,
+            IDefinition nodeDef, IClassNode classNode)
+    {
+        TypeScope cscope = (TypeScope) classNode.getDefinition()
+                .getContainedScope();
+
+        Set<INamespaceDefinition> nsSet = cscope.getNamespaceSet(project);
+        Collection<IDefinition> defs = new HashSet<IDefinition>();
+
+        cscope.getAllPropertiesForMemberAccess((CompilerProject) project, defs,
+                nsSet);
+
+        Iterator<IDefinition> visiblePropertiesIterator = defs.iterator();
+        while (visiblePropertiesIterator.hasNext())
+        {
+            if (nodeDef.getQualifiedName().equals(
+                    visiblePropertiesIterator.next().getQualifiedName()))
+                return true;
+        }
+
+        return false;
+    }
+    
+    public static boolean isScalar(IExpressionNode node)
+    {
+    	ASTNodeID id = node.getNodeID();
+        if (id == ASTNodeID.LiteralBooleanID ||
+        		id == ASTNodeID.LiteralIntegerID ||
+        		id == ASTNodeID.LiteralIntegerZeroID ||
+        		id == ASTNodeID.LiteralDoubleID ||
+        		id == ASTNodeID.LiteralNullID ||
+        		id == ASTNodeID.LiteralNumberID ||
+        		id == ASTNodeID.LiteralRegexID ||
+        		id == ASTNodeID.LiteralStringID ||
+        		id == ASTNodeID.LiteralUintID)
+        	return true;
+        if (id == ASTNodeID.IdentifierID)
+        {
+        	IIdentifierNode idnode = (IIdentifierNode)node;
+        	String idname = idnode.getName();
+        	if (idname.equals(NativeUtils.NativeASType.Infinity.name()) ||
+        		idname.equals(NativeUtils.NativeASType.undefined.name()) ||
+        		idname.equals(NativeUtils.NativeASType.NaN.name()))
+        		return true;
+        }
+        // special case -Infinity
+        if (id == ASTNodeID.Op_SubtractID &&
+        		node.getChildCount() == 1)
+        {
+        	IASNode child = node.getChild(0);
+        	if (child.getNodeID() == ASTNodeID.IdentifierID)
+        	{
+            	IIdentifierNode idnode = (IIdentifierNode)child;
+            	String idname = idnode.getName();
+            	if (idname.equals(NativeUtils.NativeASType.Infinity.name()))
+            		return true;        		
+        	}
+        }
+        return false;
+    }
+
+    public static IContainerNode insertArgumentsBefore(IContainerNode argumentsNode, IASNode... nodes)
+    {
+        int originalLength = argumentsNode.getChildCount();
+        int extraLength = nodes.length;
+        ContainerNode result = new ContainerNode(originalLength + extraLength);
+        result.setSourcePath(argumentsNode.getSourcePath());
+        result.span(argumentsNode);
+        result.setParent((NodeBase) argumentsNode.getParent());
+        for (int i = 0; i < extraLength; i++)
+        {
+            NodeBase node = (NodeBase) nodes[i];
+            node.setSourcePath(argumentsNode.getSourcePath());
+            result.addItem(node);
+        }
+        for (int i = 0; i < originalLength; i++)
+        {
+            result.addItem((NodeBase) argumentsNode.getChild(i));
+        }
+        return result;
+    }
+
+    public static IContainerNode insertArgumentsAfter(IContainerNode argumentsNode, IASNode... nodes)
+    {
+        int originalLength = argumentsNode.getChildCount();
+        int extraLength = nodes.length;
+        ContainerNode result = new ContainerNode(originalLength + extraLength);
+        result.setSourcePath(argumentsNode.getSourcePath());
+        result.span(argumentsNode);
+        result.setParent((NodeBase) argumentsNode.getParent());
+        for (int i = 0; i < originalLength; i++)
+        {
+            result.addItem((NodeBase) argumentsNode.getChild(i));
+        }
+        for (int i = 0; i < extraLength; i++)
+        {
+            NodeBase node = (NodeBase) nodes[i];
+            node.setSourcePath(argumentsNode.getSourcePath());
+            result.addItem(node);
+        }
+        return result;
+    }
+
+    public static IContainerNode insertArgumentsAt(IContainerNode argumentsNode, int index, IASNode... nodes)
+    {
+        int originalLength = argumentsNode.getChildCount();
+        int extraLength = nodes.length;
+        ContainerNode result = new ContainerNode(originalLength + extraLength);
+        result.setSourcePath(argumentsNode.getSourcePath());
+        result.span(argumentsNode);
+        result.setParent((NodeBase) argumentsNode.getParent());
+        for (int i = 0; i < originalLength; i++)
+        {
+            if(i < originalLength)
+            {
+                result.addItem((NodeBase) argumentsNode.getChild(i));
+            }
+            else
+            {
+                int j = i;
+                if (i >= index + extraLength)
+                {
+                    j -= extraLength;
+                    result.addItem((NodeBase) argumentsNode.getChild(j));
+                }
+                else
+                {
+                    j -= originalLength;
+                    NodeBase node = (NodeBase) nodes[j];
+                    node.setSourcePath(argumentsNode.getSourcePath());
+                    result.addItem(node);
+                }
+            }
+        }
+        return result;
+    }
+
+    public static boolean isImplicit(IContainerNode node)
+    {
+        return node.getContainerType() == IContainerNode.ContainerType.IMPLICIT
+                || node.getContainerType() == IContainerNode.ContainerType.SYNTHESIZED;
+    }
+
+}


[36/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLBlockWalker.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLBlockWalker.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLBlockWalker.java
new file mode 100644
index 0000000..83ec265
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLBlockWalker.java
@@ -0,0 +1,436 @@
+/*
+ *
+ *  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.internal.codegen.mxml;
+
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLArrayNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLBindingNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLBooleanNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLClassDefinitionNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLComponentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDataBindingNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDeclarationsNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDeferredInstanceNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLEmbedNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLEventSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFactoryNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLImplementsNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLInstanceNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLIntNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLLiteralNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLMetadataNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLNumberNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLObjectNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLScriptNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStringNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStyleNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStyleSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLUintNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLVectorNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockVisitor;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class MXMLBlockWalker implements IMXMLBlockVisitor, IMXMLBlockWalker
+{
+
+    //----------------------------------
+    // emitter
+    //----------------------------------
+
+    private IASEmitter asEmitter;
+
+    @Override
+    public IASEmitter getASEmitter()
+    {
+        return asEmitter;
+    }
+
+    private IMXMLEmitter mxmlEmitter;
+
+    @Override
+    public IMXMLEmitter getMXMLEmitter()
+    {
+        return mxmlEmitter;
+    }
+
+    //----------------------------------
+    // errors
+    //----------------------------------
+
+    protected List<ICompilerProblem> errors;
+
+    List<ICompilerProblem> getErrors()
+    {
+        return errors;
+    }
+
+    //----------------------------------
+    // project
+    //----------------------------------
+
+    protected IASProject project;
+
+    public IASProject getProject()
+    {
+        return project;
+    }
+
+    //----------------------------------
+    // strategy
+    //----------------------------------
+
+    private IASNodeStrategy mxmlStrategy;
+
+    public IASNodeStrategy getMXMLStrategy()
+    {
+        return mxmlStrategy;
+    }
+
+    public void setMXMLStrategy(IASNodeStrategy value)
+    {
+        mxmlStrategy = value;
+    }
+
+    private IASNodeStrategy asStrategy;
+
+    public IASNodeStrategy getASStrategy()
+    {
+        return asStrategy;
+    }
+
+    public void setASStrategy(IASNodeStrategy value)
+    {
+        asStrategy = value;
+    }
+
+    //----------------------------------
+    // walk
+    //----------------------------------
+
+    @Override
+    public void walk(IASNode node)
+    {
+        if (node instanceof IMXMLNode)
+            mxmlStrategy.handle(node);
+        else
+            asStrategy.handle(node);
+    }
+
+    @Override
+    public void visitCompilationUnit(ICompilationUnit unit)
+    {
+        debug("visitMXMLCompilationUnit()");
+        IFileNode node = null;
+        try
+        {
+            node = (IFileNode) unit.getSyntaxTreeRequest().get().getAST();
+        }
+        catch (InterruptedException e)
+        {
+            throw new RuntimeException(e);
+        }
+
+        walk(node);
+    }
+
+    public MXMLBlockWalker(List<ICompilerProblem> errors, IASProject project,
+            IMXMLEmitter mxmlEmitter, IASEmitter asEmitter,
+            IBlockWalker asBlockWalker)
+    {
+        this.asEmitter = asEmitter;
+        this.mxmlEmitter = mxmlEmitter;
+        this.project = project;
+        this.errors = errors;
+
+        asEmitter.setWalker(asBlockWalker);
+
+        mxmlEmitter.setMXMLWalker((IBlockWalker) this);
+    }
+
+    @Override
+    public void visitFile(IMXMLFileNode node)
+    {
+        debug("visitFile()");
+
+        walk(node.getDocumentNode());
+    }
+
+    @Override
+    public void visitDeclarations(IMXMLDeclarationsNode node)
+    {
+        debug("visitDeclarations()");
+
+        mxmlEmitter.emitDeclarations(node);
+    }
+
+    @Override
+    public void visitDocument(IMXMLDocumentNode node)
+    {
+        debug("visitDocument()");
+
+        IMXMLFileNode fnode = (IMXMLFileNode) node.getParent();
+        
+        mxmlEmitter.emitDocumentHeader(fnode);
+        visitClassDefinition(node);
+        mxmlEmitter.emitDocumentFooter(fnode);
+    }
+
+    @Override
+    public void visitClassDefinition(IMXMLClassDefinitionNode node)
+    {
+        debug("visitClassDefinition()");
+
+        mxmlEmitter.emitClass(node);
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void visitDeferredInstance(IMXMLDeferredInstanceNode node)
+    {
+        debug("visitdeferredInstance()");
+
+        walk(node.getChild(0));
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void visitEventSpecifier(IMXMLEventSpecifierNode node)
+    {
+        debug("visitEventSpecifier()");
+
+        mxmlEmitter.emitEventSpecifier(node);
+    }
+
+    @Override
+    public void visitInstance(IMXMLInstanceNode node)
+    {
+        debug("visitInstance()");
+
+        mxmlEmitter.emitInstance(node);
+    }
+
+    @Override
+    public void visitPropertySpecifier(IMXMLPropertySpecifierNode node)
+    {
+        debug("visitPropertySpecifier()");
+
+        mxmlEmitter.emitPropertySpecifier(node);
+    }
+
+    @Override
+    public void visitScript(IMXMLScriptNode node)
+    {
+        debug("visitScript()");
+
+        mxmlEmitter.emitScript(node);
+    }
+
+    @Override
+    public void visitStyleBlock(IMXMLStyleNode node)
+    {
+    	// don't do anything.  subclasses should.
+    }
+    
+    @Override
+    public void visitStyleSpecifier(IMXMLStyleSpecifierNode node)
+    {
+        debug("visitStyleSpecifier()");
+
+        mxmlEmitter.emitStyleSpecifier(node);
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void visitArray(IMXMLArrayNode node)
+    {
+        debug("visitArray()");
+
+        mxmlEmitter.emitArray(node);
+    }
+
+    @Override
+    public void visitBoolean(IMXMLBooleanNode node)
+    {
+        debug("visitBoolean()");
+
+        mxmlEmitter.emitBoolean(node);
+    }
+
+    @Override
+    public void visitInt(IMXMLIntNode node)
+    {
+        debug("visitInt()");
+
+        mxmlEmitter.emitInt(node);
+    }
+
+    @Override
+    public void visitNumber(IMXMLNumberNode node)
+    {
+        debug("visitNumber()");
+
+        mxmlEmitter.emitNumber(node);
+    }
+
+    @Override
+    public void visitString(IMXMLStringNode node)
+    {
+        debug("visitString()");
+
+        mxmlEmitter.emitString(node);
+    }
+
+    @Override
+    public void visitUint(IMXMLUintNode node)
+    {
+        debug("visitUint()");
+
+        mxmlEmitter.emitUint(node);
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void visitLiteral(IMXMLLiteralNode node)
+    {
+        debug("visitLiteral()");
+
+        mxmlEmitter.emitLiteral(node);
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void visitFactory(IMXMLFactoryNode node)
+    {
+        debug("visitFactory()");
+
+        mxmlEmitter.emitFactory(node);
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void visitComponent(IMXMLComponentNode node)
+    {
+        debug("visitComponent()");
+
+        mxmlEmitter.emitComponent(node);
+    }
+
+    //--------------------------------------------------------------------------
+    
+    @Override
+    public void visitMetadata(IMXMLMetadataNode node)
+    {
+        debug("visitMetadata()");
+        
+        mxmlEmitter.emitMetadata(node);
+    }
+    
+    //--------------------------------------------------------------------------
+    
+    @Override
+    public void visitEmbed(IMXMLEmbedNode node)
+    {
+        debug("visitEmbed()");
+        
+        mxmlEmitter.emitEmbed(node);
+    }
+    
+    //--------------------------------------------------------------------------
+    
+    @Override
+    public void visitImplements(IMXMLImplementsNode node)
+    {
+        debug("visitImplements()");
+        
+        mxmlEmitter.emitImplements(node);
+    }
+    
+    //--------------------------------------------------------------------------
+    
+    @Override
+    public void visitVector(IMXMLVectorNode node)
+    {
+        debug("visitVector()");
+        
+        mxmlEmitter.emitVector(node);
+    }
+    
+    //--------------------------------------------------------------------------
+    
+    @Override
+    public void visitDatabinding(IMXMLDataBindingNode node)
+    {
+        debug("visitDatabinding()");
+        
+        mxmlEmitter.emitDatabinding(node);
+    }
+    
+    //--------------------------------------------------------------------------
+    
+    @Override
+    public void visitBinding(IMXMLBindingNode node)
+    {
+        debug("visitBinding()");
+        
+        System.out.println("skipping fx:Binding in " + node.getSourcePath() + ". This node should be encoded in the binding data.");
+    }
+    
+    //--------------------------------------------------------------------------
+    
+    @Override
+    public void visitObject(IMXMLObjectNode node)
+    {
+        debug("visitObject()");
+        
+        mxmlEmitter.emitObject(node);
+    }
+    
+    //--------------------------------------------------------------------------
+
+    protected void debug(String message)
+    {
+        //System.out.println(message);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLEmitter.java
new file mode 100644
index 0000000..bba7f23
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLEmitter.java
@@ -0,0 +1,425 @@
+/*
+ *
+ *  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.internal.codegen.mxml;
+
+import java.io.FilterWriter;
+
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.internal.codegen.Emitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLArrayNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLBooleanNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLClassDefinitionNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLClassNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLComponentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDataBindingNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDeclarationsNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLEmbedNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLEventSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFactoryNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLImplementsNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLInstanceNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLIntNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLLiteralNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLMetadataNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLNumberNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLObjectNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLScriptNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStringNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStyleSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLUintNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLVectorNode;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * The base implementation for an MXML emitter.
+ * 
+ * @author Erik de Bruin
+ */
+public class MXMLEmitter extends Emitter implements IMXMLEmitter
+{
+
+    @Override
+    public String postProcess(String output)
+    {
+        return output;
+    }
+
+    //--------------------------------------------------------------------------
+    //    walkers
+    //--------------------------------------------------------------------------
+
+    protected IMXMLBlockWalker walker;
+
+    @Override
+    public IBlockWalker getMXMLWalker()
+    {
+        return (IBlockWalker) walker;
+    }
+
+    @Override
+    public void setMXMLWalker(IBlockWalker value)
+    {
+        walker = (IMXMLBlockWalker) value;
+    }
+
+    public MXMLEmitter(FilterWriter out)
+    {
+        super(out);
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitDeclarations(IMXMLDeclarationsNode node)
+    {
+        // visit tags
+        final int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            getMXMLWalker().walk(node.getChild(i));
+        }    
+    }
+    
+    @Override
+    public void emitDocumentHeader(IMXMLFileNode node)
+    {
+        IMXMLDocumentNode dnode = node.getDocumentNode();
+        
+        IClassDefinition cdef = dnode
+                .getClassReference((ICompilerProject) walker.getProject());
+
+        write("<" + cdef.getBaseName());
+
+        emitPropertySpecifiers(dnode.getPropertySpecifierNodes(), true);
+
+        writeNewline(">", true);
+    }
+
+    @Override
+    public void emitDocumentFooter(IMXMLFileNode node)
+    {
+        IMXMLDocumentNode dnode = node.getDocumentNode();
+        
+        IClassDefinition cdef = dnode
+                .getClassReference((ICompilerProject) walker.getProject());
+
+        writeNewline("", false);
+        write("</" + cdef.getBaseName() + ">");
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitClass(IMXMLClassDefinitionNode node)
+    {
+
+        // fx:declarations
+        IMXMLDeclarationsNode[] dnodes = node.getDeclarationsNodes();
+        if (dnodes != null)
+        {
+            for (IMXMLDeclarationsNode dnode : dnodes)
+            {
+                getMXMLWalker().walk(dnode);
+            }
+        }
+
+        // fx:script
+        IMXMLScriptNode[] snodes = node.getScriptNodes();
+        if (snodes != null)
+        {
+            for (IMXMLScriptNode snode : snodes)
+            {
+                getMXMLWalker().walk(snode);
+            }
+        }
+
+        // "regular" tags
+        emitPropertySpecifiers(node.getPropertySpecifierNodes(), false);
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitEventSpecifier(IMXMLEventSpecifierNode node)
+    {
+    }
+
+    @Override
+    public void emitInstance(IMXMLInstanceNode node)
+    {
+        IClassDefinition cdef = node
+                .getClassReference((ICompilerProject) getMXMLWalker()
+                        .getProject());
+
+        String cname = cdef.getBaseName();
+
+        write("<");
+        write(cname);
+        if (node.getID() != null && node.getID() != "")
+        {
+            write(ASEmitterTokens.SPACE);
+            write("id");
+            write(ASEmitterTokens.EQUAL);
+            write("\"");
+            write(node.getID());
+            write("\"");
+        }
+
+        IMXMLPropertySpecifierNode[] pnodes = node.getPropertySpecifierNodes();
+
+        // attributes
+        emitPropertySpecifiers(pnodes, true);
+
+        write(">");
+
+        // child nodes
+        emitPropertySpecifiers(pnodes, false);
+
+        write("<");
+        write("/");
+        write(cname);
+        write(">");
+    }
+
+    @Override
+    public void emitPropertySpecifier(IMXMLPropertySpecifierNode node)
+    {
+        if (!isMXMLContentNode(node)) // only for attributes
+        {
+            write(node.getName());
+            write(ASEmitterTokens.EQUAL);
+        }
+
+        getMXMLWalker().walk(node.getInstanceNode());
+    }
+
+    @Override
+    public void emitStyleSpecifier(IMXMLStyleSpecifierNode node)
+    {
+        if (!isMXMLContentNode(node)) // only for attributes
+        {
+            write(node.getName());
+            write(ASEmitterTokens.EQUAL);
+        }
+
+        getMXMLWalker().walk(node.getInstanceNode());
+    }
+
+    @Override
+    public void emitScript(IMXMLScriptNode node)
+    {
+        write("<script><![CDATA[");
+
+        int len = node.getChildCount();
+        if (len > 0)
+        {
+            writeNewline("", true);
+
+            for (int i = 0; i < len; i++)
+            {
+                getMXMLWalker().walk(node.getChild(i));
+
+                if (i == len - 1)
+                    indentPop();
+
+                writeNewline(ASEmitterTokens.SEMICOLON);
+            }
+        }
+
+        write("]]></script>");
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitObject(IMXMLObjectNode node)
+    {
+        final int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            IASNode child = node.getChild(i);
+
+            getMXMLWalker().walk(child);
+
+            if (child instanceof IMXMLInstanceNode && i < len - 1)
+                writeNewline();
+        }
+    }
+
+    @Override
+    public void emitArray(IMXMLArrayNode node)
+    {
+        final int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            IASNode child = node.getChild(i);
+
+            getMXMLWalker().walk(child);
+
+            if (child instanceof IMXMLInstanceNode && i < len - 1)
+                writeNewline();
+        }
+    }
+
+    @Override
+    public void emitBoolean(IMXMLBooleanNode node)
+    {
+        emitAttributeValue(node);
+    }
+
+    @Override
+    public void emitInt(IMXMLIntNode node)
+    {
+        emitAttributeValue(node);
+    }
+
+    @Override
+    public void emitNumber(IMXMLNumberNode node)
+    {
+        emitAttributeValue(node);
+    }
+
+    @Override
+    public void emitString(IMXMLStringNode node)
+    {
+        emitAttributeValue(node);
+    }
+
+    @Override
+    public void emitUint(IMXMLUintNode node)
+    {
+        emitAttributeValue(node);
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitLiteral(IMXMLLiteralNode node)
+    {
+        write(node.getValue().toString());
+    }
+
+    //--------------------------------------------------------------------------
+    //  Utils
+    //--------------------------------------------------------------------------
+
+    public void emitPropertySpecifiers(IMXMLPropertySpecifierNode[] nodes,
+            boolean emitAttributes)
+    {
+        if (nodes != null)
+        {
+            for (IMXMLPropertySpecifierNode cnode : nodes)
+            {
+                if (!isMXMLContentNode(cnode) && emitAttributes)
+                {
+                    write(ASEmitterTokens.SPACE);
+                    getMXMLWalker().walk(cnode);
+                }
+                else if (isMXMLContentNode(cnode) && !emitAttributes)
+                {
+                    getMXMLWalker().walk(cnode);
+                }
+            }
+        }
+    }
+
+    protected void emitAttributeValue(IASNode node)
+    {
+        IMXMLLiteralNode cnode = (IMXMLLiteralNode) node.getChild(0);
+
+        if (cnode.getValue() != null)
+        {
+            write("\"");
+
+            getMXMLWalker().walk((IASNode) cnode); // Literal
+
+            write("\"");
+        }
+    }
+
+    protected boolean isMXMLContentNode(IMXMLNode node)
+    {
+        return node.getName().equals("mxmlContentFactory")
+                || node.getName().equals("mxmlContent");
+    }
+
+    public void emitFactory(IMXMLFactoryNode node)
+    {
+        IASNode cnode = node.getChild(0);
+
+        write("\"");
+
+        if (cnode instanceof IMXMLClassNode)
+        {
+            write(((IMXMLClassNode)cnode).getValue(getMXMLWalker().getProject()).getQualifiedName());
+        }
+
+        write("\"");
+    }
+
+    public void emitComponent(IMXMLComponentNode node)
+    {
+        IASNode cnode = node.getChild(0);
+
+        write("<fx:Component>");
+
+        if (cnode instanceof IMXMLClassNode)
+        {
+            getMXMLWalker().walk((IASNode) cnode); // Literal
+        }
+
+        write("</fx:Component>");
+    }
+
+    public void emitMetadata(IMXMLMetadataNode node)
+    {
+        // ToDo (erikdebruin): implement metadata output
+    }
+
+    public void emitEmbed(IMXMLEmbedNode node)
+    {
+        // ToDo (erikdebruin): implement embed output
+    }
+    
+    public void emitImplements(IMXMLImplementsNode node)
+    {
+        // ToDo (erikdebruin): implement implements output
+    }
+    
+    public void emitVector(IMXMLVectorNode node)
+    {
+        // ToDo (erikdebruin): implement vector output
+    }
+    
+    public void emitDatabinding(IMXMLDataBindingNode node)
+    {
+    	// ToDo (erikdebruin): implement databinding output
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLEmitterTokens.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLEmitterTokens.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLEmitterTokens.java
new file mode 100644
index 0000000..3d8a4e9
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLEmitterTokens.java
@@ -0,0 +1,42 @@
+/*
+ *
+ *  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.internal.codegen.mxml;
+
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+
+/**
+ * @author Erik de Bruin
+ */
+public enum MXMLEmitterTokens implements IEmitterTokens
+{
+    TAG_OPEN("<"), TAG_CLOSE(">");
+
+    private String token;
+
+    private MXMLEmitterTokens(String value)
+    {
+        token = value;
+    }
+
+    public String getToken()
+    {
+        return token;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLWriter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLWriter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLWriter.java
new file mode 100644
index 0000000..afb45fd
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/MXMLWriter.java
@@ -0,0 +1,84 @@
+/*
+ *
+ *  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.internal.codegen.mxml;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.driver.js.IJSBackend;
+import org.apache.flex.compiler.internal.codegen.js.JSFilterWriter;
+import org.apache.flex.compiler.internal.codegen.js.JSSharedData;
+import org.apache.flex.compiler.internal.codegen.js.JSWriter;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.as.IASBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+public class MXMLWriter extends JSWriter
+{
+    /**
+     * Create a JSApplication writer.
+     * 
+     * @param application the JSApplication model to be encoded
+     * @param useCompression use ZLIB compression if true
+     */
+    public MXMLWriter(IASProject project, List<ICompilerProblem> problems,
+            ICompilationUnit compilationUnit, boolean enableDebug)
+    {
+        super(project, problems, compilationUnit, enableDebug);
+    }
+
+    @Override
+    public void writeTo(OutputStream out, File sourceMapOut)
+    {
+        IJSBackend backend = (IJSBackend) JSSharedData.backend;
+        JSFilterWriter writer = (JSFilterWriter) backend.createWriterBuffer(project);
+
+        IJSEmitter asEmitter = (IJSEmitter) backend.createEmitter(writer);
+        IASBlockWalker asBlockWalker = backend.createWalker(
+                project, problems, asEmitter);
+
+        IMXMLEmitter mxmlEmitter = backend.createMXMLEmitter(writer);
+        IMXMLBlockWalker mxmlBlockWalker = backend.createMXMLWalker(
+                project, problems, mxmlEmitter, asEmitter, asBlockWalker);
+
+        mxmlBlockWalker.visitCompilationUnit(compilationUnit);
+
+        try
+        {
+            out.write(mxmlEmitter.postProcess(writer.toString()).getBytes());
+        }
+        catch (IOException e)
+        {
+            e.printStackTrace();
+        }
+
+        if (sourceMapOut != null)
+        {
+            throw new UnsupportedOperationException("Source maps not supported for MXML files");
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java
new file mode 100644
index 0000000..9eac5d5
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLDescriptorSpecifier.java
@@ -0,0 +1,317 @@
+/*
+ *
+ *  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.internal.codegen.mxml.flexjs;
+
+import java.util.ArrayList;
+
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+
+/**
+ * @author Erik de Bruin
+ */
+public class MXMLDescriptorSpecifier extends MXMLNodeSpecifier
+{
+
+    //--------------------------------------------------------------------------
+    //
+    //    Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    public MXMLDescriptorSpecifier()
+    {
+        super();
+        
+        eventSpecifiers = new ArrayList<MXMLEventSpecifier>();
+        propertySpecifiers = new ArrayList<MXMLDescriptorSpecifier>();
+
+        valueNeedsQuotes = false;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //    Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //---------------------------------
+    //    children
+    //---------------------------------
+
+    public MXMLDescriptorSpecifier childrenSpecifier;
+
+    //---------------------------------
+    //    properties
+    //---------------------------------
+
+    public ArrayList<MXMLDescriptorSpecifier> propertySpecifiers;
+
+    //---------------------------------
+    //    events
+    //---------------------------------
+
+    public ArrayList<MXMLEventSpecifier> eventSpecifiers;
+
+    //---------------------------------
+    //    hasArray
+    //---------------------------------
+
+    public boolean hasArray;
+
+    //---------------------------------
+    //    hasObject
+    //---------------------------------
+
+    public boolean hasObject;
+
+    //---------------------------------
+    //    id
+    //---------------------------------
+
+    public String id;
+
+    //---------------------------------
+    //    isTopNode
+    //---------------------------------
+
+    public boolean isTopNode;
+
+    //---------------------------------
+    //    isProperty
+    //---------------------------------
+    
+    public boolean isProperty;
+    
+    //---------------------------------
+    //    parent
+    //---------------------------------
+
+    public MXMLDescriptorSpecifier parent;
+
+    //--------------------------------------------------------------------------
+    //
+    //    Methods
+    //
+    //--------------------------------------------------------------------------
+
+    //---------------------------------
+    //    outputEventSpecifier
+    //---------------------------------
+
+    private void outputEventSpecifier(boolean writeNewline)
+    {
+        // number of events
+        int count = 0;
+        for (MXMLEventSpecifier me : eventSpecifiers)
+        {
+            if (me.name != null)
+                count++;
+        }
+        write(count + "");
+        
+        for (MXMLEventSpecifier me : eventSpecifiers)
+        {
+            writeDelimiter(writeNewline);
+            write(me.output(writeNewline));
+        }
+    }
+
+    //---------------------------------
+    //    outputPropertySpecifier
+    //---------------------------------
+
+    private String outputPropertySpecifier(boolean writeNewline)
+    {
+        write((isProperty) ? ASEmitterTokens.SINGLE_QUOTE.getToken() : "");
+        write(name);
+        write((isProperty) ? ASEmitterTokens.SINGLE_QUOTE.getToken() : "");
+        writeDelimiter(writeNewline);
+
+        if (isProperty)
+        {
+            if (value != null)
+            {
+                write(ASEmitterTokens.TRUE);
+                writeDelimiter(writeNewline);
+                write(value);
+            }
+            else
+            {
+                write((hasArray) ? ASEmitterTokens.NULL : ASEmitterTokens.FALSE);
+                writeDelimiter(writeNewline && !hasArray);
+
+                write(ASEmitterTokens.SQUARE_OPEN);
+                output(false);
+                write(ASEmitterTokens.SQUARE_CLOSE);
+            }
+
+            if (parent != null)
+                writeDelimiter(writeNewline);
+        }
+        else
+        {
+            for (MXMLDescriptorSpecifier md : propertySpecifiers)
+            {
+                if (md.name != null && md.name.equals("mxmlContent"))
+                {
+                    childrenSpecifier = md;
+                    propertySpecifiers.remove(md);
+                    break;
+                }
+            }
+
+            if (id != null)
+            {
+                write(propertySpecifiers.size() + 1 + "");
+                writeDelimiter(writeNewline);
+                boolean isEffectiveID = id.startsWith(MXMLFlexJSEmitterTokens.ID_PREFIX.getToken()) ||
+                						id.startsWith(MXMLFlexJSEmitterTokens.BINDING_PREFIX.getToken());
+                String idPropName = (isEffectiveID) ? "_id"
+                        : "id";
+                writeSimpleDescriptor(idPropName, ASEmitterTokens.TRUE.getToken(),
+                        ASEmitterTokens.SINGLE_QUOTE.getToken()
+                                + id + ASEmitterTokens.SINGLE_QUOTE.getToken(),
+                        writeNewline);
+    
+                writeDelimiter(writeNewline);
+            }
+            else
+            {
+                write(propertySpecifiers.size() + "");
+                writeDelimiter(writeNewline);
+            }
+            
+            output(writeNewline);
+        }
+
+        return sb.toString();
+    }
+
+    //---------------------------------
+    //    outputStyleSpecifier
+    //---------------------------------
+
+    private void outputStyleSpecifier(boolean writeNewline)
+    {
+        // TODO (erikdebruin) not yet implemented in FlexJS
+
+        write("0");
+        writeDelimiter(writeNewline);
+    }
+
+    //---------------------------------
+    //    output
+    //---------------------------------
+
+    @Override
+    public String output(boolean writeNewline)
+    {
+        if (isTopNode)
+        {
+            int count = 0;
+            for (MXMLDescriptorSpecifier md : propertySpecifiers)
+            {
+                if (md.name != null)
+                    count++;
+            }
+
+            write(count + "");
+            writeNewline(ASEmitterTokens.COMMA);
+        }
+        
+        MXMLDescriptorSpecifier model = null; // model goes first
+        MXMLDescriptorSpecifier beads = null; // beads go last
+
+        for (MXMLDescriptorSpecifier md : propertySpecifiers)
+        {
+            if (md.name != null && md.name.equals("model"))
+            {
+                model = md;
+
+                break;
+            }
+        }
+
+        if (model != null)
+            write(model.outputPropertySpecifier(true));
+
+        for (MXMLDescriptorSpecifier md : propertySpecifiers)
+        {
+            if (md.name != null)
+            {
+                if (!md.name.equals("model") && !md.name.equals("beads"))
+                    write(md.outputPropertySpecifier(writeNewline));
+                else if (md.name.equals("beads"))
+                    beads = md;
+            }
+        }
+
+        if (beads != null)
+            write(beads.outputPropertySpecifier(writeNewline));
+
+        if (!isProperty)
+        {
+            outputStyleSpecifier(writeNewline);
+
+            // TODO (erikdebruin) not yet implemented in FlexJS
+            //outputEffectSpecifier(writeNewline);
+
+            outputEventSpecifier(writeNewline);
+            
+            if (!isTopNode)
+            {
+                writeDelimiter(writeNewline);
+                
+                if (childrenSpecifier == null)
+                    write(ASEmitterTokens.NULL);
+                else
+                    outputChildren(childrenSpecifier, writeNewline);
+            }
+            
+            boolean isLastChild = parent != null
+                    && parent.propertySpecifiers.indexOf(this) == parent.propertySpecifiers
+                            .size() - 1;
+
+            if (!isLastChild && !isTopNode)
+                writeDelimiter(writeNewline);
+        }
+
+        return sb.toString();
+    }
+    
+    private void outputChildren(MXMLDescriptorSpecifier children, boolean writeNewline)
+    {
+        write(ASEmitterTokens.SQUARE_OPEN.getToken());
+        write(children.output(false));
+        write(ASEmitterTokens.SQUARE_CLOSE.getToken());
+    }
+
+    public String outputStateDescriptors()
+    {
+        for (MXMLDescriptorSpecifier md : propertySpecifiers)
+        {
+            write(ASEmitterTokens.SQUARE_OPEN);
+            write(md.output(false));
+            write(ASEmitterTokens.SQUARE_CLOSE);
+            writeNewline(ASEmitterTokens.COMMA);
+        }
+        return sb.toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLEventSpecifier.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLEventSpecifier.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLEventSpecifier.java
new file mode 100644
index 0000000..d419df6
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLEventSpecifier.java
@@ -0,0 +1,99 @@
+/*
+ *
+ *  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.internal.codegen.mxml.flexjs;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+
+/**
+ * @author Erik de Bruin
+ */
+public class MXMLEventSpecifier extends MXMLNodeSpecifier
+{
+
+    //--------------------------------------------------------------------------
+    //
+    //    Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    public MXMLEventSpecifier()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //    Properties
+    //
+    //--------------------------------------------------------------------------
+
+    static List<String> nameMap = Arrays.asList(
+    		"rollOver",
+    		"rollOut",
+    		"mouseDown",
+    		"mouseMove",
+    		"mouseOver",
+    		"mouseOut",
+    		"mouseUp"
+    );
+    
+    //---------------------------------
+    //    eventHandler
+    //---------------------------------
+
+    public String eventHandler;
+
+    //---------------------------------
+    //    type
+    //---------------------------------
+
+    public String type;
+
+    //--------------------------------------------------------------------------
+    //
+    //    Methods
+    //
+    //--------------------------------------------------------------------------
+
+    //---------------------------------
+    //    output
+    //---------------------------------
+
+    public String output(boolean writeNewline)
+    {
+        String handler = ASEmitterTokens.THIS.getToken()
+                + ASEmitterTokens.MEMBER_ACCESS.getToken() + eventHandler;
+        if (nameMap.contains(name))
+        	name = name.toLowerCase();
+        writeSimpleDescriptor(name, null, handler, writeNewline);
+
+        return sb.toString();
+    }
+
+    public static String getJSEventName(String name)
+    {
+    	if (nameMap.contains(name))
+    		return name.toLowerCase();
+    	return name;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSBlockWalker.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSBlockWalker.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSBlockWalker.java
new file mode 100644
index 0000000..6d374b4
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSBlockWalker.java
@@ -0,0 +1,83 @@
+/*
+ *
+ *  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.internal.codegen.mxml.flexjs;
+
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.codegen.mxml.flexjs.IMXMLFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker;
+import org.apache.flex.compiler.internal.css.codegen.CSSCompilationSession;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStyleNode;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+
+/**
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class MXMLFlexJSBlockWalker extends MXMLBlockWalker
+{
+
+    private IMXMLEmitter mxmlEmitter;
+
+    public MXMLFlexJSBlockWalker(List<ICompilerProblem> errors,
+            IASProject project, IMXMLEmitter mxmlEmitter, IASEmitter asEmitter,
+            IBlockWalker asBlockWalker)
+    {
+        super(errors, project, mxmlEmitter, asEmitter, asBlockWalker);
+
+        this.mxmlEmitter = mxmlEmitter;
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void visitFile(IMXMLFileNode node)
+    {
+        debug("visitFile()");
+
+        walk(node.getDocumentNode());
+    }
+
+    @Override
+    public void visitDocument(IMXMLDocumentNode node)
+    {
+        debug("visitDocument()");
+
+        ((IMXMLFlexJSEmitter) mxmlEmitter).emitDocument(node);
+    }
+
+    @Override
+    public void visitStyleBlock(IMXMLStyleNode node)
+    {
+        node.getCSSDocument(errors);
+                
+        final CSSCompilationSession session = node.getFileNode().getCSSCompilationSession();
+        if (session == null)
+            return;
+        
+    }
+
+}


[14/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/README
----------------------------------------------------------------------
diff --git a/compiler.js/README b/compiler.js/README
deleted file mode 100644
index 8300ef0..0000000
--- a/compiler.js/README
+++ /dev/null
@@ -1,13 +0,0 @@
-Apache FalconJS Compiler
-====================
-
-Before trying to build FalconJS, you must:
-
-1. Build Falcon (the compiler folder).  Follow instructions in the parent folder's README
-
-2. Try to compile tests/TestApp.  It should generate .js files for TestApp.as and MainCode.as
-
-To run FalconJS, use the bin/mxmlc script.  Pass in the .as file of the top-level application like you would normally pass it in to mxmlc with all of the same options.
-
-Example for running FalconJS : ../bin/mxmlc TestApp.as -output TestApp.js
-

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/bin/mxmlc
----------------------------------------------------------------------
diff --git a/compiler.js/bin/mxmlc b/compiler.js/bin/mxmlc
deleted file mode 100755
index f841431..0000000
--- a/compiler.js/bin/mxmlc
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/sh
-
-################################################################################
-##
-##  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.
-##
-################################################################################
-
-
-#
-# mxmlc shell script to launch falcon-mxmlc.jar on OSX, Unix, or Cygwin.
-# In Windows Command Prompt, use mxmlc.bat instead.
-#
-
-SCRIPT_HOME=`dirname "$0"`
-if [ "x${FALCON_HOME}" = "x" ]
-then
-    FALCON_HOME=${SCRIPT_HOME}/../../compiler
-fi
-
-echo Using Falcon codebase: $FALCON_HOME
-
-if [ "x${FLEX_HOME}" = "x" ]
-then
-    FLEX_HOME=${FALCON_HOME}/generated/dist/sdk
-fi
-echo Using Flex SDK: $FLEX_HOME
-
-case `uname` in
-		CYGWIN*)
-			OS="Windows"
-		;;
-		*)
-			OS=Unix
-esac
-
-D32=''
-
-if [ $OS = "Windows" ]; then
-
-	FALCON_HOME=`cygpath -m $FALCON_HOME`
-	FLEX_HOME=`cygpath -m $FLEX_HOME`
-
-elif [ $OS = "Unix" ]; then
-
-    check64="`java -version 2>&1 | grep -i 64-Bit`"
-    isOSX="`uname | grep -i Darwin`"
-    javaVersion="`java -version 2>&1 | awk -F '[ ".]+' 'NR==1 {print $3 "." $4}'`"
-    
-    if [ "$isOSX" != "" -a "$HOSTTYPE" = "x86_64" -a "$check64" != "" -a "$javaVersion" = "1.6" ]; then
-        D32='-d32'
-    fi	
-fi
-
-VMARGS="-Xmx384m -Dsun.io.useCanonCaches=false "
-
-java $VMARGS $D32 $SETUP_SH_VMARGS -Dflexcompiler="$FALCON_HOME" -Dflexlib="$FLEX_HOME/frameworks" -jar "$SCRIPT_HOME/../lib/mxmlc.jar" +flexlib="$FLEX_HOME/frameworks" "$@"

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/bin/mxmlc.bat
----------------------------------------------------------------------
diff --git a/compiler.js/bin/mxmlc.bat b/compiler.js/bin/mxmlc.bat
deleted file mode 100644
index 6626760..0000000
--- a/compiler.js/bin/mxmlc.bat
+++ /dev/null
@@ -1,29 +0,0 @@
-@echo off
-
-rem
-rem Licensed to the Apache Software Foundation (ASF) under one or more
-rem contributor license agreements.  See the NOTICE file distributed with
-rem this work for additional information regarding copyright ownership.
-rem The ASF licenses this file to You under the Apache License, Version 2.0
-rem (the "License"); you may not use this file except in compliance with
-rem the License.  You may obtain a copy of the License at
-rem
-rem     http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-rem
-
-rem
-rem mxmlc.bat script to launch falcon-mxmlc.jar in Windows Command Prompt.
-rem On OSX, Unix, or Cygwin, use the mxmlc shell script instead.
-rem
-
-if "x%FALCON_HOME%"=="x"  (set FALCON_HOME=%~dp0..) else echo Using Falcon codebase: %FALCON_HOME%
-
-if "x%FLEX_HOME%"=="x" (set FLEX_HOME=%~dp0..) else echo Using Flex SDK: %FLEX_HOME%
-
-@java -Dsun.io.useCanonCaches=false -Xms32m -Xmx512m -Dflexcompiler="%FALCON_HOME%" -Dflexlib="%FLEX_HOME%\frameworks" -jar "%FALCON_HOME%\lib\mxmlc.jar" %*
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/build.xml
----------------------------------------------------------------------
diff --git a/compiler.js/build.xml b/compiler.js/build.xml
deleted file mode 100644
index 2972b6c..0000000
--- a/compiler.js/build.xml
+++ /dev/null
@@ -1,261 +0,0 @@
-<?xml version="1.0" ?>
-<!--
-
-  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.
-
--->
-<project name="falcon-js" default="jar" basedir=".">
-
-    <pathconvert property="basedir1" dirsep="/">
-      <path location="${basedir}"/>
-    </pathconvert>
-	
-    <property name="build.version" value="329449.1"/>
-	<property name="src" value="${basedir1}/src"/>
-	<property name="lib" value="${basedir1}/lib"/>
-	
-	<property name="falcon.basedir" value="${basedir1}/../compiler"/>
-	<property name="falcon.lib.dir" value="${falcon.basedir}/lib"/>
-	<property name="falcon.dist.dir" value="${falcon.basedir}/generated/dist"/>
-	<property name="falcon.src" value="${falcon.basedir}/src"/>
-	
-    <property name="build.output" value="${basedir1}/build"/>
-	<property name="build.lib.dir" value="${build.output}/lib"/>
-	<property name="build.generated.src" value="${build.output}/generatedSrc"/>
-	
-	<property name="classes.dir" value="${build.output}/classes"/>
-	<property name="tests.results" value="${build.output}/tests/results"/>
-	<property name="asc.jar" value="${build.lib.dir}/asc.jar"/>
-	<property name="mxmlc.jar" value="${build.lib.dir}/mxmlc.jar"/>
-	<property name="compc.jar" value="${build.lib.dir}/compc.jar"/>
-	<property name="jsc.jar" value="${build.lib.dir}/jsc.jar"/>
-
-	<property name="as3.codegen.generated.src" value="${build.generated.src}/as3.codegen"/>
-	<property name="as3.codegen.package.dir" value="org/apache/flex/compiler/internal/as/codegen"/>
-	<property name="falcon.as3.codegen.dir" value="${falcon.basedir}/src/${as3.codegen.package.dir}"/>
-
-    <property name="ant.build.javac.target" value="1.6"/>
-    <property name="ant.build.javac.source" value="1.6"/>
-
-    <property name="javac.debug" value="true"/>
-    <property name="javac.deprecation" value="false"/>
-	
-	<property name="falcon-js-as3.codegen" value="${basedir1}/src/${as3.codegen.package.dir}"/>
-	<property name="jburg.jar" value="${falcon.lib.dir}/jburg.jar"/>
-	<property name="antlr" value="${falcon.lib.dir}/antlr.jar"/>
-	
-	<property name="tests.root" value="${basedir1}/../compiler.tests"/>
-	<property name="tamarin.dir" value="${tests.root}/resources/tamarin"/>
-	
-    <property name="manifest.Implementation-Vendor" value="Adobe Systems Incorporated"/>
-    <property name="manifest.Implementation-Version" value="0.${build.version}"/>
-
-    <property name="localizationIntermediates.dir" value="${basedir1}/intermediates/localization"/>
-    <property name="errorMessagesPath" value="org/apache/flex/compiler/problems"/>
-    <property name="errorMessagesSrc.dir" value="${basedir1}/localization/src/${errorMessagesPath}"/>
-    <available property="haveLocalizedErrorMessages.set" file="${errorMessagesSrc.dir}" type="dir"/>
-
-    <macrodef name="jburg-js">
-		<attribute name="spec"/>
-		<attribute name="output"/>
-		<sequential>
-			<dirname property="as3.codegen.emitter.@{spec}.dirname" file="@{spec}"/>
-			<dirname property="as3.codegen.emitter.@{output}.dirname" file="@{output}"/>
-			<basename property="as3.codegen.emitter.@{output}.basename" file="@{output}"/>
-			<mkdir dir="${as3.codegen.emitter.@{output}.dirname}"/>
-			<java classname="jburg.burg.JBurgMain" 
-                classpath="${classes.dir}"
-                fork="true"
-                failonerror="true"
-                dir="${as3.codegen.emitter.@{spec}.dirname}" >
-				<arg value="@{spec}"/>
-				<arg value="-outputdir"/>
-				<arg value="${as3.codegen.emitter.@{output}.dirname}"/>
-				<arg value="-outputfile"/>
-				<arg value="${as3.codegen.emitter.@{output}.basename}"/>
-				<arg value="-g"/>
-				<classpath>
-					<pathelement path="${jburg.jar}"/>
-					<pathelement path="${antlr}"/>
-					<pathelement path="${classes.dir}"/>
-				</classpath>
-			</java>
-		</sequential>
-	</macrodef>
-	
-	<path id="classpath">
-		<filelist dir="${build.lib.dir}">
-			<file name="commons-cli.jar"/>
-			<file name="commons-io.jar"/>
-			<file name="guava.jar"/>
-        </filelist>
-		<filelist dir="${build.lib.dir}/google/closure-compiler">
-            <file name="compiler.jar"/>
-        </filelist>
-	</path>
-
-    <target name="localizeCompilerErrors" if="haveLocalizedErrorMessages.set">
-        <sequential>
-            <echo level="info" message="Copying localization files to ${localizationIntermediates.dir}."/>
-            <mkdir dir="${localizationIntermediates.dir}"/>
-            <native2ascii encoding="UTF-8" src="${errorMessagesSrc.dir}" dest="${localizationIntermediates.dir}/${errorMessagesPath}" includes="**/*.xlr,**/*.properties"/>
-        </sequential>   
-    </target>
-
-	<target name="createBuildFolders">
-		<mkdir dir="${classes.dir}"/>
-	</target>
-
-	<target name="copyFiles" depends="createBuildFolders">
-		<copy todir="${build.lib.dir}">
-			<filelist dir="${falcon.lib.dir}">
-				<file name="antlr.jar"/>
-				<file name="commons-cli.jar"/>
-				<file name="commons-io.jar"/>
-				<file name="guava.jar"/>
-			</filelist>
-		</copy>
-		<copy todir="${build.lib.dir}/google/closure-compiler">
-			<filelist dir="${lib}/google/closure-compiler">
-				<file name="compiler.jar"/>
-			</filelist>
-		</copy>
-    </target>
-
-	<target name="prepare" depends="copyFiles,localizeCompilerErrors">
-		<echo level="info">${ant.file}</echo>
-	</target>
-	
-	<target name="as3.codegen.support.uptodate">
-			<echo level="info">${ant.file}</echo>
-			<uptodate property="CmcEmitter.uptodate" 
-	            targetfile="${as3.codegen.generated.src}/${as3.codegen.package.dir}/CmcJSEmitter.java">
-	            <srcfiles dir="${falcon-js-as3.codegen}" includes="*.jbg"/>
-				<srcfiles dir="${falcon.as3.codegen.dir}" includes="*.jbg"/>
-	        </uptodate>
-	</target>
-	
-	<target name="as3.codegen.support" depends="as3.codegen.support.uptodate,createBuildFolders">
-		<javac debug="${javac.debug}" deprecation="${javac.deprecation}"
-            destdir="${classes.dir}"
-            classpathref="classpath">
-			<src path="${falcon.src}"/>
-			<include name="**/IASNodeAdapter.java"/>
-			<classpath>
-				<pathelement path="${jburg.jar}"/>
-			</classpath>
-		</javac>
-	</target>
-	
-	<target name="as3.codegen.emitter" depends="as3.codegen.support" unless="CmcEmitter.uptodate">
-		<jburg-js spec="${falcon-js-as3.codegen}/cmc-js.jbg"
-            output="${as3.codegen.generated.src}/${as3.codegen.package.dir}/CmcJSEmitter.java"/>
-	</target>
-	
-	<target name="compile" depends="prebuild,prepare,as3.codegen.emitter" description="compile">
-		<javac debug="${javac.debug}" deprecation="${javac.deprecation}"
-            includes="**/*.java"
-            excludes=""
-            destdir="${classes.dir}"
-            classpathref="classpath">
-			<src path="${src}"/>
-			<src path="${as3.codegen.generated.src}"/>
-			<classpath>
-				<pathelement path="${falcon.basedir}/generated/classes"/>
-			</classpath>
-		</javac>
-	</target>
-
-    <target name="prebuild">
-        <mkdir dir="${lib}" />
-        <mkdir dir="${lib}/google" />
-        <mkdir dir="${lib}/google/closure-compiler" />
-        <ant antfile="${basedir}/downloads.xml" dir="${basedir}"/>
-    </target>
-	
-	<target name="jar" depends="compile">
-        
-        <property name="jar.classpath" value="antlr.jar commons-cli.jar commons-io.jar org.apache.felix.framework-3.0.2.jar guava.jar google/closure-compiler/compiler.jar ../../lib/compiler.jar"/>
-
-		<echo message="Building ${jsc.jar}"/>
-		<jar file="${jsc.jar}" basedir="${classes.dir}"
-            includes="**/*.properties,org/apache/**/*"
-			excludes="**/JSDriver*,**/IASNodeAdapter*,org/apache/flex/compiler/internal/parsing/abc/*" >
-            <manifest>
-                <attribute name="Sealed" value="false"/>
-				<attribute name="Implementation-Title" value="JSC Command Line Compiler"/>
-				<attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/>
-				<attribute name="Implementation-Version" value="${manifest.Implementation-Version}"/>
-                <attribute name="Class-Path" value="${jar.classpath}"/>
-            </manifest>
-        </jar>
-
-		<echo message="Building ${mxmlc.jar}"/>
-		<jar file="${mxmlc.jar}" >
-			<manifest>
-				<attribute name="Sealed" value="${manifest.sealed}"/>
-				<attribute name="Implementation-Title" value="MXMLJSC Command Line Compiler"/>
-				<attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/>
-				<attribute name="Implementation-Version" value="${manifest.Implementation-Version}"/>
-				<attribute name="Main-Class" value="org.apache.flex.compiler.clients.MXMLJSC"/>
-                <attribute name="Class-Path" value="jsc.jar"/>
-			</manifest>
-		</jar>
-
-		<echo message="Building ${compc.jar}"/>
-		<jar file="${compc.jar}" >
-			<manifest>
-				<attribute name="Sealed" value="${manifest.sealed}"/>
-				<attribute name="Implementation-Title" value="COMPJSC Command Line Compiler"/>
-				<attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/>
-				<attribute name="Implementation-Version" value="${manifest.Implementation-Version}"/>
-				<attribute name="Main-Class" value="org.apache.flex.compiler.clients.COMPJSC"/>
-                <attribute name="Class-Path" value="jsc.jar"/>
-			</manifest>
-		</jar>
-        
-		<echo message="Copying jars to ${lib}"/>
-        <copy todir="${lib}">
-			<filelist dir="${build.lib.dir}">
-				<file name="mxmlc.jar"/>
-				<file name="compc.jar"/>
-				<file name="jsc.jar"/>
-			</filelist>
-		</copy>
-
-	</target>
-
-    <target name="super-clean" depends="thirdparty-clean,clean" description="Cleans everything including thirdparty downloads."/>
-
-    <target name="thirdparty-clean" description="Removes all thirdparty downloads.">
-        <delete failonerror="false" quiet="true" includeemptydirs="true">
-            <fileset dir="${lib}" />
-        </delete>
-        <ant antfile="${basedir}/downloads.xml" dir="${basedir}" target="clean"/>
-    </target>
-
-	<!-- clean -->
-    <target name="clean" >
-		<echo message="${build.output}: cleaning..."/>
-        <delete failonerror="false" quiet="true" includeemptydirs="true" dir="${build.output}/classes"/>
-        <delete failonerror="false" quiet="true" includeemptydirs="true" dir="${build.output}/generatedSrc"/>
-        <delete failonerror="false" quiet="true" includeemptydirs="true" dir="${build.output}/lib"/>
-        <delete failonerror="false" quiet="true" includeemptydirs="true" dir="${localizationIntermediates.dir}"/>
-    </target>
-
-	<target name="eclipse" depends="as3.codegen.emitter"/>
-
-</project>

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/downloads.xml
----------------------------------------------------------------------
diff --git a/compiler.js/downloads.xml b/compiler.js/downloads.xml
deleted file mode 100644
index 8ecf531..0000000
--- a/compiler.js/downloads.xml
+++ /dev/null
@@ -1,363 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
-  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.
-
--->
-
-<project name="downloads" default="main" basedir=".">
-	<property name="FALCONJS_HOME" location="."/>
-
-	<!-- properties -->
-	<!--<property file="${FALCONJS_HOME}/build.properties"/>-->
-
-    <property name="lib.dir" value="${FALCONJS_HOME}/lib"/>
-    
-	<property name="download.dir" value="${FALCONJS_HOME}/in"/>
-    
-	<!-- 
-	   Notes:
-	       For Apache, the JARS must be removed from the repository.
-	       
-	       Licenses:
-            antlr (3) - BSD
-	        commons-cli (1.2) - Apache 2.0
-	        commons-io (2.0.1) - Apache 2.0
-	        guava (r08) - Apache 2.0
-            felix (1.10.1) - CPL 1.0
-	        closure (9.2) - Apache 2.0
-	        
-	-->
-	
-    <property name="antlr.name" value="antlr"/>
-    <property name="commons-cli.name" value="commons-cli-1.2"/>
-    <property name="commons-io.name" value="commons-io-2.0.1"/>	
-    <property name="guava.name" value="guava-r08"/>
-    <property name="felix.name" value="felix-3.0.2"/>
-    <property name="closure.name" value="compiler"/>
-	     
-    <!-- 
-        Because the downloads requires a network connection and the JARs don't change very often, 
-        they are each downloaded only if they don't already exist. 
-    -->
-    
-	<target name="main" depends="prepare, antlr-jar, commons-jars, guava-jar, felix-jar, closure-jar" 
-		description="Downloads all the required thirdparty JARs"/>
-
-    <target name="prepare" >
-		<echo message="Making lib directory ${basedir}/${lib.dir}"/>
-        <mkdir dir="${lib.dir}" />
-    </target>
-    
-    <!--
-		Cleanup
-	-->
-	
-    <target name="clean" 
-        description="Removes thirdparty downloads.">
-        
-        <delete includeEmptyDirs="true" failonerror="false">
-            <fileset dir="${download.dir}">
-                <include name="antlr*/**"/>
-                <include name="commons-cli*/**"/>
-                <include name="commons-io*/**"/>
-                <include name="guava*/**"/>
-                <include name="felix*/**"/>
-                <include name="compiler*/**"/>
-                <include name="temp*/**"/>
-            </fileset>
-        </delete>
-    </target>
-    
-    <!--
-	    Download thirdparty JARs    
-	-->
-
-    <!--
-        Download a zip or gz file, extracts the jar file, and optionally copies the jar
-        file to a different location and optinally verifies the checksum.  
-        If the checksum fails, this script fails.
-
-        Params are:
-            srcUrl
-            zipFile - a .gz file for untar with gzip, else unzip
-            [md5]
-            [srcJarPath] - both src and dest required for the copy
-            [destJarFile]
-
-        Note: This is purposely coded without <if><else><then> so that a dependency on
-        ant-contrib.jar isn't required.        
-    -->
-    
-    <target name="download-zip"
-        description="Downloads tar/zip, and optionally verifies checksum and copies extracted jar.">                
-        
-        <mkdir dir="${download.dir}"/>        
-    	
-        <get src="${srcUrl}/${zipFile}" dest="${download.dir}/${zipFile}"/>
-
-        <condition property="zip.compressed">
-            <matches string="${zipFile}" pattern="^*.zip$"/>      
-        </condition>
- 
-        <antcall target="untar-file"/>
-        <antcall target="unzip-file"/>
-        
-        <antcall target="check-sum">
-            <param name="message" value="Checksum mismatch for ${download.dir}/${zipFile}"/>
-        </antcall>
-        
-        <condition property="destination.known">
-            <and>
-                <isset property="srcJarPath"/>
-                <isset property="destJarFile"/>
-            </and>
-        </condition> 
-        <antcall target="copy-downloaded-jar"/>
-     </target>   	
-     
-    <target name="download-bz2"
-        description="Downloads bz2, and optionally verifies checksum and copies extracted jar.">                
-        
-        <mkdir dir="${download.dir}"/>        
-    	
-        <get src="${srcUrl}/${zipFile}" dest="${download.dir}/${zipFile}"/>
-
-        <untar src="${download.dir}/${zipFile}" dest="${download.dir}/temp" compression="bzip2"/> 
-        
-        <antcall target="check-sum">
-            <param name="message" value="Checksum mismatch for ${download.dir}/${zipFile}"/>
-        </antcall>
-        
-        <condition property="destination.known">
-            <and>
-                <isset property="srcJarPath"/>
-                <isset property="destJarFile"/>
-            </and>
-        </condition> 
-        <antcall target="copy-downloaded-jar"/>
-     </target>   	
-     
-    <!--
-        Download a jar file and optionally verify the checksum.
-        If the checksum fails, this script fails.
-        
-        Params are:
-            srcUrl
-            srcJarFile
-            destJarFile
-            [md5]
-    -->
-    <target name="download-jar" 
-        description="Downloads jar, and optionally verifies checksum.">                
-     
-        <get src="${srcUrl}/${srcJarFile}" dest="${destJarFile}"/>
-        <checksum file="${destJarFile}" algorithm="MD5" property="${we.failed}"/>
-        <antcall target="fail-with-message">
-            <param name="message" value="Checksum mismatch for ${destJarFile}"/>
-        </antcall>
-    </target>
-
-    <target name="untar-file" unless="zip.compressed" description="Untars zipFile">
-        <untar src="${download.dir}/${zipFile}" dest="${download.dir}/temp" compression="gzip"/> 
-    </target>
-    
-    <target name="unzip-file" if="zip.compressed" description="Unzips zipFile">
-        <unzip src="${download.dir}/${zipFile}" dest="${download.dir}/temp"/>    
-    </target>
-    
-    <target name="check-sum" if="md5" 
-        description="Verifies MD5 checksum, and fails if checksum doesn't match">
-        
-        <checksum file="${download.dir}/${zipFile}" algorithm="MD5" property="${we.failed}"/>
-        <antcall target="fail-with-message">
-            <param name="message" value="${message}"/>
-        </antcall>
-    </target>
-    
-    <target name="copy-downloaded-jar" if="destination.known">
-        <mkdir dir="${lib.dir}"/>
-        <copy file="${download.dir}/temp/${srcJarPath}" toFile="${destJarFile}" verbose="true"/>
-    </target>
-    
-    <target name="fail-with-message" if="we.failed" 
-        description="Conditionally fails with the specified message">                
-        <fail message="${message}"/>
-    </target>
-        
-    <!--
-        antlr
-    -->
-    
-    <target name="antlr-jar-check" description="Checks if antlr jar exists.">
-    	<condition property="antlr.jar.exists">
-    	    <and>
-    	        <available file="${basedir}/lib/antlr.jar"/>
-    	    </and>
-        </condition>
-    </target>
-    
-    <target name="antlr-jar" depends="antlr-jar-check" unless="antlr.jar.exists"
-        description="Copies the antlr jar to the lib directory.">
-
-        <antcall target="antlr-download-jar"/>
-        <echo file="${lib.dir}/antlr-LICENSE.TXT">http://www.antlr.org/license.html</echo> 
-    </target>
-    
-    <target name="antlr-download-jar" depends="antlr-jar-check" unless="antlr.jar.exists"
-        description="Downloads the antlr jars.">
-        
-        <antcall target="download-jar">
-            <param name="srcUrl" value="http://antlr3.org/download"/>
-            <param name="srcJarFile" value="antlr-3.3-complete.jar"/>
-            <param name="destJarFile" value="${lib.dir}/antlr.jar"/>
-            <param name="md5" value="238becce7da69f7be5c5b8a65558cf63"/>
-        </antcall>
-    </target>
-
-    <!--
-	    commons
-	-->
-	
-	<target name="commons-jars" depends="commons-cli-jar,commons-io-jar" />
-
-    <!--
-	    commons-cli
-	-->
-	
-    <target name="commons-cli-jar-check" description="Checks if common-cli.jar has been downloaded.">
-        <available file="${lib.dir}/commons-cli.jar" property="commons.cli.jar.exists"/>
-    </target>
-    
-    <target name="commons-cli-jar" depends="commons-cli-jar-check" unless="commons.cli.jar.exists" 
-        description="Downloads and copies common-cli.jar to the lib directory.">
-                
-        <antcall target="download-zip">
-          <param name="srcUrl" value="http://archive.apache.org/dist/commons/cli/binaries"/>
-          <param name="zipFile" value="${commons-cli.name}-bin.tar.gz"/>
-          <param name="md5" value="a05956c9ac8bacdc2b8d07fb2cb331ce"/>
-          <param name="srcJarPath" value="${commons-cli.name}/${commons-cli.name}.jar"/>
-          <param name="destJarFile" value="${lib.dir}/commons-cli.jar"/>
-        </antcall>
-        <copy todir="${lib.dir}">
-            <fileset dir="${download.dir}/temp/${commons-cli.name}">
-                <include name="LICENSE.txt"/>
-            </fileset>            
-            <globmapper from="*" to="commons-cli-*"/>
-        </copy>
-        <delete dir="${download.dir}/temp/${commons-cli.name}"/>
-    </target>
-
-    <!--
-        commons-io
-    -->
-    
-    <target name="commons-io-jar-check" description="Checks if commons-io.jar is in lib directory.">
-        <available file="${lib.dir}/commons-io.jar" property="commons.io.jar.exists"/>
-    </target>
-    
-    <target name="commons-io-jar" depends="commons-io-jar-check" 
-        unless="commons.io.jar.exists" 
-        description="Copies commons-io.jar to the lib directory.">
-                
-        <antcall target="download-zip">
-          <param name="srcUrl" value="http://archive.apache.org/dist/commons/io/binaries"/>
-          <param name="zipFile" value="${commons-io.name}-bin.tar.gz"/>
-          <param name="md5" value="4f2c26f9d80f89d15939619cc8524f78"/>
-          <param name="srcJarPath" value="${commons-io.name}/${commons-io.name}.jar"/>
-          <param name="destJarFile" value="${lib.dir}/commons-io.jar"/>
-        </antcall>
-        <copy todir="${lib.dir}">
-            <fileset dir="${download.dir}/temp/${commons-io.name}">
-                <include name="LICENSE.txt"/>
-            </fileset>            
-            <globmapper from="*" to="commons-io-*"/>
-        </copy>
-        <delete dir="${download.dir}/temp/${commons-io.name}"/>
-    </target>
-	
-
-	<!--
-        guava - collections and other common constructs
-    -->
-    
-    <target name="guava-jar-check" description="Checks if guava.jar is in lib directory.">
-        <available file="${lib.dir}/guava.jar" property="guava.jar.exists"/>
-    </target>
-    
-    <target name="guava-jar" depends="guava-jar-check" 
-        unless="guava.jar.exists" 
-        description="Downloads and copies guava.jar to the lib directory.">
-
-        <antcall target="download-zip">
-          <param name="srcUrl" value="http://guava-libraries.googlecode.com/files/"/>
-          <param name="zipFile" value="${guava.name}.zip"/>
-          <param name="srcJarPath" value="${guava.name}/${guava.name}.jar"/>
-          <param name="md5" value="b73fe1bb5f443993adcf8b274f6a48b2"/>
-          <param name="destJarFile" value="${lib.dir}/guava.jar"/>
-        </antcall>
-        <get src="http://www.apache.org/licenses/LICENSE-2.0" dest="${lib.dir}/guava-LICENSE.txt"/>
-        <delete dir="${download.dir}/temp/${guava.name}"/>
-    </target>
-
-	<!--
-        felix - for codegen of certain java source files
-    -->
-    
-    <target name="felix-jar-check" description="Checks if felix.jar is in lib directory.">
-        <available file="${lib.dir}/org.apache.felix.framework-3.0.2.jar" property="felix.jar.exists"/>
-    </target>
-    
-    <target name="felix-jar" depends="felix-jar-check" unless="felix.jar.exists" 
-        description="Copies felix.jar to the lib directory.">
-
-        <antcall target="download-jar">
-            <param name="srcUrl" value="http://archive.apache.org/dist/felix"/>
-            <param name="srcJarFile" value="org.apache.felix.framework-3.0.2.jar"/>
-            <param name="destJarFile" value="${lib.dir}/org.apache.felix.framework-3.0.2.jar"/>
-            <param name="md5" value="d49b926d3f16321b95935119fd4b8db5"/>
-        </antcall>
-        <get src="http://archive.apache.org/dist/felix/LICENSE" dest="${lib.dir}/felix-LICENSE.txt"/>
-    </target>
-    	
-    <!--
-        closure - JS compiler, minimizer, etc.
-    -->
-    
-    <target name="closure-jar-check" description="Checks if closure jar exists.">
-        <available file="${lib.dir}/google/closure-compiler/compiler.jar" property="closure.jar.exists" />
-    </target>
-    
-	<target name="closure-jar" depends="closure-jar-check" unless="closure.jar.exists" 
-        description="Copies the closure build jars.">
-		<mkdir dir="${lib.dir}/google/closure-compiler" />
-        <antcall target="download-zip">
-          <param name="srcUrl" value="http://closure-compiler.googlecode.com/files"/>
-          <param name="zipFile" value="compiler-20110615.zip"/>
-          <param name="sha1" value="7bece33b7535315143374f252955833164bc5b38"/>
-        </antcall>
-        <get src="http://www.apache.org/licenses/LICENSE-2.0" dest="${lib.dir}/google/closure-compiler/closure-LICENSE.txt"/>
-        <copy todir="${lib.dir}/google/closure-compiler">
-            <fileset dir="${download.dir}/temp">
-                <include name="${closure.name}.jar"/>
-            </fileset>
-        </copy>
-        <delete includeemptydirs="true">
-            <fileset dir="${download.dir}/temp" includes="**/*"/>
-        </delete>    
-    </target>
-        
-</project>

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/js/adobe.js
----------------------------------------------------------------------
diff --git a/compiler.js/js/adobe.js b/compiler.js/js/adobe.js
deleted file mode 100644
index 2b41e78..0000000
--- a/compiler.js/js/adobe.js
+++ /dev/null
@@ -1,103 +0,0 @@
-// JavaScript Document
-/* Simple JavaScript Inheritance
- * By John Resig http://ejohn.org/
- * MIT Licensed.
- */
-// Inspired by base2 and Prototype
-
-// Modifications from original:
-// - "Class" replaced by "adobe"
-// - Refactored as a singleton class factory.  You call adobe.extend for all classes
-// instead of calling the class's extend method as shown in the blog aritcle
-// - createProxy added
-// - newObject added
-// - eventMap added
-(function(){
-  var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
-  // The base Class implementation (does nothing)
-  this.adobe = function(){};
-  
-  adobe.eventMap = {
-  	click: "onClick"
-  }
-  
-  adobe.classes = {
-  }
-  
-  adobe.createProxy = function(context, method)
-  {
-	  var self = context;
-	  return function(e) { method.apply(self, [e]) };
-  }
-  
-  adobe.newObject = function(ctor, ctorArgs)
-  {
-	  if (ctor === flash.events.Event && ctorArgs.length == 1)
-	  {
-		  var evt = document.createEvent('Event');
-		  evt.initEvent(ctorArgs[0], false, false);
-		  return evt;
-	  }
-	  
-	  if (ctorArgs.length == 1)
-		return new ctor(ctorArgs[0]);
-	  if (ctorArgs.length == 0)
-	  	return new ctor();
-  }
-  
-  adobe.prototype.init = function () {};
-  
-  // Create a new Class that inherits from this class
-  adobe.extend = function(className, superClass, prop) {
-    var _super = superClass.prototype;
-    
-    // Instantiate a base class (but only create the instance,
-    // don't run the init constructor)
-    initializing = true;
-    var prototype = new superClass();
-    initializing = false;
-    
-    // Copy the properties over onto the new prototype
-    for (var name in prop) {
-      // Check if we're overwriting an existing function
-      prototype[name] = typeof prop[name] == "function" && 
-        typeof _super[name] == "function" && fnTest.test(prop[name]) ?
-        (function(name, fn){
-          return function() {
-            var tmp = this._super;
-            
-            // Add a new ._super() method that is the same method
-            // but on the super-class
-            this._super = _super[name];
-            
-            // The method only need to be bound temporarily, so we
-            // remove it when we're done executing
-            var ret = fn.apply(this, arguments);        
-            this._super = tmp;
-            
-            return ret;
-          };
-        })(name, prop[name]) :
-        prop[name];
-    }
-    
-    // The dummy class constructor
-    function adobe() {
-      // All construction is actually done in the init method
-      if ( !initializing && this.init )
-        this.init.apply(this, arguments);
-    }
-    
-	// Populate our constructed prototype object
-    adobe.prototype = prototype;
-    
-    // Enforce the constructor to be what we expect
-    adobe.prototype.constructor = adobe;
-
-	// AJH remove this for now
-    // And make this class extendable
-    // adobe.extend = arguments.callee;
-    
-    return adobe;
-  };
-})();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_de.properties
----------------------------------------------------------------------
diff --git a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_de.properties b/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_de.properties
deleted file mode 100644
index d7ea5dd..0000000
--- a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_de.properties
+++ /dev/null
@@ -1,282 +0,0 @@
-################################################################################
-##
-##  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.
-##
-################################################################################
-
-ABCGeneratorProblem=Interner Fehler in ABC-Generatorteilsystem beim Generieren von Code für: ${sourceFileName}: ${stackTrace}
-AccessorTypesMustMatchProblem=Zugriffstypen müssen übereinstimmen.
-AccessUndefinedMemberProblem=Zugriff auf möglicherweise nicht definierte ${memberName}-Eigenschaft über einen Verweis mit dem statischen Typ "${className}".
-AccessUndefinedPropertyInPackageProblem=Zugriff auf nicht definierte ${propertyName}-Eigenschaft in ${packageName}-Paket.
-AccessUndefinedPropertyProblem=Zugriff auf möglicherweise nicht definierte ${propertyName}-Eigenschaft.
-AmbiguousReferenceProblem=Nicht eindeutiger Verweis auf ${property}
-AssignToConstProblem=Unzulässige Zuweisung zu einer als Konstante angegebenen Variablen.
-AssignToFunctionProblem=Unzulässige Zuweisung zu ${funcName}-Funktion.
-AssignToReadOnlyPropertyProblem=${name}-Eigenschaft ist schreibgeschützt.
-AttemptToDeleteFixedPropertyProblem=Es wird versucht, die feste ${name}-Eigenschaft zu löschen. Nur dynamisch definierte Eigenschaften können gelöscht werden.
-AttributesAreNotCallableProblem=Attribute sind nicht aufrufbar.
-BadAccessInterfaceMemberProblem=Schnittstellenmitglieder dürfen nicht als "public", "private", "protected" oder "internal" deklariert werden.
-BadCharacterProblem=Fehler bei unerwartetem Zeichen: "'${errorText}" ist hier nicht zulässig
-BadSetterReturnTypeProblem=Rückgabetyp einer set-Definition muss "unspecified" oder "void" sein.
-BaseClassIsFinalProblem=Basisklasse ist ${finalStr}.
-BURMDiagnosticForEachExpectedInProblem=Das Schlüsselwort "${k_each}" ist ohne einen "${k_in}"-Operator nicht zulässig
-BURMDiagnosticInvalidDecrementProblem=Operand des Dekrements muss ein Verweis sein.
-BURMDiagnosticNotAllowedHereProblem=${node} ist hier nicht zulässig
-BURMPatternMatchFailureProblem=Code für ${node} kann nicht generiert werden
-BURNDiagnosticInvalidIncrementProblem=Operand des Inkrements muss ein Verweis sein.
-CallUndefinedMethodProblem=Aufruf einer möglicherweise undefinierten ${methodName}-Methode.
-CannotDeleteSuperDescendantsProblem=Löschen von super-Nachkommen nicht möglich.
-CannotExtendClassProblem=Eine Schnittstelle kann nur andere Schnittstellen erweitern, ${className} ist jedoch eine Klasse.
-CannotExtendInterfaceProblem=Eine ${classStr} kann nur eine andere ${classStr}, jedoch keine ${interfaceStr} erweitern.
-CannotResolveConfigExpressionProblem=Konfigurationskonstante kann nicht aufgelöst werden: "${configName}"
-CircularTypeReferenceProblem=Zirkelreferenz in ${className} erkannt
-ClassesMappedToSameRemoteAliasProblem=Beim Verarbeiten der ${className}-Klasse wurde eine Zuordnung von "${existingClassName}" zum Remoteklassenalias "${alias}" gefunden. Flex generiert jetzt Code, um zu überprüfen, ob bereits ein Alias registriert wurde. Beim Deserialisieren von Remotedaten kann ein Alias die Daten nur einer einzelnen Klasse zuordnen.
-ClosureProblem=Closure error.
-CodegenInternalProblem=Interner Fehler bei Codegenerator: ${diagnostic}
-CompiledAsAComponentProblem=${className} ist ein Modul oder eine Anwendung, auf das/die direkt verwiesen wird. Dies führt dazu, dass ${className} und alle davon abhängigen Elemente in ${mainDefinition} eingebunden sind. Um dies zu vermeiden, wird die Verwendung einer Schnittstelle empfohlen.
-ConfigurationFileNotFoundProblem=Konfigurationsdatei wurde nicht gefunden: ${file}
-ConfigurationProblem=Konfigurationsproblem: ${reason}.\n${location}
-ConflictingInheritedNameInNamespaceProblem=Konflikt mit übernommener ${declName}-Definition in ${nsName}-Namespace vorhanden.
-ConflictingNameInNamespaceProblem=Konflikt mit ${declName}-Definition in ${nsName}-Namespace vorhanden.
-ConstructorCannotHaveReturnTypeProblem=Ein Konstruktor kann keinen Rückgabetyp angeben
-ConstructorIsGetterSetterProblem=Ein Konstruktor kann keine Get- oder Set-Methode sein
-ConstructorIsStaticProblem=Konstruktorfunktionen müssen Instanzmethoden sein.
-ConstructorMustBePublicProblem=Ein Konstruktor kann nur als ${modifier} deklariert werden
-CountedForLoopInitializerProblem=Syntaxfehler: Es wird ein Semikolon vor rechter Klammer erwartet.
-CSSCodeGenProblem=CSS-Codegenerierungsproblem. Grund: "${reason}"
-CSSEmbedAssetProblem=Element aus "${embed}" kann nicht eingebettet werden.
-CSSParserProblem=${reason}
-CSSUndefinedNamespacePrefixProblem=Nicht definiertes Namespacepräfix "${prefix}".
-CSSUndefinedTypeProblem="${type}" ist nicht definiert.
-CSSUnknownDefaultNamespaceProblem=Für die Typauswahl ohne Namespacepräfix muss ein Standardnamespace definiert sein. ${selectorText}
-CSSUnresolvedClassReferenceProblem=${qname} ist nicht definiert.
-CyclicalIncludesProblem=Zyklische Includes in ${file} gefunden
-DependencyNotCompatibleProblem=Die Abhängigkeit ${definition} aus ${swc} hat eine unterstützte Mindestversion ${swcMinimumVersion}, die höher ist als die Kompatibilitätsversion, ${compatibilityVersion}.
-DeprecatedConfigurationOptionProblem="${option}" wird seit ${since} nicht mehr verwendet. Verwenden Sie stattdessen "${replacement}"
-DuplicateAttributeProblem=${attrStr}-Attribut wurde mehrfach angegeben.
-DuplicateClassDefinitionProblem=Doppelt vorhandene Klassendefinition: ${className}.
-DuplicateConfigNameProblem=Doppelt vorhandener Konfigurationsnamespace: "${configName}"
-DuplicateFunctionDefinitionProblem=Doppelt vorhandene Funktionsdefinition: ${methodName}
-DuplicateInterfaceDefinitionProblem=Doppelt vorhandene Schnittstellendefinition: ${interfaceName}.
-DuplicateInterfaceProblem=${className}-${classStr} implementiert ${interfaceName}-${interfaceStr} mehrfach.
-DuplicateLabelProblem=Doppelt vorhandene Bezeichnungsdefinition.
-DuplicateNamespaceDefinitionProblem=Doppelt vorhandene Namespacedefinition.
-DuplicateQNameInSourcePathProblem=${qName} wird von mehreren Dateien definiert: ${fileList} 
-DuplicateSkinStateProblem=Doppelt vorhandene Deklaration von SkinState "${name}"
-DuplicateSourceFileProblem=${file} wurde in der Liste der einzubeziehenden Quellen mehrfach angegeben.
-DuplicateSourcePathProblem=${directory} wurde im Quellpfad mehrmals angegeben.
-DuplicateSwitchCaseProblem=Doppelt vorhandene Switch-Alternative ${caseName}.
-DynamicNotOnClassProblem=Das ${dynamicStr}-Attribut kann nur mit ${classStr}ndefinitionen verwendet werden.
-EmbedAS2TagsModifiedProblem=AS2-Aktionen wurden aus dem ${symbol}-Tag entfernt
-EmbedBadFontParameters=Für die Schriftartentranskodierung müssen Sie "fontName" sowie "source", "systemFont" oder "sourceList" angeben
-EmbedBadScalingGridTargetProblem=Das ${symbol}-Symbol konnte nicht skaliert werden, da es nicht vom Typ Sprite ist
-EmbedCouldNotDetermineSampleFrameCountProblem=Die Samplebildanzahl in der Datei "${filename}" konnte nicht bestimmt werden
-EmbeddedFontShadowsDeviceFontProblem=Die eingebettete Schriftart "${alias}" kann einer Geräteschriftart mit demselben Namen entsprechen. Verwenden Sie fontName, um einen anderen Namen für die Schriftart zu verwenden
-EmbedExceptionWhileTranscodingProblem=Ausnahme während der Transkodierung: ${exception}
-EmbedInitialValueProblem=Eine Embed-Variable darf keinen vorhandenen Wert haben.
-EmbedInvalidAttributeValueProblem=Der Wert ${value} ist für das ${attribute}-Attribut ungültig
-EmbedInvalidUnicodeRangeProblem=ungültiger Unicode-Bereich "${range}"
-EmbedMissingSymbolProblem=Das ${symbol}-Symbol wurde in der Datei "${swf}" nicht gefunden
-EmbedMovieScalingNoSymbolProblem=Geben Sie ein Symbol an, wenn Sie einen eingebetteten Film skalieren
-EmbedMultipleMetaTagsProblem=Eine Variable kann nur ein Embed-Metadaten-Tag haben
-EmbedNoSkinClassProblem=Beim Einbetten von Skinelementen muss ein skinClass-Attribut angegeben werden
-EmbedNoSourceAttributeProblem=Für das Einbetten ist ein Quelldateiattribut erforderlich
-EmbedQualityRequiresCompressionProblem=Geben Sie "quality" nicht an, wenn die Komprimierung deaktiviert ist
-EmbedQualityValueProblem=Der Wert ${value} für das quality-Attribut ist ungültig. Er muss zwischen 0.0 und 100.0 liegen
-EmbedScalingGridProblem=Die Attribute scaleBottom, scaleLeft, scaleRight und scaleTop müssen zusammen angegeben werden
-EmbedScalingGridValueProblem=Der Skalierungswert ${value} muss für das ${attr}-Attribut größer als 0 sein
-EmbedSkinClassNotFoundProblem=${skinClass}-Klasse wurde nicht gefunden
-EmbedSourceAttributeCouldNotBeReadProblem=Embed-Quelldatei "${filename}" konnte nicht gelesen werden
-EmbedSourceAttributeDoesNotExistProblem=Embed-Quelldatei wurde nicht gefunden
-EmbedSourceFileNotFoundProblem=Embed-Quelldatei wurde nicht gefunden: ${file}
-EmbedTypeNotEmbeddableProblem=Typ ${typeName} kann nicht eingebettet werden
-EmbedUnableToBuildFontProblem=Schriftart "${fontName}" kann nicht erstellt werden
-EmbedUnableToReadSourceProblem=Transkodierungsquelle "${source}" kann nicht gelesen werden
-EmbedUnknownAttributeProblem=Unbekanntes Attribut: ${attr}
-EmbedUnknownMimeTypeProblem=Nicht verarbeiteter MIME-Typ ${mimeType}
-EmbedUnrecogniedFileTypeProblem=Datei "${file}" weist ein unbekanntes Dateiformat auf, das nicht eingebettet werden kann
-EmbedUnsupportedAttributeProblem=Das ${attribute}-Attribut kann nicht mit folgendem MIME-Typ verwendet werden: ${mimeType}
-EmbedUnsupportedSamplingRateProblem=Die Frequenz ${frequency} wird in Datei "${filename}" nicht unterstützt
-FileNotFoundProblem=Datei nicht gefunden: ${file}
-FinalOutsideClassProblem=Das ${finalStr}-Attribut kann nur für eine in einer ${classStr} definierte Methode verwendet werden.
-FunctionNotMarkedOverrideProblem=Eine nicht für "${overrideStr}" gekennzeichnete ${funcStr} wird außer Kraft gesetzt
-FunctionWithoutBodyProblem=Funktion enthält keinen Hauptteil.
-FXGCompilerProblem=FXG-Kompilierungsproblem: ${message}
-GetterCannotHaveParametersProblem=Eine get-Definition darf keine Parameter enthalten.
-GlobalBindablePropertyProblem=[${bindableStr}] nicht zulässig für globale oder ${packageStr}-Variablen
-HostComponentClassNotFoundProblem=[HostComponent]-Klasse "${className}" nicht gefunden.
-HostComponentMustHaveTypeProblem=[HostComponent] muss einen Typennamen angeben.
-IllegalAssignmentToClassProblem=Unzulässige Zuweisung zu ${className}-Klasse.
-ImplicitCoercionToSubtypeProblem=Implizite Typumwandlung eines Werts mit statischem Typ "${baseType}" in einen möglicherweise nicht verwandten Typ "${subType}".
-ImplicitCoercionToUnrelatedTypeProblem=Implizite Typumwandlung eines Werts von Typ "${actualType}" in einen nicht verwandten Typ "${expectedType}".
-InaccessibleMethodReferenceProblem=Versuchter Aufruf einer nicht verfügbaren ${methodName}-Methode über einen Verweis mit statischem Typ "${className}".
-InaccessiblePropertyReferenceProblem=Versuchter Aufruf einer nicht verfügbaren ${propertyName}-Eigenschaft über einen Verweis mit statischem Typ "${className}".
-IncompatibleDefaultValueProblem=Inkompatibler Standardwert des Typs "${srcType}", bei dem "${tgtType}" erwartet wird.
-IncompatibleInterfaceMethodProblem=${interfStr}nmethode ${methodName} in ${namespaceStr} ${namespaceName} wird mit einer inkompatiblen Signatur in ${classStr} ${className} implementiert
-IncompatibleOverrideProblem=Inkompatibler ${overrideStr}.
-InterfaceBindablePropertyProblem=[${bindableStr}] ist innerhalb einer ${interfStr}ndefinition nicht zulässig.
-InterfaceCannotBeInstantiatedProblem=Schnittstellen dürfen nicht mit dem neuen Operator instanziiert werden.
-InterfaceMethodWithBodyProblem=In einer ${interfaceStr} definierte Methoden dürfen keinen Hauptteil haben.
-InterfaceModifierProblem=Schnittstellenattribut ${modifier} ist ungültig.
-InterfaceNamespaceAttributeProblem=Namespaceattribute sind für Schnittstellenmethoden nicht zulässig.
-InternalCompilerProblem=Interner Compilerfehler
-InvalidABCByteCodeProblem=Ungültiger ABC-Bytecode.
-InvalidBackgroundColorProblem=Ungültige Hintergrundfarbe: ${backgroundColor}
-InvalidDecrementOperandProblem=Ungültiger Dekrementoperand.
-InvalidEscapeSequenceProblem="${badSequence}" ist keine gültige Escapesequenz
-InvalidForInInitializerProblem=Syntaxfehler: Ungültiger for-in-Initialisierer, nur 1 Ausdruck erwartet.
-InvalidIncrementOperandProblem=Ungültiger Inkrementoperand.
-InvalidLvalueProblem=Ziel der Zuweisung muss ein Verweiswert sein.
-InvalidNamespaceInitializerProblem=Ein Namespaceinitialisierer muss entweder ein Literalstring oder ein anderer Namespace sein.
-InvalidNamespaceProblem=Ein benutzerdefiniertes Namespaceattribut kann nur auf der obersten Ebene einer ${classStr}ndefinition verwendet werden.
-InvalidOverrideProblem=Das ${overrideStr}-Attribut kann nur für eine in einer ${classStr} definierte Methode verwendet werden.
-InvalidPrivateNamespaceAttrProblem=Das ${privateStr}-Attribut kann nur für Definitionen von ${classStr}neigenschaften verwendet werden.
-InvalidPrivateNamespaceProblem=${privateStr} kann nur innerhalb einer ${classStr} als Namespace verwendet werden.
-InvalidProtectedNamespaceAttrProblem=Das ${protectedStr}-Attribut kann nur für Definitionen von ${classStr}neigenschaften verwendet werden.
-InvalidProtectedNamespaceProblem=${protectedStr} kann nur innerhalb einer ${classStr} als Namespace verwendet werden.
-InvalidPublicNamespaceAttrProblem=Das ${publicStr}-Attribut kann nur innerhalb eines ${packageStr}s verwendet werden.
-InvalidPublicNamespaceProblem=${publicStr} kann nur innerhalb eines ${packageStr}s als Namespace verwendet werden.
-InvalidRestParameterDeclarationProblem=Nach dem Parameterdefinitionsschlüsselwort ...rest angegebene Parameter können nur vom Array-Datentyp sein.
-InvalidSuperExpressionProblem=Super-Ausdrücke können nur innerhalb von Klasseninstanzmethoden verwendet werden.
-InvalidSuperStatementProblem=Super-Anweisungen können nur innerhalb von Klasseninstanzkonstruktoren verwendet werden.
-JSDataClassMethodError=ERROR: DataClass classes must not declare methods. 
-JSInternalCompilerProblem=Internal compiler error: ${message}. 
-JSUnsupportedFeatureProblem=Unsupported feature: ${feature}. 
-JSWarnClassInitProblem=PERFORMANCE: Avoid loose class initialization statements. Consider using singletons instead.
-JSWarnClosureAdvancedOptimizationsProblem=WARNING: Optimizing with ADVANCED_OPTIMIZATIONS will fail because of accessing properties via unknown strings.
-JSWarnRuntimeNameLookupProblem=PERFORMANCE: Forced to emit expensive runtime name lookup. Consider using strict types instead of generic objects and avoiding dynamic classes.
-LocalBindablePropertyProblem=[${bindableStr}] ist innerhalb einer ${funcStr}sdefinition nicht zulässig.
-LossyConversionProblem=Ungültige Initialisierung: Konvertierung in Typ "${targetType}" führt zu Datenverlust.
-MethodCannotBeConstructorProblem=Methode kann nicht als Konstruktor verwendet werden.
-MissingBuiltinProblem=Fehlender integrierter Typ ${builtinType}
-MissingCatchOrFinallyProblem=Syntaxfehler: catch- oder finally-Klausel wird erwartet.
-MissingFactoryClassInFrameMetadataProblem=Für diese Kompilierungseinheit wurde keine factoryClass in den Frame-Metadaten angegeben, um die konfigurierten Runtime Shared Libraries zu laden. Um ohne Runtime Shared Libraries zu kompilieren, stellen Sie die Option "-static-link-runtime-shared-libraries" auf "true" ein oder entfernen Sie die Option "-runtime-shared-libraries".
-MissingRequirementConfigurationProblem=Konfigurationsvariable "${required}" wurde nicht festgelegt
-MissingSignedDigestProblem=Kein signierter Digest in catalog.xml der Bibliothek "${libraryPath}" gefunden.
-MissingSkinPartProblem=Der erforderliche Skinteil "${skinPartName}" fehlt.
-MissingSkinStateProblem=Der erforderliche Skinstatus "${skinStateName}" fehlt.
-MissingUnsignedDigestProblem=Kein nicht signierter Digest in catalog.xml der Bibliothek "${libraryPath}" gefunden.
-MultipleConfigNamespaceDecorationsProblem=Doppelte Konfigurationsnamespaces sind in einer Definition nicht zulässig
-MultipleSwitchDefaultsProblem=Für den Switch gibt es mehr als einen Standardwert, es ist jedoch nur einer zulässig.
-MXMLAttributeVersionProblem=Das ${name}-Attribut kann nur in MXML ${version} oder höher verwendet werden. Es wird ignoriert.
-MXMLClassNodeProblem="${qname}" gibt keine Klasse oder Schnittstelle an. Es wird ignoriert.
-MXMLDatabindingSourceNotBindableProblem=Die Datenbindung kann keine Zuweisungen zu "${sourceName}" erkennen.
-MXMLDuplicateIDProblem=Diese ID ist nicht eindeutig. Sie wird ignoriert.
-MXMLFinalClassProblem=${qname} ist eine finale Klasse und kann nicht als Root-Tag verwendet werden.
-MXMLIncludeInAndExcludeFromProblem=Die Attribute "includeIn" und "excludeFrom" können nicht im selben Tag angegeben werden. Beide werden ignoriert.
-MXMLIncompatibleArrayElementProblem=Ein Arrayelement des Typs "${actualType}" ist inkompatibel mit dem erwarteten [ArrayElementType] von "${expectedType}" für die ${propertyName}-Eigenschaft.
-MXMLIncompatibleVectorElementProblem=Dieses Element ist inkompatibel mit dem Vector-Typ. Es wird ignoriert.
-MXMLInvalidEntityProblem=Unbekannte Entität "${entity}" gefunden. Sie wird ignoriert.
-MXMLInvalidIDProblem=Diese ID ist kein gültiger ActionScript-Bezeichner. Sie wird ignoriert.
-MXMLInvalidItemCreationPolicyProblem=Gültige Werte für itemCreationPolicy sind "immediate" oder "deferred". Dieses Attribut wird ignoriert.
-MXMLInvalidItemDestructionPolicyProblem=Gültige Werte für itemDestructionPolicy sind "auto" oder "never". Dieses Attribut wird ignoriert.
-MXMLInvalidPercentageProblem=Initialisierer für "${property}": ungültiger Prozentausdruck: "${text}".
-MXMLInvalidTextForTypeProblem=Ein Wert des Typs "${type}" kann nicht aus "${text}" geparst werden.
-MXMLInvalidVectorFixedAttributeProblem=Das fixed-Attribut muss "true" oder "false" sein. Es wird ignoriert.
-MXMLInvalidVectorTypeAttributeProblem=Das type-Attribut gibt keine bekannte Klasse an. Der Typ wird als "*" angenommen.
-MXMLMissingRootTagProblem=In dieser MXML-Datei wurde kein Root-Tag gefunden.
-MXMLMissingVectorTypeAttributeProblem=Für ein <Vector>-Tag ist ein type-Attribut erforderlich. Der Typ wird als "*" angenommen.
-MXMLNotAClassProblem="${qname}" ist keine Klasse. Dieses Tag wird ignoriert.
-MXMLOperationMissingNameProblem=Für den Vorgang wird ein name-Attribut benötigt.
-MXMLOtherLanguageNamespaceProblem=In einem MXML-Dokument kann nur ein Sprachennamespace verwendet werden. Dieses Attribut wird ignoriert.
-MXMLOuterDocumentAlreadyDeclaredProblem=Eine Eigenschaft mit dem Namen "outerDocument" wurde bereits deklariert und steht in Konflikt mit dem fx:Component-Tag "outerDocument".
-MXMLPercentageNotAllowedProblem=Initialisierer für "${property}": Prozentwert hier nicht zulässig: "${text}".
-MXMLPrivateAttributeProblem=Dieses Attribut verwendet einen privaten Namespace und wird deshalb ignoriert.
-MXMLPrivateTagLocationProblem=Das <Private>-Tag muss das letzte untergeordnete Tag des Root-Tags der Datei sein. Es wird ignoriert.
-MXMLSemanticProblem=Internes Problem bei der semantischen MXML-Analyse
-MXMLUnexpectedAttributeProblem=Dieses Attribut ist unerwartet. Es wird ignoriert.
-MXMLUnexpectedDatabindingProblem=Dieser Datenbindungsausdruck ist unerwartet. Er wird ignoriert.
-MXMLUnexpectedTagProblem=Dieses Tag ist unerwartet. Es wird ignoriert.
-MXMLUnexpectedTextProblem=Dieser Text ist unerwartet. Er wird ignoriert.
-MXMLUnrecognizedCompilerDirectiveProblem=Die Funktion "${functionName}" ist keine bekannte Kompilierungszeitdirektive
-MXMLUnresolvedTagProblem=Dieses Tag konnte nicht zu einer ActionScript-Klasse aufgelöst werden. Es wird ignoriert.
-MXMLUnterminatedEntityProblem=Nicht beendete Einheit gefunden. Sie wird ignoriert.
-MXMLXMLListMixedContentProblem=Gemischte Inhalte sind hier nicht zulässig.
-MXMLXMLOnlyOneRootTagProblem=Es ist nur ein Root-Tag zulässig
-MXMLXMLRequireContentProblem=Es ist XML-Inhalt erforderlich
-NamespaceInInterfaceProblem=Namespacedeklarationen sind in Schnittstellen nicht zulässig.
-NativeMethodWithBodyProblem=Native Methoden können nicht über einen Hauptteil verfügen.
-NativeNotOnFunctionProblem=Das ${nativeStr}-Attribut kann nur mit ${functionStr}sdefinitionen verwendet werden.
-NativeUsedInInterfaceProblem=Das ${nativeStr}-Attribut kann nicht in ${interfStr}ndefinitionen verwendet werden.
-NativeVariableProblem=Variablen können nicht "${nativeStr}" sein.
-NestedGetterSetterProblem=Zugriffsmodule dürfen nicht in anderen Funktionen verschachtelt sein.
-NestedPackageProblem=Pakete dürfen nicht verschachtelt sein.
-NoCompilationUnitForDefinitionProblem=Es wurde keine Kompilierungseinheit mit dem Namen "${qname}" gefunden.
-NoDefaultConstructorInBaseClassProblem=Kein Standardkonstruktor in ${baseClass}-Basisklasse gefunden.
-NoDefinitionForSWCDependencyProblem=Die Definition "${qname}", von der die SWC-Datei "${swcFilename}" abhängig ist, wurde nicht gefunden
-NoMainDefinitionProblem=Es wurde keine extern sichtbare Definition mit dem Namen "${qname}" gefunden.
-NonConstantNamespaceProblem=Ein Namespaceinitialisierer muss entweder ein Literalstring oder ein anderer Namespace sein.
-NonConstantParamInitializerProblem=Parameterinitialisierer ist keine Konstante zur Kompilierungszeit.
-NonDirectoryInSourcePathProblem=${file} wurde im Quellpfad angegeben und ist kein Ordner.
-NoScopesInABCCompilationUnitProblem=In der Kompilierungseinheit wurden keine Gültigkeitsbereiche gefunden.
-OnlyOneHostComponentAllowedProblem=Es ist nur eine [HostComponent] zulässig.
-OverlappingSourcePathProblem=Überlappende Quellpfadeinträge: ${ancestor} ist ein Vorgängerelement von ${descendant}
-OverrideFinalProblem=Eine ${finalStr}e Methode kann nicht neu definiert werden.
-OverrideNotFoundProblem=Als "${overrideStr}" markierte Methode muss eine andere Methode überschreiben.
-OverrideOutsideClassProblem=Das ${overrideStr}-Attribut kann nur für Definitionen von ${classStr}neigenschaften verwendet werden.
-PackageCannotBeUsedAsValueProblem=Paket kann nicht als Wert verwendet werden: ${packageName}.
-ParserProblem=Internes Parsingproblem
-PropertyIsWriteOnlyProblem=${name}-Eigenschaft kann nur geschrieben werden.
-PrototypeInvalidAttributeProblem=Das prototype-Attribut ist ungültig.
-RemovedConfigurationOptionProblem="${option}" wird nicht mehr unterstützt und hat keine Auswirkungen.
-RequiredParameterAfterOptionalProblem=Erforderliche Parameter sind nach optionalen Parametern nicht zulässig.
-ResourceBundleMalformedEncodingProblem=Die Kodierung für den gegebenen String ist fehlerhaft strukturiert: ${string}
-ResourceBundleNoBundleParameterProblem=Kein bundle-Parameter für @Resource() angegeben
-ResourceBundleNoKeyParameterProblem=Kein key-Parameter für @Resource() angegeben
-ResourceBundleNotFoundForLocaleProblem=Ressourcenbundle "${bundleName}" kann nicht für Gebietsschema "${locale}" aufgelöst werden
-ResourceBundleNotFoundProblem=Ressourcenbundle "${bundleName}" kann nicht aufgelöst werden
-RestParameterMustBeLastProblem=Rest-Parameter müssen an letzter Stelle stehen.
-ReturnCannotBeUsedInGlobalProblem=Die return-Anweisung kann im globalen Initialisierungscode nicht verwendet werden.
-ReturnCannotBeUsedInPackageProblem=Die return-Anweisung kann im Initialisierungscode des Pakets nicht verwendet werden.
-ReturnCannotBeUsedInStaticProblem=Die return-Anweisung kann im statischen Initialisierungscode nicht verwendet werden.
-ReturnMustReturnValueProblem=Funktion gibt keinen Wert zurück.
-ReturnValueMustBeUndefinedProblem=Rückgabewert darf nicht definiert sein.
-SemanticProblem=Internes Problem bei der semantischen Analyse
-SetterCannotHaveOptionalProblem=Eine set-Definition darf nicht über optionale Parameter verfügen.
-SetterMustHaveOneParameterProblem=Eine set-Definition muss genau einen Parameter enthalten.
-SkinPartsMustBePublicProblem=Skinteile müssen öffentlich sein.
-StaticAndOverrideProblem=Funktionen können nicht "${staticStr}" und gleichzeitig "${overrideStr}" sein.
-StaticNamespaceDefinitionProblem=Das static-Attribut ist in ${namespaceKeyword}-Definitionen nicht zulässig.
-StaticOutsideClassProblem=Das ${staticStr}-Attribut kann nur für Definitionen innerhalb einer ${classStr} verwendet werden.
-StrictUndefinedMethodProblem=Aufruf einer möglicherweise nicht definierten ${methodName}-Methode über einen Verweis mit dem statischen Typ "${className}".
-SyntaxProblem=Syntaxfehler: "${tokenText}" ist hier nicht zulässig
-ThisUsedInStaticFunctionProblem=Dieses ${thisKeyword}-Schlüsselword kann in statischen Methoden nicht verwendet werden. Es kann nur in Instanzenmethoden, Funktionsabschlüssen und in globalem Code verwendet werden.
-TooFewFunctionParametersProblem=Falsche Anzahl Argumente. Erwartet wurden ${nParams}
-TooManyFunctionParametersProblem=Falsche Anzahl Argumente. Erwartet wurden nicht mehr als ${nParams}
-UnableToBuildReportProblem=Bericht konnte nicht erstellt werden: ${message}
-UnableToBuildSWFProblem=SWF-Datei "${file}" konnte nicht erstellt werden
-UnableToBuildSWFTagProblem=SFW-Tag für "${name}" konnte nicht erstellt werden
-UnableToListFilesProblem=Inhalt des Ordners kann nicht aufgelistet werden: @{directory}
-UnboundMetadataProblem=Metadaten wurden an keine Definition gebunden
-UndefinedConfigNameProblem=Nicht definierte Konfigurationskonstante: "${configName}"
-UndefinedConfigNamespaceProblem=Nicht definierter Konfigurationsnamespace: "${configName}"
-UnexpectedExceptionProblem=Unerwartete Ausnahme "${exceptionName}".
-UnexpectedReturnProblem=Die return-Anweisung kann hier nicht verwendet werden.
-UnexpectedTokenProblem=Syntaxfehler: Erwartet wurde "${tokenKind}", erhalten wurde jedoch "${tokenText}"
-UnfoundPropertyProblem=Zugriff auf nicht definierte ${property}-Eigenschaft
-UnimplementedInterfaceMethodProblem=${interfStr}nmethode ${methodName} in ${namespaceName}-${namespaceStr} nicht von ${className}-${classStr} implementiert
-UnknownBreakTargetProblem=Ziel der break-Anweisung wurde nicht gefunden.
-UnknownContinueTargetProblem=Ziel der continue-Anweisung wurde nicht gefunden.
-UnknownInterfaceProblem=${interfaceName}-${interfaceStr} wurde nicht gefunden.
-UnknownNamespaceProblem=Unbekannter ${namespaceName}-Namespace.
-UnknownSuperclassProblem=Die Definition der ${superclassName}-Basisklasse wurde nicht gefunden.
-UnknownTypeProblem=Typ wurde nicht gefunden oder war keine Konstante zur Kompilierungszeit: ${typeName}.
-UnresolvedClassReferenceProblem=Definition "${qname}" wurde nicht gefunden.
-UnresolvedNamespaceProblem=Namespace wurde nicht gefunden oder ist keine Konstante zur Kompilierungszeit.
-UnsupportedSourceFileProblem="${file}" weist nicht unterstützten Typ auf: ${ext}
-VarInInterfaceProblem=${varStr}-Deklarationen sind in ${interfStr} nicht zulässig.
-VoidTypeProblem=${voidStr} ist kein gültiger Typ.
-WrongSkinPartProblem=Der Skinteiltyp "${skinPartTypeName}" muss zu "${hostSkinPartTypeName}" zugewiesen werden können.

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_en.properties
----------------------------------------------------------------------
diff --git a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_en.properties b/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_en.properties
deleted file mode 100644
index 12f1ac5..0000000
--- a/compiler.js/localization/src/org/apache/flex/compiler/problems/Messages_en.properties
+++ /dev/null
@@ -1,283 +0,0 @@
-################################################################################
-##
-##  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.
-##
-################################################################################
-
-ABCGeneratorProblem=Internal error in ABC generator subsystem, when generating code for: ${sourceFileName}: ${stackTrace}
-AccessorTypesMustMatchProblem=Accessor types must match.
-AccessUndefinedMemberProblem=Access of possibly undefined property ${memberName} through a reference with static type ${className}.
-AccessUndefinedPropertyInPackageProblem=Access of undefined property ${propertyName} in package ${packageName}.
-AccessUndefinedPropertyProblem=Access of possibly undefined property ${propertyName}.
-AmbiguousReferenceProblem=Ambiguous reference to ${property}
-AssignToConstProblem=Illegal assignment to a variable specified as constant.
-AssignToFunctionProblem=Illegal assignment to function ${funcName}.
-AssignToReadOnlyPropertyProblem=Property ${name} is read-only.
-AttemptToDeleteFixedPropertyProblem=Attempt to delete the fixed property ${name}.  Only dynamically defined properties can be deleted.
-AttributesAreNotCallableProblem=Attributes are not callable.
-BadAccessInterfaceMemberProblem=Interface members cannot be declared public, private, protected, or internal.
-BadCharacterProblem=Unexpected char error: '${errorText}' is not allowed here
-BadSetterReturnTypeProblem=Return type of a setter definition must be unspecified or void.
-BaseClassIsFinalProblem=Base class is ${finalStr}.
-BURMDiagnosticForEachExpectedInProblem=the '${k_each}' keyword is not allowed without an '${k_in}' operator
-BURMDiagnosticInvalidDecrementProblem=Operand of decrement must be a reference.
-BURMDiagnosticNotAllowedHereProblem=${node} is not allowed here
-BURMPatternMatchFailureProblem=Unable to generate code for ${node}
-BURNDiagnosticInvalidIncrementProblem=Operand of increment must be a reference.
-CallUndefinedMethodProblem=Call to a possibly undefined method ${methodName}.
-CannotDeleteSuperDescendantsProblem=Cannot delete super descendants.
-CannotExtendClassProblem=An interface can only extend other interfaces, but ${className} is a class.
-CannotExtendInterfaceProblem=A ${classStr} can only extend another ${classStr}, not an ${interfaceStr}.
-CannotResolveConfigExpressionProblem=Can not resolve config constant: '${configName}'
-CircularTypeReferenceProblem=Circular type reference was detected in ${className}
-ClassesMappedToSameRemoteAliasProblem=A mapping for '${existingClassName}' to the remote class alias '${alias}' was found while processing class '${className}'. Flex now generates code to check if an alias has already been registered. When deserializing remote data an alias can only map to a single class.
-ClosureProblem=Closure error.
-CodegenInternalProblem=Code generator internal error: ${diagnostic}
-CompiledAsAComponentProblem=${className} is a module or application that is directly referenced. This will cause ${className} and all of its dependencies to be linked in with ${mainDefinition}. Using an interface is the recommended practice to avoid this.
-ConfigurationFileNotFoundProblem=Can't find config file: ${file}
-ConfigurationProblem=Configuration problem: ${reason}.\n${location}
-ConflictingInheritedNameInNamespaceProblem=A conflict exists with inherited definition ${declName} in namespace ${nsName}.
-ConflictingNameInNamespaceProblem=A conflict exists with definition ${declName} in namespace ${nsName}.
-ConstructorCannotHaveReturnTypeProblem=A Constructor cannot specify a return type
-ConstructorIsGetterSetterProblem=A constructor cannot be a getter or setter method
-ConstructorIsStaticProblem=Constructor functions must be instance methods
-ConstructorMustBePublicProblem=A constructor can only be declared ${modifier}
-CountedForLoopInitializerProblem=Syntax error: expecting semicolon before rightparen.
-CSSCodeGenProblem=CSS codegen problem. Reason: '${reason}'
-CSSEmbedAssetProblem=Can not embed asset from '${embed}'.
-CSSParserProblem=${reason}
-CSSUndefinedNamespacePrefixProblem=Undefined namespace prefix '${prefix}'.
-CSSUndefinedTypeProblem='${type}' is not defined.
-CSSUnknownDefaultNamespaceProblem=Type selector without namespace prefix requires a default namespace to be defined. ${selectorText}
-CSSUnresolvedClassReferenceProblem=${qname} is not defined.
-CyclicalIncludesProblem=Cyclical includes found in ${file}
-DependencyNotCompatibleProblem=The dependency ${definition} from ${swc} has a minimum supported version of ${swcMinimumVersion}, which is higher than the compatibility version, ${compatibilityVersion}.
-DeprecatedConfigurationOptionProblem='${option}' has been deprecated since ${since}. Please use '${replacement}'
-DuplicateAttributeProblem=Attribute ${attrStr} was specified multiple times.
-DuplicateClassDefinitionProblem=Duplicate class definition: ${className}.
-DuplicateConfigNameProblem=Duplicate config namespace: '${configName}'
-DuplicateFunctionDefinitionProblem=Duplicate function definition: ${methodName}
-DuplicateInterfaceDefinitionProblem=Duplicate interface definition: ${interfaceName}.
-DuplicateInterfaceProblem=${classStr} ${className} implements ${interfaceStr} ${interfaceName} multiple times.
-DuplicateLabelProblem=Duplicate label definition.
-DuplicateNamespaceDefinitionProblem=Duplicate namespace definition.
-DuplicateQNameInSourcePathProblem=${qName} is defined by multiple files: ${fileList} 
-DuplicateSkinStateProblem=Duplicate declaration of SkinState '${name}'
-DuplicateSourceFileProblem=${file} was specified more than once in the include sources list.
-DuplicateSourcePathProblem=${directory} was specified more than once in the source path.
-DuplicateSwitchCaseProblem=Duplicate switch alternative ${caseName}.
-DynamicNotOnClassProblem=The ${dynamicStr} attribute can only be used with ${classStr} definitions.
-EmbedAS2TagsModifiedProblem=AS2 actions have been removed from the ${symbol} tag
-EmbedBadFontParameters=font transcoding requires you to specify 'fontName' and one of 'source', 'systemFont', or 'sourceList'
-EmbedBadScalingGridTargetProblem=Could not scale the symbol ${symbol} as it is not of type Sprite
-EmbedCouldNotDetermineSampleFrameCountProblem=Could not determine the sample frame count in file ${filename}
-EmbeddedFontShadowsDeviceFontProblem=the embedded font '${alias}' may shadow a device font of the same name.  Use fontName to alias the font to a different name
-EmbedExceptionWhileTranscodingProblem=exception during transcoding: ${exception}
-EmbedInitialValueProblem=An Embed variable must not have an existing value.
-EmbedInvalidAttributeValueProblem=The value ${value} is invalid for attribute ${attribute}
-EmbedInvalidUnicodeRangeProblem=invalid Unicode range '${range}'
-EmbedMissingSymbolProblem=Could not find the symbol ${symbol} in the file ${swf}
-EmbedMovieScalingNoSymbolProblem=Specify a symbol when scaling an embedded movie
-EmbedMultipleMetaTagsProblem=A variable can only only have one Embed meta data tag
-EmbedNoSkinClassProblem=Must specify a skinClass attribute when embedding skin assets
-EmbedNoSourceAttributeProblem=Embed requires a source file attribute
-EmbedQualityRequiresCompressionProblem=Don't specify quality when compression is disabled
-EmbedQualityValueProblem=The value ${value} is invalid for the quality attribute. It must be between 0.0 and 100.0
-EmbedScalingGridProblem=attributes scaleBottom, scaleLeft, scaleRight and scaleTop must be specified together
-EmbedScalingGridValueProblem=The scaling value ${value} must be greater than 0 for attribute ${attr}
-EmbedSkinClassNotFoundProblem=Class ${skinClass} could not be found
-EmbedSourceAttributeCouldNotBeReadProblem=Embed source file ${filename} could not be read
-EmbedSourceAttributeDoesNotExistProblem=Embed source file could not be found
-EmbedSourceFileNotFoundProblem=Can't find Embed source file: ${file}
-EmbedTypeNotEmbeddableProblem=Type ${typeName} cannot be embedded
-EmbedUnableToBuildFontProblem=unable to build font '${fontName}'
-EmbedUnableToReadSourceProblem=unable to read transcoding source '${source}'
-EmbedUnknownAttributeProblem=Unknown attribute: ${attr}
-EmbedUnknownMimeTypeProblem=Unhandled mimetype ${mimeType}
-EmbedUnrecogniedFileTypeProblem=File ${file} is of an unknown file type which can't be embedded
-EmbedUnsupportedAttributeProblem=The attribute ${attribute} can't be used with the mime type: ${mimeType}
-EmbedUnsupportedSamplingRateProblem=The frequency ${frequency} is not supported in file ${filename}
-FileNotFoundProblem=File not found: ${file}
-FinalOutsideClassProblem=The attribute ${finalStr} can only be used on a method defined in a ${classStr}.
-FunctionNotMarkedOverrideProblem=Overriding a ${funcStr} that is not marked for ${overrideStr}
-FunctionWithoutBodyProblem=Function does not have a body.
-FXGCompilerProblem=FXG Compilation Problem: ${message}
-GetterCannotHaveParametersProblem=A getter definition must have no parameters.
-GlobalBindablePropertyProblem=[${bindableStr}] not allowed on global or ${packageStr} variables
-HostComponentClassNotFoundProblem=[HostComponent] class '${className}' not found.
-HostComponentMustHaveTypeProblem=[HostComponent] must specify a type name.
-IllegalAssignmentToClassProblem=Illegal assignment to class ${className}.
-ImplicitCoercionToSubtypeProblem=Implicit coercion of a value with static type ${baseType} to a possibly unrelated type ${subType}.
-ImplicitCoercionToUnrelatedTypeProblem=Implicit coercion of a value of type ${actualType} to an unrelated type ${expectedType}.
-InaccessibleMethodReferenceProblem=Attempted access of inaccessible method ${methodName} through a reference with static type ${className}.
-InaccessiblePropertyReferenceProblem=Attempted access of inaccessible property ${propertyName} through a reference with static type ${className}.
-IncompatibleDefaultValueProblem=Incompatible default value of type ${srcType} where ${tgtType} is expected.
-IncompatibleInterfaceMethodProblem=${interfStr} method ${methodName} in ${namespaceStr} ${namespaceName} is implemented with an incompatible signature in ${classStr} ${className}
-IncompatibleOverrideProblem=Incompatible ${overrideStr}.
-InterfaceBindablePropertyProblem=[${bindableStr}] is not allowed inside a ${interfStr} definition.
-InterfaceCannotBeInstantiatedProblem=Interfaces cannot be instantiated with the new operator.
-InterfaceMethodWithBodyProblem=Methods defined in an ${interfaceStr} must not have a body.
-InterfaceModifierProblem=Interface attribute ${modifier} is invalid.
-InterfaceNamespaceAttributeProblem=Namespace attributes are not permitted on interface methods.
-InternalCompilerProblem=Internal compiler error
-InvalidABCByteCodeProblem=Invalid ABC byte code.
-InvalidBackgroundColorProblem=Invalid background color: ${backgroundColor}
-InvalidDecrementOperandProblem=Decrement operand is invalid.
-InvalidEscapeSequenceProblem='${badSequence}' is not a valid escape sequence
-InvalidForInInitializerProblem=Syntax error: invalid for-in initializer, only 1 expression expected.
-InvalidIncrementOperandProblem=Increment operand is invalid.
-InvalidLvalueProblem=Target of assignment must be a reference value.
-InvalidNamespaceInitializerProblem=A namespace initializer must be either a literal string or another namespace.
-InvalidNamespaceProblem=A user-defined namespace attribute can only be used at the top level of a ${classStr} definition.
-InvalidOverrideProblem=The ${overrideStr} attribute can only be used on a method defined in a ${classStr}.
-InvalidPrivateNamespaceAttrProblem=The ${privateStr} attribute may be used only on ${classStr} property definitions.
-InvalidPrivateNamespaceProblem=${privateStr} can only be used as a namespace inside a ${classStr}.
-InvalidProtectedNamespaceAttrProblem=The ${protectedStr} attribute may be used only on ${classStr} property definitions.
-InvalidProtectedNamespaceProblem=${protectedStr} can only be used as a namespace inside a ${classStr}.
-InvalidPublicNamespaceAttrProblem=The ${publicStr} attribute can only be used inside a ${packageStr}.
-InvalidPublicNamespaceProblem=${publicStr} can only be used as a namespace inside a ${packageStr}.
-InvalidRestParameterDeclarationProblem=Parameters specified after the ...rest parameter definition keyword can only be an Array data type.
-InvalidSuperExpressionProblem=A super expression can be used only inside class instance methods.
-InvalidSuperStatementProblem=A super statement can be used only inside class instance constructors.
-JSDataClassMethodError=ERROR: DataClass classes must not declare methods. 
-JSInternalCompilerProblem=Internal compiler error: ${message}. 
-JSUnsupportedFeatureProblem=Unsupported feature: ${feature}. 
-JSWarnClassInitProblem=PERFORMANCE: Avoid loose class initialization statements. Consider using singletons instead.
-JSWarnClosureAdvancedOptimizationsProblem=WARNING: Optimizing with ADVANCED_OPTIMIZATIONS will fail because of accessing properties via unknown strings.
-JSWarnRuntimeNameLookupProblem=PERFORMANCE: Forced to emit expensive runtime name lookup. Consider using strict types instead of generic objects and avoiding dynamic classes.
-LocalBindablePropertyProblem=[${bindableStr}] is not allowed inside a ${funcStr} definition.
-LossyConversionProblem=Invalid initialization: conversion to type ${targetType} loses data.
-MethodCannotBeConstructorProblem=Method cannot be used as a constructor.
-MissingBuiltinProblem=Missing builtin type ${builtinType}
-MissingCatchOrFinallyProblem=Syntax error: expecting a catch or a finally clause.
-MissingFactoryClassInFrameMetadataProblem=This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option.
-MissingRequirementConfigurationProblem=configuration variable '${required}' was not set
-MissingSignedDigestProblem=No signed digest found in catalog.xml of the library, ${libraryPath}.
-MissingSkinPartProblem=The required skin part '${skinPartName}' is missing.
-MissingSkinStateProblem=The required skin state '${skinStateName}' is missing.
-MissingUnsignedDigestProblem=No unsigned digest found in catalog.xml of the library, ${libraryPath}.
-MultipleConfigNamespaceDecorationsProblem=Duplicate config namespaces are not allowed on a definition
-MultipleSwitchDefaultsProblem=The switch has more than one default, but only one default is allowed.
-MXMLAttributeVersionProblem=The '${name}' attribute can only be used in MXML ${version} or later. It will be ignored.
-MXMLClassNodeProblem='${qname}' does not specify a class or interface. It will be ignored.
-MXMLDatabindingSourceNotBindableProblem=Data binding will not be able to detect assignments to '${sourceName}'.
-MXMLDuplicateIDProblem=This id is not unique. It will be ignored.
-MXMLFinalClassProblem='${qname}' is a final class and cannot be used as root tag.
-MXMLIncludeInAndExcludeFromProblem=The 'includeIn' and 'excludeFrom' attributes cannot be specified on this same tag. Both will be ignored.
-MXMLIncompatibleArrayElementProblem=An array element of type '${actualType}' is incompatible with the expected [ArrayElementType] of '${expectedType}' for the '${propertyName}' property.
-MXMLIncompatibleVectorElementProblem=This element is incompatible with the Vector type. It will be ignored.
-MXMLInvalidEntityProblem=Unknown entity '{entity}' found. It will be ignored.
-MXMLInvalidIDProblem=This id is not a valid ActionScript identifier. It will be ignored.
-MXMLInvalidItemCreationPolicyProblem=Valid values for itemCreationPolicy are 'immediate' or 'deferred'. This attribute will be ignored.
-MXMLInvalidItemDestructionPolicyProblem=Valid values for itemDestructionPolicy are 'auto' or 'never'. This attribute will be ignored.
-MXMLInvalidPercentageProblem=Initializer for '${property}': invalid percentage expression: '${text}'.
-MXMLInvalidTextForTypeProblem=Cannot parse a value of type '${type}' from '${text}'.
-MXMLInvalidVectorFixedAttributeProblem=The 'fixed' attribute must be 'true' or 'false'. It will be ignored.
-MXMLInvalidVectorTypeAttributeProblem=The 'type' attribute does not specify a known class. The type will be assumed to be '*'.
-MXMLMissingRootTagProblem=No root tag found in this MXML file.
-MXMLMissingVectorTypeAttributeProblem=A 'type' attribute is required on a <Vector> tag. The type will be assumed to be '*'.
-MXMLNotAClassProblem='${qname}' is not a class. This tag will be ignored.
-MXMLOperationMissingNameProblem=Operation requires a name attribute.
-MXMLOtherLanguageNamespaceProblem=Only one language namespace may be used in an MXML document. This attribute will be ignored.
-MXMLOuterDocumentAlreadyDeclaredProblem=A property named outerDocument has already been declared, conflicting with the fx:Component tag outerDocument.
-MXMLPercentageNotAllowedProblem=Initializer for '${property}': percentage not allowed here: '${text}'.
-MXMLPrivateAttributeProblem=This attribute uses a private namespace and therefore will be ignored.
-MXMLPrivateTagLocationProblem=The <Private> tag must be the last child tag of the file's root tag. It will be ignored.
-MXMLSemanticProblem=Internal problem during semantic analysis of MXML
-MXMLUnexpectedAttributeProblem=This attribute is unexpected. It will be ignored.
-MXMLUnexpectedDatabindingProblem=This databinding expression is unexpected. It will be ignored.
-MXMLUnexpectedTagProblem=This tag is unexpected. It will be ignored.
-MXMLUnexpectedTextProblem=This text is unexpected. It will be ignored.
-MXMLUnrecognizedCompilerDirectiveProblem=Function ${functionName} is not a recognized compile-time directive
-MXMLUnresolvedTagProblem=This tag could not be resolved to an ActionScript class. It will be ignored.
-MXMLUnterminatedEntityProblem=Unterminated entity found. It will be ignored.
-MXMLXMLListMixedContentProblem=Mixed content not allowed here.
-MXMLXMLOnlyOneRootTagProblem=Only one root tag is allowed
-MXMLXMLRequireContentProblem=XML content is required
-NamespaceInInterfaceProblem=Namespace declarations are not permitted in interfaces.
-NativeMethodWithBodyProblem=Native methods cannot have a body.
-NativeNotOnFunctionProblem=The ${nativeStr} attribute can only be used with ${functionStr} definitions.
-NativeUsedInInterfaceProblem=The ${nativeStr} attribute cannot be used in ${interfStr} definitions.
-NativeVariableProblem=Variables cannot be ${nativeStr}.
-NestedGetterSetterProblem=Accessors cannot be nested inside other functions.
-NestedPackageProblem=Packages cannot be nested.
-NoCompilationUnitForDefinitionProblem=No compilation unit with the name '${qname}' was found.
-NoDefaultConstructorInBaseClassProblem=No default constructor found in base class ${baseClass}.
-NoDefinitionForSWCDependencyProblem=The definition ${qname} depended on in the SWC ${swcFilename} could not be found
-NoMainDefinitionProblem=No externally-visible definition with the name '${qname}' was found.
-NonConstantNamespaceProblem=A namespace initializer must be either a literal string or another namespace.
-NonConstantParamInitializerProblem=Parameter initializer unknown or is not a compile-time constant.
-NonDirectoryInSourcePathProblem=${file} was specified in the source path and is not a directory.
-NoScopesInABCCompilationUnitProblem=Can't find scopes in the compilation unit.
-OnlyOneHostComponentAllowedProblem=Only one [HostComponent] allowed.
-OverlappingSourcePathProblem=Overlapping source path entries: ${ancestor} is an ancestor of ${descendant}
-OverrideFinalProblem=Cannot redefine a ${finalStr} method.
-OverrideNotFoundProblem=Method marked ${overrideStr} must ${overrideStr} another method.
-OverrideOutsideClassProblem=The ${overrideStr} attribute may be used only on ${classStr} property definitions.
-PackageCannotBeUsedAsValueProblem=Package cannot be used as a value: ${packageName}.
-ParserProblem=Internal parsing problem
-PropertyIsWriteOnlyProblem=Property ${name} is write-only.
-PrototypeInvalidAttributeProblem=The prototype attribute is invalid.
-RemovedConfigurationOptionProblem='${option}' is no longer supported and will have no effect.
-RequiredParameterAfterOptionalProblem=Required parameters are not permitted after optional parameters.
-ResourceBundleMalformedEncodingProblem=The encoding for the given string is malformed: ${string}
-ResourceBundleNoBundleParameterProblem=No bundle parameter given for @Resource()
-ResourceBundleNoKeyParameterProblem=No key parameter given for @Resource()
-ResourceBundleNotFoundForLocaleProblem=Unable to resolve resource bundle '${bundleName}' for locale '${locale}'
-ResourceBundleNotFoundProblem=Unable to resolve resource bundle '${bundleName}'
-RestParameterMustBeLastProblem=Rest parameters must be last.
-ReturnCannotBeUsedInGlobalProblem=The return statement cannot be used in global initialization code.
-ReturnCannotBeUsedInPackageProblem=The return statement cannot be used in package initialization code.
-ReturnCannotBeUsedInStaticProblem=The return statement cannot be used in static initialization code.
-ReturnMustReturnValueProblem=Function does not return a value.
-ReturnValueMustBeUndefinedProblem=Return value must be undefined.
-SemanticProblem=Internal problem during semantic analysis
-SetterCannotHaveOptionalProblem=A setter definition cannot have optional parameters.
-SetterMustHaveOneParameterProblem=A setter definition must have exactly one parameter.
-SkinPartsMustBePublicProblem=Skin parts must be public.
-StaticAndOverrideProblem=Functions cannot be both ${staticStr} and ${overrideStr}.
-StaticNamespaceDefinitionProblem=The static attribute is not allowed on ${namespaceKeyword} definitions.
-StaticOutsideClassProblem=The ${staticStr} attribute may be used only on definitions inside a ${classStr}.
-StrictUndefinedMethodProblem=Call to a possibly undefined method ${methodName} through a reference with static type ${className}.
-SyntaxProblem=Syntax error: '${tokenText}' is not allowed here
-ThisUsedInStaticFunctionProblem=The ${thisKeyword} keyword can not be used in static methods. It can only be used in instance methods, function closures, and global code.
-TooFewFunctionParametersProblem=Incorrect number of arguments.  Expected ${nParams}
-TooManyFunctionParametersProblem=Incorrect number of arguments.  Expected no more than ${nParams}
-UnableToBuildReportProblem=Unable to build report: ${message}
-UnableToBuildSWFProblem=Unable to build SWF ${file}
-UnableToBuildSWFTagProblem=Unable to build SWF tag for ${name}
-UnableToListFilesProblem=Unable to list contents of directory: @{directory}
-UnboundMetadataProblem=Metadata was not bound to a definition
-UndefinedConfigNameProblem=Undefined config constant: '${configName}'
-UndefinedConfigNamespaceProblem=Undefined config namespace: '${configName}'
-UnexpectedExceptionProblem=Unexpected exception '${exceptionName}'.
-UnexpectedReturnProblem=The return statement cannot be used here.
-UnexpectedTokenProblem=Syntax error: Expected ${tokenKind} but got '${tokenText}'
-UnfoundPropertyProblem=Access of undefined property ${property}
-UnimplementedInterfaceMethodProblem=${interfStr} method ${methodName} in ${namespaceStr} ${namespaceName} not implemented by ${classStr} ${className}
-UnknownBreakTargetProblem=Target of break statement was not found.
-UnknownContinueTargetProblem=Target of continue statement was not found.
-UnknownInterfaceProblem=${interfaceStr} ${interfaceName} was not found.
-UnknownNamespaceProblem=Unknown namespace ${namespaceName}.
-UnknownSuperclassProblem=The definition of base class ${superclassName} was not found.
-UnknownTypeProblem=Type was not found or was not a compile-time constant: ${typeName}.
-UnresolvedClassReferenceProblem=Definition ${qname} could not be found.
-UnresolvedNamespaceProblem=Namespace was not found or is not a compile-time constant.
-UnsupportedSourceFileProblem=${file} is of an unsupported type: ${ext}
-VarInInterfaceProblem=${varStr} declarations are not permitted in ${interfStr}.
-VoidTypeProblem=${voidStr} is not a valid type.
-WrongSkinPartProblem=The skin part type '${skinPartTypeName}' must be assignable to '${hostSkinPartTypeName}'.
-


[46/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
new file mode 100644
index 0000000..875d1d2
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java
@@ -0,0 +1,1540 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import java.io.FilterWriter;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.IEmitter;
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.common.IImportTarget;
+import org.apache.flex.compiler.common.ModifiersSet;
+import org.apache.flex.compiler.constants.IASKeywordConstants;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.definitions.IPackageDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.definitions.IVariableDefinition;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.tree.as.ChainedVariableNode;
+import org.apache.flex.compiler.internal.tree.as.ContainerNode;
+import org.apache.flex.compiler.internal.tree.as.FunctionNode;
+import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IAccessorNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.ICatchNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IConditionalNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IContainerNode.ContainerType;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IFunctionObjectNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IIfNode;
+import org.apache.flex.compiler.tree.as.IImportNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.IIterationFlowNode;
+import org.apache.flex.compiler.tree.as.IKeywordNode;
+import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
+import org.apache.flex.compiler.tree.as.ILiteralContainerNode;
+import org.apache.flex.compiler.tree.as.ILiteralNode;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.INamespaceAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.INamespaceNode;
+import org.apache.flex.compiler.tree.as.INumericLiteralNode;
+import org.apache.flex.compiler.tree.as.IObjectLiteralValuePairNode;
+import org.apache.flex.compiler.tree.as.IOperatorNode;
+import org.apache.flex.compiler.tree.as.IPackageNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.IReturnNode;
+import org.apache.flex.compiler.tree.as.IScopedNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.apache.flex.compiler.tree.as.IStatementNode;
+import org.apache.flex.compiler.tree.as.ISwitchNode;
+import org.apache.flex.compiler.tree.as.ITerminalNode;
+import org.apache.flex.compiler.tree.as.ITernaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IThrowNode;
+import org.apache.flex.compiler.tree.as.ITryNode;
+import org.apache.flex.compiler.tree.as.ITypeNode;
+import org.apache.flex.compiler.tree.as.ITypedExpressionNode;
+import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IUseNamespaceNode;
+import org.apache.flex.compiler.tree.as.IVariableExpressionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.tree.as.IWhileLoopNode;
+import org.apache.flex.compiler.tree.as.IWithNode;
+import org.apache.flex.compiler.tree.metadata.IMetaTagNode;
+import org.apache.flex.compiler.utils.ASNodeUtils;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.as.IASBlockWalker;
+
+/**
+ * The base implementation for an ActionScript emitter.
+ * 
+ * @author Michael Schmalle
+ */
+public class ASEmitter implements IASEmitter, IEmitter
+{
+    private final FilterWriter out;
+
+    private boolean bufferWrite;
+
+    protected boolean isBufferWrite()
+    {
+        return bufferWrite;
+    }
+
+    public void setBufferWrite(boolean value)
+    {
+        bufferWrite = value;
+    }
+
+    private StringBuilder builder;
+
+    protected StringBuilder getBuilder()
+    {
+        return builder;
+    }
+
+    protected void setBuilder(StringBuilder sb)
+    {
+        builder = sb;
+    }
+    
+    protected void flushBuilder()
+    {
+        setBufferWrite(false);
+        write(builder.toString());
+        builder.setLength(0);
+    }
+
+    // (mschmalle) think about how this should be implemented, we can add our
+    // own problems to this, they don't just have to be parse problems
+    public List<ICompilerProblem> getProblems()
+    {
+        return walker.getErrors();
+    }
+
+    private int currentIndent = 0;
+
+    protected int getCurrentIndent()
+    {
+        return currentIndent;
+    }
+
+    protected void writeIndent()
+    {
+        write(ASEmitterTokens.INDENT);
+    }
+
+    private IASBlockWalker walker;
+
+    @Override
+    public IBlockWalker getWalker()
+    {
+        return walker;
+    }
+
+    @Override
+    public void setWalker(IBlockWalker value)
+    {
+        walker = (IASBlockWalker) value;
+    }
+
+    @Override
+    public IDocEmitter getDocEmitter()
+    {
+        return null;
+    }
+
+    @Override
+    public void setDocEmitter(IDocEmitter value)
+    {
+    }
+    
+    private int currentLine = 0;
+
+    protected int getCurrentLine()
+    {
+        return currentLine;
+    }
+
+    private int currentColumn = 0;
+
+    protected int getCurrentColumn()
+    {
+        return currentColumn;
+    }
+
+    public ASEmitter(FilterWriter out)
+    {
+        this.out = out;
+        builder = new StringBuilder();
+    }
+
+    @Override
+    public String postProcess(String output)
+    {
+    	return output;
+    }
+    
+    @Override
+    public void write(IEmitterTokens value)
+    {
+        write(value.getToken());
+    }
+
+    @Override
+    public void write(String value)
+    {
+        try
+        {
+            int newLineCount = value.length() - value.replace("\n", "").length();
+            currentLine += newLineCount;
+            if (newLineCount > 0)
+            {
+                currentColumn = value.length() - value.lastIndexOf("\n") - 1;
+            }
+            else
+            {
+                currentColumn += value.length();
+            }
+            if (!bufferWrite)
+                out.write(value);
+            else
+                builder.append(value);
+        }
+        catch (IOException e)
+        {
+            throw new RuntimeException(e);
+        }
+    }
+
+    protected String getIndent(int numIndent)
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < numIndent; i++)
+            sb.append(ASEmitterTokens.INDENT.getToken());
+        return sb.toString();
+    }
+
+    @Override
+    public void indentPush()
+    {
+        currentIndent++;
+    }
+
+    @Override
+    public void indentPop()
+    {
+        currentIndent--;
+    }
+
+    @Override
+    public void writeNewline()
+    {
+        write(ASEmitterTokens.NEW_LINE);
+        write(getIndent(currentIndent));
+    }
+
+    @Override
+    public void writeNewline(IEmitterTokens value)
+    {
+        writeNewline(value.getToken());
+    }
+
+    @Override
+    public void writeNewline(String value)
+    {
+        write(value);
+        writeNewline();
+    }
+
+    @Override
+    public void writeNewline(IEmitterTokens value, boolean pushIndent)
+    {
+        writeNewline(value.getToken(), pushIndent);
+    }
+
+    @Override
+    public void writeNewline(String value, boolean pushIndent)
+    {
+        if (pushIndent)
+            indentPush();
+        else
+            indentPop();
+        write(value);
+        writeNewline();
+    }
+
+    public void writeSymbol(String value)
+    {
+        write(value);
+    }
+
+    @Override
+    public void writeToken(IEmitterTokens value)
+    {
+        writeToken(value.getToken());
+    }
+
+    @Override
+    public void writeToken(String value)
+    {
+        write(value);
+        write(ASEmitterTokens.SPACE);
+    }
+
+    //--------------------------------------------------------------------------
+    // IPackageNode
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitImport(IImportNode node)
+    {
+        IImportTarget target = node.getImportTarget();
+        writeToken(ASEmitterTokens.IMPORT);
+        write(target.toString());
+    }
+
+    @Override
+    public void emitPackageHeader(IPackageDefinition definition)
+    {
+        write(ASEmitterTokens.PACKAGE);
+
+        IPackageNode node = definition.getNode();
+        String name = node.getQualifiedName();
+        if (name != null && !name.equals(""))
+        {
+            write(ASEmitterTokens.SPACE);
+            getWalker().walk(node.getNameExpressionNode());
+        }
+
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.BLOCK_OPEN);
+    }
+
+    @Override
+    public void emitPackageHeaderContents(IPackageDefinition definition)
+    {
+    }
+
+    @Override
+    public void emitPackageContents(IPackageDefinition definition)
+    {
+        IPackageNode node = definition.getNode();
+        ITypeNode tnode = EmitterUtils.findTypeNode(node);
+        if (tnode != null)
+        {
+            indentPush();
+            writeNewline();
+            getWalker().walk(tnode); // IClassNode | IInterfaceNode
+        }
+    }
+
+    @Override
+    public void emitPackageFooter(IPackageDefinition definition)
+    {
+        indentPop();
+        writeNewline();
+        write(ASEmitterTokens.BLOCK_CLOSE);
+    }
+
+    //--------------------------------------------------------------------------
+    // 
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitClass(IClassNode node)
+    {
+        writeToken(node.getNamespace());
+
+        if (node.hasModifier(ASModifier.FINAL))
+        {
+            writeToken(ASEmitterTokens.FINAL);
+        }
+        else if (node.hasModifier(ASModifier.DYNAMIC))
+        {
+            writeToken(ASEmitterTokens.DYNAMIC);
+        }
+
+        writeToken(ASEmitterTokens.CLASS);
+        getWalker().walk(node.getNameExpressionNode());
+        write(ASEmitterTokens.SPACE);
+
+        IExpressionNode bnode = node.getBaseClassExpressionNode();
+        if (bnode != null)
+        {
+            writeToken(ASEmitterTokens.EXTENDS);
+            getWalker().walk(bnode);
+            write(ASEmitterTokens.SPACE);
+        }
+
+        IExpressionNode[] inodes = node.getImplementedInterfaceNodes();
+        final int ilen = inodes.length;
+        if (ilen != 0)
+        {
+            writeToken(ASEmitterTokens.IMPLEMENTS);
+            for (int i = 0; i < ilen; i++)
+            {
+                getWalker().walk(inodes[i]);
+                if (i < ilen - 1)
+                {
+                    writeToken(ASEmitterTokens.COMMA);
+                }
+            }
+            write(ASEmitterTokens.SPACE);
+        }
+
+        write(ASEmitterTokens.BLOCK_OPEN);
+
+        // fields, methods, namespaces
+        final IDefinitionNode[] members = node.getAllMemberNodes();
+        if (members.length > 0)
+        {
+            indentPush();
+            writeNewline();
+
+            final int len = members.length;
+            int i = 0;
+            for (IDefinitionNode mnode : members)
+            {
+                getWalker().walk(mnode);
+                if (mnode.getNodeID() == ASTNodeID.VariableID)
+                {
+                    write(ASEmitterTokens.SEMICOLON);
+                    if (i < len - 1)
+                        writeNewline();
+                }
+                else if (mnode.getNodeID() == ASTNodeID.FunctionID)
+                {
+                    if (i < len - 1)
+                        writeNewline();
+                }
+                else if (mnode.getNodeID() == ASTNodeID.GetterID
+                        || mnode.getNodeID() == ASTNodeID.SetterID)
+                {
+                    if (i < len - 1)
+                        writeNewline();
+                }
+                i++;
+            }
+
+            indentPop();
+        }
+
+        writeNewline();
+        write(ASEmitterTokens.BLOCK_CLOSE);
+    }
+
+    @Override
+    public void emitInterface(IInterfaceNode node)
+    {
+        writeToken(node.getNamespace());
+
+        writeToken(ASEmitterTokens.INTERFACE);
+        getWalker().walk(node.getNameExpressionNode());
+        write(ASEmitterTokens.SPACE);
+
+        IExpressionNode[] inodes = node.getExtendedInterfaceNodes();
+        final int ilen = inodes.length;
+        if (ilen != 0)
+        {
+            writeToken(ASEmitterTokens.EXTENDS);
+            for (int i = 0; i < ilen; i++)
+            {
+                getWalker().walk(inodes[i]);
+                if (i < ilen - 1)
+                {
+                    writeToken(ASEmitterTokens.COMMA);
+                }
+            }
+            write(ASEmitterTokens.SPACE);
+        }
+
+        write(ASEmitterTokens.BLOCK_OPEN);
+
+        final IDefinitionNode[] members = node.getAllMemberDefinitionNodes();
+        if (members.length > 0)
+        {
+            indentPush();
+            writeNewline();
+
+            final int len = members.length;
+            int i = 0;
+            for (IDefinitionNode mnode : members)
+            {
+                getWalker().walk(mnode);
+                write(ASEmitterTokens.SEMICOLON);
+                if (i < len - 1)
+                    writeNewline();
+                i++;
+            }
+
+            indentPop();
+        }
+
+        writeNewline();
+        write(ASEmitterTokens.BLOCK_CLOSE);
+    }
+
+    //--------------------------------------------------------------------------
+    // 
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitVarDeclaration(IVariableNode node)
+    {
+        if (!(node instanceof ChainedVariableNode))
+        {
+            emitMemberKeyword(node);
+        }
+
+        emitDeclarationName(node);
+        emitType(node.getVariableTypeNode());
+        
+        IExpressionNode avnode = node.getAssignedValueNode();
+        if (avnode != null)
+        {
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            emitAssignedValue(avnode);
+        }
+
+        if (!(node instanceof ChainedVariableNode))
+        {
+            // check for chained variables
+            int len = node.getChildCount();
+            for (int i = 0; i < len; i++)
+            {
+                IASNode child = node.getChild(i);
+                if (child instanceof ChainedVariableNode)
+                {
+                    writeToken(ASEmitterTokens.COMMA);
+                    emitVarDeclaration((IVariableNode) child);
+                }
+            }
+        }
+
+        // the client such as IASBlockWalker is responsible for the 
+        // semi-colon and newline handling
+    }
+
+    //--------------------------------------------------------------------------
+    // 
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitFieldDocumentation(IVariableNode node)
+    {
+    }
+
+    @Override
+    public void emitField(IVariableNode node)
+    {
+        emitFieldDocumentation(node);
+
+        IVariableDefinition definition = (IVariableDefinition) node
+                .getDefinition();
+
+        if (!(node instanceof ChainedVariableNode))
+        {
+            emitNamespaceIdentifier(node);
+            emitModifiers(definition);
+            emitMemberKeyword(node);
+        }
+
+        emitMemberName(node);
+        emitType(node.getVariableTypeNode());
+
+        IExpressionNode avnode = node.getAssignedValueNode();
+        if (avnode != null)
+        {
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            emitAssignedValue(avnode);
+        }
+
+        if (!(node instanceof ChainedVariableNode))
+        {
+            // check for chained variables
+            int len = node.getChildCount();
+            for (int i = 0; i < len; i++)
+            {
+                IASNode child = node.getChild(i);
+                if (child instanceof ChainedVariableNode)
+                {
+                    writeToken(ASEmitterTokens.COMMA);
+                    emitField((IVariableNode) child);
+                }
+            }
+        }
+
+        // the client such as IASBlockWalker is responsible for the 
+        // semi-colon and newline handling
+    }
+
+    //--------------------------------------------------------------------------
+    // 
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitMethodDocumentation(IFunctionNode node)
+    {
+    }
+
+    @Override
+    public void emitMethod(IFunctionNode node)
+    {
+        // see below, this is temp, I don't want a bunch of duplicated code
+        // at them moment, subclasses can refine anyways, we are generalizing
+        if (node instanceof IGetterNode)
+        {
+            emitGetAccessorDocumentation((IGetterNode) node);
+        }
+        else if (node instanceof ISetterNode)
+        {
+            emitSetAccessorDocumentation((ISetterNode) node);
+        }
+        else
+        {
+            emitMethodDocumentation(node);
+        }
+
+        FunctionNode fn = (FunctionNode) node;
+        fn.parseFunctionBody(getProblems());
+
+        IFunctionDefinition definition = node.getDefinition();
+
+        emitNamespaceIdentifier(node);
+        emitModifiers(definition);
+        emitMemberKeyword(node);
+
+        // I'm cheating right here, I haven't "seen" the light
+        // on how to properly and efficiently deal with accessors since they are SO alike
+        // I don't want to lump them in with methods because implementations in the
+        // future need to know the difference without loopholes
+        if (node instanceof IAccessorNode)
+        {
+            emitAccessorKeyword(((IAccessorNode) node).getAccessorKeywordNode());
+        }
+
+        emitMemberName(node);
+        emitParameters(node.getParametersContainerNode());
+        emitType(node.getReturnTypeNode());
+        if (node.getParent().getParent().getNodeID() == ASTNodeID.ClassID)
+        {
+            emitMethodScope(node.getScopedNode());
+        }
+
+        // the client such as IASBlockWalker is responsible for the 
+        // semi-colon and newline handling
+    }
+
+    @Override
+    public void emitGetAccessorDocumentation(IGetterNode node)
+    {
+    }
+
+    @Override
+    public void emitGetAccessor(IGetterNode node)
+    {
+        // just cheat for now, IGetterNode is a IFunctionNode
+        emitMethod(node);
+    }
+
+    @Override
+    public void emitSetAccessorDocumentation(ISetterNode node)
+    {
+    }
+
+    @Override
+    public void emitSetAccessor(ISetterNode node)
+    {
+        // just cheat for now, ISetterNode is a IFunctionNode
+        emitMethod(node);
+    }
+
+    @Override
+    public void emitLocalNamedFunction(IFunctionNode node)
+    {
+        FunctionNode fnode = (FunctionNode) node;
+        write(ASEmitterTokens.FUNCTION);
+        write(ASEmitterTokens.SPACE);
+        write(fnode.getName());
+        emitParameters(fnode.getParametersContainerNode());
+        emitType(fnode.getTypeNode());
+        emitFunctionScope(fnode.getScopedNode());
+    }
+
+    @Override
+    public void emitFunctionObject(IFunctionObjectNode node)
+    {
+        FunctionNode fnode = node.getFunctionNode();
+        write(ASEmitterTokens.FUNCTION);
+        emitParameters(fnode.getParametersContainerNode());
+        emitType(fnode.getTypeNode());
+        emitFunctionScope(fnode.getScopedNode());
+    }
+
+    //--------------------------------------------------------------------------
+    // 
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitNamespace(INamespaceNode node)
+    {
+        emitNamespaceIdentifier(node);
+        writeToken(ASEmitterTokens.NAMESPACE);
+        emitMemberName(node);
+        write(ASEmitterTokens.SPACE);
+        writeToken(ASEmitterTokens.EQUAL);
+        getWalker().walk(node.getNamespaceURINode());
+    }
+
+    //--------------------------------------------------------------------------
+    // 
+    //--------------------------------------------------------------------------
+
+    protected void emitNamespaceIdentifier(IDefinitionNode node)
+    {
+        String namespace = node.getNamespace();
+        if (namespace != null
+                && !namespace.equals(IASKeywordConstants.INTERNAL))
+        {
+            writeToken(namespace);
+        }
+    }
+
+    protected void emitModifiers(IDefinition definition)
+    {
+        ModifiersSet modifierSet = definition.getModifiers();
+        if (modifierSet.hasModifiers())
+        {
+            for (ASModifier modifier : modifierSet.getAllModifiers())
+            {
+                writeToken(modifier.toString());
+            }
+        }
+    }
+
+    public void emitMemberKeyword(IDefinitionNode node)
+    {
+        if (node instanceof IFunctionNode)
+        {
+            writeToken(ASEmitterTokens.FUNCTION);
+        }
+        else if (node instanceof IVariableNode)
+        {
+            writeToken(((IVariableNode) node).isConst() ? ASEmitterTokens.CONST
+                    : ASEmitterTokens.VAR);
+        }
+    }
+
+    protected void emitMemberName(IDefinitionNode node)
+    {
+        getWalker().walk(node.getNameExpressionNode());
+    }
+
+    public void emitDeclarationName(IDefinitionNode node)
+    {
+        getWalker().walk(node.getNameExpressionNode());
+    }
+
+    public void emitParameters(IContainerNode node)
+    {
+        write(ASEmitterTokens.PAREN_OPEN);
+        int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            IParameterNode parameterNode = (IParameterNode) node.getChild(i);
+            getWalker().walk(parameterNode); //emitParameter
+            if (i < len - 1)
+            {
+                writeToken(ASEmitterTokens.COMMA);
+            }
+        }
+        write(ASEmitterTokens.PAREN_CLOSE);
+    }
+
+    @Override
+    public void emitParameter(IParameterNode node)
+    {
+        if (node.isRest())
+        {
+            write(ASEmitterTokens.ELLIPSIS);
+            write(node.getName());
+        }
+        else
+        {
+            getWalker().walk(node.getNameExpressionNode());
+            write(ASEmitterTokens.COLON);
+            getWalker().walk(node.getVariableTypeNode());
+            IExpressionNode anode = node.getAssignedValueNode();
+            if (anode != null)
+            {
+                write(ASEmitterTokens.SPACE);
+                writeToken(ASEmitterTokens.EQUAL);
+                getWalker().walk(anode);
+            }
+        }
+    }
+
+    protected void emitType(IExpressionNode node)
+    {
+        // TODO (mschmalle) node.getVariableTypeNode() will return "*" if undefined, what to use?
+        // or node.getReturnTypeNode()
+        if (node != null)
+        {
+            write(ASEmitterTokens.COLON);
+            getWalker().walk(node);
+        }
+    }
+
+    protected void emitAssignedValue(IExpressionNode node)
+    {
+        if (node == null)
+        {
+            return;
+        }
+        getWalker().walk(node);
+    }
+
+    @Override
+    public void emitFunctionBlockHeader(IFunctionNode node)
+    {
+        // nothing to do in AS
+    }
+
+    public void emitMethodScope(IScopedNode node)
+    {
+        write(ASEmitterTokens.SPACE);
+        getWalker().walk(node);
+    }
+
+    protected void emitAccessorKeyword(IKeywordNode node)
+    {
+        getWalker().walk(node);
+        write(ASEmitterTokens.SPACE);
+    }
+
+    protected void emitFunctionScope(IScopedNode node)
+    {
+        emitMethodScope(node);
+    }
+
+    //--------------------------------------------------------------------------
+    // Statements
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitStatement(IASNode node)
+    {
+        getWalker().walk(node);
+        // XXX (mschmalle) this should be in the after handler?
+        if (node.getParent().getNodeID() != ASTNodeID.LabledStatementID
+        		&& node.getNodeID() != ASTNodeID.ConfigBlockID
+                && !(node instanceof IStatementNode))
+        {
+            write(ASEmitterTokens.SEMICOLON);
+        }
+
+        if (!isLastStatement(node))
+            writeNewline();
+    }
+
+    @Override
+    public void emitIf(IIfNode node)
+    {
+        IConditionalNode conditional = (IConditionalNode) node.getChild(0);
+
+        IContainerNode xnode = (IContainerNode) conditional
+                .getStatementContentsNode();
+
+        writeToken(ASEmitterTokens.IF);
+        //write(SPACE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(conditional.getChild(0)); // conditional expression
+        write(ASEmitterTokens.PAREN_CLOSE);
+        if (!isImplicit(xnode))
+            write(ASEmitterTokens.SPACE);
+
+        getWalker().walk(conditional.getChild(1)); // BlockNode
+        IConditionalNode[] nodes = node.getElseIfNodes();
+        if (nodes.length > 0)
+        {
+            for (int i = 0; i < nodes.length; i++)
+            {
+                IConditionalNode enode = nodes[i];
+                IContainerNode snode = (IContainerNode) enode
+                        .getStatementContentsNode();
+
+                final boolean isImplicit = isImplicit(snode);
+                if (isImplicit)
+                    writeNewline();
+                else
+                    write(ASEmitterTokens.SPACE);
+
+                writeToken(ASEmitterTokens.ELSE);
+                writeToken(ASEmitterTokens.IF);
+                write(ASEmitterTokens.PAREN_OPEN);
+                getWalker().walk(enode.getChild(0));
+                write(ASEmitterTokens.PAREN_CLOSE);
+                if (!isImplicit)
+                    write(ASEmitterTokens.SPACE);
+
+                getWalker().walk(enode.getChild(1)); // ConditionalNode
+            }
+        }
+
+        ITerminalNode elseNode = node.getElseNode();
+        if (elseNode != null)
+        {
+            IContainerNode cnode = (IContainerNode) elseNode.getChild(0);
+            // if an implicit if, add a newline with no space
+            final boolean isImplicit = isImplicit(cnode);
+            if (isImplicit)
+                writeNewline();
+            else
+                write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.ELSE);
+            if (!isImplicit)
+                write(ASEmitterTokens.SPACE);
+
+            getWalker().walk(elseNode); // TerminalNode
+        }
+    }
+
+    @Override
+    public void emitForEachLoop(IForLoopNode node)
+    {
+        IContainerNode xnode = (IContainerNode) node.getChild(1);
+        writeToken(ASEmitterTokens.FOR);
+        writeToken(ASEmitterTokens.EACH);
+        write(ASEmitterTokens.PAREN_OPEN);
+
+        IContainerNode cnode = node.getConditionalsContainerNode();
+        getWalker().walk(cnode.getChild(0));
+
+        write(ASEmitterTokens.PAREN_CLOSE);
+        if (!isImplicit(xnode))
+            write(ASEmitterTokens.SPACE);
+
+        getWalker().walk(node.getStatementContentsNode());
+    }
+
+    @Override
+    public void emitForLoop(IForLoopNode node)
+    {
+        IContainerNode xnode = (IContainerNode) node.getChild(1);
+
+        writeToken(ASEmitterTokens.FOR);
+        write(ASEmitterTokens.PAREN_OPEN);
+
+        IContainerNode cnode = node.getConditionalsContainerNode();
+        final IASNode node0 = cnode.getChild(0);
+        if (node0.getNodeID() == ASTNodeID.Op_InID)
+        {
+            getWalker().walk(cnode.getChild(0));
+        }
+        else
+        {
+            visitForBody(cnode);
+        }
+
+        write(ASEmitterTokens.PAREN_CLOSE);
+        if (!isImplicit(xnode))
+            write(ASEmitterTokens.SPACE);
+
+        getWalker().walk(node.getStatementContentsNode());
+    }
+
+    @Override
+    public void emitSwitch(ISwitchNode node)
+    {
+        writeToken(ASEmitterTokens.SWITCH);
+        write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(node.getChild(0));
+        writeToken(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline(ASEmitterTokens.BLOCK_OPEN, true);
+
+        IConditionalNode[] cnodes = ASNodeUtils.getCaseNodes(node);
+        ITerminalNode dnode = ASNodeUtils.getDefaultNode(node);
+
+        for (int i = 0; i < cnodes.length; i++)
+        {
+            IConditionalNode casen = cnodes[i];
+            IContainerNode cnode = (IContainerNode) casen.getChild(1);
+            writeToken(ASEmitterTokens.CASE);
+            getWalker().walk(casen.getConditionalExpressionNode());
+            write(ASEmitterTokens.COLON);
+            if (!isImplicit(cnode))
+                write(ASEmitterTokens.SPACE);
+            getWalker().walk(casen.getStatementContentsNode());
+            if (i == cnodes.length - 1 && dnode == null)
+            {
+                indentPop();
+                writeNewline();
+            }
+            else
+                writeNewline();
+        }
+        if (dnode != null)
+        {
+            IContainerNode cnode = (IContainerNode) dnode.getChild(0);
+            write(ASEmitterTokens.DEFAULT);
+            write(ASEmitterTokens.COLON);
+            if (!isImplicit(cnode))
+                write(ASEmitterTokens.SPACE);
+            getWalker().walk(dnode);
+            indentPop();
+            writeNewline();
+        }
+        write(ASEmitterTokens.BLOCK_CLOSE);
+    }
+
+    @Override
+    public void emitWhileLoop(IWhileLoopNode node)
+    {
+        IContainerNode cnode = (IContainerNode) node.getChild(1);
+        writeToken(ASEmitterTokens.WHILE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(node.getConditionalExpressionNode());
+        write(ASEmitterTokens.PAREN_CLOSE);
+        if (!isImplicit(cnode))
+            write(ASEmitterTokens.SPACE);
+        getWalker().walk(node.getStatementContentsNode());
+    }
+
+    @Override
+    public void emitDoLoop(IWhileLoopNode node)
+    {
+        IContainerNode cnode = (IContainerNode) node.getChild(0);
+        write(ASEmitterTokens.DO);
+        if (!isImplicit(cnode))
+            write(ASEmitterTokens.SPACE);
+        getWalker().walk(node.getStatementContentsNode());
+        if (!isImplicit(cnode))
+            write(ASEmitterTokens.SPACE);
+        else
+            writeNewline(); // TODO (mschmalle) there is something wrong here, block should NL
+        write(ASEmitterTokens.WHILE);
+        write(ASEmitterTokens.SPACE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(node.getConditionalExpressionNode());
+        write(ASEmitterTokens.PAREN_CLOSE);
+        write(ASEmitterTokens.SEMICOLON);
+    }
+
+    @Override
+    public void emitWith(IWithNode node)
+    {
+        IContainerNode cnode = (IContainerNode) node.getChild(1);
+        writeToken(ASEmitterTokens.WITH);
+        write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(node.getTargetNode());
+        write(ASEmitterTokens.PAREN_CLOSE);
+        if (!isImplicit(cnode))
+            write(ASEmitterTokens.SPACE);
+        getWalker().walk(node.getStatementContentsNode());
+    }
+
+    @Override
+    public void emitThrow(IThrowNode node)
+    {
+        writeToken(ASEmitterTokens.THROW);
+        getWalker().walk(node.getThrownExpressionNode());
+    }
+
+    @Override
+    public void emitTry(ITryNode node)
+    {
+        writeToken(ASEmitterTokens.TRY);
+        getWalker().walk(node.getStatementContentsNode());
+        for (int i = 0; i < node.getCatchNodeCount(); i++)
+        {
+            getWalker().walk(node.getCatchNode(i));
+        }
+        ITerminalNode fnode = node.getFinallyNode();
+        if (fnode != null)
+        {
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.FINALLY);
+            getWalker().walk(fnode);
+        }
+    }
+
+    @Override
+    public void emitCatch(ICatchNode node)
+    {
+        write(ASEmitterTokens.SPACE);
+        writeToken(ASEmitterTokens.CATCH);
+        write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(node.getCatchParameterNode());
+        writeToken(ASEmitterTokens.PAREN_CLOSE);
+        getWalker().walk(node.getStatementContentsNode());
+    }
+
+    @Override
+    public void emitReturn(IReturnNode node)
+    {
+        write(ASEmitterTokens.RETURN);
+        IExpressionNode rnode = node.getReturnValueNode();
+        if (rnode != null && rnode.getNodeID() != ASTNodeID.NilID)
+        {
+            write(ASEmitterTokens.SPACE);
+            getWalker().walk(rnode);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    // Expressions
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitFunctionCall(IFunctionCallNode node)
+    {
+        if (node.isNewExpression())
+        {
+            writeToken(ASEmitterTokens.NEW);
+        }
+
+        getWalker().walk(node.getNameNode());
+        
+        emitArguments(node.getArgumentsNode());
+    }
+
+    @Override
+    public void emitArguments(IContainerNode node)
+    {
+        write(ASEmitterTokens.PAREN_OPEN);
+        int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            IExpressionNode argumentNode = (IExpressionNode) node.getChild(i);
+            getWalker().walk(argumentNode);
+            if (i < len - 1)
+            {
+                writeToken(ASEmitterTokens.COMMA);
+            }
+        }
+        write(ASEmitterTokens.PAREN_CLOSE);
+    }
+
+    //--------------------------------------------------------------------------
+    // Operators
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitAsOperator(IBinaryOperatorNode node)
+    {
+        getWalker().walk(node.getLeftOperandNode());
+        write(ASEmitterTokens.SPACE);
+        writeToken(node.getOperator().getOperatorText());
+        getWalker().walk(node.getRightOperandNode());
+    }
+
+    @Override
+    public void emitIsOperator(IBinaryOperatorNode node)
+    {
+        getWalker().walk(node.getLeftOperandNode());
+        write(ASEmitterTokens.SPACE);
+        writeToken(node.getOperator().getOperatorText());
+        getWalker().walk(node.getRightOperandNode());
+    }
+
+    @Override
+    public void emitBinaryOperator(IBinaryOperatorNode node)
+    {
+        if (ASNodeUtils.hasParenOpen(node))
+            write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(node.getLeftOperandNode());
+        if (node.getNodeID() != ASTNodeID.Op_CommaID)
+            write(ASEmitterTokens.SPACE);
+        writeToken(node.getOperator().getOperatorText());
+        getWalker().walk(node.getRightOperandNode());
+        if (ASNodeUtils.hasParenClose(node))
+            write(ASEmitterTokens.PAREN_CLOSE);
+    }
+
+    //--------------------------------------------------------------------------
+    // Utility
+    //--------------------------------------------------------------------------
+
+    protected ITypeNode findTypeNode(IPackageNode node)
+    {
+        IScopedNode scope = node.getScopedNode();
+        for (int i = 0; i < scope.getChildCount(); i++)
+        {
+            IASNode child = scope.getChild(i);
+            if (child instanceof ITypeNode)
+                return (ITypeNode) child;
+        }
+        return null;
+    }
+
+    protected ITypeDefinition findType(Collection<IDefinition> definitions)
+    {
+        for (IDefinition definition : definitions)
+        {
+            if (definition instanceof ITypeDefinition)
+                return (ITypeDefinition) definition;
+        }
+        return null;
+    }
+
+    //--------------------------------------------------------------------------
+    // Static Utility
+    //--------------------------------------------------------------------------
+
+    protected static IFunctionNode getConstructor(IDefinitionNode[] members)
+    {
+        for (IDefinitionNode node : members)
+        {
+            if (node instanceof IFunctionNode)
+            {
+                IFunctionNode fnode = (IFunctionNode) node;
+                if (fnode.isConstructor())
+                    return fnode;
+            }
+        }
+        return null;
+    }
+
+    protected static boolean isLastStatement(IASNode node)
+    {
+        return getChildIndex(node.getParent(), node) == node.getParent()
+                .getChildCount() - 1;
+    }
+
+    // this is not fair that we have to do this if (i < len - 1)
+    private static int getChildIndex(IASNode parent, IASNode node)
+    {
+        final int len = parent.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            if (parent.getChild(i) == node)
+                return i;
+        }
+        return -1;
+    }
+
+    protected static final boolean isImplicit(IContainerNode node)
+    {
+        return EmitterUtils.isImplicit(node);
+    }
+
+    protected void visitForBody(IContainerNode node)
+    {
+        final IASNode node0 = node.getChild(0);
+        final IASNode node1 = node.getChild(1);
+        final IASNode node2 = node.getChild(2);
+
+        // initializer
+        if (node0 != null)
+        {
+            getWalker().walk(node0);
+            write(ASEmitterTokens.SEMICOLON);
+            if (node1.getNodeID() != ASTNodeID.NilID)
+                write(ASEmitterTokens.SPACE);
+        }
+        // condition or target
+        if (node1 != null)
+        {
+            getWalker().walk(node1);
+            write(ASEmitterTokens.SEMICOLON);
+            if (node2.getNodeID() != ASTNodeID.NilID)
+                write(ASEmitterTokens.SPACE);
+        }
+        // iterator
+        if (node2 != null)
+        {
+            getWalker().walk(node2);
+        }
+    }
+
+    @Override
+    public void emitLiteral(ILiteralNode node)
+    {
+        write(node.getValue(true));
+    }
+
+    @Override
+    public void emitLiteralContainer(ILiteralContainerNode node)
+    {
+        final ContainerNode cnode = node.getContentsNode();
+        final ContainerType type = cnode.getContainerType();
+        String postFix = "";
+
+        if (type == ContainerType.BRACES)
+        {
+            write(ASEmitterTokens.BLOCK_OPEN);
+            postFix = ASEmitterTokens.BLOCK_CLOSE.getToken();
+        }
+        else if (type == ContainerType.BRACKETS)
+        {
+            write(ASEmitterTokens.SQUARE_OPEN);
+            postFix = ASEmitterTokens.SQUARE_CLOSE.getToken();
+        }
+        else if (type == ContainerType.IMPLICIT)
+        {
+            // nothing to write, move along
+        }
+        else if (type == ContainerType.PARENTHESIS)
+        {
+            write(ASEmitterTokens.PAREN_OPEN);
+            postFix = ASEmitterTokens.PAREN_CLOSE.getToken();
+        }
+
+        final int len = cnode.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            IASNode child = cnode.getChild(i);
+            getWalker().walk(child);
+            if (i < len - 1)
+                writeToken(ASEmitterTokens.COMMA);
+        }
+
+        if (postFix != "")
+            write(postFix);
+    }
+
+    @Override
+    public void emitIdentifier(IIdentifierNode node)
+    {
+        write(node.getName());
+    }
+
+    @Override
+    public void emitNumericLiteral(INumericLiteralNode node)
+    {
+        write(node.getNumericValue().toString());
+    }
+
+    @Override
+    public void emitKeyword(IKeywordNode node)
+    {
+        write(node.getNodeID().getParaphrase());
+    }
+
+    @Override
+    public void emitIterationFlow(IIterationFlowNode node)
+    {
+        write(node.getKind().toString().toLowerCase());
+        IIdentifierNode lnode = node.getLabelNode();
+        if (lnode != null)
+        {
+            write(ASEmitterTokens.SPACE);
+            getWalker().walk(lnode);
+        }
+    }
+
+    @Override
+    public void emitMemberAccessExpression(IMemberAccessExpressionNode node)
+    {
+        getWalker().walk(node.getLeftOperandNode());
+        write(node.getOperator().getOperatorText());
+        getWalker().walk(node.getRightOperandNode());
+    }
+
+    @Override
+    public void emitDynamicAccess(IDynamicAccessNode node)
+    {
+        getWalker().walk(node.getLeftOperandNode());
+        write(ASEmitterTokens.SQUARE_OPEN);
+        getWalker().walk(node.getRightOperandNode());
+        write(ASEmitterTokens.SQUARE_CLOSE);
+    }
+
+    @Override
+    public void emitTypedExpression(ITypedExpressionNode node)
+    {
+        getWalker().walk(node.getCollectionNode());
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        write(ASEmitterTokens.LESS_THAN);
+        getWalker().walk(node.getTypeNode());
+        write(ASEmitterTokens.GREATER_THAN);
+    }
+
+    @Override
+    public void emitVariableExpression(IVariableExpressionNode node)
+    {
+        getWalker().walk(node.getTargetVariable());
+    }
+
+    @Override
+    public void emitTernaryOperator(ITernaryOperatorNode node)
+    {
+    	if (ASNodeUtils.hasParenOpen((IOperatorNode) node))
+    		write(ASEmitterTokens.PAREN_OPEN);
+        getWalker().walk(node.getConditionalNode());
+        write(ASEmitterTokens.SPACE);
+        writeToken(ASEmitterTokens.TERNARY);
+        getWalker().walk(node.getLeftOperandNode());
+        write(ASEmitterTokens.SPACE);
+        writeToken(ASEmitterTokens.COLON);
+        getWalker().walk(node.getRightOperandNode());
+        if (ASNodeUtils.hasParenClose((IOperatorNode) node))
+            write(ASEmitterTokens.PAREN_CLOSE);
+    }
+
+    @Override
+    public void emitObjectLiteralValuePair(IObjectLiteralValuePairNode node)
+    {
+        getWalker().walk(node.getNameNode());
+        write(ASEmitterTokens.COLON);
+        getWalker().walk(node.getValueNode());
+    }
+
+    @Override
+    public void emitLabelStatement(LabeledStatementNode node)
+    {
+        writeToken(node.getLabel());
+        writeToken(ASEmitterTokens.COLON);
+        getWalker().walk(node.getLabeledStatement());
+    }
+
+    @Override
+    public void emitNamespaceAccessExpression(
+            INamespaceAccessExpressionNode node)
+    {
+        getWalker().walk(node.getLeftOperandNode());
+        write(node.getOperator().getOperatorText());
+        getWalker().walk(node.getRightOperandNode());
+    }
+
+    @Override
+    public void emitUnaryOperator(IUnaryOperatorNode node)
+    {
+        if (ASNodeUtils.hasParenOpen(node))
+            write(ASEmitterTokens.PAREN_OPEN);
+
+        if (node.getNodeID() == ASTNodeID.Op_PreIncrID
+                || node.getNodeID() == ASTNodeID.Op_PreDecrID
+                || node.getNodeID() == ASTNodeID.Op_BitwiseNotID
+                || node.getNodeID() == ASTNodeID.Op_LogicalNotID
+                || node.getNodeID() == ASTNodeID.Op_SubtractID
+                || node.getNodeID() == ASTNodeID.Op_AddID)
+        {
+            write(node.getOperator().getOperatorText());
+            IExpressionNode opNode = node.getOperandNode();
+            getWalker().walk(opNode);
+        }
+
+        else if (node.getNodeID() == ASTNodeID.Op_PostIncrID
+                || node.getNodeID() == ASTNodeID.Op_PostDecrID)
+        {
+            getWalker().walk(node.getOperandNode());
+            write(node.getOperator().getOperatorText());
+        }
+        else if (node.getNodeID() == ASTNodeID.Op_DeleteID
+                || node.getNodeID() == ASTNodeID.Op_VoidID)
+        {
+            writeToken(node.getOperator().getOperatorText());
+            getWalker().walk(node.getOperandNode());
+        }
+        else if (node.getNodeID() == ASTNodeID.Op_TypeOfID)
+        {
+            write(node.getOperator().getOperatorText());
+            write(ASEmitterTokens.PAREN_OPEN);
+            getWalker().walk(node.getOperandNode());
+            write(ASEmitterTokens.PAREN_CLOSE);
+        }
+
+        if (ASNodeUtils.hasParenClose(node))
+            write(ASEmitterTokens.PAREN_CLOSE);
+    }
+
+    @Override
+    public void emitLanguageIdentifier(ILanguageIdentifierNode node)
+    {
+        if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.ANY_TYPE)
+        {
+            write(ASEmitterTokens.ANY_TYPE);
+        }
+        else if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.REST)
+        {
+            write(ASEmitterTokens.ELLIPSIS);
+        }
+        else if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.SUPER)
+        {
+            write(ASEmitterTokens.SUPER);
+        }
+        else if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.THIS)
+        {
+            write(ASEmitterTokens.THIS);
+        }
+        else if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.VOID)
+        {
+            write(ASEmitterTokens.VOID);
+        }
+    }
+
+    @Override
+    public void emitMetaTag(IMetaTagNode node)
+    {
+    }
+
+    @Override
+    public void emitContainer(IContainerNode node)
+    {
+    }
+
+    @Override
+    public void emitE4XFilter(IMemberAccessExpressionNode node)
+    {
+        // ToDo (erikdebruin)
+    }
+
+    @Override
+    public void emitUseNamespace(IUseNamespaceNode node)
+    {
+        // ToDo (erikdebruin)
+    }
+
+    @Override
+    public String stringifyNode(IASNode node)
+    {
+        boolean oldBufferWrite = isBufferWrite();
+        StringBuilder oldBuilder = this.builder;
+        this.builder = new StringBuilder();
+        setBufferWrite(true);
+        getWalker().walk(node);
+        String result = getBuilder().toString();
+        getBuilder().setLength(0);
+        this.builder = oldBuilder;
+        setBufferWrite(oldBufferWrite);
+        return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASEmitterTokens.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASEmitterTokens.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASEmitterTokens.java
new file mode 100644
index 0000000..9296a78
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASEmitterTokens.java
@@ -0,0 +1,203 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+
+/**
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public enum ASEmitterTokens implements IEmitterTokens
+{
+    DOUBLE_QUOTE("\""), INDENT("\t"), NEW_LINE("\n"), SINGLE_QUOTE("'"), SPACE(
+            " "),
+
+    INTERNAL("internal"), PRIVATE("private"), PROTECTED("protected"),
+
+    ANY_TYPE("*"), UNDEFINED("undefined"),
+
+    //    int EOF = 1;
+    //    int NULL_TREE_LOOKAHEAD = 3;
+    //    int HIDDEN_TOKEN_COMMENT = 4;
+    //    int HIDDEN_TOKEN_SINGLE_LINE_COMMENT = 5;
+    //    int HIDDEN_TOKEN_STAR_ASSIGNMENT = 6;
+    //    int HIDDEN_TOKEN_BUILTIN_NS = 7;
+    //    int HIDDEN_TOKEN_MULTI_LINE_COMMENT = 8;
+    //    int TOKEN_ASDOC_TAG = 9;
+    //    int TOKEN_ASDOC_TEXT = 10;
+    EACH("each"),
+    //    int TOKEN_RESERVED_WORD_CONFIG = 12;
+    //    int TOKEN_KEYWORD_INCLUDE = 13;
+    //    int TOKEN_RESERVED_WORD_GOTO = 14;
+    //    int TOKEN_IDENTIFIER = 15;
+    FINALLY("finally"),
+    CATCH("catch"),
+    //    int TOKEN_LITERAL_STRING = 18;
+    BLOCK_OPEN("{"),
+    BLOCK_CLOSE("}"),
+    //    int TOKEN_NAMESPACE_NAME = 21;
+    //    int TOKEN_OPERATOR_NS_QUALIFIER = 22;
+    //    int TOKEN_NAMESPACE_ANNOTATION = 23;
+    COLON(":"),
+    IMPORT("import"),
+    //    int TOKEN_KEYWORD_USE = 26;
+    NAMESPACE("namespace"),
+    //    int TOKEN_ASDOC_COMMENT = 28;
+    FINAL("final"),
+    DYNAMIC("dynamic"),
+    OVERRIDE("override"),
+    //    int TOKEN_MODIFIER_STATIC = 32;
+    //    int TOKEN_MODIFIER_NATIVE = 33;
+    //    int TOKEN_MODIFIER_VIRTUAL = 34;
+    MEMBER_ACCESS("."),
+    //    int TOKEN_ATTRIBUTE = 36;
+    SQUARE_OPEN("["),
+    PACKAGE("package"),
+    INTERFACE("interface"),
+    EXTENDS("extends"),
+    COMMA(","),
+    CLASS("class"),
+    IMPLEMENTS("implements"),
+    FUNCTION("function"),
+    PAREN_CLOSE(")"),
+    PAREN_OPEN("("),
+    GET("get"),
+    SET("set"),
+    ELLIPSIS("..."),
+    VAR("var"),
+    CONST("const"),
+    //    int TOKEN_OPERATOR_ASSIGNMENT = 52;
+    //    int TOKEN_DIRECTIVE_DEFAULT_XML = 53;
+    SEMICOLON(";"),
+    RETURN("return"),
+    THROW("throw"),
+    FOR("for"),
+    IN("in"),
+    DO("do"),
+    WHILE("while"),
+    //    int TOKEN_KEYWORD_CONTINUE = 61;
+    //    int TOKEN_KEYWORD_BREAK = 62;
+    WITH("with"),
+    TRY("try"),
+    IF("if"),
+    ELSE("else"),
+    SWITCH("switch"),
+    CASE("case"),
+    DEFAULT("default"),
+    SUPER("super"),
+    //    int TOKEN_TYPED_COLLECTION_OPEN = 71;
+    //    int TOKEN_TYPED_COLLECTION_CLOSE = 72;
+    GREATER_THAN(">"),
+    //    int TOKEN_OPERATOR_LOGICAL_AND_ASSIGNMENT = 74;
+    //    int TOKEN_OPERATOR_LOGICAL_OR_ASSIGNMENT = 75;
+    //    int TOKEN_OPERATOR_PLUS_ASSIGNMENT = 76;
+    //    int TOKEN_OPERATOR_MINUS_ASSIGNMENT = 77;
+    //    int TOKEN_OPERATOR_MULTIPLICATION_ASSIGNMENT = 78;
+    //    int TOKEN_OPERATOR_DIVISION_ASSIGNMENT = 79;
+    //    int TOKEN_OPERATOR_MODULO_ASSIGNMENT = 80;
+    //    int TOKEN_OPERATOR_BITWISE_AND_ASSIGNMENT = 81;
+    //    int TOKEN_OPERATOR_BITWISE_OR_ASSIGNMENT = 82;
+    //    int TOKEN_OPERATOR_BITWISE_XOR_ASSIGNMENT = 83;
+    //    int TOKEN_OPERATOR_BITWISE_LEFT_SHIFT_ASSIGNMENT = 84;
+    //    int TOKEN_OPERATOR_BITWISE_RIGHT_SHIFT_ASSIGNMENT = 85;
+    //    int TOKEN_OPERATOR_BITWISE_UNSIGNED_RIGHT_SHIFT_ASSIGNMENT = 86;
+    TERNARY("?"),
+    LOGICAL_OR("||"),
+    LOGICAL_AND("&&"),
+    //    int TOKEN_OPERATOR_BITWISE_OR = 90;
+    //    int TOKEN_OPERATOR_BITWISE_XOR = 91;
+    //    int TOKEN_OPERATOR_BITWISE_AND = 92;
+    EQUAL("="),
+    //    int TOKEN_OPERATOR_NOT_EQUAL = 94;
+    STRICT_EQUAL("==="),
+    STRICT_NOT_EQUAL("!=="),
+    //    int TOKEN_OPERATOR_GREATER_THAN_EQUALS = 97;
+    LESS_THAN("<"),
+    //    int TOKEN_OPERATOR_LESS_THAN_EQUALS = 99;
+    INSTANCEOF("instanceof"),
+    IS("is"),
+    AS("as"),
+    //    int TOKEN_OPERATOR_BITWISE_LEFT_SHIFT = 103;
+    //    int TOKEN_OPERATOR_BITWISE_RIGHT_SHIFT = 104;
+    //    int TOKEN_OPERATOR_BITWISE_UNSIGNED_RIGHT_SHIFT = 105;
+    MINUS("-"),
+    PLUS("+"),
+    //    int TOKEN_OPERATOR_DIVISION = 108;
+    //    int TOKEN_OPERATOR_MODULO = 109;
+    //    int TOKEN_OPERATOR_STAR = 110;
+    //    int TOKEN_KEYWORD_DELETE = 111;
+    //    int TOKEN_OPERATOR_INCREMENT = 112;
+    //    int TOKEN_OPERATOR_DECREMENT = 113;
+    VOID("void"),
+    TYPEOF("typeof"),
+    //    int TOKEN_OPERATOR_BITWISE_NOT = 116;
+    //    int TOKEN_OPERATOR_LOGICAL_NOT = 117;
+    NULL("null"),
+    TRUE("true"),
+    FALSE("false"),
+    THIS("this"),
+    //    int TOKEN_VOID_0 = 122;
+    //    int TOKEN_LITERAL_REGEXP = 123;
+    //    int TOKEN_LITERAL_NUMBER = 124;
+    //    int TOKEN_LITERAL_HEX_NUMBER = 125;
+    SQUARE_CLOSE("]"),
+    //    int TOKEN_TYPED_LITERAL_OPEN = 127;
+    //    int TOKEN_TYPED_LITERAL_CLOSE = 128;
+    //    int TOKEN_E4X_WHITESPACE = 129;
+    //    int TOKEN_E4X_COMMENT = 130;
+    //    int TOKEN_E4X_CDATA = 131;
+    //    int TOKEN_E4X_PROCESSING_INSTRUCTION = 132;
+    //    int TOKEN_E4X_ENTITY = 133;
+    //    int TOKEN_E4X_DECIMAL_ENTITY = 134;
+    //    int TOKEN_E4X_HEX_ENTITY = 135;
+    //    int TOKEN_E4X_TEXT = 136;
+    //    int TOKEN_E4X_STRING = 137;
+    //    int TOKEN_E4X_OPEN_TAG_START = 138;
+    //    int TOKEN_E4X_CLOSE_TAG_START = 139;
+    //    int HIDDEN_TOKEN_E4X = 140;
+    //    int TOKEN_E4X_NAME = 141;
+    //    int TOKEN_E4X_TAG_END = 142;
+    //    int TOKEN_E4X_EMPTY_TAG_END = 143;
+    //    int TOKEN_E4X_XMLNS = 144;
+    //    int TOKEN_E4X_NAME_DOT = 145;
+    //    int TOKEN_E4X_DOTTED_NAME_PART = 146;
+    //    int TOKEN_E4X_EQUALS = 147;
+    //    int TOKEN_LITERAL_XMLLIST = 148;
+    //    int TOKEN_E4X_XMLLIST_CLOSE = 149;
+    //    int TOKEN_E4X_BINDING_OPEN = 150;
+    //    int TOKEN_E4X_BINDING_CLOSE = 151;
+    NEW("new"),
+    ATSIGN("@"),
+    //    int TOKEN_OPERATOR_DESCENDANT_ACCESS = 154;
+    ;
+
+    private String token;
+
+    private ASEmitterTokens(String value)
+    {
+        token = value;
+    }
+
+    public String getToken()
+    {
+        return token;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASFilterWriter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASFilterWriter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASFilterWriter.java
new file mode 100644
index 0000000..c9fe02e
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASFilterWriter.java
@@ -0,0 +1,42 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import java.io.FilterWriter;
+import java.io.Writer;
+
+/**
+ * @author Michael Schmalle
+ */
+public class ASFilterWriter extends FilterWriter
+{
+
+    public ASFilterWriter(Writer out)
+    {
+        super(out);
+    }
+
+    @Override
+    public String toString()
+    {
+        return out.toString();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASWriter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASWriter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASWriter.java
new file mode 100644
index 0000000..87634b7
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASWriter.java
@@ -0,0 +1,97 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.as.IASWriter;
+import org.apache.flex.compiler.internal.codegen.js.JSSharedData;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.as.IASBlockWalker;
+
+public class ASWriter implements IASWriter
+{
+    private IASProject project;
+
+    private List<ICompilerProblem> problems;
+
+    private ICompilationUnit compilationUnit;
+
+    @SuppressWarnings("unused")
+    private boolean enableDebug;
+
+    /**
+     * Create a JSApplication writer.
+     * 
+     * @param application the JSApplication model to be encoded
+     * @param useCompression use ZLIB compression if true
+     */
+    public ASWriter(IASProject project, List<ICompilerProblem> problems,
+            ICompilationUnit compilationUnit, boolean enableDebug)
+    {
+        this.project = project;
+        this.problems = problems;
+        this.compilationUnit = compilationUnit;
+        this.enableDebug = enableDebug;
+    }
+
+    @Override
+    public void close() throws IOException
+    {
+        //outputBuffer.close();
+    }
+
+    @Override
+    public void writeTo(OutputStream out)
+    {
+        ASFilterWriter writer = JSSharedData.backend
+                .createWriterBuffer(project);
+        IASEmitter emitter = JSSharedData.backend.createEmitter(writer);
+        IASBlockWalker walker = JSSharedData.backend.createWalker(project,
+                problems, emitter);
+
+        walker.visitCompilationUnit(compilationUnit);
+
+        System.out.println(writer.toString());
+
+        try
+        {
+            out.write(writer.toString().getBytes());
+        }
+        catch (IOException e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public int writeTo(File out) throws FileNotFoundException, IOException
+    {
+        return 0;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/emit/ReferenceEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/emit/ReferenceEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/emit/ReferenceEmitter.java
new file mode 100644
index 0000000..957d352
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/emit/ReferenceEmitter.java
@@ -0,0 +1,166 @@
+/*
+ *
+ *  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.internal.codegen.externals.emit;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.flex.compiler.internal.codegen.externals.reference.BaseReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ConstantReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.FunctionReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;
+
+public class ReferenceEmitter
+{
+    private ReferenceModel model;
+
+    public ReferenceEmitter(ReferenceModel model)
+    {
+        this.model = model;
+    }
+
+    public void emit() throws IOException
+    {
+        final File asRoot = model.getConfiguration().getAsRoot();
+        if (!asRoot.exists())
+            asRoot.mkdirs();
+
+        emitClasses();
+        emitInterfaces();
+        emitTypedefs();
+        emitFunctions();
+        emitConstants();
+    }
+
+    protected void emitInterfaces() throws IOException
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (ClassReference reference : model.getClasses())
+        {
+            if (model.isExcludedClass(reference) != null)
+                continue;
+
+            if (!reference.isInterface())
+                continue;
+
+            if (model.getConfiguration().isExternalExtern(reference))
+                continue;
+
+            emit(reference, sb);
+
+            File sourceFile = reference.getFile(model.getConfiguration().getAsInterfaceRoot());
+            FileUtils.write(sourceFile, sb.toString());
+
+            sb.setLength(0);
+        }
+    }
+
+    protected void emitClasses() throws IOException
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (ClassReference reference : model.getClasses())
+        {
+            if (model.isExcludedClass(reference) != null)
+                continue;
+
+            if (reference.isInterface())
+                continue;
+
+            if (model.getConfiguration().isExternalExtern(reference))
+                continue;
+            
+            emit(reference, sb);
+
+            File sourceFile = reference.getFile(model.getConfiguration().getAsClassRoot());
+            FileUtils.write(sourceFile, sb.toString());
+
+            sb.setLength(0);
+        }
+    }
+
+    protected void emitTypedefs() throws IOException
+    {
+        final StringBuilder sb = new StringBuilder();
+        // TODO figure out how to resolve/emit @typedef
+        for (ClassReference reference : model.getTypedefs())
+        {
+            if (model.isExcludedClass(reference) != null)
+                continue;
+
+            if (model.getConfiguration().isExternalExtern(reference))
+                continue;
+
+            emit(reference, sb);
+
+            File sourceFile = reference.getFile(model.getConfiguration().getAsTypeDefRoot());
+            FileUtils.write(sourceFile, sb.toString());
+
+            sb.setLength(0);
+        }
+    }
+
+    protected void emitFunctions() throws IOException
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (FunctionReference reference : model.getFunctions())
+        {
+            if (model.getConfiguration().isExternalExtern(reference))
+                continue;
+            
+            emit(reference, sb);
+
+            File sourceFile = reference.getFile(model.getConfiguration().getAsFunctionRoot());
+            FileUtils.write(sourceFile, sb.toString());
+
+            sb.setLength(0);
+        }
+    }
+
+    protected void emitConstants() throws IOException
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (ConstantReference reference : model.getConstants())
+        {
+            if (model.getConfiguration().isExternalExtern(reference))
+                continue;
+            
+            emit(reference, sb);
+
+            File sourceFile = reference.getFile(model.getConfiguration().getAsConstantRoot());
+            FileUtils.write(sourceFile, sb.toString());
+
+            sb.setLength(0);
+        }
+    }
+
+    public void emit(BaseReference reference, StringBuilder sb)
+    {
+        reference.emit(sb);
+    }
+
+    public String emit(BaseReference reference)
+    {
+        final StringBuilder sb = new StringBuilder();
+        reference.emit(sb);
+        return sb.toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/AbstractCompilerPass.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/AbstractCompilerPass.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/AbstractCompilerPass.java
new file mode 100644
index 0000000..a9734de
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/AbstractCompilerPass.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.internal.codegen.externals.pass;
+
+import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;
+import org.apache.flex.compiler.internal.codegen.externals.utils.DebugLogUtils;
+
+import com.google.javascript.jscomp.AbstractCompiler;
+import com.google.javascript.jscomp.CompilerPass;
+import com.google.javascript.jscomp.NodeTraversal;
+import com.google.javascript.jscomp.NodeTraversal.Callback;
+import com.google.javascript.rhino.Node;
+
+public abstract class AbstractCompilerPass implements CompilerPass, Callback
+{
+    protected ReferenceModel model;
+    protected AbstractCompiler compiler;
+
+    protected boolean logEnabled;
+    protected boolean errEnabled;
+
+    public AbstractCompilerPass(ReferenceModel model, AbstractCompiler compiler)
+    {
+        this.model = model;
+        this.compiler = compiler;
+    }
+
+    @Override
+    public void process(Node externs, Node root)
+    {
+        //NodeTraversal.traverse(compiler, root, this);
+        NodeTraversal.traverseRoots(compiler, this, externs, root);
+    }
+
+    protected void log(Node n)
+    {
+        DebugLogUtils.err(n);
+    }
+
+    protected void err(Node n)
+    {
+        DebugLogUtils.err(n);
+    }
+
+    protected void log(String message)
+    {
+        DebugLogUtils.log(message);
+    }
+
+    protected void err(String message)
+    {
+        DebugLogUtils.err(message);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/AddMemberPass.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/AddMemberPass.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/AddMemberPass.java
new file mode 100644
index 0000000..8379af9
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/AddMemberPass.java
@@ -0,0 +1,150 @@
+/*
+ *
+ *  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.internal.codegen.externals.pass;
+
+import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;
+
+import com.google.javascript.jscomp.AbstractCompiler;
+import com.google.javascript.jscomp.NodeTraversal;
+import com.google.javascript.rhino.Node;
+
+public class AddMemberPass extends AbstractCompilerPass
+{
+
+    public AddMemberPass(ReferenceModel model, AbstractCompiler compiler)
+    {
+        super(model, compiler);
+    }
+
+    @Override
+    public boolean shouldTraverse(NodeTraversal nodeTraversal, Node n,
+            Node parent)
+    {
+        return n.isBlock() || n.isScript();
+    }
+
+    @Override
+    public void visit(NodeTraversal t, Node n, Node parent)
+    {
+        for (Node child : n.children())
+        {
+            //log(child);
+
+            if (child.isExprResult())
+            {
+                Node first = child.getFirstChild();
+
+                if (first.isVar())
+                {
+                    // visitVar(t, n);
+                }
+                else if (first.isFunction())
+                {
+                    // visitFunction(t, n);
+                }
+                else if (first.isAssign())
+                {
+                    if (first.getFirstChild().isGetProp()
+                            && first.getLastChild().isFunction())
+                    {
+                        // instance or static method
+                        visitMethod(t, first);
+                    }
+                    else
+                    {
+                        // DOMException.INDEX_SIZE_ERR = 1;
+                        // The first child of the assign is the GetProp node,
+                        // if later you need the value, either change this or check
+                        // for a parent assign node when creating the FieldReference
+                        // which the value would be n.getLastChild()
+                        // XXX visitStaticField(t, n);
+                        //System.err.println(n.toStringTree());
+                    }
+                }
+                else if (first.isGetProp())
+                {
+                    visitGetProp(t, first);
+                }
+            }
+        }
+    }
+
+    // n == ASSIGN
+    private void visitMethod(NodeTraversal t, Node n)
+    {
+        String qName = n.getFirstChild().getQualifiedName();
+
+        if (n.getFirstChild().isGetProp())
+        {
+            int protoType = qName.indexOf(".prototype.");
+            if (protoType != -1)
+            {
+                String className = qName.substring(0, protoType);
+                String memberName = qName.substring(protoType + 11,
+                        qName.length());
+                //log("Prototype:: className [" + className
+                //        + "] memberName [" + memberName + "]");
+                model.addMethod(n, className, memberName);
+            }
+            else
+            {
+                String className = qName.substring(0, qName.lastIndexOf("."));
+                String memberName = qName.substring(qName.lastIndexOf(".") + 1,
+                        qName.length());
+                //log("className [" + className + "] memberName ["
+                //        + memberName + "]");
+                model.addStaticMethod(n, className, memberName);
+            }
+        }
+        else if (n.getFirstChild().isName())
+        {
+            err("visitMethod() non impl");
+            log(n);
+        }
+    }
+
+    private void visitGetProp(NodeTraversal t, Node n)
+    {
+        String qualifiedName = n.getQualifiedName();
+
+        log("visitGetProp [" + qualifiedName + "]");
+
+        int protoType = qualifiedName.indexOf(".prototype.");
+        if (protoType != -1)
+        {
+            String className = qualifiedName.substring(0, protoType);
+            String memberName = qualifiedName.substring(protoType + 11,
+                    qualifiedName.length());
+            //log("Prototype:: className [" + className
+            //        + "] memberName [" + memberName + "]");
+            model.addField(n, className, memberName);
+        }
+        else
+        {
+            String className = qualifiedName.substring(0,
+                    qualifiedName.lastIndexOf("."));
+            String memberName = qualifiedName.substring(
+                    qualifiedName.lastIndexOf(".") + 1, qualifiedName.length());
+            //log("className [" + className + "] memberName ["
+            //        + memberName + "]");
+            model.addStaticField(n, className, memberName);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/CollectImportsPass.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/CollectImportsPass.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/CollectImportsPass.java
new file mode 100644
index 0000000..d934610
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/CollectImportsPass.java
@@ -0,0 +1,188 @@
+/*
+ *
+ *  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.internal.codegen.externals.pass;
+
+import java.util.List;
+
+import org.apache.flex.compiler.internal.codegen.externals.reference.*;
+
+import com.google.javascript.jscomp.AbstractCompiler;
+import com.google.javascript.jscomp.NodeTraversal;
+import com.google.javascript.rhino.Node;
+
+/**
+ * @author: Frederic Thomas Date: 05/07/2015 Time: 18:16
+ */
+public class CollectImportsPass extends AbstractCompilerPass
+{
+    public CollectImportsPass(final ReferenceModel model, AbstractCompiler compiler)
+    {
+        super(model, compiler);
+    }
+
+    @Override
+    public void process(Node externs, Node root)
+    {
+        for (ClassReference reference : model.getClasses())
+        {
+            collectClassImports(reference);
+        }
+
+        for (FunctionReference reference : model.getFunctions())
+        {
+            collectFunctionImports(reference);
+        }
+    }
+
+    private void collectClassImports(ClassReference reference)
+    {
+        final MethodReference constructor = reference.getConstructor();
+        final List<ClassReference> superClasses = reference.getSuperClasses();
+        final List<ClassReference> interfaces = reference.getInterfaces();
+        final List<ClassReference> extendedInterfaces = reference.getExtendedInterfaces();
+        final List<FieldReference> fields = reference.getAllFields();
+        final List<MethodReference> methods = reference.getAllMethods();
+
+        for (ClassReference superClass : superClasses)
+        {
+            if (model.isExcludedClass(superClass) == null)
+            {
+                addClassImport(reference, superClass);
+            }
+        }
+
+        for (ClassReference _interface : interfaces)
+        {
+            if (model.isExcludedClass(_interface) == null)
+            {
+                addClassImport(reference, _interface);
+            }
+        }
+
+        for (ClassReference _interface : extendedInterfaces)
+        {
+            if (model.isExcludedClass(_interface) == null)
+            {
+                addClassImport(reference, _interface);
+            }
+        }
+
+        for (FieldReference field : fields)
+        {
+            if (field.isExcluded() == null)
+            {
+                addClassImport(reference, getType(field));
+            }
+        }
+
+        if (constructor != null)
+        {
+            for (ParameterReference parameterReference : constructor.getParameters())
+            {
+                addClassImport(reference, getType(parameterReference));
+            }
+        }
+
+        for (MethodReference method : methods)
+        {
+            if (method.isExcluded() == null)
+            {
+                addClassImport(reference, getReturnType(method));
+
+                for (ParameterReference parameterReference : method.getParameters())
+                {
+                    addClassImport(reference, getType(parameterReference));
+                }
+            }
+        }
+    }
+
+    private void addClassImport(final ClassReference thisReference, final ClassReference referenceToImport)
+    {
+        if (canImport(referenceToImport))
+        {
+            final String thisPackageName = thisReference.getPackageName();
+            final String importPackageName = referenceToImport.getPackageName();
+
+            if (!importPackageName.equals(thisPackageName))
+            {
+                thisReference.addImport(referenceToImport);
+            }
+        }
+    }
+
+    private void collectFunctionImports(final FunctionReference function)
+    {
+        if (function.isExcluded() == null)
+        {
+            ClassReference returnType = getReturnType(function);
+
+            if (canImport(returnType))
+            {
+                function.addImport(returnType);
+            }
+
+            for (ParameterReference parameterReference : function.getParameters())
+            {
+                ClassReference type = getType(parameterReference);
+
+                if (canImport(type))
+                {
+                    function.addImport(type);
+                }
+            }
+        }
+    }
+
+    private ClassReference getType(final FieldReference field)
+    {
+        return model.getClassReference(field.toTypeString());
+    }
+
+    private ClassReference getReturnType(final MethodReference method)
+    {
+        return model.getClassReference(method.transformReturnString());
+    }
+
+    private ClassReference getReturnType(final FunctionReference function)
+    {
+        return model.getClassReference(function.transformReturnString());
+    }
+
+    private ClassReference getType(final ParameterReference parameter)
+    {
+        return model.getClassReference(parameter.getQualifiedName());
+    }
+
+    private boolean canImport(ClassReference reference)
+    {
+        return reference != null && reference.isQualifiedName() && model.isExcludedClass(reference) == null;
+    }
+
+    @Override
+    public boolean shouldTraverse(final NodeTraversal nodeTraversal, final Node n, final Node parent) {
+        return false;
+    }
+
+    @Override
+    public void visit(final NodeTraversal t, final Node n, final Node parent)
+    {
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/CollectTypesPass.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/CollectTypesPass.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/CollectTypesPass.java
new file mode 100644
index 0000000..8ddde76
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/CollectTypesPass.java
@@ -0,0 +1,165 @@
+/*
+ *
+ *  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.internal.codegen.externals.pass;
+
+import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;
+
+import com.google.javascript.jscomp.AbstractCompiler;
+import com.google.javascript.jscomp.NodeTraversal;
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.Node;
+
+public class CollectTypesPass extends AbstractCompilerPass
+{
+    public CollectTypesPass(ReferenceModel model, AbstractCompiler compiler)
+    {
+        super(model, compiler);
+    }
+
+    @Override
+    public boolean shouldTraverse(NodeTraversal nodeTraversal, Node n,
+            Node parent)
+    {
+        return n.isBlock() || n.isScript();
+    }
+
+    @Override
+    public void visit(NodeTraversal t, Node n, Node parent)
+    {
+        for (Node child : n.children())
+        {
+            if (child.isVar())
+            {
+                visitVar(child);
+            }
+            else if (child.isFunction())
+            {
+                visitFunction(child);
+            }
+            else if (child.isExprResult())
+            {
+                visitExprResult(child);
+            }
+        }
+    }
+
+    private void visitExprResult(Node child)
+    {
+        JSDocInfo comment = null;
+
+        Node container = child.getFirstChild();
+        if (container.isAssign())
+        {
+            comment = container.getJSDocInfo();
+
+            Node left = container.getFirstChild();
+            Node right = container.getLastChild();
+
+            if (left.isName() && right.isFunction())
+            {
+                if (comment.isConstructor() || comment.isInterface())
+                {
+                    // Foo = function () {};
+                    model.addClass(container, left.getString());
+                }
+
+            }
+            else if (left.isGetProp() && right.isFunction())
+            {
+                boolean isConstructor = comment != null
+                        && (comment.isConstructor() || comment.isInterface());
+                // foo.bar.Baz = function () {};
+                if (isConstructor)
+                {
+                    model.addClass(container, left.getQualifiedName());
+                }
+            }
+        }
+    }
+
+    private void visitFunction(Node child)
+    {
+        JSDocInfo comment = child.getJSDocInfo();
+
+        boolean isConstructor = comment != null
+                && (comment.isConstructor() || comment.isInterface());
+
+        if (isConstructor)
+        {
+            // function Goo () {};
+            model.addClass(child, child.getFirstChild().getString());
+        }
+        else
+        {
+            model.addFunction(child, child.getFirstChild().getString());
+        }
+    }
+
+    private void visitVar(Node child)
+    {
+        JSDocInfo comment = child.getJSDocInfo();
+
+        Node first = child.getFirstChild();
+        if (first.isName())
+        {
+            Node subFirst = first.getFirstChild();
+            if (subFirst != null && subFirst.isObjectLit())
+            {
+                if (comment.hasEnumParameterType())
+                {
+
+                }
+                else
+                {
+                    //System.out.println(first.getFirstChild().toStringTree());
+                    //log("Encountered namespace [" + first.getQualifiedName() + "]");
+                    model.addNamespace(child, first.getQualifiedName());
+                }
+            }
+            else if (subFirst != null && subFirst.isFunction())
+            {
+                boolean isConstructor = comment != null
+                        && (comment.isConstructor() || comment.isInterface());
+                // foo.bar.Baz = function () {};
+                if (isConstructor)
+                {
+                    model.addClass(child, first.getString());
+                }
+            }
+            else
+            {
+                boolean isConstructor = comment != null
+                        && (comment.getTypedefType() != null);
+                // * @typedef
+                // var foo;
+                if (isConstructor)
+                {
+                    // model.addClass(child, first.getString());
+                    model.addTypeDef(child, first.getString());
+                }
+                else if (comment != null && comment.isConstant())
+                {
+                    //System.out.println(child.toStringTree());
+                    model.addConstant(child, first.getString());
+                }
+            }
+        }
+    }
+}


[31/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/goog/JSGoogConfiguration.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/goog/JSGoogConfiguration.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/goog/JSGoogConfiguration.java
new file mode 100644
index 0000000..0f03323
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/goog/JSGoogConfiguration.java
@@ -0,0 +1,311 @@
+/*
+ *
+ *  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.internal.driver.js.goog;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flex.compiler.clients.JSConfiguration;
+import org.apache.flex.compiler.clients.MXMLJSC;
+import org.apache.flex.compiler.config.ConfigurationValue;
+import org.apache.flex.compiler.exceptions.ConfigurationException;
+import org.apache.flex.compiler.internal.config.annotations.Config;
+import org.apache.flex.compiler.internal.config.annotations.FlexOnly;
+import org.apache.flex.compiler.internal.config.annotations.InfiniteArguments;
+import org.apache.flex.compiler.internal.config.annotations.Mapping;
+
+/**
+ * The {@link JSGoogConfiguration} class holds all compiler arguments needed for
+ * compiling ActionScript to JavaScript the 'goog' way.
+ * <p>
+ * Specific flags are implemented here for the configuration to be loaded by the
+ * configure() method of {@link MXMLJSC}.
+ * <p>
+ * This class inherits all compiler arguments from the MXMLC compiler.
+ * 
+ * @author Erik de Bruin
+ */
+public class JSGoogConfiguration extends JSConfiguration
+{
+    public JSGoogConfiguration()
+    {
+    }
+
+    //
+    // 'closure-lib'
+    //
+
+    protected String closureLib = "";
+
+    public boolean isClosureLibSet() {
+        return !closureLib.isEmpty();
+    }
+
+    public String getClosureLib()
+    {
+        try
+        {
+            if (closureLib.equals(""))
+            {
+                return getAbsolutePathFromPathRelativeToMXMLC(
+                        "../../js/lib/google/closure-library");
+            }
+        }
+        catch (Exception e) { /* better to try and fail... */ }
+        
+        return closureLib;
+    }
+
+    @Config
+    @Mapping("closure-lib")
+    public void setClosureLib(ConfigurationValue cv, String value)
+            throws ConfigurationException
+    {
+        if (value != null)
+            closureLib = value;
+    }
+
+    //
+    // Override 'compiler.binding-value-change-event-type'
+    //
+
+    private String bindingValueChangeEventType = "valueChange";
+
+    @Override
+    public String getBindingValueChangeEventType()
+    {
+        return bindingValueChangeEventType;
+    }
+
+    @Override
+    @Config(advanced = true)
+    public void setCompilerBindingValueChangeEventType(ConfigurationValue cv, String b)
+    {
+        bindingValueChangeEventType = b;
+    }
+
+    //
+    // Override 'compiler.mxml.children-as-data'
+    //
+    
+    private Boolean childrenAsData = true;
+    
+    @Override
+    public Boolean getCompilerMxmlChildrenAsData()
+    {
+        return childrenAsData;
+    }
+
+    @Override
+    @Config
+    @Mapping({"compiler", "mxml", "children-as-data"})
+    @FlexOnly
+    public void setCompilerMxmlChildrenAsData(ConfigurationValue cv, Boolean asData) throws ConfigurationException
+    {
+        childrenAsData = asData;
+    }
+
+    //
+    // 'marmotinni'
+    //
+
+    private String marmotinni;
+
+    public String getMarmotinni()
+    {
+        return marmotinni;
+    }
+
+    @Config
+    @Mapping("marmotinni")
+    public void setMarmotinni(ConfigurationValue cv, String value)
+            throws ConfigurationException
+    {
+        marmotinni = value;
+    }
+
+    //
+    // 'sdk-js-lib'
+    //
+
+    protected List<String> sdkJSLib = new ArrayList<String>();
+
+    public List<String> getSDKJSLib()
+    {
+        if (sdkJSLib.size() == 0)
+        {
+            try
+            {
+                String path = getAbsolutePathFromPathRelativeToMXMLC(
+                            "../../frameworks/js/FlexJS/src");
+
+                sdkJSLib.add(path);
+            }
+            catch (Exception e) { /* better to try and fail... */ }
+        }
+        
+        return sdkJSLib;
+    }
+
+    @Config(allowMultiple = true)
+    @Mapping("sdk-js-lib")
+    @InfiniteArguments
+    public void setSDKJSLib(ConfigurationValue cv, List<String> value)
+            throws ConfigurationException
+    {
+        sdkJSLib.addAll(value);
+    }
+
+    //
+    // 'external-js-lib'
+    //
+
+    private List<String> externalJSLib = new ArrayList<String>();
+
+    public List<String> getExternalJSLib()
+    {
+        return externalJSLib;
+    }
+
+    @Config(allowMultiple = true)
+    @Mapping("external-js-lib")
+    @InfiniteArguments
+    public void setExternalJSLib(ConfigurationValue cv, List<String> value)
+            throws ConfigurationException
+    {
+        externalJSLib.addAll(value);
+    }
+
+    //
+    // 'strict-publish'
+    //
+
+    private boolean strictPublish = true;
+
+    public boolean getStrictPublish()
+    {
+        return strictPublish;
+    }
+
+    @Config
+    @Mapping("strict-publish")
+    public void setStrictPublish(ConfigurationValue cv, boolean value)
+            throws ConfigurationException
+    {
+        strictPublish = value;
+    }
+
+    //
+    // 'keep-asdoc'
+    //
+
+    private boolean keepASDoc = true;
+
+    public boolean getKeepASDoc()
+    {
+        return keepASDoc;
+    }
+
+    @Config
+    @Mapping("keep-asdoc")
+    public void setKeepASDoc(ConfigurationValue cv, boolean value)
+            throws ConfigurationException
+    {
+    	keepASDoc = value;
+    }
+
+    
+    
+    //
+    // 'remove-circulars'
+    //
+
+    private boolean removeCirculars = false;
+
+    public boolean getRemoveCirculars()
+    {
+        return removeCirculars;
+    }
+
+    @Config
+    @Mapping("remove-circulars")
+    public void setRemoveCirculars(ConfigurationValue cv, boolean value)
+            throws ConfigurationException
+    {
+    	removeCirculars = value;
+    }
+
+    
+    
+    protected String getAbsolutePathFromPathRelativeToMXMLC(String relativePath)
+        throws IOException
+    {
+        String mxmlcURL = MXMLJSC.class.getProtectionDomain().getCodeSource()
+                .getLocation().getPath();
+
+        File mxmlc = new File(URLDecoder.decode(mxmlcURL, "utf-8"));
+        
+        return new File(mxmlc.getParent() + File.separator + relativePath)
+                .getCanonicalPath();
+    }
+
+    //
+    // 'js-compiler-option'
+    //
+
+    protected List<String> jsCompilerOptions = new ArrayList<String>();
+
+    public List<String> getJSCompilerOptions()
+    {
+        return jsCompilerOptions;
+    }
+
+    @Config(allowMultiple = true)
+    @Mapping("js-compiler-option")
+    @InfiniteArguments
+    public void setJSCompilerOptions(ConfigurationValue cv, List<String> value)
+            throws ConfigurationException
+    {
+    	jsCompilerOptions.addAll(value);
+    }
+
+    //
+    // 'js-output-optimization'
+    //
+
+    protected List<String> jsOutputOptimizations = new ArrayList<String>();
+
+    public List<String> getJSOutputOptimizations()
+    {
+        return jsOutputOptimizations;
+    }
+
+    @Config(allowMultiple = true)
+    @Mapping("js-output-optimization")
+    @InfiniteArguments
+    public void setJSOutputOptimizations(ConfigurationValue cv, List<String> value)
+            throws ConfigurationException
+    {
+    	jsOutputOptimizations.addAll(value);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/jsc/JSCBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/jsc/JSCBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/jsc/JSCBackend.java
new file mode 100644
index 0000000..10d049f
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/jsc/JSCBackend.java
@@ -0,0 +1,47 @@
+/*
+ *
+ *  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.internal.driver.js.jsc;
+
+import java.util.List;
+
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.jsc.JSCPublisher;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSPublisher;
+import org.apache.flex.compiler.internal.driver.mxml.jsc.MXMLJSCJSBackend;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+
+/**
+ * A concrete implementation of the {@link IBackend} API for the 'jsc' code
+ * production.
+ * 
+ * @author Michael Schmalle
+ */
+public class JSCBackend extends MXMLJSCJSBackend
+{
+    @Override
+    public MXMLFlexJSPublisher createPublisher(IASProject project,
+            List<ICompilerProblem> errors, Configuration config)
+    {
+        return new JSCPublisher(config, (FlexJSProject) project);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/node/NodeBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/node/NodeBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/node/NodeBackend.java
new file mode 100644
index 0000000..e4d0503
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/node/NodeBackend.java
@@ -0,0 +1,47 @@
+/*
+ *
+ *  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.internal.driver.js.node;
+
+import java.util.List;
+
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.node.NodePublisher;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSPublisher;
+import org.apache.flex.compiler.internal.driver.js.jsc.JSCBackend;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+
+/**
+ * A concrete implementation of the {@link IBackend} API for the 'node' code
+ * production.
+ *
+ * @author Josh Tynjala
+ */
+public class NodeBackend extends JSCBackend
+{
+    @Override
+    public MXMLFlexJSPublisher createPublisher(IASProject project,
+                                               List<ICompilerProblem> errors, Configuration config)
+    {
+        return new NodePublisher(config, (FlexJSProject) project);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/vf2js/JSVF2JSConfiguration.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/vf2js/JSVF2JSConfiguration.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/vf2js/JSVF2JSConfiguration.java
new file mode 100644
index 0000000..ae620f7
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/vf2js/JSVF2JSConfiguration.java
@@ -0,0 +1,86 @@
+/*
+ *
+ *  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.internal.driver.js.vf2js;
+
+import java.util.List;
+
+import org.apache.flex.compiler.clients.MXMLJSC;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+
+/**
+ * The {@link JSVF2JSConfiguration} class holds all compiler arguments needed for
+ * compiling ActionScript to JavaScript the 'goog' way.
+ * <p>
+ * Specific flags are implemented here for the configuration to be loaded by the
+ * configure() method of {@link MXMLJSC}.
+ * <p>
+ * This class inherits all compiler arguments from the MXMLC compiler.
+ * 
+ * @author Erik de Bruin
+ */
+public class JSVF2JSConfiguration extends JSGoogConfiguration
+{
+    public JSVF2JSConfiguration()
+    {
+    }
+
+    //
+    // 'closure-lib'
+    //
+
+    @Override
+    public String getClosureLib()
+    {
+        try
+        {
+            if (closureLib.equals(""))
+            {
+                closureLib = getAbsolutePathFromPathRelativeToMXMLC(
+                        "../lib/google/closure-library");
+            }
+        }
+        catch (Exception e) { /* better to try and fail... */ }
+        
+        return closureLib;
+    }
+
+    //
+    // 'sdk-js-lib'
+    //
+
+    @Override
+    public List<String> getSDKJSLib()
+    {
+        if (sdkJSLib.size() == 0)
+        {
+            try
+            {
+                String path = getAbsolutePathFromPathRelativeToMXMLC(
+                            "../../../../frameworks/js/vf2js/src");
+
+                sdkJSLib.add(path);
+            }
+            catch (Exception e) { /* better to try and fail... */ }
+        }
+        
+        return sdkJSLib;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/vf2js/VF2JSBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/vf2js/VF2JSBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/vf2js/VF2JSBackend.java
new file mode 100644
index 0000000..d0030fe
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/js/vf2js/VF2JSBackend.java
@@ -0,0 +1,55 @@
+/*
+ *
+ *  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.internal.driver.js.vf2js;
+
+import java.io.FilterWriter;
+
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.vf2js.JSVF2JSEmitter;
+import org.apache.flex.compiler.internal.driver.js.goog.GoogBackend;
+import org.apache.flex.compiler.internal.targets.FlexJSTarget;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+
+/**
+ * @author Erik de Bruin
+ */
+public class VF2JSBackend extends GoogBackend
+{
+
+    @Override
+    public IJSEmitter createEmitter(FilterWriter out)
+    {
+        IJSEmitter emitter = new JSVF2JSEmitter(out);
+        emitter.setDocEmitter(createDocEmitter(emitter));
+        return emitter;
+    }
+    
+    @Override
+    public JSTarget createTarget(IASProject project, ITargetSettings settings,
+            ITargetProgressMonitor monitor)
+    {
+        return new FlexJSTarget(project, settings, monitor);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/MXMLBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/MXMLBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/MXMLBackend.java
new file mode 100644
index 0000000..a569be1
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/MXMLBackend.java
@@ -0,0 +1,80 @@
+/*
+ *
+ *  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.internal.driver.mxml;
+
+import java.io.FilterWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLEmitter;
+import org.apache.flex.compiler.internal.driver.js.JSBackend;
+import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
+import org.apache.flex.compiler.internal.visitor.as.ASNodeSwitch;
+import org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.visitor.IBlockVisitor;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * A concrete implementation of the {@link IBackend} API where the
+ * {@link MXMLBlockWalker} is used to traverse the {@link IMXMLFileNode} AST.
+ * 
+ * @author Erik de Bruin
+ */
+public class MXMLBackend extends JSBackend
+{
+
+    @Override
+    public ISourceFileHandler getSourceFileHandlerInstance()
+    {
+        return MXMLSourceFileHandler.INSTANCE;
+    }
+
+    @Override
+    public IMXMLEmitter createMXMLEmitter(FilterWriter out)
+    {
+        return new MXMLEmitter(out);
+    }
+
+    @Override
+    public IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter mxmlEmitter,
+            IASEmitter asEmitter, IBlockWalker asBlockWalker)
+    {
+        MXMLBlockWalker walker = new MXMLBlockWalker(errors, project,
+                mxmlEmitter, asEmitter, asBlockWalker);
+
+        ASNodeSwitch asStrategy = new ASNodeSwitch(
+                (IBlockVisitor) asBlockWalker);
+        walker.setASStrategy(asStrategy);
+
+        MXMLNodeSwitch strategy = new MXMLNodeSwitch(walker);
+        walker.setMXMLStrategy(strategy);
+
+        return walker;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/MXMLSourceFileHandler.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/MXMLSourceFileHandler.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/MXMLSourceFileHandler.java
new file mode 100644
index 0000000..ef147b2
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/MXMLSourceFileHandler.java
@@ -0,0 +1,85 @@
+/*
+ *
+ *  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.internal.driver.mxml;
+
+import org.apache.flex.compiler.internal.projects.CompilerProject;
+import org.apache.flex.compiler.internal.projects.DefinitionPriority;
+import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
+import org.apache.flex.compiler.internal.units.ASCompilationUnit;
+import org.apache.flex.compiler.internal.units.MXMLCompilationUnit;
+import org.apache.flex.compiler.units.ICompilationUnit;
+
+/**
+ * Implementation of ISourceFileHandler that constructs
+ * {@link ASCompilationUnit}'s. MXMLSourceFileHandler is the SourceFileHandler
+ * that provides JSCompilationUnit for *.mxml files. JSDriver registers
+ * MXMLSourceFileHandler at FlexApplicationProject. This implementation is part
+ * of FalconJS. For more details on FalconJS see
+ * org.apache.flex.compiler.JSDriver
+ */
+public final class MXMLSourceFileHandler implements ISourceFileHandler
+{
+
+    public static final String EXTENSION = "mxml"; //$NON-NLS-1$
+    public static final MXMLSourceFileHandler INSTANCE = new MXMLSourceFileHandler();
+
+    private MXMLSourceFileHandler()
+    {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String[] getExtensions()
+    {
+        return new String[] { EXTENSION };
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ICompilationUnit createCompilationUnit(CompilerProject proj,
+            String path, DefinitionPriority.BasePriority basePriority,
+            int order, String qname, String locale)
+    {
+        return new MXMLCompilationUnit(proj, path, basePriority, order, qname);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean needCompilationUnit(CompilerProject project, String path,
+            String qname, String locale)
+    {
+        return true;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean canCreateInvisibleCompilationUnit()
+    {
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/flexjs/MXMLFlexJSBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/flexjs/MXMLFlexJSBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/flexjs/MXMLFlexJSBackend.java
new file mode 100644
index 0000000..612b089
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/flexjs/MXMLFlexJSBackend.java
@@ -0,0 +1,131 @@
+/*
+ *
+ *  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.internal.driver.mxml.flexjs;
+
+import java.io.FilterWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.codegen.js.IJSWriter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogDocEmitter;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLWriter;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSPublisher;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.driver.mxml.MXMLBackend;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.targets.FlexJSTarget;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.internal.visitor.as.ASNodeSwitch;
+import org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IBlockVisitor;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * A concrete implementation of the {@link IBackend} API where the
+ * {@link MXMLBlockWalker} is used to traverse the {@link IMXMLFileNode} AST.
+ * 
+ * @author Erik de Bruin
+ */
+public class MXMLFlexJSBackend extends MXMLBackend
+{
+
+    @Override
+    public Configurator createConfigurator()
+    {
+        return new Configurator(JSGoogConfiguration.class);
+    }
+
+    @Override
+    public IMXMLEmitter createMXMLEmitter(FilterWriter out)
+    {
+        return new MXMLFlexJSEmitter(out);
+    }
+
+    @Override
+    public IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter mxmlEmitter,
+            IASEmitter asEmitter, IBlockWalker asBlockWalker)
+    {
+        MXMLBlockWalker walker = new MXMLFlexJSBlockWalker(errors, project,
+                mxmlEmitter, asEmitter, asBlockWalker);
+
+        ASNodeSwitch asStrategy = new ASNodeSwitch(
+                (IBlockVisitor) asBlockWalker);
+        walker.setASStrategy(asStrategy);
+
+        MXMLNodeSwitch mxmlStrategy = new MXMLNodeSwitch(walker);
+        walker.setMXMLStrategy(mxmlStrategy);
+
+        return walker;
+    }
+
+    @Override
+    public IDocEmitter createDocEmitter(IASEmitter emitter)
+    {
+        return new JSGoogDocEmitter((IJSEmitter) emitter);
+    }
+
+    @Override
+    public IJSEmitter createEmitter(FilterWriter out)
+    {
+        IJSEmitter emitter = new JSFlexJSEmitter(out);
+        emitter.setDocEmitter(createDocEmitter(emitter));
+        return emitter;
+    }
+
+    @Override
+    public IJSWriter createMXMLWriter(IASProject project,
+            List<ICompilerProblem> problems, ICompilationUnit compilationUnit,
+            boolean enableDebug)
+    {
+        return new MXMLWriter(project, problems, compilationUnit, enableDebug);
+    }
+
+    @Override
+    public JSTarget createTarget(IASProject project, ITargetSettings settings,
+            ITargetProgressMonitor monitor)
+    {
+        return new FlexJSTarget(project, settings, monitor);
+    }
+
+    @Override
+    public MXMLFlexJSPublisher createPublisher(IASProject project,
+            List<ICompilerProblem> errors, Configuration config)
+    {
+        return new MXMLFlexJSPublisher(config, (FlexJSProject) project);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/flexjs/MXMLFlexJSSWCBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/flexjs/MXMLFlexJSSWCBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/flexjs/MXMLFlexJSSWCBackend.java
new file mode 100644
index 0000000..45bc336
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/flexjs/MXMLFlexJSSWCBackend.java
@@ -0,0 +1,121 @@
+/*
+ *
+ *  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.internal.driver.mxml.flexjs;
+
+import java.io.FilterWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.codegen.js.IJSWriter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogDocEmitter;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLWriter;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSEmitter;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.driver.mxml.MXMLBackend;
+import org.apache.flex.compiler.internal.targets.FlexJSSWCTarget;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.internal.visitor.as.ASNodeSwitch;
+import org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IBlockVisitor;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * A concrete implementation of the {@link IBackend} API where the
+ * {@link MXMLBlockWalker} is used to traverse the {@link IMXMLFileNode} AST.
+ * 
+ * @author Erik de Bruin
+ */
+public class MXMLFlexJSSWCBackend extends MXMLBackend
+{
+
+    @Override
+    public Configurator createConfigurator()
+    {
+        return new Configurator(JSGoogConfiguration.class);
+    }
+
+    @Override
+    public IMXMLEmitter createMXMLEmitter(FilterWriter out)
+    {
+        return new MXMLFlexJSEmitter(out);
+    }
+
+    @Override
+    public IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter mxmlEmitter,
+            IASEmitter asEmitter, IBlockWalker asBlockWalker)
+    {
+        MXMLBlockWalker walker = new MXMLFlexJSBlockWalker(errors, project,
+                mxmlEmitter, asEmitter, asBlockWalker);
+
+        ASNodeSwitch asStrategy = new ASNodeSwitch(
+                (IBlockVisitor) asBlockWalker);
+        walker.setASStrategy(asStrategy);
+
+        MXMLNodeSwitch mxmlStrategy = new MXMLNodeSwitch(walker);
+        walker.setMXMLStrategy(mxmlStrategy);
+
+        return walker;
+    }
+
+    @Override
+    public IDocEmitter createDocEmitter(IASEmitter emitter)
+    {
+        return new JSGoogDocEmitter((IJSEmitter) emitter);
+    }
+
+    @Override
+    public IJSEmitter createEmitter(FilterWriter out)
+    {
+        IJSEmitter emitter = new JSFlexJSEmitter(out);
+        emitter.setDocEmitter(createDocEmitter(emitter));
+        return emitter;
+    }
+    
+    @Override
+    public IJSWriter createMXMLWriter(IASProject project,
+            List<ICompilerProblem> problems, ICompilationUnit compilationUnit,
+            boolean enableDebug)
+    {
+        return new MXMLWriter(project, problems, compilationUnit, enableDebug);
+    }
+
+    @Override
+    public JSTarget createTarget(IASProject project, ITargetSettings settings,
+            ITargetProgressMonitor monitor)
+    {
+        return new FlexJSSWCTarget(project, settings, monitor);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/jsc/MXMLJSCJSBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/jsc/MXMLJSCJSBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/jsc/MXMLJSCJSBackend.java
new file mode 100644
index 0000000..18a0388
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/jsc/MXMLJSCJSBackend.java
@@ -0,0 +1,121 @@
+/*
+ *
+ *  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.internal.driver.mxml.jsc;
+
+import java.io.FilterWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.codegen.js.IJSWriter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jsc.JSCJSEmitter;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLWriter;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.jsc.MXMLJSCJSEmitter;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.driver.mxml.flexjs.MXMLFlexJSBackend;
+import org.apache.flex.compiler.internal.targets.FlexJSTarget;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.internal.visitor.as.ASNodeSwitch;
+import org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IBlockVisitor;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * A concrete implementation of the {@link IBackend} API where the
+ * {@link MXMLBlockWalker} is used to traverse the {@link IMXMLFileNode} AST.
+ * 
+ * @author Erik de Bruin
+ */
+public class MXMLJSCJSBackend extends MXMLFlexJSBackend
+{
+
+    @Override
+    public Configurator createConfigurator()
+    {
+        return new Configurator(JSGoogConfiguration.class);
+    }
+
+    @Override
+    public IMXMLEmitter createMXMLEmitter(FilterWriter out)
+    {
+        return new MXMLJSCJSEmitter(out);
+    }
+
+    @Override
+    public IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter mxmlEmitter,
+            IASEmitter asEmitter, IBlockWalker asBlockWalker)
+    {
+        MXMLBlockWalker walker = new MXMLFlexJSBlockWalker(errors, project,
+                mxmlEmitter, asEmitter, asBlockWalker);
+
+        ASNodeSwitch asStrategy = new ASNodeSwitch(
+                (IBlockVisitor) asBlockWalker);
+        walker.setASStrategy(asStrategy);
+
+        MXMLNodeSwitch mxmlStrategy = new MXMLNodeSwitch(walker);
+        walker.setMXMLStrategy(mxmlStrategy);
+
+        return walker;
+    }
+
+    @Override
+    public IDocEmitter createDocEmitter(IASEmitter emitter)
+    {
+        return new JSGoogDocEmitter((IJSEmitter) emitter);
+    }
+
+    @Override
+    public IJSEmitter createEmitter(FilterWriter out)
+    {
+        IJSEmitter emitter = new JSCJSEmitter(out);
+        emitter.setDocEmitter(createDocEmitter(emitter));
+        return emitter;
+    }
+
+    @Override
+    public IJSWriter createMXMLWriter(IASProject project,
+            List<ICompilerProblem> problems, ICompilationUnit compilationUnit,
+            boolean enableDebug)
+    {
+        return new MXMLWriter(project, problems, compilationUnit, enableDebug);
+    }
+
+    @Override
+    public JSTarget createTarget(IASProject project, ITargetSettings settings,
+            ITargetProgressMonitor monitor)
+    {
+        return new FlexJSTarget(project, settings, monitor);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/jsc/MXMLJSCJSSWCBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/jsc/MXMLJSCJSSWCBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/jsc/MXMLJSCJSSWCBackend.java
new file mode 100644
index 0000000..3657c7e
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/jsc/MXMLJSCJSSWCBackend.java
@@ -0,0 +1,121 @@
+/*
+ *
+ *  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.internal.driver.mxml.jsc;
+
+import java.io.FilterWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.codegen.js.IJSWriter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jsc.JSCJSEmitter;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLWriter;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.jsc.MXMLJSCJSEmitter;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.driver.mxml.MXMLBackend;
+import org.apache.flex.compiler.internal.targets.FlexJSSWCTarget;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.internal.visitor.as.ASNodeSwitch;
+import org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IBlockVisitor;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * A concrete implementation of the {@link IBackend} API where the
+ * {@link MXMLBlockWalker} is used to traverse the {@link IMXMLFileNode} AST.
+ * 
+ * @author Erik de Bruin
+ */
+public class MXMLJSCJSSWCBackend extends MXMLBackend
+{
+
+    @Override
+    public Configurator createConfigurator()
+    {
+        return new Configurator(JSGoogConfiguration.class);
+    }
+
+    @Override
+    public IMXMLEmitter createMXMLEmitter(FilterWriter out)
+    {
+        return new MXMLJSCJSEmitter(out);
+    }
+
+    @Override
+    public IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter mxmlEmitter,
+            IASEmitter asEmitter, IBlockWalker asBlockWalker)
+    {
+        MXMLBlockWalker walker = new MXMLFlexJSBlockWalker(errors, project,
+                mxmlEmitter, asEmitter, asBlockWalker);
+
+        ASNodeSwitch asStrategy = new ASNodeSwitch(
+                (IBlockVisitor) asBlockWalker);
+        walker.setASStrategy(asStrategy);
+
+        MXMLNodeSwitch mxmlStrategy = new MXMLNodeSwitch(walker);
+        walker.setMXMLStrategy(mxmlStrategy);
+
+        return walker;
+    }
+
+    @Override
+    public IDocEmitter createDocEmitter(IASEmitter emitter)
+    {
+        return new JSGoogDocEmitter((IJSEmitter) emitter);
+    }
+
+    @Override
+    public IJSEmitter createEmitter(FilterWriter out)
+    {
+        IJSEmitter emitter = new JSCJSEmitter(out);
+        emitter.setDocEmitter(createDocEmitter(emitter));
+        return emitter;
+    }
+    
+    @Override
+    public IJSWriter createMXMLWriter(IASProject project,
+            List<ICompilerProblem> problems, ICompilationUnit compilationUnit,
+            boolean enableDebug)
+    {
+        return new MXMLWriter(project, problems, compilationUnit, enableDebug);
+    }
+
+    @Override
+    public JSTarget createTarget(IASProject project, ITargetSettings settings,
+            ITargetProgressMonitor monitor)
+    {
+        return new FlexJSSWCTarget(project, settings, monitor);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/vf2js/MXMLVF2JSBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/vf2js/MXMLVF2JSBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/vf2js/MXMLVF2JSBackend.java
new file mode 100644
index 0000000..f69d499
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/vf2js/MXMLVF2JSBackend.java
@@ -0,0 +1,132 @@
+/*
+ *
+ *  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.internal.driver.mxml.vf2js;
+
+import java.io.FilterWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.codegen.js.IJSWriter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.driver.IPublisher;
+import org.apache.flex.compiler.internal.codegen.js.vf2js.JSVF2JSDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.vf2js.JSVF2JSEmitter;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLWriter;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.vf2js.MXMLVF2JSEmitter;
+import org.apache.flex.compiler.internal.codegen.mxml.vf2js.MXMLVF2JSPublisher;
+import org.apache.flex.compiler.internal.driver.js.vf2js.JSVF2JSConfiguration;
+import org.apache.flex.compiler.internal.driver.mxml.MXMLBackend;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.targets.FlexJSTarget;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.internal.visitor.as.ASNodeSwitch;
+import org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IBlockVisitor;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * A concrete implementation of the {@link IBackend} API where the
+ * {@link MXMLBlockWalker} is used to traverse the {@link IMXMLFileNode} AST.
+ * 
+ * @author Erik de Bruin
+ */
+public class MXMLVF2JSBackend extends MXMLBackend
+{
+
+    @Override
+    public Configurator createConfigurator()
+    {
+        return new Configurator(JSVF2JSConfiguration.class);
+    }
+
+    @Override
+    public IMXMLEmitter createMXMLEmitter(FilterWriter out)
+    {
+        return new MXMLVF2JSEmitter(out);
+    }
+
+    @Override
+    public IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter mxmlEmitter,
+            IASEmitter asEmitter, IBlockWalker asBlockWalker)
+    {
+        MXMLBlockWalker walker = new MXMLFlexJSBlockWalker(errors, project,
+                mxmlEmitter, asEmitter, asBlockWalker);
+
+        ASNodeSwitch asStrategy = new ASNodeSwitch(
+                (IBlockVisitor) asBlockWalker);
+        walker.setASStrategy(asStrategy);
+
+        MXMLNodeSwitch mxmlStrategy = new MXMLNodeSwitch(walker);
+        walker.setMXMLStrategy(mxmlStrategy);
+
+        return walker;
+    }
+
+    @Override
+    public IDocEmitter createDocEmitter(IASEmitter emitter)
+    {
+        return new JSVF2JSDocEmitter((IJSEmitter) emitter);
+    }
+
+    @Override
+    public IJSEmitter createEmitter(FilterWriter out)
+    {
+        IJSEmitter emitter = new JSVF2JSEmitter(out);
+        emitter.setDocEmitter(createDocEmitter(emitter));
+        return emitter;
+    }
+
+    @Override
+    public IJSWriter createMXMLWriter(IASProject project,
+            List<ICompilerProblem> problems, ICompilationUnit compilationUnit,
+            boolean enableDebug)
+    {
+        return new MXMLWriter(project, problems, compilationUnit, enableDebug);
+    }
+
+    @Override
+    public JSTarget createTarget(IASProject project, ITargetSettings settings,
+            ITargetProgressMonitor monitor)
+    {
+        return new FlexJSTarget(project, settings, monitor);
+    }
+
+    @Override
+    public IPublisher createPublisher(IASProject project,
+            List<ICompilerProblem> errors, Configuration config)
+    {
+        return new MXMLVF2JSPublisher(config, (FlexJSProject) project);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/vf2js/MXMLVF2JSSWCBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/vf2js/MXMLVF2JSSWCBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/vf2js/MXMLVF2JSSWCBackend.java
new file mode 100644
index 0000000..f9390fc
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/driver/mxml/vf2js/MXMLVF2JSSWCBackend.java
@@ -0,0 +1,121 @@
+/*
+ *
+ *  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.internal.driver.mxml.vf2js;
+
+import java.io.FilterWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.codegen.js.IJSWriter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.vf2js.JSVF2JSDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.vf2js.JSVF2JSEmitter;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.MXMLWriter;
+import org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSBlockWalker;
+import org.apache.flex.compiler.internal.codegen.mxml.vf2js.MXMLVF2JSEmitter;
+import org.apache.flex.compiler.internal.driver.js.vf2js.JSVF2JSConfiguration;
+import org.apache.flex.compiler.internal.driver.mxml.MXMLBackend;
+import org.apache.flex.compiler.internal.targets.FlexJSSWCTarget;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.internal.visitor.as.ASNodeSwitch;
+import org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IBlockVisitor;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * A concrete implementation of the {@link IBackend} API where the
+ * {@link MXMLBlockWalker} is used to traverse the {@link IMXMLFileNode} AST.
+ * 
+ * @author Erik de Bruin
+ */
+public class MXMLVF2JSSWCBackend extends MXMLBackend
+{
+
+    @Override
+    public Configurator createConfigurator()
+    {
+        return new Configurator(JSVF2JSConfiguration.class);
+    }
+
+    @Override
+    public IMXMLEmitter createMXMLEmitter(FilterWriter out)
+    {
+        return new MXMLVF2JSEmitter(out);
+    }
+
+    @Override
+    public IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter mxmlEmitter,
+            IASEmitter asEmitter, IBlockWalker asBlockWalker)
+    {
+        MXMLBlockWalker walker = new MXMLFlexJSBlockWalker(errors, project,
+                mxmlEmitter, asEmitter, asBlockWalker);
+
+        ASNodeSwitch asStrategy = new ASNodeSwitch(
+                (IBlockVisitor) asBlockWalker);
+        walker.setASStrategy(asStrategy);
+
+        MXMLNodeSwitch mxmlStrategy = new MXMLNodeSwitch(walker);
+        walker.setMXMLStrategy(mxmlStrategy);
+
+        return walker;
+    }
+
+    @Override
+    public IDocEmitter createDocEmitter(IASEmitter emitter)
+    {
+        return new JSVF2JSDocEmitter((IJSEmitter) emitter);
+    }
+
+    @Override
+    public IJSEmitter createEmitter(FilterWriter out)
+    {
+        IJSEmitter emitter = new JSVF2JSEmitter(out);
+        emitter.setDocEmitter(createDocEmitter(emitter));
+        return emitter;
+    }
+    
+    @Override
+    public IJSWriter createMXMLWriter(IASProject project,
+            List<ICompilerProblem> problems, ICompilationUnit compilationUnit,
+            boolean enableDebug)
+    {
+        return new MXMLWriter(project, problems, compilationUnit, enableDebug);
+    }
+
+    @Override
+    public JSTarget createTarget(IASProject project, ITargetSettings settings,
+            ITargetProgressMonitor monitor)
+    {
+        return new FlexJSSWCTarget(project, settings, monitor);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
new file mode 100644
index 0000000..e0173d2
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/graph/GoogDepsWriter.java
@@ -0,0 +1,682 @@
+/*
+ *
+ *  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.internal.graph;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Scanner;
+import java.util.Set;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.flex.compiler.clients.problems.ProblemQuery;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.problems.FileNotFoundProblem;
+import org.apache.flex.swc.ISWC;
+import org.apache.flex.swc.ISWCFileEntry;
+
+import com.google.common.io.Files;
+
+public class GoogDepsWriter {
+
+    public GoogDepsWriter(File outputFolder, String mainClassName, JSGoogConfiguration config, List<ISWC> swcs)
+	{
+		this.outputFolderPath = outputFolder.getAbsolutePath();
+		this.mainName = mainClassName;
+		removeCirculars = config.getRemoveCirculars();
+		otherPaths = config.getSDKJSLib();
+		otherPaths.add(new File(outputFolder.getParent(), "flexjs/FlexJS/src").getPath());
+		this.swcs = swcs;
+		for (ISWC swc : swcs)
+		{
+			System.out.println("using SWC: " + swc.getSWCFile().getAbsolutePath());
+		}
+	}
+	
+	private ProblemQuery problems;
+	private String outputFolderPath;
+	private String mainName;
+	private List<String> otherPaths;
+	private List<ISWC> swcs;
+	private boolean removeCirculars = false;
+	private boolean problemsFound = false;
+	private ArrayList<GoogDep> dps;
+	
+	private HashMap<String,GoogDep> depMap = new HashMap<String,GoogDep>();
+	private HashMap<String, String> requireMap = new HashMap<String, String>();
+	
+	public ArrayList<String> getListOfFiles(ProblemQuery problems) throws InterruptedException
+	{
+		problemsFound = false;
+		this.problems = problems;
+
+		if (dps == null)
+		{
+			buildDB();
+			dps = sort(mainName);
+		}
+		ArrayList<String> files = new ArrayList<String>();
+		for (GoogDep gd : dps)
+		{
+			files.add(gd.filePath);
+		}
+		return files;
+	}
+	
+	public boolean generateDeps(ProblemQuery problems, StringBuilder depsFileData) throws InterruptedException, FileNotFoundException
+	{
+	    problemsFound = false;
+	    this.problems = problems;
+	    if (dps == null)
+	    {
+	    	buildDB();
+	    	dps = sort(mainName);
+	    }
+		String outString = "// generated by FalconJX" + "\n";
+		int n = dps.size();
+		for (int i = n - 1; i >= 0; i--)
+		{
+			GoogDep gd = dps.get(i);
+			if (!isGoogClass(gd.className)) 
+			{
+			    String s = "goog.addDependency('";
+	            s += relativePath(gd.filePath);
+	            s += "', ['";
+	            s += gd.className;
+	            s += "'], [";
+	            s += getDependencies(gd.deps);
+	            s += "]);\n";
+	            outString += s;
+			}
+		}
+		depsFileData.append(outString);
+		return !problemsFound; 
+	}
+	
+	private boolean isGoogClass(String className)
+	{
+	    return className.startsWith("goog.");
+	}
+	
+	private void buildDB()
+	{
+		addDeps(mainName);
+	}
+	
+    public ArrayList<String> filePathsInOrder = new ArrayList<String>();
+    
+    public ArrayList<String> additionalHTML = new ArrayList<String>();
+    
+    private HashMap<String, GoogDep> visited = new HashMap<String, GoogDep>();
+    
+	private ArrayList<GoogDep> sort(String rootClassName)
+	{
+		ArrayList<GoogDep> arr = new ArrayList<GoogDep>();
+		GoogDep current = depMap.get(rootClassName);
+		sortFunction(current, arr);
+		return arr;
+	}
+	
+	private void sortFunction(GoogDep current, ArrayList<GoogDep> arr)
+	{
+		visited.put(current.className, current);
+		
+		filePathsInOrder.add(current.filePath);
+		if (removeCirculars)
+			removeCirculars(current);
+        System.out.println("Dependencies calculated for '" + current.filePath + "'");
+
+		ArrayList<String> deps = current.deps;
+		for (String className : deps)
+		{
+			if (!visited.containsKey(className) && !isGoogClass(className))
+			{
+				GoogDep gd = depMap.get(className);
+				sortFunction(gd, arr);
+			}
+		}
+		arr.add(current);
+	}
+	
+	private void addDeps(String className)
+	{
+		if (depMap.containsKey(className) || isGoogClass(className))
+			return;
+		
+		// build goog dependency list
+		GoogDep gd = new GoogDep();
+		gd.className = className;
+		gd.filePath = getFilePath(className);
+		if(gd.filePath.isEmpty()) {
+			// TODO Send a ICompilerProblem instead.
+			throw new RuntimeException("Unable to find JavaScript filePath for class: " + className);
+		}
+		depMap.put(gd.className, gd);
+        List<String> fileLines;
+		try {
+			fileLines = Files.readLines(new File(gd.filePath), Charset.defaultCharset());
+            FileInfo fi = getFileInfo(fileLines, className);
+			gd.fileInfo = fi;
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		ArrayList<String> deps = getDirectDependencies(gd.filePath);
+		
+		gd.deps = new ArrayList<String>();
+		for (String dep : deps)
+		{
+			if (gd.fileInfo.impls != null && gd.fileInfo.impls.contains(dep))
+			{
+				if (!requireMap.containsKey(dep))
+				{
+					// we are first class that needs this dependency
+					// at prototype initialization time
+					requireMap.put(dep, className);
+				}
+			}
+			else if (depMap.containsKey(dep) && !isGoogClass(dep))
+		    {
+		        continue;
+		    }
+			gd.deps.add(dep);
+		}
+        for (String dep : deps)
+        {
+            addDeps(dep);
+        }
+	}
+	
+	void removeCirculars(GoogDep gd)
+	{
+		String className = gd.className;
+		
+	    // remove requires that would cause circularity
+	    try
+        {
+            List<String> fileLines = Files.readLines(new File(gd.filePath), Charset.defaultCharset());
+            ArrayList<String> finalLines = new ArrayList<String>();
+            
+            FileInfo fi = gd.fileInfo;
+            int suppressCount = 0;
+            int i = 0;
+            for (String line : fileLines)
+            {
+            	if (i < fi.constructorLine)
+            	{
+                    int c = line.indexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+                    if (c > -1)
+                    {
+                        int c2 = line.indexOf(")");
+                        String s = line.substring(c + 14, c2 - 1);
+                        if (gd.fileInfo.impls == null || !gd.fileInfo.impls.contains(s))
+                        {
+	                        if (requireMap.containsKey(s) && requireMap.get(s) != className)
+	                        {
+	                        	// don't add the require if some class needs it at static initialization
+	                        	// time and that class is not this class
+	                        	suppressCount++;
+	                        	System.out.println(gd.filePath + " removing circular (static): " + s);
+	                        	continue;
+	                        }
+	                        else if (!gd.deps.contains(s))
+	                        {
+	                        	// someone require'd this class
+	                        	suppressCount++;
+	                        	System.out.println(gd.filePath + " removing circular: " + s);
+	                        	continue;
+	                        }
+                        }
+                    }
+            	}
+                finalLines.add(line);
+                i++;
+            }
+            if (suppressCount > 0)
+            {
+            	if (fi.suppressLine > 0)
+            	{
+            		if (fi.suppressLine < fi.constructorLine) 
+            		{
+                		String line = finalLines.get(fi.suppressLine);
+                		int c = line.indexOf("@suppress {");
+                		if (c > -1)
+                		{
+                			if (!line.contains("missingRequire"))
+                			{
+                				line = line.substring(0, c) + "@suppress {missingRequire|" + line.substring(c + 11);
+                				finalLines.remove(fi.suppressLine);
+                				finalLines.add(fi.suppressLine, line);
+                			}
+                		}
+                		else
+                			System.out.println("Confused by @suppress in " + className);
+                	}
+                	else                		
+                	{
+                		// the @suppress was for the constructor or some other thing so add a top-level
+                		// @suppress
+                		if (fi.fileoverviewLine > -1)
+                		{
+                			// there is already a fileOverview but no @suppress
+                			finalLines.add(fi.fileoverviewLine + 1, " *  @suppress {missingRequire}");
+                		}
+                		else if (fi.googProvideLine > -1)
+                		{
+                			finalLines.add(fi.googProvideLine, " */");
+                			finalLines.add(fi.googProvideLine, " *  @suppress {missingRequire}");
+                			finalLines.add(fi.googProvideLine, " *  @fileoverview");
+                			finalLines.add(fi.googProvideLine, "/**");
+                		}
+                		else
+                		{
+                			System.out.println("Confused by @suppress in " + className);
+                		}
+                	}
+            	}
+            	else
+            	{
+            		if (fi.fileoverviewLine > -1)
+            		{
+            			// there is already a fileoverview but no @suppress
+            			finalLines.add(fi.fileoverviewLine + 1, " *  @suppress {missingRequire}");
+            		}
+            		else if (fi.googProvideLine > -1)
+            		{
+            			finalLines.add(fi.googProvideLine, " */");
+            			finalLines.add(fi.googProvideLine, " *  @suppress {missingRequire}");
+            			finalLines.add(fi.googProvideLine, " *  @fileoverview");
+            			finalLines.add(fi.googProvideLine, "/**");
+            		}
+            		else
+            		{
+            			System.out.println("Confused by @suppress in " + className);
+            		}                		
+            	}
+            }
+            File file = new File(gd.filePath);  
+            PrintWriter out = new PrintWriter(new FileWriter(file));  
+            for (String s : finalLines)
+            {
+                out.println(s);
+            }
+            out.close();
+                
+        }
+        catch (IOException e)
+        {
+            e.printStackTrace();
+        }		
+	}
+	
+	FileInfo getFileInfo(List<String> lines, String className)
+	{
+		FileInfo fi = new FileInfo();
+		
+	    int n = lines.size();
+	    fi.constructorLine = n;
+	    fi.suppressLine = -1;
+	    fi.fileoverviewLine = -1;
+	    fi.googProvideLine = -1;
+	    for (int i = 0; i < n; i++)
+	    {
+	        String line = lines.get(i);
+	        int c2;
+	        int c = line.indexOf("goog.inherits");
+	        if (c > -1)
+	        {
+	            String inheritLine = ""; 
+                while (true)
+                {
+                    inheritLine += line;
+                    c2 = line.indexOf(")");
+                    if (c2 > -1)
+                        break;
+                    else
+                    {
+                        i++;
+                        line = lines.get(i);
+                    }
+                }
+	            c = inheritLine.indexOf(",");
+                c2 = inheritLine.indexOf(")");
+                fi.inherits = inheritLine.substring(c + 1, c2).trim();
+                return fi;
+	        }
+	        else
+	        {
+		        c = line.indexOf("@constructor");
+		        if (c > -1)
+		        	fi.constructorLine = i;
+		        else
+		        {
+			        c = line.indexOf("@interface");
+			        if (c > -1)
+			        	fi.constructorLine = i;
+			        else
+			        {
+			        	c = line.indexOf("@suppress");
+			        	if (c > -1)
+			        		fi.suppressLine = i;
+			        	else
+			        	{
+				        	c = line.indexOf("@fileoverview");
+				        	if (c > -1)
+				        		fi.fileoverviewLine = i;
+				        	else
+				        	{
+					        	c = line.indexOf("goog.provide");
+					        	if (c > -1)
+					        		fi.googProvideLine = i;
+					        	else
+					        	{
+					        		c = line.indexOf("@implements");
+					        		if (c > -1)
+					        		{
+					        			if (fi.impls == null)
+					        				fi.impls = new ArrayList<String>();
+					        			c2 = line.indexOf("}", c);
+					        			String impl = line.substring(c + 13, c2);
+					        			fi.impls.add(impl);
+					        		}
+					        		else
+					        		{
+						        		c = line.indexOf("@extends");
+						        		if (c > -1)
+						        		{
+						        			if (fi.impls == null)
+						        				fi.impls = new ArrayList<String>();
+						        			c2 = line.indexOf("}", c);
+						        			String impl = line.substring(c + 10, c2);
+						        			fi.impls.add(impl);
+						        		}					        			
+					        		}
+					        	}
+				        	}
+			        	}
+			        }
+		        }
+	        }
+	    }
+	    return fi;
+	}
+	
+	String getFilePath(String className)
+	{
+	    String fn;
+	    File destFile;
+	    File f;
+	    
+		String classPath = className.replace(".", File.separator);
+		// special case app names with underscores, but hope that
+		// no other class names have underscores in them
+        if (className.equals(mainName))
+        	classPath = className;
+        
+        fn = outputFolderPath + File.separator + classPath + ".js";
+        f = new File(fn);
+        if (f.exists())
+        {
+            return fn;
+        }
+        
+        for (String otherPath : otherPaths)
+        {
+    		fn = otherPath + File.separator + classPath + ".js";
+    		f = new File(fn);
+    		if (f.exists())
+    		{
+    			fn = outputFolderPath + File.separator + classPath + ".js";
+    			destFile = new File(fn);
+    			// copy source to output
+    			try {
+    				FileUtils.copyFile(f, destFile);
+    				
+    				// (erikdebruin) copy class assets files
+    				if (className.contains("org.apache.flex"))
+    				{
+    				    File assetsDir = new File(f.getParentFile(), "assets");
+    				    if (assetsDir.exists())
+    				    {
+    				        String nameOfClass = className.substring(className.lastIndexOf('_') + 1);
+    				        
+    				        File[] assetsList = assetsDir.listFiles();
+					        assert assetsList != null;
+					        for (File assetFile : assetsList) {
+						        String assetFileName = assetFile.getName();
+
+						        if (assetFile.isFile() && assetFileName.indexOf(nameOfClass) == 0) {
+							        String pathOfClass;
+							        pathOfClass = className.substring(0, className.lastIndexOf('_'));
+							        pathOfClass = pathOfClass.replace(".", File.separator);
+
+							        destFile = new File(outputFolderPath +
+									        File.separator + pathOfClass +
+									        File.separator + "assets" +
+									        File.separator + assetFileName);
+							        FileUtils.copyFile(assetFile, destFile);
+
+							        destFile = new File(outputFolderPath.replace("js-debug", "js-release") +
+									        File.separator + pathOfClass +
+									        File.separator + "assets" +
+									        File.separator + assetFileName);
+							        FileUtils.copyFile(assetFile, destFile);
+
+							        System.out.println("Copied assets of the '" + nameOfClass + "' class");
+						        }
+					        }
+    				    }
+    				}
+    			} catch (IOException e) {
+    				System.out.println("Error copying file for class: " + className);
+    			}
+    			return fn;
+    		}
+        }
+
+		String fwdClassPath = className.replace(".", "/");
+		String bckClassPath = className.replace(".", "\\");
+        for (ISWC swc : swcs)
+        {
+        	ISWCFileEntry fileEntry =  swc.getFile("js/src/" + fwdClassPath + ".js");
+        	if (fileEntry == null)
+        		fileEntry = swc.getFile("js/out/" + fwdClassPath + ".js");
+        	if (fileEntry == null)
+        		fileEntry = swc.getFile("js/src/" + bckClassPath + ".js");
+        	if (fileEntry == null)
+        		fileEntry = swc.getFile("js/out/" + bckClassPath + ".js");
+            if (fileEntry == null)
+                fileEntry = swc.getFile("js\\src\\" + bckClassPath + ".js");
+            if (fileEntry == null)
+                fileEntry = swc.getFile("js\\out\\" + bckClassPath + ".js");
+    		if (fileEntry != null)
+    		{
+    			fn = outputFolderPath + File.separator + classPath + ".js";
+    			destFile = new File(fn);
+    			// copy source to output
+    			try {
+    				InputStream inStream = fileEntry.createInputStream();
+    				OutputStream outStream = FileUtils.openOutputStream(destFile);
+    				byte[] b = new byte[1024 * 1024];
+    				int bytes_read;
+    				while ((bytes_read = inStream.read(b)) != -1)
+    				{
+        				outStream.write(b, 0, bytes_read);
+    				}
+    				outStream.flush();
+    				outStream.close();    					
+    				inStream.close();
+
+    				// (erikdebruin) copy class assets files
+    				if (className.contains("org.apache.flex"))
+    				{
+    					Map<String, ISWCFileEntry> includedfiles = swc.getFiles();
+    					Set<String> includedList = includedfiles.keySet();
+    					for (String included : includedList)
+    					{
+    						if (included.contains(".png") ||
+    							included.contains(".gif") ||
+    							included.contains(".jpg") ||
+    							included.contains(".json"))
+    						{
+    							fileEntry = includedfiles.get(included);
+    			    			String assetName = outputFolderPath + File.separator + included;
+    			    			File assetFile = new File(assetName);
+    		    				inStream = fileEntry.createInputStream();
+    		    				outStream = FileUtils.openOutputStream(assetFile);
+    		    				b = new byte[inStream.available()];
+    		    				inStream.read(b);
+    		    				outStream.write(b);
+    		    				inStream.close();
+    		    				outStream.flush();
+    		    				outStream.close();
+						        System.out.println("Copied asset " + assetName);
+    						}
+    					}
+    				}
+    			} catch (IOException e) {
+    				System.out.println("Error copying file for class: " + className);
+    			}
+    			return fn;
+    		}
+        }
+        
+		System.out.println("Could not find file for class: " + className);
+		problems.add(new FileNotFoundProblem(className));
+		problemsFound = true;
+		return "";
+	}
+	
+	private ArrayList<String> getDirectDependencies(String fn)
+	{
+		ArrayList<String> deps = new ArrayList<String>();
+		
+		FileInputStream fis;
+		try {
+			fis = new FileInputStream(fn);
+			Scanner scanner = new Scanner(fis, "UTF-8");
+			boolean inInjectHTML = false;
+			while (scanner.hasNextLine())
+			{
+				String s = scanner.nextLine();
+				if (s.contains("goog.inherits"))
+					break;
+                if (inInjectHTML)
+                {
+                    int c = s.indexOf("</inject_html>");
+                    if (c > -1)
+                    {
+                        inInjectHTML = false;
+                        continue;
+                    }
+                }    
+                if (inInjectHTML)
+                {
+                	s = s.trim();
+                	if (s.startsWith("*"))
+                		s = s.substring(1);
+				    additionalHTML.add(s);
+				    continue;
+                }
+				int c = s.indexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken());
+				if (c > -1)
+				{
+					int c2 = s.indexOf(")");
+					s = s.substring(c + 14, c2 - 1);
+					deps.add(s);
+				}
+                c = s.indexOf("<inject_html>");
+                if (c > -1)
+                {
+                    inInjectHTML = true;
+                }
+			}
+			scanner.close();
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		}
+		return deps;
+	}
+	
+	private String getDependencies(ArrayList<String> deps)
+	{
+		String s = "";
+		for (String dep : deps)
+		{
+			if (s.length() > 0)
+			{
+				s += ", ";
+			}
+			s += "'" + dep + "'";			
+		}
+		return s;
+	}
+
+	String relativePath(String path)
+	{
+        if (path.indexOf(outputFolderPath) == 0)
+        {
+            path = path.replace(outputFolderPath, "../../..");
+        }
+        else
+        {
+    	    for (String otherPath : otherPaths)
+    	    {
+        		if (path.indexOf(otherPath) == 0)
+        		{
+        			path = path.replace(otherPath, "../../..");
+        			
+        		}
+    	    }
+        }
+		// paths are actually URIs and always have forward slashes
+		path = path.replace('\\', '/');
+		return path;
+	}
+	private class GoogDep
+	{
+		public String filePath;
+		public String className;
+		public ArrayList<String> deps;
+		public FileInfo fileInfo;
+		
+	}
+	
+	@SuppressWarnings( "unused" )
+	private class FileInfo
+	{
+		public String inherits;
+		public ArrayList<String> impls;
+		public int constructorLine;
+		public int suppressLine;
+		public int fileoverviewLine;
+		public int googProvideLine;
+	}
+}


[39/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/IfEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/IfEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/IfEmitter.java
new file mode 100644
index 0000000..5370a95
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/IfEmitter.java
@@ -0,0 +1,117 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IConditionalNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IIfNode;
+import org.apache.flex.compiler.tree.as.ITerminalNode;
+
+public class IfEmitter extends JSSubEmitter implements
+        ISubEmitter<IIfNode>
+{
+    public IfEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IIfNode node)
+    {
+        IConditionalNode conditional = (IConditionalNode) node.getChild(0);
+        emitConditional(conditional, false);
+
+        IConditionalNode[] nodes = node.getElseIfNodes();
+        if (nodes.length > 0)
+        {
+            for (int i = 0; i < nodes.length; i++)
+            {
+                IConditionalNode enode = nodes[i];
+                IContainerNode snode = (IContainerNode) enode
+                        .getStatementContentsNode();
+
+                final boolean isImplicit = EmitterUtils.isImplicit(snode);
+                if (isImplicit)
+                    writeNewline();
+                else
+                    write(ASEmitterTokens.SPACE);
+
+                emitConditional(enode, true);
+            }
+        }
+
+        ITerminalNode elseNode = node.getElseNode();
+        if (elseNode != null)
+        {
+            emitElse(elseNode);
+        }
+        
+    }
+
+    protected void emitConditional(IConditionalNode node, boolean isElseIf)
+    {
+        startMapping(node);
+        if (isElseIf)
+        {
+            writeToken(ASEmitterTokens.ELSE);
+        }
+        writeToken(ASEmitterTokens.IF);
+        write(ASEmitterTokens.PAREN_OPEN);
+        endMapping(node);
+
+        IASNode conditionalExpression = node.getChild(0);
+        getWalker().walk(conditionalExpression);
+
+        startMapping(node, conditionalExpression);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        IContainerNode xnode = (IContainerNode) node.getStatementContentsNode();
+        if (!EmitterUtils.isImplicit(xnode))
+            write(ASEmitterTokens.SPACE);
+        endMapping(node);
+
+        getWalker().walk(node.getChild(1)); // BlockNode
+    }
+
+    protected void emitElse(ITerminalNode node)
+    {
+        IContainerNode cnode = (IContainerNode) node.getChild(0);
+
+        // if an implicit if, add a newline with no space
+        final boolean isImplicit = EmitterUtils.isImplicit(cnode);
+        if (isImplicit)
+            writeNewline();
+        else
+            write(ASEmitterTokens.SPACE);
+
+        startMapping(node);
+        write(ASEmitterTokens.ELSE);
+        if (!isImplicit)
+            write(ASEmitterTokens.SPACE);
+        endMapping(node);
+
+        getWalker().walk(node); // TerminalNode
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/InterfaceEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/InterfaceEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/InterfaceEmitter.java
new file mode 100644
index 0000000..626896f
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/InterfaceEmitter.java
@@ -0,0 +1,131 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSDocEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IAccessorNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+
+public class InterfaceEmitter extends JSSubEmitter implements
+        ISubEmitter<IInterfaceNode>
+{
+
+    public InterfaceEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IInterfaceNode node)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+
+        ICompilerProject project = getWalker().getProject();
+
+        fjs.getDocEmitter().emitInterfaceDoc(node, project);
+
+        String qname = node.getQualifiedName();
+        if (qname != null && !qname.equals(""))
+        {
+            write(getEmitter().formatQualifiedName(qname));
+            write(ASEmitterTokens.SPACE);
+            writeToken(ASEmitterTokens.EQUAL);
+            write(ASEmitterTokens.FUNCTION);
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(ASEmitterTokens.PAREN_CLOSE);
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.BLOCK_OPEN);
+            writeNewline();
+            write(ASEmitterTokens.BLOCK_CLOSE);
+            write(ASEmitterTokens.SEMICOLON);
+        }
+
+        final IDefinitionNode[] members = node.getAllMemberDefinitionNodes();
+        for (IDefinitionNode mnode : members)
+        {
+            boolean isAccessor = mnode.getNodeID() == ASTNodeID.GetterID
+                    || mnode.getNodeID() == ASTNodeID.SetterID;
+
+            if (!isAccessor
+                    || !getModel().getInterfacePropertyMap().contains(qname))
+            {
+                writeNewline();
+
+                if (isAccessor)
+                {
+                	IAccessorNode accessor = (IAccessorNode)mnode;
+                	String propType = accessor.getVariableType();
+                	IExpressionNode typeNode = accessor.getVariableTypeNode();
+                	ITypeDefinition typeDef = typeNode.resolveType(project);
+                	String packageName = typeDef.getPackageName();
+                	packageName = project.getActualPackageName(packageName);
+                    write(JSDocEmitterTokens.JSDOC_OPEN);
+                    write(ASEmitterTokens.SPACE);
+                    fjs.getDocEmitter().emitType(propType, packageName);
+                    write(ASEmitterTokens.SPACE);
+                    write(JSDocEmitterTokens.JSDOC_CLOSE);
+                }
+                write(getEmitter().formatQualifiedName(qname));
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                write(JSEmitterTokens.PROTOTYPE);
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                write(mnode.getQualifiedName());
+
+                if (isAccessor
+                        && !getModel().getInterfacePropertyMap()
+                                .contains(qname))
+                {
+                    getModel().getInterfacePropertyMap().add(qname);
+                }
+                else
+                {
+                    write(ASEmitterTokens.SPACE);
+                    writeToken(ASEmitterTokens.EQUAL);
+                    write(ASEmitterTokens.FUNCTION);
+
+                    fjs.emitParameters(((IFunctionNode) mnode)
+                            .getParametersContainerNode());
+
+                    write(ASEmitterTokens.SPACE);
+                    write(ASEmitterTokens.BLOCK_OPEN);
+                    writeNewline();
+                    write(ASEmitterTokens.BLOCK_CLOSE);
+                }
+
+                write(ASEmitterTokens.SEMICOLON);
+            }
+        }
+        fjs.getPackageFooterEmitter().emitClassInfo(node);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/IterationFlowEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/IterationFlowEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/IterationFlowEmitter.java
new file mode 100644
index 0000000..25c2d10
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/IterationFlowEmitter.java
@@ -0,0 +1,54 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IIterationFlowNode;
+
+public class IterationFlowEmitter extends JSSubEmitter implements
+        ISubEmitter<IIterationFlowNode>
+{
+    public IterationFlowEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IIterationFlowNode node)
+    {
+        startMapping(node);
+        write(node.getKind().toString().toLowerCase());
+        IIdentifierNode lnode = node.getLabelNode();
+        if (lnode != null)
+        {
+            write(ASEmitterTokens.SPACE);
+            endMapping(node);
+            getWalker().walk(lnode);
+        }
+        else
+        {
+            endMapping(node);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LanguageIdentifierEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LanguageIdentifierEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LanguageIdentifierEmitter.java
new file mode 100644
index 0000000..8f01b71
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LanguageIdentifierEmitter.java
@@ -0,0 +1,44 @@
+package org.apache.flex.compiler.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.common.ISourceLocation;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
+
+public class LanguageIdentifierEmitter extends JSSubEmitter implements
+        ISubEmitter<ILanguageIdentifierNode>
+{
+    public LanguageIdentifierEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(ILanguageIdentifierNode node)
+    {
+        startMapping((ISourceLocation) node);
+        if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.ANY_TYPE)
+        {
+            write(ASEmitterTokens.ANY_TYPE);
+        }
+        else if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.REST)
+        {
+            write(ASEmitterTokens.ELLIPSIS);
+        }
+        else if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.SUPER)
+        {
+            write(ASEmitterTokens.SUPER);
+        }
+        else if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.THIS)
+        {
+            write(ASEmitterTokens.THIS);
+        }
+        else if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.VOID)
+        {
+            write(ASEmitterTokens.VOID);
+        }
+        endMapping((ISourceLocation) node);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralContainerEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralContainerEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralContainerEmitter.java
new file mode 100644
index 0000000..d1d24fd
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralContainerEmitter.java
@@ -0,0 +1,96 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.ILiteralContainerNode;
+
+public class LiteralContainerEmitter extends JSSubEmitter implements
+        ISubEmitter<ILiteralContainerNode>
+{
+    public LiteralContainerEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(ILiteralContainerNode node)
+    {
+        final IContainerNode cnode = node.getContentsNode();
+        final IContainerNode.ContainerType type = cnode.getContainerType();
+        String preFix = null;
+        String postFix = null;
+
+        if (type == IContainerNode.ContainerType.BRACES)
+        {
+            preFix = ASEmitterTokens.BLOCK_OPEN.getToken();
+            postFix = ASEmitterTokens.BLOCK_CLOSE.getToken();
+        }
+        else if (type == IContainerNode.ContainerType.BRACKETS)
+        {
+            preFix = ASEmitterTokens.SQUARE_OPEN.getToken();
+            postFix = ASEmitterTokens.SQUARE_CLOSE.getToken();
+        }
+        else if (type == IContainerNode.ContainerType.IMPLICIT)
+        {
+            // nothing to write, move along
+        }
+        else if (type == IContainerNode.ContainerType.PARENTHESIS)
+        {
+            preFix = ASEmitterTokens.PAREN_OPEN.getToken();
+            postFix = ASEmitterTokens.PAREN_CLOSE.getToken();
+        }
+
+        if (preFix != null)
+        {
+            startMapping(node);
+            write(preFix);
+            endMapping(node);
+        }
+
+        final int len = cnode.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            IASNode child = cnode.getChild(i);
+            getWalker().walk(child);
+            if (i < len - 1)
+            {
+                //we're mapping the comma to the literal container, but we fill
+                //the space between the current child and the next because we
+                //don't know exactly where the comma appears in ActionScript
+                startMapping(node, child);
+                writeToken(ASEmitterTokens.COMMA);
+                endMapping(node);
+            }
+        }
+
+        if (postFix != null)
+        {
+            startMapping(node, node.getLine(), node.getColumn() + node.getAbsoluteEnd() - node.getAbsoluteStart() - 1);
+            write(postFix);
+            endMapping(node);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
new file mode 100644
index 0000000..70d2c48
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
@@ -0,0 +1,134 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
+import org.apache.flex.compiler.internal.tree.as.LiteralNode;
+import org.apache.flex.compiler.internal.tree.as.RegExpLiteralNode;
+import org.apache.flex.compiler.internal.tree.as.XMLLiteralNode;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.ILiteralNode;
+import org.apache.flex.compiler.tree.as.ILiteralNode.LiteralType;
+
+public class LiteralEmitter extends JSSubEmitter implements
+        ISubEmitter<ILiteralNode>
+{
+
+    public LiteralEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(ILiteralNode node)
+    {
+        boolean isWritten = false;
+
+        String s = node.getValue(true);
+        if (!(node instanceof RegExpLiteralNode))
+        {
+            if (node.getLiteralType() == LiteralType.XML)
+            {
+                write("new XML");
+                writeToken(ASEmitterTokens.PAREN_OPEN);
+            	XMLLiteralNode xmlNode = (XMLLiteralNode)node;
+            	if (xmlNode.getContentsNode().getChildCount() == 1)
+            	{
+	            	if (s.contains("'"))
+	            		write("\"" + s + "\"");
+	            	else
+	            		write("'" + s + "'");
+	                isWritten = true;
+            	}
+            	else
+            	{
+            		// probably contains {initializers}
+            		int n = xmlNode.getContentsNode().getChildCount();
+            		for (int i = 0; i < n; i++)
+            		{
+            			if (i > 0)
+            				write(" + ");
+            			IASNode child = xmlNode.getContentsNode().getChild(i);
+            			if (child instanceof LiteralNode)
+            			{
+            				s = ((LiteralNode)child).getValue(true);
+        	            	if (s.contains("'"))
+        	            		write("\"" + s + "\"");
+        	            	else
+        	            		write("'" + s + "'");
+        	                isWritten = true;
+            			}
+            			else if (child instanceof IdentifierNode)
+            			{
+            				s = getEmitter().stringifyNode(child);
+            				write(s);
+            			}
+            		}
+            	}
+                writeToken(ASEmitterTokens.PAREN_CLOSE);
+            }
+            s = s.replaceAll("\n", "__NEWLINE_PLACEHOLDER__");
+            s = s.replaceAll("\r", "__CR_PLACEHOLDER__");
+            s = s.replaceAll("\t", "__TAB_PLACEHOLDER__");
+            s = s.replaceAll("\f", "__FORMFEED_PLACEHOLDER__");
+            s = s.replaceAll("\b", "__BACKSPACE_PLACEHOLDER__");
+            s = s.replaceAll("\\\\\"", "__QUOTE_PLACEHOLDER__");
+            s = s.replaceAll("\\\\", "__ESCAPE_PLACEHOLDER__");
+            //s = "\'" + s.replaceAll("\'", "\\\\\'") + "\'";
+            s = s.replaceAll("__ESCAPE_PLACEHOLDER__", "\\\\\\\\");
+            s = s.replaceAll("__QUOTE_PLACEHOLDER__", "\\\\\"");
+            s = s.replaceAll("__BACKSPACE_PLACEHOLDER__", "\\\\b");
+            s = s.replaceAll("__FORMFEED_PLACEHOLDER__", "\\\\f");
+            s = s.replaceAll("__TAB_PLACEHOLDER__", "\\\\t");
+            s = s.replaceAll("__CR_PLACEHOLDER__", "\\\\r");
+            s = s.replaceAll("__NEWLINE_PLACEHOLDER__", "\\\\n");
+            if (node.getLiteralType() == LiteralType.STRING)
+            {
+            	char c = s.charAt(0);
+            	if (c == '"')
+            	{
+            		s = s.substring(1, s.length() - 1);
+            		s = s.replace("\"", "\\\"");
+            		s = "\"" + s + "\"";
+            	}
+            	else if (c == '\'')
+            	{
+            		s = s.substring(1, s.length() - 1);
+            		s = s.replace("'", "\\'");            		
+            		s = "'" + s + "'";
+            	}
+            	s = s.replace("\u2028", "\\u2028");
+            	s = s.replace("\u2029", "\\u2029");
+            }
+
+        }
+
+        if (!isWritten)
+        {
+			startMapping(node);
+            write(s);
+			endMapping(node);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
new file mode 100644
index 0000000..7088431
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
@@ -0,0 +1,323 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
+import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.tree.as.FunctionCallNode;
+import org.apache.flex.compiler.internal.tree.as.GetterNode;
+import org.apache.flex.compiler.internal.tree.as.IdentifierNode;
+import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
+import org.apache.flex.compiler.internal.tree.as.NamespaceAccessExpressionNode;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.IOperatorNode.OperatorType;
+import org.apache.flex.compiler.utils.ASNodeUtils;
+
+public class MemberAccessEmitter extends JSSubEmitter implements
+        ISubEmitter<IMemberAccessExpressionNode>
+{
+
+    public MemberAccessEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IMemberAccessExpressionNode node)
+    {
+        if (ASNodeUtils.hasParenOpen(node))
+            write(ASEmitterTokens.PAREN_OPEN);
+
+        IASNode leftNode = node.getLeftOperandNode();
+        IASNode rightNode = node.getRightOperandNode();
+
+    	JSFlexJSEmitter fjs = (JSFlexJSEmitter)getEmitter();
+        IDefinition def = node.resolve(getProject());
+        if (def == null)
+        {
+        	IASNode parentNode = node.getParent();
+        	// could be XML
+        	boolean isXML = false;
+        	boolean isProxy = false;
+        	if (leftNode instanceof MemberAccessExpressionNode)
+        		isXML = fjs.isXMLList((MemberAccessExpressionNode)leftNode);
+        	else if (leftNode instanceof IExpressionNode)
+        		isXML = fjs.isXML((IExpressionNode)leftNode);
+        	if (leftNode instanceof MemberAccessExpressionNode)
+        		isProxy = fjs.isProxy((MemberAccessExpressionNode)leftNode);
+        	else if (leftNode instanceof IExpressionNode)
+        		isProxy = fjs.isProxy((IExpressionNode)leftNode);
+        	if (isXML)
+        	{
+        		boolean descendant = (node.getOperator() == OperatorType.DESCENDANT_ACCESS);
+        		boolean child = (node.getOperator() == OperatorType.MEMBER_ACCESS) && 
+        							(!(parentNode instanceof FunctionCallNode)) &&
+        							rightNode.getNodeID() != ASTNodeID.Op_AtID;
+        		if (descendant || child)
+	        	{
+	        		writeLeftSide(node, leftNode, rightNode);
+	        		if (descendant)
+	        			write(".descendants('");
+	        		if (child)
+	        			write(".child('");	        			
+	        		String s = fjs.stringifyNode(rightNode);
+	        		int dot = s.indexOf('.');
+	        		if (dot != -1)
+	        		{
+	        			String name = s.substring(0, dot);
+	        			String afterDot = s.substring(dot);
+	        			write(name);
+	        			write("')");
+	        			write(afterDot);
+	        		}
+	        		else
+	        		{
+	        			write(s);
+	        			write("')");
+	        		}
+	        		return;
+	        	}
+        	}
+        	else if (isProxy)
+        	{
+        		boolean child = (node.getOperator() == OperatorType.MEMBER_ACCESS) && 
+        							(!(parentNode instanceof FunctionCallNode)) &&
+        							rightNode.getNodeID() != ASTNodeID.Op_AtID;
+        		if (child)
+	        	{
+	        		writeLeftSide(node, leftNode, rightNode);
+	        		if (child)
+	        			write(".getProperty('");
+	        		String s = fjs.stringifyNode(rightNode);
+	        		int dot = s.indexOf('.');
+	        		if (dot != -1)
+	        		{
+	        			String name = s.substring(0, dot);
+	        			String afterDot = s.substring(dot);
+	        			write(name);
+	        			write("')");
+	        			write(afterDot);
+	        		}
+	        		else
+	        		{
+	        			write(s);
+	        			write("')");
+	        		}
+	        		return;
+	        	}
+        	}
+        	else if (rightNode instanceof NamespaceAccessExpressionNode)
+        	{
+        		// if you define a local variable with the same URI as a
+        		// namespace that defines a namespaced property
+        		// it doesn't resolve above so we handle it here
+        		NamespaceAccessExpressionNode naen = (NamespaceAccessExpressionNode)rightNode;
+        		IDefinition d = naen.getLeftOperandNode().resolve(getProject());
+        		IdentifierNode r = (IdentifierNode)(naen.getRightOperandNode());
+        		// output bracket access with QName
+        		writeLeftSide(node, leftNode, rightNode);
+        		write(ASEmitterTokens.SQUARE_OPEN);
+        		write(ASEmitterTokens.NEW);
+        		write(ASEmitterTokens.SPACE);
+        		write(IASLanguageConstants.QName);
+        		write(ASEmitterTokens.PAREN_OPEN);
+        		write(d.getBaseName());
+        		write(ASEmitterTokens.COMMA);
+        		write(ASEmitterTokens.SPACE);
+        		write(ASEmitterTokens.SINGLE_QUOTE);
+        		write(r.getName());
+        		write(ASEmitterTokens.SINGLE_QUOTE);
+        		write(ASEmitterTokens.PAREN_CLOSE);
+        		write(ASEmitterTokens.SQUARE_CLOSE);
+        		return;
+        	}
+        }
+        else if (fjs.isDateProperty(node))
+        {
+    		writeLeftSide(node, leftNode, rightNode);
+            write(".get");
+            String rightName = ((IIdentifierNode)rightNode).getName();
+            String firstChar = rightName.substring(0, 1);
+            firstChar = firstChar.toUpperCase();
+            rightName = rightName.substring(1);
+            write(firstChar);
+            write(rightName);
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(ASEmitterTokens.PAREN_CLOSE);
+    		return;
+        }
+        else if (def.getParent() != null &&
+        		def.getParent().getQualifiedName().equals("Array"))
+        {
+        	if (def.getBaseName().equals("removeAt"))
+        	{
+        		writeLeftSide(node, leftNode, rightNode);
+        		write(".splice");
+        		return;
+        	}
+        	else if (def.getBaseName().equals("insertAt"))
+        	{
+        		writeLeftSide(node, leftNode, rightNode);
+        		write(".splice");
+        		return;
+        	}
+        }
+    	else if (rightNode instanceof NamespaceAccessExpressionNode)
+    	{
+    		NamespaceAccessExpressionNode naen = (NamespaceAccessExpressionNode)rightNode;
+    		IDefinition d = naen.getLeftOperandNode().resolve(getProject());
+    		IdentifierNode r = (IdentifierNode)(naen.getRightOperandNode());
+    		// output bracket access with QName
+    		writeLeftSide(node, leftNode, rightNode);
+    		write(ASEmitterTokens.SQUARE_OPEN);
+    		write(ASEmitterTokens.NEW);
+    		write(ASEmitterTokens.SPACE);
+    		write(IASLanguageConstants.QName);
+    		write(ASEmitterTokens.PAREN_OPEN);
+    		write(fjs.formatQualifiedName(d.getBaseName()));
+    		write(ASEmitterTokens.COMMA);
+    		write(ASEmitterTokens.SPACE);
+    		write(ASEmitterTokens.SINGLE_QUOTE);
+    		write(r.getName());
+    		write(ASEmitterTokens.SINGLE_QUOTE);
+    		write(ASEmitterTokens.PAREN_CLOSE);
+    		write(ASEmitterTokens.SQUARE_CLOSE);
+    		return;
+    	}
+        boolean isStatic = false;
+        if (def != null && def.isStatic())
+            isStatic = true;
+        boolean needClosure = false;
+        if (def instanceof FunctionDefinition && (!(def instanceof AccessorDefinition))
+        		&& !def.getBaseName().equals("constructor")) // don't wrap references to obj.constructor
+        {
+        	IASNode parentNode = node.getParent();
+        	if (parentNode != null)
+        	{
+				ASTNodeID parentNodeId = parentNode.getNodeID();
+				// we need a closure if this MAE is the top-level in a chain
+				// of MAE and not in a function call.
+				needClosure = !isStatic && parentNodeId != ASTNodeID.FunctionCallID &&
+							parentNodeId != ASTNodeID.MemberAccessExpressionID &&
+							parentNodeId != ASTNodeID.ArrayIndexExpressionID;
+        		
+        	}
+        }
+
+        boolean continueWalk = true;
+        if (!isStatic)
+        {
+        	if (needClosure)
+        		getEmitter().emitClosureStart();
+        	
+        	continueWalk = writeLeftSide(node, leftNode, rightNode);
+            if (continueWalk)
+            {
+                startMapping(node, node.getLeftOperandNode());
+                write(node.getOperator().getOperatorText());
+                endMapping(node);
+            }
+        }
+
+        if (continueWalk)
+        {
+            getWalker().walk(node.getRightOperandNode());
+        }
+        
+        if (needClosure)
+        {
+        	write(ASEmitterTokens.COMMA);
+        	write(ASEmitterTokens.SPACE);
+        	writeLeftSide(node, leftNode, rightNode);
+        	getEmitter().emitClosureEnd(node);
+        }
+        
+        if (ASNodeUtils.hasParenClose(node))
+            write(ASEmitterTokens.PAREN_CLOSE);
+    }
+
+    private boolean writeLeftSide(IMemberAccessExpressionNode node, IASNode leftNode, IASNode rightNode)
+    {
+        if (!(leftNode instanceof ILanguageIdentifierNode && ((ILanguageIdentifierNode) leftNode)
+                .getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.THIS))
+        {
+            IDefinition rightDef = null;
+            if (rightNode instanceof IIdentifierNode)
+                rightDef = ((IIdentifierNode) rightNode)
+                        .resolve(getProject());
+
+            if (leftNode.getNodeID() != ASTNodeID.SuperID)
+            {
+                getWalker().walk(node.getLeftOperandNode());
+            }
+            else if (leftNode.getNodeID() == ASTNodeID.SuperID
+                    && (rightNode.getNodeID() == ASTNodeID.GetterID || (rightDef != null && rightDef instanceof AccessorDefinition)))
+            {
+                ICompilerProject project = this.getProject();
+                if (project instanceof FlexJSProject)
+                	((FlexJSProject)project).needLanguage = true;
+                // setter is handled in binaryOperator
+                write(JSFlexJSEmitterTokens.LANGUAGE_QNAME);
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                write(JSFlexJSEmitterTokens.SUPERGETTER);
+                write(ASEmitterTokens.PAREN_OPEN);
+                IClassNode cnode = (IClassNode) node
+                        .getAncestorOfType(IClassNode.class);
+                write(getEmitter().formatQualifiedName(
+                        cnode.getQualifiedName()));
+                writeToken(ASEmitterTokens.COMMA);
+                write(ASEmitterTokens.THIS);
+                writeToken(ASEmitterTokens.COMMA);
+                write(ASEmitterTokens.SINGLE_QUOTE);
+                if (rightDef != null)
+                    write(rightDef.getBaseName());
+                else
+                    write(((GetterNode) rightNode).getName());
+                write(ASEmitterTokens.SINGLE_QUOTE);
+                write(ASEmitterTokens.PAREN_CLOSE);
+                return false;
+            }
+        }
+        else
+        {
+            startMapping(leftNode);
+            write(ASEmitterTokens.THIS);
+            endMapping(leftNode);
+        }
+        return true;
+    }
+    	
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MemberKeywordEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MemberKeywordEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MemberKeywordEmitter.java
new file mode 100644
index 0000000..3f71c78
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MemberKeywordEmitter.java
@@ -0,0 +1,70 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IKeywordNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+
+public class MemberKeywordEmitter extends JSSubEmitter implements
+        ISubEmitter<IDefinitionNode>
+{
+    public MemberKeywordEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IDefinitionNode node)
+    {
+        IKeywordNode keywordNode = null;
+        for(int i = 0; i < node.getChildCount(); i++)
+        {
+            IASNode childNode = node.getChild(i);
+            if (childNode instanceof IKeywordNode)
+            {
+                keywordNode = (IKeywordNode) childNode;
+                break;
+            }
+        }
+        if (keywordNode != null)
+        {
+            startMapping(keywordNode);
+        }
+        if (node instanceof IFunctionNode)
+        {
+            writeToken(ASEmitterTokens.FUNCTION);
+        }
+        else if (node instanceof IVariableNode)
+        {
+            writeToken(ASEmitterTokens.VAR);
+        }
+        if (keywordNode != null)
+        {
+            endMapping(keywordNode);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java
new file mode 100644
index 0000000..2657907
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java
@@ -0,0 +1,145 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import java.util.ArrayList;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSessionModel;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.tree.as.FunctionNode;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+
+public class MethodEmitter extends JSSubEmitter implements
+        ISubEmitter<IFunctionNode>
+{
+    public MethodEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IFunctionNode node)
+    {
+    	getModel().getMethods().add(node);
+    	
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+
+        FunctionNode fn = (FunctionNode) node;
+        fn.parseFunctionBody(new ArrayList<ICompilerProblem>());
+
+        ICompilerProject project = getWalker().getProject();
+
+        fjs.getDocEmitter().emitMethodDoc(node, project);
+
+        boolean isConstructor = node.isConstructor();
+
+        String qname = null;
+        IFunctionDefinition.FunctionClassification classification = fn.getFunctionClassification();
+        if(classification == IFunctionDefinition.FunctionClassification.FILE_MEMBER ||
+                classification == IFunctionDefinition.FunctionClassification.PACKAGE_MEMBER)
+        {
+            write(fjs.formatQualifiedName(fn.getQualifiedName()));
+        }
+        else
+        {
+            startMapping(node.getNameExpressionNode());
+            ITypeDefinition typeDef = EmitterUtils.getTypeDefinition(node);
+            if (typeDef != null)
+            {
+                qname = typeDef.getQualifiedName();
+            }
+            if (qname != null && !qname.equals(""))
+            {
+                write(fjs.formatQualifiedName(qname));
+                if (!isConstructor)
+                {
+                    write(ASEmitterTokens.MEMBER_ACCESS);
+                    if (!fn.hasModifier(ASModifier.STATIC))
+                    {
+                        write(JSEmitterTokens.PROTOTYPE);
+                        write(ASEmitterTokens.MEMBER_ACCESS);
+                    }
+                }
+            }
+            if (!isConstructor)
+            {
+                fjs.emitMemberName(node);
+            }
+            endMapping(node.getNameExpressionNode());
+        }
+
+        startMapping(node);
+        write(ASEmitterTokens.SPACE);
+        writeToken(ASEmitterTokens.EQUAL);
+        write(ASEmitterTokens.FUNCTION);
+        endMapping(node);
+
+        fjs.emitParameters(node.getParametersContainerNode());
+
+        boolean hasSuperClass = EmitterUtils.hasSuperClass(project, node);
+
+        if (isConstructor && node.getScopedNode().getChildCount() == 0)
+        {
+            write(ASEmitterTokens.SPACE);
+            write(ASEmitterTokens.BLOCK_OPEN);
+            if (hasSuperClass)
+                fjs.emitSuperCall(node, JSSessionModel.CONSTRUCTOR_EMPTY);
+            writeNewline();
+            IClassNode cnode = (IClassNode) node
+            .getAncestorOfType(IClassNode.class);
+            fjs.emitComplexInitializers(cnode);
+            write(ASEmitterTokens.BLOCK_CLOSE);
+        }
+
+        if (!isConstructor || node.getScopedNode().getChildCount() > 0)
+        {
+            getEmitter().pushSourceMapName(node);
+            fjs.emitMethodScope(node.getScopedNode());
+            getEmitter().popSourceMapName();
+        }
+
+        if (isConstructor && hasSuperClass)
+        {
+            writeNewline(ASEmitterTokens.SEMICOLON);
+            write(JSGoogEmitterTokens.GOOG_INHERITS);
+            write(ASEmitterTokens.PAREN_OPEN);
+            write(fjs.formatQualifiedName(qname));
+            writeToken(ASEmitterTokens.COMMA);
+            String sname = EmitterUtils.getSuperClassDefinition(node, project)
+                    .getQualifiedName();
+            write(fjs.formatQualifiedName(sname));
+            write(ASEmitterTokens.PAREN_CLOSE);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/NumericLiteralEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/NumericLiteralEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/NumericLiteralEmitter.java
new file mode 100644
index 0000000..604d1d6
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/NumericLiteralEmitter.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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.common.ISourceLocation;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.as.INumericLiteralNode;
+
+public class NumericLiteralEmitter extends JSSubEmitter implements
+        ISubEmitter<INumericLiteralNode>
+{
+    public NumericLiteralEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(INumericLiteralNode node)
+    {
+        startMapping((ISourceLocation) node);
+        write(node.getNumericValue().toString());
+        endMapping((ISourceLocation) node);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ObjectDefinePropertyEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ObjectDefinePropertyEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ObjectDefinePropertyEmitter.java
new file mode 100644
index 0000000..d867332
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ObjectDefinePropertyEmitter.java
@@ -0,0 +1,166 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.common.IMetaInfo;
+import org.apache.flex.compiler.definitions.IFunctionDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
+import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
+import org.apache.flex.compiler.internal.tree.as.FunctionNode;
+import org.apache.flex.compiler.internal.tree.as.SetterNode;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IAccessorNode;
+
+public class ObjectDefinePropertyEmitter extends JSSubEmitter implements
+        ISubEmitter<IAccessorNode>
+{
+
+    public ObjectDefinePropertyEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IAccessorNode node)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+
+        //TODO: ajh  is this method needed anymore?
+
+        FunctionNode fn = (FunctionNode) node;
+        fn.parseFunctionBody(fjs.getProblems());
+
+        IFunctionDefinition definition = node.getDefinition();
+        ITypeDefinition type = (ITypeDefinition) definition.getParent();
+
+        // ToDo (erikdebruin): add VF2JS conditional -> only use check during full SDK compilation
+        if (type == null)
+            return;
+
+        boolean isBindableSetter = false;
+        if (node instanceof SetterNode)
+        {
+            IMetaInfo[] metaInfos = null;
+            metaInfos = node.getMetaInfos();
+            for (IMetaInfo metaInfo : metaInfos)
+            {
+                String name = metaInfo.getTagName();
+                if (name.equals("Bindable")
+                        && metaInfo.getAllAttributes().length == 0)
+                {
+                    isBindableSetter = true;
+                    break;
+                }
+            }
+        }
+        if (isBindableSetter)
+        {
+            fjs.getDocEmitter().emitMethodDoc(fn, getWalker().getProject());
+            write(fjs.formatQualifiedName(type.getQualifiedName()));
+            if (!node.hasModifier(ASModifier.STATIC))
+            {
+                write(ASEmitterTokens.MEMBER_ACCESS);
+                write(JSEmitterTokens.PROTOTYPE);
+            }
+
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write("__bindingWrappedSetter__");
+            writeToken(node.getName());
+            writeToken(ASEmitterTokens.EQUAL);
+            write(ASEmitterTokens.FUNCTION);
+            fjs.emitParameters(node.getParametersContainerNode());
+            //writeNewline();
+            fjs.emitMethodScope(node.getScopedNode());
+        }
+
+        super_emitObjectDefineProperty(node);
+    }
+
+    protected void super_emitObjectDefineProperty(IAccessorNode node)
+    {
+        // TODO (mschmalle) will remove this cast as more things get abstracted
+        JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
+
+        /*
+        Object.defineProperty(
+            A.prototype, 
+            'foo', 
+            {get: function() {return -1;}, 
+            configurable: true}
+         );
+        */
+
+        FunctionNode fn = (FunctionNode) node;
+        fn.parseFunctionBody(fjs.getProblems());
+
+        // head
+        write(JSGoogEmitterTokens.OBJECT);
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        write(JSEmitterTokens.DEFINE_PROPERTY);
+        fjs.writeNewline(ASEmitterTokens.PAREN_OPEN, true);
+
+        // Type
+        IFunctionDefinition definition = node.getDefinition();
+        ITypeDefinition type = (ITypeDefinition) definition.getParent();
+        write(type.getQualifiedName());
+        if (!node.hasModifier(ASModifier.STATIC))
+        {
+            write(ASEmitterTokens.MEMBER_ACCESS);
+            write(JSEmitterTokens.PROTOTYPE);
+        }
+        writeToken(ASEmitterTokens.COMMA);
+        writeNewline();
+
+        // name
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(definition.getBaseName());
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        writeToken(ASEmitterTokens.COMMA);
+        writeNewline();
+
+        // info object
+        // declaration
+        write(ASEmitterTokens.BLOCK_OPEN);
+        write(node.getNodeID() == ASTNodeID.GetterID ? ASEmitterTokens.GET
+                : ASEmitterTokens.SET);
+        write(ASEmitterTokens.COLON);
+        write(ASEmitterTokens.FUNCTION);
+        fjs.emitParameters(node.getParametersContainerNode());
+
+        fjs.emitDefinePropertyFunction(node);
+
+        writeToken(ASEmitterTokens.COMMA);
+        write(JSEmitterTokens.CONFIGURABLE);
+        write(ASEmitterTokens.COLON);
+        write(ASEmitterTokens.TRUE);
+        fjs.writeNewline(ASEmitterTokens.BLOCK_CLOSE, false);
+
+        // tail, no colon; parent container will add it
+        write(ASEmitterTokens.PAREN_CLOSE);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ObjectLiteralValuePairEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ObjectLiteralValuePairEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ObjectLiteralValuePairEmitter.java
new file mode 100644
index 0000000..d93d701
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ObjectLiteralValuePairEmitter.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.internal.codegen.js.jx;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.common.ISourceLocation;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IObjectLiteralValuePairNode;
+
+public class ObjectLiteralValuePairEmitter extends JSSubEmitter implements
+        ISubEmitter<IObjectLiteralValuePairNode>
+{
+    public ObjectLiteralValuePairEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IObjectLiteralValuePairNode node)
+    {
+        ISourceLocation sourceLocationNode = (ISourceLocation) node;
+
+        IExpressionNode nameNode = node.getNameNode();
+        getWalker().walk(nameNode);
+
+        startMapping(sourceLocationNode, nameNode);
+        write(ASEmitterTokens.COLON);
+        endMapping(sourceLocationNode);
+
+        IExpressionNode valueNode = node.getValueNode();
+        getWalker().walk(valueNode);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java
new file mode 100644
index 0000000..e5aaf34
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java
@@ -0,0 +1,640 @@
+/*
+ *
+ *  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.internal.codegen.js.jx;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.flex.compiler.codegen.ISubEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.common.ModifiersSet;
+import org.apache.flex.compiler.constants.IASKeywordConstants;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.IPackageDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.definitions.metadata.IMetaTagAttribute;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSDocEmitter;
+import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.tree.as.SetterNode;
+import org.apache.flex.compiler.scopes.IASScope;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.ITypeNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.tree.metadata.IMetaTagNode;
+import org.apache.flex.compiler.tree.metadata.IMetaTagsNode;
+
+public class PackageFooterEmitter extends JSSubEmitter implements
+        ISubEmitter<IPackageDefinition>
+{
+
+    public PackageFooterEmitter(IJSEmitter emitter)
+    {
+        super(emitter);
+    }
+
+    @Override
+    public void emit(IPackageDefinition definition)
+    {
+        getEmitter().popSourceMapName();
+        IASScope containedScope = definition.getContainedScope();
+        ITypeDefinition type = EmitterUtils.findType(containedScope
+                .getAllLocalDefinitions());
+        if (type == null)
+            return;
+
+        getEmitter().emitSourceMapDirective(type.getNode());
+    }
+
+    public void emitClassInfo(ITypeNode tnode)
+    {
+        JSFlexJSDocEmitter doc = (JSFlexJSDocEmitter) getEmitter()
+        .getDocEmitter();
+
+	    /*
+	     * Metadata
+	     * 
+	     * @type {Object.<string, Array.<Object>>}
+	     */
+	    writeNewline();
+	    writeNewline();
+	    writeNewline();
+	    doc.begin();
+	    writeNewline(" * Metadata");
+	    writeNewline(" *");
+	    writeNewline(" * @type {Object.<string, Array.<Object>>}");
+	    doc.end();
+	
+	    // a.B.prototype.AFJS_CLASS_INFO = {  };
+	    write(getEmitter().formatQualifiedName(tnode.getQualifiedName()));
+	    write(ASEmitterTokens.MEMBER_ACCESS);
+	    write(JSEmitterTokens.PROTOTYPE);
+	    write(ASEmitterTokens.MEMBER_ACCESS);
+	    writeToken(JSFlexJSEmitterTokens.FLEXJS_CLASS_INFO);
+	    writeToken(ASEmitterTokens.EQUAL);
+	    writeToken(ASEmitterTokens.BLOCK_OPEN);
+	
+	    // names: [{ name: '', qName: '' }]
+	    write(JSFlexJSEmitterTokens.NAMES);
+	    writeToken(ASEmitterTokens.COLON);
+	    write(ASEmitterTokens.SQUARE_OPEN);
+	    writeToken(ASEmitterTokens.BLOCK_OPEN);
+	    write(JSFlexJSEmitterTokens.NAME);
+	    writeToken(ASEmitterTokens.COLON);
+	    write(ASEmitterTokens.SINGLE_QUOTE);
+	    write(tnode.getName());
+	    write(ASEmitterTokens.SINGLE_QUOTE);
+	    writeToken(ASEmitterTokens.COMMA);
+	    write(JSFlexJSEmitterTokens.QNAME);
+	    writeToken(ASEmitterTokens.COLON);
+	    write(ASEmitterTokens.SINGLE_QUOTE);
+	    write(getEmitter().formatQualifiedName(tnode.getQualifiedName()));
+	    write(ASEmitterTokens.SINGLE_QUOTE);
+	    write(ASEmitterTokens.BLOCK_CLOSE);
+	    write(ASEmitterTokens.SQUARE_CLOSE);
+	
+	    IExpressionNode[] enodes;
+	    if (tnode instanceof IClassNode)
+	        enodes = ((IClassNode) tnode).getImplementedInterfaceNodes();
+	    else
+	        enodes = ((IInterfaceNode) tnode).getExtendedInterfaceNodes();
+	
+	    if (enodes.length > 0)
+	    {
+	        writeToken(ASEmitterTokens.COMMA);
+	
+	        // interfaces: [a.IC, a.ID]
+	        write(JSFlexJSEmitterTokens.INTERFACES);
+	        writeToken(ASEmitterTokens.COLON);
+	        write(ASEmitterTokens.SQUARE_OPEN);
+	        int i = 0;
+	        for (IExpressionNode enode : enodes)
+	        {
+	        	IDefinition edef = enode.resolve(getProject());
+	        	if (edef == null)
+	        		continue;
+	            write(getEmitter().formatQualifiedName(
+	                    edef.getQualifiedName()));
+	            if (i < enodes.length - 1)
+	                writeToken(ASEmitterTokens.COMMA);
+	            i++;
+	        }
+	        write(ASEmitterTokens.SQUARE_CLOSE);
+	    }
+	    write(ASEmitterTokens.SPACE);
+	    write(ASEmitterTokens.BLOCK_CLOSE);
+	    write(ASEmitterTokens.SEMICOLON);
+
+        if (!(tnode instanceof IInterfaceNode))
+        {
+		    writeNewline();
+		    writeNewline();
+		    writeNewline();
+		    doc.begin();
+		    writeNewline(" * Prevent renaming of class. Needed for reflection.");
+		    doc.end();
+		    write(JSFlexJSEmitterTokens.GOOG_EXPORT_SYMBOL);
+		    write(ASEmitterTokens.PAREN_OPEN);
+		    write(ASEmitterTokens.SINGLE_QUOTE);
+		    write(getEmitter().formatQualifiedName(tnode.getQualifiedName()));
+		    write(ASEmitterTokens.SINGLE_QUOTE);
+		    write(ASEmitterTokens.COMMA);
+		    write(ASEmitterTokens.SPACE);
+		    write(getEmitter().formatQualifiedName(tnode.getQualifiedName()));
+		    write(ASEmitterTokens.PAREN_CLOSE);
+		    write(ASEmitterTokens.SEMICOLON);
+        }
+
+	    collectReflectionData(tnode);
+	    IMetaTagNode[] metadata = null;
+	    IMetaTagsNode metadataTags = tnode.getMetaTags();
+	    if (metadataTags != null)
+	    	metadata = metadataTags.getAllTags();
+	    emitReflectionData(getEmitter().formatQualifiedName(tnode.getQualifiedName()),
+	    		varData,
+	    		accessorData,
+	    		methodData,
+	    		metadata);
+    }
+    
+    public class VariableData
+    {
+    	public String name;
+    	public String type;
+    	public IMetaTagNode[] metaData;
+    }
+    
+    private ArrayList<VariableData> varData;
+    
+    public class MethodData
+    {
+    	public String name;
+    	public String type;
+    	public String declaredBy;
+    	public IMetaTagNode[] metaData;
+    }
+    
+    private ArrayList<MethodData> accessorData;
+    private ArrayList<MethodData> methodData;
+    
+    public void collectReflectionData(ITypeNode tnode)
+    {
+    	varData = new ArrayList<VariableData>();
+    	accessorData = new ArrayList<MethodData>();
+    	methodData = new ArrayList<MethodData>();
+    	/*
+	     * Reflection
+	     * 
+	     * @return {Object.<string, Function>}
+	     */
+        IDefinitionNode[] dnodes;
+        boolean isInterface = tnode instanceof IInterfaceNode;
+	    if (!isInterface)
+	        dnodes = ((IClassNode) tnode).getAllMemberNodes();
+	    else
+	        dnodes = ((IInterfaceNode) tnode).getAllMemberDefinitionNodes();
+	    
+        for (IDefinitionNode dnode : dnodes)
+        {
+            ModifiersSet modifierSet = dnode.getDefinition().getModifiers();
+            boolean isStatic = (modifierSet != null && modifierSet
+                    .hasModifier(ASModifier.STATIC));
+            if (!isStatic && (dnode.getNodeID() == ASTNodeID.VariableID ||
+            		dnode.getNodeID() == ASTNodeID.BindableVariableID))
+            {
+            	IVariableNode varNode = (IVariableNode)dnode;
+                String ns = varNode.getNamespace();
+                if (ns == IASKeywordConstants.PUBLIC || isInterface)
+                {
+                	VariableData data = new VariableData();
+                	varData.add(data);
+                	data.name = varNode.getName();
+            	    data.type = getEmitter().formatQualifiedName(varNode.getVariableType());
+            	    IMetaTagsNode metaData = varNode.getMetaTags();
+            	    if (metaData != null)
+            	    {
+            	    	IMetaTagNode[] tags = metaData.getAllTags();
+            	    	if (tags.length > 0)
+            	    		data.metaData = tags;
+            	    }
+                }
+            }
+        }
+        
+	    HashMap<String, MethodData> accessorMap = new HashMap<String, MethodData>();
+        for (IDefinitionNode dnode : dnodes)
+        {
+            ModifiersSet modifierSet = dnode.getDefinition().getModifiers();
+            boolean isStatic = (modifierSet != null && modifierSet
+                    .hasModifier(ASModifier.STATIC));
+            if (!isStatic && (dnode.getNodeID() == ASTNodeID.GetterID ||
+            		dnode.getNodeID() == ASTNodeID.SetterID))
+            {
+            	IFunctionNode fnNode = (IFunctionNode)dnode;
+                String ns = fnNode.getNamespace();
+                if (ns == IASKeywordConstants.PUBLIC || isInterface)
+                {
+                	MethodData data = new MethodData();
+                	data.name = fnNode.getName();
+                	if (accessorMap.containsKey(data.name)) continue;
+                	accessorData.add(data);
+            	    if (dnode.getNodeID() == ASTNodeID.GetterID)
+            	    	data.type = fnNode.getReturnType();
+            	    else
+            	    	data.type = ((SetterNode)fnNode).getVariableType();
+                	accessorMap.put(data.name, data);
+            	    data.type = getEmitter().formatQualifiedName(data.type);
+            	    IClassNode declarer = (IClassNode)fnNode.getAncestorOfType(IClassNode.class);
+            	    String declarant = getEmitter().formatQualifiedName(tnode.getQualifiedName());
+            	    if (declarer != null)
+            	    	declarant = getEmitter().formatQualifiedName(declarer.getQualifiedName());
+            	    data.declaredBy = declarant;
+            	    IMetaTagsNode metaData = fnNode.getMetaTags();
+            	    if (metaData != null)
+            	    {
+            	    	IMetaTagNode[] tags = metaData.getAllTags();
+            	    	if (tags.length > 0)
+                    		data.metaData = tags;
+            	    }
+                }
+            }
+        }
+        for (IDefinitionNode dnode : dnodes)
+        {
+            ModifiersSet modifierSet = dnode.getDefinition().getModifiers();
+            boolean isStatic = (modifierSet != null && modifierSet
+                    .hasModifier(ASModifier.STATIC));
+            if (dnode.getNodeID() == ASTNodeID.FunctionID && !isStatic)
+            {
+            	IFunctionNode fnNode = (IFunctionNode)dnode;
+                String ns = fnNode.getNamespace();
+                if (ns == IASKeywordConstants.PUBLIC || isInterface)
+                {
+                	MethodData data = new MethodData();
+                	methodData.add(data);
+                	data.name = fnNode.getName();
+            	    data.type = getEmitter().formatQualifiedName(fnNode.getReturnType());
+            	    ITypeNode declarer;
+            	    if (isInterface)
+            	    	declarer = (IInterfaceNode)fnNode.getAncestorOfType(IInterfaceNode.class);
+            	    else
+            	    	declarer = (IClassNode)fnNode.getAncestorOfType(IClassNode.class);
+            	    String declarant = getEmitter().formatQualifiedName(tnode.getQualifiedName());
+            	    if (declarer != null)
+            	    	declarant = getEmitter().formatQualifiedName(declarer.getQualifiedName());
+            	    data.declaredBy = declarant;
+            	    IMetaTagsNode metaData = fnNode.getMetaTags();
+            	    if (metaData != null)
+            	    {
+            	    	IMetaTagNode[] tags = metaData.getAllTags();
+            	    	if (tags.length > 0)
+            	    		data.metaData = tags;
+            	    }
+                }
+            }
+        }
+    }
+    
+    public void emitReflectionData(String typeName,
+    		List<VariableData> varData,
+    		List<MethodData> accessorData,
+    		List<MethodData> methodData,
+    		IMetaTagNode[] metaData
+    		)
+    {
+        JSFlexJSDocEmitter doc = (JSFlexJSDocEmitter) getEmitter()
+        .getDocEmitter();
+	    /*
+	     * Reflection
+	     * 
+	     * @return {Object.<string, Function>}
+	     */
+
+	    writeNewline();
+	    writeNewline();
+	    writeNewline();
+	    writeNewline();
+	    doc.begin();
+	    writeNewline(" * Reflection");
+	    writeNewline(" *");
+	    writeNewline(" * @return {Object.<string, Function>}");
+	    doc.end();
+	
+	    // a.B.prototype.FLEXJS_REFLECTION_INFO = function() {
+	    write(typeName);
+	    write(ASEmitterTokens.MEMBER_ACCESS);
+	    write(JSEmitterTokens.PROTOTYPE);
+	    write(ASEmitterTokens.MEMBER_ACCESS);
+	    writeToken(JSFlexJSEmitterTokens.FLEXJS_REFLECTION_INFO);
+	    writeToken(ASEmitterTokens.EQUAL);
+	    writeToken(ASEmitterTokens.FUNCTION);
+	    write(ASEmitterTokens.PAREN_OPEN);
+	    writeToken(ASEmitterTokens.PAREN_CLOSE);
+	    write(ASEmitterTokens.BLOCK_OPEN);
+	
+	    indentPush();
+	    writeNewline();
+	    // return {
+	    writeToken(ASEmitterTokens.RETURN);
+	    write(ASEmitterTokens.BLOCK_OPEN);
+	    indentPush();
+	    writeNewline();
+	    // variables: function() {
+	    write("variables");
+	    writeToken(ASEmitterTokens.COLON);
+	    writeToken(ASEmitterTokens.FUNCTION);
+	    write(ASEmitterTokens.PAREN_OPEN);
+	    writeToken(ASEmitterTokens.PAREN_CLOSE);
+	    write(ASEmitterTokens.BLOCK_OPEN);
+	    indentPush();
+	    writeNewline();
+	    // return {
+	    writeToken(ASEmitterTokens.RETURN);
+	    write(ASEmitterTokens.BLOCK_OPEN);
+	    indentPush();
+	    
+	    int count = 0;
+        for (VariableData var : varData)
+        {
+        	if (count > 0)
+        		write(ASEmitterTokens.COMMA);
+    		writeNewline();
+        	count++;
+        	// varname: { type: typename
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+        	write(var.name);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+    	    writeToken(ASEmitterTokens.COLON);
+    	    writeToken(ASEmitterTokens.BLOCK_OPEN);
+    	    write("type");
+    	    writeToken(ASEmitterTokens.COLON);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+    	    write(var.type);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+	    	IMetaTagNode[] tags = var.metaData;
+	    	if (tags != null)
+	    	{
+        		writeToken(ASEmitterTokens.COMMA);
+        	    writeMetaData(tags);
+	    	}            	    	
+    	    // close object
+    	    write(ASEmitterTokens.BLOCK_CLOSE);
+        }
+	    indentPop();
+	    writeNewline();
+	    write(ASEmitterTokens.BLOCK_CLOSE);
+    	write(ASEmitterTokens.SEMICOLON);
+	    indentPop();
+	    writeNewline();
+	    // close variable function
+	    write(ASEmitterTokens.BLOCK_CLOSE);
+	    write(ASEmitterTokens.COMMA);
+	    writeNewline();
+	
+	    
+	    // accessors: function() {
+	    write("accessors");
+	    writeToken(ASEmitterTokens.COLON);
+	    writeToken(ASEmitterTokens.FUNCTION);
+	    write(ASEmitterTokens.PAREN_OPEN);
+	    writeToken(ASEmitterTokens.PAREN_CLOSE);
+	    write(ASEmitterTokens.BLOCK_OPEN);
+	    indentPush();
+	    writeNewline();
+	    // return {
+	    writeToken(ASEmitterTokens.RETURN);
+	    write(ASEmitterTokens.BLOCK_OPEN);
+	    indentPush();
+	    
+	    count = 0;
+        for (MethodData accessor : accessorData)
+        {
+        	if (count > 0)
+        		write(ASEmitterTokens.COMMA);
+    		writeNewline();
+        	count++;
+        	// accessorname: { type: typename
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+        	write(accessor.name);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+    	    writeToken(ASEmitterTokens.COLON);
+    	    writeToken(ASEmitterTokens.BLOCK_OPEN);
+    	    write("type");
+    	    writeToken(ASEmitterTokens.COLON);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+    	    write(accessor.type);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+    		writeToken(ASEmitterTokens.COMMA);
+    	    write("declaredBy");
+    	    writeToken(ASEmitterTokens.COLON);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+    	    write(accessor.declaredBy);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+	    	IMetaTagNode[] tags = accessor.metaData;
+	    	if (tags != null)
+	    	{
+        		writeToken(ASEmitterTokens.COMMA);
+        	    writeMetaData(tags);
+	    	}            	    	
+    	    // close object
+    	    write(ASEmitterTokens.BLOCK_CLOSE);
+        }
+	    indentPop();
+	    writeNewline();
+	    write(ASEmitterTokens.BLOCK_CLOSE);
+    	write(ASEmitterTokens.SEMICOLON);
+	    indentPop();
+	    writeNewline();
+	    // close accessor function
+	    write(ASEmitterTokens.BLOCK_CLOSE);
+	    write(ASEmitterTokens.COMMA);
+	    writeNewline();
+	
+	    
+	    // methods: function() {
+	    write("methods");
+	    writeToken(ASEmitterTokens.COLON);
+	    writeToken(ASEmitterTokens.FUNCTION);
+	    write(ASEmitterTokens.PAREN_OPEN);
+	    writeToken(ASEmitterTokens.PAREN_CLOSE);
+	    write(ASEmitterTokens.BLOCK_OPEN);
+	    indentPush();
+	    writeNewline();
+	    // return {
+	    writeToken(ASEmitterTokens.RETURN);
+	    write(ASEmitterTokens.BLOCK_OPEN);
+	    indentPush();
+	    
+	    count = 0;
+        for (MethodData method : methodData)
+        {
+        	if (count > 0)
+        		write(ASEmitterTokens.COMMA);
+        	writeNewline();
+        	count++;
+        	// methodname: { type: typename
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+        	write(method.name);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+    	    writeToken(ASEmitterTokens.COLON);
+    	    writeToken(ASEmitterTokens.BLOCK_OPEN);
+    	    write("type");
+    	    writeToken(ASEmitterTokens.COLON);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+    	    write(method.type);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+    		writeToken(ASEmitterTokens.COMMA);
+    	    write("declaredBy");
+    	    writeToken(ASEmitterTokens.COLON);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+    	    write(method.declaredBy);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+	    	IMetaTagNode[] tags = method.metaData;
+	    	if (tags != null)
+	    	{
+        		writeToken(ASEmitterTokens.COMMA);
+        	    writeMetaData(tags);
+	    	}            	    	
+    	    // close object
+    	    write(ASEmitterTokens.BLOCK_CLOSE);
+        }
+        // close return
+	    indentPop();
+	    writeNewline();
+	    write(ASEmitterTokens.BLOCK_CLOSE);
+    	write(ASEmitterTokens.SEMICOLON);
+	    indentPop();
+	    writeNewline();
+	    // close method function
+	    write(ASEmitterTokens.BLOCK_CLOSE);
+
+    	if (metaData != null && metaData.length > 0)
+    	{
+    		write(ASEmitterTokens.COMMA);
+    	    writeNewline();
+    	    writeMetaData(metaData);
+    	}            	    	
+	    
+	    indentPop();
+	    writeNewline();
+	    // close return object
+	    write(ASEmitterTokens.BLOCK_CLOSE);
+	    write(ASEmitterTokens.SEMICOLON);
+	    
+	    // close function
+	    indentPop();
+	    writeNewline();
+	    write(ASEmitterTokens.BLOCK_CLOSE);
+	    writeNewline(ASEmitterTokens.SEMICOLON);
+    }
+    
+    private void writeMetaData(IMetaTagNode[] tags)
+    {
+    	JSGoogConfiguration config = ((FlexJSProject)getWalker().getProject()).config;
+    	Set<String> allowedNames = config.getCompilerKeepAs3Metadata();
+    	
+	    // metadata: function() {
+		write("metadata");
+	    writeToken(ASEmitterTokens.COLON);
+	    writeToken(ASEmitterTokens.FUNCTION);
+	    write(ASEmitterTokens.PAREN_OPEN);
+	    writeToken(ASEmitterTokens.PAREN_CLOSE);
+	    writeToken(ASEmitterTokens.BLOCK_OPEN);
+	    // return [ array of metadata tags ]
+	    writeToken(ASEmitterTokens.RETURN);
+	    writeToken(ASEmitterTokens.SQUARE_OPEN);
+
+	    int count = 0;
+	    for (int i = 0; i < tags.length; i++)
+	    {
+	    	IMetaTagNode tag = tags[i];
+	    	if (count > 0)
+	    	{
+        		writeToken(ASEmitterTokens.COMMA);
+	    	}
+	    	if (!allowedNames.contains(tag.getTagName()))
+	    		continue;
+	    	count++;
+    	    // { name: <tag name>
+    	    writeToken(ASEmitterTokens.BLOCK_OPEN);
+    	    write("name");
+    	    writeToken(ASEmitterTokens.COLON);
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+    	    write(tag.getTagName());
+    	    write(ASEmitterTokens.SINGLE_QUOTE);
+    	    IMetaTagAttribute[] args = tag.getAllAttributes();
+    	    if (args.length > 0)
+    	    {
+        		writeToken(ASEmitterTokens.COMMA);
+        	    
+        	    // args: [
+        	    write("args");
+        	    writeToken(ASEmitterTokens.COLON);
+        	    writeToken(ASEmitterTokens.SQUARE_OPEN);
+        	    
+        	    for (int j = 0; j < args.length; j++)
+        	    {
+        	    	if (j > 0)
+        	    	{
+                		writeToken(ASEmitterTokens.COMMA);
+        	    	}
+        	    	// { key: key, value: value }
+        	    	IMetaTagAttribute arg = args[j];
+            	    writeToken(ASEmitterTokens.BLOCK_OPEN);
+            	    write("key");
+            	    writeToken(ASEmitterTokens.COLON);
+            	    write(ASEmitterTokens.SINGLE_QUOTE);
+            	    String key = arg.getKey();
+            	    write(key == null ? "" : key);
+            	    write(ASEmitterTokens.SINGLE_QUOTE);
+            		writeToken(ASEmitterTokens.COMMA);
+            	    write("value");
+            	    writeToken(ASEmitterTokens.COLON);
+            	    write(ASEmitterTokens.SINGLE_QUOTE);
+            	    write(arg.getValue());
+            	    write(ASEmitterTokens.SINGLE_QUOTE);
+            	    write(ASEmitterTokens.BLOCK_CLOSE);
+        	    }
+        	    // close array of args
+        	    write(ASEmitterTokens.SQUARE_CLOSE);
+    	    }
+    	    // close metadata object
+    	    write(ASEmitterTokens.BLOCK_CLOSE);
+	    }
+	    // close array of metadatas
+	    write(ASEmitterTokens.SQUARE_CLOSE);
+	    writeToken(ASEmitterTokens.SEMICOLON);
+	    // close function
+	    write(ASEmitterTokens.BLOCK_CLOSE);
+    }
+}


[44/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ReferenceModel.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ReferenceModel.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ReferenceModel.java
new file mode 100644
index 0000000..090eb63
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/reference/ReferenceModel.java
@@ -0,0 +1,357 @@
+/*
+ *
+ *  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.internal.codegen.externals.reference;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.flex.compiler.clients.ExternCConfiguration;
+import org.apache.flex.compiler.clients.ExternCConfiguration.ExcludedMember;
+import org.apache.flex.compiler.internal.codegen.externals.utils.DebugLogUtils;
+
+import com.google.javascript.jscomp.Compiler;
+import com.google.javascript.jscomp.NodeUtil;
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.JSTypeExpression;
+import com.google.javascript.rhino.Node;
+import com.google.javascript.rhino.jstype.JSType;
+
+public class ReferenceModel
+{
+    private ExternCConfiguration configuration;
+    private Compiler jscompiler;
+
+    private List<String> namespaces = new ArrayList<String>();
+
+    private HashMap<String, ClassReference> typedefs = new HashMap<String, ClassReference>();
+    private HashMap<String, ClassReference> classes = new HashMap<String, ClassReference>();
+    private HashMap<String, FunctionReference> functions = new HashMap<String, FunctionReference>();
+    private HashMap<String, ConstantReference> constants = new HashMap<String, ConstantReference>();
+
+    //    public Compiler getJSCompiler()
+    //    {
+    //        return jscompiler;
+    //    }
+
+    public void setJSCompiler(Compiler compiler)
+    {
+        this.jscompiler = compiler;
+    }
+
+    public ExternCConfiguration getConfiguration()
+    {
+        return configuration;
+    }
+
+    public ClassReference getObjectReference()
+    {
+        return classes.get("Object");
+    }
+
+    public Collection<String> getNamespaces()
+    {
+        return namespaces;
+    }
+
+    public Collection<ClassReference> getTypedefs()
+    {
+        return typedefs.values();
+    }
+
+    public Collection<ClassReference> getClasses()
+    {
+        return classes.values();
+    }
+
+    public Collection<FunctionReference> getFunctions()
+    {
+        return functions.values();
+    }
+
+    public Collection<ConstantReference> getConstants()
+    {
+        return constants.values();
+    }
+
+    public ReferenceModel(ExternCConfiguration config)
+    {
+        this.configuration = config;
+    }
+
+    public ClassReference getClassReference(String qualifiedName)
+    {
+        return classes.get(qualifiedName);
+    }
+
+    public ClassReference getInterfaceReference(String qualifiedName)
+    {
+        ClassReference reference = classes.get(qualifiedName);
+        if (reference != null && reference.isInterface())
+            return reference;
+        return null;
+    }
+
+    public void addNamespace(Node node, String qualifiedName)
+    {
+        if (namespaces.contains(qualifiedName))
+        {
+            err("Duplicate namesapce [" + qualifiedName + "]");
+            return;
+        }
+
+        log("Model.addNamespace(" + qualifiedName + ")");
+
+        namespaces.add(qualifiedName);
+    }
+
+    public void addClass(Node node, String qualifiedName)
+    {
+        if (getConfiguration().isClassToFunctions(qualifiedName))
+        {
+            addFunction(node, qualifiedName);
+            return;
+        }
+
+        if (classes.containsKey(qualifiedName))
+        {
+            err("Duplicate class [" + qualifiedName + "]");
+            return;
+        }
+
+        log("Model.addClass(" + qualifiedName + ")");
+        ClassReference reference = new ClassReference(this, node, qualifiedName);
+
+        // TODO (mschmalle) Figure out if gcc makes any decisions about what is final or dynamic
+        if (reference.getQualifiedName().equals("Object"))
+            reference.setDynamic(true);
+
+        classes.put(qualifiedName, reference);
+    }
+
+    public void addEnum(Node node, String qualifiedName)
+    {
+        if (classes.containsKey(qualifiedName))
+        {
+            err("Duplicate class, @enum conflict [" + qualifiedName + "]");
+            return;
+        }
+
+        log("Model.addEnum(" + qualifiedName + ")");
+        ClassReference reference = new ClassReference(this, node, qualifiedName);
+        classes.put(qualifiedName, reference);
+    }
+
+    public void addTypeDef(Node node, String qualifiedName)
+    {
+        if (typedefs.containsKey(qualifiedName))
+        {
+            err("Duplicate @typedef [" + qualifiedName + "]");
+            return;
+        }
+
+        log("Model.addTypeDef(" + qualifiedName + ")");
+
+        ClassReference reference = new ClassReference(this, node, qualifiedName);
+        typedefs.put(qualifiedName, reference);
+    }
+
+    public void addInterface(Node node, String qualifiedName)
+    {
+        if (classes.containsKey(qualifiedName))
+        {
+            err("Duplicate @interface [" + qualifiedName + "]");
+            return;
+        }
+
+        log("Model.addInterface(" + qualifiedName + ")");
+
+        ClassReference reference = new ClassReference(this, node, qualifiedName);
+        classes.put(qualifiedName, reference);
+    }
+
+    public void addFinalClass(Node node, String qualifiedName)
+    {
+        if (classes.containsKey(qualifiedName))
+        {
+            err("Duplicate final class [" + qualifiedName + "]");
+            return;
+        }
+
+        log("Model.addFinalClass(" + qualifiedName + ")");
+
+        ClassReference reference = new ClassReference(this, node, qualifiedName);
+        reference.setFinal(true);
+        classes.put(qualifiedName, reference);
+    }
+
+    public void addFunction(Node node, String qualifiedName)
+    {
+        if (functions.containsKey(qualifiedName))
+        {
+            err("Duplicate global function [" + qualifiedName + "]");
+            return;
+        }
+
+        log("Model.addFunction(" + qualifiedName + ")");
+
+        FunctionReference reference = new FunctionReference(this, node, qualifiedName, node.getJSDocInfo());
+        functions.put(qualifiedName, reference);
+    }
+
+    public boolean hasClass(String className)
+    {
+        return classes.containsKey(className);
+    }
+
+    public boolean hasConstant(String qualifiedName)
+    {
+        return constants.containsKey(qualifiedName);
+    }
+
+    public void addConstant(Node node, String qualifiedName)
+    {
+        if (constants.containsKey(qualifiedName))
+        {
+            // XXX Record warning;
+            return;
+        }
+
+        log("Model.addConstant(" + qualifiedName + ")");
+
+        ConstantReference reference = new ConstantReference(this, node, qualifiedName, node.getJSDocInfo());
+        constants.put(qualifiedName, reference);
+    }
+
+    public void addConstantType(Node node, String qualifiedName, JSType type)
+    {
+        if (constants.containsKey(qualifiedName))
+        {
+            // XXX Record warning;
+            return;
+        }
+
+        log("Model.addConstantType(" + qualifiedName + ")");
+
+        ConstantReference reference = new ConstantReference(this, node, qualifiedName, node.getJSDocInfo(), type);
+        constants.put(qualifiedName, reference);
+    }
+
+    public void addField(Node node, String className, String memberName)
+    {
+        ClassReference classReference = getClassReference(className);
+        if (classReference != null)
+            classReference.addField(node, memberName, node.getJSDocInfo(), false);
+    }
+
+    public void addStaticField(Node node, String className, String memberName)
+    {
+        ClassReference classReference = getClassReference(className);
+        // XXX this is here because for now, the doc might be on the parent ASSIGN node
+        // if it's a static property with a value
+        JSDocInfo comment = NodeUtil.getBestJSDocInfo(node);
+        if (classReference != null)
+        {
+            classReference.addField(node, memberName, comment, true);
+        }
+        else
+        {
+            err(">>>> {ReferenceModel} Class [" + className + "] not found in " + node.getSourceFileName());
+        }
+    }
+
+    public void addMethod(Node node, String className, String memberName)
+    {
+        JSDocInfo comment = NodeUtil.getBestJSDocInfo(node);
+        ClassReference classReference = getClassReference(className);
+        if (classReference != null)
+            classReference.addMethod(node, memberName, comment, false);
+    }
+
+    public void addStaticMethod(Node node, String className, String memberName)
+    {
+        ClassReference classReference = getClassReference(className);
+        // XXX this is here because for now, the doc might be on the parent ASSIGN node
+        // if it's a static property with a value
+        JSDocInfo comment = NodeUtil.getBestJSDocInfo(node);
+        if (classReference != null)
+        {
+            classReference.addMethod(node, memberName, comment, true);
+        }
+        else
+        {
+            err(">>>> {ReferenceModel} Class [" + className + "] not found in " + node.getSourceFileName());
+        }
+    }
+
+    public final JSType evaluate(JSTypeExpression expression)
+    {
+        JSType jsType = null;
+
+        if (expression != null)
+        {
+            try
+            {
+                jsType = expression.evaluate(null, jscompiler.getTypeRegistry());
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+        return jsType;
+    }
+
+    //--------------------------------------------------------------------------
+
+    public ExcludedMember isExcludedClass(ClassReference classReference)
+    {
+        return getConfiguration().isExcludedClass(classReference);
+    }
+
+    public ExcludedMember isExcludedMember(ClassReference classReference, MemberReference memberReference)
+    {
+        return getConfiguration().isExcludedMember(classReference, memberReference);
+    }
+
+    //--------------------------------------------------------------------------
+
+    protected void log(Node n)
+    {
+        DebugLogUtils.err(n);
+    }
+
+    protected void err(Node n)
+    {
+        DebugLogUtils.err(n);
+    }
+
+    protected void log(String message)
+    {
+        DebugLogUtils.log(message);
+    }
+
+    protected void err(String message)
+    {
+        DebugLogUtils.err(message);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/DebugLogUtils.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/DebugLogUtils.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/DebugLogUtils.java
new file mode 100644
index 0000000..5dcdc48
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/DebugLogUtils.java
@@ -0,0 +1,52 @@
+/*
+ *
+ *  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.internal.codegen.externals.utils;
+
+import com.google.javascript.rhino.Node;
+
+public final class DebugLogUtils
+{
+    private static boolean logEnabled = false;
+    private static boolean errEnabled = false;
+
+    public static void log(Node n)
+    {
+        log("StringTree -------------------------------------");
+        log(n.toStringTree());
+    }
+
+    public static void log(String message)
+    {
+        if (logEnabled)
+            System.out.println(message);
+    }
+
+    public static void err(String message)
+    {
+        if (errEnabled)
+            System.err.println(message);
+    }
+
+    public static void err(Node n)
+    {
+        err("StringTree -------------------------------------");
+        err(n.toStringTree());
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/FunctionUtils.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/FunctionUtils.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/FunctionUtils.java
new file mode 100644
index 0000000..473e42c
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/FunctionUtils.java
@@ -0,0 +1,232 @@
+/*
+ *
+ *  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.internal.codegen.externals.utils;
+
+import org.apache.flex.compiler.internal.codegen.externals.reference.BaseReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;
+
+import com.google.common.base.Strings;
+import com.google.javascript.rhino.JSDocInfo;
+import com.google.javascript.rhino.JSTypeExpression;
+import com.google.javascript.rhino.Node;
+
+public class FunctionUtils
+{
+    /**
+     * Compute the type of a function or method parameter.
+     * 
+     * @param reference The FunctionReference or MethodReference the parameter belongs to
+     * @param name The name of the parameter
+     * @return the type of a function or method parameter
+     */
+    public static String toParameterType(final BaseReference reference, final String name)
+    {
+
+        String parameterType;
+        if (FunctionUtils.hasTemplate(reference) && FunctionUtils.containsTemplate(reference, name))
+        {
+            parameterType = "Object";
+        }
+        else
+        {
+            parameterType = JSTypeUtils.toParamTypeString(reference, name);
+        }
+
+        return parameterType;
+    }
+
+    public static String toReturnString(BaseReference reference)
+    {
+        final StringBuilder sb = new StringBuilder();
+
+        String returnType;
+
+        if (hasTemplate(reference))
+        {
+            returnType = JSTypeUtils.toReturnTypeString(reference);
+            if (containsTemplate(reference, returnType))
+            	returnType = "*";
+            else if (returnType.equals("RESULT"))
+            	returnType = "Object";
+        }
+        else
+        {
+            returnType = JSTypeUtils.toReturnTypeString(reference);
+        }
+
+        sb.append(returnType);
+
+        return sb.toString();
+    }
+
+    public static String toParameterString(BaseReference reference, JSDocInfo comment, Node paramNode, boolean outputJS)
+    {
+        final StringBuilder sb = new StringBuilder();
+
+        sb.append("(");
+
+        if (paramNode != null)
+        {
+            int index = 0;
+            int len = comment.getParameterCount();
+            if (len == 0)
+            {
+                // Missing JSDocInf @param tags, so instead of using the @param tags
+                // we use the actual Node list from the AST
+                len = paramNode.getChildCount();
+                if (len > 0)
+                {
+                    for (Node param : paramNode.children())
+                    {
+                        sb.append(param.getString());
+                        if (!outputJS)
+                        	sb.append(":Object");
+                        if (index < len - 1)
+                            sb.append(", ");
+                        index++;
+                    }
+                }
+            }
+            else
+            {
+                for (String paramName : comment.getParameterNames())
+                {
+                    sb.append(toParameter(reference, comment, paramName, comment.getParameterType(paramName), outputJS));
+
+                    if (index < len - 1)
+                        sb.append(", ");
+
+                    index++;
+                }
+            }
+        }
+
+        sb.append(")");
+
+        return sb.toString();
+    }
+
+    /**
+     * Check we can import the given type into the given package.
+     *
+     * @param model The containing reference model
+     * @param node The containing node
+     * @param typeName The type we want check
+     * @param packageName The current package
+     * @return true if we can import the given type into the given package
+     */
+    public static boolean canBeImported(final ReferenceModel model, final Node node, final String typeName,
+            final String packageName)
+    {
+        boolean canImport = false;
+
+        if (model != null && node != null && !Strings.isNullOrEmpty(typeName))
+        {
+            final ClassReference reference = new ClassReference(null, node, typeName);
+
+            final int lastDotPosition = typeName.lastIndexOf(".");
+
+            // Can import when the type to import does not belong to the current package.
+            canImport = lastDotPosition > -1 && !typeName.substring(0, lastDotPosition).equals(packageName);
+
+            // And is not excluded.
+            canImport &= model.isExcludedClass(reference) == null;
+        }
+
+        return canImport;
+    }
+
+    private static String toParameter(BaseReference reference, JSDocInfo comment, String paramName,
+            JSTypeExpression parameterType, boolean outputJS)
+    {
+        final StringBuilder sb = new StringBuilder();
+
+        String paramType;
+
+        if (parameterType == null)
+        {
+        	System.out.println("no parameter type for " + paramName + " " + reference.getQualifiedName());
+            paramType = "Object";
+            if (outputJS)
+            	sb.append(paramName);
+        }
+        else if (parameterType.isVarArgs())
+        {
+        	if (outputJS)
+        		sb.append("var_").append(paramName);
+        	else
+        		sb.append("...").append(paramName);
+        }
+        else
+        {
+            paramType = JSTypeUtils.toParamTypeString(reference, paramName);
+            if (hasTemplate(reference) && containsTemplate(reference, paramType))
+            {
+                paramType = "Object";
+            }
+
+            sb.append(paramName);
+            if (!outputJS)
+            {
+                sb.append(":");
+                sb.append(paramType);            	
+	            if (parameterType.isOptionalArg())
+	            {
+	                sb.append(" = ");
+	                sb.append(toDefaultParameterValue(paramType));
+	            }
+            }
+        }
+
+        return sb.toString();
+    }
+
+    private static String toDefaultParameterValue(String paramType)
+    {
+        if (paramType.equals("Function"))
+            return "null";
+        else if (paramType.equals("Number"))
+            return "0";
+        else if (paramType.equals("String"))
+            return "''";
+        else if (paramType.equals("Boolean"))
+            return "false";
+        return "null";
+    }
+
+    public static boolean hasTemplate(BaseReference reference)
+    {
+        return reference.getComment().getTemplateTypeNames().size() > 0;
+    }
+    
+    public static boolean containsTemplate(BaseReference reference, String name)
+    {
+    	for (String template : reference.getComment().getTemplateTypeNames())
+    	{
+    		if (name.contains("<" + template + ">"))
+    			return true;
+    		if (name.equals(template))
+    			return true;
+    	}
+    	return false;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/JSTypeUtils.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/JSTypeUtils.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/JSTypeUtils.java
new file mode 100644
index 0000000..c14ddb8
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/utils/JSTypeUtils.java
@@ -0,0 +1,169 @@
+/*
+ *
+ *  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.internal.codegen.externals.utils;
+
+import java.util.HashMap;
+
+import org.apache.flex.compiler.internal.codegen.externals.reference.BaseReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ConstantReference;
+import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;
+
+import com.google.javascript.rhino.JSTypeExpression;
+import com.google.javascript.rhino.jstype.JSType;
+import com.google.javascript.rhino.jstype.UnionType;
+
+public class JSTypeUtils
+{
+    public static String toClassTypeString(ClassReference reference)
+    {
+        String type = getJsType(reference.getModel(), reference.getComment().getBaseType()).toString();
+        return type;
+    }
+
+    public static String toParamTypeString(BaseReference reference, String paramName)
+    {
+        JSTypeExpression expression = reference.getComment().getParameterType(paramName);
+        if (expression == null)
+            return "Object";
+
+        String type = toTypeExpressionString(reference, expression);
+        type = transformType(type);
+
+        return type;
+    }
+
+    public static String toReturnTypeString(BaseReference reference)
+    {
+        JSTypeExpression expression = reference.getComment().getReturnType();
+        if (expression == null)
+            return "void";
+
+        String type = toTypeExpressionString(reference, expression);
+        type = transformType(type);
+
+        return type;
+    }
+
+    public static String toFieldTypeString(BaseReference reference)
+    {
+        JSTypeExpression expression = reference.getComment().getType();
+        if (expression == null)
+            return "Object";
+
+        String type = toTypeExpressionString(reference, expression);
+        type = transformType(type);
+
+        return type;
+    }
+
+    public static String toEnumTypeString(BaseReference reference)
+    {
+        JSTypeExpression enumParameterType = reference.getComment().getEnumParameterType();
+        String overrideStringType = transformType(reference.getModel().evaluate(enumParameterType).toAnnotationString());
+
+        return overrideStringType;
+    }
+
+    public static String toConstantTypeString(ConstantReference reference)
+    {
+        JSTypeExpression expression = reference.getComment().getType();
+        if (expression == null)
+            return "Object";
+
+        String type = toTypeExpressionString(reference, expression);
+        type = transformType(type);
+
+        return type;
+    }
+
+    //--------------------------------------------------------------------------
+
+    public static String transformType(String type)
+    {
+        // XXX This is an error but, needs to be reduced in @param union
+        if (type.indexOf("|") != -1)
+            return "Object";
+
+        HashMap<String, String> map = new HashMap<String, String>();
+        map.put("?", "Object /* ? */");
+        map.put("*", "*");
+        map.put("string", "String");
+        map.put("number", "Number");
+        map.put("boolean", "Boolean");
+        map.put("undefined", "Object /* undefined */");
+        map.put("null", "Object /* null */");
+
+        if (map.containsKey(type))
+            return map.get(type);
+
+        return type;
+    }
+
+    private static String toTypeExpressionString(BaseReference reference, JSTypeExpression expression)
+    {
+        JSType jsType = getJsType(reference.getModel(), expression);
+        String type = toTypeString(jsType);
+        return type;
+    }
+
+    private static String toTypeString(JSType jsType)
+    {
+        String type = jsType.toString();
+
+        if (jsType.isFunctionType())
+        {
+            return "Function /* " + type + " */";
+        }
+        else if (jsType.isRecordType())
+        {
+            return "Object /* " + type + " */";
+        }
+        else
+        {
+            if (type.indexOf("Array<") == 0)
+            {
+                return "Array";
+            }
+            else if (type.indexOf("Object<") == 0)
+            {
+                return "Object";
+            }
+        }
+
+        return type;
+    }
+
+    private static JSType getJsType(ReferenceModel model, JSTypeExpression typeExpression)
+    {
+        JSType jsType = model.evaluate(typeExpression);
+
+        if (jsType.isUnionType())
+        {
+            UnionType ut = (UnionType) jsType;
+            JSType jsType2 = ut.restrictByNotNullOrUndefined();
+
+            if (!jsType2.isUnionType())
+                jsType = jsType2;
+        }
+
+        return jsType;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSDocEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSDocEmitter.java
new file mode 100644
index 0000000..743ecce
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSDocEmitter.java
@@ -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.
+ *
+ */
+
+package org.apache.flex.compiler.internal.codegen.js;
+
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.IEmitter;
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.tree.as.IASNode;
+
+public class JSDocEmitter implements IDocEmitter, IEmitter
+{
+
+    private int currentIndent = 0;
+
+    protected IEmitter emitter;
+
+    private StringBuilder builder;
+
+    protected StringBuilder getBuilder()
+    {
+        return builder;
+    }
+
+    private boolean bufferWrite;
+
+    public boolean isBufferWrite()
+    {
+        return bufferWrite;
+    }
+
+    public void setBufferWrite(boolean value)
+    {
+        bufferWrite = value;
+    }
+
+    public String flushBuffer()
+    {
+        setBufferWrite(false);
+        String result = builder.toString();
+        builder.setLength(0);
+        return result;
+    }
+
+    public JSDocEmitter(IJSEmitter emitter)
+    {
+        this.emitter = (IEmitter) emitter;
+        
+        builder = new StringBuilder();
+    }
+
+    @Override
+    public void indentPush()
+    {
+        currentIndent++;
+    }
+
+    @Override
+    public void indentPop()
+    {
+        currentIndent--;
+    }
+
+    @Override
+    public void write(IEmitterTokens value)
+    {
+        write(value.getToken());
+    }
+
+    @Override
+    public void write(String value)
+    {
+        if (!bufferWrite)
+            emitter.write(value);
+        else
+            builder.append(value);
+    }
+
+    @Override
+    public void writeNewline()
+    {
+        write(ASEmitterTokens.NEW_LINE);
+    }
+
+    @Override
+    public void writeNewline(String value)
+    {
+        write(value);
+        writeNewline();
+    }
+
+    @Override
+    public void writeNewline(IEmitterTokens value)
+    {
+        writeNewline(value.getToken());
+    }
+
+    @Override
+    public void writeNewline(String value, boolean pushIndent)
+    {
+        if (pushIndent)
+            indentPush();
+        else
+            indentPop();
+        write(value);
+        writeNewline();
+    }
+
+    @Override
+    public void writeNewline(IEmitterTokens value, boolean pushIndent)
+    {
+        writeNewline(value.getToken(), pushIndent);
+    }
+
+    @Override
+    public void writeToken(IEmitterTokens value)
+    {
+        writeToken(value.getToken());
+    }
+
+    @Override
+    public void writeToken(String value)
+    {
+        write(value);
+        write(ASEmitterTokens.SPACE);
+    }
+
+    public void writeBlockClose()
+    {
+        write(ASEmitterTokens.BLOCK_CLOSE);
+    }
+
+    public void writeBlockOpen()
+    {
+        write(ASEmitterTokens.BLOCK_OPEN);
+    }
+
+    @Override
+    public void begin()
+    {
+        writeNewline(JSDocEmitterTokens.JSDOC_OPEN);
+    }
+
+    @Override
+    public void end()
+    {
+        write(ASEmitterTokens.SPACE);
+        writeNewline(JSDocEmitterTokens.JSDOC_CLOSE);
+    }
+    
+    @Override
+    public String stringifyNode(IASNode node)
+    {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSDocEmitterTokens.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSDocEmitterTokens.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSDocEmitterTokens.java
new file mode 100644
index 0000000..813e36b
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSDocEmitterTokens.java
@@ -0,0 +1,38 @@
+/*
+ *
+ *  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.internal.codegen.js;
+
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+
+public enum JSDocEmitterTokens implements IEmitterTokens
+{
+    JSDOC_CLOSE("*/"), JSDOC_OPEN("/**");
+
+    private String token;
+
+    private JSDocEmitterTokens(String value)
+    {
+        token = value;
+    }
+
+    public String getToken()
+    {
+        return token;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
new file mode 100644
index 0000000..a50e288
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
@@ -0,0 +1,453 @@
+/*
+ *
+ *  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.internal.codegen.js;
+
+import java.io.FilterWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Stack;
+
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.common.ISourceLocation;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitter;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.jx.DoWhileLoopEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.DynamicAccessEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.ForLoopEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.FunctionCallArgumentsEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.IfEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.IterationFlowEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.LanguageIdentifierEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.LiteralContainerEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.MemberKeywordEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.NumericLiteralEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.ObjectLiteralValuePairEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.ParameterEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.ParametersEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.ReturnEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.SourceMapDirectiveEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.StatementEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.TernaryOperatorEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.UnaryOperatorEmitter;
+import org.apache.flex.compiler.internal.codegen.js.jx.WhileLoopEmitter;
+import org.apache.flex.compiler.internal.codegen.js.utils.EmitterUtils;
+import org.apache.flex.compiler.internal.tree.as.FunctionNode;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IFunctionObjectNode;
+import org.apache.flex.compiler.tree.as.IIfNode;
+import org.apache.flex.compiler.tree.as.IIterationFlowNode;
+import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
+import org.apache.flex.compiler.tree.as.ILiteralContainerNode;
+import org.apache.flex.compiler.tree.as.INumericLiteralNode;
+import org.apache.flex.compiler.tree.as.IObjectLiteralValuePairNode;
+import org.apache.flex.compiler.tree.as.IPackageNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.IReturnNode;
+import org.apache.flex.compiler.tree.as.ITernaryOperatorNode;
+import org.apache.flex.compiler.tree.as.ITypeNode;
+import org.apache.flex.compiler.tree.as.ITypedExpressionNode;
+import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IWhileLoopNode;
+
+import com.google.debugging.sourcemap.FilePosition;
+
+/**
+ * @author Michael Schmalle
+ */
+public class JSEmitter extends ASEmitter implements IJSEmitter
+{
+    private JSSessionModel model;
+    
+    public NumericLiteralEmitter numericLiteralEmitter;
+    public ParametersEmitter parametersEmitter;
+    public ParameterEmitter parameterEmitter;
+    public FunctionCallArgumentsEmitter functionCallArgumentsEmitter;
+    public LiteralContainerEmitter literalContainerEmitter;
+    public ObjectLiteralValuePairEmitter objectLiteralValuePairEmitter;
+    public ReturnEmitter returnEmitter;
+    public DynamicAccessEmitter dynamicAccessEmitter;
+    public UnaryOperatorEmitter unaryOperatorEmitter;
+    public TernaryOperatorEmitter ternaryOperatorEmitter;
+    public MemberKeywordEmitter memberKeywordEmitter;
+    public IfEmitter ifEmitter;
+    public WhileLoopEmitter whileLoopEmitter;
+    public DoWhileLoopEmitter doWhileLoopEmitter;
+    public ForLoopEmitter forLoopEmitter;
+    public IterationFlowEmitter interationFlowEmitter;
+    public StatementEmitter statementEmitter;
+    public LanguageIdentifierEmitter languageIdentifierEmitter;
+    public SourceMapDirectiveEmitter sourceMapDirectiveEmitter;
+    
+    @Override
+    public JSSessionModel getModel()
+    {
+        return model;
+    }
+    
+    private SourceMapMapping lastMapping;
+    
+    private Stack<String> nameStack = new Stack<String>();
+    
+    private List<SourceMapMapping> sourceMapMappings;
+    
+    public List<SourceMapMapping> getSourceMapMappings()
+    {
+        return sourceMapMappings;
+    }
+
+    public JSEmitter(FilterWriter out)
+    {
+        super(out);
+        
+        model = new JSSessionModel();
+        sourceMapMappings = new ArrayList<SourceMapMapping>();
+
+        numericLiteralEmitter = new NumericLiteralEmitter(this);
+        parametersEmitter = new ParametersEmitter(this);
+        parameterEmitter = new ParameterEmitter(this);
+        functionCallArgumentsEmitter = new FunctionCallArgumentsEmitter(this);
+        literalContainerEmitter = new LiteralContainerEmitter(this);
+        objectLiteralValuePairEmitter = new ObjectLiteralValuePairEmitter(this);
+        returnEmitter = new ReturnEmitter(this);
+        dynamicAccessEmitter = new DynamicAccessEmitter(this);
+        unaryOperatorEmitter = new UnaryOperatorEmitter(this);
+        ternaryOperatorEmitter = new TernaryOperatorEmitter(this);
+        memberKeywordEmitter = new MemberKeywordEmitter(this);
+        ifEmitter = new IfEmitter(this);
+        whileLoopEmitter = new WhileLoopEmitter(this);
+        doWhileLoopEmitter = new DoWhileLoopEmitter(this);
+        forLoopEmitter = new ForLoopEmitter(this);
+        interationFlowEmitter = new IterationFlowEmitter(this);
+        statementEmitter = new StatementEmitter(this);
+        languageIdentifierEmitter = new LanguageIdentifierEmitter(this);
+        sourceMapDirectiveEmitter = new SourceMapDirectiveEmitter(this);
+    }
+
+    @Override
+    public String formatQualifiedName(String name)
+    {
+        return name;
+    }
+    
+    @Override
+    public void emitLocalNamedFunction(IFunctionNode node)
+    {
+        startMapping(node);
+        FunctionNode fnode = (FunctionNode)node;
+        write(ASEmitterTokens.FUNCTION);
+        write(ASEmitterTokens.SPACE);
+        write(fnode.getName());
+        endMapping(node);
+        emitParameters(fnode.getParametersContainerNode());
+        emitFunctionScope(fnode.getScopedNode());
+    }
+    
+    @Override
+    public void emitFunctionObject(IFunctionObjectNode node)
+    {
+        startMapping(node);
+        FunctionNode fnode = node.getFunctionNode();
+        write(ASEmitterTokens.FUNCTION);
+        endMapping(node);
+        emitParameters(fnode.getParametersContainerNode());
+        emitFunctionScope(fnode.getScopedNode());
+    }
+
+    public void emitClosureStart()
+    {
+    	
+    }
+
+    public void emitClosureEnd(IASNode node)
+    {
+    	
+    }
+    
+    public void emitSourceMapDirective(ITypeNode node)
+    {
+        sourceMapDirectiveEmitter.emit(node);
+    }
+
+    public void emitParameters(IContainerNode node)
+    {
+        parametersEmitter.emit(node);
+    }
+
+    @Override
+    public void emitParameter(IParameterNode node)
+    {
+        parameterEmitter.emit(node);
+    }
+
+    @Override
+    public void emitArguments(IContainerNode node)
+    {
+        functionCallArgumentsEmitter.emit(node);
+    }
+
+    @Override
+    public void emitNumericLiteral(INumericLiteralNode node)
+    {
+        numericLiteralEmitter.emit(node);
+    }
+
+    @Override
+    public void emitLiteralContainer(ILiteralContainerNode node)
+    {
+        literalContainerEmitter.emit(node);
+    }
+
+    @Override
+    public void emitObjectLiteralValuePair(IObjectLiteralValuePairNode node)
+    {
+        objectLiteralValuePairEmitter.emit(node);
+    }
+
+    @Override
+    public void emitReturn(IReturnNode node)
+    {
+        returnEmitter.emit(node);
+    }
+
+    @Override
+    public void emitTypedExpression(ITypedExpressionNode node)
+    {
+        write(JSEmitterTokens.ARRAY);
+    }
+
+    @Override
+    public void emitDynamicAccess(IDynamicAccessNode node)
+    {
+        dynamicAccessEmitter.emit(node);
+    }
+
+    @Override
+    public void emitMemberKeyword(IDefinitionNode node)
+    {
+        memberKeywordEmitter.emit(node);
+    }
+
+    @Override
+    public void emitUnaryOperator(IUnaryOperatorNode node)
+    {
+        unaryOperatorEmitter.emit(node);
+    }
+
+    @Override
+    public void emitTernaryOperator(ITernaryOperatorNode node)
+    {
+        ternaryOperatorEmitter.emit(node);
+    }
+
+    @Override
+    public void emitLanguageIdentifier(ILanguageIdentifierNode node)
+    {
+        languageIdentifierEmitter.emit(node);
+    }
+
+    @Override
+    public void emitStatement(IASNode node)
+    {
+        statementEmitter.emit(node);
+    }
+
+    @Override
+    public void emitIf(IIfNode node)
+    {
+        ifEmitter.emit(node);
+    }
+
+    @Override
+    public void emitWhileLoop(IWhileLoopNode node)
+    {
+        whileLoopEmitter.emit(node);
+    }
+
+    @Override
+    public void emitDoLoop(IWhileLoopNode node)
+    {
+        doWhileLoopEmitter.emit(node);
+    }
+
+    @Override
+    public void emitForLoop(IForLoopNode node)
+    {
+        forLoopEmitter.emit(node);
+    }
+
+    @Override
+    public void emitIterationFlow(IIterationFlowNode node)
+    {
+        interationFlowEmitter.emit(node);
+    }
+
+    public void pushSourceMapName(ISourceLocation node)
+    {
+        boolean isValidMappingScope = node instanceof ITypeNode
+                || node instanceof IPackageNode
+                || node instanceof IFunctionNode;
+        if(!isValidMappingScope)
+        {
+            throw new IllegalStateException("A source mapping scope must be a package, type, or function.");
+        }
+        
+        IDefinitionNode definitionNode = (IDefinitionNode) node;
+        String nodeName = definitionNode.getQualifiedName();
+        ITypeDefinition typeDef = EmitterUtils.getTypeDefinition(definitionNode);
+        if (typeDef != null)
+        {
+            boolean isConstructor = node instanceof IFunctionNode &&
+                    ((IFunctionNode) node).isConstructor();
+            boolean isStatic = definitionNode.hasModifier(ASModifier.STATIC);
+            if (isConstructor)
+            {
+                nodeName = typeDef.getQualifiedName() + ".constructor";
+            }
+            else if (isStatic)
+            {
+                nodeName = typeDef.getQualifiedName() + "." + nodeName;
+            }
+            else
+            {
+                nodeName = typeDef.getQualifiedName() + ".prototype." + nodeName;
+            }
+        }
+        nameStack.push(nodeName);
+    }
+    
+    public void popSourceMapName()
+    {
+        nameStack.pop();
+    }
+
+    public void startMapping(ISourceLocation node)
+    {
+        startMapping(node, node.getLine(), node.getColumn());
+    }
+
+    public void startMapping(ISourceLocation node, ISourceLocation nodeBeforeMapping)
+    {
+        startMapping(node, nodeBeforeMapping.getLine(), nodeBeforeMapping.getColumn() + nodeBeforeMapping.getAbsoluteEnd() - nodeBeforeMapping.getAbsoluteStart());
+    }
+    
+    public void startMapping(ISourceLocation node, int line, int column)
+    {
+        if (lastMapping != null)
+        {
+            FilePosition sourceStartPosition = lastMapping.sourceStartPosition;
+            throw new IllegalStateException("Cannot start new mapping when another mapping is already started. "
+                    + "Previous mapping at Line " + sourceStartPosition.getLine()
+                    + " and Column " + sourceStartPosition.getColumn()
+                    + " in file " + lastMapping.sourcePath);
+        }
+        
+        String sourcePath = node.getSourcePath();
+        if (sourcePath == null)
+        {
+            //if the source path is null, this node may have been generated by
+            //the compiler automatically. for example, an untyped variable will
+            //have a node for the * type.
+            if (node instanceof IASNode)
+            {
+                IASNode parentNode = ((IASNode) node).getParent();
+                if (parentNode != null)
+                {
+                    //try the parent node
+                    startMapping(parentNode, line, column);
+                    return;
+                }
+            }
+        }
+        
+        String nodeName = null;
+        if (nameStack.size() > 0)
+        {
+            nodeName = nameStack.lastElement();
+        }
+        SourceMapMapping mapping = new SourceMapMapping();
+        mapping.sourcePath = sourcePath;
+        mapping.name = nodeName;
+        mapping.sourceStartPosition = new FilePosition(line, column);
+        mapping.destStartPosition = new FilePosition(getCurrentLine(), getCurrentColumn());
+        lastMapping = mapping;
+    }
+
+    public void endMapping(ISourceLocation node)
+    {
+        if (lastMapping == null)
+        {
+            throw new IllegalStateException("Cannot end mapping when a mapping has not been started");
+        }
+
+        lastMapping.destEndPosition = new FilePosition(getCurrentLine(), getCurrentColumn());
+        sourceMapMappings.add(lastMapping);
+        lastMapping = null;
+    }
+
+    /**
+     * Adjusts the line numbers saved in the source map when a line should be
+     * added during post processing.
+     *
+     * @param lineIndex
+     */
+    protected void addLineToMappings(int lineIndex)
+    {
+        for (SourceMapMapping mapping : sourceMapMappings)
+        {
+            FilePosition destStartPosition = mapping.destStartPosition;
+            int startLine = destStartPosition.getLine();
+            if(startLine > lineIndex)
+            {
+                mapping.destStartPosition = new FilePosition(startLine + 1, destStartPosition.getColumn());
+                FilePosition destEndPosition = mapping.destEndPosition;
+                mapping.destEndPosition = new FilePosition(destEndPosition.getLine() + 1, destEndPosition.getColumn());
+            }
+        }
+    }
+
+    /**
+     * Adjusts the line numbers saved in the source map when a line should be
+     * removed during post processing.
+     * 
+     * @param lineIndex
+     */
+    protected void removeLineFromMappings(int lineIndex)
+    {
+        for (SourceMapMapping mapping : sourceMapMappings)
+        {
+            FilePosition destStartPosition = mapping.destStartPosition;
+            int startLine = destStartPosition.getLine();
+            if(startLine > lineIndex)
+            {
+                mapping.destStartPosition = new FilePosition(startLine - 1, destStartPosition.getColumn());
+                FilePosition destEndPosition = mapping.destEndPosition;
+                mapping.destEndPosition = new FilePosition(destEndPosition.getLine() - 1, destEndPosition.getColumn());
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitterTokens.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitterTokens.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitterTokens.java
new file mode 100644
index 0000000..82935af
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitterTokens.java
@@ -0,0 +1,47 @@
+/*
+ *
+ *  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.internal.codegen.js;
+
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+
+public enum JSEmitterTokens implements IEmitterTokens
+{
+    ARGUMENTS("arguments"),
+    CALL("call"),
+    CONFIGURABLE("configurable"),
+    CONSTRUCTOR("constructor"),
+    DEFINE_PROPERTY("defineProperty"),
+    DEFINE_PROPERTIES("defineProperties"),
+    INTERFACE("interface"),
+    PROTOTYPE("prototype"),
+    SLICE("slice"),
+    ARRAY("Array");
+
+    private String token;
+
+    private JSEmitterTokens(String value)
+    {
+        token = value;
+    }
+
+    public String getToken()
+    {
+        return token;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSFilterWriter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSFilterWriter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSFilterWriter.java
new file mode 100644
index 0000000..bf17a87
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSFilterWriter.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.internal.codegen.js;
+
+import java.io.Writer;
+
+import org.apache.flex.compiler.internal.codegen.as.ASFilterWriter;
+
+/**
+ * @author Michael Schmalle
+ */
+public class JSFilterWriter extends ASFilterWriter
+{
+
+    public JSFilterWriter(Writer out)
+    {
+        super(out);
+    }
+
+    @Override
+    public String toString()
+    {
+        return out.toString();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSPublisher.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSPublisher.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSPublisher.java
new file mode 100644
index 0000000..cc49504
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSPublisher.java
@@ -0,0 +1,85 @@
+/*
+ *
+ *  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.internal.codegen.js;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.io.FilenameUtils;
+import org.apache.flex.compiler.clients.problems.ProblemQuery;
+import org.apache.flex.compiler.codegen.js.IJSPublisher;
+import org.apache.flex.compiler.config.Configuration;
+
+public class JSPublisher implements IJSPublisher
+{
+
+    public JSPublisher(Configuration config)
+    {
+        this.configuration = config;
+    }
+
+    protected File outputFolder;
+    protected File outputParentFolder;
+
+
+    protected Configuration configuration;
+
+    public File getOutputFolder()
+    {
+        outputFolder = new File(getOutputFilePath());
+        if (!outputFolder.isDirectory())
+            outputFolder = outputFolder.getParentFile();
+
+        outputParentFolder = outputFolder;
+
+        setupOutputFolder();
+
+        return outputFolder;
+    }
+
+    protected void setupOutputFolder()
+    {
+        if (outputParentFolder.exists())
+            org.apache.commons.io.FileUtils.deleteQuietly(outputParentFolder);
+
+        if (!outputFolder.exists())
+            outputFolder.mkdirs();
+    }
+
+    private String getOutputFilePath()
+    {
+        if (configuration.getOutput() == null)
+        {
+            final String extension = "." + JSSharedData.OUTPUT_EXTENSION;
+            return FilenameUtils.removeExtension(configuration.getTargetFile())
+                    .concat(extension);
+        }
+        else
+            return configuration.getOutput();
+    }
+
+    public boolean publish(ProblemQuery problems) throws IOException
+    {
+        System.out
+                .println("The project has been successfully compiled and optimized.");
+        return true;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSessionModel.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSessionModel.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSessionModel.java
new file mode 100644
index 0000000..5c45227
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSessionModel.java
@@ -0,0 +1,180 @@
+/*
+ *
+ *  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.internal.codegen.js;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Stack;
+
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+
+/**
+ * @author Michael Schmalle
+ */
+public class JSSessionModel
+{
+    public static final String CONSTRUCTOR_EMPTY = "emptyConstructor";
+    public static final String CONSTRUCTOR_FULL = "fullConstructor";
+    public static final String SUPER_FUNCTION_CALL = "replaceSuperFunction";
+
+    private IClassDefinition currentClass;
+
+    public static class PropertyNodes
+    {
+        public IGetterNode getter;
+        public ISetterNode setter;
+    }
+
+    private static class Context
+    {
+    	public LinkedHashMap<String, PropertyNodes> propertyMap;
+    	public List<String> interfacePropertyMap;
+    	public LinkedHashMap<String, PropertyNodes> staticPropertyMap;
+    	public ArrayList<String> bindableVars;
+    	public ArrayList<IVariableNode> vars;
+    	public ArrayList<IFunctionNode> methods;
+    	public IClassDefinition classDefinition;
+    }
+    private Stack<Context> stack = new Stack<Context>();
+    
+    private LinkedHashMap<String, PropertyNodes> propertyMap = new LinkedHashMap<String, PropertyNodes>();
+
+    private List<String> interfacePropertyMap = new ArrayList<String>();
+
+    private LinkedHashMap<String, PropertyNodes> staticPropertyMap = new LinkedHashMap<String, PropertyNodes>();
+
+    private ArrayList<String> bindableVars = new ArrayList<String>();
+
+    private ArrayList<IVariableNode> vars = new ArrayList<IVariableNode>();
+    
+    private ArrayList<IFunctionNode> methods = new ArrayList<IFunctionNode>();
+    
+    private HashMap<String, String> internalClasses;
+    
+    private int foreachLoopCount = 0;
+
+    public IClassDefinition getCurrentClass()
+    {
+        return currentClass;
+    }
+
+    public void setCurrentClass(IClassDefinition currentClass)
+    {
+        this.currentClass = currentClass;
+    }
+
+    public void pushClass(IClassDefinition currentClass)
+    {
+    	Context context = new Context();
+    	context.bindableVars = bindableVars;
+    	context.interfacePropertyMap = interfacePropertyMap;
+    	context.propertyMap = propertyMap;
+    	context.staticPropertyMap = staticPropertyMap;
+    	context.classDefinition = this.currentClass;
+    	context.vars = vars;
+    	context.methods = methods;
+    	stack.push(context);
+        this.currentClass = currentClass;
+        bindableVars = new ArrayList<String>();
+        staticPropertyMap = new LinkedHashMap<String, PropertyNodes>();
+        interfacePropertyMap = new ArrayList<String>();
+        propertyMap = new LinkedHashMap<String, PropertyNodes>();
+        vars = new ArrayList<IVariableNode>();
+        methods = new ArrayList<IFunctionNode>();
+    }
+
+    public void popClass()
+    {
+    	Context context = stack.pop();
+    	this.currentClass = context.classDefinition;
+    	bindableVars = context.bindableVars;
+    	staticPropertyMap = context.staticPropertyMap;
+    	propertyMap = context.propertyMap;
+    	interfacePropertyMap = context.interfacePropertyMap;
+    	vars = context.vars;
+    	methods = context.methods;
+    }
+    
+    public HashMap<String, PropertyNodes> getPropertyMap()
+    {
+        return propertyMap;
+    }
+
+    public List<String> getInterfacePropertyMap()
+    {
+        return interfacePropertyMap;
+    }
+
+    public HashMap<String, PropertyNodes> getStaticPropertyMap()
+    {
+        return staticPropertyMap;
+    }
+
+    public boolean hasBindableVars()
+    {
+        return bindableVars.size() > 0;
+    }
+
+    public List<String> getBindableVars()
+    {
+        return bindableVars;
+    }
+
+    public List<IVariableNode> getVars()
+    {
+        return vars;
+    }
+
+    public List<IFunctionNode> getMethods()
+    {
+        return methods;
+    }
+
+    public HashMap<String, String> getInternalClasses()
+    {
+    	if (internalClasses == null)
+    		internalClasses = new HashMap<String, String>();
+        return internalClasses;
+    }
+
+    public boolean isInternalClass(String className)
+    {
+    	if (internalClasses == null) return false;
+    	
+        return internalClasses.containsKey(className);
+    }
+
+    public final void incForeachLoopCount()
+    {
+        foreachLoopCount++;
+    }
+
+    public String getCurrentForeachName()
+    {
+        return "foreachiter" + Integer.toString(foreachLoopCount);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSharedData.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSharedData.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSharedData.java
new file mode 100644
index 0000000..e430a03
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSharedData.java
@@ -0,0 +1,116 @@
+/*
+ *
+ *  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.internal.codegen.js;
+
+import java.io.PrintStream;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.workspaces.Workspace;
+
+// TODO (mschmalle) This class sucks, figure out some other way instead of using
+// a static singleton class like this, change when implementing Configuration
+public class JSSharedData
+{
+
+    public static final String COMPILER_NAME = "MXMLJSC";
+    public static final boolean OUTPUT_TIMESTAMPS = true;
+    public static final String COMPILER_VERSION = "329449.1";
+
+    public final static JSSharedData instance = new JSSharedData();
+
+    public static IBackend backend;
+    public static String OUTPUT_EXTENSION;
+    public static Workspace workspace;
+
+    public static PrintStream STDOUT = System.out;
+    public static PrintStream STDERR = System.err;
+
+    @SuppressWarnings("unused")
+    private Boolean m_verbose = false;
+    private final ReadWriteLock m_verboseLock = new ReentrantReadWriteLock();
+
+    private Object m_codeGenMonitor = new Object();
+    private long m_codeGenCounter = 0;
+    private final ReadWriteLock m_codeGenCounterLock = new ReentrantReadWriteLock();
+
+    public static String now()
+    {
+        final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss";
+        Calendar cal = Calendar.getInstance();
+        SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
+        return sdf.format(cal.getTime());
+    }
+
+    public void stdout(String s)
+    {
+        if (STDOUT != null)
+        {
+            m_verboseLock.writeLock().lock();
+            STDOUT.println(s);
+            m_verboseLock.writeLock().unlock();
+        }
+    }
+
+    public void stderr(String s)
+    {
+        if (STDERR != null)
+        {
+            m_verboseLock.writeLock().lock();
+            STDERR.println(s);
+            m_verboseLock.writeLock().unlock();
+        }
+    }
+
+    public void beginCodeGen()
+    {
+        m_codeGenCounterLock.writeLock().lock();
+        m_codeGenCounter++;
+        m_codeGenCounterLock.writeLock().unlock();
+    }
+
+    public void endCodeGen()
+    {
+        m_codeGenCounterLock.writeLock().lock();
+        final long currentCounter = --m_codeGenCounter;
+        m_codeGenCounterLock.writeLock().unlock();
+
+        if (currentCounter == 0)
+        {
+            synchronized (m_codeGenMonitor)
+            {
+                m_codeGenMonitor.notifyAll();
+            }
+        }
+    }
+
+    public static String getTimeStampString()
+    {
+        if (JSSharedData.OUTPUT_TIMESTAMPS)
+            return "CROSS-COMPILED BY " + JSSharedData.COMPILER_NAME + " ("
+                    + JSSharedData.COMPILER_VERSION + ") ON "
+                    + JSSharedData.now() + "\n";
+        else
+            return "CROSS-COMPILED BY " + JSSharedData.COMPILER_NAME + "\n";
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSourceMapEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSourceMapEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSourceMapEmitter.java
new file mode 100644
index 0000000..bcdeed5
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSourceMapEmitter.java
@@ -0,0 +1,67 @@
+/*
+ *
+ *  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.internal.codegen.js;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.ISourceMapEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+
+import com.google.debugging.sourcemap.SourceMapGeneratorV3;
+
+public class JSSourceMapEmitter implements ISourceMapEmitter
+{
+    private IJSEmitter emitter;
+    private SourceMapGeneratorV3 sourceMapGenerator;
+
+    public JSSourceMapEmitter(IJSEmitter emitter)
+    {
+        this.emitter = emitter;
+        sourceMapGenerator = new SourceMapGeneratorV3();
+    }
+    
+    public String emitSourceMap(String fileName, String sourceMapPath, String sourceRoot)
+    {
+        List<IJSEmitter.SourceMapMapping> mappings = this.emitter.getSourceMapMappings();
+        for (IJSEmitter.SourceMapMapping mapping : mappings)
+        {
+            sourceMapGenerator.addMapping(mapping.sourcePath, mapping.name,
+                    mapping.sourceStartPosition,
+                    mapping.destStartPosition, mapping.destEndPosition);
+        }
+        if (sourceRoot != null)
+        {
+            sourceMapGenerator.setSourceRoot(sourceRoot);
+        }
+
+        StringBuilder builder = new StringBuilder();
+        try
+        {
+            sourceMapGenerator.appendTo(builder, fileName);
+        }
+        catch (IOException e)
+        {
+            e.printStackTrace();
+        }
+        
+        return builder.toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java
new file mode 100644
index 0000000..be0b9d1
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSSubEmitter.java
@@ -0,0 +1,126 @@
+/*
+ *
+ *  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.internal.codegen.js;
+
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.common.ISourceLocation;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+
+public class JSSubEmitter
+{
+    private IJSEmitter emitter;
+
+    protected IJSEmitter getEmitter()
+    {
+        return emitter; 
+    }
+
+    protected IBlockWalker getWalker()
+    {
+        return emitter.getWalker();
+    }
+    
+    protected ICompilerProject getProject()
+    {
+        return emitter.getWalker().getProject();
+    }
+
+    protected JSSessionModel getModel()
+    {
+        return emitter.getModel();
+    }
+
+    public JSSubEmitter(IJSEmitter emitter)
+    {
+        this.emitter = emitter;
+    }
+
+    protected void write(IEmitterTokens value)
+    {
+        emitter.write(value);
+    }
+
+    protected void write(String value)
+    {
+        emitter.write(value);
+    }
+
+    protected void writeToken(IEmitterTokens value)
+    {
+        emitter.writeToken(value);
+    }
+
+    protected void writeToken(String value)
+    {
+        emitter.writeToken(value);
+    }
+
+    protected void writeNewline()
+    {
+        emitter.writeNewline();
+    }
+
+    protected void writeNewline(IEmitterTokens value)
+    {
+        emitter.writeNewline(value);
+    }
+
+    protected void writeNewline(String value)
+    {
+        emitter.writeNewline(value);
+    }
+
+    protected void writeNewline(String value, boolean pushIndent)
+    {
+        emitter.writeNewline(value, pushIndent);
+    }
+
+    protected void indentPush()
+    {
+        emitter.indentPush();
+    }
+
+    protected void indentPop()
+    {
+        emitter.indentPop();
+    }
+
+    protected void startMapping(ISourceLocation node)
+    {
+        emitter.startMapping(node);
+    }
+
+    protected void startMapping(ISourceLocation node, int line, int column)
+    {
+        emitter.startMapping(node, line, column);
+    }
+
+    protected void startMapping(ISourceLocation node, ISourceLocation nodeBeforeMapping)
+    {
+        emitter.startMapping(node, nodeBeforeMapping);
+    }
+
+    protected void endMapping(ISourceLocation node)
+    {
+        emitter.endMapping(node);
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSWriter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSWriter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSWriter.java
new file mode 100644
index 0000000..e984eda
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSWriter.java
@@ -0,0 +1,166 @@
+/*
+ *
+ *  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.internal.codegen.js;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.List;
+import java.util.Stack;
+
+import org.apache.flex.compiler.codegen.ISourceMapEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.codegen.js.IJSWriter;
+import org.apache.flex.compiler.driver.js.IJSBackend;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.as.IASBlockWalker;
+
+public class JSWriter implements IJSWriter
+{
+    protected IASProject project;
+
+    protected List<ICompilerProblem> problems;
+
+    protected ICompilationUnit compilationUnit;
+
+    @SuppressWarnings("unused")
+    private boolean enableDebug;
+
+    /**
+     * Create a JSApplication writer.
+     * 
+     * @param application the JSApplication model to be encoded
+     * @param useCompression use ZLIB compression if true
+     */
+    public JSWriter(IASProject project, List<ICompilerProblem> problems,
+            ICompilationUnit compilationUnit, boolean enableDebug)
+    {
+        this.project = project;
+        this.problems = problems;
+        this.compilationUnit = compilationUnit;
+        this.enableDebug = enableDebug;
+    }
+
+    @Override
+    public void close() throws IOException
+    {
+        //outputBuffer.close();
+    }
+
+    @Override
+    public void writeTo(OutputStream out)
+    {
+        writeTo(out, null);
+    }
+
+    @Override
+    public int writeTo(File out) throws FileNotFoundException, IOException
+    {
+        return 0;
+    }
+
+    public void writeTo(OutputStream jsOut, File sourceMapOut)
+    {
+        IJSBackend backend = (IJSBackend) JSSharedData.backend;
+        JSFilterWriter writer = (JSFilterWriter) backend.createWriterBuffer(project);
+        IJSEmitter emitter = (IJSEmitter) backend.createEmitter(writer);
+        IASBlockWalker walker = backend.createWalker(project,
+                problems, emitter);
+
+        walker.visitCompilationUnit(compilationUnit);
+
+        try
+        {
+            jsOut.write(emitter.postProcess(writer.toString()).getBytes());
+        }
+        catch (IOException e)
+        {
+            e.printStackTrace();
+        }
+
+        if (sourceMapOut != null)
+        {
+            convertMappingSourcePathsToRelative(emitter, sourceMapOut);
+
+            File compilationUnitFile = new File(compilationUnit.getAbsoluteFilename());
+            ISourceMapEmitter sourceMapEmitter = backend.createSourceMapEmitter(emitter);
+            try
+            {
+                String fileName = compilationUnitFile.getName();
+                fileName = fileName.replace(".as", ".js");
+                String sourceMap = sourceMapEmitter.emitSourceMap(fileName, sourceMapOut.getAbsolutePath(), null);
+                BufferedOutputStream outStream = new BufferedOutputStream(new FileOutputStream(sourceMapOut));
+                outStream.write(sourceMap.getBytes());
+                outStream.flush();
+                outStream.close();
+            } catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+    }
+    
+    protected void convertMappingSourcePathsToRelative(IJSEmitter emitter, File relativeToFile)
+    {
+        List<IJSEmitter.SourceMapMapping> mappings = emitter.getSourceMapMappings();
+        for (IJSEmitter.SourceMapMapping mapping : mappings)
+        {
+            mapping.sourcePath = relativePath(mapping.sourcePath, relativeToFile.getAbsolutePath());
+        }
+    }
+
+    //if we ever support Java 7, the java.nio.file.Path relativize() method
+    //should be able to replace this method
+    private String relativePath(String filePath, String relativeToFilePath)
+    {
+        File currentFile = new File(filePath);
+        Stack<String> stack = new Stack<String>();
+        stack.push(currentFile.getName());
+        currentFile = currentFile.getParentFile();
+        while (currentFile != null)
+        {
+            String absoluteCurrentFile = currentFile.getAbsolutePath() + File.separator;
+            if (relativeToFilePath.startsWith(absoluteCurrentFile))
+            {
+                String relativeRelativeToFile = relativeToFilePath.substring(absoluteCurrentFile.length());
+                int separatorCount = relativeRelativeToFile.length() - relativeRelativeToFile.replace(File.separator, "").length();
+                String result = "";
+                while (separatorCount > 0)
+                {
+                    result += ".." + File.separator;
+                    separatorCount--;
+                }
+                while (stack.size() > 0)
+                {
+                    result += stack.pop();
+                }
+                return result;
+            }
+            stack.push(currentFile.getName() + File.separator);
+            currentFile = currentFile.getParentFile();
+        }
+        return null;
+    }
+}


[06/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGenerator.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGenerator.java b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGenerator.java
deleted file mode 100644
index 154a70c..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGenerator.java
+++ /dev/null
@@ -1,925 +0,0 @@
-/*
- *
- *  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.internal.as.codegen;
-
-import static org.apache.flex.abc.ABCConstants.OP_add;
-import static org.apache.flex.abc.ABCConstants.OP_getlocal0;
-import static org.apache.flex.abc.ABCConstants.OP_pushscope;
-import static org.apache.flex.abc.ABCConstants.OP_returnvalue;
-import static org.apache.flex.abc.ABCConstants.OP_returnvoid;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-
-import org.apache.flex.abc.ABCConstants;
-import org.apache.flex.abc.instructionlist.InstructionList;
-import org.apache.flex.abc.semantics.MethodBodyInfo;
-import org.apache.flex.abc.semantics.MethodInfo;
-import org.apache.flex.abc.semantics.Name;
-import org.apache.flex.abc.visitors.IMethodBodyVisitor;
-import org.apache.flex.abc.visitors.IMethodVisitor;
-import org.apache.flex.abc.visitors.IScriptVisitor;
-import org.apache.flex.abc.visitors.IVisitor;
-import org.apache.flex.compiler.definitions.references.IReference;
-import org.apache.flex.compiler.exceptions.BURMAbortException;
-import org.apache.flex.compiler.exceptions.CodegenInterruptedException;
-import org.apache.flex.compiler.exceptions.MissingBuiltinException;
-import org.apache.flex.compiler.internal.as.codegen.ICodeGenerator.IConstantValue;
-import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
-import org.apache.flex.compiler.internal.definitions.ParameterDefinition;
-import org.apache.flex.compiler.internal.definitions.TypeDefinitionBase;
-import org.apache.flex.compiler.internal.embedding.EmbedData;
-import org.apache.flex.compiler.internal.scopes.ASScope;
-import org.apache.flex.compiler.internal.testing.NodesToXMLStringFormatter;
-import org.apache.flex.compiler.internal.tree.as.FunctionNode;
-import org.apache.flex.compiler.internal.tree.mxml.MXMLFileNode;
-import org.apache.flex.compiler.internal.units.requests.ABCBytesRequestResult;
-import org.apache.flex.compiler.problems.CodegenInternalProblem;
-import org.apache.flex.compiler.problems.ICompilerProblem;
-import org.apache.flex.compiler.problems.MissingBuiltinProblem;
-import org.apache.flex.compiler.projects.ICompilerProject;
-import org.apache.flex.compiler.tree.as.IASNode;
-import org.apache.flex.compiler.tree.as.IExpressionNode;
-import org.apache.flex.compiler.units.ICompilationUnit;
-import org.apache.flex.compiler.units.ICompilationUnit.Operation;
-import org.apache.flex.compiler.units.requests.IABCBytesRequestResult;
-
-import com.google.common.util.concurrent.Futures;
-
-/**
- * ABCGenerator is the public interface to the code generator.
- */
-
-/**
- * JSGenerator is modeled after from ABCGenerator and called by
- * JSCompilationUnit. JSGenerator owns the JSSharedData singleton. Ideally
- * JSGenerator and ABCGenerator should be derived from the same base class, i.e.
- * Generator. Some of the code in JSGenerator and ABCGenerator could be shared
- * if Generator used a burm factory in generateInstructions(). ABCGenerator
- * creates and uses a CmcEmitter, while JSGenerator uses a CmcJSEmitter. This
- * implementation is part of FalconJS. For more details on FalconJS see
- * org.apache.flex.compiler.JSDriver
- */
-public class JSGenerator implements ICodeGenerator
-{
-    public ICompilationUnit m_compilationUnit = null;
-    private Boolean m_needsSecondPass = false;
-    private CmcJSEmitter m_cmcJSEmitter = null;
-    private JSGeneratingReducer m_burm = null;
-    private ICompilationUnit.Operation m_buildPhase = Operation.GET_ABC_BYTES;
-    private JSEmitter m_emitter = null;
-
-    public JSGenerator()
-    {
-        m_cmcJSEmitter = JSSharedData.backend.createCmcJSEmitter();
-        m_cmcJSEmitter.reducer = JSSharedData.backend.createReducer();
-        m_burm = m_cmcJSEmitter.reducer;
-    }
-
-    // If JSEmitter.needsSecondPass() returns true, JSGenerator.generate() will return null during scanning, 
-    // which will result in JSCompilationUnit::handleSemanticProblemsRequest not caching any abcBytes for 
-    // handleABCBytesRequest. The net result is that JSGenerator.generate() will be called again in handleABCBytesRequest. 
-    // This mechanic will ensure selective two-pass compilation. 
-    public Boolean needsSecondPass()
-    {
-        return m_needsSecondPass;
-    }
-
-    /*
-     * There are currently a lot of problems with the DependencyGraph: -
-     * ImportNode::resolveRefs() has not been implemented. - import and
-     * expression dependencies are not being recognized. If
-     * useOwnDependencyGraph() returns true we use our own (old) DependencyGraph
-     * implementation that used to drive the while loop in
-     * JSGenerator.generate() using nextJS. - JSDriver does a second pass -
-     * JSGlobalDirectiveProcessor::processImportDirective() registers imported
-     * classes.
-     */
-    public static Boolean useOwnDependencyGraph()
-    {
-        // return true;
-        return false;
-    }
-
-    /**
-     * Generate an ABC file equivalent to the input syntax tree.
-     * 
-     * @param synthetic_name_prefix Prefix to prepend to all synthetic names
-     * @param root_node the root of the syntax tree.
-     * @param project {@link ICompilerProject} whose symbol table is used to
-     * resolve references to definitions.
-     * @throws InterruptedException
-     */
-    @SuppressWarnings("nls")
-    public ABCBytesRequestResult generate(String synthetic_name_prefix, IASNode root_node, ICompilerProject project) throws InterruptedException
-    {
-        return generate(null, false, synthetic_name_prefix, root_node, project, false, Collections.<String, String>emptyMap());    	
-    }
-    
-    @Override
-	public ABCBytesRequestResult generate(ExecutorService executorService, boolean useParallelCodegen,
-	                                      String synthetic_name_prefix, IASNode root_node,
-	                                      ICompilerProject project, boolean inInvisibleCompilationUnit,
-	                                      Map<String, String> encodedDebugFiles)
-        throws InterruptedException
-	{
-        m_needsSecondPass = false;
-        if (root_node instanceof MXMLFileNode)
-        	m_emitter = new JSMXMLEmitter(JSSharedData.instance, m_buildPhase, project, this);
-        else
-        	m_emitter = JSSharedData.backend.createEmitter(m_buildPhase, project, this);
-        m_emitter.visit(ABCConstants.VERSION_ABC_MAJOR_FP10, ABCConstants.VERSION_ABC_MINOR_FP10);
-
-        IScriptVisitor sv = m_emitter.visitScript();
-        sv.visit();
-        MethodInfo init_method = new MethodInfo();
-        sv.visitInit(init_method);
-
-        MethodBodyInfo init_body = new MethodBodyInfo();
-        init_body.setMethodInfo(init_method);
-
-        IMethodVisitor mv = m_emitter.visitMethod(init_method);
-        IMethodBodyVisitor mbv = mv.visitBody(init_body);
-        mbv.visit();
-
-        //  Set up the global lexical scope.
-        final LexicalScope global_scope = new GlobalLexicalScope(project, this, synthetic_name_prefix, m_emitter);
-        global_scope.traitsVisitor = sv.visitTraits();
-        global_scope.setMethodInfo(init_method);
-        global_scope.methodBodyVisitor = mbv;
-
-        //  Process global directives.
-        GlobalDirectiveProcessor top_level_processor = JSSharedData.backend.createGlobalDirectiveProcessor(this, global_scope, m_emitter);
-        boolean fatal_error_encountered = false;
-        try
-        {
-            top_level_processor.traverse(root_node);
-        }
-        catch (MissingBuiltinException e)
-        {
-            global_scope.addProblem(new MissingBuiltinProblem(root_node, e.getBuiltinName()));
-            fatal_error_encountered = true;
-        }
-        catch (CodegenInterruptedException e)
-        {
-            //  Unwrap the InterruptedException and rethrow it.
-            throw e.getException();
-        }
-
-        byte[] generatedBytes = IABCBytesRequestResult.ZEROBYTES;
-
-        if (!fatal_error_encountered)
-        {
-            //  Initialize the init script.
-            InstructionList script_init_insns = new InstructionList();
-
-            script_init_insns.addInstruction(OP_getlocal0);
-            script_init_insns.addInstruction(OP_pushscope);
-
-            script_init_insns.addAll(global_scope.getInitInstructions());
-            script_init_insns.addAll(top_level_processor.directiveInsns);
-
-            if (script_init_insns.canFallThrough() || script_init_insns.hasPendingLabels())
-                script_init_insns.addInstruction(OP_returnvoid);
-
-            //  Allocate temps beginning with register 1,
-            //  register 0 is reserved for "this" global.
-            global_scope.initializeTempRegisters(1);
-
-            mbv.visitInstructionList(script_init_insns);
-            mbv.visitEnd();
-            mv.visitEnd();
-            sv.visitEnd();
-
-            try
-            {
-                generatedBytes = m_emitter.emit();
-            }
-            catch (Throwable cant_generate)
-            {
-                global_scope.addProblem(new CodegenInternalProblem(root_node, cant_generate));
-            }
-        }
-
-        ICompilerProblem[] problemsArray = global_scope.getProblems().toArray(IABCBytesRequestResult.ZEROPROBLEMS);
-        return new ABCBytesRequestResult(generatedBytes, problemsArray, Collections.<EmbedData> emptySet());
-    }
-
-    /**
-     * Translate an AST into ABC instructions.
-     * 
-     * @param subtree - the CM subtree.
-     * @param goal_state - the desired goal state. One of the nonterminal states
-     * in CmcJSEmitter, or 0 if you're feeling lucky and are willing to accept
-     * whatever instruction sequence the BURM decides is optimal.
-     * @param scope - the active lexical scope.
-     * @return a list of ABC instructions.
-     */
-    public InstructionList generateInstructions(IASNode subtree, int goal_state, LexicalScope scope)
-    {
-        return generateInstructions(subtree, goal_state, scope, null);
-    }
-
-    /**
-     * Translate an AST into ABC instructions.
-     * 
-     * @param subtree - the CM subtree.
-     * @param goal_state - the desired goal state. One of the nonterminal states
-     * in CmcJSEmitter, or 0 if you're feeling lucky and are willing to accept
-     * whatever instruction sequence the BURM decides is optimal.
-     * @param scope - the active lexical scope.
-     * @param instance_init_insns - a list of instance initialization
-     * instructions collected outside a constructor body that must be included
-     * in the constructor.
-     * @post if instance_init_insns is not null then the method will have been
-     * processed as and marked as a constructor.
-     * @return a list of ABC instructions.
-     */
-    public InstructionList generateInstructions(IASNode subtree, int goal_state, LexicalScope scope, InstructionList instance_init_insns)
-    {
-        m_burm.setCurrentscope(scope);
-        m_burm.setInstanceInitializers(instance_init_insns);
-        m_burm.setAprioriinstructions(instance_init_insns);
-        m_burm.setFunctionNode(subtree);
-
-        InstructionList list = new InstructionList();
-
-        try
-        {
-            m_cmcJSEmitter.burm(subtree, goal_state);
-
-            // TODO: cmcJSEmitter.getResult() now returns a String, which needs to be wrapped into an InstructionList
-            // return ((InstructionList)cmcJSEmitter.getResult());
-            list.addInstruction(JSSharedData.OP_JS, m_cmcJSEmitter.getResult());
-
-            // If JSEmitter.needsSecondPass() returns true, JSGenerator.generate() will return null during scanning, 
-            // which will result in JSCompilationUnit::handleSemanticProblemsRequest not caching any abcBytes for 
-            // handleABCBytesRequest. The net result is that JSGenerator.generate() will be called again in handleABCBytesRequest. 
-            // This mechanic will ensure selective two-pass compilation. 
-            if (m_burm.needsSecondPass())
-            {
-                m_needsSecondPass = true;
-            }
-        }
-        catch (Exception cant_reduce)
-        {
-            handleBurmError(m_cmcJSEmitter, subtree, cant_reduce, scope);
-        }
-
-        return list;
-    }
-
-    /**
-     * Generate code for a function declaration, and put its initialization code
-     * on the relevant instruction list.
-     * 
-     * @param func - the function declaration node.
-     * @param enclosing_scope - the lexical scope in which the function was
-     * defined.
-     * @param a_priori_insns - instructions generated by an enclosing subsystem
-     * that should be included in the function (e.g., a constructor needs a
-     * priori instructions to initialize instance vars).
-     */
-    public MethodInfo generateFunction(FunctionNode func, LexicalScope enclosing_scope, InstructionList a_priori_insns)
-    {
-        m_burm.setCurrentscope(enclosing_scope);
-        MethodInfo mi = createMethodInfo(m_burm, m_emitter, enclosing_scope, func);
-        if (mi.isNative())
-        {
-            generateNativeMethod(func, mi, enclosing_scope);
-        }
-        else
-        {
-            /*
-             * Now done in JSEmitter: // support for class inits. // If this is
-             * a static function and the owner class has a class init then call
-             * __static_init() final IDefinition fdef = func.getDefinition();
-             * if( fdef.isStatic() && fdef.getParent() != null &&
-             * fdef.getParent() instanceof ClassDefinition ) { final IDefinition
-             * cdef = fdef.getParent(); final String fullName =
-             * JSGeneratingReducer
-             * .createFullNameFromDefinition(enclosing_scope.getProject(),cdef);
-             * if( JSSharedData.instance.hasClassInit(fullName) ) { final String
-             * callInit = fullName + "." + JSSharedData.STATIC_INIT + "();\n";
-             * if( a_priori_insns == null ) a_priori_insns = new
-             * InstructionList(); a_priori_insns.addInstruction(
-             * JSSharedData.OP_JS, callInit ); } }
-             */
-            m_burm.startFunction(func);
-            generateMethodBodyForFunction(mi, func, enclosing_scope, a_priori_insns);
-            m_burm.endFunction(func);
-        }
-
-        return mi;
-    }
-    
-    public GenerateFunctionInParallelResult generateFunctionInParallel (ExecutorService executorService, FunctionNode func, LexicalScope enclosing_scope)
-    {
-    	/** AJH commented out for now
-        MethodInfo mi = createMethodInfo(enclosing_scope, func);
-        if (mi.isNative())
-        {
-            generateNativeMethod(func, mi, enclosing_scope);
-            return new GenerateFunctionInParallelResult(Futures.immediateFuture(null), mi, Collections.<IVisitor>emptyList());
-        }
-        GenerateFunctionRunnable runnable = new GenerateFunctionRunnable(mi, func, enclosing_scope);
-        Future<?> future = executorService.submit(runnable);
-        return new GenerateFunctionInParallelResult(future, mi, runnable.getDeferredVisitEndsList());
-        */
-    	System.out.println("unhandled call to generateFunctionInParallel");
-    	return null;
-    }
-
-    /**
-     * Helper method used by <code>generateFunction()</code>.
-     * 
-     * @param func - the function declaration node.
-     * @param mi - the MethodInfo describing the signature
-     * @param enclosing_scope - the lexical scope in which the handler method is
-     * autogenerated.
-     */
-    static void generateNativeMethod(FunctionNode func, MethodInfo mi,
-                                     LexicalScope enclosing_scope)
-    {
-        enclosing_scope.getMethodBodySemanticChecker().checkNativeMethod(func);
-
-        // don't need to create a new scope, so just use the enclosing scope
-        // to get a handle to the emitter
-        IMethodVisitor mv = enclosing_scope.getEmitter().visitMethod(mi);
-
-        // Just visit the method info.  Do NOT generate a body
-        // for native methods
-        mv.visit();
-
-        // func.getReturnType() returns a short name string.
-        // But we need a real name. ctors don't have return types.
-        if (!func.isConstructor())
-        {
-            final ASScope scope = (ASScope)JSGeneratingReducer.getScopeFromNode(func);
-            final FunctionDefinition fdef = func.getDefinition();
-            final IReference ref = fdef.getReturnTypeReference();
-            final Name returnTypeName = ref.getMName(enclosing_scope.getProject(), scope);
-            mi.setReturnType(returnTypeName);
-        }
-
-        // For non native methods, the return type is set by the burm,
-        // but for native types, as the burm isn't run, we need to set
-        // the return type here.
-        // String returnType = func.getReturnType();
-        // mi.setReturnType(new Name(returnType));
-
-        mv.visitEnd();
-    }
-
-    /**
-     * Helper method used by <code>generateFunction()</code> (and also by
-     * <code>generateEventHandler()</code> in MXMLDocumentDirectiveProcessor).
-     * 
-     * @param mi - the MethodInfo describing the signature
-     * @param node - the FunctionNode or MXMLEventSpecifierNode. may be null
-     * when generating method bodies for purely synthetic functions, such as
-     * theIEventDispatcher methods that [Bindable] introduces.
-     * @param enclosing_scope - the lexical scope in which the handler method is
-     * autogenerated.
-     * @param a_priori_insns - instructions generated by an enclosing subsystem
-     * that should be included in the function (e.g., a constructor needs a
-     * priori instructions to initialize instance vars).
-     */
-    public void generateMethodBodyForFunction(MethodInfo mi, IASNode node,
-            LexicalScope enclosing_scope,
-            InstructionList a_priori_insns)
-    {
-        generateMethodBody(mi, node, enclosing_scope, a_priori_insns, CmcEmitter.__function_NT, null);
-    }
-
-    /**
-     * Helper methods used by databinding codegen to emit anonymous functions
-     * based on an expression node.
-     * 
-     * @param mi - the MethodInfo describing the signature
-     * @param node - the expression node whose code will start the function. may
-     * be null when generating method bodies for purely synthetic functions,
-     * such as theIEventDispatcher methods that [Bindable] introduces.
-     * @param enclosing_scope
-     * @param insns_to_append - typically some massaging of the TOS and a return
-     * function
-     */
-    public MethodInfo generateFunctionFromExpression(MethodInfo mi, IASNode node,
-            LexicalScope enclosing_scope,
-            InstructionList insns_to_append)
-    {
-        return generateMethodBody(mi, node, enclosing_scope, null, CmcEmitter.__expression_NT, insns_to_append);
-    }
-
-    /**
-     * Helper methods used by databinding codegen to emit anonymous functions
-     * based on an expression node.
-     * 
-     * @param mi - the MethodInfo describing the signature
-     * @param nodes - a list of expression nodes whose code will start the
-     * function. May have the following values: null when generating method
-     * bodies for purely synthetic functions, such as theIEventDispatcher
-     * methods that [Bindable] introduces. an IASNode for an expression that
-     * will be code-gen'd a List of IASNodes. This is a special case where we
-     * code-gen the sum of all the expressions
-     * @param enclosing_scope
-     * @param insns_to_append - typically some massaging of the TOS and a return
-     * function
-     */
-
-    public MethodInfo generateFunctionFromExpressions(MethodInfo mi, List<? extends IASNode> nodes,
-             LexicalScope enclosing_scope,
-             InstructionList insns_to_append)
-    {
-        return generateMethodBody(mi, nodes, enclosing_scope, null, CmcEmitter.__expression_NT, insns_to_append);
-    }
-
-    /**
-     * General method body maker. see the public documentation, above, for more
-     * into
-     */
-    MethodInfo generateMethodBody(MethodInfo mi, Object node,
-                                         LexicalScope enclosing_scope,
-                                         InstructionList a_priori_insns,
-                                         int goal_state,
-                                         InstructionList insns_to_append)
-    {
-        //  Set up a lexical scope for this function.
-        LexicalScope function_scope = enclosing_scope.pushFrame();
-
-        IMethodVisitor mv = function_scope.getEmitter().visitMethod(mi);
-        mv.visit();
-
-        MethodBodyInfo mbi = new MethodBodyInfo();
-        mbi.setMethodInfo(mi);
-
-        IMethodBodyVisitor mbv = mv.visitBody(mbi);
-        mbv.visit();
-
-        function_scope.methodBodyVisitor = mbv;
-        function_scope.traitsVisitor = mbv.visitTraits();
-        function_scope.setMethodInfo(mi);
-        
-        System.out.println(mi.getMethodName());
-        if (mi.getMethodName().contains("loginInternal"))
-        {
-        	System.out.println("got it");
-        }
-
-        InstructionList insns = null;
-        if (node == null)
-        {
-            // node may be null when generating method bodies for purely synthetic functions, such as the
-            // IEventDispatcher methods that [Bindable] introduces.
-            insns = new InstructionList();
-        }
-        else if (node instanceof IASNode)
-        {
-            // If we are passed a single node, generate its instructions
-            insns = generateInstructions((IASNode)node, goal_state, function_scope, a_priori_insns);
-        }
-        else if (node instanceof List<?>)
-        {
-            List<?> nodes = (List<?>)node;
-
-            // for a list of nodes, generate all their instructions and add the results together.
-            // typically we are doing this to concatenate strings
-            for (int nodeIndex = 0; nodeIndex < nodes.size(); ++nodeIndex)
-            {
-                IASNode n = (IASNode)nodes.get(nodeIndex);
-                if (nodeIndex == 0)
-                {
-                    // First one in the list makes a new IL and puts
-                    // instructions into it
-                    insns = generateInstructions(n, goal_state, function_scope, a_priori_insns);
-                }
-                else
-                {
-                    // successive children generate into the same IS, then add the results
-                    insns.addAll(generateInstructions(n, goal_state, function_scope, a_priori_insns));
-                    insns.addInstruction(OP_add);
-                }
-            }
-        }
-        else
-        {
-            assert false; // Illegal type passed as node parameter
-        }
-        assert insns != null;
-
-        // If caller passed in instructions to get after the BURM-generated stuff,
-        // add them to the instruction stream
-        if (insns_to_append != null)
-        {
-            insns.addAll(insns_to_append);
-        }
-
-        mbv.visitInstructionList(insns);
-
-        if (function_scope.needsActivation())
-        {
-            mi.setFlags((byte)(mi.getFlags() | ABCConstants.NEED_ACTIVATION));
-        }
-
-        mbv.visitEnd();
-        mv.visitEnd();
-
-        return mi;
-    }
-
-    /**
-     * Helper method used by mxml databinding codegen to emit an anonymous
-     * function used by an mxml data binding destination function. Example:
-     * <p>
-     * If the expression node is a.b.c, this method will generate a funtion
-     * whose source would look something like this:
-     * 
-     * <pre>
-     * function (arg:*):void { a.b.c = arg; }
-     * </pre>
-     * 
-     * @param mi - the MethodInfo describing the signature
-     * @param setterExpression {@link IExpressionNode} that is the destination
-     * expression of a mxml data binding.
-     * @param enclosing_scope {@link LexicalScope} for the class initializer
-     * that encloses the function being generated.
-     */
-    public void generateMXMLDataBindingSetterFunction (MethodInfo mi, IExpressionNode setterExpression, LexicalScope enclosing_scope)
-    {
-    	System.out.println("unhandled call to generateMXMLDataBindingSetterFunction");
-    	/* AJH commented out for now
-        IMethodVisitor methodVisitor = enclosing_scope.getEmitter().visitMethod(mi);
-        methodVisitor.visit();
-        MethodBodyInfo methodBodyInfo = new MethodBodyInfo();
-        methodBodyInfo.setMethodInfo(mi);
-        IMethodBodyVisitor methodBodyVisitor = methodVisitor.visitBody(methodBodyInfo);
-        methodBodyVisitor.visit();
-        
-        //  Set up a lexical scope for this function.
-        LexicalScope function_scope = enclosing_scope.pushFrame();
-        
-        function_scope.methodBodyVisitor = methodBodyVisitor;
-        function_scope.traitsVisitor = methodBodyVisitor.visitTraits();
-        function_scope.setMethodInfo(mi);
-        
-
-        InstructionList functionBody;
-        if (setterExpression instanceof InstructionListNode)
-            functionBody = ((InstructionListNode)setterExpression).getInstructions();
-        else
-            functionBody = generateInstructions(setterExpression, CmcEmitter.__mxml_data_binding_setter_expression_NT, function_scope, null);
-        
-        functionBody.addInstruction(OP_returnvoid);
-        
-        methodBodyVisitor.visitInstructionList(functionBody);
-        methodBodyVisitor.visitEnd();
-        methodVisitor.visitEnd();
-        */
-    }
-    
-    /**
-     * Helper method used by databinding codegen to emit an anonymous function
-     * based on a list of {@link IExpressionNode}'s. This method emits a
-     * function that contains code that evaluates each expression in the list
-     * and adds the expressions together with {@link ABCConstants#OP_add}.
-     * 
-     * @param mi - the MethodInfo describing the signature
-     * @param nodes - a {@link List} of {@link IExpressionNode}'s to be
-     * codegen'd.
-     * @param enclosing_scope {@link LexicalScope} for the class initializer
-     * that encloses the function being generated.
-     */
-     public void generateMXMLDataBindingGetterFunction (MethodInfo mi, List<IExpressionNode> nodes,
-                                                        LexicalScope enclosing_scope)
-     {
-     	System.out.println("unhandled call to generateMXMLDataBindingSetterFunction");
-    	 /* AJH commented out for now
-         IMethodVisitor methodVisitor = enclosing_scope.getEmitter().visitMethod(mi);
-         methodVisitor.visit();
-         MethodBodyInfo methodBodyInfo = new MethodBodyInfo();
-         methodBodyInfo.setMethodInfo(mi);
-         IMethodBodyVisitor methodBodyVisitor = methodVisitor.visitBody(methodBodyInfo);
-         methodBodyVisitor.visit();
-         
-         //  Set up a lexical scope for this function.
-         LexicalScope function_scope = enclosing_scope.pushFrame();
-         
-         function_scope.methodBodyVisitor = methodBodyVisitor;
-         function_scope.traitsVisitor = methodBodyVisitor.visitTraits();
-         function_scope.setMethodInfo(mi);
-
-         InstructionList functionBody = null;
-         // for a list of nodes, generate all their instructions and add the results together.
-         // typically we are doing this to concatenate strings
-         for (IExpressionNode expressionNode : nodes)
-         {
-             InstructionList instructionsForExpression = generateInstructions(expressionNode, CmcEmitter.__expression_NT, function_scope, null);
-             if (functionBody == null)
-             {
-                 // First one in the list makes a new IL and puts
-                 // instructions into it
-                 functionBody = instructionsForExpression;
-             }
-             else
-             {
-                 // successive children generate into the same IL, then add the results
-                 functionBody.addAll(instructionsForExpression);
-                 functionBody.addInstruction(OP_add);
-             }
-         }
-         
-         functionBody.addInstruction(OP_returnvalue);
-         
-         methodBodyVisitor.visitInstructionList(functionBody);
-         function_scope.traitsVisitor.visitEnd();
-         methodBodyVisitor.visitEnd();
-         methodVisitor.visitEnd();
-         */
-    }
-
-     /**
-     * Creates a MethodInfo specifying the signature of a method declared by a
-     * FunctionNode.
-     * 
-     * @param func - A FunctionNode representing a method declaration.
-     * @return The MethodInfo specifying the signature of the method.
-     */
-    public static MethodInfo createMethodInfo(JSGeneratingReducer burm, JSEmitter emitter, LexicalScope scope, FunctionNode func)
-    {
-        MethodInfo mi = new MethodInfo();
-        //  FIXME: FunctionNode.getQualifiedName() has
-        //  preconditions that need to be understood!
-        mi.setMethodName(func.getName());
-
-        FunctionDefinition funcDef = func.getDefinition();
-        //  Marshal the function's arguments.
-        ParameterDefinition[] args = funcDef.getParameters();
-        List<String> param_names = new ArrayList<String>();
-
-        ICompilerProject project = scope.getProject();
-        if (args.length > 0)
-        {
-            Vector<Name> method_args = new Vector<Name>();
-            for (ParameterDefinition arg : args)
-            {
-                TypeDefinitionBase arg_type = arg.resolveType(project);
-                Name type_name = arg_type != null ? arg_type.getMName(project) : null;
-
-                if (arg.isRest())
-                {
-                    mi.setFlags((byte)(mi.getFlags() | ABCConstants.NEED_REST));
-                    param_names.add(arg.getBaseName());
-                }
-                else
-                {
-                    method_args.add(type_name);
-                    param_names.add(arg.getBaseName());
-                }
-            }
-            mi.setParamTypes(method_args);
-            mi.setParamNames(param_names);
-        }
-
-        // check for native modifier
-        if (func.getDefinition().isNative())
-        {
-            mi.setFlags((byte)(mi.getFlags() | ABCConstants.NATIVE));
-        }
-
-        // The return type will be set by the BURM.
-
-        // Falcon's IMethodVisitor only records a fraction of the FunctionDefinition.
-        // For that reason we are registering every MethodInfo with its corresponding FunctionDefinition at the JSEmitter.
-        emitter.visitFunctionDefinition(mi, funcDef);
-
-        return mi;
-    }
-
-    // called by JSInterfaceDirectiveProcessor
-    public MethodInfo createMethodInfo(LexicalScope scope, FunctionNode func)
-    {
-        return JSGenerator.createMethodInfo(m_burm, m_emitter, scope, func);
-    }
-    
-    /**
-     **
-     * Creates a MethodInfo specifying the signature of a method
-     * declared by a FunctionNode, and adds in the information for any
-     * default argument values.
-     * 
-     * @param func - A FunctionNode representing a method declaration.
-     * @return The MethodInfo specifying the signature of the method.
-     * 
-     * Will generate a compiler problem is the default value is bad
-     */
-    @Override
-    public MethodInfo createMethodInfoWithDefaultArgumentValues (LexicalScope scope, FunctionNode func)
-    {   
-        return JSGenerator.createMethodInfo(m_burm, m_emitter, scope, func);
-    }
-
-    /**
-     * Helper method to expose the constant folding code to clients outside of
-     * the burm, such as
-     * org.apache.flex.compiler.internal.as.definitions.ConstantDefinition.
-     * 
-     * @param subtree the tree to generate a constant value for
-     * @param project the project to use to evaluate the tree
-     * @return the constant value for the subtree, or null if a constant value
-     * can't be determined
-     */
-    public IConstantValue generateConstantValue(IASNode subtree, ICompilerProject project)
-    {
-        Object result = null;
-
-        LexicalScope scope = new GlobalLexicalScope(project, null, GlobalLexicalScope.EMPTY_NAME_PREFIX, m_emitter);
-
-        if (subtree != null)
-        {
-            try
-            {
-                result = reduceSubtree(subtree, scope, CmcJSEmitter.__constant_value_NT);
-            }
-            catch (Exception cant_reduce)
-            {
-                // Can't generate a constant value, just return null
-            }
-        }
-
-        return new ConstantValue(result, null);
-    }
-
-    /**
-     * Reduce an AST to its equivalent ABC structures.
-     * 
-     * @param subtree - the root of the AST subtree. May be null, in which case
-     * this routine returns null.
-     * @param scope - the active LexicalScope.
-     * @param goal - the BURM's goal state. One of the CmcEmitter.__foo_NT
-     * constants.
-     * @return the result of reducing the subtree to the desired goal state, or
-     * null if the input subtree was null.
-     * @throws Exception from the BURM if the computation didn't succeed or was
-     * interrupted.
-     */
-    public Object reduceSubtree(IASNode subtree, LexicalScope scope, int goal)
-            throws Exception
-    {
-        CmcJSEmitter burm = m_cmcJSEmitter;
-        burm.reducer = this.m_burm;
-        burm.reducer.setCurrentscope(scope);
-
-        burm.burm(subtree, CmcEmitter.__constant_value_NT);
-        return burm.getResult();
-    }
-
-    /**
-     * Handle an error from a BURM: emit diagnostics and bump the error count.
-     * 
-     * @param n - the subtree that was to be reduced.
-     * @param ex - the exception.
-     */
-    @SuppressWarnings("nls")
-    private static void handleBurmError(CmcJSEmitter burm, IASNode n, Exception ex, LexicalScope scope)
-    {
-        if (ex instanceof CodegenInterruptedException)
-        {
-            // If the exception is an InterruptedException, do nothing, as not
-            // a real error.  The incremental flow kicked in and interrupted
-            // the current work, so just throw away the current work and carry
-            // on our merry way.
-            // No problem should be reported in this case.
-            scope.getProblems().clear();
-            return;
-        }
-        else if (!(ex instanceof BURMAbortException))
-        {
-            scope.addProblem(new CodegenInternalProblem(n, ex));
-        }
-
-        java.io.PrintWriter dumper;
-
-        String dump_dir = System.getenv("JBURG_DUMP_DIR");
-        if (dump_dir != null)
-        {
-            try
-            {
-                String dump_file = dump_dir + "/failedBurm-" + Integer.toString(dumpCount++) + ".xml";
-                dumper = new java.io.PrintWriter(new java.io.FileWriter(dump_file));
-                dumper.println("<?xml version=\"1.0\"?>");
-                dumper.println("<BurmDump date=\"" + new Date().toString() + "\">");
-                burm.dump(dumper);
-                dumper.println("<AST>");
-                dumper.println(new NodesToXMLStringFormatter(n).toString());
-                dumper.println("</AST>");
-                dumper.println("</BurmDump>");
-                dumper.flush();
-                dumper.close();
-            }
-            catch (Exception e)
-            {
-                JSSharedData.instance.stderr("Unable to dump due to: " + e.toString());
-                try
-                {
-                    JSSharedData.instance.stderr(new NodesToXMLStringFormatter(n).toString());
-                }
-                catch (Exception cantformat)
-                {
-                    //  Probably an error in the AST itself, diagnosed above.
-                }
-            }
-        }
-    }
-
-    /**
-     * Number of diagnostic dumps emitted by this compiler; used to generate
-     * unique dump file names.
-     */
-    static int dumpCount = 0;
-
-    public String toString()
-    {
-        return "JSGenerator: " + m_compilationUnit.toString();
-    }
-
-    public void setBuildPhase(ICompilationUnit.Operation op)
-    {
-        m_buildPhase = op;
-        m_burm.setBuildPhase(op);
-    }
-
-    public JSGeneratingReducer getReducer()
-    {
-        return m_burm;
-    }
-
-
-    /**
-     * Get an ICodeGeneratorFactory that will always return the same ABCGenerator instance
-     */
-    public static ICodeGeneratorFactory getABCGeneratorFactory()
-    {
-        return new ICodeGeneratorFactory()
-        {
-            public ICodeGenerator get ()
-            {
-                return new JSGenerator();
-            }
-        };
-    }
-    
-    /**
-     * Represents the result of {@link #generateConstantValue}(}.
-     * <p>
-     * In addition to producing the constant value itself,
-     * the constant reduction process can also produce compiler problems.
-     */
-    public static final class ConstantValue implements IConstantValue
-    {
-        public ConstantValue(Object value, Collection<ICompilerProblem> problems)
-        {
-            this.value = value;
-            this.problems = problems;
-        }
-        
-        private final Object value;
-        private final Collection<ICompilerProblem> problems;
-        
-        @Override
-        public Object getValue()
-        {
-            return value;
-        }
-
-        @Override
-        public Collection<ICompilerProblem> getProblems()
-        {
-            return problems;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGlobalDirectiveProcessor.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGlobalDirectiveProcessor.java b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGlobalDirectiveProcessor.java
deleted file mode 100644
index f15d7d5..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGlobalDirectiveProcessor.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- *
- *  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.internal.as.codegen;
-
-import org.apache.flex.abc.ABCConstants;
-import org.apache.flex.abc.instructionlist.InstructionList;
-import org.apache.flex.abc.semantics.MethodInfo;
-import org.apache.flex.abc.semantics.Name;
-import org.apache.flex.abc.visitors.IABCVisitor;
-import org.apache.flex.abc.visitors.IClassVisitor;
-import org.apache.flex.abc.visitors.ITraitVisitor;
-import org.apache.flex.abc.visitors.ITraitsVisitor;
-import org.apache.flex.compiler.common.DependencyType;
-import org.apache.flex.compiler.definitions.IDefinition;
-import org.apache.flex.compiler.internal.definitions.ClassDefinition;
-import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
-import org.apache.flex.compiler.internal.scopes.ASScope;
-import org.apache.flex.compiler.internal.tree.as.ClassNode;
-import org.apache.flex.compiler.internal.tree.as.FunctionNode;
-import org.apache.flex.compiler.internal.tree.as.ImportNode;
-import org.apache.flex.compiler.internal.tree.as.InterfaceNode;
-import org.apache.flex.compiler.internal.tree.as.PackageNode;
-import org.apache.flex.compiler.internal.tree.as.VariableNode;
-import org.apache.flex.compiler.problems.DuplicateFunctionDefinitionProblem;
-import org.apache.flex.compiler.problems.ICompilerProblem;
-import org.apache.flex.compiler.scopes.IASScope;
-import org.apache.flex.compiler.tree.ASTNodeID;
-import org.apache.flex.compiler.tree.as.IASNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
-
-/**
- * A GlobalDirectiveProcessor translates directives at global scope into ABC.
- * JSGlobalDirectiveProcessor is derived from GlobalDirectiveProcessor and adds
- * workarounds necessary for FalconJS. Ideally FalconJS should use
- * GlobalDirectiveProcessor and retire JSGlobalDirectiveProcessor. This
- * implementation is part of FalconJS. For more details on FalconJS see
- * org.apache.flex.compiler.JSDriver
- */
-public class JSGlobalDirectiveProcessor extends GlobalDirectiveProcessor
-{
-    JSGenerator m_generator;
-
-    private String m_packageName = null;
-
-    /**
-     * @param current_scope - the scope to use. It may be created a priori by
-     * the caller, so it's not created by nesting an enclosing scope.
-     * @param emitter - the ABC emitter.
-     */
-    public JSGlobalDirectiveProcessor(JSGenerator generator, LexicalScope current_scope, IABCVisitor emitter)
-    {
-        super(current_scope, emitter);
-        m_generator = generator;
-    }
-
-    @Override
-    void declareFunction(FunctionNode f)
-    {
-        //  No modifiers allowed at global scope.
-        // super.verifyModifiers(f);
-
-        // MISSING in GlobalDirectiveProcessor
-        MethodInfo mi = m_generator.generateFunction(f, currentScope, null);
-        if (mi != null)
-        {
-            FunctionDefinition funcDef = f.getDefinition();
-            JSSharedData.instance.registerDefinition(funcDef);
-
-            // TODO: generalize excluding functions using metadata annotations.
-            final String packageName = funcDef.getPackageName();
-            if (!packageName.equals("com.jquery"))
-            {
-                final IClassVisitor cv = ((JSEmitter)emitter).visitPackage(m_packageName);
-                cv.visit();
-                this.currentScope.traitsVisitor = cv.visitClassTraits();
-                cv.visitEnd();
-                /*
-                 * InstanceInfo iinfo = new InstanceInfo(); iinfo.name =
-                 * JSGeneratingReducer.makeName(packageName); IClassVisitor cv =
-                 * emitter.visitClass(iinfo, new ClassInfo()); cv.visit();
-                 * cv.visitInstanceTraits(); ITraitsVisitor ctraits =
-                 * cv.visitClassTraits(); final Name funcName =
-                 * funcDef.getMName(currentScope.getProject(),
-                 * currentScope.getProblems()); final ITraitVisitor tv =
-                 * ctraits.visitMethodTrait(TRAIT_Method, funcName, 0, mi);
-                 * tv.visitAttribute(Trait.TRAIT_FINAL, Boolean.TRUE);
-                 */
-                /*
-                 * final String key = packageName; ICompilationUnit cu =
-                 * m_generator.m_compilationUnit; ICompilationUnit registeredCU
-                 * = JSSharedData.instance.getCompilationUnit(key); if( cu !=
-                 * registeredCU ) { // make the current cu dependent on the
-                 * registered cu. if( registeredCU != null ) { final
-                 * CompilerProject compilerProject =
-                 * (CompilerProject)cu.getProject();
-                 * compilerProject.addDependency(cu, registeredCU,
-                 * DependencyType.INHERITANCE); } else {
-                 * JSSharedData.instance.registerCompilationUnit(key, cu); } }
-                 */
-            }
-
-            Name funcName = funcDef.getMName(this.currentScope.getProject());
-
-            if (funcName == null)
-            {
-                //  getMName() emitted a diagnostic, 
-                //  repair and continue.
-                funcName = new Name("<invalid>");
-            }
-
-            ITraitVisitor tv = null;
-
-            int traitKind = this.processingPackage ?
-                    DirectiveProcessor.functionTraitKind(f, ABCConstants.TRAIT_Method) :
-                    DirectiveProcessor.functionTraitKind(f, ABCConstants.TRAIT_Var);
-
-            if (!this.currentScope.traitsVisitor.getTraits().containsTrait(traitKind, funcName))
-
-            {
-                this.currentScope.declareVariableName(funcName);
-
-                if (!this.processingPackage)
-                {
-                    // Functions at the global scope create a var of type '*'
-                    // TODO: this should be typed as 'Function' if strict mode is on
-                    if (f.isGetter() || f.isSetter())
-                    {
-                        tv = this.currentScope.traitsVisitor.visitMethodTrait(
-                                DirectiveProcessor.functionTraitKind(f, ABCConstants.TRAIT_Var),
-                                funcName,
-                                ITraitsVisitor.RUNTIME_DISP_ID,
-                                mi);
-                    }
-                    else
-                    {
-                        tv = this.currentScope.traitsVisitor.visitSlotTrait(
-                                DirectiveProcessor.functionTraitKind(f, ABCConstants.TRAIT_Var),
-                                funcName,
-                                ITraitsVisitor.RUNTIME_SLOT,
-                                LexicalScope.anyType,
-                                LexicalScope.noInitializer);
-
-                        /*
-                         * this.currentScope.getInitInstructions().addInstruction
-                         * (ABCConstants.OP_getglobalscope);
-                         * this.currentScope.getInitInstructions
-                         * ().addInstruction(ABCConstants.OP_newfunction, mi);
-                         * this
-                         * .currentScope.getInitInstructions().addInstruction
-                         * (ABCConstants.OP_setproperty, funcName);
-                         */
-                    }
-                }
-                else
-                {
-                    tv = this.currentScope.traitsVisitor.visitMethodTrait(DirectiveProcessor.functionTraitKind(f, ABCConstants.TRAIT_Method), funcName, 0, mi);
-                }
-
-                if (tv != null)
-                {
-                    this.currentScope.processMetadata(tv, funcDef.getAllMetaTags());
-                }
-            }
-            else
-            {
-                ICompilerProblem problem = new DuplicateFunctionDefinitionProblem(f, funcName.getBaseName());
-                this.currentScope.addProblem(problem);
-            }
-        }
-    }
-
-    /**
-     * Declare a class.
-     */
-    @Override
-    void declareClass(ClassNode c)
-    {
-        verifyClassModifiers(c);
-        verifySkinning(c.getDefinition());
-        currentScope.getMethodBodySemanticChecker().checkNamespaceOfDefinition(c, c.getDefinition(), currentScope.getProject());
-        JSClassDirectiveProcessor cp = JSSharedData.backend.createClassDirectiveProcessor(m_generator, c, this.currentScope, this.emitter);
-        cp.traverse(c.getScopedNode());
-        cp.finishClassDefinition();
-    }
-
-    /**
-     * Declare an interface.
-     */
-    @Override
-    void declareInterface(InterfaceNode interface_ast)
-    {
-        verifyInterfaceModifiers(interface_ast);
-        currentScope.getMethodBodySemanticChecker().checkNamespaceOfDefinition(interface_ast, interface_ast.getDefinition(), currentScope.getProject());
-        InterfaceDirectiveProcessor ip = JSSharedData.backend.createInterfaceDirectiveProcessor(m_generator, interface_ast, this.currentScope, this.emitter);
-        ip.traverse(interface_ast.getScopedNode());
-        ip.finishInterfaceDefinition();
-    }
-
-    /**
-     * Process a random directive, which at the global level is probably a loose
-     * instruction.
-     */
-    @Override
-    void processDirective(IASNode n)
-    {
-        // Use nodes have no effect
-        /*
-         * if(n.getNodeID() == ASTNodeID.UseID ) { if(
-         * !JSSharedData.GENERATE_EMBED_WRAPPER ) return; }
-         */
-
-        // workaround for Falcon bug.
-        // DirectiveProcessor is observing NamespaceIdentifierID instead of NamespaceID
-        if (n.getNodeID() == ASTNodeID.NamespaceID)
-        {
-            try
-            {
-                final IClassVisitor cv = ((JSEmitter)emitter).visitPackage(m_packageName);
-                cv.visit();
-                this.currentScope.traitsVisitor = cv.visitClassTraits();
-                cv.visitEnd();
-
-                m_generator.generateInstructions(n, CmcEmitter.__statement_NT, this.currentScope);
-                // assert(stmt_insns == null);
-            }
-            finally
-            {
-                // this.currentScope.traitsVisitor = null;
-            }
-            return;
-        }
-
-        //  Handle a loose statement.
-        InstructionList stmt_insns = m_generator.generateInstructions(n, CmcJSEmitter.__statement_NT, currentScope);
-        if (stmt_insns != null)
-            directiveInsns.addAll(stmt_insns);
-    }
-
-    @Override
-    void declarePackage(PackageNode p)
-    {
-        m_packageName = p.getName();
-        ((JSEmitter)emitter).visitPackage(m_packageName);
-        JSSharedData.instance.registerPackage(m_packageName);
-        super.declarePackage(p);
-    }
-
-    /**
-     * Declare a variable.
-     */
-    @Override
-    void declareVariable(VariableNode var)
-    {
-        super.declareVariable(var);
-    }
-
-    /**
-     * Translate a ImportNode AST into ABC. Subclasses should override this if
-     * they can process imports.
-     * 
-     * @param imp - the import's AST.
-     */
-    @Override
-    void processImportDirective(ImportNode imp)
-    {
-        String importName = imp.getImportName();
-        if (!importName.contains("."))
-        {
-            final IASScope scope = JSGeneratingReducer.getScopeFromNode(imp);
-            final IDefinition def = ((ASScope)scope).findProperty(currentScope.getProject(), imp.getImportName(), DependencyType.INHERITANCE);
-            if (def == null)
-            {
-                importName = null;
-            }
-            else
-            {
-                // workaround for Falcon bug.
-                // Falcon does not always recognize dependencies to package functions provided by SWCs.
-                // In this workaround we explicitly set a EXPRESSION dependency. 
-                /*
-                 * if( def != null ) { final ICompilationUnit fromCU =
-                 * m_generator.m_compilationUnit; final CompilerProject
-                 * compilerProject = (CompilerProject)currentScope.project;
-                 * final ASProjectScope projectScope =
-                 * compilerProject.getScope(); final ICompilationUnit toCU =
-                 * projectScope.getCompilationUnitForDefinition(def); if( fromCU
-                 * != toCU ) { // sharedData.verboseMessage(
-                 * "Adding dependency: " + className );
-                 * compilerProject.addDependency(fromCU, toCU,
-                 * DependencyGraph.DependencyType.EXPRESSION); } }
-                 */
-
-                // skip imports from the same package.
-                if (def.getPackageName().equals(m_packageName))
-                    importName = null;
-                else
-                    importName = JSGeneratingReducer.definitionToString(currentScope.getProject(), def);
-            }
-        }
-
-        if (importName != null)
-        {
-            JSEmitter emitter = (JSEmitter)this.currentScope.getEmitter();
-            emitter.visitImport(importName, imp.getImportKind());
-        }
-    }
-    
-    /**
-     * Declare an MXML document.
-     */
-    @Override
-    void declareMXMLDocument(IMXMLDocumentNode d)
-    {
-        verifySkinning((ClassDefinition)d.getDefinition());
-        try
-        {
-            MXMLClassDirectiveProcessor dp;
-        	dp = new JSMXMLClassDirectiveProcessor(d, this.currentScope, this.emitter);
-            dp.processMainClassDefinitionNode(d);
-            dp.finishClassDefinition();
-        }
-        catch (Error e)
-        {
-        	System.out.print(e);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSInterfaceDirectiveProcessor.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSInterfaceDirectiveProcessor.java b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSInterfaceDirectiveProcessor.java
deleted file mode 100644
index 2241017..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSInterfaceDirectiveProcessor.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- *  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.internal.as.codegen;
-
-import static org.apache.flex.abc.ABCConstants.*;
-
-import org.apache.flex.abc.semantics.MethodInfo;
-import org.apache.flex.abc.semantics.Name;
-import org.apache.flex.abc.visitors.IABCVisitor;
-import org.apache.flex.abc.visitors.IMethodVisitor;
-import org.apache.flex.compiler.definitions.INamespaceDefinition;
-import org.apache.flex.compiler.definitions.references.INamespaceReference;
-import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
-import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
-import org.apache.flex.compiler.internal.tree.as.FunctionNode;
-import org.apache.flex.compiler.internal.tree.as.InterfaceNode;
-import org.apache.flex.compiler.problems.BadAccessInterfaceMemberProblem;
-import org.apache.flex.compiler.problems.InterfaceNamespaceAttributeProblem;
-
-/**
- * The InterfaceDirectiveProcessor translates an InterfaceNode AST and children
- * into an interface declaration and definition in the ABC and the init script,
- * respectively.
- */
-public class JSInterfaceDirectiveProcessor extends InterfaceDirectiveProcessor
-{
-    private JSGenerator m_generator;
-
-    /**
-     * Create an InterfaceDirectiveProcessor and set up the basic AET
-     * structures.
-     * 
-     * @param in - the InterfaceNode.
-     * @param enclosing_scope - the lexical scope that encloses this interface
-     * declaration. Either the global scope or a package scope.
-     * @param emitter - the active ABC emitter.
-     */
-    public JSInterfaceDirectiveProcessor(JSGenerator jsGenerator, InterfaceNode in, LexicalScope enclosing_scope, IABCVisitor emitter)
-    {
-        super(in, addDefinition(enclosing_scope, in.getDefinition()), emitter);
-        m_generator = jsGenerator;
-    }
-
-    private static LexicalScope addDefinition(LexicalScope enclosing_scope, InterfaceDefinition idef)
-    {
-        JSSharedData.instance.registerDefinition(idef);
-        return enclosing_scope;
-    }
-
-    /**
-     * Declare a function.
-     */
-    @Override
-    void declareFunction(FunctionNode func)
-    {
-        verifyFunctionModifiers(func);
-
-        INamespaceReference ns_ref = func.getDefinition().getNamespaceReference();
-
-        if (ns_ref instanceof INamespaceDefinition.IInterfaceNamespaceDefinition)
-        {
-            //  Allowed, continue
-        }
-        else if (ns_ref instanceof INamespaceDefinition.ILanguageNamespaceDefinition)
-        {
-            interfaceScope.addProblem(new BadAccessInterfaceMemberProblem(func));
-        }
-        else
-        // if ( ns_ref instanceof UserDefinedNamespaceDefinition )
-        {
-            interfaceScope.addProblem(new InterfaceNamespaceAttributeProblem(func));
-        }
-
-        // workaround for Falcon bug.
-        // InterfaceDirectiveProcessor currently does not record return type and default values of optional parameters.
-        // In order to do so InterfaceDirectiveProcessor needs to do what ClassDirectiveProcessor::declareFunction
-        // is doing, which is letting the ABCGenerator kick off CmcEmitter.burm() etc.
-        // This is the stack trace for the JS backend implementation:
-        //      JSGenerator.generateInstructions() 
-        //      JSGenerator.generateMethodBody()  
-        //      JSGenerator.generateFunction()
-        //      JSClassDirectiveProcessor.declareFunction() 
-        // The workaround below achieves the same by directly calling JSGenerator.generateFunction(), which is robust 
-        // enough to handle situations where there is no IMethodBodyVisitor registered.
-
-        // MethodInfo mi = m_generator.createMethodInfo(this.interfaceScope, func);
-        MethodInfo mi = m_generator.generateFunction(func, this.interfaceScope, null);
-
-        IMethodVisitor mv = this.emitter.visitMethod(mi);
-        mv.visit();
-        mv.visitEnd();
-
-        FunctionDefinition funcDef = func.getDefinition();
-        Name funcName = funcDef.getMName(interfaceScope.getProject());
-        if (mi.getReturnType() == null && funcDef.getReturnTypeReference() != null)
-            mi.setReturnType(funcDef.getReturnTypeReference().getMName(interfaceScope.getProject(), funcDef.getContainedScope()));
-
-        itraits.visitMethodTrait(functionTraitKind(func, TRAIT_Method), funcName, 0, mi);
-    }
-
-}


[47/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/amd/IJSAMDDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/amd/IJSAMDDocEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/amd/IJSAMDDocEmitter.java
new file mode 100644
index 0000000..02eb3cb
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/amd/IJSAMDDocEmitter.java
@@ -0,0 +1,40 @@
+/*
+ *
+ *  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.codegen.js.amd;
+
+import org.apache.flex.compiler.codegen.js.IJSDocEmitter;
+
+/**
+ * The {@link IJSAMDDocEmitter} interface allows the abstraction of JavaScript
+ * document comments to be emitted per tag.
+ * <p>
+ * The purpose of the API is to clamp emitted output to JavaScript doc tags. The
+ * output can be multiline but is specific to one tag. This allows a full
+ * comment to be created without worrying about how to assemble the tags.
+ * <p>
+ * TODO (mschmalle) Might make a comment API and tag API so comments are not
+ * dependent on tag creation IE IJSDocEmitter and IJSDocTagEmitter
+ * 
+ * @author Michael Schmalle
+ */
+public interface IJSAMDDocEmitter extends IJSDocEmitter
+{
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/amd/IJSAMDEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/amd/IJSAMDEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/amd/IJSAMDEmitter.java
new file mode 100644
index 0000000..2e117e6
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/amd/IJSAMDEmitter.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.codegen.js.amd;
+
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+
+/**
+ * The {@link IJSAMDEmitter} interface allows abstraction between the base
+ * JavaScript and the AMD specific IJSAMDEmitter.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IJSAMDEmitter extends IJSEmitter
+{
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/flexjs/IJSFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/flexjs/IJSFlexJSEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/flexjs/IJSFlexJSEmitter.java
new file mode 100644
index 0000000..038c5ce
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/flexjs/IJSFlexJSEmitter.java
@@ -0,0 +1,30 @@
+/*
+ *
+ *  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.codegen.js.flexjs;
+
+import org.apache.flex.compiler.codegen.js.goog.IJSGoogEmitter;
+
+/**
+ * @author Erik de Bruin
+ */
+public interface IJSFlexJSEmitter extends IJSGoogEmitter
+{
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/goog/IJSGoogDocEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/goog/IJSGoogDocEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/goog/IJSGoogDocEmitter.java
new file mode 100644
index 0000000..7b433cd
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/goog/IJSGoogDocEmitter.java
@@ -0,0 +1,140 @@
+/*
+ *
+ *  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.codegen.js.goog;
+
+import org.apache.flex.compiler.codegen.js.IJSDocEmitter;
+import org.apache.flex.compiler.definitions.IClassDefinition;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IDefinitionNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+
+/**
+ * The {@link IJSGoogDocEmitter} interface allows the abstraction of JavaScript
+ * document comments to be emitted per tag.
+ * <p>
+ * The purpose of the API is to clamp emitted output to JavaScript doc tags. The
+ * output can be multiline but is specific to one tag. This allows a full
+ * comment to be created without worrying about how to assemble the tags.
+ * <p>
+ * The current tags were found at
+ * https://developers.google.com/closure/compiler/docs/js-for-compiler#types
+ * <p>
+ * TODO (mschmalle) Might make a comment API and tag API so comments are not
+ * dependent on tag creation IE IJSDocEmitter and IJSDocTagEmitter
+ * 
+ * @author Michael Schmalle
+ */
+public interface IJSGoogDocEmitter extends IJSDocEmitter
+{
+
+    void emitInterfaceDoc(IInterfaceNode node, ICompilerProject project);
+
+    void emitInterfaceMemberDoc(IDefinitionNode node, ICompilerProject project);
+    
+    void emitFieldDoc(IVariableNode node, IDefinition def, ICompilerProject project);
+
+    void emitMethodDoc(IFunctionNode node, ICompilerProject project);
+
+    void emitVarDoc(IVariableNode node, IDefinition def, ICompilerProject project);
+
+    /*
+     * https://developers.google.com/closure/compiler/docs/js-for-compiler#types
+     *- @const - Marks a variable as read-only. The compiler can inline @const variables
+     *
+     *- @define - Indicates a constant that can be overridden by the compiler at compile-time.
+     *
+     * @deprecated - Warns against using the marked function, method, or property should not be used.
+     * 
+     *- @enum - Specifies the type of an enum. An enum is an object whose properties constitute a 
+     *        set of related constants. The @enum tag must be followed by a type expression. 
+     *        
+     * @export - Declares an exported property. Exported properties will have an alias set up so
+     *        they can be accessed via [] syntax.
+     *         
+     *- @extends - Marks a class or interface as inheriting from another class. A class marked 
+     *           with @extends must also be marked with either @constructor or @interface. 
+     *           
+     *- @implements - Used with @constructor to indicate that a class implements an interface. 
+     *
+     *- @inheritDoc - tag implies the @override tag.  has exactly the same documentation.
+     *
+     * @interface - Marks a function as an interface.
+     * 
+     * @lends
+     * 
+     * @license|@preserve - Tells the compiler to insert the associated comment before the compiled
+     *                      code for the marked file.
+     *                      
+     * @nosideeffects - Indicates that a call to the declared function has no side effects
+     * 
+     *- @override - Indicates that a method or property of a subclass intentionally hides a method or 
+     *              property of the superclass.
+     *              
+     * @param - Used with method, function and constructor definitions to specify the types of function 
+     *          arguments. 
+     *          
+     * @private - Marks a member as private. Only code in the same file can access global variables and 
+     *            functions marked @private. Constructors marked @private can only be instantiated by code 
+     *            in the same file and by their static and instance members. 
+     *            
+     * @protected - Indicates that a member or property is protected.
+     * 
+     * @return - Specifies the return types of method and function definitions. The @return tag must be 
+     *           followed by a type expression. 
+     *           
+     * @this - Specifies the type of the object to which the keyword this refers within a function. 
+     *         The @this tag must be followed by a type expression. 
+     *         
+     * @type - Identifies the type of a variable, property, or expression. The @type tag must be 
+     *         followed by a type expression. 
+     *         
+     * @typedef - Declares an alias for a more complex type. 
+     */
+
+    void emitConst(IVariableNode node);
+
+    void emitExtends(IClassDefinition superDefinition, String packageName);
+
+    void emitImplements(ITypeDefinition definition, String packageName);
+
+    void emitOverride(IFunctionNode node);
+
+    void emitParam(IParameterNode node, String packageName);
+
+    void emitPublic(IASNode node);
+
+    void emitPrivate(IASNode node);
+
+    void emitProtected(IASNode node);
+
+    void emitReturn(IFunctionNode node, String packageName);
+
+    void emitThis(ITypeDefinition node, String packageName);
+
+    void emitType(IASNode node, String packageName);
+
+	void emitType(String type, String packageName);
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/goog/IJSGoogEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/goog/IJSGoogEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/goog/IJSGoogEmitter.java
new file mode 100644
index 0000000..5e5bd50
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/goog/IJSGoogEmitter.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.codegen.js.goog;
+
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+
+/**
+ * The {@link IJSGoogEmitter} interface allows abstraction between the base
+ * JavaScript and the 'goog' specific IJSGoogEmitter.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IJSGoogEmitter extends IJSEmitter
+{
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/vf2js/IJSVF2JSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/vf2js/IJSVF2JSEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/vf2js/IJSVF2JSEmitter.java
new file mode 100644
index 0000000..cd4cacd
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/vf2js/IJSVF2JSEmitter.java
@@ -0,0 +1,30 @@
+/*
+ *
+ *  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.codegen.js.vf2js;
+
+import org.apache.flex.compiler.codegen.js.goog.IJSGoogEmitter;
+
+/**
+ * @author Erik de Bruin
+ */
+public interface IJSVF2JSEmitter extends IJSGoogEmitter
+{
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/mxml/IMXMLEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/mxml/IMXMLEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/mxml/IMXMLEmitter.java
new file mode 100644
index 0000000..a8dc6dc
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/mxml/IMXMLEmitter.java
@@ -0,0 +1,140 @@
+/*
+ *
+ *  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.codegen.mxml;
+
+import java.io.Writer;
+
+import org.apache.flex.compiler.codegen.IEmitter;
+import org.apache.flex.compiler.tree.mxml.IMXMLArrayNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLBooleanNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLClassDefinitionNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLComponentNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDataBindingNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDeclarationsNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLEmbedNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLEventSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFactoryNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLImplementsNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLInstanceNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLIntNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLLiteralNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLMetadataNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLNumberNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLObjectNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLScriptNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStringNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLStyleSpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLUintNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLVectorNode;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+
+/**
+ * The {@link IMXMLEmitter} interface allows abstraction between the
+ * {@link IASNodeStrategy} and the current output buffer {@link Writer}.
+ * 
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public interface IMXMLEmitter extends IEmitter
+{
+
+    IBlockWalker getMXMLWalker();
+
+    String postProcess(String output);
+    
+    void setMXMLWalker(IBlockWalker mxmlBlockWalker);
+
+    //--------------------------------------------------------------------------
+
+    void emitDocumentHeader(IMXMLFileNode node);
+
+    void emitDocumentFooter(IMXMLFileNode node);
+
+    //--------------------------------------------------------------------------
+
+    void emitClass(IMXMLClassDefinitionNode node);
+
+    //--------------------------------------------------------------------------
+
+    void emitEventSpecifier(IMXMLEventSpecifierNode node);
+
+    void emitInstance(IMXMLInstanceNode node);
+
+    void emitPropertySpecifier(IMXMLPropertySpecifierNode node);
+
+    void emitScript(IMXMLScriptNode node);
+
+    void emitStyleSpecifier(IMXMLStyleSpecifierNode node);
+
+    //--------------------------------------------------------------------------
+
+    void emitArray(IMXMLArrayNode node);
+
+    void emitBoolean(IMXMLBooleanNode node);
+
+    void emitInt(IMXMLIntNode node);
+
+    void emitNumber(IMXMLNumberNode node);
+
+    void emitObject(IMXMLObjectNode node);
+
+    void emitString(IMXMLStringNode node);
+
+    void emitUint(IMXMLUintNode node);
+
+    //--------------------------------------------------------------------------
+
+    void emitLiteral(IMXMLLiteralNode node);
+
+    //--------------------------------------------------------------------------
+
+    void emitPropertySpecifiers(IMXMLPropertySpecifierNode[] nodes,
+            boolean emitAttributes);
+
+    void emitFactory(IMXMLFactoryNode node);
+
+    void emitComponent(IMXMLComponentNode node);
+
+    void emitDeclarations(IMXMLDeclarationsNode node);
+
+    //--------------------------------------------------------------------------
+
+    void emitMetadata(IMXMLMetadataNode node);
+
+    //--------------------------------------------------------------------------
+
+    void emitEmbed(IMXMLEmbedNode node);
+    
+    //--------------------------------------------------------------------------
+    
+    void emitImplements(IMXMLImplementsNode node);
+    
+    //--------------------------------------------------------------------------
+    
+    void emitVector(IMXMLVectorNode node);
+    
+    //--------------------------------------------------------------------------
+    
+    void emitDatabinding(IMXMLDataBindingNode node);
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/mxml/flexjs/IMXMLFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/mxml/flexjs/IMXMLFlexJSEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/mxml/flexjs/IMXMLFlexJSEmitter.java
new file mode 100644
index 0000000..333aa00
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/mxml/flexjs/IMXMLFlexJSEmitter.java
@@ -0,0 +1,39 @@
+/*
+ *
+ *  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.codegen.mxml.flexjs;
+
+import java.io.Writer;
+
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+
+/**
+ * The {@link IMXMLFlexJSEmitter} interface allows abstraction between the
+ * {@link IASNodeStrategy} and the current output buffer {@link Writer}.
+ * 
+ * @author Erik de Bruin
+ */
+public interface IMXMLFlexJSEmitter extends IMXMLEmitter
+{
+
+    void emitDocument(IMXMLDocumentNode node);
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/driver/IApplication.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/driver/IApplication.java b/compiler-jx/src/main/java/org/apache/flex/compiler/driver/IApplication.java
new file mode 100644
index 0000000..3654806
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/driver/IApplication.java
@@ -0,0 +1,31 @@
+/*
+ *
+ *  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.driver;
+
+/**
+ * The ActionScript model interface used when implementing build targets that
+ * create javascript applications cross compiled from actionscript.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IApplication
+{
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/driver/IBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/driver/IBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/driver/IBackend.java
new file mode 100644
index 0000000..4ec1fa7
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/driver/IBackend.java
@@ -0,0 +1,124 @@
+/*
+ *
+ *  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.driver;
+
+import java.io.File;
+import java.io.FilterWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.clients.MXMLJSC;
+import org.apache.flex.compiler.codegen.IDocEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.as.IASWriter;
+import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.config.Configuration;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.internal.codegen.as.ASFilterWriter;
+import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
+import org.apache.flex.compiler.internal.targets.JSTarget;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.targets.ITarget;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IBlockWalker;
+import org.apache.flex.compiler.visitor.as.IASBlockWalker;
+import org.apache.flex.compiler.visitor.mxml.IMXMLBlockWalker;
+
+/**
+ * The backend strategy for the {@link MXMLJSC} javascript compiler.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IBackend
+{
+
+    /**
+     * Returns the instance that is used to manage what type of
+     * {@link ICompilationUnit} is created during parsing.
+     * 
+     * @return The implemented {@link ISourceFileHandler}.
+     */
+    ISourceFileHandler getSourceFileHandlerInstance();
+
+    /**
+     * Returns the {@link File} extension used when saving compiled code.
+     */
+    String getOutputExtension();
+
+    /**
+     * Creates a {@link Configurator} for the specific compile session.
+     */
+    Configurator createConfigurator();
+
+    /**
+     * Creates a javascript target that will be used to build the compiled
+     * javascript source file.
+     * 
+     * @param project The current {@link ICompilerProject}.
+     * @param settings The target's custom settings.
+     * @param monitor The compilation monitor used during asynchronous parsing
+     *        of {@link ICompilationUnit}s.
+     * @return A new {@link JSTarget} used during compilation.
+     */
+    ITarget createTarget(IASProject project, ITargetSettings settings,
+            ITargetProgressMonitor monitor);
+
+    IDocEmitter createDocEmitter(IASEmitter emitter);
+
+    IASEmitter createEmitter(FilterWriter writer);
+
+    IMXMLEmitter createMXMLEmitter(FilterWriter writer);
+
+    ASFilterWriter createWriterBuffer(IASProject project);
+
+    IASWriter createWriter(IASProject project, List<ICompilerProblem> errors,
+            ICompilationUnit compilationUnit, boolean enableDebug);
+
+    IASWriter createMXMLWriter(IASProject project,
+            List<ICompilerProblem> errors, ICompilationUnit compilationUnit,
+            boolean enableDebug);
+
+    IASBlockWalker createWalker(IASProject project,
+            List<ICompilerProblem> errors, IASEmitter emitter);
+
+    IPublisher createPublisher(IASProject project,
+            List<ICompilerProblem> errors, Configuration config);
+
+    /**
+     * Creates an AST walker capable of traversing MXML AST and calling back to
+     * the {@link IASBlockWalker} for ActionScript source code production.
+     * <p>
+     * Use the {@link #createWalker(IASProject, List, ASFilterWriter)} method
+     * first and pass that instance into this method's <code>walker</code>
+     * parameter.
+     * 
+     * @param project The current {@link IASProject}.
+     * @param errors The current {@link ICompilerProblem} list.
+     * @param emitter The current {@link IASEmitter} that is used for it's
+     *        emitter and is available for callbacks to it's visit methods.
+     */
+    IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter mxmlEmitter,
+            IASEmitter asEmitter, IBlockWalker asBlockWalker);
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/driver/IPublisher.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/driver/IPublisher.java b/compiler-jx/src/main/java/org/apache/flex/compiler/driver/IPublisher.java
new file mode 100644
index 0000000..a2535bd
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/driver/IPublisher.java
@@ -0,0 +1,25 @@
+/*
+ *
+ *  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.driver;
+
+public interface IPublisher
+{
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/driver/js/IJSApplication.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/driver/js/IJSApplication.java b/compiler-jx/src/main/java/org/apache/flex/compiler/driver/js/IJSApplication.java
new file mode 100644
index 0000000..c61aa90
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/driver/js/IJSApplication.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.driver.js;
+
+import org.apache.flex.compiler.driver.IApplication;
+
+/**
+ * The JavaScript model interface used when implementing build targets that
+ * create javascript applications cross compiled from actionscript.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IJSApplication extends IApplication
+{
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/driver/js/IJSBackend.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/driver/js/IJSBackend.java b/compiler-jx/src/main/java/org/apache/flex/compiler/driver/js/IJSBackend.java
new file mode 100644
index 0000000..eb0f4e2
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/driver/js/IJSBackend.java
@@ -0,0 +1,29 @@
+/*
+ *
+ *  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.driver.js;
+
+import org.apache.flex.compiler.codegen.ISourceMapEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.driver.IBackend;
+
+public interface IJSBackend extends IBackend
+{
+    ISourceMapEmitter createSourceMapEmitter(IJSEmitter emitter);
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/Emitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/Emitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/Emitter.java
new file mode 100644
index 0000000..c399d73
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/Emitter.java
@@ -0,0 +1,235 @@
+/*
+ *
+ *  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.internal.codegen;
+
+import java.io.FilterWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.IEmitter;
+import org.apache.flex.compiler.codegen.IEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.visitor.as.IASBlockWalker;
+
+/**
+ * The base implementation for an ActionScript emitter.
+ * 
+ * @author Michael Schmalle
+ */
+public class Emitter implements IEmitter
+{
+    private final FilterWriter out;
+
+    private boolean bufferWrite;
+
+    protected boolean isBufferWrite()
+    {
+        return bufferWrite;
+    }
+
+    protected void setBufferWrite(boolean value)
+    {
+        bufferWrite = value;
+    }
+
+    private StringBuilder builder;
+
+    protected StringBuilder getBuilder()
+    {
+        return builder;
+    }
+
+    protected void flushBuilder()
+    {
+        setBufferWrite(false);
+        write(builder.toString());
+        builder.setLength(0);
+    }
+
+    protected List<ICompilerProblem> problems;
+
+    // (mschmalle) think about how this should be implemented, we can add our
+    // own problems to this, they don't just have to be parse problems
+    public List<ICompilerProblem> getProblems()
+    {
+        return problems;
+    }
+
+    //    private IDocEmitter docEmitter;
+    //
+    //    @Override
+    //    public IDocEmitter getDocEmitter()
+    //    {
+    //        return docEmitter;
+    //    }
+    //
+    //    @Override
+    //    public void setDocEmitter(IDocEmitter value)
+    //    {
+    //        docEmitter = value;
+    //    }
+
+    private int currentIndent = 0;
+
+    protected int getCurrentIndent()
+    {
+        return currentIndent;
+    }
+
+    private IASBlockWalker walker;
+
+    public IASBlockWalker getWalker()
+    {
+        return walker;
+    }
+
+    public void setWalker(IASBlockWalker value)
+    {
+        walker = value;
+    }
+
+    public Emitter(FilterWriter out)
+    {
+        this.out = out;
+        builder = new StringBuilder();
+        problems = new ArrayList<ICompilerProblem>();
+    }
+
+    @Override
+    public void write(IEmitterTokens value)
+    {
+        write(value.getToken());
+    }
+
+    @Override
+    public void write(String value)
+    {
+        try
+        {
+            if (!bufferWrite)
+                out.write(value);
+            else
+                builder.append(value);
+        }
+        catch (IOException e)
+        {
+            throw new RuntimeException(e);
+        }
+    }
+
+    protected String getIndent(int numIndent)
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < numIndent; i++)
+            sb.append(ASEmitterTokens.INDENT.getToken());
+        return sb.toString();
+    }
+
+    @Override
+    public void indentPush()
+    {
+        currentIndent++;
+    }
+
+    @Override
+    public void indentPop()
+    {
+        if (currentIndent > 0)
+            currentIndent--;
+    }
+
+    @Override
+    public void writeNewline()
+    {
+        write(ASEmitterTokens.NEW_LINE);
+        write(getIndent(currentIndent));
+    }
+
+    @Override
+    public void writeNewline(IEmitterTokens value)
+    {
+        writeNewline(value.getToken());
+    }
+
+    @Override
+    public void writeNewline(String value)
+    {
+        write(value);
+        writeNewline();
+    }
+
+    @Override
+    public void writeNewline(IEmitterTokens value, boolean pushIndent)
+    {
+        writeNewline(value.getToken(), pushIndent);
+    }
+
+    @Override
+    public void writeNewline(String value, boolean pushIndent)
+    {
+        if (pushIndent)
+            indentPush();
+        else
+            indentPop();
+        write(value);
+        writeNewline();
+    }
+
+    public void writeSymbol(String value)
+    {
+        write(value);
+    }
+
+    @Override
+    public void writeToken(IEmitterTokens value)
+    {
+        writeToken(value.getToken());
+    }
+
+    @Override
+    public void writeToken(String value)
+    {
+        write(value);
+        write(ASEmitterTokens.SPACE);
+    }
+
+    /**
+     * Takes the node argument and created a String representation if it using
+     * the buffer temporarily.
+     * <p>
+     * Note; This method is still beta, it need more logic if an emitter is
+     * actually using the buffer!
+     * 
+     * @param node The node walk and create a String for.
+     * @return The node's output.
+     */
+    public String stringifyNode(IASNode node)
+    {
+        setBufferWrite(true);
+        getWalker().walk(node);
+        String result = getBuilder().toString();
+        getBuilder().setLength(0);
+        setBufferWrite(false);
+        return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASAfterNodeStrategy.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASAfterNodeStrategy.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASAfterNodeStrategy.java
new file mode 100644
index 0000000..1ac85f7
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASAfterNodeStrategy.java
@@ -0,0 +1,77 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import org.apache.flex.compiler.codegen.IEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IContainerNode.ContainerType;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+
+/**
+ * A concrete implementation of the {@link IASNodeStrategy} that allows
+ * {@link IASNode} processing after the current node handler.
+ * <p>
+ * The class has access to the current {@link IJSEmitter} instance being used to
+ * output source code to the current output buffer.
+ * 
+ * @author Michael Schmalle
+ */
+public class ASAfterNodeStrategy implements IASNodeStrategy
+{
+    private final IASEmitter emitter;
+
+    public ASAfterNodeStrategy(IASEmitter emitter)
+    {
+        this.emitter = emitter;
+    }
+
+    @Override
+    public void handle(IASNode node)
+    {
+        if (node.getNodeID() == ASTNodeID.BlockID)
+        {
+            IContainerNode container = (IContainerNode) node;
+            ContainerType type = container.getContainerType();
+            if (type != ContainerType.IMPLICIT
+                    && type != ContainerType.SYNTHESIZED)
+            {
+                if (node.getChildCount() != 0)
+                {
+                    emitter.indentPop();
+                    ((IEmitter) emitter).writeNewline();
+                }
+
+                ((IEmitter) emitter).write(ASEmitterTokens.BLOCK_CLOSE);
+            }
+            else if (type == ContainerType.IMPLICIT
+                    || type == ContainerType.SYNTHESIZED)
+            {
+                if (node.getChildCount() != 0)
+                {
+                    emitter.indentPop();
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASBeforeNodeStrategy.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASBeforeNodeStrategy.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASBeforeNodeStrategy.java
new file mode 100644
index 0000000..d481573
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASBeforeNodeStrategy.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.internal.codegen.as;
+
+import org.apache.flex.compiler.codegen.IEmitter;
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IContainerNode.ContainerType;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+
+/**
+ * A concrete implementation of the {@link IASNodeStrategy} that allows
+ * {@link IASNode} processing before the current node handler.
+ * 
+ * @author Michael Schmalle
+ */
+public class ASBeforeNodeStrategy implements IASNodeStrategy
+{
+    private final IASEmitter emitter;
+
+    public ASBeforeNodeStrategy(IASEmitter emitter)
+    {
+        this.emitter = emitter;
+    }
+
+    @Override
+    public void handle(IASNode node)
+    {
+        if (node.getNodeID() == ASTNodeID.BlockID)
+        {
+            IASNode parent = node.getParent();
+            IContainerNode container = (IContainerNode) node;
+            ContainerType type = container.getContainerType();
+
+            if (parent.getNodeID() != ASTNodeID.LabledStatementID)
+            {
+                if (node.getChildCount() != 0)
+                    emitter.indentPush();
+            }
+
+            // switch cases are SYNTHESIZED
+            if (type != ContainerType.IMPLICIT
+                    && type != ContainerType.SYNTHESIZED)
+            {
+                ((IEmitter) emitter).write(ASEmitterTokens.BLOCK_OPEN);
+            }
+
+            if (parent.getNodeID() != ASTNodeID.LabledStatementID)
+            {
+                ((IEmitter) emitter).writeNewline();
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
new file mode 100644
index 0000000..aa29f4d
--- /dev/null
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/as/ASBlockWalker.java
@@ -0,0 +1,660 @@
+/*
+ *
+ *  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.internal.codegen.as;
+
+import java.util.List;
+
+import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.definitions.IPackageDefinition;
+import org.apache.flex.compiler.internal.semantics.SemanticUtils;
+import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.tree.ASTNodeID;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IBlockNode;
+import org.apache.flex.compiler.tree.as.ICatchNode;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IContainerNode;
+import org.apache.flex.compiler.tree.as.IDefaultXMLNamespaceNode;
+import org.apache.flex.compiler.tree.as.IDynamicAccessNode;
+import org.apache.flex.compiler.tree.as.IEmbedNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode.ForLoopKind;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IFunctionObjectNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.IIdentifierNode;
+import org.apache.flex.compiler.tree.as.IIfNode;
+import org.apache.flex.compiler.tree.as.IImportNode;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.apache.flex.compiler.tree.as.IIterationFlowNode;
+import org.apache.flex.compiler.tree.as.IKeywordNode;
+import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
+import org.apache.flex.compiler.tree.as.ILiteralContainerNode;
+import org.apache.flex.compiler.tree.as.ILiteralNode;
+import org.apache.flex.compiler.tree.as.ILiteralNode.LiteralType;
+import org.apache.flex.compiler.tree.as.IMemberAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.INamespaceAccessExpressionNode;
+import org.apache.flex.compiler.tree.as.INamespaceNode;
+import org.apache.flex.compiler.tree.as.INumericLiteralNode;
+import org.apache.flex.compiler.tree.as.IObjectLiteralValuePairNode;
+import org.apache.flex.compiler.tree.as.IPackageNode;
+import org.apache.flex.compiler.tree.as.IParameterNode;
+import org.apache.flex.compiler.tree.as.IReturnNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.apache.flex.compiler.tree.as.ISwitchNode;
+import org.apache.flex.compiler.tree.as.ITerminalNode;
+import org.apache.flex.compiler.tree.as.ITernaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IThrowNode;
+import org.apache.flex.compiler.tree.as.ITryNode;
+import org.apache.flex.compiler.tree.as.ITypedExpressionNode;
+import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IUseNamespaceNode;
+import org.apache.flex.compiler.tree.as.IVariableExpressionNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.tree.as.IWhileLoopNode;
+import org.apache.flex.compiler.tree.as.IWhileLoopNode.WhileLoopKind;
+import org.apache.flex.compiler.tree.as.IWithNode;
+import org.apache.flex.compiler.tree.metadata.IMetaTagNode;
+import org.apache.flex.compiler.tree.metadata.IMetaTagsNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.utils.DefinitionUtils;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+import org.apache.flex.compiler.visitor.as.IASBlockVisitor;
+import org.apache.flex.compiler.visitor.as.IASBlockWalker;
+
+/**
+ * A base implementation of the {@link IASBlockVisitor} that will walk the
+ * {@link ICompilationUnit}s AST {@link IASNode} hierarchy.
+ * 
+ * @author Michael Schmalle
+ */
+public class ASBlockWalker implements IASBlockVisitor, IASBlockWalker
+{
+    boolean isDebug;
+
+    private IASEmitter emitter;
+
+    @Override
+    public IASEmitter getEmitter()
+    {
+        return emitter;
+    }
+
+    private final List<ICompilerProblem> errors;
+
+    public List<ICompilerProblem> getErrors()
+    {
+        return errors;
+    }
+
+    //----------------------------------
+    // strategy
+    //----------------------------------
+
+    private IASNodeStrategy strategy;
+
+    public IASNodeStrategy getStrategy()
+    {
+        return strategy;
+    }
+
+    public void setStrategy(IASNodeStrategy value)
+    {
+        strategy = value;
+    }
+
+    //----------------------------------
+    // project
+    //----------------------------------
+
+    private IASProject project;
+
+    @Override
+    public IASProject getProject()
+    {
+        return project;
+    }
+
+    public ASBlockWalker(List<ICompilerProblem> errors, IASProject project,
+            IASEmitter emitter)
+    {
+        this.errors = errors;
+        this.project = project;
+        this.emitter = emitter;
+        emitter.setWalker(this);
+    }
+
+    //--------------------------------------------------------------------------
+    // File level
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void walk(IASNode node)
+    {
+        getStrategy().handle(node);
+    }
+
+    @Override
+    public void visitCompilationUnit(ICompilationUnit unit)
+    {
+        debug("visitCompilationUnit()");
+        IFileNode node = null;
+        try
+        {
+            node = (IFileNode) unit.getSyntaxTreeRequest().get().getAST();
+        }
+        catch (InterruptedException e)
+        {
+            throw new RuntimeException(e);
+        }
+
+        walk(node);
+    }
+
+    @Override
+    public void visitFile(IFileNode node)
+    {
+        debug("visitFile()");
+        
+        boolean foundPackage = false;
+        int nodeCount = node.getChildCount();
+        for (int i = 0; i < nodeCount; i++)
+        {
+	        IASNode pnode = node.getChild(i);
+	        
+	        // ToDo (erikdebruin): handle other types of root node, such as when
+	        //                     there is no wrapping Package or Class, like
+	        //                     in mx.core.Version
+	        if (pnode != null)
+            { 
+                boolean isPackage = pnode instanceof IPackageNode;
+                boolean isAllowedAfterPackage = false;
+                if(isPackage)
+                {
+                    foundPackage = true;
+                }
+                else if(foundPackage)
+                {
+                    isAllowedAfterPackage = pnode instanceof IInterfaceNode
+                        || pnode instanceof IClassNode
+                        || pnode instanceof IFunctionNode
+                        || pnode instanceof INamespaceNode
+                        || pnode instanceof IVariableNode;
+                }
+                if(isPackage || isAllowedAfterPackage)
+                {
+                    walk(pnode);
+                    
+                    if (i < nodeCount - 1)
+                    {
+                        emitter.writeNewline();
+                        emitter.writeNewline();
+                        emitter.writeNewline();
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public void visitPackage(IPackageNode node)
+    {
+        debug("visitPackage()");
+        IPackageDefinition definition = (IPackageDefinition) node
+                .getDefinition();
+        emitter.emitPackageHeader(definition);
+        emitter.emitPackageHeaderContents(definition);
+        emitter.emitPackageContents(definition);
+        emitter.emitPackageFooter(definition);
+    }
+
+    //--------------------------------------------------------------------------
+    // Type level
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void visitClass(IClassNode node)
+    {
+        debug("visitClass()");
+        emitter.emitClass(node);
+    }
+
+    @Override
+    public void visitInterface(IInterfaceNode node)
+    {
+        debug("visitInterface()");
+        emitter.emitInterface(node);
+    }
+
+    @Override
+    public void visitVariable(IVariableNode node)
+    {
+        debug("visitVariable()");
+        if (SemanticUtils.isPackageDefinition(node.getDefinition()) ||
+            SemanticUtils.isMemberDefinition(node.getDefinition()) ||
+            node.getParent() instanceof IFileNode)
+        {
+            emitter.emitField(node);
+        }
+        else
+        {
+            emitter.emitVarDeclaration(node);
+        }
+    }
+
+    @Override
+    public void visitFunction(IFunctionNode node)
+    {
+        debug("visitFunction()");
+        if (SemanticUtils.isPackageDefinition(node.getDefinition()) ||
+            DefinitionUtils.isMemberDefinition(node.getDefinition()) ||
+            node.getParent() instanceof IFileNode)
+        {
+            emitter.emitMethod(node);
+        }
+        else
+        {
+        	emitter.emitLocalNamedFunction(node);
+        }
+    }
+
+    @Override
+    public void visitParameter(IParameterNode node)
+    {
+        debug("visitParameter()");
+        emitter.emitParameter(node);
+    }
+
+    @Override
+    public void visitGetter(IGetterNode node)
+    {
+        debug("visitGetter()");
+        emitter.emitGetAccessor(node);
+    }
+
+    @Override
+    public void visitSetter(ISetterNode node)
+    {
+        debug("visitSetter()");
+        emitter.emitSetAccessor(node);
+    }
+
+    @Override
+    public void visitNamespace(INamespaceNode node)
+    {
+        debug("visitNamespace()");
+        emitter.emitNamespace(node);
+    }
+
+    @Override
+    public void visitFunctionCall(IFunctionCallNode node)
+    {
+        debug("visitFunctionCall()");
+        emitter.emitFunctionCall(node);
+    }
+
+    @Override
+    public void visitBlock(IBlockNode node)
+    {
+        debug("visitBlock()");
+        ASTNodeID pnodeId = node.getParent().getNodeID();
+        // (erikdebruin) 'goog' also needs access to the block header for
+        //               accessor function blocks
+        if (pnodeId == ASTNodeID.FunctionID || pnodeId == ASTNodeID.GetterID
+                || pnodeId == ASTNodeID.SetterID)
+        {
+            emitter.emitFunctionBlockHeader((IFunctionNode) node.getParent());
+        }
+
+        final int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            emitter.emitStatement(node.getChild(i));
+        }
+    }
+
+    @Override
+    public void visitIf(IIfNode node)
+    {
+        debug("visitIf()");
+        emitter.emitIf(node);
+    }
+
+    @Override
+    public void visitForLoop(IForLoopNode node)
+    {
+        debug("visitForLoop(" + node.getKind() + ")");
+        if (node.getKind() == ForLoopKind.FOR)
+            visitFor(node);
+        else if (node.getKind() == ForLoopKind.FOR_EACH)
+            visitForEach(node);
+    }
+
+    protected void visitForEach(IForLoopNode node)
+    {
+        debug("visitForEach()");
+        emitter.emitForEachLoop(node);
+    }
+
+    protected void visitFor(IForLoopNode node)
+    {
+        debug("visitFor()");
+        emitter.emitForLoop(node);
+    }
+
+    @Override
+    public void visitSwitch(ISwitchNode node)
+    {
+        debug("visitSwitch()");
+        emitter.emitSwitch(node);
+    }
+
+    @Override
+    public void visitWhileLoop(IWhileLoopNode node)
+    {
+        debug("visitWhileLoopNode()");
+        if (node.getKind() == WhileLoopKind.WHILE)
+        {
+            emitter.emitWhileLoop(node);
+        }
+        else if (node.getKind() == WhileLoopKind.DO)
+        {
+            emitter.emitDoLoop(node);
+        }
+    }
+
+    @Override
+    public void visitWith(IWithNode node)
+    {
+        debug("visitWith()");
+        emitter.emitWith(node);
+    }
+
+    @Override
+    public void visitThrow(IThrowNode node)
+    {
+        debug("visitThrow()");
+        emitter.emitThrow(node);
+    }
+
+    @Override
+    public void visitTry(ITryNode node)
+    {
+        debug("visitTry()");
+        emitter.emitTry(node);
+    }
+
+    @Override
+    public void visitCatch(ICatchNode node)
+    {
+        debug("visitCatch()");
+        emitter.emitCatch(node);
+    }
+
+    @Override
+    public void visitIterationFlow(IIterationFlowNode node)
+    {
+        debug("visitIterationFlow()");
+        emitter.emitIterationFlow(node);
+    }
+
+    @Override
+    public void visitIdentifier(IIdentifierNode node)
+    {
+        debug("visitIdentifier(" + node.getName() + ")");
+        emitter.emitIdentifier(node);
+    }
+
+    @Override
+    public void visitNumericLiteral(INumericLiteralNode node)
+    {
+        debug("visitNumericLiteral(" + node.getNumericValue() + ")");
+        emitter.emitNumericLiteral(node);
+    }
+
+    @Override
+    public void visitDefaultXMLNamespace(IDefaultXMLNamespaceNode node)
+    {
+        debug("visitDefaultXMLNamespace()");
+        walk(node.getKeywordNode()); // default xml namespace
+        walk(node.getExpressionNode()); // "http://ns.whatever.com"
+    }
+
+    @Override
+    public void visitKeyword(IKeywordNode node)
+    {
+        debug("visitKeyword(" + node.getNodeID().getParaphrase() + ")");
+        emitter.emitKeyword(node);
+    }
+
+    @Override
+    public void visitLiteral(ILiteralNode node)
+    {
+        debug("visitLiteral(" + node.getValue() + ")");
+        if (node.getLiteralType() == LiteralType.NUMBER
+                || node.getLiteralType() == LiteralType.BOOLEAN
+                || node.getLiteralType() == LiteralType.NULL
+                || node.getLiteralType() == LiteralType.NUMBER
+                || node.getLiteralType() == LiteralType.REGEXP
+                || node.getLiteralType() == LiteralType.STRING
+                || node.getLiteralType() == LiteralType.XML
+                || node.getLiteralType() == LiteralType.VOID)
+        {
+            emitter.emitLiteral(node);
+        }
+        else if (node.getLiteralType() == LiteralType.ARRAY
+                || node.getLiteralType() == LiteralType.OBJECT
+                || node.getLiteralType() == LiteralType.VECTOR
+                || node.getLiteralType() == LiteralType.XMLLIST)
+        {
+            emitter.emitLiteralContainer((ILiteralContainerNode) node);
+        }
+    }
+
+    @Override
+    public void visitMemberAccessExpression(IMemberAccessExpressionNode node)
+    {
+        debug("visitMemberAccessExpression()");
+        emitter.emitMemberAccessExpression(node);
+    }
+
+    @Override
+    public void visitNamespaceAccessExpression(
+            INamespaceAccessExpressionNode node)
+    {
+        debug("visitNamespaceAccessExpression()");
+        emitter.emitNamespaceAccessExpression(node);
+    }
+
+    @Override
+    public void visitDynamicAccess(IDynamicAccessNode node)
+    {
+        debug("visitDynamicAccess()");
+        emitter.emitDynamicAccess(node);
+    }
+
+    @Override
+    public void visitTypedExpression(ITypedExpressionNode node)
+    {
+        debug("visitITypedExpression()");
+        emitter.emitTypedExpression(node);
+    }
+
+    @Override
+    public void visitAsOperator(IBinaryOperatorNode node)
+    {
+        debug("visitAsOperator()");
+        emitter.emitAsOperator(node);
+    }
+
+    @Override
+    public void visitIsOperator(IBinaryOperatorNode node)
+    {
+        debug("visitIsOperator()");
+        emitter.emitIsOperator(node);
+    }
+
+    @Override
+    public void visitBinaryOperator(IBinaryOperatorNode node)
+    {
+        debug("visitBinaryOperator(" + node.getOperator().getOperatorText()
+                + ")");
+        emitter.emitBinaryOperator(node);
+    }
+
+    @Override
+    public void visitUnaryOperator(IUnaryOperatorNode node)
+    {
+        debug("visitUnaryOperator()");
+        emitter.emitUnaryOperator(node);
+    }
+
+    @Override
+    public void visitTerminal(ITerminalNode node)
+    {
+        debug("visitTerminal(" + node.getKind() + ")");
+        walk(node.getStatementContentsNode());
+    }
+
+    @Override
+    public void visitFunctionObject(IFunctionObjectNode node)
+    {
+        emitter.emitFunctionObject((IFunctionObjectNode) node);
+    }
+
+    @Override
+    public void visitVariableExpression(IVariableExpressionNode node)
+    {
+        debug("visitVariableExpression()");
+        emitter.emitVariableExpression(node);
+    }
+
+    @Override
+    public void visitExpression(IExpressionNode node)
+    {
+        debug("visitExpression()");
+        // XXX (mschmalle) anything getting past here?
+    }
+
+    @Override
+    public void visitImport(IImportNode node)
+    {
+        debug("visitImport()");
+        emitter.emitImport(node);
+    }
+
+    @Override
+    public void visitMetaTags(IMetaTagsNode node)
+    {
+        debug("visitMetaTags()");
+        IMetaTagNode[] tags = node.getAllTags();
+        for (IMetaTagNode tag : tags)
+        {
+            walk(tag);
+        }
+    }
+
+    @Override
+    public void visitMetaTag(IMetaTagNode node)
+    {
+        debug("visitMetaTag(" + node.getTagName() + ")");
+        emitter.emitMetaTag(node);
+    }
+
+    @Override
+    public void visitUseNamespace(IUseNamespaceNode node)
+    {
+        debug("visitUseNamespace(" + node.getTargetNamespace() + ")");
+        emitter.emitUseNamespace(node);
+    }
+
+    @Override
+    public void visitEmbed(IEmbedNode node)
+    {
+        debug("visitEmbed(" + node.getAttributes()[0].getValue() + ")");
+        // TODO (mschmalle) visitEmbed() 
+    }
+
+    @Override
+    public void visitContainer(IContainerNode node)
+    {
+        debug("visitContainer()");
+        emitter.emitContainer(node);
+    }
+
+    @Override
+    public void visitE4XFilter(IMemberAccessExpressionNode node)
+    {
+        debug("visitE4XFilter()");
+        emitter.emitE4XFilter(node);
+    }
+    
+    @Override
+    public void visitReturn(IReturnNode node)
+    {
+        debug("visitReturn()");
+        emitter.emitReturn(node);
+    }
+
+    @Override
+    public void visitTernaryOperator(ITernaryOperatorNode node)
+    {
+        debug("visitTernaryOperator()");
+        emitter.emitTernaryOperator(node);
+    }
+
+    @Override
+    public void visitLabeledStatement(LabeledStatementNode node)
+    {
+        debug("visitLabeledStatement()");
+        emitter.emitLabelStatement(node);
+    }
+
+    @Override
+    public void visitObjectLiteralValuePair(IObjectLiteralValuePairNode node)
+    {
+        debug("visitIObjectLiteralValuePair()");
+        emitter.emitObjectLiteralValuePair(node);
+    }
+
+    @Override
+    public void visitLanguageIdentifierNode(ILanguageIdentifierNode node)
+    {
+        emitter.emitLanguageIdentifier(node);
+    }
+
+    //--------------------------------------------------------------------------
+    // 
+    //--------------------------------------------------------------------------
+
+    protected void debug(String message)
+    {
+        if (isDebug)
+        {
+            System.out.println(message);
+        }
+    }
+}


[09/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSEmitter.java b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSEmitter.java
deleted file mode 100644
index 367a0cc..0000000
--- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSEmitter.java
+++ /dev/null
@@ -1,3448 +0,0 @@
-/*
- *
- *  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.internal.as.codegen;
-
-import static org.apache.flex.abc.ABCConstants.*;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.Vector;
-
-import org.apache.flex.abc.ABCConstants;
-import org.apache.flex.abc.visitors.IABCVisitor;
-import org.apache.flex.abc.visitors.IClassVisitor;
-import org.apache.flex.abc.visitors.IMetadataVisitor;
-import org.apache.flex.abc.visitors.IMethodBodyVisitor;
-import org.apache.flex.abc.visitors.IMethodVisitor;
-import org.apache.flex.abc.visitors.IScriptVisitor;
-import org.apache.flex.abc.visitors.ITraitVisitor;
-import org.apache.flex.abc.visitors.ITraitsVisitor;
-import org.apache.flex.abc.graph.IBasicBlock;
-import org.apache.flex.abc.semantics.ClassInfo;
-import org.apache.flex.abc.semantics.ExceptionInfo;
-import org.apache.flex.abc.semantics.InstanceInfo;
-import org.apache.flex.abc.semantics.Instruction;
-import org.apache.flex.abc.semantics.Label;
-import org.apache.flex.abc.semantics.Metadata;
-import org.apache.flex.abc.semantics.MethodBodyInfo;
-import org.apache.flex.abc.semantics.MethodInfo;
-import org.apache.flex.abc.semantics.Name;
-import org.apache.flex.abc.semantics.Namespace;
-import org.apache.flex.abc.semantics.Nsset;
-import org.apache.flex.abc.semantics.PooledValue;
-import org.apache.flex.abc.semantics.ScriptInfo;
-import org.apache.flex.abc.semantics.Trait;
-import org.apache.flex.abc.semantics.Traits;
-import org.apache.flex.abc.instructionlist.InstructionList;
-import org.apache.flex.compiler.constants.IMetaAttributeConstants;
-import org.apache.flex.compiler.definitions.IClassDefinition;
-import org.apache.flex.compiler.definitions.IDefinition;
-import org.apache.flex.compiler.definitions.INamespaceDefinition;
-import org.apache.flex.compiler.internal.definitions.AmbiguousDefinition;
-import org.apache.flex.compiler.internal.definitions.ClassDefinition;
-import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
-import org.apache.flex.compiler.internal.definitions.PackageDefinition;
-import org.apache.flex.compiler.internal.legacy.ASDefinitionFilter;
-import org.apache.flex.compiler.internal.legacy.ASDefinitionFilter.AccessValue;
-import org.apache.flex.compiler.internal.legacy.ASDefinitionFilter.ClassificationValue;
-import org.apache.flex.compiler.internal.legacy.ASDefinitionFilter.SearchScopeValue;
-import org.apache.flex.compiler.internal.legacy.ASScopeUtils;
-import org.apache.flex.compiler.internal.legacy.MemberedDefinitionUtils;
-import org.apache.flex.compiler.internal.projects.CompilerProject;
-import org.apache.flex.compiler.internal.projects.FlexJSProject;
-import org.apache.flex.compiler.projects.ICompilerProject;
-import org.apache.flex.compiler.scopes.IASScope;
-import org.apache.flex.compiler.tree.as.IImportNode.ImportKind;
-import org.apache.flex.compiler.units.ICompilationUnit;
-import org.apache.flex.abc.ABCEmitter;
-
-/**
- * JSEmitter is used in two different phases. During compilation it acts as a
- * visitor that gets called for each layer in the AST (see Emitter*IVisitor
- * classes). The second phase is triggered by JSCompilationUnit's
- * handleABCBytesRequest() and uses emitCode() for building the JavaScript code
- * (see emit* methods). This implementation is part of FalconJS. For more
- * details on FalconJS see org.apache.flex.compiler.JSDriver.
- */
-@SuppressWarnings("nls")
-public class JSEmitter implements IABCVisitor
-{
-    protected JSOutputStream w = new JSOutputStream();
-    protected Set<String> m_importNames = new TreeSet<String>();
-    protected Set<String> m_useNames = new TreeSet<String>();
-
-    protected Vector<EmitterClassVisitor> definedClasses = new Vector<EmitterClassVisitor>();
-    private Vector<MethodInfo> methodInfos = new Vector<MethodInfo>();
-    private Vector<MethodBodyInfo> methodBodies = new Vector<MethodBodyInfo>();
-    private Vector<ScriptInfo> scriptInfos = new Vector<ScriptInfo>();
-    protected final Boolean emitExterns = JSSharedData.m_useClosureLib && false; // only set emitExterns to true if you want to generate extern files, i.e. svg.js.
-
-    private JSSharedData m_sharedData;
-    private EmitterClassVisitor m_currentClassVisitor;
-    private String m_methodPrologue = "";
-    private String m_methodPostlogue = "";
-    private static String EXTERN_PREFIX = "// EXTERN ";
-    // private ICompilationUnit.Operation m_buildPhase;
-    private IABCVisitor m_visitor = null;
-    protected ICompilerProject m_project = null;
-    protected JSGenerator m_generator = null;
-    private IASScope m_currentScope = null;
-    protected Map<MethodInfo, FunctionDefinition> m_methodInfoToDefinition = new HashMap<MethodInfo, FunctionDefinition>();
-    protected Map<FunctionDefinition, MethodInfo> m_definitionToMethodInfo = new HashMap<FunctionDefinition, MethodInfo>();
-    protected String m_packageName = null;
-
-    public JSEmitter(JSSharedData sharedData,
-                     ICompilationUnit.Operation buildPhase,
-                     ICompilerProject project,
-                     JSGenerator generator)
-    {
-        this.w = new JSOutputStream();
-        m_sharedData = sharedData;
-        m_currentClassVisitor = null;
-        // m_buildPhase = buildPhase;
-        m_project = project;
-        m_generator = generator;
-    }
-
-    protected void writeString(String str)
-    {
-        w.writeString(str);
-    }
-
-    public void setVisitor(IABCVisitor visitor)
-    {
-        m_visitor = visitor;
-    }
-
-    public byte[] emit()
-            throws Exception
-    {
-        // Metadata
-        /*
-         * for (Metadata md : metadataPool.getValues()) { // name final String
-         * name = md.getName(); // items count assert md.getKeys().length ==
-         * md.getValues().length; // metadata keys for (final String key :
-         * md.getKeys()) { writeString( "// META[" + name + "]: key=" + key +
-         * "\n" ); } // metadata values for (final String value :
-         * md.getValues()) { writeString( "// META[" + name + "]: value=" +
-         * value + "\n" ); } }
-         */
-        m_currentClassVisitor = null;
-
-        // first write out the framework class
-        EmitterClassVisitor frameWorkClassVisitor = null;
-        for (EmitterClassVisitor clz : this.definedClasses)
-        {
-            InstanceInfo ii = clz.instanceInfo;
-            if (!ii.isInterface() && JSGeneratingReducer.getBasenameFromName(ii.name).equals(JSSharedData.JS_FRAMEWORK_NAME))
-            {
-                m_currentClassVisitor = clz;
-                final IDefinition def = getDefinition(ii.name);
-                final String packageName = def.getPackageName();
-                if (packageName.isEmpty())
-                {
-                    frameWorkClassVisitor = clz;
-                    emitClass(clz);
-                }
-            }
-        }
-
-        // write out all the other classes
-        for (EmitterClassVisitor clz : this.definedClasses)
-        {
-            if (clz != frameWorkClassVisitor)
-            {
-                m_currentClassVisitor = clz;
-
-                if (clz.instanceInfo.isInterface())
-                    emitInterface(clz);
-                else
-                    emitClass(clz);
-            }
-        }
-
-        // static initializers?
-        /*
-         * for (EmitterClassVisitor clz : this.definedClasses) {
-         * m_currentClassVisitor = clz;
-         * w.writeU30(getMethodId(clz.classInfo.cInit));
-         * emitTraits(clz.classTraits); }
-         */
-
-        m_currentClassVisitor = null;
-
-        // write out free floating code: package functions and package variables. 
-        for (ScriptInfo si : this.scriptInfos)
-        {
-            emitScriptInfo(si);
-        }
-
-        return w.toByteArray();
-    }
-
-    protected MethodBodyInfo findMethodBodyInfo(MethodInfo mi)
-    {
-        for (int i = 0; i < this.methodBodies.size(); i++)
-        {
-            MethodBodyInfo mbi = methodBodies.elementAt(i);
-            if (mbi.getMethodInfo() == mi)
-                return mbi;
-        }
-
-        // Don't throw, because interfaces don't have  MethodBodyInfo:
-        // throw new IllegalArgumentException("Unable to find MethodBodyInfo for " + mi);
-        return null;
-    }
-
-    protected String emitParameters(MethodInfo mi) throws Exception
-    {
-        final FunctionDefinition fdef = this.m_methodInfoToDefinition.get(mi);
-        String[] chunk = JSGeneratingReducer.emitParameters(m_project, fdef, mi);
-        // String[] chunk = JSGeneratingReducer.emitParameters(mi);
-
-        final String a_priori_insns = chunk[0];
-        final String code = chunk[1];
-
-        writeString(code);
-        return a_priori_insns;
-    }
-
-    protected void emitInstanceTraits(Traits traits, MethodInfo ctor, String packageName, String className, String superClass,
-                                        Boolean isExtern, Boolean isInterface, Boolean isPackageFunction) throws Exception
-    {
-        // private void emitTraits(Traits traits, Boolean isInstanceTraits, MethodInfo ctor, String packageName, String className, String methodPrefix, String assignmentOp, String separator, String indent ) throws Exception
-
-        if (JSSharedData.m_useClosureLib)
-        {
-            if (isExtern)
-                emitTraits(traits, true, isExtern, isInterface, isPackageFunction, ctor, packageName, className, superClass, className + ".prototype.", "=", ";", EXTERN_PREFIX);
-            else
-            {
-                final String fullName = createFullName(packageName, className);
-                emitTraits(traits, true, isExtern, isInterface, isPackageFunction, ctor, packageName, className, superClass, fullName + ".prototype.", "=", ";", "");
-            }
-        }
-        else
-            emitTraits(traits, true, isExtern, isInterface, isPackageFunction, ctor, packageName, className, superClass, "this.", "", ",", isExtern ? EXTERN_PREFIX : "    ");
-    }
-
-    protected Boolean isExtern(Name name)
-    {
-        if (name != null)
-        {
-            final IDefinition def = JSGeneratingReducer.getDefinitionForName(m_project, name);
-            if (def == null)
-            {
-                JSGeneratingReducer.getDefinitionForName(m_project, name);
-                throw new IllegalArgumentException("isExtern: can't find definition for name " + name.toString());
-            }
-
-            if (def.getMetaTagByName(JSSharedData.EXTERN_METATAG) != null)
-                return true;
-        }
-        return false;
-    }
-
-    /** packageName can be "" */
-    protected IDefinition getDefinition(Name name)
-    {
-        if (name == null)
-            return null;
-
-        final IDefinition def = JSGeneratingReducer.getDefinitionForNameByScope(m_project, m_project.getScope(), name);
-
-        if (def == null)
-        {
-            throw new IllegalArgumentException("getDefinition: can't find definition for name " + name.toString());
-        }
-
-        return def;
-    }
-
-    /** packageName can be "" */
-    private ClassDefinition getClassDefinition(String shortClassName, String packageName)
-    {
-        if (packageName.isEmpty())
-            return getClassDefinition(shortClassName);
-        else
-            return getClassDefinition(packageName + "." + shortClassName);
-    }
-
-    /** expects className to be fully-qualified if it's in a package */
-    private ClassDefinition getClassDefinition(String className)
-    {
-        IDefinition definitionContext = null;
-        ASDefinitionFilter filter = new ASDefinitionFilter(ClassificationValue.CLASSES_AND_INTERFACES, SearchScopeValue.ALL_SCOPES, AccessValue.ALL, definitionContext);
-        IDefinition def = ASScopeUtils.findDefinitionByName(m_project.getScope(), m_project, className, filter);
-        if (def instanceof ClassDefinition)
-        {
-            final ClassDefinition classDef = (ClassDefinition)def;
-            return classDef;
-        }
-        return null;
-    }
-
-    // Symbol support
-    private Boolean isSymbolClass(String className)
-    {
-        final ClassDefinition classDef = getClassDefinition(className);
-        if (classDef != null)
-        {
-            for (String implementedInterface : classDef.getImplementedInterfacesAsDisplayStrings())
-            {
-                if (implementedInterface.equals(JSSharedData.SYMBOL_INTERFACE_NAME))
-                    return true;
-            }
-        }
-        return false;
-    }
-
-    private void emitClassInfo(String packageName, String className, String superClass, Boolean isDynamic, Boolean isFinal)
-    {
-        final String fullClassNameWithoutDot = createFullName(packageName, className);
-        String fullClassName = fullClassNameWithoutDot;
-        if (!fullClassName.isEmpty())
-            fullClassName += ".";
-
-        if (superClass.isEmpty())
-            superClass = "Object";
-
-        // Namespace support
-        final IDefinition def = JSSharedData.instance.getDefinition(fullClassNameWithoutDot);
-        if (def != null)
-        {
-            def.getQualifiedName();
-        }
-    }
-
-    private void emitClassTraits(Traits traits, MethodInfo staticInitMI,
-                                String packageName, String className, String superClass,
-                                Boolean isExtern, Boolean isPackageFunction,
-                                Boolean isDynamicClass, Boolean isFinalClass,
-                                Boolean emitClassPrologue) throws Exception
-    {
-        final Boolean isInterface = false;
-        writeString("\n\n");
-
-        // TODO: generalize
-        if (isExtern || packageName.startsWith("goog"))
-            return;
-
-        if (emitClassPrologue && !className.isEmpty())
-        {
-            emitClassInfo(packageName, className, superClass, isDynamicClass, isFinalClass);
-        }
-
-        String fullClassName = createFullName(packageName, className);
-        if (!fullClassName.isEmpty())
-            fullClassName += ".";
-
-        emitTraits(traits, false, isExtern, isInterface, isPackageFunction, staticInitMI, packageName.replaceFirst(JSSharedData.ROOT_NAME, ""), className, superClass, fullClassName, "=", ";", "");
-
-        /*
-         * if( isExtern ) emitTraits( traits, false, isExtern, staticInitMI,
-         * packageName, className, superClass, fullClassName, "=", ";", "" );
-         * else emitTraits( traits, false, isExtern, staticInitMI,
-         * packageName.replaceFirst( JSSharedData.ROOT_NAME, ""), className,
-         * superClass, fullClassName, "=", ";", "" );
-         */
-    }
-
-    private String nameToString(Name name)
-    {
-        String baseName = JSGeneratingReducer.getBasenameFromName(name);
-        if (baseName == null || baseName.isEmpty())
-        {
-            String packageName = "";
-            final Nsset nsset = name.getQualifiers();
-            if (nsset != null && nsset.length() > 0)
-            {
-                packageName = nsset.iterator().next().getName();
-                if (!packageName.isEmpty())
-                    baseName = "{" + packageName + "}::" + baseName;
-            }
-        }
-        else
-        {
-            final IDefinition def = getDefinition(name);
-            if (name != null && !name.isTypeName())
-            {
-                final String packageName = def.getPackageName();
-                if (packageName != null && !packageName.isEmpty())
-                {
-                    final String fullName = "{" + packageName + "}::" + baseName;
-                    return fullName;
-                }
-            }
-        }
-        return baseName;
-
-    }
-
-    // see Namespace::getKindString
-    /*
-     * private String getKindString(Namespace ns) { switch(ns.getKind()) { case
-     * ABCConstants.CONSTANT_Namespace: return "Ns"; case
-     * ABCConstants.CONSTANT_PackageNs: return "PackageNs"; case
-     * ABCConstants.CONSTANT_PackageInternalNs: return "PackageInternalNs"; case
-     * ABCConstants.CONSTANT_ProtectedNs: return "ProtectedNs"; case
-     * ABCConstants.CONSTANT_ExplicitNamespace: return "ExplicitNs"; case
-     * ABCConstants.CONSTANT_StaticProtectedNs: return "StaticProtectedNs"; case
-     * ABCConstants.CONSTANT_PrivateNs: return "PrivateNs"; } return "UnknownNs"
-     * ; }
-     */
-
-    private String mangleName(String baseName, Namespace ns)
-    {
-        String name = baseName + "::";
-        String nsStr = ns.toString();
-
-        // workaround for Falcon bug.
-        // ns.toString() is now returning:
-        //      ProtectedNs:"tests:Test"
-        // instead of
-        //      ProtectedNs:"tests.Test"
-        if (ns.getName().contains(":") /*
-                                        * && ns.getKind() !=
-                                        * ABCConstants.CONSTANT_Namespace
-                                        */)
-        {
-            String tmp = ns.getName();
-
-            // support for "use namespace"
-            /*
-             * final INamespaceDefinition ins =
-             * JSSharedData.instance.getNamespace(tmp); if( ins != null ) { tmp
-             * = ins.getQualifiedName(); }
-             */
-            tmp = tmp.replaceAll(":", ".");
-
-            // another workaround for a Falcon bug.
-            // WRONG:       PrivateNs:"ClassPrivateNS:tests:Test"
-            // CORRECT:     PrivateNs:ClassPrivateNS:"tests:Test"
-            if (tmp.startsWith("ClassPrivateNS."))
-                tmp = tmp.replace("ClassPrivateNS.", "ClassPrivateNS:");
-            nsStr = nsStr.substring(0, nsStr.length() - ns.getName().length() - 2) + tmp;
-        }
-        nsStr = nsStr.replaceAll("\\\"", "");
-
-        Boolean colon = false;
-        for (String part : nsStr.split(":"))
-        {
-            if (colon)
-                name += ":";
-            else
-                colon = true;
-            part = part.replaceAll("\\\"", "");
-
-            if (part.equals("Ns"))
-                name += JSSharedData.CONSTANT_Namespace;
-            else if (part.equals("PackageNs"))
-                name += JSSharedData.CONSTANT_PackageNs;
-            else if (part.equals("PackageInternalNs"))
-                name += JSSharedData.CONSTANT_PackageInternalNs;
-            else if (part.equals("ProtectedNs"))
-                name += JSSharedData.CONSTANT_ProtectedNs;
-            else if (part.equals("ExplicitNs"))
-                name += JSSharedData.CONSTANT_ExplicitNamespace;
-            else if (part.equals("StaticProtectedNs"))
-                name += JSSharedData.CONSTANT_StaticProtectedNs;
-            else if (part.equals("PrivateNs"))
-                name += JSSharedData.CONSTANT_PrivateNs;
-            else if (part.equals("ClassPrivateNS"))
-                name += JSSharedData.CONSTANT_ClassPrivateNS;
-            else
-                name += part;
-        }
-
-        return name;
-    }
-
-    private void emitNamespaceInfo(EmitterClassVisitor clz,
-            String packageName, String className, String superClass) throws Exception
-    {
-        // check whether this class is tagged with [ClassInfo]
-        if (!className.isEmpty())
-        {
-            final Traits instanceTraits = clz.instanceTraits;
-            final String fullName = createFullName(packageName, className);
-            boolean comma = false;
-            String names = "";
-            for (Trait t : instanceTraits)
-            {
-                final Name name = t.getNameAttr("name");
-                final Nsset nsset = name.getQualifiers();
-                if (nsset != null && nsset.length() > 0)
-                {
-                    if (comma)
-                        names += ",\n";
-                    else
-                        comma = true;
-                    for (Namespace ns : nsset)
-                    {
-                        names += "    \"" + mangleName(name.getBaseName(), ns) + "\" : true";
-                    }
-                }
-            }
-
-            // add _NAMESPACES member to class 
-            writeString("\n");
-            writeString("/**\n");
-            writeString(" * Member: " + fullName + "._NAMESPACES\n");
-            writeString(" * @const\n");
-            writeString(" * @type {Object}\n");
-            writeString(" */\n");
-
-            if (names.isEmpty())
-                writeString(fullName + "._NAMESPACES = {};\n");
-            else
-            {
-                writeString(fullName + "._NAMESPACES = {\n");
-                writeString(names + "\n");
-                writeString("}\n");
-            }
-
-            // add _USES member to class 
-            names = "";
-            comma = false;
-            for (String uses : m_useNames)
-            {
-                final INamespaceDefinition ns = JSSharedData.instance.getNamespaceForQName(uses);
-                if (ns != null)
-                {
-                    if (comma)
-                        names += ",\n";
-                    else
-                        comma = true;
-                    names += ("    \"" + ns.getURI().replaceAll(":", ".") + "\" : \"" + uses + "\"");
-                }
-            }
-
-            if (!names.isEmpty())
-            {
-                writeString("\n");
-                writeString("/**\n");
-                writeString(" * Member: " + fullName + "._USES\n");
-                writeString(" * @const\n");
-                writeString(" * @type {Object}\n");
-                writeString(" */\n");
-
-                writeString(fullName + "._USES = {\n");
-                writeString(names + "\n");
-                writeString("}\n");
-            }
-        }
-    }
-
-    private Boolean needsClassInfo(Traits classTraits)
-    {
-        for (Trait t : classTraits)
-        {
-            final Vector<Metadata> metaData = t.getMetadata();
-            for (Metadata md : metaData)
-            {
-                if (md.getName().equals(JSSharedData.GENERATE_CLASSINFO))
-                    return true;
-            }
-        }
-        return false;
-    }
-
-    /*
-     * tests.Test._CLASSINFO = { name : "", isDynamic : true, isFinal : true,
-     * isStatic : true, bases : [], traits : { bases : {}, interfaces : {},
-     * constructor : { {type: "", optional:false}, ... }, variables : { name:
-     * "", type: "", access: "readwrite", uri: "", metadata: { name : "", value
-     * : { {key:"", value:""}, ... } } } accessors : { name: "", type: "",
-     * access: "readwrite", declaredBy: "", uri: "", metadata: { name : "",
-     * value : { {key:"", value:""}, ... } } }, methods : { name: "",
-     * returnType: "", declaredBy: "", parameters: { }, uri: "", metadata: {
-     * name : "", value : { {key:"", value:""}, ... } } }, metadata: { name :
-     * "", value : { {key:"", value:""}, ... } } } }
-     */
-    private void emitJSONInfo(EmitterClassVisitor clz,
-            String packageName, String className, String superClass) throws Exception
-    {
-        final Traits classTraits = clz.classTraits;
-        // check whether this class is tagged with [ClassInfo]
-        if (!className.isEmpty() && needsClassInfo(classTraits))
-        {
-            final Traits instanceTraits = clz.instanceTraits;
-            final String fullName = createFullName(packageName, className);
-
-            // add _CLASSINFO member to class 
-            writeString("\n");
-            writeString("/**\n");
-            writeString(" * Member: " + fullName + "._CLASSINFO\n");
-            writeString(" * @const\n");
-            writeString(" * @type {Object}\n");
-            writeString(" */\n");
-            writeString(fullName + "._CLASSINFO =\n");
-            writeString("{\n");
-
-            final String indent = "    ";
-            final String indent2 = "        ";
-            final String indent3 = "            ";
-            final String indent4 = "                ";
-            final String indent5 = "                    ";
-
-            // add name, bases, isDynamic, isFinal, isStatic
-            final InstanceInfo iinfo = clz.instanceInfo;
-            final Boolean isDynamic = !iinfo.isSealed();
-            final Boolean isFinal = iinfo.isFinal();
-            final Boolean isStatic = true;
-            if (packageName.isEmpty())
-                writeString(indent + "name : \"" + className + "\",\n");
-            else
-                writeString(indent + "name : \"{" + packageName + "}::" + className + "\",\n");
-            writeString(indent + "bases : [\"Class\"],\n");
-            writeString(indent + "isDynamic : " + (isDynamic ? "true" : "false") + ",\n");
-            writeString(indent + "isFinal : " + (isFinal ? "true" : "false") + ",\n");
-            writeString(indent + "isStatic : " + (isStatic ? "true" : "false") + ",\n");
-
-            // traits
-            writeString(indent + "traits:\n");
-            writeString(indent + "{\n");
-
-            // add traits.bases 
-            writeString(indent2 + "bases:\n");
-            writeString(indent2 + "{\n");
-
-            ClassDefinition classDef = getClassDefinition(className, packageName);
-
-            IClassDefinition superclassDef = classDef.resolveBaseClass(m_project);
-            while (superclassDef != null)
-            {
-                final String superPackageName = superclassDef.getPackageName();
-                if (superPackageName.isEmpty())
-                    writeString(indent3 + superclassDef.getBaseName() + ": \"" + superclassDef.getBaseName() + "\",\n");
-                else
-                    writeString(indent3 + superclassDef.getBaseName() + ": \"{" + superPackageName + "}::" + superclassDef.getBaseName() + "\",\n");
-
-                superclassDef = superclassDef.resolveBaseClass(m_project);
-            }
-            writeString(indent2 + "},\n");
-
-            // add traits.interfaces
-            writeString(indent2 + "interfaces:\n");
-            writeString(indent2 + "{\n");
-            for (Name iname : iinfo.interfaceNames)
-            {
-                writeString(indent3 + "\"" + nameToString(iname) + "\",\n");
-            }
-            writeString(indent2 + "},\n");
-
-            // add traits.constructor 
-            writeString(indent2 + "constructor:\n");
-            writeString(indent2 + "{\n");
-            final MethodInfo ctor = clz.instanceInfo.iInit;
-            writeString(getParameterInfo(ctor, indent3));
-            writeString(indent2 + "},\n");
-
-            // add variables, accessors, methods
-            List<String> variables = new ArrayList<String>();
-            List<String> methods = new ArrayList<String>();
-            Map<String, String> getters = new HashMap<String, String>();
-            Map<String, String> setters = new HashMap<String, String>();
-
-            for (Trait t : instanceTraits)
-            {
-                String str = new String();
-                final Name name = t.getNameAttr("name");
-                String propName = JSGeneratingReducer.getBasenameFromName(name);
-                String propType = "";
-                switch (t.getKind())
-                {
-                    // traits.variables
-                    case TRAIT_Var:
-                    case TRAIT_Const:
-                    {
-                        final Boolean isConst = t.getKind() == TRAIT_Const;
-                        final Name type = t.getNameAttr(Trait.TRAIT_TYPE);
-                        if (type == null)
-                            propType = "Object";
-                        else
-                            propType = nameToString(type);// JSGeneratingReducer.getBasenameFromName(type);
-                        str += indent3 + propName + ":\n";
-                        str += indent3 + "{\n";
-                        str += indent4 + "name : " + "\"" + propName + "\",\n";
-                        str += indent4 + "type : " + "\"" + propType + "\",\n";
-                        str += indent4 + "access : " + "\"" + (isConst ? "readonly" : "readwrite") + "\",\n";
-                        // str += indent4 + "uri : " + "\"" + ??? + "\"\n";
-                        // str += getMetaDataInfo( findMetadata(classTraits, propName, t.getKind()), indent4 );
-                        str += getMetaDataInfo(t.getMetadata(), indent4);
-                        str += indent3 + "}";
-                        variables.add(str);
-                        break;
-                    }
-                        // traits.accessors
-                    case TRAIT_Getter:
-                    case TRAIT_Setter:
-                    {
-                        final String declaredBy = "(unknown)"; // TODO
-                        final String access = t.getKind() == TRAIT_Getter ? "readonly" : "readwrite";
-                        str += indent3 + propName + ":\n";
-                        str += indent3 + "{\n";
-                        str += indent4 + "name : " + "\"" + propName + "\",\n";
-                        str += indent4 + "type : " + "\"" + propType + "\",\n";
-                        str += indent4 + "access : " + "\"" + access + "\",\n";
-                        str += indent4 + "declaredBy : " + "\"" + declaredBy + "\",\n";
-                        // str += indent4 + "uri : " + "\"" + ??? + "\"\n";
-                        // str += getMetaDataInfo( findMetadata(classTraits, propName, t.getKind()), indent4 );
-                        str += getMetaDataInfo(t.getMetadata(), indent4);
-                        str += indent3 + "}";
-
-                        if (t.getKind() == TRAIT_Getter)
-                            getters.put(propName, str);
-                        else
-                            setters.put(propName, str);
-                        break;
-                    }
-                        // traits.methods
-                    case TRAIT_Method:
-                    case TRAIT_Function:
-                    {
-                        final String declaredBy = "(unknown)"; // TODO
-                        final MethodInfo mi = (MethodInfo)t.getAttr("method_id");
-                        str += indent3 + propName + ":\n";
-                        str += indent3 + "{\n";
-                        str += indent4 + "name : " + "\"" + propName + "\",\n";
-                        str += indent4 + "returnType : " + "\"" + nameToString(mi.getReturnType()) + "\",\n";
-                        str += indent4 + "declaredBy : " + "\"" + declaredBy + "\",\n";
-                        // str += indent4 + "uri : " + "\"" + ??? + "\"\n";
-                        str += indent4 + "parameters:\n";
-                        str += indent4 + "{\n";
-                        str += getParameterInfo(mi, indent5);
-                        str += indent4 + "},\n";
-                        // str += getMetaDataInfo( findMetadata(classTraits, propName, t.getKind()), indent4 );
-                        str += getMetaDataInfo(t.getMetadata(), indent4);
-                        str += indent3 + "}";
-                        methods.add(str);
-
-                        break;
-                    }
-                }
-            }
-
-            // add variables
-            writeString(indent2 + "variables:\n");
-            writeString(indent2 + "{\n");
-            for (String var : variables)
-            {
-                writeString(var + ",\n");
-            }
-            writeString(indent2 + "},\n");
-
-            // add accessors
-            writeString(indent2 + "accessors:\n");
-            writeString(indent2 + "{\n");
-            for (Map.Entry<String, String> entry : getters.entrySet())
-            {
-                final String s = setters.get(entry.getKey());
-                if (s != null)
-                    writeString(s + ",\n");
-                else
-                    writeString(entry.getValue() + ",\n");
-            }
-            writeString(indent2 + "},\n");
-
-            // add methods
-            writeString(indent2 + "methods:\n");
-            writeString(indent2 + "{\n");
-            for (String met : methods)
-            {
-                writeString(met + ",\n");
-            }
-            writeString("\n");
-            writeString(indent2 + "},\n");
-
-            // closing traits
-            writeString(indent + "},\n");
-
-            // add class metadata
-            for (Trait t : classTraits)
-            {
-                if (t.getKind() == TRAIT_Class)
-                    writeString(getMetaDataInfo(t.getMetadata(), indent));
-            }
-
-            writeString("}\n");
-        }
-    }
-
-    /*
-     * private Vector<Metadata> findMetadata( Traits classTraits, String name,
-     * int traitKind ) { for( Trait t : classTraits ) { if( t.getKind() ==
-     * traitKind ) { final Name n = t.getNameAttr("name"); if(
-     * JSGeneratingReducer.getBasenameFromName(n).equals(name) ) return
-     * t.getMetadata(); } } return new Vector<Metadata>(); }
-     */
-
-    private String getMetaDataInfo(Vector<Metadata> metaData, String indent)
-    {
-        String s = "";
-        if (!metaData.isEmpty())
-        {
-            s += indent + "metadata:\n";
-            s += indent + "{\n";
-            for (Metadata md : metaData)
-            {
-                s += indent + "    " + md.getName() + ":\n";
-                s += indent + "    {\n";
-                s += indent + "        " + "name : \"" + md.getName() + "\",\n";
-                final String[] keys = md.getKeys();
-                if (keys.length > 0)
-                {
-                    final String[] values = md.getValues();
-
-                    s += indent + "        " + "value:\n";
-                    s += indent + "        " + "{\n";
-                    for (int i = 0; i < keys.length; ++i)
-                    {
-                        s += indent + "            " + keys[i] + ": {key: \"" + keys[i] + "\", value: \"" + values[i] + "\"},\n";
-                    }
-                    s += indent + "        " + "}\n";
-                }
-                s += indent + "    },\n";
-            }
-            s += indent + "}\n";
-        }
-        return s;
-    }
-
-    private String getParameterInfo(MethodInfo mi, String indent)
-    {
-        String s = "";
-        if (mi != null)
-        {
-            Vector<PooledValue> defaultValues = mi.getDefaultValues();
-            Vector<Name> paramTypes = mi.getParamTypes();
-            final int defaultsStartAt = paramTypes.size() - defaultValues.size();
-            int current = 0;
-            for (Name type : paramTypes)
-            {
-                final String optional = current >= defaultsStartAt ? "true" : "false";
-                s += indent + "p" + current + ": {type: \"" + nameToString(type) + "\", optional: " + optional + "},\n";
-                current++;
-            }
-        }
-        return s;
-    }
-
-    /*
-     * private void emitPackageNames() { writeString( "// Packages \n" ); // get
-     * all package names from the shared data object Set<String> packages =
-     * JSSharedData.instance.getPackages(); // "expand" the package names, i.e.
-     * "com.adobe" expands to "com", "com.adobe". Set<String> expanded = new
-     * TreeSet<String>(); for (String packageName : packages) { String path =
-     * ""; String[] parts = packageName.split("\\."); for( String part: parts )
-     * { if( path.length() == 0 ) path += part; else path += "." + part; if(
-     * path.length() > 0 ) expanded.add( path ); } } // create an entry for each
-     * expanded package name Iterator<String> it = expanded.iterator(); if(
-     * it.hasNext() ) { while (it.hasNext()) { writeString(
-     * JSSharedData.ROOT_NAME + it.next().toString() + " = {};\n" ); } }
-     * writeString( "\n" ); }
-     */
-
-    private String createFullName(String packageName, String className)
-    {
-        String fullName = "";
-
-        // root name
-        if (!JSSharedData.ROOT_NAME.isEmpty() && !className.startsWith(JSSharedData.ROOT_NAME))
-            fullName += JSSharedData.ROOT_NAME;
-
-        // package name
-        if (!packageName.isEmpty())
-        {
-            if (!fullName.isEmpty())
-                fullName += ".";
-            fullName += packageName;
-        }
-
-        // class name
-        if (!className.isEmpty())
-        {
-            if (!fullName.isEmpty())
-                fullName += ".";
-            fullName += className;
-        }
-
-        return fullName;
-    }
-
-    /*
-     * private int typeNameToAbcConstant( Name typeName ) { if( typeName != null
-     * ) { final String type =
-     * JSGeneratingReducer.getBasenameFromName(typeName); if( type.equals("int")
-     * ) return ABCConstants.CONSTANT_Int; if( type.equals("uint") ) return
-     * ABCConstants.CONSTANT_UInt; if( type.equals("Number") ) return
-     * ABCConstants.CONSTANT_Double; if( type.equals("String") ) return
-     * ABCConstants.CONSTANT_Utf8; if( type.equals("Boolean") ) return
-     * ABCConstants.CONSTANT_False; if( type.equals("null") ) return
-     * ABCConstants.CONSTANT_Null; } return ABCConstants.CONSTANT_Undefined; }
-     */
-    private Boolean isDataClassDefinition(IDefinition def)
-    {
-        if (def != null && def instanceof IClassDefinition)
-        {
-            IClassDefinition classDef = (IClassDefinition)def;
-            Iterator<IClassDefinition> superClassIterator = classDef.classIterator(m_project, true);
-
-            while (superClassIterator.hasNext())
-            {
-                final IClassDefinition superClass = superClassIterator.next();
-                if (superClass.getMetaTagByName("DataClass") != null)
-                    return true;
-            }
-        }
-        return false;
-    }
-
-    protected void emitCtor(MethodInfo ctor, Boolean isExtern, Boolean isInterface, String packageName, String className, String superClassName,
-            String methodPrefix, String assignmentOp, String separator, String indent) throws Exception
-    {
-        final Boolean isFramework = className.equals(JSSharedData.JS_FRAMEWORK_NAME);
-
-        // first check whether there is any code...
-        final String body = getCodeForConstructor(ctor);
-        final String fullName = createFullName(packageName, className);
-
-        if (!body.isEmpty() || JSSharedData.instance.hasClassInit(fullName))
-        {
-            // writeString("\n" + indent + "// Constructor\n");
-
-            m_methodPrologue = "";
-
-            final Boolean isPackageFunction = false;
-            if (JSSharedData.m_useClosureLib)
-            {
-                final String pkg = packageName.isEmpty() ? "" : (createFullName(packageName, "") + ".");
-                emitMethod(null, ctor, isFramework, isExtern, isInterface, isPackageFunction, fullName, className, "", pkg, assignmentOp, separator, indent);
-            }
-            else
-            {
-                MethodBodyInfo mbi = findMethodBodyInfo(ctor);
-                emitMethodBody(mbi);
-            }
-        }
-        else
-        {
-            if (JSSharedData.m_useClosureLib)
-                writeString(fullName + " = function(){}\n");
-        }
-
-        // inherits
-        if (JSSharedData.m_useClosureLib && (!JSGeneratingReducer.isDataType(superClassName) || superClassName.equals("Error")))
-        {
-            writeString("goog.inherits("
-                            + fullName + ", "
-                            + superClassName + ");\n");
-        }
-
-        // don't add _CLASS to DataClass instances.
-        final IDefinition def = JSSharedData.instance.getDefinition(fullName);
-        if (JSSharedData.m_useClosureLib && (def == null || !isDataClassDefinition(def)))
-        {
-            // add _CLASS member to instance 
-            writeString("\n");
-            writeString("/**\n");
-            writeString(" * Member: " + fullName + ".prototype._CLASS\n");
-            writeString(" * @const\n");
-            writeString(" * @type {" + fullName + "}\n");
-            writeString(" */\n");
-            writeString(fullName + ".prototype._CLASS = " + fullName + ";\n");
-        }
-    }
-
-    protected String emitSlotValue(Trait t)
-    {
-        Object trait_value = t.getAttr(Trait.SLOT_VALUE);
-        if (trait_value != null)
-        {
-            //  See also poolTraitValues(Traits), which
-            //  puts these values into the pools.
-            if (trait_value instanceof String)
-            {
-                return ((String)trait_value);
-            }
-            else if (trait_value instanceof Namespace)
-            {
-                return (((Namespace)trait_value).getName());
-            }
-            else if (trait_value instanceof Double)
-            {
-                return (((Double)trait_value).toString());
-            }
-            else if (trait_value instanceof Integer)
-            {
-                return (((Integer)trait_value).toString());
-            }
-            else if (trait_value instanceof Long)
-            {
-                return (((Long)trait_value).toString());
-            }
-            else if (trait_value instanceof Float)
-            {
-                return (((Float)trait_value).toString());
-            }
-            else if (trait_value.equals(Boolean.TRUE))
-            {
-                return ("true");
-            }
-            else if (trait_value.equals(Boolean.FALSE))
-            {
-                return ("false");
-            }
-            else if (trait_value == ABCConstants.NULL_VALUE)
-            {
-                return ("null");
-            }
-            else if (trait_value == ABCConstants.UNDEFINED_VALUE)
-            {
-                //  Undefined is a special case; it has no kind byte.
-                return ("undefined");
-            }
-            else
-            {
-                throw new IllegalStateException("Unrecognized initializer type: " + trait_value.getClass().toString());
-            }
-        }
-        else
-        {
-            final Name type = t.getNameAttr(Trait.TRAIT_TYPE);
-
-            // In AS, uninitialized variables have a type-specific default value (not always undefined).
-            // The local-var version of this fix is in JSGeneratingReducer.reduce_typedVariableDecl()
-            return (getDefaultInitializerForVariable(type));
-
-            /*
-             * // Flash assumes that uninitialized numbers default to "0" and
-             * not "undefined". String defaultVal = "undefined"; switch(
-             * typeNameToAbcConstant(type) ) { case ABCConstants.CONSTANT_Int :
-             * defaultVal = "0"; break; case ABCConstants.CONSTANT_UInt :
-             * defaultVal = "0"; break; case ABCConstants.CONSTANT_Double :
-             * defaultVal = "0.0"; break; case ABCConstants.CONSTANT_Utf8 :
-             * defaultVal = "null"; break; case ABCConstants.CONSTANT_False :
-             * defaultVal = "false"; break; case ABCConstants.CONSTANT_True :
-             * defaultVal = "true"; break; case ABCConstants.CONSTANT_Undefined
-             * : defaultVal = "undefined"; break; case
-             * ABCConstants.CONSTANT_Null : defaultVal = "null"; break; default
-             * : defaultVal = "undefined"; break; } return( defaultVal );
-             */
-        }
-    }
-
-    protected Boolean emitVariable(Trait t, String baseName,
-            String packageName, String className, String superClassName,
-            String methodPrefix, String assignment, String separator, String indent) throws Exception
-    {
-        Boolean needsSkinPartProcessing = false;
-        final Name name = t.getNameAttr("name");
-        final Name type = t.getNameAttr(Trait.TRAIT_TYPE);
-
-        // JSDoc 
-        List<String> jsdoc = new ArrayList<String>();
-        // jsdoc.add("Member: " + createFullName(packageName, className + "." + baseName));
-
-        if (name != null)
-        {
-            Namespace ns = name.getSingleQualifier();
-            if (ns.getKind() == CONSTANT_PrivateNs)
-                jsdoc.add("@private");
-            else if (ns.getKind() == CONSTANT_ProtectedNs)
-                jsdoc.add("@protected");
-            else
-                jsdoc.add("@expose");
-        }
-        if (t.getKind() == TRAIT_Const)
-            jsdoc.add("@const");
-        if (type != null)
-        {
-            final StringBuilder sb = new StringBuilder();
-            JSGeneratingReducer.nameToJSDocType(m_project, type, sb);
-            jsdoc.add("@type {" + sb.toString() + "}");
-        }
-
-        if (jsdoc.size() > 0)
-        {
-            writeString("\n");
-            if (jsdoc.size() == 1)
-                writeString(indent + "/** " + jsdoc.get(0) + " */\n");
-            else
-            {
-                writeString(indent + "/**\n");
-                for (String decl : jsdoc)
-                {
-                    writeString(indent + " * " + decl + "\n");
-                }
-                writeString(indent + " */\n");
-            }
-        }
-
-        writeString(indent + methodPrefix + baseName + assignment + ";\n\n");
-
-        // Examine var/const metadata
-        final Vector<Metadata> metaData = t.getMetadata();
-        for (Metadata md : metaData)
-        {
-            if (md.getName().equals(IMetaAttributeConstants.ATTRIBUTE_SKIN_PART))
-            {
-                needsSkinPartProcessing = true;
-                break;
-            }
-        }
-
-        return needsSkinPartProcessing;
-    }
-
-    protected void emitTraits(Traits traits,
-                            Boolean isInstanceTraits, Boolean isExtern, Boolean isInterface, Boolean isPackageFunction,
-                            MethodInfo ctor, String packageName, String className, String superClassName,
-                            String methodPrefix, String assignmentOp, String separator, String indent) throws Exception
-    {
-        final Boolean isFramework = className.equals(JSSharedData.JS_FRAMEWORK_NAME);
-        Boolean emitComma = false;
-
-        // cache some data used by all the warnIfPrivateNameCollision() calls below
-        IClassDefinition classDef = getClassDefinition(className, packageName);
-        IClassDefinition baseClass = null;
-        ASDefinitionFilter filter = null;
-        if (classDef != null)
-        {
-            baseClass = classDef.resolveBaseClass(m_project);
-            filter = new ASDefinitionFilter(ClassificationValue.ALL,
-                                            ASDefinitionFilter.SearchScopeValue.INHERITED_MEMBERS,
-                                            ASDefinitionFilter.AccessValue.ALL,
-                                            baseClass);
-        }
-
-        // 1. emit constructor 
-        if (isInstanceTraits && ctor != null)
-        {
-            emitCtor(ctor, isExtern, isInterface, packageName, className, superClassName,
-                      methodPrefix, assignmentOp, separator, indent);
-        }
-
-        // Avoid emitting duplicate Traits, which starts happening after adding 
-        // this line to JSClassDirectiveProcessor::declareVariable():
-        // this.classScope.traitsVisitor = (is_static)? ctraits: itraits;
-        final Set<String> visitedTraits = new HashSet<String>();
-
-        // 2. emit all variables before any methods
-        boolean needsSkinPartProcessing = false;
-
-        for (Trait t : traits)
-        {
-            //  Get the kind byte with its flags set in the high nibble.
-            switch (t.getKind())
-            {
-                case TRAIT_Var:
-                case TRAIT_Const:
-
-                    final Name name = t.getNameAttr("name");
-                    Namespace ns = name.getSingleQualifier();
-                    if (ns.getKind() != CONSTANT_PrivateNs && isInstanceTraits)
-                    	break;
-                    final String baseName = JSGeneratingReducer.getBasenameFromName(name);
-
-                    if (!visitedTraits.contains(baseName))
-                    {
-                        visitedTraits.add(baseName);
-
-                        // see JSGlobalDirectiveProcessor::declareFunction.
-                        // Functions at the global scope create a var of type '*'
-                        Boolean emitVar = true;
-                        if (isPackageFunction)
-                        {
-                            final Name type = t.getNameAttr("type");
-                            if (type == null || type.equals("Function"))
-                            {
-                                for (MethodInfo mi : methodInfos)
-                                {
-                                    if (mi.getMethodName() != null && mi.getMethodName().equals(baseName))
-                                    {
-                                        emitMethod(t, mi, isFramework, isExtern, isInterface, isPackageFunction, baseName, baseName, "", "var ", assignmentOp, separator, indent);
-                                        emitVar = false;
-                                        break;
-                                    }
-                                }
-                            }
-                        }
-
-                        if (emitVar)
-                        {
-                        	writeString("\n");
-                        	String slotValue = (String)t.getAttr(Trait.SLOT_VALUE);
-                        	if (slotValue == null)
-                        		slotValue = "";
-                        	else
-                        	{
-                        		slotValue = " = " + slotValue;
-                        	}                            
-                        	boolean methodNeedsSkinPartProcessing = emitVariable(t, baseName,
-                                                                    packageName, className, superClassName,
-                                                                    methodPrefix, slotValue, separator, indent);
-
-                        	needsSkinPartProcessing = needsSkinPartProcessing || methodNeedsSkinPartProcessing;
-                            // print warning in cases where FJS-24 is being hit
-                            String fullName = createFullName(packageName, className);
-                            if (!fullName.isEmpty())
-                                fullName += ".";
-                            fullName += baseName;
-
-                            warnIfPrivateNameCollision(baseClass, filter, baseName, fullName, "Field");
-                        }
-                    }
-                    break;
-                case TRAIT_Method:
-                case TRAIT_Function:
-                case TRAIT_Getter:
-                case TRAIT_Setter:
-                {
-                    // methods will be processed below.
-                }
-                    break;
-                case TRAIT_Class:
-                    // TODO: non-zero slot id
-                    // writeString( "\n    // ClassInfo: " + ((ClassInfo)t.getAttr(Trait.TRAIT_CLASS)).toString() + "\n" );
-                    break;
-                default:
-                    throw new IllegalArgumentException("Unknown trait kind " + t.getKind());
-            }
-        }
-        if (isInstanceTraits && ctor != null)
-        {
-        	writeString("};\n"); // end of constructor
-            final String cName = createFullName(packageName, className);
-            writeString("goog.inherits(" + cName + ", " + superClassName + ");\n");
-        }
-        
-        // 3. emit public vars
-        for (Trait t : traits)
-        {
-            //  Get the kind byte with its flags set in the high nibble.
-            switch (t.getKind())
-            {
-                case TRAIT_Var:
-                case TRAIT_Const:
-
-                    final Name name = t.getNameAttr("name");
-                    Namespace ns = name.getSingleQualifier();
-                    if (ns.getKind() == CONSTANT_PrivateNs)
-                    	break;
-                    final String baseName = JSGeneratingReducer.getBasenameFromName(name);
-
-                    if (!visitedTraits.contains(baseName))
-                    {
-                        visitedTraits.add(baseName);
-
-                        // see JSGlobalDirectiveProcessor::declareFunction.
-                        // Functions at the global scope create a var of type '*'
-                        Boolean emitVar = true;
-                        if (isPackageFunction)
-                        {
-                            final Name type = t.getNameAttr("type");
-                            if (type == null || type.equals("Function"))
-                            {
-                                for (MethodInfo mi : methodInfos)
-                                {
-                                    if (mi.getMethodName() != null && mi.getMethodName().equals(baseName))
-                                    {
-                                        emitMethod(t, mi, isFramework, isExtern, isInterface, isPackageFunction, baseName, baseName, "", "var ", assignmentOp, separator, indent);
-                                        emitVar = false;
-                                        break;
-                                    }
-                                }
-                            }
-                        }
-
-                        if (emitVar)
-                        {
-                        	String slotValue = (String)t.getAttr(Trait.SLOT_VALUE);
-                        	if (slotValue == null)
-                        		slotValue = "";
-                        	else
-                        	{
-                        		slotValue = " = " + slotValue;
-                        	}
-                        	writeString("\n");
-                            
-                        	boolean methodNeedsSkinPartProcessing = emitVariable(t, baseName,
-                                                                    packageName, className, superClassName,
-                                                                    (packageName == "") ? className + ".prototype." :
-                                                                    packageName + "." + className + ".prototype.", slotValue, "", "");
-
-                        	needsSkinPartProcessing = needsSkinPartProcessing || methodNeedsSkinPartProcessing;
-                            // print warning in cases where FJS-24 is being hit
-                            String fullName = createFullName(packageName, className);
-                            if (!fullName.isEmpty())
-                                fullName += ".";
-                            fullName += baseName;
-
-                            warnIfPrivateNameCollision(baseClass, filter, baseName, fullName, "Field");
-                        }
-                    }
-                    break;
-                case TRAIT_Method:
-                case TRAIT_Function:
-                case TRAIT_Getter:
-                case TRAIT_Setter:
-                {
-                    // methods will be processed below.
-                }
-                    break;
-                case TRAIT_Class:
-                    // TODO: non-zero slot id
-                    // writeString( "\n    // ClassInfo: " + ((ClassInfo)t.getAttr(Trait.TRAIT_CLASS)).toString() + "\n" );
-                    break;
-                default:
-                    throw new IllegalArgumentException("Unknown trait kind " + t.getKind());
-            }
-        }
-        
-        String proto = isInstanceTraits ? ".prototype." : ".";
-        // 4. emit all other methods (ctor already emitted)
-        for (Trait t : traits)
-        {
-            //  Get the kind byte with its flags set in the high nibble.
-            switch (t.getKind())
-            {
-                case TRAIT_Method:
-                case TRAIT_Function:
-                case TRAIT_Getter:
-                case TRAIT_Setter:
-                {
-                    // we can't emit getter and setter for extern declarations.
-                    if (!isExtern || t.getKind() != TRAIT_Setter)
-                    {
-
-                        // write out full function name with package.
-                        Name name = t.getNameAttr("name");
-                        MethodInfo mi = (MethodInfo)t.getAttr("method_id");
-                        final String baseName = JSGeneratingReducer.getBasenameFromName(name);
-
-                        // write out comment with the full class name
-                        String fullName = createFullName(packageName, className);
-                        String xetter = "";
-
-                        // cleaning up static inits.
-                        // Static initializer is generated but not called for classes without explicit constructor
-                        //if ((!isInstanceTraits || ctor == null) && JSSharedData.instance.hasClassInit(fullName))
-                        //    m_methodPrologue += "        " + fullName + "." + JSSharedData.STATIC_INIT + "();\n";
-
-                        if (!isExtern)
-                        {
-                            if (t.getKind() == TRAIT_Getter)
-                                xetter = JSSharedData.GETTER_PREFIX;
-                            else if (t.getKind() == TRAIT_Setter)
-                                xetter = JSSharedData.SETTER_PREFIX;
-                        }
-
-                        if (!fullName.isEmpty())
-                            fullName += ".";
-                        fullName += xetter + baseName;
-
-                        // don't emit extern package functions
-                        if (!isExtern && isPackageFunction)
-                            isExtern = isExtern(name);
-
-                        // actually emit the JS code
-                        emitMethod(t, mi, isFramework, isExtern, isInterface, isPackageFunction, fullName, baseName, xetter, 
-                                (packageName == "") ? className + proto :
-                                    packageName + "." + className + proto , "=", "", "");
-
-                        // print warning in cases where FJS-24 is being hit
-                        warnIfPrivateNameCollision(baseClass, filter, baseName, fullName, "Method");
-                    }
-                }
-                    break;
-            }
-        }
-
-        // 5. custom methods generated from metadata
-        if (needsSkinPartProcessing)
-        {
-            if (emitComma)
-                writeString(separator + "\n");
-            else
-                emitComma = separator.equals(",");
-
-            emitGeneratedSkinPartsMethod(className, packageName, methodPrefix, assignmentOp);
-        }
-
-        // 5. class constructor
-        if (ctor != null && !isInstanceTraits)
-        {
-            // first check whether there is any code...
-            final String body = getCodeForConstructor(ctor);
-            if (!body.isEmpty())
-            {
-                if (emitComma)
-                    writeString(separator + "\n");
-                else
-                    emitComma = separator.equals(",");
-
-                final String fullName = createFullName(packageName, className);
-
-                // writeString( "\n    // Static inits:\n" );
-                emitMethod(null, ctor, isFramework, isExtern, isInterface, isPackageFunction, fullName, null, "", methodPrefix, assignmentOp, separator, indent);
-            }
-        }
-    }
-
-    /**
-     * Emits the skinParts getter definition that is implied by the use of
-     * [SkinPart] metadata on a Flex class. TODO: once Falcon starts handling
-     * [SkinPart] this code should probbly go away
-     */
-    private void emitGeneratedSkinPartsMethod(String className, String packageName, String methodPrefix, String assignmentOp)
-    {
-        IClassDefinition def = getClassDefinition(className, packageName);
-        String jsonResult = JSFlexUtils.generateGetSkinPartsJSON(def, m_project);
-
-        // Emit JSDoc -- based on emitJSDocForMethod()
-        String methodName = "get_skinParts";
-        String methodFullName = packageName + "." + className + "." + methodName;
-        String indent = "";
-        writeString(indent + "\n\n");
-        writeString(indent + "/**\n");
-        writeString(indent + " * Method: " + methodFullName + "()\n");
-        writeString(indent + " * @this {" + methodFullName.substring(0, methodFullName.lastIndexOf(".")) + "}\n");
-        writeString(indent + " * @protected\n");
-        writeString(indent + " * @override\n");
-        writeString(indent + " * @return {Object}\n");
-        writeString(indent + " */\n");
-
-        // Emit method definition itself -- based on emitMethod()
-        writeString(indent + methodPrefix + methodName);
-        writeString(" " + assignmentOp + " ");
-
-        writeString("function() /* : Object */\n");
-        writeString("{\n");
-
-        indent = "        ";
-        writeString(indent + "return " + jsonResult + ";\n");
-
-        writeString("}");
-    }
-
-    /**
-     * Given a var or const trait, return the default value it should be
-     * initialized to if there was no initializer in the AS code
-     */
-    public static String getDefaultInitializerForVariable(Name varType)
-    {
-        if (varType != null)
-        {
-            String typeName = JSGeneratingReducer.getBasenameFromName(varType);
-
-            // int/uint default to 0 in AS; this matters since, e.g.: 0++ = 1; undefined++ = NaN
-            if (typeName.equals("int") || typeName.equals("uint"))
-                return "0";
-
-            // Number defaults to naN
-            if (typeName.equals("Number"))
-                return "NaN";
-
-            // Boolean defaults to false in AS; this matters when comparing two bools: undefined != false
-            if (typeName.equals("Boolean"))
-                return "false";
-        }
-        return "undefined";
-    }
-
-    /**
-     * Given a class member and the class's base class, try to detect whether it
-     * will hit FJS-24 - and if so print a warning. Intended to be called from
-     * emitTraits().
-     */
-    public void warnIfPrivateNameCollision(IClassDefinition baseClass, ASDefinitionFilter baseClassAllFilter, String memberName, String memberFullName, String memberDescription)
-    {
-        // If baseClass is null, we're probably looking at a global function like trace() or setTimeout()
-        if (baseClass != null)
-        {
-            IDefinition conflict = MemberedDefinitionUtils.getMemberByName(baseClass, m_project, memberName, baseClassAllFilter);
-            if (conflict != null)
-            {
-                // If member is non-private, it's *expected* to be overridden (note: we could also check isOverride() on classDef's member)
-                // If member is static, FJS-24 doesn't apply and all is well
-                if (conflict.isPrivate() && !conflict.isStatic())
-                {
-                    m_sharedData.stderr("Warning: " + memberDescription + " " + memberFullName + " will unexpectedly override a private member of superclass " + conflict.getParent().getBaseName());
-                }
-            }
-        }
-    }
-
-    /*
-     * private String getCodeForMethodInfo( MethodInfo mi ) { String body = "";
-     * MethodBodyInfo mbi = findMethodBodyInfo( mi ); if( mbi != null ) { for
-     * (Block b : mbi.getBlocks()) { for (int i = 0; i < b.instructions.size()
-     * && !b.instructions.get(i).isBranch(); i++) { final Instruction insn =
-     * b.instructions.get(i); if( insn.getOpcode() == JSSharedData.OP_JS ) {
-     * final String str = (String)insn.getOperand(0); body +=
-     * JSGeneratingReducer.indentBlock(str,1); } } } } return body; }
-     */
-
-    protected String getCodeForConstructor(MethodInfo mi)
-    {
-        String body = "";
-        MethodBodyInfo mbi = findMethodBodyInfo(mi);
-
-        if (mbi != null)
-        {
-            for (IBasicBlock b : mbi.getCfg().getBlocksInEntryOrder())
-            {
-                for (int i = 0; i < b.size() && !b.get(i).isBranch(); i++)
-                {
-                    final Instruction insn = b.get(i);
-                    if (insn.getOpcode() == JSSharedData.OP_JS)
-                    {
-                        final String str = (String)insn.getOperand(0);
-
-                        // we are only interested in the instruction that initialize variables with a value.
-                        // if( str.contains("=") )
-                        body += JSGeneratingReducer.indentBlock(str, 1);
-                    }
-                }
-            }
-        }
-        return body;
-    }
-
-    private void emitJSDocForMethod(Trait t, MethodInfo mi, MethodBodyInfo mbi, String fullName, String indent)
-    {
-        final Boolean isCtor = t == null;
-        final Boolean isInterface = mbi == null;
-
-        writeString(indent + "\n\n");
-        writeString(indent + "/**\n");
-        /*
-        if (isCtor)
-        {
-            writeString(indent + " * Constructor: " + fullName + "()\n");
-            writeString(indent + " * @constructor\n");
-        }
-        else if (isInterface)
-        {
-            writeString(indent + " * Interface: " + fullName + "()\n");
-        }
-        else
-        {
-            writeString(indent + " * Method: " + fullName + "()\n");
-        }
-		*/
-        if (!isInterface)
-        {
-            if (fullName.contains("."))
-            {
-                if (fullName.substring(0, fullName.lastIndexOf(".")).equals(JSSharedData.JS_FRAMEWORK_NAME))
-                    writeString(indent + " * @this {" + JSSharedData.JS_FRAMEWORK_NAME + "}\n");
-                else
-                    writeString(indent + " * @this {" + fullName.substring(0, fullName.lastIndexOf(".")) + "}\n");
-            }
-
-            if (t != null)
-            {
-                final Name name = t.getNameAttr("name");
-                if (name != null)
-                {
-                    Namespace ns = name.getSingleQualifier();
-                    if (ns.getKind() == CONSTANT_PrivateNs)
-                        writeString(indent + " * @private\n");
-                    else if (ns.getKind() == CONSTANT_ProtectedNs)
-                        writeString(indent + " * @protected\n");
-                    else
-                        writeString(indent + " * @expose\n");
-                }
-                if (t.isOverride() ||
-                    (t.hasAttr("override") && (Boolean)(t.getAttr("override")) == true))
-                {
-                    writeString(indent + " * @override\n");
-                }
-            }
-        }
-
-        emitJSDocForParams(mi, indent);
-        
-        if (mi.getReturnType() != null && !JSGeneratingReducer.getBasenameFromName(mi.getReturnType()).equals("void"))
-        {
-            final StringBuilder sb = new StringBuilder();
-            JSGeneratingReducer.nameToJSDocType(m_project, mi.getReturnType(), sb);
-
-            writeString(indent + " * @return {" + sb.toString() + "}\n");
-        }
-
-        writeString(indent + " */\n");
-    }
-
-    private void emitJSDocForParams(MethodInfo mi, String indent)
-    {
-        Vector<PooledValue> defaultValues = mi.getDefaultValues();
-        Vector<Name> paramTypes = mi.getParamTypes();
-        List<String> paramNames = mi.getParamNames();
-
-        int nthParam = 0;
-        final int defaultsStartAt = paramTypes.size() - defaultValues.size();
-        final Boolean needsRest = (mi.getFlags() & ABCConstants.NEED_REST) > 0;
-        final int restStartsAt = needsRest ? paramNames.size() - 1 : paramNames.size();
-
-        for (String argName : paramNames)
-        {
-            if (nthParam == restStartsAt)
-            {
-                // param is rest argument
-                writeString(indent + " * @param {...} " + argName + "\n");
-            }
-            else
-            {
-                Name nextParam = paramTypes.elementAt(nthParam);
-                final StringBuilder sb = new StringBuilder();
-                JSGeneratingReducer.nameToJSDocType(m_project, nextParam, sb);
-                final String argType = sb.toString();
-                if (nthParam < defaultsStartAt)
-                {
-                    // param without default value
-                    writeString(indent + " * @param {" + argType + "} " + argName + "\n");
-                }
-                else
-                {
-                    // param with default value
-                    writeString(indent + " * @param {" + argType + "} " + JSSharedData.DEFAULT_PARAM_PREFIX + argName);
-
-                    String defaultVal = "undefined";
-                    PooledValue val = defaultValues.elementAt(nthParam - defaultsStartAt);
-                    if (val != null)
-                    {
-                        switch (val.getKind())
-                        {
-                            case ABCConstants.CONSTANT_Int:
-                                defaultVal = val.getIntegerValue().toString();
-                                break;
-                            case ABCConstants.CONSTANT_UInt:
-                                defaultVal = val.getLongValue().toString();
-                                break;
-                            case ABCConstants.CONSTANT_Double:
-                                defaultVal = val.getDoubleValue().toString();
-                                break;
-                            case ABCConstants.CONSTANT_Utf8:
-                                defaultVal = val.getStringValue();
-                                break;
-                            case ABCConstants.CONSTANT_True:
-                                defaultVal = "true";
-                                break;
-                            case ABCConstants.CONSTANT_False:
-                                defaultVal = "false";
-                                break;
-                            case ABCConstants.CONSTANT_Undefined:
-                                defaultVal = "undefined";
-                                break;
-                            case ABCConstants.CONSTANT_Null:
-                                defaultVal = "null";
-                                break;
-                            default:
-                            {
-                                final Namespace ns = val.getNamespaceValue();
-                                if (ns != null)
-                                    defaultVal = ns.getName() + " /* (namespace) */";
-                            }
-                                break;
-                        }
-                    }
-                    writeString(" Defaults to " + defaultVal + ".\n");
-                }
-            }
-
-            nthParam++;
-        }
-    }
-    
-    protected Boolean isPackageFunction(MethodInfo mi)
-    {
-        final FunctionDefinition fdef = m_methodInfoToDefinition.get(mi);
-        if (fdef != null && fdef.getParent() instanceof PackageDefinition)
-            return true;
-
-        return false;
-    }
-
-    protected void emitFrameworkInit()
-    {
-        writeString("\n");
-        writeString("// Overrides \n");
-
-        writeString("adobe.globals = __global;\n");
-
-        // auto-register classes
-        writeString("" + JSSharedData.JS_CLASSES + " = {};\n");
-        writeString("" + JSSharedData.JS_INT_CLASS + " = IntClass;\n");
-        writeString("" + JSSharedData.JS_UINT_CLASS + " = UIntClass;\n");
-
-        // override settings for adobe.USE_SELF and adobe.USE_STATIC
-        final Boolean useClosure = JSSharedData.m_useClosureLib;
-        final Boolean useSelfParameter = JSSharedData.m_useSelfParameter;
-        final Boolean convertToStatic = useSelfParameter && false; // see JSSharedData.m_convertToStatic
-        writeString("\n");
-        writeString("// Settings \n");
-        writeString("adobe.USE_CLOSURE = " + (useClosure ? "true" : "false") + ";\n");
-        writeString("adobe.USE_SELF = " + (useSelfParameter ? "true" : "false") + ";\n");
-        writeString("adobe.USE_STATIC = " + (convertToStatic ? "true" : "false") + ";\n");
-        writeString("adobe.ROOT_NAME = \"" + JSSharedData.ROOT_NAME + "\";\n");
-        writeString("adobe.NO_EXPORTS = " + JSSharedData.NO_EXPORTS + ";\n");
-        writeString("adobe.root = " + JSSharedData.JS_SYMBOLS + ";\n");
-    }
-
-    protected void emitMethod(Trait t, MethodInfo mi, Boolean isFramework, Boolean isExtern, Boolean isInterface, Boolean isPackageFunction, String fullName, String name, String xetter, String methodPrefix, String assignmentOp, String separator, String indent) throws Exception
-    {
-        // don't emit extern package functions
-        if (isExtern && isPackageFunction)
-            return;
-
-        MethodBodyInfo mbi = findMethodBodyInfo(mi);
-
-        if (name != null)
-        {
-            // Sometimes mi.name is empty
-            if (mi.getMethodName() == null || mi.getMethodName().isEmpty())
-                mi.setMethodName(name);
-
-            // set m_currentScope to classScope
-            if (m_currentScope != null)
-            {
-                IASScope methodScope = null;
-                IASScope scope = m_currentScope;
-                ASDefinitionFilter filter = new ASDefinitionFilter(ClassificationValue.MEMBERS_AND_TYPES,
-                        SearchScopeValue.ALL_SCOPES,
-                        AccessValue.ALL,
-                        scope.getDefinition());
-                IDefinition def = ASScopeUtils.findDefinitionByName(scope, m_project, name, filter);
-                if (def != null)
-                {
-                    //FunctionDefinition 
-                    // methodScope = new ASScope((ASScope)def.getContainingScope());
-                    methodScope = def.getContainingScope();
-                    m_currentScope = methodScope;
-                }
-            }
-
-            emitJSDocForMethod(t, mi, mbi, fullName, indent);
-
-            final Boolean isGetter = t != null && t.getKind() == TRAIT_Getter;
-            // final Boolean isPackageFunction = methodPrefix.isEmpty() && isPackageFunction(mi);
-
-            // regular constructor
-            writeString(indent + methodPrefix + xetter + name);
-            if (isInterface && isGetter)
-            {
-                writeString(";\n");
-                return;
-            }
-
-            writeString(" " + assignmentOp + " ");
-
-            writeString("function(");
-            String a_priori_insns = "";
-            // a_priori_insns = emitParameters( m_methodInfoToDefinition.get(mi) );
-            a_priori_insns = emitParameters(mi);
-            writeString(")");
-
-            // return type 
-            // if (mi.getReturnType() != null)
-            //    writeString(" /* : " + JSGeneratingReducer.getBasenameFromName(mi.getReturnType()) + " */");
-
-            if (isInterface)
-            {
-                writeString(" {};\n");
-            }
-            else
-            {
-                writeString("\n");
-                writeString(indent + "{");
-                writeString("\n");
-                if (!a_priori_insns.isEmpty())
-                {
-                    writeString(a_priori_insns);
-                }
-                emitMethodBody(mbi);
-                writeString(indent + "};");
-            }
-
-        }
-        else
-        {
-            // all __static_inits need to be registered.
-            if (!JSSharedData.instance.hasClassInit(fullName))
-                JSSharedData.instance.registerClassInit(fullName);
-
-            final String staticInitName = methodPrefix + JSSharedData.STATIC_INIT;
-
-            writeString("\n\n");
-            writeString("/**\n");
-            writeString(" * Method: " + indent + staticInitName + "()\n");
-            writeString(" */\n");
-
-            writeString(indent + staticInitName + " = ");
-            writeString("function() /* : void */\n");
-            writeString(indent + "{\n");
-            writeString(indent + "    " + staticInitName + " = " + JSSharedData.JS_EMPTY_FUNCTION + ";\n");
-
-            // static init
-            emitMethodBody(mbi);
-
-            writeString(indent + "}");
-        }
-    }
-
-    private void emitScriptInfo(ScriptInfo info) throws Exception
-    {
-        // w.writeU30(getScriptId(info.getInitId()));
-        // emitTraits(info.getTraits(), "", "    " );
-
-        final Object init_id = info.getInit();
-        ;
-        if (init_id instanceof MethodInfo)
-        {
-            final MethodInfo mi = (MethodInfo)init_id;
-            final MethodBodyInfo mbi = this.findMethodBodyInfo(mi);
-            if (mbi != null)
-            {
-                final String str = extractCodeFromMethodBodyInfo(mbi);
-                if (!str.isEmpty())
-                {
-                    final StringBuilder scriptInfos = new StringBuilder();
-
-                    scriptInfos.append("// ScriptInfo \n");
-                    scriptInfos.append("{\n");
-                    scriptInfos.append("    var " + JSSharedData.THIS + " = ");
-                    if (m_packageName != null && !m_packageName.isEmpty())
-                    {
-                        scriptInfos.append(m_packageName + ";\n");
-                    }
-                    else
-                    {
-                        scriptInfos.append(JSSharedData.JS_FRAMEWORK_NAME + ".globals;\n");
-                    }
-
-                    // This is just crazy...
-                    // It looks like very variable declared in a script info block becomes a global variable.
-                    // See testUnicodeRangeHelper() in Tamarin's ecma3/Unicode/unicodeUtil.as, which for some
-                    // reasons uses "this.array" instead of just "array".
-                    final StringBuilder sb = new StringBuilder();
-                    for (String line : str.split("\n"))
-                    {
-                        if (line.startsWith("var "))
-                            sb.append(line.replaceFirst("var ", JSSharedData.THIS + "."));
-                        else
-                            sb.append(line);
-                        sb.append("\n");
-                    }
-
-                    // the meat of  emitCode(mbi);
-                    scriptInfos.append(JSGeneratingReducer.indentBlock(sb.toString(), 1));
-
-                    scriptInfos.append("}\n");
-
-                    JSSharedData.instance.registerScriptInfo(scriptInfos.toString());
-                }
-            }
-        }
-    }
-
-    protected void emitMethodBody(MethodBodyInfo f)
-            throws Exception
-    {
-        if (f == null)
-            return;
-
-        /*
-         * MethodInfo signature = f.getMethodInfo();
-         * w.writeU30(getMethodId(signature)); f.computeFrameCounts();
-         * w.writeU30(f.getMaxStack()); int max_local = f.getLocalCount(); if
-         * (signature.getParamCount() > max_local) max_local =
-         * signature.getParamCount(); w.writeU30(max_local);
-         * w.writeU30(f.getInitScopeDepth()); w.writeU30(f.getMaxScopeDepth());
-         */
-
-        if (!m_methodPrologue.isEmpty())
-        {
-            writeString(m_methodPrologue);
-            m_methodPrologue = "";
-        }
-
-        emitCode(f);
-
-        if (!m_methodPostlogue.isEmpty())
-        {
-            writeString(m_methodPostlogue);
-            m_methodPostlogue = "";
-        }
-    }
-
-    private void emitCode(MethodBodyInfo f)
-            throws Exception
-    {
-        String str = extractCodeFromMethodBodyInfo(f);
-
-        /*
-         * Experimental: ABC decompilation if( str.isEmpty() ) { final
-         * ByteArrayOutputStream out = new ByteArrayOutputStream(); final
-         * JSConverter converter = new JSConverter(m_project, m_currentScope,
-         * out ); final MethodInfo mi = f.getMethodInfo(); final IMethodVisitor
-         * mv = converter.visitMethod(mi); mv.visit(); final IMethodBodyVisitor
-         * mbv = mv.visitBody(f); mbv.visit(); mbv.visitEnd(); mv.visitEnd();
-         * str = out.toString(); }
-         */
-
-        if (!str.isEmpty())
-        {
-            writeString(JSGeneratingReducer.indentBlock(str, 1));
-        }
-    }
-
-    /*
-     * private String indentBlock( String block, int indentBy ) { Boolean
-     * firstPart = true; String s = ""; String[] parts = block.split( "\n" );
-     * for( String part : parts ) { if( firstPart ) firstPart = false; else s +=
-     * "\n"; for( int i = 0; i < indentBy; ++i ) s += "    "; s += part; } return
-     * s; } private void emitNamespace(Namespace ns) { w.write(ns.getKind());
-     * w.writeU30(stringPool.id(ns.getName())); }
-     */
-
-    private String extractCodeFromBlock(IBasicBlock b)
-    {
-        String str = "";
-        for (int i = 0; i < b.size() && !b.get(i).isBranch(); i++)
-        {
-            final Instruction insn = b.get(i);
-            if (insn.getOpcode() == JSSharedData.OP_JS)
-                str += (String)insn.getOperand(0);
-        }
-        return str;
-    }
-
-    private String extractCodeFromMethodBodyInfo(MethodBodyInfo mbi)
-    {
-        String str = "";
-        for (IBasicBlock b : mbi.getCfg().getBlocksInEntryOrder())
-        {
-            str += extractCodeFromBlock(b);
-        }
-        return str;
-    }
-
-    class JSOutputStream extends ByteArrayOutputStream
-    {
-        void rewind(int n)
-        {
-            super.count -= n;
-        }
-
-        void writeString(String str)
-        {
-            try
-            {
-                write(str.getBytes());
-            }
-            catch (IOException e)
-            {
-
-            }
-        }
-
-        public void write(int i)
-        {
-            // super.write(i);
-        }
-
-        void writeU16(int i)
-        {
-            //write(i);
-            //write(i >> 8);
-        }
-
-        void writeS24(int i)
-        {
-            //writeU16(i);
-            //write(i >> 16);
-        }
-
-        void write64(long i)
-        {
-            //writeS24((int)i);
-            //writeS24((int)(i >> 24));
-            //writeU16((int)(i >> 48));
-        }
-
-        void writeU30(int v)
-        {
-            /*
-             * if (v < 128 && v >= 0) { write(v); } else if (v < 16384 && v >=
-             * 0) { write(v & 0x7F | 0x80); write(v >> 7); } else if (v <
-             * 2097152 && v >= 0) { write(v & 0x7F | 0x80); write(v >> 7 |
-             * 0x80); write(v >> 14); } else if (v < 268435456 && v >= 0) {
-             * write(v & 0x7F | 0x80); write(v >> 7 | 0x80); write(v >> 14 |
-             * 0x80); write(v >> 21); } else { write(v & 0x7F | 0x80); write(v
-             * >> 7 | 0x80); write(v >> 14 | 0x80); write(v >> 21 | 0x80);
-             * write(v >> 28); }
-             */
-        }
-
-        int sizeOfU30(int v)
-        {
-            if (v < 128 && v >= 0)
-            {
-                return 1;
-            }
-            else if (v < 16384 && v >= 0)
-            {
-                return 2;
-            }
-            else if (v < 2097152 && v >= 0)
-            {
-                return 3;
-            }
-            else if (v < 268435456 && v >= 0)
-            {
-                return 4;
-            }
-            else
-            {
-                return 5;
-            }
-        }
-    }
-
-    /**
-     * The nominal name given to a MultinameL.
-     * 
-     * @see http://bugs.adobe.com/jira/browse/CMP-393, this may not be
-     * necessary, and if under some circumstances it is necessary this is
-     * certainly not the name required.
-     */
-    private static Name indexAccessName;
-    /**
-     * The above Name packaged up into operand form.
-     */
-    private static Object[] indexAccessOperands;
-    /*
-     * Initialization code for indexAccessname and indexAccessOperands.
-     */
-    static
-    {
-        Vector<Namespace> usual_suspects = new Vector<Namespace>(2);
-        usual_suspects.add(new Namespace(CONSTANT_PrivateNs));
-        usual_suspects.add(new Namespace(CONSTANT_PackageNs));
-        indexAccessName = new Name(ABCConstants.CONSTANT_MultinameL, new Nsset(usual_suspects), null);
-        indexAccessOperands = new Object[] {indexAccessName};
-    }
-
-    /**
-     * Find all the operands in a method body and make sure they find their way
-     * into the appropriate pool.
-     * 
-     * @param mi - the method body.
-     * @post any runtime multinames have a dummy Name operand.
-     */
-    void _poolOperands(MethodBodyInfo mbi)
-    {
-        for (IBasicBlock b : mbi.getCfg().getBlocksInEntryOrder())
-            for (Instruction insn : b.getInstructions())
-                switch (insn.getOpcode())
-                {
-                    case OP_findproperty:
-                    case OP_findpropstrict:
-                    case OP_getlex:
-                    case OP_getsuper:
-                    case OP_setsuper:
-                    case OP_getdescendants:
-                    case OP_initproperty:
-                    case OP_istype:
-                    case OP_coerce:
-                    case OP_astype:
-                    case OP_finddef:
-                        visitPooledName((Name)insn.getOperand(0));
-                        break;
-                    case OP_deleteproperty:
-                    case OP_getproperty:
-                    case OP_setproperty:
-                        if (insn.getOperandCount() > 0 && insn.getOperand(0) != null)
-                        {
-                            visitPooledName((Name)insn.getOperand(0));
-                        }
-                        else
-                        {
-                            //  get/set/deleteproperty with no operands => runtime multiname.
-                            visitPooledName(indexAccessName);
-                            insn.setOperands(indexAccessOperands);
-                        }
-                        break;
-                    case OP_callproperty:
-                    case OP_callproplex:
-                    case OP_callpropvoid:
-                    case OP_callsuper:
-                    case OP_callsupervoid:
-                    case OP_constructprop:
-                        visitPooledName((Name)insn.getOperand(0));
-                        break;
-                    case OP_pushstring:
-                    case OP_dxns:
-                    case OP_debugfile:
-                        break;
-                    case OP_pushnamespace:
-                        visitPooledNamespace((Namespace)insn.getOperand(0));
-                        break;
-                    case OP_pushint:
-                        break;
-                    case OP_pushuint:
-                        break;
-                    case OP_pushdouble:
-                        break;
-                    case OP_debug:
-                        break;
-                }
-    }
-
-    /**
-     * Inspect a set of Traits and ensure that constant initializer values have
-     * been properly registered in the constant pools.
-     */
-    private void poolTraitValues(Traits ts)
-    {
-        for (Trait t : ts)
-        {
-            if (t.hasAttr(T

<TRUNCATED>

[24/51] [partial] git commit: [flex-falcon] [refs/heads/feature/maven-migration-test] - - Check-In of the migrated project to make error analysis easier

Posted by cd...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
new file mode 100644
index 0000000..638f71b
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java
@@ -0,0 +1,666 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogGlobalClasses;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.internal.driver.js.goog.JSGoogConfiguration;
+import org.apache.flex.compiler.internal.projects.FlexJSProject;
+import org.apache.flex.compiler.internal.tree.as.VariableNode;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IForLoopNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+import org.junit.Ignore;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestFlexJSGlobalClasses extends TestGoogGlobalClasses
+{
+    @Override
+    public void setUp()
+    {
+    	project = new FlexJSProject(workspace);
+    	((FlexJSProject)project).config = new JSGoogConfiguration();
+    	project.setProxyBaseClass("flash.utils.Proxy");
+        super.setUp();
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+
+    @Override
+    @Test
+    public void testArguments()
+    {
+        IFunctionNode node = getMethod("function a():void {  trace(arguments);}");
+        asBlockWalker.visitFunction(node);
+        assertOut("FalconTest_A.prototype.a = function() {\n  org.apache.flex.utils.Language.trace(arguments);\n}");
+    }
+
+    @Test
+    public void testArrayNoArgs()
+    {
+        IVariableNode node = getVariable("var a:Array = new Array();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = new Array()");
+    }
+
+    @Test
+    public void testArrayStringArgs()
+    {
+        IVariableNode node = getVariable("var a:Array = new Array('Hello', 'World');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = new Array('Hello', 'World')");
+    }
+
+    @Test
+    public void testArraySizeArg()
+    {
+        IVariableNode node = getVariable("var a:Array = new Array(30);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = new Array(30)");
+    }
+
+    @Test
+    public void testArrayNumberArgs()
+    {
+        IVariableNode node = getVariable("var a:Array = new Array(30, 40);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = new Array(30, 40)");
+    }
+
+    @Test
+    public void testArrayArrayArg()
+    {
+        IVariableNode node = getVariable("var a:Array = new Array(['Hello', 'World']);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = new Array(['Hello', 'World'])");
+    }
+
+    @Test
+    public void testArrayConstCaseInsensitive()
+    {
+        IVariableNode node = getVariable("var a:Number = Array.CASEINSENSITIVE");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = 1");
+    }
+
+    @Test
+    public void testArrayConstNumeric()
+    {
+        IVariableNode node = getVariable("var a:Number = Array.NUMERIC");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = 16");
+    }
+
+    @Ignore
+    public void testArrayRemoveAt()
+    {
+    	// requires FP19 or newer
+        IBinaryOperatorNode node = getBinaryNode("var a:Array = new Array(); a.removeAt(2)");
+        IFunctionCallNode parentNode = (IFunctionCallNode)(node.getParent());
+        asBlockWalker.visitFunctionCall(parentNode);
+        assertOut("a.splice(2, 1)");
+    }
+
+    @Ignore
+    public void testArrayInsertAt()
+    {
+    	// requires FP19 or newer
+        IBinaryOperatorNode node = getBinaryNode("var a:Array = new Array(); a.insertAt(2, 'foo')");
+        IFunctionCallNode parentNode = (IFunctionCallNode)(node.getParent());
+        asBlockWalker.visitFunctionCall(parentNode);
+        assertOut("a.splice(2, 0, 'foo')");
+    }
+
+    @Test
+    public void testArraySortOn()
+    {
+        IBinaryOperatorNode node = getBinaryNode("var a:Array = new Array(); a.sortOn('foo')");
+        IFunctionCallNode parentNode = (IFunctionCallNode)(node.getParent());
+        asBlockWalker.visitFunctionCall(parentNode);
+        assertOut("org.apache.flex.utils.Language.sortOn(a, 'foo')");
+    }
+
+    @Test
+    public void testArraySortOnTwoArgs()
+    {
+        IBinaryOperatorNode node = getBinaryNode("var a:Array = new Array(); a.sortOn('foo', 10)");
+        IFunctionCallNode parentNode = (IFunctionCallNode)(node.getParent());
+        asBlockWalker.visitFunctionCall(parentNode);
+        assertOut("org.apache.flex.utils.Language.sortOn(a, 'foo', 10)");
+    }
+
+    @Test
+    public void testIntConstMaxValue()
+    {
+        IVariableNode node = getVariable("var a:Number = int.MAX_VALUE");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = 2147483648");
+    }
+
+    @Test
+    public void testIntConstMinValue()
+    {
+        IVariableNode node = getVariable("var a:Number = int.MIN_VALUE");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = -2147483648");
+    }
+
+    @Test
+    public void testUintConstMaxValue()
+    {
+        IVariableNode node = getVariable("var a:Number = uint.MAX_VALUE");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = 4294967295");
+    }
+
+    @Test
+    public void testUintConstMinValue()
+    {
+        IVariableNode node = getVariable("var a:Number = uint.MIN_VALUE");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = 0");
+    }
+
+    @Test
+    public void testDateGetMinutes()
+    {
+        IVariableNode node = getVariable("var a:Date = new Date(); var b:Number = a.minutes");
+        node = (IVariableNode)(node.getParent().getChild(1));
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ b = a.getMinutes()");
+    }
+
+    @Test
+    public void testDateSetMinutes()
+    {
+    	IBinaryOperatorNode node = getBinaryNode("var a:Date = new Date(); a.minutes = 10");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a.setMinutes(10, a.getSeconds(), a.getMilliseconds())");
+    }
+
+    @Test
+    public void testDateGetMinutesMethod()
+    {
+        IVariableNode node = getVariable("var a:Date = new Date(); var b:Number = a.getMinutes()");
+        node = (IVariableNode)(node.getParent().getChild(1));
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ b = a.getMinutes()");
+    }
+    
+    @Test
+    public void testDateSetMinutesMethod()
+    {
+    	IBinaryOperatorNode node = getBinaryNode("var a:Date = new Date(); a.setMinutes(10, 0, 0)");
+    	IFunctionCallNode parentNode = (IFunctionCallNode)(node.getParent());
+        asBlockWalker.visitFunctionCall(parentNode);
+        assertOut("a.setMinutes(10, 0, 0)");
+    }
+
+    @Override
+    @Test
+    public void testVector()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = new Vector.<String>(['Hello', 'World']);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = new Array(['Hello', 'World'])");
+    }
+
+    @Test
+    public void testVectorLiteral_1()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = new <String>[];");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = []");
+    }
+
+    @Test
+    public void testVectorLiteral_2()
+    {
+        IVariableNode node = getVariable("var a:Vector.<int> = new <int>[0, 1, 2, 3];");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = [0, 1, 2, 3]");
+    }
+
+    @Test
+    public void testVectorLiteral_3()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = new <String>[\"one\", \"two\", \"three\";");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = [\"one\", \"two\", \"three\"]");
+    }
+    
+    @Test
+    public void testVectorNoArgs()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = new Vector.<String>();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = new Array()");
+    }
+
+    @Test
+    public void testVectorStringArgs()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = new Vector.<String>('Hello', 'World');");
+        asBlockWalker.visitVariable(node);
+        // expected error?
+        assertOut("var /** @type {Array} */ a = new Array('Hello', 'World')");
+    }
+
+    @Test
+    public void testVectorStringArgs3()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = new Vector.<String>('Hello', 'World', 'Three');");
+        asBlockWalker.visitVariable(node);
+        // expected error?
+        assertOut("var /** @type {Array} */ a = new Array('Hello', 'World', 'Three')");
+    }
+
+    @Test
+    public void testVectorSizeArg()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = new Vector.<String>(30);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = new Array(30)");
+    }
+
+    @Test
+    public void testVectorNumberArgs()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = new Vector.<String>(30, 40);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = new Array(30, 40)");
+    }
+
+    @Test
+    public void testVectorArrayArg()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = new Vector.<String>(['Hello', 'World']);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = new Array(['Hello', 'World'])");
+    }
+
+    @Test
+    public void testXML()
+    {
+        IVariableNode node = getVariable("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {XML} */ a = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\")");
+    }
+    
+    @Test
+    public void testXMLLiteral()
+    {
+        IVariableNode node = getVariable("var a:XML = <top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {XML} */ a = new XML( \"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\") ");
+    }
+    
+    @Test
+    public void testXMLLiteralWithTemplate()
+    {
+        VariableNode node = (VariableNode)getNode("private function get tagname():String { return 'name'; };\n" +
+        							 "private function get attributename():String { return 'id'; };\n" +
+        							 "private function get attributevalue():Number { return 5; };\n" +
+        							 "private function get content():String { return 'Fred'; };\n" +
+        							 "private function test() { var a:XML = <{tagname} {attributename}={attributevalue}>{content}</{tagname}>;}",
+        							 VariableNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {XML} */ a = new XML( '<' + this.tagname + ' ' + this.attributename + '=' + this.attributevalue + '>' + this.content + '</' + this.tagname + '>') ");
+    }
+    
+    @Test
+    public void testXMLLiteralAsParam()
+    {
+        IFunctionCallNode node = (IFunctionCallNode)getNode("var a:XML; a.appendChild(<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>)",
+        		IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("a.appendChild(new XML( \"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\") )");
+    }
+    
+    @Test
+    public void testXMLLiteralInReassign()
+    {
+    	IBinaryOperatorNode node = getBinaryNode("var a:XML = <foo />; a = <top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>)");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a = new XML( \"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\") ");
+    }
+    
+    @Test
+    public void testXMLSingleDot()
+    {
+        IVariableNode node = getVariable("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");var b:XMLList = a.child;");
+        IASNode parentNode = node.getParent();
+        node = (IVariableNode) parentNode.getChild(1);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {XMLList} */ b = a.child('child')");
+    }
+    
+    @Test
+    public void testXMLSingleDotChain()
+    {
+        IVariableNode node = getVariable("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");var b:XMLList = a.child.grandchild;");
+        IASNode parentNode = node.getParent();
+        node = (IVariableNode) parentNode.getChild(1);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {XMLList} */ b = a.child('child').child('grandchild')");
+    }
+    
+    @Test
+    public void testXMLDelete()
+    {
+        IUnaryOperatorNode node = getUnaryNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");delete a.child;");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("a.removeChild('child')");
+    }
+    
+    @Test
+    public void testXMLDeleteChain()
+    {
+        IUnaryOperatorNode node = getUnaryNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");delete a.child.grandchild;");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("a.child('child').removeChild('grandchild')");
+    }
+
+    @Test
+    public void testXMLDeleteObjChain()
+    {
+        IUnaryOperatorNode node = getUnaryNode("public var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");private function foo() { delete this.a.child.grandchild;}",
+        		WRAP_LEVEL_CLASS);
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("this.a.child('child').removeChild('grandchild')");
+    }
+    
+    @Test
+    public void testXMLDeleteCastChain()
+    {
+        IUnaryOperatorNode node = getUnaryNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");var b:Object = { xml: a};delete XML(b.xml).child.grandchild;");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("org.apache.flex.utils.Language.as(b.xml, XML, true).child('child').removeChild('grandchild')");
+    }
+    
+    @Test
+    public void testXMLDeleteCastAsChain()
+    {
+        IUnaryOperatorNode node = getUnaryNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");var b:Object = { xml: a};delete (b.xml as XML).child.grandchild;");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("org.apache.flex.utils.Language.as(b.xml, XML).child('child').removeChild('grandchild')");
+    }    
+
+    @Test
+    public void testXMLListDelete()
+    {
+        IUnaryOperatorNode node = getUnaryNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");delete a.child[0];");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("a.child('child').removeChildAt(0)");
+    }
+    
+    @Test
+    public void testXMLListChain()
+    {
+        IUnaryOperatorNode node = getUnaryNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");delete a.child.grandchild[0];");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("a.child('child').child('grandchild').removeChildAt(0)");
+    }
+    
+    @Test
+    public void testXMLListObjChain()
+    {
+        IUnaryOperatorNode node = getUnaryNode("public var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");private function foo() { delete this.a.child.grandchild[0];}",
+        		WRAP_LEVEL_CLASS);
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("this.a.child('child').child('grandchild').removeChildAt(0)");
+    }
+    
+    @Test
+    public void testXMLListCastChain()
+    {
+        IUnaryOperatorNode node = getUnaryNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");var b:Object = { xml: a};delete XML(b.xml).child.grandchild[0];");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("org.apache.flex.utils.Language.as(b.xml, XML, true).child('child').child('grandchild').removeChildAt(0)");
+    }
+    
+    @Test
+    public void testXMLListAsCastChain()
+    {
+        IUnaryOperatorNode node = getUnaryNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");var b:Object = { xml: a};delete (b.xml as XML).child.grandchild[0];");
+        asBlockWalker.visitUnaryOperator(node);
+        assertOut("org.apache.flex.utils.Language.as(b.xml, XML).child('child').child('grandchild').removeChildAt(0)");
+    }
+    
+    @Test
+    public void testXMLNameFunction()
+    {
+    	IVariableNode node = getVariable("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");var b:String = a.name();");
+        IASNode parentNode = node.getParent();
+        node = (IVariableNode) parentNode.getChild(1);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {string} */ b = a.name()");
+    }
+    
+    @Test
+    public void testXMLListLengthFunction()
+    {
+    	IVariableNode node = getVariable("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");var b:int = a.child.length();");
+        IASNode parentNode = node.getParent();
+        node = (IVariableNode) parentNode.getChild(1);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ b = a.child('child').length()");
+    }
+    
+    @Test
+    public void testXMLDoubleDot()
+    {
+        IVariableNode node = getVariable("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");var b:XMLList = a..child;");
+        IASNode parentNode = node.getParent();
+        node = (IVariableNode) parentNode.getChild(1);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {XMLList} */ b = a.descendants('child')");
+    }
+    
+    @Test
+    public void testXMLAttribute()
+    {
+        IVariableNode node = getVariable("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");var b:XMLList = a.@attr1;");
+        IASNode parentNode = node.getParent();
+        node = (IVariableNode) parentNode.getChild(1);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {XMLList} */ b = a.attribute('attr1')");
+    }
+    
+    @Test
+    public void testXMLFilter()
+    {
+        IVariableNode node = getVariable("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");var b:XMLList = a..grandchild.(@attr2 == 'fish');");
+        IASNode parentNode = node.getParent();
+        node = (IVariableNode) parentNode.getChild(1);
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {XMLList} */ b = a.descendants('grandchild').filter(function(node){return (node.attribute('attr2') == 'fish')})");
+    }
+    
+    @Test
+    public void testXMLSetAttribute()
+    {
+        IBinaryOperatorNode node = getBinaryNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");a.@bar = 'foo'");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a.setAttribute('bar', 'foo')");
+    }
+    
+    @Test
+    public void testXMLSetChild()
+    {
+        IBinaryOperatorNode node = getBinaryNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");a.foo = a.child");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a.setChild('foo', a.child('child'))");
+    }
+    
+    @Test
+    public void testXMLListConcat()
+    {
+        IBinaryOperatorNode node = getBinaryNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");a.foo += a.child");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a.child('foo').concat(a.child('child'))");
+    }
+    
+    @Test
+    public void testXMLListAddAndAssign()
+    {
+        IBinaryOperatorNode node = getBinaryNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");a.foo = a.child + a..grandchild");
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("a.setChild('foo', a.child('child').copy().concat(a.descendants('grandchild')))");
+    }
+    
+    @Test
+    public void testXMLForLoop()
+    {
+        IForLoopNode node = getForLoopNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");for (var p:* in a) delete a[p];");
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {*} */ p in a.elementNames())\n  a.removeChild(p);");
+    }
+    
+    @Test
+    public void testXMLForEachLoop()
+    {
+    	IForLoopNode node = getForLoopNode("var a:XML = new XML(\"<top attr1='cat'><child attr2='dog'><grandchild attr3='fish'>text</grandchild></child></top>\");for each (var p:XMLList in a) var i:int = p.length();");
+        asBlockWalker.visitForLoop(node);
+        assertOut("var foreachiter0_target = a;\nfor (var foreachiter0 in foreachiter0_target.elementNames()) \n{\nvar p = foreachiter0_target.child(foreachiter0);\n\n  var /** @type {number} */ i = p.length();}\n");
+    }
+    
+    @Test
+    public void testNamespaceNoArg()
+    {
+        IVariableNode node = getVariable("var a:Namespace = new Namespace();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Namespace} */ a = new Namespace()");
+    }
+    
+    @Test
+    public void testNamespaceOneArg()
+    {
+        IVariableNode node = getVariable("var a:Namespace = new Namespace('foo');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Namespace} */ a = new Namespace('foo')");
+    }
+    
+    @Test
+    public void testNamespaceTwoArg()
+    {
+        IVariableNode node = getVariable("var a:Namespace = new Namespace('foo', 'bar');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Namespace} */ a = new Namespace('foo', 'bar')");
+    }
+        
+    @Test
+    public void testQNameNoArg()
+    {
+        IVariableNode node = getVariable("var a:QName = new QName();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {QName} */ a = new QName()");
+    }
+    
+    @Test
+    public void testQNameTwoArg()
+    {
+        IVariableNode node = getVariable("var a:QName = new QName(new Namespace('foo'), 'bar');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {QName} */ a = new QName(new Namespace('foo'), 'bar')");
+    }
+
+    @Test
+    public void testQNameOneArg()
+    {
+        IVariableNode node = getVariable("var a:QName = new QName(new QName(new Namespace('foo'), 'bar'));");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {QName} */ a = new QName(new QName(new Namespace('foo'), 'bar'))");
+    }
+    
+    
+    @Test
+    public void testProxy()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "import flash.utils.Proxy; public class B {public function b() { var a:Proxy = new Proxy();a.foo = 'bar'; }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nfoo.bar.B.prototype.b = function() {\n  var /** @type {flash.utils.Proxy} */ a = new flash.utils.Proxy();\n  a.setProperty('foo', 'bar');\n}");
+    }
+    
+    @Test
+    public void testProxyGet()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "import flash.utils.Proxy; public class B {public function b() { var a:Proxy = new Proxy();var bar:* = a.foo; }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nfoo.bar.B.prototype.b = function() {\n  var /** @type {flash.utils.Proxy} */ a = new flash.utils.Proxy();\n  var /** @type {*} */ bar = a.getProperty('foo');\n}");
+    }
+    
+    @Test
+    public void testProxyConcat()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "import flash.utils.Proxy; public class B {public function b() { var a:Proxy = new Proxy();var baz:String = a.foo + 'bar'; }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nfoo.bar.B.prototype.b = function() {\n  var /** @type {flash.utils.Proxy} */ a = new flash.utils.Proxy();\n  var /** @type {string} */ baz = a.getProperty('foo') + 'bar';\n}");
+    }
+    
+    @Test
+    public void testProxyAddAndAssign()
+    {
+        IFunctionNode node = (IFunctionNode) getNode(
+                "import flash.utils.Proxy; public class B {public function b() { var a:Proxy = new Proxy();a.foo += 'bar'; }}",
+                IFunctionNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n */\nfoo.bar.B.prototype.b = function() {\n  var /** @type {flash.utils.Proxy} */ a = new flash.utils.Proxy();\n  a.setProperty('foo', a.getProperty('foo') + 'bar');\n}");
+    }
+    
+    @Test
+    public void testProxyForLoop()
+    {
+    	IForLoopNode node = (IForLoopNode) getNode(
+                "import flash.utils.Proxy; public class B {public function b() { var a:Proxy = new Proxy();for (var p:* in a) delete a[p];; }}",
+                IForLoopNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitForLoop(node);
+        assertOut("for (var /** @type {*} */ p in a.propertyNames())\n  a.deleteProperty(p);");
+    }
+    
+    @Test
+    public void testProxyForEachLoop()
+    {
+    	IForLoopNode node = (IForLoopNode) getNode(
+                "import flash.utils.Proxy; public class B {public function b() { var a:Proxy = new Proxy();for each (var p:String in a) var i:int = p.length; }}",
+                IForLoopNode.class, WRAP_LEVEL_PACKAGE, true);
+        asBlockWalker.visitForLoop(node);
+        assertOut("var foreachiter0_target = a;\nfor (var foreachiter0 in foreachiter0_target.propertyNames()) \n{\nvar p = foreachiter0_target.getProperty(foreachiter0);\n\n  var /** @type {number} */ i = p.length;}\n");
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalConstants.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalConstants.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalConstants.java
new file mode 100644
index 0000000..78e93cc
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalConstants.java
@@ -0,0 +1,75 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogGlobalConstants;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestFlexJSGlobalConstants extends TestGoogGlobalConstants
+{
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+
+    @Override
+    @Test
+    public void testInfinity()
+    {
+        IVariableNode node = getField("var a:Number = Infinity;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @type {number}\n */\nFalconTest_A.prototype.a = Infinity");
+    }
+
+    @Override
+    @Test
+    public void testNegativeInfinity()
+    {
+        IVariableNode node = getField("var a:Number = -Infinity;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @type {number}\n */\nFalconTest_A.prototype.a = -Infinity");
+    }
+
+    @Override
+    @Test
+    public void testNaN()
+    {
+        IVariableNode node = getField("var a:Number = NaN;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @type {number}\n */\nFalconTest_A.prototype.a = NaN");
+    }
+
+    @Override
+    @Test
+    public void testUndefined()
+    {
+        IVariableNode node = getField("var a:* = undefined;");
+        asBlockWalker.visitVariable(node);
+        assertOut("/**\n * @export\n * @type {*}\n */\nFalconTest_A.prototype.a = undefined");
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java
new file mode 100644
index 0000000..f1be070
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java
@@ -0,0 +1,238 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogGlobalFunctions;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.tree.as.IBinaryOperatorNode;
+import org.apache.flex.compiler.tree.as.IFunctionCallNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestFlexJSGlobalFunctions extends TestGoogGlobalFunctions
+{
+    @Override
+    @Test
+    public void testArray()
+    {
+        IVariableNode node = getVariable("var a:Array = Array(1);");
+        asBlockWalker.visitVariable(node);
+        // (erikdebruin) The Actionscript and JavaScript implementations of
+        //               Array are identical in this regard, Array() can be
+        //               called as a function (without new) and if the argument
+        //               is a single integer, an Array with that length is 
+        //               returned:
+        //
+        //               https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
+        //
+        assertOut("var /** @type {Array} */ a = Array(1)");
+    }
+    
+    @Test
+    public void testArrayNoArgs()
+    {
+        IVariableNode node = getVariable("var a:Array = Array();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = Array()");
+    }
+
+    @Test
+    public void testArrayStringArgs()
+    {
+        IVariableNode node = getVariable("var a:Array = Array('Hello', 'World');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = Array('Hello', 'World')");
+    }
+
+    @Test
+    public void testArraySizeArg()
+    {
+        IVariableNode node = getVariable("var a:Array = Array(30);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = Array(30)");
+    }
+
+    @Test
+    public void testArrayNumberArgs()
+    {
+        IVariableNode node = getVariable("var a:Array = Array(30, 40);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = Array(30, 40)");
+    }
+
+    @Test
+    public void testArrayArrayArg()
+    {
+        IVariableNode node = getVariable("var a:Array = Array(['Hello', 'World']);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = Array(['Hello', 'World'])");
+    }
+
+    @Test
+    public void testParseInt()
+    {
+        IVariableNode node = getVariable("var a:int = parseInt('1.8');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = parseInt('1.8', 10)");
+    }
+
+    @Test
+    public void testParseIntTwoArgs()
+    {
+        IVariableNode node = getVariable("var a:int = parseInt('1.8', 16);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = parseInt('1.8', 16)");
+    }
+
+    @Override
+    @Test
+    public void testInt()
+    {
+        IVariableNode node = getVariable("var a:int = int(1.8);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = org.apache.flex.utils.Language._int(1.8)");
+    }
+
+    @Override
+    @Test
+    public void testTrace()
+    {
+        IFunctionCallNode node = (IFunctionCallNode) getNode(
+                "trace('Hello World');", IFunctionCallNode.class);
+        asBlockWalker.visitFunctionCall(node);
+        assertOut("org.apache.flex.utils.Language.trace('Hello World')");
+    }
+
+    @Override
+    @Test
+    public void testUint()
+    {
+        IVariableNode node = getVariable("var a:uint = uint(-100);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {number} */ a = org.apache.flex.utils.Language.uint(-100)");
+    }
+
+    @Override
+    @Test
+    public void testVector()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = Vector.<String>(['Hello', 'World']);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = ['Hello', 'World'].slice()");
+    }
+
+    @Ignore
+    public void testVectorNoArgs()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = Vector.<String>();");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = Array()");
+    }
+
+    @Ignore
+    public void testVectorStringArgs()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = Vector.<String>('Hello', 'World');");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = Array('Hello', 'World')");
+    }
+
+    @Ignore
+    public void testVectorSizeArg()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = Vector.<String>(30);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = Array(30)");
+    }
+
+    @Ignore
+    public void testVectorNumberArgs()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = Vector.<String>(30, 40);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = Array(30, 40)");
+    }
+
+    @Test
+    public void testVectorArrayArg()
+    {
+        IVariableNode node = getVariable("var a:Vector.<String> = Vector.<String>(['Hello', 'World']);");
+        asBlockWalker.visitVariable(node);
+        assertOut("var /** @type {Array} */ a = ['Hello', 'World'].slice()");
+    }
+
+    @Ignore
+    @Override
+    @Test
+    public void testXML()
+    {
+        IVariableNode node = getVariable("var a:XML = XML('@');");
+        asBlockWalker.visitVariable(node);
+        // TODO (aharui) claims this is not valid and someday needs to result in:
+        //     <@/>  or something like that?
+        // I cannot find any reference to creating an XML object via a
+        // global function
+        
+        // (erikdebruin) E4X in Javascript is obsolete.
+        //               Ref.: https://developer.mozilla.org/en-US/docs/E4X
+        
+        assertOut("var /** @type {XML} */ a = XML('@')");
+    }
+
+    @Ignore
+    @Override
+    @Test
+    public void testXMLList()
+    {
+        IVariableNode node = getVariable("var a:XMLList = XMLList('<!-- comment -->');");
+        asBlockWalker.visitVariable(node);
+        // TODO (aharui) claims this is not valid and someday needs to result in:
+        //     <@/>  or something like that?
+        // I cannot find any reference to creating an XML object via a
+        // global function
+
+        // (erikdebruin) E4X in Javascript is obsolete.
+        //               Ref.: https://developer.mozilla.org/en-US/docs/E4X
+        
+        assertOut("var /** @type {XMLList} */ a = XMLList('<!-- comment -->')");
+    }
+
+    @Test
+    public void testGlobalFunctionInClass()
+    {
+        IBinaryOperatorNode node = (IBinaryOperatorNode) getNode(
+                "public class B {public function b():String { var s:String; s = encodeURIComponent('foo'); return s;}",
+                IBinaryOperatorNode.class, WRAP_LEVEL_PACKAGE);
+        asBlockWalker.visitBinaryOperator(node);
+        assertOut("s = encodeURIComponent('foo')");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
new file mode 100644
index 0000000..bacd034
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSInterface.java
@@ -0,0 +1,78 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogInterface;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.tree.as.IInterfaceNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid 'goog' JS code for Interface
+ * production.
+ * 
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class TestFlexJSInterface extends TestGoogInterface
+{
+
+    @Override
+    @Test
+    public void testAccessors()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA {"
+                + "function get foo1():Object;"
+                + "function set foo1(value:Object):void;}");
+        asBlockWalker.visitInterface(node);
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n/**  * @type {Object}\n */IA.prototype.foo1;");
+    }
+
+    @Override
+    @Test
+    public void testMethods()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA {"
+                + "function baz1():Object;"
+                + "function baz2(value:Object):void;}");
+        asBlockWalker.visitInterface(node);
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\nIA.prototype.baz1 = function() {\n};\nIA.prototype.baz2 = function(value) {\n};");
+    }
+
+    @Override
+    @Test
+    public void testAccessorsMethods()
+    {
+        IInterfaceNode node = getInterfaceNode("public interface IA {"
+                + "function get foo1():Object;"
+                + "function set foo1(value:Object):void;"
+                + "function baz1():Object;"
+                + "function baz2(value:Object):void;}");
+        asBlockWalker.visitInterface(node);
+        assertOut("/**\n * @interface\n */\nIA = function() {\n};\n/**  * @type {Object}\n */IA.prototype.foo1;\nIA.prototype.baz1 = function() {\n};\nIA.prototype.baz2 = function(value) {\n};");
+    }
+
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c3dce49f/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSMethodMembers.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSMethodMembers.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSMethodMembers.java
new file mode 100644
index 0000000..5f6256d
--- /dev/null
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSMethodMembers.java
@@ -0,0 +1,207 @@
+/*
+ *
+ *  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.internal.codegen.js.flexjs;
+
+import org.apache.flex.compiler.driver.IBackend;
+import org.apache.flex.compiler.internal.codegen.js.goog.TestGoogMethodMembers;
+import org.apache.flex.compiler.internal.driver.js.flexjs.FlexJSBackend;
+import org.apache.flex.compiler.tree.as.IClassNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.junit.Test;
+
+/**
+ * @author Erik de Bruin
+ */
+public class TestFlexJSMethodMembers extends TestGoogMethodMembers
+{
+
+    @Override
+    @Test
+    public void testMethod_withReturnType()
+    {
+        IFunctionNode node = getMethod("function foo():int{  return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @return {number}\n */\nFalconTest_A.prototype.foo = function() {\n  return -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withParameterReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar):int{  return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {*} bar\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar) {\n  return -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withParameterTypeReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar:String):int{  return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {string} bar\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar) {\n  return -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withDefaultParameterTypeReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar:String = \"baz\"):int{  return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {string=} bar\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar) {\n  bar = typeof bar !== 'undefined' ? bar : \"baz\";\n  return -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withMultipleDefaultParameterTypeReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar:String, baz:int = null):int{  return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {string} bar\n * @param {number=} baz\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar, baz) {\n  baz = typeof baz !== 'undefined' ? baz : null;\n  return -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withRestParameterTypeReturnType()
+    {
+        IFunctionNode node = getMethod("function foo(bar:String, ...rest):int{  return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {string} bar\n * @param {...} rest\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar, rest) {\n  rest = Array.prototype.slice.call(arguments, 1);\n  return -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withNamespaceCustom()
+    {
+        IFunctionNode node = getMethod("mx_internal function foo(bar:String, baz:int = null):int{  return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @param {string} bar\n * @param {number=} baz\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar, baz) {\n  baz = typeof baz !== 'undefined' ? baz : null;\n  return -1;\n}");
+    }
+
+    //--------------------------------------------------------------------------
+    // Doc Specific Tests 
+    //--------------------------------------------------------------------------
+
+    @Override
+    @Test
+    public void testConstructor_withThisInBody()
+    {
+        IClassNode node = (IClassNode) getNode("public function FalconTest_A(){this.foo();}; private function foo():String{return '';};", IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n  this.foo();\n};\n\n\n/**\n * @private\n * @return {string}\n */\nFalconTest_A.prototype.foo = function() {\n  return '';\n};");
+    }
+
+    @Test
+    public void testConstructor_withImplicitThisInBody()
+    {
+        IClassNode node = (IClassNode) getNode("public function FalconTest_A(){foo();}; private function foo():String{return '';};", IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n  this.foo();\n};\n\n\n/**\n * @private\n * @return {string}\n */\nFalconTest_A.prototype.foo = function() {\n  return '';\n};");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withThisInBody()
+    {
+        IClassNode node = (IClassNode) getNode("public function FalconTest_A(){}; private var baz:String; private function foo():String{return this.baz;};", IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+         assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n * @private\n * @type {string}\n */\nFalconTest_A.prototype.baz;\n\n\n/**\n * @private\n * @return {string}\n */\nFalconTest_A.prototype.foo = function() {\n  return this.baz;\n};");
+    }
+
+    @Test
+    public void testMethod_withImplicitThisInBody()
+    {
+        IClassNode node = (IClassNode) getNode("public function FalconTest_A(){}; private var baz:String; private function foo():String{return baz;};", IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+         assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n * @private\n * @type {string}\n */\nFalconTest_A.prototype.baz;\n\n\n/**\n * @private\n * @return {string}\n */\nFalconTest_A.prototype.foo = function() {\n  return this.baz;\n};");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withThisInBodyComplex()
+    {
+        IClassNode node = (IClassNode) getNode("public function FalconTest_A(){}; private function foo(value:int):String{return value;}; private function bar():String{if(true){while(i){return this.foo(42);}}};", IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n * @private\n * @param {number} value\n * @return {string}\n */\nFalconTest_A.prototype.foo = function(value) {\n  return value;\n};\n\n\n/**\n * @private\n * @return {string}\n */\nFalconTest_A.prototype.bar = function() {\n  if (true) {\n    while (i) {\n      return this.foo(42);\n    }\n  }\n};");
+    }
+
+    @Test
+    public void testMethod_withImplicitThisInBodyComplex()
+    {
+        IClassNode node = (IClassNode) getNode("public function FalconTest_A(){}; private function foo(value:int):String{return value;}; private function bar():void{if(true){while(i){foo(42);}}};", IClassNode.class, WRAP_LEVEL_CLASS);
+        asBlockWalker.visitClass(node);
+        assertOut("/**\n * @constructor\n */\nFalconTest_A = function() {\n};\n\n\n/**\n * @private\n * @param {number} value\n * @return {string}\n */\nFalconTest_A.prototype.foo = function(value) {\n  return value;\n};\n\n\n/**\n * @private\n */\nFalconTest_A.prototype.bar = function() {\n  if (true) {\n    while (i) {\n      this.foo(42);\n    }\n  }\n};");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withNamespace()
+    {
+        IFunctionNode node = getMethod("public function foo(bar:String, baz:int = null):int{  return -1;}");
+        asBlockWalker.visitFunction(node);
+        // we ignore the 'public' namespace completely
+        assertOut("/**\n * @export\n * @param {string} bar\n * @param {number=} baz\n * @return {number}\n */\nFalconTest_A.prototype.foo = function(bar, baz) {\n  baz = typeof baz !== 'undefined' ? baz : null;\n  return -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withNamespaceModifiers()
+    {
+        IFunctionNode node = getMethod("public static function foo(bar:String, baz:int = null):int{  return -1;}");
+        asBlockWalker.visitFunction(node);
+        // (erikdebruin) here we actually DO want to declare the method
+        //               directly on the 'class' constructor instead of the
+        //               prototype!
+        assertOut("/**\n * @export\n * @param {string} bar\n * @param {number=} baz\n * @return {number}\n */\nFalconTest_A.foo = function(bar, baz) {\n  baz = typeof baz !== 'undefined' ? baz : null;\n  return -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withNamespaceModifierOverride()
+    {
+        IFunctionNode node = getMethod("public override function foo(bar:String, baz:int = null):int{  return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n * @override\n */\nFalconTest_A.prototype.foo = function(bar, baz) {\n  baz = typeof baz !== 'undefined' ? baz : null;\n  return -1;\n}");
+    }
+
+    @Override
+    @Test
+    public void testMethod_withNamespaceModifierOverrideBackwards()
+    {
+        IFunctionNode node = getMethod("override public function foo(bar:String, baz:int = null):int{return -1;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n * @override\n */\nFalconTest_A.prototype.foo = function(bar, baz) {\n  baz = typeof baz !== 'undefined' ? baz : null;\n  return -1;\n}");
+    }
+
+    @Test
+    public void testMethod_withConstDeclaration()
+    {
+        IFunctionNode node = getMethod("public function foo():String{const A:String = 'Hello World'; return A;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @export\n * @return {string}\n */\nFalconTest_A.prototype.foo = function() {\n  \n/**\n * @const\n * @type {string}\n */\nvar A = 'Hello World';\n  return A;\n}");
+    }
+
+    @Override
+    protected IBackend createBackend()
+    {
+        return new FlexJSBackend();
+    }
+    
+}