Package flex2.compiler

Examples of flex2.compiler.CompilationUnit


  }

    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

    CompilerContext context = new CompilerContext();

        // 1. parse/analyze MXML, or retrieve preparsed DOM
        // 2. add MXML syntax tree to a new CompilationUnit
        DocumentNode app;
        CompilationUnit unit;

        Object preparsedSyntaxTree = source.getSourceFragment(AttrInlineComponentSyntaxTree);
        if (preparsedSyntaxTree == null)
        {
            app = parseMXML(source);
            if (app == null)
            {
                return null;
            }

            unit = source.newCompilationUnit(app, context);

            // do more syntax checking, chase includes, etc.
            app.analyze(new SyntaxAnalyzer(unit, mxmlConfiguration));
            if (ThreadLocalToolkit.errorCount() > 0)
            {
                return null;
            }
        }
        else
        {
            assert preparsedSyntaxTree instanceof DocumentNode : "bogus preparsed root node passed to InterfaceCompiler";
            app = (DocumentNode) preparsedSyntaxTree;
            unit = source.newCompilationUnit(app, context);
        }

        unit.getContext().setAttribute(DOCUMENT_NODE, app);

        //  start a new DocumentInfo. this will accumulate document state as compilation proceeds
        DocumentInfo docInfo = createDocumentInfo(unit, app, source);
        if (ThreadLocalToolkit.errorCount() > 0)
        {
            return null;
        }

        unit.getContext().setAttribute(MxmlCompiler.DOCUMENT_INFO, docInfo);
        unit.topLevelDefinitions.add(new QName(docInfo.getPackageName(), docInfo.getClassName()));
        transferDependencies(docInfo, unit.inheritance, unit.inheritanceHistory);

        return unit;
    }
View Full Code Here

      map.setNewName(newSource.getName());
    }

    //  use ASC to produce new CU for generated interface source. Will be managed by "outer" MXML CU
    CompilationUnit interfaceUnit = compileInterface(newSource, source, docInfo, map, symbolTable);

    if (interfaceUnit != null)
    {
      //  transfer includes from the interface unit to the real MXML unit
      unit.getSource().addFileIncludes(interfaceUnit.getSource());

            //  InterfaceUnit, LineNumberMap are used in subsequent phases of InterfaceCompiler
            unit.getContext().setAttribute(MxmlCompiler.LINE_NUMBER_MAP, map);
            unit.getContext().setAttribute(MxmlCompiler.DELEGATE_UNIT, interfaceUnit);
View Full Code Here

    /**
     * run asc.analyze1() on unit's private AS unit representing the public signature, shuttling results back to outer unit
     */
    public void analyze1(CompilationUnit unit, SymbolTable symbolTable)
    {
    CompilationUnit interfaceUnit = (CompilationUnit) unit.getContext().getAttribute(MxmlCompiler.DELEGATE_UNIT);

    Logger original = setLogAdapter(unit);
        asc.analyze1(interfaceUnit, symbolTable);
        ThreadLocalToolkit.setLogger(original);

View Full Code Here

    /**
     * run asc.analyze1() on unit's private AS unit representing the public signature, shuttling results back to outer unit
     */
    public void analyze2(CompilationUnit unit, SymbolTable symbolTable)
    {
    CompilationUnit interfaceUnit = (CompilationUnit) unit.getContext().getAttribute(MxmlCompiler.DELEGATE_UNIT);
        Source.transferDependencies(unit, interfaceUnit);
       
    Logger original = setLogAdapter(unit);
        asc.analyze2(interfaceUnit, symbolTable);
        ThreadLocalToolkit.setLogger(original);
View Full Code Here

        Source.transferDependencies(interfaceUnit, unit);
    }

    public void analyze3(CompilationUnit unit, SymbolTable symbolTable)
    {
    CompilationUnit interfaceUnit = (CompilationUnit) unit.getContext().getAttribute(MxmlCompiler.DELEGATE_UNIT);

        // C: unit.importDefinitionStatements has no bogus statements
        //    interfaceUnit.importDefinitionStatements may have bogus statements.
        QNameSet importDefinitionStatements = new QNameSet(interfaceUnit.importDefinitionStatements);
View Full Code Here

    /**
     * run asc.analyze1() on unit's private AS unit representing the public signature, shuttling results back to outer unit
     */
    public void analyze4(CompilationUnit unit, SymbolTable symbolTable)
    {
    CompilationUnit interfaceUnit = (CompilationUnit) unit.getContext().getAttribute(MxmlCompiler.DELEGATE_UNIT);

    Logger original = setLogAdapter(unit);
        asc.analyze4(interfaceUnit, symbolTable);
        ThreadLocalToolkit.setLogger(original);

View Full Code Here

    MxmlLogAdapter adapter = new MxmlLogAdapter(original, map);
    adapter.addLineNumberMaps(origSource.getSourceFragmentLineMaps());
    ThreadLocalToolkit.setLogger(adapter);
    }

    CompilationUnit interfaceUnit = asc.parse1(newSource, symbolTable);
        //  performance: strip non-signature code from parse tree; it's not needed in the Interface pass
        SyntaxTreeEvaluator.removeNonAPIContent(interfaceUnit);

        //  make sure management vars only occur once in class chain
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.