Package org.apache.flex.compiler.units

Examples of org.apache.flex.compiler.units.ICompilationUnit


                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);
            }
View Full Code Here


                    continue;

                String packageName = classDefinition.getPackageName();
                String key = packageName.replaceAll("\\.", "/") + "/" + iconFilePath;

                ICompilationUnit cu = project.getScope().getCompilationUnitForDefinition(classDefinition);
                IBinaryFileSpecification fileSpec = null;
                if (cu.getCompilationUnitType() == UnitType.SWC_UNIT)
                {
                    ISWC swc = project.getWorkspace().getSWCManager().get(new File(cu.getAbsoluteFilename()));
                    ISWCFileEntry swcFileEntry = swc.getFile(key);
                    fileSpec = new SWCFileSpecification(key, swcFileEntry);
                }
                else
                {
View Full Code Here

            String bundleName = node.getBundleName();
            String key = node.getKey();
            if(bundleName != null && key != null)
            {
                //compilation unit of the file that has the compiler directive
                final ICompilationUnit refCompUnit = project.getScope(
                ).getCompilationUnitForScope(((NodeBase)node).getASScope());
                assert refCompUnit != null;

                ResourceBundleUtils.resolveDependencies(bundleName, refCompUnit, project, node, getProblems());
            }
View Full Code Here

            final FlexProject flexProject = (FlexProject)getProject();
           
            //flex.compiler.support.ResourceModuleBase
            ASProjectScope scope = flexProject.getScope();
            IDefinition def = scope.findDefinitionByName(flexProject.getResourceModuleBaseClass());
            ICompilationUnit resourceModuleBaseCompUnit = scope.getCompilationUnitForDefinition(def);
            flexProject.addDependency(this, resourceModuleBaseCompUnit, DependencyType.INHERITANCE,
                    def.getQualifiedName());
           
            //Add dependency to all the resource bundle compilation units we want to
            //include in the resource module SWF
View Full Code Here

                                .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,
View Full Code Here

    {
        final ImmutableSet.Builder<ICompilationUnit> builder = new ImmutableSet.Builder<ICompilationUnit>();
        for (final IClassDefinition classDefinition : classDefinitions)
        {
            final ASProjectScope scope = flexProject.getScope();
            final ICompilationUnit compilationUnit = scope.getCompilationUnitForDefinition(classDefinition);
            if (compilationUnit != null)
                builder.add(compilationUnit);
            else
                assert problemCreatedForUnresolvedClassReference(problems, classDefinition) : "Can't find compilation unit for class '" + classDefinition.getQualifiedName() + "'. Expected a 'CSSUnresolvedClassReference'.";
        }
View Full Code Here

                builtinType != IASLanguageConstants.BuiltinType.ANY_TYPE &&
                builtinType != IASLanguageConstants.BuiltinType.VOID)
        {
            ASProjectScope projectScope = project.getScope();

            ICompilationUnit from = projectScope.getCompilationUnitForScope(this);
            ICompilationUnit to = projectScope.getCompilationUnitForDefinition(definition);

            String qname = definition.getQualifiedName();
            project.addDependency(from, to, dependencyType, qname);
        }
    }
View Full Code Here

        // if this class extends another, add a dependency on this compilation unit to the class that it extends
        if (embedData.generatedClassExtendsAnother())
        {
            ASProjectScope projectScope = getProject().getScope();
            IDefinition[] defs = projectScope.findAllDefinitionsByName(Multiname.crackDottedQName(getProject(), embedData.getTranscoder().getBaseClassQName()));
            ICompilationUnit referencedCU = projectScope.getCompilationUnitForScope(defs[0].getContainingScope());
            getProject().addDependency(this, referencedCU, DependencyType.INHERITANCE, defs[0].getQualifiedName());
        }
    }
View Full Code Here

            {
                String baseName = reference.getName();
                // use super.getDefinitionSetByName so we don't turn definition promises into
                // actual definitions.  Doing so would require parsing files which would be slow.
                IDefinitionSet definitionSet = super.getLocalDefinitionSetByName(baseName);
                ICompilationUnit cu = null;
                if (definitionSet != null)
                {
                    int n = definitionSet.getSize();
                    for (int i = 0; i < n; i++)
                    {
View Full Code Here

            {
                int n = definitionSet.getSize();
                for (int i = 0; i < n; i++)
                {
                    IDefinition definition = definitionSet.getDefinition(i);
                    ICompilationUnit compilationUnit;
                    if (definition instanceof DefinitionPromise)
                    {
                        compilationUnit = ((DefinitionPromise)definition).getCompilationUnit();
                    }
                    else
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.units.ICompilationUnit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.