Package org.apache.flex.abc.semantics

Examples of org.apache.flex.abc.semantics.MethodInfo


            IExpressionNode expression,
            LexicalScope enclosing_scope
            )
    {
        // get a method info and a scope for the getter we will generate
        MethodInfo mi = createSetterMethodInfo();

        log(ret, "making bind_setter");

        // After codegen of the binding expression, we just need to return it
        // TODO: add O_coerce
View Full Code Here


    /**
     * Generate a MethodInfo appropriate for an anonymous getter
     */
    private static MethodInfo createGetterMethodInfo()
    {      
        MethodInfo mi = new MethodInfo();
       
        // TODO: consider making us a more useful name for these anonymous functions
        // For debugging with swfdump, you can uncomment the line below:
        // mi.setMethodName("binding_getter");

        // Set return type as '*'
        mi.setReturnType( null);
   
        return mi;
    }
View Full Code Here

    /**
     * Generate a MethodInfo appropriate for an anonymous getter
     */
    private static MethodInfo createSetterMethodInfo()
    {
        MethodInfo mi = new MethodInfo();

        // TODO: consider making us a more useful name for these anonymous functions
        // For debugging with swfdump, you can uncomment the line below:
        // mi.setMethodName("binding_getter");

        mi.setReturnType(NAME_VOID);
        mi.setParamTypes(DEST_METHOD_PARAMS);

        return mi;
    }
View Full Code Here

    public static void makeParameterFunction(IABCVisitor emitter, InstructionList ret, IExpressionNode[] params)
    {
      
        //----------- step 1: build up a method info for the function
        // we are going to make a new func
        MethodInfo mi = new MethodInfo();
         
        // TODO: consider making us a more useful name for these anonymous functions
        // For debugging with swfdump, you can un-comment the line below:
        //mi.setMethodName("parameterFunction");
 
        mi.setReturnType( new Name(IASLanguageConstants.Array));
            
        //---- generate code that throws the exception.
        // This is based on the code that came out of the old compiler
       
View Full Code Here

            IABCVisitor emitter,
            ICompilerProject project,
            ASScope scope
            )
    {
        MethodInfo mi = new MethodInfo();
       
        // TODO: consider making us a more useful name for these anonymous functions
        // For debugging with swfdump, you can un-comment the line below:
        //mi.setMethodName("propertyGetterFunction");

        // Method returns "*", and takes one string parameter
        mi.setReturnType( null);
        Vector<Name> x = new Vector<Name>();
        x.add( new Name(IASLanguageConstants.String));
        mi.setParamTypes( x);
            
        Name magicName = makeNameForPropertyLookup(project, scope);
        InstructionList propertyGetterBody = new InstructionList();
   
        // we are not a member, function, so local 0 does not have "this"
View Full Code Here

            PropertyWatcherInfo propertyWatcherInfo = (PropertyWatcherInfo)watcherInfoBase;
          
            boolean makeStaticWatcher = (watcherInfoBase.getType() == WatcherType.STATIC_PROPERTY);
           
            // round up the getter function for the watcher, or null if we don't need one
            MethodInfo propertyGetterFunction = null;
            if (watcherInfoBase.isRoot && !makeStaticWatcher)
            {
                // TODO: figure out what this looks like
                // propertyGetterFunction = this.propertyGetter;
                // assert propertyGetterFunction != null;
View Full Code Here

        //    {
        //        return backingName;
        //    }
        //

        MethodInfo mi = new MethodInfo();
        mi.setMethodName(propName.getBaseName());

        mi.setReturnType(propType);

        InstructionList insns = new InstructionList(3);
        insns.addInstruction(OP_getlocal0);
        insns.addInstruction(OP_getproperty, backingName);
        insns.addInstruction(OP_returnvalue);
View Full Code Here

                    NamespaceDefinition.createPackagePublicNamespaceDefinition(NAMESPACE_MX_EVENTS.getName()),
                    NAME_PROPERTY_CHANGE_EVENT_KIND.getBaseName(),
                    DependencyType.EXPRESSION);
        }

        MethodInfo mi = new MethodInfo();
        mi.setMethodName(propName.getBaseName());

        Vector<Name> paramTypes = new Vector<Name>(1);
        paramTypes.add(propType);
        mi.setParamTypes(paramTypes);

        mi.setReturnType(NAME_VOID);

        InstructionList insns = new InstructionList(32);
        // var oldValue = backingName;
        insns.addInstruction(OP_getlocal0);
        insns.addInstruction(OP_getproperty, backingName);
View Full Code Here

        //      public static function get staticEventDispatcher():flash.events.IEventDispatcher
        //      {
        //          return ClassName._bindingEventDispatcher;
        //      }
        //
        MethodInfo mi = new MethodInfo();
        mi.setMethodName(NAME_STATIC_EVENT_DISPATCHER.getBaseName());

        mi.setReturnType(NAME_IEVENT_DISPATCHER);

        InstructionList insns = new InstructionList(3);
        insns.addInstruction(OP_getlocal0);
        insns.addInstruction(OP_getproperty, NAME_BINDING_EVENT_DISPATCHER);
        insns.addInstruction(OP_returnvalue);
View Full Code Here

        //    {
        //        _bindingEventDispatcher.addEventListener(type, listener, useCapture,
        //                                                 priority, weakRef);
        //    }

        MethodInfo addEventInfo = new MethodInfo();
        addEventInfo.setMethodName("addEventListener");
        Vector<Name> paramTypes = new Vector<Name>(5);

        paramTypes.add(NAME_STRING);
        paramTypes.add(NAME_FUNCTION);
        paramTypes.add(NAME_BOOLEAN);
        paramTypes.add(NAME_INT);
        paramTypes.add(NAME_BOOLEAN);

        addEventInfo.setParamTypes(paramTypes);

        //addEventInfo.setFlags(ABCConstants.HAS_OPTIONAL);

        addEventInfo.addDefaultValue(new PooledValue(false));
        addEventInfo.addDefaultValue(new PooledValue(0));
        addEventInfo.addDefaultValue(new PooledValue(false));

        addEventInfo.setReturnType(NAME_VOID);

        InstructionList addEventInsns = new InstructionList(10);
        addEventInsns.addInstruction(OP_getlocal0);
        addEventInsns.addInstruction(OP_getproperty, NAME_BINDING_EVENT_DISPATCHER);
        addEventInsns.addInstruction(OP_getlocal1);
View Full Code Here

TOP

Related Classes of org.apache.flex.abc.semantics.MethodInfo

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.