Examples of AbcClass


Examples of flex2.compiler.abc.AbcClass

        for( Map.Entry<String, AbcClass> entry : interfaceUnit.classTable.entrySet() )
        {
            // Freeeze the clases generated for the interface file, so that we
            // can still access them when we are building the generated file.
            //System.out.println("Freezing " + entry.getKey());
            AbcClass c = entry.getValue();
            c.freeze();
        }

        Source.transferDependencies(interfaceUnit, unit);
        Source.transferLoaderClassBase(interfaceUnit, unit);
        Source.transferGeneratedSources(interfaceUnit, unit);
View Full Code Here

Examples of flex2.compiler.abc.AbcClass

    return classes;
  }

  private final void createClass(ClassDefinitionNode clsdef, Map<String, AbcClass> classes)
  {
    AbcClass cls = new As3Class(clsdef, this);
    classes.put(cls.getName(), cls);
  }
View Full Code Here

Examples of flex2.compiler.abc.AbcClass

                }
            }

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

      return;
    }
View Full Code Here

Examples of flex2.compiler.abc.AbcClass

                }
            }

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

      try
      {
View Full Code Here

Examples of flex2.compiler.abc.AbcClass

        {
            watcher.addChangeEvent("resultForBinding");
        }
        else if (srcTypeName != null)
        {
            AbcClass watchedClass = typeTable.getClass(srcTypeName);

            if (watchedClass != null)
            {
                if ( watchedClass.isSubclassOf(standardDefs.CLASS_OBJECTPROXY) )
                {
                    watcher.setPartOfAnonObjectGraph(true);
                }

                List metaData = watchedClass.getMetaData(BINDABLE, true);
                boolean foundEvents = addBindables(watcher, metaData);
                boolean foundSource = false;

                Variable variable = getVariable(context, watchedClass, ref, multiName);

                if (variable != null)
                {
                    metaData = variable.getMetaData(BINDABLE);
                    foundEvents = addBindables(watcher, metaData) || foundEvents;
                    metaData = variable.getMetaData(CHANGE_EVENT);
                    foundEvents = addChangeEvents(watcher, metaData) || foundEvents;
                    metaData = variable.getMetaData(NON_COMMITTING_CHANGE_EVENT);
                    foundEvents = addNonCommittingChangeEvents(watcher, metaData) || foundEvents;

                    // Object has a public static const variable names "length", which is
                    // some legacy compatibility crap left over from EMCA script 262, so
                    // we ignore it.
                    if (variable.isConst() &&
                        !(multiName.getLocalPart().equals("length") &&
                          variable.getDeclaringClassName().equals(SymbolTable.OBJECT)))
                    {
                        // We didn't really find any events, but we want
                        // to follow the same code path below as if we did.
                        foundEvents = true;
                        //    TODO will this ever be something besides a PropertyWatcher?
                        if (watcher instanceof PropertyWatcher)
                        {
                            ((PropertyWatcher) watcher).suppress();
                        }
                    }

                    // See comment above.
                    if (!(multiName.getLocalPart().equals("length") &&
                          variable.getDeclaringClassName().equals(SymbolTable.OBJECT)))
                    {
                        checkForStaticProperty(variable.isStatic(), watcher, srcTypeName);
                    }

                    foundSource = true;
                }

                if (!foundEvents)
                {
                    Method getter = getGetter(context, watchedClass, ref, multiName);

                    if (getter != null)
                    {
                        metaData = getter.getMetaData(BINDABLE);
                        foundEvents = addBindables(watcher, metaData) || foundEvents;
                        metaData = getter.getMetaData(CHANGE_EVENT);
                        foundEvents = addChangeEvents(watcher, metaData) || foundEvents;
                        metaData = getter.getMetaData(NON_COMMITTING_CHANGE_EVENT);
                        foundEvents = addNonCommittingChangeEvents( watcher, metaData) || foundEvents;

                        checkForStaticProperty(getter.isStatic(), watcher, srcTypeName);

                        foundSource = true;
                    }

                    Method setter = getSetter(context, watchedClass, ref, multiName);

                    if (setter != null)
                    {
                        metaData = setter.getMetaData(BINDABLE);
                        foundEvents = addBindables(watcher, metaData) || foundEvents;
                        metaData = setter.getMetaData(CHANGE_EVENT);
                        foundEvents = addChangeEvents(watcher, metaData) || foundEvents;
                        metaData = setter.getMetaData(NON_COMMITTING_CHANGE_EVENT);
                        foundEvents = addNonCommittingChangeEvents(watcher, metaData) || foundEvents;

                        checkForStaticProperty(setter.isStatic(), watcher, srcTypeName);

                        foundSource = true;
                    }
                    else
                    {
                        if (getter != null)
                        {
                            //    getters without setters are de facto const, use same bypass as above for const vars
                            foundEvents = true;
                        }
                    }
                }

                if (!foundSource)
                {
                    Method function = getMethod(context, watchedClass, ref, multiName);

                    if (function != null)
                    {
                        metaData = function.getMetaData(BINDABLE);
                        foundEvents = addBindables(watcher, metaData) || foundEvents;
                        metaData = function.getMetaData(CHANGE_EVENT);
                        foundEvents = addChangeEvents(watcher, metaData) || foundEvents;
                        metaData = function.getMetaData(NON_COMMITTING_CHANGE_EVENT);
                        foundEvents = addNonCommittingChangeEvents(watcher, metaData) || foundEvents;
                        foundSource = true;

                        if (!foundEvents && callExpressionStack.isEmpty())
                        {
                            foundEvents = true;
                            //    TODO will this ever be something besides a PropertyWatcher?
                            if (watcher instanceof PropertyWatcher)
                            {
                                ((PropertyWatcher)watcher).suppress();
                            }
                        }
                    }
                }

                if ((!foundSource) && watchedClass.isSubclassOf(standardDefs.CLASS_ABSTRACTSERVICE))
                {
                    watcher.setOperation(true);
                }
                else if (!foundEvents &&
                         !(watcher instanceof FunctionReturnWatcher) &&
                         !(watcher instanceof XMLWatcher) &&
                         !watcher.isOperation())
                {
                    /***
                     * NOTE: when we've failed to find change events for properties of untyped or Object-typed parents, we go
                     * ahead and generate code to create a runtime PropertyWatcher with no change events specified. The lack
                     * of change events tells the runtime PW to introspect RTTI to discover change events associated with the
                     * actual type of the actual value being assigned to the property.
                     * OTOH for strongly-typed properties, we still require change events to be reachable at compile time.
                     */
                    if (!(watchedClass.getName().equals(SymbolTable.OBJECT) || watchedClass.getName().equals(SymbolTable.NOTYPE)))
                    {
                        //    TODO do we still want this to be configurable?
                        if (showBindingWarnings)
                        {
                            context.localizedWarning2(pos, new UnableToDetectChanges(name));
View Full Code Here

Examples of flex2.compiler.abc.AbcClass

        // Validate up the inheritance chain
        String superTypeName = hostComponentClass.getSuperTypeName();

        if (superTypeName != null)
        {
            AbcClass superType = typeTable.getClass(superTypeName);

            if (superType != null)
            {
                validateRequiredSkinParts(superType, skinClass, cx, position, typeTable);
            }
View Full Code Here

Examples of flex2.compiler.abc.AbcClass

    private void validateRequiredSkinPartsAndStates(Context cx, CompilationUnit unit, TypeTable typeTable)
    {
      MetaDataNode metaData = unit.hostComponentMetaData;
        String hostComponentClassName = metaData.getValue(0);
        AbcClass hostComponentClass = typeTable.getClass(NameFormatter.toColon(hostComponentClassName));

        if (hostComponentClass == null)
        {
            cx.localizedError2(cx.input.origin, metaData.pos(),
                               new HostComponentClassNotFound(hostComponentClassName));
        }
        else if (unit.hostComponentOwnerClass != null)
        {
            AbcClass skinClass = typeTable.getClass(unit.hostComponentOwnerClass);
            validateRequiredSkinParts(hostComponentClass, skinClass, cx, metaData.pos(), typeTable);
            validateRequiredSkinStates(hostComponentClass, skinClass, cx, metaData.pos());
        }
    }
View Full Code Here

Examples of flex2.compiler.abc.AbcClass

            backgroundColor = lookupTypeSelectorBackgroundColor(globalStylesContainer, className);
        }

        if (backgroundColor == -1)
        {
            AbcClass abcClass = symbolTable.getClass(NameFormatter.toColon(className));

            if (abcClass != null)
            {
                String superTypeName = abcClass.getSuperTypeName();

                if (superTypeName != null)
                {
                    // The styleName is intentionally not passed in,
                    // because we've already tried doing a lookup with it.
View Full Code Here

Examples of flex2.compiler.abc.AbcClass

        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);
            unit.classTable.put(className, c);
        }

        try
View Full Code Here

Examples of flex2.compiler.abc.AbcClass

  {
    for (Iterator it = unit.topLevelDefinitions.iterator(); it.hasNext();)
    {
        QName qName = (QName) it.next();

        AbcClass c = typeTable.getClass( qName.toString() );
        if (c == null)
            continue;
        getParentLoader(unit, typeTable, c);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.