Package weasel.interpreter

Examples of weasel.interpreter.WeaselMethod


      }
     
      if(!hasConstructor){
        System.out.println("ADDCONSTRUCTOR to "+name);
        int id = ids.method++;
        WeaselMethod method = createMethod("<init>", isEnum?0:WeaselModifier.PUBLIC, this, new WeaselGenericClassInfo(compiler.baseTypes.voidClass, -1, new WeaselGenericClassInfo[0]), new WeaselGenericClassInfo[0], new WeaselGenericInformation[0], id);
        System.out.println(method);
        WeaselMethod[] newMethods = new WeaselMethod[methods.length+1];
        for(int i=0; i<methods.length; i++){
          newMethods[i] = methods[i];
        }
View Full Code Here


        token = getNextToken();
      }
    }
    WeaselCompiler.expect(token, WeaselTokenType.CLOSEBRACKET);
    WeaselGenericClassInfo[] wgci = genericInfos.toArray(new WeaselGenericClassInfo[0]);
    WeaselMethod method = null;
    try{
      method = getMethod(name, wgci);
    }catch(WeaselNativeException e){}
    int id;
    boolean resize;
    if(method!=null){
      if(method.getParentClass()==this)
        onException(tokenName.line, "Duplicated method %s", method);
      if(WeaselModifier.isStatic(modifier) != WeaselModifier.isStatic(method.getModifier()))
        onException(tokenName.line, "Static method error");
      if(WeaselModifier.isStatic(modifier)){
        id = ids.staticMethod++;
        resize = true;
      }else{
        if(WeaselModifier.isFinal(method.getModifier())){
          onException(tokenName.line, "Can't override final method %s", method);
        }
        id = method.getID();
        resize = false;
      }
    }else{
      id = WeaselModifier.isStatic(modifier)?ids.staticMethod++:ids.method++;
      resize = true;
View Full Code Here

    WeaselInterfaceMaps wim = new WeaselInterfaceMaps();
    interfaceMaps.put(interfaceClass, wim);
    wim.methodMapper = new int[methods.length];
    for(int i=0; i<methods.length; i++){
      if(!WeaselModifier.isStatic(methods[i].getModifier())){
        WeaselMethod method = getMethod(methods[i].getName(), methods[i].getDesk());
        checkOverrides(method, method.getID());
        wim.methodMapper[methods[i].getID()] = method.getID();
      }
    }
   
  }
View Full Code Here

    WeaselInterfaceMaps wim = new WeaselInterfaceMaps();
    interfaceMaps.put(interfaceClass, wim);
    wim.methodMapper = new int[methods.length];
    for(int i=0; i<methods.length; i++){
      if(!WeaselModifier.isStatic(methods[i].getModifier())){
        WeaselMethod method = getMethod(methods[i].getName(), methods[i].getDesk());
        if(method==null){
          int id = ids.method++;
          WeaselClass[] params = methods[i].getParamClasses();
          WeaselGenericClassInfo[] wgci = new WeaselGenericClassInfo[params.length];
          for(int j=0; j<params.length; j++){
            wgci[j] = new WeaselGenericClassInfo(params[i], -1, new WeaselGenericClassInfo[0]);
          }
          method = createMethod(name, modifier, this, new WeaselGenericClassInfo(methods[i].getReturnClasses(), -1, new WeaselGenericClassInfo[0]), wgci, new WeaselGenericInformation[0], id);
          WeaselMethod[] newMethods = new WeaselMethod[this.methods.length+1];
          for(int j=0; j<this.methods.length; j++){
            newMethods[j] = this.methods[j];
          }
          newMethods[methods.length] = method;
          this.methods = newMethods;
          WeaselMethodBody[] newMethodBodys = new WeaselMethodBody[ids.method];
          for(int j=0; j<methodBodys.length; j++){
            newMethodBodys[j] = methodBodys[j];
          }
          methodBodys = newMethodBodys;
        }
        wim.methodMapper[methods[i].getID()] = method.getID();
      }
    }
  }
View Full Code Here

TOP

Related Classes of weasel.interpreter.WeaselMethod

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.