Package flex2.compiler

Examples of flex2.compiler.CompilationUnit


            Set externs = configuration.getExterns();

        for (int i = 0, size = sources.size(); i < size; i++)
        {
          Source src = sources.get(i);
          CompilationUnit unit = src == null ? null : src.getCompilationUnit();
          if (unit != null && !PreLink.isCompilationUnitExternal(unit, externs) &&
              !src.isInternal())
          {
            s.addAll(unit.resourceBundleHistory);
          }
View Full Code Here


        // No new classes can be discovered here, we're just building the frame class list.

        Map<String, CompilationUnit> def2unit = new HashMap<String, CompilationUnit>();
        for (Iterator<CompilationUnit> it = units.iterator(); it.hasNext(); )
        {
            CompilationUnit unit = it.next();
            mapAll( def2unit, unit.topLevelDefinitions.getStringSet(), unit );
        }

        buildFrames( def2unit, mainDef, new HashSet<String>() );
View Full Code Here

  }

    private DependencyGraph<CompilationUnit> extractCompilationUnitInfo(List<CompilationUnit> units)
    {
        final DependencyGraph<CompilationUnit> dependencies = new DependencyGraph<CompilationUnit>();
      CompilationUnit main = null;

        for (int i = 0, length = units.size(); i < length; i++)
        {
            CompilationUnit u = units.get(i);
            Source s = u.getSource();
            String path = s.getName();

          if (!u.isRoot())
          {
            // C: should also setup dependencies based on CompilationUnit.inheritance...
            //    it still works because the list is already sorted and this is a SimpleMovie!
                dependencies.put(path, u);
            dependencies.addVertex(new Vertex<String,CompilationUnit>(path));
View Full Code Here

      Algorithms.topologicalSort(dependencies, new Visitor<Vertex<String,CompilationUnit>>()
      {
        public void visit(Vertex<String,CompilationUnit> v)
        {
          String fileName = v.getWeight();
          CompilationUnit u = dependencies.get(fileName);

          exportUnitOnFrame( u, frame, lazyInit );
        }
      });
    }
View Full Code Here

    {
      List<CompilationUnit> a = new ArrayList<CompilationUnit>();
     
      for (Iterator<CompilationUnit> i = exportedUnits.keySet().iterator(); i.hasNext(); )
      {
        CompilationUnit u = i.next();
        Frame frame = exportedUnits.get(u);
        if (f == frame)
        {
          a.add(u);
        }
View Full Code Here

        if (progress.contains( className ))
            return;

        progress.add( className );

        CompilationUnit unit = def2unit.get( className );

        if (unit == null)   // this should get picked up elsewhere
            throw new LinkerException.UndefinedSymbolException( className ); // fixme - add special frame class error?

        if (unit.loaderClass != null)
View Full Code Here

        String serverConfigDef = null;

        CULinkable mainLinkable = null;
        for (Iterator<CompilationUnit> it = units.iterator(); it.hasNext();)
        {
            CompilationUnit unit = it.next();

      //  NOTE Here we watch for specific generated loose code units we have carnal knowledge of, and add their
      //  definitions as deps to the main unit.
      //   TODO Remove once serverconfigdata is handled within the standard bootstrap setup.
      //
            Source source = unit.getSource();
      String sourceName = source.getName();

            if (sourceName.equals("serverConfigData.as"))
            {
                serverConfigDef = unit.topLevelDefinitions.first().toString();
            }
            CULinkable linkable = new CULinkable( unit );
            if (unit.isRoot())
                mainLinkable = linkable;

            if (source.isInternal())
            {
                externs.addAll( unit.topLevelDefinitions.getStringSet() );
View Full Code Here

        final DependencyGraph<CompilationUnit> dependencies = new DependencyGraph<CompilationUnit>();
    final Map<QName, String> qnames = new HashMap<QName, String>(); // QName, VirtualFile.getName()

        for (int i = 0, length = units.size(); i < length; i++)
        {
            CompilationUnit u = units.get(i);
            Source s = u.getSource();
            String path = s.getName();

            dependencies.put(path, u);
      if (!dependencies.containsVertex(s.getName()))
      {
        dependencies.addVertex(new Vertex<String,CompilationUnit>(path));
      }
       
      // register QName --> VirtualFile.getName()
      for (Iterator<QName> j = u.topLevelDefinitions.iterator(); j.hasNext();)
      {
        qnames.put(j.next(), s.getName());
      }
        }

    // setup inheritance-based dependencies...
    for (int i = 0, size = units.size(); i < size; i++)
    {
            CompilationUnit u = units.get(i);
            Source s = u.getSource();
            String head = s.getName();

      for (Name name : u.inheritance)
      {
        if (name instanceof QName)
View Full Code Here

    Algorithms.topologicalSort(dependencies, new Visitor<Vertex<String,CompilationUnit>>()
    {
      public void visit(Vertex<String,CompilationUnit> v)
      {
        String fileName = v.getWeight();
        CompilationUnit u = dependencies.get(fileName);
        if (!u.getSource().isInternal())
        {
          if (u.isRoot())
          {
            main = u.getByteCodes();
          }
          else
          {
            abcList.add(u.getByteCodes());
          }
          exportedUnits.add(u);
        }
      }
    });
View Full Code Here

                            return 1;
                        }
                    }
                   
                    // Favor SwcScript's with a cached CompilationUnit
                    CompilationUnit swcScript1CompilationUnit = swcScript1.getCompilationUnit();
                    CompilationUnit swcScript2CompilationUnit = swcScript2.getCompilationUnit();

                    if (swcScript1CompilationUnit != null)
                    {
                        if (swcScript1CompilationUnit.hasTypeInfo)
                        {
                            return -1;
                        }
                    }
                    else if (swcScript2CompilationUnit != null)
                    {
                        if (swcScript2CompilationUnit.hasTypeInfo)
                        {
                            return 1;
                        }
                    }

          return 0;
        }
                else if (swcScript1mod < swcScript2mod)
        {
          return 1;
        }
                else
        {
          return -1;
        }
      }
    });

    def2script = new HashMap<String, SwcScript>();
    qnames = new HashSet<QName>();
    for (int i = 0; i < scriptArray.length; i++)
    {
      SwcScript s = scriptArray[i];
      String name = s.getName();
      HashMap<String, SwcScript> staging = new HashMap<String, SwcScript>();
      for (Iterator defit = s.getDefinitionIterator(); defit.hasNext();)
      {
        String def = (String) defit.next();
        staging.put(def, s);
                SwcScript newerSwcScript = def2script.get(def);

        if (newerSwcScript != null)
        {
                    // already have a newer definition, this script is obsolete.
                    staging = null;

                    CompilationUnit compilationUnit = s.getCompilationUnit();

                    if (compilationUnit != null)
                    {
                        CompilationUnit newerCompilationUnit = newerSwcScript.getCompilationUnit();

                        if (newerCompilationUnit != null)
                        {
                            if ((newerCompilationUnit != null) &&
                                (compilationUnit.typeInfo != newerCompilationUnit.typeInfo))
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.