Package org.allspice.bytecode

Examples of org.allspice.bytecode.FieldDef


public class TestField extends MyTestCase {
  public ClassDef defadd(String type) {
    ClassDef cd = makeClass() ;
   
    FieldDef fd = new FieldDef(Scope.PUBLIC,new TypeName(type),"foo") ;
    cd = cd.addField(fd) ;
    {
      Var x = new Var(1,new TypeName(type)) ;
      MethodDef md = new MethodDef(TypeName.VOID,"setFoo",x) ;
      md = md.addInstructions(
View Full Code Here


import org.allspice.bytecode.instructions.Store;

public class TestStaticField extends MyTestCase {
  public ClassDef defadd(String type) {
    ClassDef cd = makeClassDef() ;
    FieldDef fd = new FieldDef(Scope.PUBLIC,new TypeName(type),"foo") ;
    fd = fd.setStatic(true) ;
    cd = cd.addField(fd) ;
    {
      Var x = new Var(0,new TypeName(type)) ;
      MethodDef md = new MethodDef(TypeName.VOID,"setFoo",x) ;
      md = md.setStatic(true) ;
View Full Code Here

import org.allspice.bytecode.instructions.Return;

public class TestArrLd extends MyTestCase {
  public ClassDef defadd(String type) {
    ClassDef cd = makeClassDef() ;
    FieldDef fd = new FieldDef(Scope.PUBLIC,new TypeName(type),"foo") ;
    fd = fd.setStatic(true) ;
    cd = cd.addField(fd) ;
    {
      Var x = new Var(0,new TypeName(type+"[]")) ;
      Var y = new Var(1,TypeName.INT) ;
      MethodDef md = new MethodDef(new TypeName(type),"getFoo",x,y) ;
View Full Code Here

    Scope scope =
      fieldAttrs.visibility == Visibility.PUBLIC ? Scope.PUBLIC :
      fieldAttrs.visibility == Visibility.PROTECTED ? Scope.PROTECTED :
      fieldAttrs.visibility == Visibility.PRIVATE ? Scope.PRIVATE :
      Scope.PROTECTED ;
    FieldDef fdef = new FieldDef(scope,fuinfo.getFullQualified(fdecl.type),fdecl.name,o == null ? null : o.o) ;
    if (fieldAttrs.isStatic) {
      fdef = fdef.setStatic(true) ;
    }
    if (fieldAttrs.isVolatile) {
      fdef = fdef.setVolatile(true) ;
    }
    if (fieldAttrs.isTransient) {
      fdef = fdef.setTransient(true) ;
    }
    if (fieldAttrs.isFinal) {
      fdef = fdef.setFinal(true) ;
    }
    return fdef ;
  }
View Full Code Here

import org.allspice.bytecode.instructions.Store;

public class TestArrStr extends MyTestCase {
  public ClassDef defadd(String type) {
    ClassDef cd = makeClassDef() ;
    FieldDef fd = new FieldDef(Scope.PUBLIC,new TypeName(type),"foo") ;
    fd = fd.setStatic(true) ;
    cd = cd.addField(fd) ;
    {
      Var x = new Var(0,new TypeName(type+"[]")) ;
      Var y = new Var(1,TypeName.INT) ;
      Var z = new Var(2,new TypeName(type)) ;
View Full Code Here

import org.allspice.bytecode.instructions.Return;

public class TestArrLen extends MyTestCase {
  public ClassDef defadd(String type) {
    ClassDef cd = makeClassDef() ;
    FieldDef fd = new FieldDef(Scope.PUBLIC,new TypeName(type),"foo") ;
    fd = fd.setStatic(true) ;
    cd = cd.addField(fd) ;
    {
      Var x = new Var(0,new TypeName(type+"[]")) ;
      MethodDef md = new MethodDef(TypeName.INT,"getFoo",x) ;
      md = md.setStatic(true) ;
View Full Code Here

TOP

Related Classes of org.allspice.bytecode.FieldDef

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.