Package org.candle.decompiler.intermediate.expression

Examples of org.candle.decompiler.intermediate.expression.Expression


    Type type = instruction.getType(cpg);
    Object instructionValue = instruction.getValue(cpg);
   
    if(Type.STRING == type) {
      Expression resolved = new StringLiteral(context.getCurrentInstruction(), instructionValue.toString());
      context.getExpressions().push(resolved);
      return;
    }
    else {
     
    }
   
    StringBuilder resolvedValue = new StringBuilder();
    if(instructionValue instanceof ConstantClass) {
      String clzName = getClassName((ConstantClass)instructionValue, cpg.getConstantPool());
      resolvedValue.append(clzName);
    }
    else {
      resolvedValue.append(instructionValue.toString());
    }
   
   
    Expression resolved = new Resolved(context.getCurrentInstruction(), type, resolvedValue.toString());
    context.getExpressions().push(resolved);
  }
View Full Code Here


    }
    else {
      incrementerBuilder.append(" += ").append(incrementBy);
    }
   
    Expression exp = new Increment(context.getCurrentInstruction(), variable, Type.INT, incrementerBuilder.toString());
    context.pushIntermediateToInstruction(new StatementIntermediate(context.getCurrentInstruction(), exp));
  }
View Full Code Here

  }

  //Process all single-value conditionals.
  @Override
  public void visitIFLT(IFLT instruction) {
    Expression left = context.getExpressions().pop();
    //TODO: this should probably be resolved to it's left expression value for the resovled value.
    Expression right = new Resolved(context.getCurrentInstruction(), null, "0");
    processMultiConditionalStatement(OperationType.LESS, left, right);
  }
View Full Code Here

    processMultiConditionalStatement(OperationType.LESS, left, right);
  }
 
  @Override
  public void visitIFGT(IFGT instruction) {
    Expression right = new Resolved(context.getCurrentInstruction(), null, "0");
    Expression left = context.getExpressions().pop();
    processMultiConditionalStatement(OperationType.GREATER, left, right);
  }
View Full Code Here

    processMultiConditionalStatement(OperationType.GREATER, left, right);
  }

  @Override
  public void visitIFGE(IFGE obj) {
    Expression right = new Resolved(context.getCurrentInstruction(), null, "0");
    Expression left = context.getExpressions().pop();
    processMultiConditionalStatement(OperationType.GREATER_EQUAL, left, right);
  }
View Full Code Here

    Expression left = context.getExpressions().pop();
    processMultiConditionalStatement(OperationType.GREATER_EQUAL, left, right);
  }
  @Override
  public void visitIFLE(IFLE obj) {
    Expression right = new Resolved(context.getCurrentInstruction(), null, "0");
    Expression left = context.getExpressions().pop();
    processMultiConditionalStatement(OperationType.LESS_EQUAL, left, right);
  }
View Full Code Here

    processMultiConditionalStatement(OperationType.LESS_EQUAL, left, right);
  }
 
  @Override
  public void visitIFNE(IFNE instruction) {
    Expression left = context.getExpressions().pop();
    SingleConditional conditional = new SingleConditional(context.getCurrentInstruction(), left, false);
    BooleanBranchIntermediate line = new BooleanBranchIntermediate(context.getCurrentInstruction(), conditional);
    context.pushIntermediateToInstruction(line);
  }
View Full Code Here

    context.pushIntermediateToInstruction(line);
  }
 
  @Override
  public void visitIFEQ(IFEQ instruction) {
    Expression left = context.getExpressions().pop();
    SingleConditional conditional = new SingleConditional(context.getCurrentInstruction(), left);
    BooleanBranchIntermediate line = new BooleanBranchIntermediate(context.getCurrentInstruction(), conditional);
    context.pushIntermediateToInstruction(line);
  }
View Full Code Here

    context.pushIntermediateToInstruction(line);
  }
 
  @Override
  public void visitIFNULL(IFNULL instruction) {
    Expression left = context.getExpressions().pop();
    Expression right = new NullLiteral(context.getCurrentInstruction());
   
    MultiConditional conditional = new MultiConditional(context.getCurrentInstruction(), left, right, OperationType.EQ);
    BooleanBranchIntermediate line = new BooleanBranchIntermediate(context.getCurrentInstruction(), conditional);
    context.pushIntermediateToInstruction(line);
  }
View Full Code Here

    context.pushIntermediateToInstruction(line);
  }

  @Override
  public void visitIFNONNULL(IFNONNULL instruction) {
    Expression left = context.getExpressions().pop();
    Expression right = new NullLiteral(context.getCurrentInstruction());
   
    MultiConditional conditional = new MultiConditional(context.getCurrentInstruction(), left, right, OperationType.NE);
    BooleanBranchIntermediate line = new BooleanBranchIntermediate(context.getCurrentInstruction(), conditional);
    context.pushIntermediateToInstruction(line);
  }
View Full Code Here

TOP

Related Classes of org.candle.decompiler.intermediate.expression.Expression

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.