Package flex2.compiler.as3.reflect

Examples of flex2.compiler.as3.reflect.TypeTable


        if (firstPassEvaluator != null && firstPassEvaluator.makeSecondPass())
        {
            Node node = (Node) unit.getSyntaxTree();
            Context cx = unit.getContext().getAscContext();
            TypeAnalyzer typeAnalyzer = typeTable.getSymbolTable().getTypeAnalyzer();

            node.evaluate(cx, typeAnalyzer);

            Iterator iterator = firstPassEvaluator.getClassMap().entrySet().iterator();

            while ( iterator.hasNext() )
            {
                Entry entry = (Entry) iterator.next();
                String className = (String) entry.getKey();
                GenerativeClassInfo generativeClassInfo = (GenerativeClassInfo) entry.getValue();
                ClassInfo classInfo = typeAnalyzer.getClassInfo(className);
                generativeClassInfo.setClassInfo(classInfo);
            }

            Evaluator secondPassEvaluator = getSecondPassEvaluator(unit, typeAnalyzer, firstPassEvaluator);
View Full Code Here


    public Value evaluate(Context context, ClassDefinitionNode node)
    {
        super.evaluate(context, node);
       
        //Used to populate ClassInfo via getClassInfo
        TypeAnalyzer typeAnalyzer = symbolTable.getTypeAnalyzer();
       
        //Needed for getClassInfo
        String className = NodeMagic.getClassName(node);
       
        if(className == null) return null;
       
        currentContext = context;
       
        //This walks the class hiearchy to insure that the tree has been parsed
        //we need to do this before we use getClassInfo() to make sure we get all the
        //baseclasses' info
        typeAnalyzer.evaluate(context, node);
       
        ClassInfo classInfo = typeAnalyzer.getClassInfo(className);
       
        //Returns a hash of all skin parts, including inherited parts
        Map<String, Boolean> parts = classInfo.getSkinParts(true);
       
       
View Full Code Here

        CompilerConfiguration compilerConfiguration = configuration.getCompilerConfiguration();
        int compatibilityVersion = compilerConfiguration.getCompatibilityVersion();

        StandardDefs standardDefs = ThreadLocalToolkit.getStandardDefs();
        TypeAnalyzer typeAnalyzer = symbolTable.getTypeAnalyzer();
        assert(typeAnalyzer != null);
       
        for (int i = 0, length = units.size(); i < length; i++)
        {
            CompilationUnit u = (CompilationUnit) units.get(i);

            if (u.isRoot())
            {
                StylesContainer stylesContainer =
                    (StylesContainer) symbolTable.getContext().getAttribute(StylesContainer.class.getName());
                StylesContainer rootStylesContainer = u.getStylesContainer();

                // If the backgroundColor wasn't specified inline, go looking for it in CSS.
                if ((u.swfMetaData == null) || (u.swfMetaData.getValue("backgroundColor") == null))
                {
                    QName qName = u.topLevelDefinitions.last();
                   
                    if (qName != null)
                    {
                        String def = qName.toString();
                        lookupBackgroundColor(stylesContainer, rootStylesContainer, u.styleName,
                                              NameFormatter.toDot(def), symbolTable, configuration);
                    }
                }

                if (rootStylesContainer != null)
                {
                    // Swap in root's Logger, so warnings get associated correctly.
                    Logger originalLogger = ThreadLocalToolkit.getLogger();
                    ThreadLocalToolkit.setLogger(u.getSource().getLogger());
                    rootStylesContainer.validate(symbolTable, nameMappings, u.getStandardDefs(),
                                                 compilerConfiguration.getThemeNames(), null);
                    ThreadLocalToolkit.setLogger(originalLogger);
                }

                Source source = u.getSource();

                // Now that we're done validating the StyleContainer,
                // we can disconnect the root's logger.
                source.disconnectLogger();

                // Clear the root's path resolver, so the
                // CompilationUnit doesn't hold onto the global path
                // resolver, which has strong references to things
                // like the SourcePath, which we want freed up at the
                // end of a compilation.  All the other
                // CompilationUnit's have their PathResolver cleared
                // when they reach the ABC state.  We hold onto the
                // root's path resolver until now, because of the
                // styles
                source.setPathResolver(null);

                // C: we don't need the styles container anymore
                u.setStylesContainer(null);
            }
            else if (generatedLoaderClass && !u.getSource().isInternal() && !u.getSource().isSwcScriptOwner())
            {
                // Check if the source is a module or an application. If it is and we know it
                // is not the root then generate a warning.
                if (typeAnalyzer != null)
                {
                    for (QName qName : u.topLevelDefinitions)
                    {
                        ClassInfo info = typeAnalyzer.getClassInfo(qName.toString());
                        checkForModuleOrApplication(standardDefs, typeAnalyzer, info, qName, configuration);
                    }
                }
            }
           
View Full Code Here

            {
                throw new SkinClassNotFound(skinClassName);
            }

            result = new TranscodingResults();
            TypeAnalyzer typeAnalyzer = symbolTable.getTypeAnalyzer();
            ClassInfo skinClassInfo = typeAnalyzer.analyzeClass(null, new MultiName(NameFormatter.toColon(skinClassName)));
            result.generatedCode = generateSource(className, skinClassName, skinClassInfo);
        }
        else
        {
            throw new EmbedRequiresCodegen((String) args.get(Transcoder.ORIGINAL), className);
View Full Code Here

        // implement IEventDispatcher. See SDK-25312
        if (unit.hostComponentMetaData != null)
        {
            CompilerContext context = unit.getContext();
            Context cx = (Context) context.getAscContext();
            TypeAnalyzer typeAnalyzer = typeTable.getSymbolTable().getTypeAnalyzer();
            generateHostComponentVariable(cx, unit, typeAnalyzer);
        }
    }
View Full Code Here

    qNameTable = new QNameMap<Source>(300);
    multiNames = new HashMap<MultiName, QName>(1024);
    Context cx = new Context(perCompileData);
    emitter = new BytecodeEmitter(cx, null, false, false);
    cx.setEmitter(emitter);
    typeAnalyzer = new TypeAnalyzer(this);
   
    rbNames = new HashMap<String, QName[]>();
    rbNameTable = new HashMap<String, Source>();
  }
View Full Code Here

        assert classDefinitionNode != null : "could not find a class definition node...";

        CompilerContext context = ascUnit.getContext();
        Context cx = context.getAscContext();

        TypeAnalyzer typeAnalyzer = symbolTable.getTypeAnalyzer();

        program.evaluate(cx, typeAnalyzer);

        ClassInfo classInfo = typeAnalyzer.getClassInfo(className);

        // If classInfo is null, then errors should be reported downstream.
        if (classInfo != null)
        {
            ClassInfo baseClassInfo = classInfo.getBaseClassInfo();
View Full Code Here

            {
                throw new SkinClassNotFound(skinClassName);
            }

            result = new TranscodingResults();
            TypeAnalyzer typeAnalyzer = symbolTable.getTypeAnalyzer();
            ClassInfo skinClassInfo = typeAnalyzer.analyzeClass(null, new MultiName(NameFormatter.toColon(skinClassName)));
            result.generatedCode = generateSource(className, skinClassName, skinClassInfo);
        }
        else
        {
            throw new EmbedRequiresCodegen((String) args.get(Transcoder.ORIGINAL), className);
View Full Code Here

        CompilerConfiguration compilerConfiguration = configuration.getCompilerConfiguration();
        int compatibilityVersion = compilerConfiguration.getCompatibilityVersion();

        StandardDefs standardDefs = ThreadLocalToolkit.getStandardDefs();
        TypeAnalyzer typeAnalyzer = symbolTable.getTypeAnalyzer();
        assert(typeAnalyzer != null);
       
        for (int i = 0, length = units.size(); i < length; i++)
        {
            CompilationUnit u = (CompilationUnit) units.get(i);

            if (u.isRoot())
            {
                StylesContainer stylesContainer =
                    (StylesContainer) symbolTable.getContext().getAttribute(StylesContainer.class.getName());
                StylesContainer rootStylesContainer = u.getStylesContainer();

                // If the backgroundColor wasn't specified inline, go looking for it in CSS.
                if ((u.swfMetaData == null) || (u.swfMetaData.getValue("backgroundColor") == null))
                {
                    QName qName = u.topLevelDefinitions.last();
                   
                    if (qName != null)
                    {
                        String def = qName.toString();
                        lookupBackgroundColor(stylesContainer, rootStylesContainer, u.styleName,
                                              NameFormatter.toDot(def), symbolTable, configuration);
                    }
                }

                if (rootStylesContainer != null)
                {
                    // Swap in root's Logger, so warnings get associated correctly.
                    Logger originalLogger = ThreadLocalToolkit.getLogger();
                    ThreadLocalToolkit.setLogger(u.getSource().getLogger());
                    rootStylesContainer.validate(symbolTable, nameMappings, u.getStandardDefs(),
                                                 compilerConfiguration.getThemeNames(), null);
                    ThreadLocalToolkit.setLogger(originalLogger);
                }

                Source source = u.getSource();

                // Now that we're done validating the StyleContainer,
                // we can disconnect the root's logger.
                source.disconnectLogger();

                // Clear the root's path resolver, so the
                // CompilationUnit doesn't hold onto the global path
                // resolver, which has strong references to things
                // like the SourcePath, which we want freed up at the
                // end of a compilation.  All the other
                // CompilationUnit's have their PathResolver cleared
                // when they reach the ABC state.  We hold onto the
                // root's path resolver until now, because of the
                // styles
                source.setPathResolver(null);

                // C: we don't need the styles container anymore
                u.setStylesContainer(null);
            }
            else if (generatedLoaderClass && !u.getSource().isInternal() && !u.getSource().isSwcScriptOwner())
            {
                // Check if the source is a module or an application. If it is and we know it
                // is not the root then generate a warning.
                if (typeAnalyzer != null)
                {
                    for (QName qName : u.topLevelDefinitions)
                    {
                        ClassInfo info = typeAnalyzer.getClassInfo(qName.toString());
                        checkForModuleOrApplication(standardDefs, typeAnalyzer, info, qName, configuration);
                    }
                }
            }
           
View Full Code Here

                    FunctionDefinitionNode setter = generateSetter(context, className, accessorInfo);

                    if (accessorInfo.getIsFunction())
                    {
                        GetterSetterInfo getterSetterInfo = (GetterSetterInfo) accessorInfo;
                        boolean processedBindable =
                            processGetterMetaData(nodeFactory,
                                                  getterSetterInfo.getGetterFunctionDefinition());
                        moveMetaDataToNewDefinition(nodeFactory,
                                                    getterSetterInfo.getSetterFunctionDefinition(),
                                                    setter, statementList, !processedBindable);
                    }

                    nodeFactory.statementList(statementList, setter);
                }
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.