Package org.apache.flex.compiler.units

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


            return ModuleFactoryInfo.create(Collections.<ICompilerProblem>emptyList()); // TODO make a compiler problem here!
       
        final ClassDefinition moduleFactoryBaseClass =
            (ClassDefinition)moduleFactoryBaseClassDef;
       
        final ICompilationUnit moduleFactoryBaseClassCompilationUnit =
            flexProject.getScope().getCompilationUnitForDefinition(moduleFactoryBaseClass);
        assert moduleFactoryBaseClassCompilationUnit != null : "Unable to find compilation unit for definition!";
       
        return ModuleFactoryInfo.create(getGeneratedModuleFactoryClassName(moduleFactoryBaseClass), moduleFactoryBaseClass, moduleFactoryBaseClassCompilationUnit);
    }
View Full Code Here


    {
        final IDefinition definition = referenceToResolve.resolve(flexProject);
        // TODO add a problem if definition is not found
        if (definition != null)
        {
            ICompilationUnit moduleFactoryCU = projectScope.getCompilationUnitForDefinition(definition);
            assert moduleFactoryCU != null : "Unable to get compilation unit for definition!";
            compilationUnits.add(moduleFactoryCU);
        }
    }
View Full Code Here

     * @return A new {@link SWFFrameInfo}.
     * @throws InterruptedException
     */
    private SWFFrameInfo createFrameInfoForGeneratedSystemManager(ClassDefinition factoryClass) throws InterruptedException
    {
        final ICompilationUnit factoryClassCompilationUnit = flexProject.getScope().getCompilationUnitForDefinition(factoryClass);
        assert factoryClassCompilationUnit != null :"Unable to find compilation unit for definiton!";
       
        final ImmutableSet.Builder<ICompilationUnit> compilationUnits =
            ImmutableSet.<ICompilationUnit>builder();
        final ImmutableList.Builder<ICompilerProblem> problems =
View Full Code Here

        final ImmutableList.Builder<ClassDefinition> classes =
            ImmutableList.<ClassDefinition>builder();
        final ImmutableList.Builder<ICompilerProblem> problems =
            ImmutableList.<ICompilerProblem>builder();
       
        ICompilationUnit rootClassCU = getRootClassCompilationUnit();
        assert rootClassCU != null : "Unable to find compilation unit for definiton!";
       
        compilationUnits.add(rootClassCU);
        classes.add(rootClassDefinition);
       
View Full Code Here

    {
        LinkedList<SWFFrameInfo> frames = new LinkedList<SWFFrameInfo>();
        ClassDefinition rootClassDef = getRootClassDefinition();
        assert rootClassDef != null : "If the root class can not be resolved, the build should be aborted before this point";
       
        ICompilationUnit rootClassCU = getRootClassCompilationUnit();
        assert rootClassCU != null :"Unable to find compilation unit for definiton!";
       
        final SWFFrameInfo applicationFrame =
            createFrameInfoForApplicationFrame(rootClassDef);
       
        frames.addFirst(applicationFrame);
       
        final ClassDefinition initialFactoryClass =
            rootClassDef.resolveInheritedFactoryClass(flexProject);
        ClassDefinition currentFrameClass = initialFactoryClass;
       
        SWFFrameInfo systemManagerFrame = null;
       
        final FlexDelegate delegate = getDelegate();
        if (delegate.getGenerateSystemManagerAndFlexInit())
        {
            final SWFFrameInfo frameInfo = createFrameInfoForGeneratedSystemManager(initialFactoryClass);
            systemManagerFrame = frameInfo;
            frames.addFirst(frameInfo);
            currentFrameClass = currentFrameClass.resolveInheritedFactoryClass(project);
        }
       
        while ((currentFrameClass != null) && (!currentFrameClass.isImplicit()))
        {
            ICompilationUnit currentFrameClassCompilationUnit = flexProject.getScope().getCompilationUnitForDefinition(currentFrameClass);
            assert currentFrameClassCompilationUnit != null :"Unable to find compilation unit for definiton!";
            final SWFFrameInfo frameInfo = new SWFFrameInfo(currentFrameClass.getQualifiedName(), SWFFrameInfo.EXTERNS_DISALLOWED,
                    Collections.<ICompilationUnit>singleton(currentFrameClassCompilationUnit),
                    Collections.<ICompilerProblem>emptyList());
            frames.addFirst(frameInfo);
View Full Code Here

    {
        final Iterable<ICompilerProblem> fatalProblemsFromSuper = super.computeFatalProblems();
        if (!Iterables.isEmpty(fatalProblemsFromSuper))
            return fatalProblemsFromSuper;
       
        final ICompilationUnit rootClassCompilationUnit = getRootClassCompilationUnit();
       
        Collection<ICompilerProblem> externallyVisibleDefinitionProblems =
            rootClassCompilationUnit.getFileScopeRequest().get().checkExternallyVisibleDefinitions(targetSettings.getRootClassName());
        assert (!externallyVisibleDefinitionProblems.isEmpty()) || checkRootDefinitionConsistency();
       
        return externallyVisibleDefinitionProblems;
    }
View Full Code Here

    private boolean checkRootDefinitionConsistency()
    {
        IDefinition rootClassDefinition = getRootClassDefinition();
        if (rootClassDefinition == null)
            return false;
        ICompilationUnit rootCompilationUnit = getRootClassCompilationUnit();
        ICompilationUnit rootClassCompilationUnit = project.getScope().getCompilationUnitForDefinition(rootClassDefinition);
        return rootCompilationUnit == rootClassCompilationUnit;
    }
View Full Code Here

        List<ICompilationUnit> unitsToAdd = new ArrayList<ICompilationUnit>();
        if (!newQNameFilesToCreate.isEmpty())
        {
            for (QNameFile qNameFile : newQNameFilesToCreate)
            {
                ICompilationUnit newCU =
                    compilerProject.getSourceCompilationUnitFactory().createCompilationUnit(
                        qNameFile.file, DefinitionPriority.BasePriority.SOURCE_PATH, qNameFile.order, qNameFile.qName, qNameFile.locale);
               
                //It can be null in some cases, see #ResourceBundleSourceFileHandler
                if(newCU != null)
View Full Code Here

            return false;

        List<ICompilationUnit> unitsToAdd = new ArrayList<ICompilationUnit>();
        for (QNameFile qNameFile : qNameFiles)
        {
            ICompilationUnit newCU =
                    compilerProject.getSourceCompilationUnitFactory().createCompilationUnit(
                            qNameFile.file, DefinitionPriority.BasePriority.SOURCE_PATH, qNameFile.order, qNameFile.qName, qNameFile.locale);
            if (newCU != null)
                unitsToAdd.add(newCU);
        }
View Full Code Here

            final Integer compatibilityVersion = flexProject.getCompatibilityVersion();
            if ((compatibilityVersion != null) && (compatibilityVersion < Configuration.MXML_VERSION_4_0))
                return;
           
            // Only validate root MXML compilation unit because only an application file can have type selectors.
            ICompilationUnit rootCompilationUnit = getRootClassCompilationUnit();
            if (rootCompilationUnit.getCompilationUnitType() != ICompilationUnit.UnitType.MXML_UNIT)
                return;
            final MXMLCompilationUnit rootMXMLCompilationUnit = (MXMLCompilationUnit)rootCompilationUnit;
               
            // Only validate root MXML compilation unit because only an application file can have type selectors.
            final MXMLFileNode mxmlFileNode = (MXMLFileNode)rootMXMLCompilationUnit.getSyntaxTreeRequest().get().getAST();
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.