Package flex2.compiler

Examples of flex2.compiler.CompilationUnit


        if (ThreadLocalToolkit.errorCount() > 0)
        {
            return null;
        }

        CompilationUnit ascUnit = asc.parse1(transSource, symbolTable);

        if (ThreadLocalToolkit.errorCount() > 0)
        {
            return null;
        }

        flex2.compiler.CompilerContext context = new flex2.compiler.CompilerContext();
        context.setAttribute("ascUnit", ascUnit);
        context.setAttribute(CompilerContext.L10N_ARCHIVE_FILES, new HashMap());

        CompilationUnit unit = source.newCompilationUnit(null, context);

        // when building a SWC, we want to locate all the asset sources and ask compc to put them in the SWC.
        for (int i = 0, len = translations.length; i < len; i++)
        {
          if (translations[i] != null)
View Full Code Here


        if (benchmarkHelper != null)
        {
            benchmarkHelper.startPhase(CompilerBenchmarkHelper.PARSE2, unit.getSource().getNameForReporting());
        }

      CompilationUnit ascUnit = (CompilationUnit) unit.getContext().getAttribute("ascUnit");
      Source.transferInheritance(unit, ascUnit);

      asc.parse2(ascUnit, symbolTable);     

    Source.transferAssets(ascUnit, unit);
View Full Code Here

        if (benchmarkHelper != null)
        {
            benchmarkHelper.startPhase(CompilerBenchmarkHelper.ANALYZE1, unit.getSource().getNameForReporting());
        }
       
      CompilationUnit ascUnit = (CompilationUnit) unit.getContext().getAttribute("ascUnit");
      asc.analyze1(ascUnit, symbolTable);

      Source.transferTypeInfo(ascUnit, unit);
      Source.transferNamespaces(ascUnit, unit);
View Full Code Here

        if (benchmarkHelper != null)
        {
            benchmarkHelper.startPhase(CompilerBenchmarkHelper.ANALYZE2, unit.getSource().getNameForReporting());
        }

        CompilationUnit ascUnit = (CompilationUnit) unit.getContext().getAttribute("ascUnit");
        Source.transferDependencies(unit, ascUnit);
        asc.analyze2(ascUnit, symbolTable);
        Source.transferDependencies(ascUnit, unit);

        if (benchmarkHelper != null)
View Full Code Here

        if (benchmarkHelper != null)
        {
            benchmarkHelper.startPhase(CompilerBenchmarkHelper.ANALYZE3, unit.getSource().getNameForReporting());
        }

        CompilationUnit ascUnit = (CompilationUnit) unit.getContext().getAttribute("ascUnit");
        Source.transferDependencies(unit, ascUnit);
        asc.analyze3(ascUnit, symbolTable);

        if (benchmarkHelper != null)
        {
View Full Code Here

        if (benchmarkHelper != null)
        {
            benchmarkHelper.startPhase(CompilerBenchmarkHelper.ANALYZE4, unit.getSource().getNameForReporting());
        }

        CompilationUnit ascUnit = (CompilationUnit) unit.getContext().getAttribute("ascUnit");
        asc.analyze4(ascUnit, symbolTable);
        Source.transferExpressions(ascUnit, unit);
      // Source.transferLoaderClassBase(ascUnit, unit);
      // Source.transferGeneratedSources(ascUnit, unit);
      // Source.transferClassTable(ascUnit, unit);
View Full Code Here

        if (benchmarkHelper != null)
        {
            benchmarkHelper.startPhase(CompilerBenchmarkHelper.GENERATE, unit.getSource().getNameForReporting());
        }

        CompilationUnit ascUnit = (CompilationUnit) unit.getContext().getAttribute("ascUnit");
        asc.generate(ascUnit, symbolTable);

        unit.bytes.clear();
        unit.bytes.addAll(ascUnit.bytes);
View Full Code Here

    if (units != null)
    {
      data.swcDefSignatureChecksums = new HashMap<QName, Long>();
      for (Iterator iter = units.iterator(); iter.hasNext();)
      {
        CompilationUnit unit = (CompilationUnit)iter.next();
        Source source = unit == null ? null : unit.getSource();
        if (source != null && source.isSwcScriptOwner() && !source.isInternal())
        {
          addSignatureChecksumToData(data, unit);
        }
      }
View Full Code Here

    private static void addDependents(Source source,
                                      Set<QName> dependents,
                                      Map<QName, Source> qNameToSourceMap,
                                      Map<Name, Map<String, Source>> dependentMap)
    {
        CompilationUnit compilationUnit = source.getCompilationUnit();

        if (compilationUnit != null)
        {
            for (QName topLevelDefinition : compilationUnit.topLevelDefinitions)
            {
                Map<String, Source> topLevelDefinitionDependents = dependentMap.get(topLevelDefinition);

                if (topLevelDefinitionDependents != null)
                {
                    for (Source dependentSource : topLevelDefinitionDependents.values())
                    {
                        boolean foundNewDependent = false;
                        CompilationUnit dependentCompilationUnit = dependentSource.getCompilationUnit();

                        if (dependentCompilationUnit != null)
                        {
                            for (QName dependent : dependentCompilationUnit.topLevelDefinitions)
                            {
View Full Code Here

        Map<QName, Source> qNames = new HashMap<QName, Source>(sources.size());
        Map<Name, Map<String, Source>> dependentMap = new HashMap<Name, Map<String, Source>>(sources.size());

        for (Source source : this.sources.values())
        {
            CompilationUnit compilationUnit = source.getCompilationUnit();

            if (compilationUnit != null)
            {
                for (QName qName : compilationUnit.topLevelDefinitions)
                {
                    qNames.put(qName, source);
                }
            }
        }

        for (Source source : this.sources.values())
        {
            CompilationUnit compilationUnit = source.getCompilationUnit();

            if (compilationUnit != null)
            {
                for (Name name : compilationUnit.inheritance)
                {
View Full Code Here

TOP

Related Classes of flex2.compiler.CompilationUnit

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.