Package anvil.codec

Examples of anvil.codec.Field


        "register", "(Ljava/lang/String;)I");
      BindingEnumeration e = _symbols.keysAndElements();
      while(e.hasMoreElements()) {
        int index = ((Integer)e.nextKey()).intValue();
        String name = (String)e.nextElement();
        Field field = clazz.createField("r_"+name, "I", ACC_PUBLIC|ACC_STATIC|ACC_FINAL);
        code.astring(name);
        code.invokestatic(register);
        code.putstatic(field);
      }
    }
View Full Code Here


 

  public void compile(ByteCompiler context)
  {
    ClassRoom clazz = context.getClassRoom();
    Field typefield = clazz.createField("f_"+_name, "Lanvil/script/Function;", ACC_PUBLIC|ACC_STATIC);
    clazz.createField("F_"+_name, "Lanvil/core/Any;", ACC_PUBLIC|ACC_STATIC);
    Method method = clazz.createMethod("f_"+_name, getSignature(), ACC_PUBLIC|ACC_FINAL|ACC_STATIC|(_synchronized?ACC_SYNCHRONIZED:0));
    compileBody(context, method, typefield);
  }
View Full Code Here

  protected static void compileMembers(ByteCompiler context, int size, Enumeration types)
  {
    ClassRoom clazz = context.getClassRoom();
    ConstantPool pool = clazz.getPool();
    Field members = clazz.createField("_members", "[Ljava/lang/Object;", Code.ACC_PUBLIC|Code.ACC_STATIC);
    Code code = clazz.getStatic().getCode();
    context.pushCode(code);
    int intclazz = pool.addClass("java/lang/Integer");
    int intclazzctor = pool.addMethodRef(intclazz, "<init>", "(I)V");
    code.iconst(size * 4);
 
View Full Code Here

  {
    ClassRoom clazz = context.getClassRoom().createClass(getDescriptor(), "i_"+_name);
    clazz.setAccessFlags(context.ACC_PUBLIC);
    ConstantPool pool = clazz.getPool();
    context.pushClass(clazz);
    Field typefield1 = clazz.createField("_class", "Lanvil/script/compiler/CompiledInterfaceType;", Code.ACC_PUBLIC|Code.ACC_STATIC);
    Field typefield2 = clazz.createField("_type", "Lanvil/core/Any;", Code.ACC_PUBLIC|Code.ACC_STATIC);
    clazz.setSuperClassname(context.TYPE_OBJECT);
    clazz.setAccessFlags(Code.ACC_SUPER|Code.ACC_PUBLIC);

    compileMembers(context, _types.size(), _types.elements());

    Field bases = clazz.createField("_bases", "[Ljava/lang/String;", Code.ACC_PUBLIC|Code.ACC_STATIC);
    Code code = clazz.getStatic().getCode();
    context.pushCode(code);

    //code.println("INTERFACE-START:"+getDescriptor());
    code.getstatic(pool.addFieldRef(_parent.getDescriptor(),
View Full Code Here


  public void compile(ByteCompiler context)
  {
    ClassRoom clazz = context.getClassRoom();
    Field typefield = clazz.createField("m_"+_name, "Lanvil/script/Function;", ACC_PUBLIC|ACC_STATIC);
    clazz.createField("M_"+_name, "Lanvil/core/Any;", ACC_PUBLIC|ACC_STATIC);
    Method method = clazz.createMethod("m_"+_name, getSignature(), ACC_PUBLIC|(_synchronized?ACC_SYNCHRONIZED:0));
    compileBody(context, method, typefield);
  }
View Full Code Here

   
    ClassRoom clazz = context.getClassRoom().createClass(_descriptor, "z_"+_name);
    clazz.setAccessFlags(Code.ACC_PUBLIC);
    ConstantPool pool = clazz.getPool();
    context.pushClass(clazz);
    Field typefield1 = clazz.createField("_class", "Lanvil/script/compiler/CompiledClassType;", Code.ACC_PUBLIC|Code.ACC_STATIC);
    Field typefield2 = clazz.createField("_type", "Lanvil/core/Any;", Code.ACC_PUBLIC|Code.ACC_STATIC);
    ClassType base = getBaseClass();
    if (base != Any.__class__) {
      clazz.setSuperClassname(base.getDescriptor());
    } else {
      clazz.setSuperClassname("anvil/core/AnyClass");
    }
    clazz.setAccessFlags(Code.ACC_SUPER|Code.ACC_PUBLIC);

    Field bases = clazz.createField("_bases", "[Ljava/lang/String;", Code.ACC_PUBLIC|Code.ACC_STATIC);
    Code code = clazz.getStatic().getCode();
    context.pushCode(code);
   
    code.getstatic(pool.addFieldRef(_parent.getDescriptor(), "_members", "[Ljava/lang/Object;"));
    code.pop();
View Full Code Here

  public void compile(ByteCompiler context)
  {
    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

  {
    ClassRoom clazz = context.getClassRoom().createClass(getDescriptor(), "n_"+_name);
    clazz.setAccessFlags(context.ACC_PUBLIC);
    ConstantPool pool = clazz.getPool();
    context.pushClass(clazz);
    Field typefield1 = clazz.createField("_class", "Lanvil/script/compiler/CompiledNamespace;", Code.ACC_PUBLIC|Code.ACC_STATIC);
    Field typefield2 = clazz.createField("_type", "Lanvil/core/Any;", Code.ACC_PUBLIC|Code.ACC_STATIC);
    clazz.setSuperClassname(context.TYPE_OBJECT);
    clazz.setAccessFlags(Code.ACC_SUPER|Code.ACC_PUBLIC);

    compileMembers(context, _types.size(), _types.elements());
View Full Code Here

    clsid.append(_address.getPathinfo());
    clsid.append(" 1.0 ");
    LocalizationPreferences prefs = _address.getZone().getLocalizationPreferences();
    Calendar cal = Calendar.getInstance(prefs.getTimezoneInstance(), prefs.getLocaleInstance());
    anvil.util.Conversions.toString(clsid, cal);
    Field clsidfield = clazz.createField("_id", "Ljava/lang/String;", ACC_PUBLIC|ACC_STATIC|ACC_FINAL);
    clsidfield.setConstantValue(pool.addString(clsid.toString()));

    context.pushCode(code);
    code.self();
    code.invokespecial(pool.addMethodRef("anvil/script/compiler/CompiledModule",
      "<init>", "()V"));
View Full Code Here

  private void compileDependencies(ByteCompiler context)
  {
    ClassRoom clazz = context.getClassRoom();
    Code code = context.getCode();
    ConstantPool pool = code.getPool();
    Field field = clazz.createField("_imports", "[Ljava/lang/String;", Code.ACC_PUBLIC|Code.ACC_STATIC);
    code.iconst(_dependencies.size()*2);
    code.anewarray("java/lang/String");
    Iterator iter = _dependencies.values().iterator();
    for(int i=0; iter.hasNext(); ) {
      Dependency dep = (Dependency)iter.next();
View Full Code Here

TOP

Related Classes of anvil.codec.Field

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.