Package org.candle.decompiler.intermediate.expression

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


  }

  @Override
  public void visitStatementIntermediate(StatementIntermediate line) {
    //first, look for the
    Assignment assignment = extractConstantArrayAssignment(line.getExpression());
    if(assignment == null) {
      return;
    }
   
    //at this point, we know both the statement is an assignment, and that the left assignment is to a constant array value.
View Full Code Here


 
  public void collectConstantAssignments(AbstractIntermediate current, Map<Integer, Expression> assignments) {
    StatementIntermediate si = (StatementIntermediate)current;
   
    //get the assignment...
    Assignment assignment = extractConstantArrayAssignment(si.getExpression());
    if(assignment == null) {
      return;
    }
   
    Expression right = assignment.getRightHandSide();
    ArrayAccess apr = (ArrayAccess)assignment.getLeftHandSide();
    assignments.put(toInteger(apr.getIndex()), right);
   
    List<AbstractIntermediate> predecessor = Graphs.predecessorListOf(igc.getGraph(), current);
   
    if(predecessor.size() != 1) {
View Full Code Here

    String fieldName = instruction.getFieldName(cpg);
    Type fieldType = instruction.getFieldType(cpg);
   
    Expression right = context.getExpressions().pop();
    Variable variable = new Variable(context.getCurrentInstruction(), fieldType, fieldName);
    Assignment assignment = new Assignment(context.getCurrentInstruction(), variable, right);
   
    if(LOG.isDebugEnabled()) {
      for(Field field : context.getJavaClass().getFields()) {
        LOG.debug(field);
      }
View Full Code Here

  public Assignment extractConstantArrayAssignment(Expression line) {
    if(!(line instanceof Assignment)) {
      return null;
    }
   
    Assignment assignment = (Assignment)line;
   
    if(!(assignment.getLeftHandSide() instanceof ArrayAccess)) {
      return null;
    }
   
    ArrayAccess apr = (ArrayAccess)assignment.getLeftHandSide();
    if(!(apr.getArray() instanceof NewConstantArrayInstance)) {
      return null;
    }
   
    return assignment;
View Full Code Here

   
    Expression right = context.getExpressions().pop();
    Expression left = context.getExpressions().pop();
   
    FieldAccess fieldRef = new FieldAccess(context.getCurrentInstruction(), left, fieldName);
    Assignment assignment = new Assignment(context.getCurrentInstruction(), fieldRef, right);
   
    StatementIntermediate complete = new StatementIntermediate(context.getCurrentInstruction(), assignment);
   
    context.pushIntermediateToInstruction(complete);
  }
View Full Code Here

    if(variable == null) {
      variable = new Variable(context.getCurrentInstruction(), iv.getType(), iv.getName());
    }
   
    //create the assignment.
    Assignment assignment = new Assignment(context.getCurrentInstruction(), variable, right);
   
    Expression left = null;
    if(declared) {
      left = assignment;
    }
View Full Code Here

    Expression value = context.getExpressions().pop();
    Expression arrayPosition = context.getExpressions().pop();
    Expression arrayReference = context.getExpressions().pop();
   
    ArrayAccess arrayPositionReference = new ArrayAccess(context.getCurrentInstruction(), arrayReference, arrayPosition);
    Assignment assignment = new Assignment(context.getCurrentInstruction(), arrayPositionReference, value);
   
    StatementIntermediate si = new StatementIntermediate(context.getCurrentInstruction(), assignment);
   
    //add it to the intermediate lines.
    context.pushIntermediateToInstruction(si);
View Full Code Here

TOP

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

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.