Package com.dragome.compiler.ast

Examples of com.dragome.compiler.ast.FieldWrite


        Expression rhs= stack.pop();

        int index= bytes.readUnsignedShort();
        ConstantFieldref fieldRef= (ConstantFieldref) constantPool.getConstant(index, Constants.CONSTANT_Fieldref);

        FieldAccess fa= new FieldWrite();
        fa.setName(getFieldName(fieldRef));
        fa.setType(new ObjectType(fieldRef.getClass(constantPool)));
        fa.initialize(methodDecl);

        if (opcode == Const.PUTFIELD)
        {
          fa.setExpression(stack.pop());
        }

        a.setLeftHandSide(fa);
        a.setRightHandSide(rhs);

        instruction= a;
        break;
      }

      case Const.GETFIELD:
      {

        int index= bytes.readUnsignedShort();
        ConstantFieldref fieldRef= (ConstantFieldref) constantPool.getConstant(index, Constants.CONSTANT_Fieldref);

        Expression ex= stack.pop();
        FieldAccess fa= new FieldRead();
        fa.setType(new ObjectType(fieldRef.getClass(constantPool)));
        fa.setName(getFieldName(fieldRef));
        fa.setExpression(ex);
        fa.initialize(methodDecl);
        instruction= fa;
        break;
      }

      case Const.GETSTATIC:
      {

        int index= bytes.readUnsignedShort();
        ConstantFieldref fieldRef= (ConstantFieldref) constantPool.getConstant(index, Constants.CONSTANT_Fieldref);

        FieldAccess fa= new FieldRead();
        fa.setType(new ObjectType(fieldRef.getClass(constantPool)));
        fa.setName(getFieldName(fieldRef));
        fa.initialize(methodDecl);

        instruction= fa;
        break;
      }
View Full Code Here

TOP

Related Classes of com.dragome.compiler.ast.FieldWrite

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.