Package anvil.script

Examples of anvil.script.MethodType


  }


  protected MethodType onMethod(Method method, String name, Object[] parameters, Doc doc)
  {
    MethodType function = new MethodBase(this, method, name, parameters, doc);
    putstatic(_class, "m_" + name, function);
    putstatic(_class, "M_" + name, new AnyFunction(function));
    declare(function);
    return function;
  }
View Full Code Here


  }


  protected MethodType onInterfaceMethod(Method method, String name, Object[] parameters, Doc doc)
  {
    MethodType function = new InterfaceMethodBase(this, method, name, parameters, doc);
    putstatic(_class, "m_" + name, function);
    putstatic(_class, "M_" + name, new AnyFunction(function));
    declare(function);
    return function;
  }
View Full Code Here

  }
 

  protected MethodType onConstructor(Method method, Constructor constructor, String name, Object[] parameters, Doc doc)
  {
    MethodType function = new ConstructorBase(this, constructor, method, name, parameters, doc);
    putfield(_class, null, "m_" + name, function);
    putfield(_class, null, "M_" + name, new AnyFunction(function))
    declare(function);
    return function;
  }
View Full Code Here

        return new TypeNode(type);
      }
      if (_statement.isStaticRegion()) {
        context.error(_location, "Attempting to invoke '"+type+"' from static region");
      }
      MethodType ctor = (MethodType)type;
      checkArguments(context, ctor);
      return new SuperInvokeNode(ctor, consumeArgs());

    case Type.FUNCTION:
      if (!hasArgs()) {
View Full Code Here

      return null;
    }
    switch(type.getType()) {
    case Type.METHOD:
      {
        MethodType method = (MethodType)type;
       
        consumeSymbol();
        if (hasMoreSymbols()) {
          //methodname
          return new DelegateNode(new ThisNode(context, classtype), method);
View Full Code Here

        return new TypeNode(type);
      }

    case Type.METHOD:
      {
        MethodType method = (MethodType)type;
        ClassStatement context = _statement.getClassStatement();

        if (type instanceof FunctionStatement) {
          FunctionStatement function = (FunctionStatement)type;
          if (function.getContext() != null) {
            if (hasArgs()) {
              return new InlinedCallNode(_statement.getFunctionStatement(), function, consumeArgs());
            } else {
              return new InlinedFunctionNode(_statement.getFunctionStatement(), function);
            }
          }
        }
        if (hasMoreSymbols()) {
          return new TypeNode(type);
        } else {
          Grammar.checkInstanceAmbiguity(listener, _location, context, method);
          if (hasArgs()) {
            //methodname(...)
            checkArguments(listener, method);
            return new StaticInvokeNode(method.getClassType(), context, method, consumeArgs());
          } else {
            //methodname
            return new DelegateNode(new ThisNode(context, method.getClassType()), method);
          }
        }
      }
     
    case Type.CONSTRUCTOR:
View Full Code Here

TOP

Related Classes of anvil.script.MethodType

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.