Package org.jreversepro.ast.expression

Examples of org.jreversepro.ast.expression.Constant


  @Test
  public void testSerializedArgs() {
    MethodAccessExpression mex;
   
    Expression exp1 = new Constant(4);
    Expression exp2 = new Constant(6);
   
    List<Expression> args = new ArrayList<Expression>();
    args.add(exp1);
    args.add(exp2);
   
View Full Code Here


    }
    if (evalMachine.prevOpcode < OPCODE_LCMP
        || evalMachine.prevOpcode > OPCODE_DCMPG) {
      // To be compared with 0
      evalMachine.conditionExpression = null;
      Expression rhs = new Constant(JLSConstants.VALUE_0, lhs.getType());

      evalMachine.conditionExpression = new ConditionExpression(lhs, rhs, op);
    }

  }
View Full Code Here

  }

  @Override
  void evaluate(Instruction ins) {
    int val = ins.opcode - OPCODE_LCONST_0;
    evalMachine.push(new Constant(val, JVM_TYPE_LONG));
  }
View Full Code Here

    switch (ins.opcode) {
    case OPCODE_LDC: {
      // Utf8 Value is referred to here.
      int ldcIndex = ins.getArgUnsignedByte();
      String ldcString = pool.getLdcString(ldcIndex);
      evalMachine.push(new Constant(ldcString, pool.getDataType(ldcIndex)));
      break;
    }
    case OPCODE_LDC_W: { // ldc_w
      int ldcIndex = ins.getArgUnsignedShort();
      evalMachine.push(new Constant(pool.getLdcString(ldcIndex),
          CLASS_LANG_STRING));
      break;
    }
    case OPCODE_LDC2_W: { // ldc2_w
      int ldcIndex = ins.getArgUnsignedShort();
      evalMachine.push(new Constant(pool.getEntryValue(ldcIndex), pool
          .getDataType(ldcIndex)));
      break;
    }
    }
  }
View Full Code Here

  }

  @Override
  void evaluate(Instruction ins) {
    int val = ins.opcode - OPCODE_ICONST_0;
    evalMachine.push(new Constant(String.valueOf(val), JVM_TYPE_INT));
  }
View Full Code Here

  @Override
  void evaluate(Instruction ins) {
    switch (ins.opcode) {
    case OPCODE_BIPUSH: {
      evalMachine.push(new Constant(ins.getArgByte(), JVM_TYPE_BYTE));
      break;
    }
    case OPCODE_SIPUSH: {
      // Sign Extend This
      evalMachine.push(new Constant(ins.getArgShort(), JVM_TYPE_SHORT));
      break;
    }
    }
  }
View Full Code Here

    Variable var = new Variable(varTable, JVM_TYPE_INT, ins
        .getArgUnsignedWide(), ins.currentPc);
    int constant = ins.getArgWide(1);

    if (constant < 0) {
      Constant ct = new Constant(-constant);
      statements.append(new CompleteLine(ins, new BinaryOpExpression(var,
          BinaryOperator.SMART_MINUS, ct, JVM_TYPE_INT)));
    } else {
      Constant ct = new Constant(constant);
      statements.append(new CompleteLine(ins, new BinaryOpExpression(var,
          BinaryOperator.SMART_PLUS, ct, JVM_TYPE_INT)));
    }

  }
View Full Code Here

  @Test
  public void testSerializedArgs() {
    MethodAccessExpression mex;
   
    Expression exp1 = new Constant(4);
    Expression exp2 = new Constant(6);
   
    List<Expression> args = new ArrayList<Expression>();
    args.add(exp1);
    args.add(exp2);
   
View Full Code Here

TOP

Related Classes of org.jreversepro.ast.expression.Constant

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.