Package flex2.compiler

Examples of flex2.compiler.Source


                    QName qName = (QName) entry.getKey();
            Long dataSignatureChecksum = (Long)entry.getValue();
            Long swcSignatureChecksum = swcContext.getChecksum(qName);
                    if (swcSignatureChecksum == null && qName != null)
                    {
                        Source source = swcContext.getSource(qName.getNamespace(), qName.getLocalPart());
                        if (source != null)
                        {
                            swcSignatureChecksum = new Long(source.getLastModified());
                        }
                    }
            if (Trace.swcChecksum)
            {
              if (dataSignatureChecksum == null)
View Full Code Here


        Iterator<Source> iterator = sources.values().iterator();
        int nextLowestTotalDependentCount = Integer.MAX_VALUE;

        while (iterator.hasNext())
        {
            Source source = iterator.next();
            int totalDependentCount = source.getTotalDependentCount();

            if (totalDependentCount == lowestTotalDependentCount)
            {
                iterator.remove();
            }
View Full Code Here

        boolean relink = false;

        for (Map.Entry<String, Source> entry : sources.entrySet())
        {
            String className = entry.getKey();
            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 &&
                    (cachedCompilationUnit != null) && cachedCompilationUnit.hasTypeInfo)
                {
                    Source.copyCompilationUnit(cachedCompilationUnit, compilationUnit, true);
                    source.setFileTime(cachedSource.getFileTime());
                    source.reused();
                    relink = true;
                }
            }
        }
View Full Code Here

                                         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)
                        {
                            assetNames.add(path.getName());
                        }
                    }
                }
      }
      else if (s.isSwcScriptOwner())
      {
        String location = ((SwcScript) s.getOwner()).getLibrary().getSwcLocation();
        libraryNames.add(location);
      }
    }
  }
View Full Code Here

      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)
                        {
                            String assetName = path.getName();
                            if (!aList.contains(assetName))
                            {
                                aList.add(assetName);
                            }
                        }
          }
        }

        if (s.isFileSpecOwner() || s.isResourceBundlePathOwner() || s.isSourceListOwner() ||
          s.isSourcePathOwner() || s.isSwcScriptOwner())
        {
          for (Iterator k = u.topLevelDefinitions.iterator(); k.hasNext(); )
          {
            String definitionName = k.next().toString();
            dList.add(definitionName);
View Full Code Here

        if (benchmarkHelper != null)
        {
            benchmarkHelper.startPhase(CompilerBenchmarkHelper.PREPROCESS, source.getNameForReporting());
        }
       
        Source result = null;
       
    if (source.getCompilationUnit() == null)
      result = intfc.preprocess(source);
    else
      result = implc.preprocess(source);
View Full Code Here

         * any of it child tags (if the FXG DOM says that they're needed).
         */
        @Override
        public void parse2(CompilationUnit unit, SymbolTable symbolTable)
        {
            Source generatedSource = null;
            Source originalSource = unit.getSource();

            // Determine whether we need to introduce text class dependencies
            FXGNode rootNode = (FXGNode)unit.getContext().getAttribute(FXG_DOM_ROOT);
            boolean hasTextGraphic = false;
            String baseClassName = null;
View Full Code Here

                FileUtil.writeFile(generatedName, generatedCode);
            }

            // Create a new Source for the generated file but based on our
            // original Source to preserve information like last modified.
            Source generatedSource = new Source(generatedFile, originalSource);

            return generatedSource;
        }
View Full Code Here

            // 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)
                {
View Full Code Here

         * CompilationUnit. Additional symbols will be generated for child
         * sprites corresponding to &lt;TextGraphic&gt; nodes.
         */
        private Source generateSource(CompilationUnit unit, SymbolTable symbolTable) throws IOException
        {
            Source originalSource = unit.getSource();

            // package/class is derived from source name and location
            String className = originalSource.getShortName();
            String packageName = originalSource.getRelativePath().replace('/','.');

            // TypeTable will be used to determine if an text related FXG
            // attribute apply to a property or style of the associated
            // ActionScript API.
            TypeTable typeTable = new TypeTable(symbolTable, nameMappings, unit.getStandardDefs(),
                                                themeNames);

            // Transcode the FXG DOM to SWF graphics primitives
            FXGSymbolClass asset = transcodeFXG(unit, packageName, className, typeTable);

            // Generate the main source and associate the top level DefineSprite
            Source generatedSource = generateMainSource(unit, packageName, className, asset);

            // Handle any additional generated child sprite classes
            List<FXGSymbolClass> additionalAssets = asset.getAdditionalSymbolClasses();
            if (additionalAssets != null && additionalAssets.size() > 0)
            {
                Map<QName, Source> additionalSources = new HashMap<QName, Source>(additionalAssets.size());
                for (FXGSymbolClass additionalAsset : additionalAssets)
                {
                    if (additionalAsset.getSymbol() != null)
                    {
                        Source additionalSource = generateAdditionalSource(unit, additionalAsset);
                        if (additionalSource != null)
                        {
                            QName additionalQName = new QName(additionalAsset.getPackageName(), additionalAsset.getClassName());
                            additionalSources.put(additionalQName, additionalSource);
                        }
View Full Code Here

TOP

Related Classes of flex2.compiler.Source

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.