Package anvil.codec

Examples of anvil.codec.ClassRoom.createMethod()


    }

    method = getMethod("_setRef");
    if (method != null) {
      compileCallback(context, method,
        clazz.createMethod("setRef", "(Lanvil/core/Any;)V", Code.ACC_PUBLIC), true, 1, P1_NODE, 0, 0);
    }

    compileAux(context);
   
    //compileInvoker(context);
View Full Code Here


  protected void compileAux(ByteCompiler context)
  {
    ClassRoom clazz = context.getClassRoom();
    ConstantPool pool = clazz.getPool();

    Method method = clazz.createMethod("getAllMembers", "()Lanvil/java/util/BindingEnumeration;", Code.ACC_PUBLIC);
    Code code = method.getCode();
    int cge = pool.addClass("anvil/script/ClassGraphEnumeration");
    code.anew(cge);
    code.dup();
    code.getstatic(pool.addFieldRef(clazz.getIndex(), "_class", "Lanvil/script/compiler/CompiledClassType;"));
View Full Code Here

    code.getstatic(pool.addFieldRef(clazz.getIndex(), "_class", "Lanvil/script/compiler/CompiledClassType;"));
    code.self();
    code.invokespecial(pool.addMethodRef(cge, "<init>", "(Lanvil/script/ClassType;Lanvil/core/AnyClass;)V"));
    code.areturn();

    method = clazz.createMethod("classOf", "()Lanvil/script/ClassType;", Code.ACC_PUBLIC);
    code = method.getCode();
    code.getstatic(pool.addFieldRef(clazz.getIndex(), "_class", "Lanvil/script/compiler/CompiledClassType;"));
    code.areturn();
  }
View Full Code Here

 
 
  protected void compileEqualsMethod(ByteCompiler context, CompilableFunction function)
  {
    ClassRoom clazz = context.getClassRoom();
    Method method = clazz.createMethod("equals", "(Ljava/lang/Object;)Z", Code.ACC_PUBLIC);
    Code code = method.getCode();
    ConstantPool pool = code.getPool();
    context.pushCode(code);
    code.addLocal();
    code.aload(1);
View Full Code Here

  {
    ClassRoom clazz = context.getClassRoom();
    String name = getDescriptor();
    Field typefield = clazz.createField(name, "Lanvil/script/Function;", ACC_PUBLIC|ACC_STATIC);
    clazz.createField("M_"+_name, "Lanvil/core/Any;", ACC_PUBLIC|ACC_STATIC);
    Method method = clazz.createMethod(name, getSignature(), ACC_PUBLIC);
    compileBody(context, method, typefield);
  }


}
View Full Code Here

  public void compile(ByteCompiler context)
  {
    ClassRoom clazz = context.getClassRoom();
    clazz.createField("m_"+_name, "Lanvil/script/Function;", ACC_PUBLIC|ACC_STATIC);
    clazz.createField("M_"+_name, "Lanvil/core/Any;", ACC_PUBLIC|ACC_STATIC);
    clazz.createMethod("m_"+_name, getSignature(), ACC_PUBLIC|ACC_ABSTRACT);
  }


}
View Full Code Here

  public void compile(ByteCompiler context)
  {
    ClassRoom clazz = context.getClassRoom();
    clazz.createField("m_"+_name, "Lanvil/script/Function;", ACC_PUBLIC|ACC_STATIC);
    clazz.createField("M_"+_name, "Lanvil/core/Any;", ACC_PUBLIC|ACC_STATIC);
    clazz.createMethod("m_"+_name, getSignature(), ACC_PUBLIC|ACC_ABSTRACT);
  }


}
View Full Code Here

    code.self();
    code.invokespecial(pool.addMethodRef("anvil/script/compiler/CompiledModule",
      "<init>", "()V"));
    context.popCode();
   
    Method versionmethod = clazz.createMethod("getVersion", "()I", ACC_PUBLIC);
    code = versionmethod.getCode();
    context.pushCode(code);
    code.iconst(_envelope.getVersion());
    code.ireturn();
View Full Code Here

   
 
  public void compileInit(ByteCompiler context)
  {
    ClassRoom clazz = context.getClassRoom();
    Method method = clazz.createMethod("init", "(Lanvil/script/Context;)V", ACC_PUBLIC|ACC_FINAL|ACC_SYNCHRONIZED);
    Code code = method.getCode();
    context.pushCode(code);
    code.addLocal();
    if (_init != null) {
      _init.compile(context);
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.