Package flex2.compiler.as3.reflect

Examples of flex2.compiler.as3.reflect.TypeTable


    private void processAccessibilityClassMetaData(Context cx, MetaDataNode node)
    {  
        if (node.getValue( "implementation" ) != null)
        {
            unit.addAccessibilityClass(new MetaData(node));
        }
        else
        {
            cx.localizedError2(cx.input.origin, node.pos(), new AccessibilityClassMustHaveType());
        }
View Full Code Here


            benchmarkHelper.startPhase(CompilerBenchmarkHelper.ANALYZE4, unit.getSource().getNameForReporting());
        }

    if (unit != null && unit.hasTypeInfo)
    {
            TypeTable typeTable = null;

            if (symbolTable != null)
            {
                typeTable = (TypeTable) symbolTable.getContext().getAttribute(As3Compiler.AttrTypeTable);

                if (typeTable == null)
                {
                    typeTable = new TypeTable(symbolTable);
                    symbolTable.getContext().setAttribute(As3Compiler.AttrTypeTable, typeTable);
                }
            }

            for (Map.Entry<String, AbcClass> entry : unit.classTable.entrySet())
View Full Code Here

  public void analyze4(CompilationUnit unit, SymbolTable symbolTable)
  {
        if (benchmarkHelper != null)
            benchmarkHelper.startPhase(CompilerBenchmarkHelper.ANALYZE4, unit.getSource().getNameForReporting());

    TypeTable typeTable = null;
    if (symbolTable != null)
    {
      typeTable = (TypeTable) symbolTable.getContext().getAttribute(As3Compiler.AttrTypeTable);
      if (typeTable == null)
      {
        typeTable = new TypeTable(symbolTable);
        symbolTable.getContext().setAttribute(As3Compiler.AttrTypeTable, typeTable);
      }
    }

    if (unit.hasTypeInfo)
    {
            for (Map.Entry<String, AbcClass> entry : unit.classTable.entrySet())
            {
                AbcClass c = entry.getValue();
                c.setTypeTable(typeTable);
                symbolTable.registerClass(entry.getKey(), c);
            }

      try
      {
        symbolTable.registerStyles(unit.styles);
      }
      catch (StyleConflictException e)
      {
        // C: assume that StyleConflictException is going to be internationalized...
        ThreadLocalToolkit.logError(unit.getSource().getNameForReporting(), e.getLocalizedMessage());
      }

      As3Compiler.evaluateLoaderClassBase(unit, typeTable);
      return;
    }

    ProgramNode node = (ProgramNode) unit.getSyntaxTree();

    CompilerContext context = unit.getContext();
    Context cx = context.getAscContext();
    symbolTable.perCompileData.handler = cx.getHandler();

    // run ConstantEvaluator
    cx.pushScope(node.frame);
    ConstantEvaluator analyzer = (ConstantEvaluator) context.removeAttribute("ConstantEvaluator");
    node.evaluate(cx, analyzer);
    cx.popScope();

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

    if (symbolTable != null)
    {
      Map classMap = typeTable.createClasses(node.clsdefs, unit.topLevelDefinitions);
      for (Iterator i = classMap.keySet().iterator(); i.hasNext();)
      {
        String className = (String) i.next();
        flex2.compiler.abc.AbcClass c = (flex2.compiler.abc.AbcClass) classMap.get(className);
        symbolTable.registerClass(className, c);
View Full Code Here

        for (Name name : inheritanceEvaluator.getInheritance())
        {
            unit.inheritance.add(name);
        }
 
    TypeTable typeTable = (TypeTable) symbolTable.getContext().getAttribute(AttrTypeTable);

        if (typeTable == null)
        {
            typeTable = new TypeTable(symbolTable);
            symbolTable.getContext().setAttribute(AttrTypeTable, typeTable);
        }

    for (int i = 0, length = compilerExtensions.size(); i < length; i++)
    {
View Full Code Here

        if (unit.hasTypeInfo)
        {
            return;
        }

    TypeTable typeTable = (TypeTable) symbolTable.getContext().getAttribute(AttrTypeTable);

    for (int i = 0, length = compilerExtensions.size(); i < length; i++)
    {
      compilerExtensions.get(i).parse2(unit, typeTable);
View Full Code Here

        if (unit.hasTypeInfo)
        {
            return;
        }

        TypeTable typeTable = (TypeTable) symbolTable.getContext().getAttribute(AttrTypeTable);

    ProgramNode node = (ProgramNode) unit.getSyntaxTree();
    if (node.state != ProgramNode.Inheritance)
    {
      return;
View Full Code Here

        if (unit.hasTypeInfo)
        {
            return;
        }

    TypeTable typeTable = (TypeTable) symbolTable.getContext().getAttribute(AttrTypeTable);

    ProgramNode node = (ProgramNode) unit.getSyntaxTree();
    if (node.state != ProgramNode.Else)
    {
      return;
View Full Code Here

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

    TypeTable typeTable = (TypeTable) symbolTable.getContext().getAttribute(AttrTypeTable);

    for (int i = 0, length = compilerExtensions.size(); i < length; i++)
    {
      compilerExtensions.get(i).analyze3(unit, typeTable);
View Full Code Here

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

    if (symbolTable != null)
    {
      typeTable = (TypeTable) symbolTable.getContext().getAttribute(AttrTypeTable);
      if (typeTable == null)
      {
        typeTable = new TypeTable(symbolTable);
        symbolTable.getContext().setAttribute(AttrTypeTable, typeTable);
      }
    }

        if (unit.hasTypeInfo)
        {
            for (Map.Entry<String, AbcClass> entry : unit.classTable.entrySet())
            {
                AbcClass c = entry.getValue();
                c.setTypeTable(typeTable);
                symbolTable.registerClass(entry.getKey(), c);
            }

            try
            {
                symbolTable.registerStyles(unit.styles);
            }
            catch (StyleConflictException e)
            {
                // C: assume that StyleConflictException is going to be internationalized...
                ThreadLocalToolkit.logError(unit.getSource().getNameForReporting(), e.getLocalizedMessage());
            }

            evaluateLoaderClassBase(unit, typeTable);
            return;
        }

        ProgramNode node = (ProgramNode) unit.getSyntaxTree();
        if (node.state == ProgramNode.Inheritance || node.state == ProgramNode.Else)
        {
            return;
        }

        CompilerContext context = unit.getContext();
        Context cx = context.getAscContext();
        symbolTable.perCompileData.handler = cx.getHandler();

        // run ConstantEvaluator
        cx.pushScope(node.frame);
        ConstantEvaluator analyzer = (ConstantEvaluator) context.removeAttribute("ConstantEvaluator");
    node.evaluate(cx, analyzer);
    cx.popScope();

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

    // run -strict and -coach
    if (as3Configuration.warnings())
    {
      cx.pushScope(node.frame);

      LintEvaluator lint = new LintEvaluator(cx, unit.getSource().getName(), warnMap);
      node.evaluate(cx, lint);
      cx.popScope();
            lint.simpleLogWarnings(cx, coachWarningsAsErrors);
            // if we want to go back to the verbose style of warnings, uncomment the line below and
            // comment out the line above
            //lint.logWarnings(context.cx);

      lint.clear();
    }

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

    // last step: collect class definitions, add them to the symbol table and the CompilationUnit
        Map classMap = typeTable.createClasses(node.clsdefs, unit.topLevelDefinitions);
        for (Iterator i = classMap.keySet().iterator(); i.hasNext();)
        {
            String className = (String) i.next();
            AbcClass c = (AbcClass) classMap.get(className);
            symbolTable.registerClass(className, c);
View Full Code Here

        if (unit.hasTypeInfo)
        {
            return;
        }

    TypeTable typeTable = (TypeTable) symbolTable.getContext().getAttribute(AttrTypeTable);

    CompilerContext context = unit.getContext();
    Context cx = context.getAscContext();
    symbolTable.perCompileData.handler = cx.getHandler();
View Full Code Here

TOP

Related Classes of flex2.compiler.as3.reflect.TypeTable

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.