Package flex2.compiler

Examples of flex2.compiler.CompilationUnit


            Source source = entry.getValue();
            Source cachedSource = applicationCache.getSource(className);

            if ((cachedSource != null) && !cachedSource.isUpdated())
            {
                CompilationUnit compilationUnit = source.getCompilationUnit();
                VirtualFile pathRoot = source.getPathRoot();
                CompilationUnit cachedCompilationUnit = cachedSource.getCompilationUnit();
                VirtualFile cachedSourcePathRoot = cachedSource.getPathRoot();

                if ((((pathRoot == null) && (cachedSourcePathRoot == null)) ||
                     ((pathRoot != null) && pathRoot.equals(cachedSource.getPathRoot()))) &&
                    (compilationUnit != null) && !compilationUnit.hasTypeInfo &&
View Full Code Here


  private void processCompilationUnits(List<CompilationUnit> units, TreeSet<String> sourceNames,
                                         TreeSet<String> assetNames, TreeSet<String> libraryNames)
  {
    for (int i = 0, length = units == null ? 0 : units.size(); i < length; i++)
    {
      CompilationUnit u = units.get(i);
      Source s = (u == null) ? null : u.getSource();
     
      if (s == null)
      {
        continue;
      }
     
      if (s.isFileSpecOwner() || s.isSourceListOwner() || s.isSourcePathOwner() || s.isResourceBundlePathOwner())
      {
        sourceNames.add(s.getName());
       
        for (Iterator j = s.getFileIncludes(); j.hasNext(); )
        {
          VirtualFile f = (VirtualFile) j.next();
          sourceNames.add(f.getName());
        }

        if (u.hasAssets())
                {
                    for (Iterator j = u.getAssets().iterator(); j.hasNext(); )
                    {
                        Map.Entry e = (Map.Entry) j.next();
                        AssetInfo assetInfo = (AssetInfo) e.getValue();
                        VirtualFile path = assetInfo.getPath();
                        if (path != null)
View Full Code Here

  private void processSources(List<Source> sources, TreeSet<String> sourceNames, TreeSet<String> assetNames,
                                TreeSet<String> libraryNames, Map<String, Data> data, Map<String, String> locations)
  {
    for (Source s : sources)
    {
      CompilationUnit u = (s == null) ? null : s.getCompilationUnit();
     
      if (s == null)
      {
        continue;
      }
     
      if (s.isFileSpecOwner() || s.isSourceListOwner() || s.isSourcePathOwner() || s.isResourceBundlePathOwner())
      {
        sourceNames.add(s.getName());
       
        for (Iterator j = s.getFileIncludes(); j.hasNext(); )
        {
          VirtualFile f = (VirtualFile) j.next();
          sourceNames.add(f.getName());
        }

        if (u.hasAssets())
                {
                    for (Iterator j = u.getAssets().iterator(); j.hasNext(); )
                    {
                        Map.Entry e = (Map.Entry) j.next();
                        AssetInfo assetInfo = (AssetInfo) e.getValue();
                        VirtualFile path = assetInfo.getPath();
                        if (path != null)
                        {
                            assetNames.add(assetInfo.getPath().getName());
                        }
                    }
                }

        if (locations != null)
        {
          for (int j = 0, size = u.topLevelDefinitions.size(); j < size; j++)
          {
            locations.put(u.topLevelDefinitions.get(j).toString(), s.getName());
          }
        }
      }
      else if (s.isSwcScriptOwner())
      {
        String location = ((SwcScript) s.getOwner()).getLibrary().getSwcLocation();
        libraryNames.add(location);
       
        if (locations != null)
        {
          for (int j = 0, size = u.topLevelDefinitions.size(); j < size; j++)
          {
            locations.put(u.topLevelDefinitions.get(j).toString(), location);
          }
        }
      }
    }

    for (Source s : sources)
    {
      CompilationUnit u = (s == null) ? null : s.getCompilationUnit();
     
      if (s == null)
      {
        continue;
      }
View Full Code Here

      Frame f = movie.frames.get(i);
      List<CompilationUnit> units = movie.getExportedUnitsByFrame(f);
            List<String> aList = new ArrayList<String>(), dList = new ArrayList<String>();
      for (int j = 0, size = units == null ? 0 : units.size(); j < size; j++)
      {
        CompilationUnit u = units.get(j);
        Source s = u.getSource();
       
                if (u.hasAssets())
                {
                    for (Iterator k = u.getAssets().iterator(); k.hasNext(); )
                    {
                        Map.Entry e = (Map.Entry) k.next();
                        AssetInfo assetInfo = (AssetInfo) e.getValue();
                        VirtualFile path = assetInfo.getPath();
                        if (path != null)
View Full Code Here

    public CompilationUnit parse1(Source source, SymbolTable symbolTable)
    {
        if (benchmarkHelper != null)
            benchmarkHelper.startPhase(CompilerBenchmarkHelper.PARSE1, source.getNameForReporting());

        CompilationUnit unit = source.getCompilationUnit();

        if (unit != null && unit.hasTypeInfo)
        {
            return unit;
        }
View Full Code Here

        if (benchmarkHelper != null)
        {
            benchmarkHelper.startPhase(CompilerBenchmarkHelper.PARSE1, source.getNameForReporting());
        }

    CompilationUnit unit = source.getCompilationUnit();
       
    if (unit != null && unit.hasTypeInfo)
    {
      return unit;
    }
View Full Code Here

         * </p>
         */
        public CompilationUnit parse1(Source source, SymbolTable symbolTable)
        {
            CompilerContext context = new CompilerContext();
            CompilationUnit unit = source.newCompilationUnit(null, context);

            // Setup a logger to bridge FXG and Flex logging systems
            setupLogger();

            // Setup the FXG Parser using either the mobile or desktop profile
View Full Code Here

                ThreadLocalToolkit.log(new SourceGenerationException(ex), originalSource);
                return;
            }

            // Compile our generated source with ASC
            CompilationUnit interfaceUnit = delegateSubCompiler.parse1(generatedSource, symbolTable);

            if (interfaceUnit != null)
            {
                unit.getSource().addFileIncludes(interfaceUnit.getSource());
                unit.getContext().setAttribute(DELEGATE_UNIT, interfaceUnit);

                //TODO: Establish FXG -> generated ActionScript line number map
                //unit.getContext().setAttribute(LINE_NUMBER_MAP, lineNumberMap);
View Full Code Here

         * Transcode our DOM to SWF graphics primitives and generate the
         * concrete ActionScript source for ASC compilation.
         */
        public CompilationUnit parse1(Source source, SymbolTable symbolTable)
        {
            CompilationUnit unit = source.getCompilationUnit();

            // Now we can generate the concrete implementation for the FXG DOM
            // saved in the CompilationUnit's context from the parse1() phase
            // of SkeletonCompiler.
            try
            {
                Source generatedSource = generateSource(unit, symbolTable);
                if (generatedSource != null)
                    generatedSource.addFileIncludes(source);

                // Then we delegate to ASC to process our generated source.
                CompilationUnit implementationUnit = delegateSubCompiler.parse1(generatedSource, symbolTable);
                if (implementationUnit != null)
                {
                    // Transfer includes from the ASC unit to the FXG unit
                    unit.getSource().addFileIncludes(implementationUnit.getSource());
                    unit.getContext().setAttribute(DELEGATE_UNIT, implementationUnit);
                    //context.setAttribute(LINE_NUMBER_MAP, lineNumberMap);
                    Source.transferMetaData(implementationUnit, unit);
                    Source.transferGeneratedSources(implementationUnit, unit);
                    Source.transferDefinitions(implementationUnit, unit);
View Full Code Here

        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

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.