Package org.candle.decompiler.intermediate.expression

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


  /**
   * Decompiles "new object array" operations.
   */
  public void visitANEWARRAY(ANEWARRAY instruction) {
    Type type = instruction.getType(context.getMethodGen().getConstantPool());
    Expression count = context.getExpressions().pop();

    ArrayCreation nai = null;
   
    if(context.getCurrentInstruction().getNext().getInstruction() instanceof DUP) {
      nai = new NewConstantArrayInstance(context.getCurrentInstruction(), type, count);
View Full Code Here


    context.getExpressions().push(nai);
  }
 
  //array load operations
  protected void processArrayLoad() {
    Expression arrayPosition = context.getExpressions().pop();
    Expression arrayObject = context.getExpressions().pop();
   
    //now, we just need to create the array reference.
   
    ArrayAccess apr = new ArrayAccess(context.getCurrentInstruction(), arrayObject, arrayPosition);
    context.getExpressions().push(apr);
View Full Code Here

  }

  public void visitConversionInstruction(ConversionInstruction instruction) {
    ConstantPoolGen cpg = context.getMethodGen().getConstantPool();
   
    Expression right = context.getExpressions().pop();
    Type type = instruction.getType(cpg);
   
    //now see what type it is.
    LOG.debug("To Type: "+type);
   
View Full Code Here

    //handle in subtype.
  }

 
  public void visitATHROW(ATHROW instruction) {
    Expression expression = context.getExpressions().pop();
    Throw throwException = new Throw(context.getCurrentInstruction(), expression);
   
    StatementIntermediate complete = new StatementIntermediate(context.getCurrentInstruction(), throwException);
    context.pushIntermediateToInstruction(complete);
  }
View Full Code Here

    // TODO Auto-generated method stub
  }
 

  protected void processComparator() {
    Expression left = context.getExpressions().pop();
    Expression right = context.getExpressions().pop();

    MultiConditional conditional = new MultiConditional(context.getCurrentInstruction(), left, right, OperationType.EQ);
    BooleanBranchIntermediate line = new BooleanBranchIntermediate(this.context.getCurrentInstruction(), conditional);
    context.pushIntermediateToInstruction(line);
  }
View Full Code Here

  }
  public void visitFCMPL(FCMPL instruction) {
    processComparator();
  }
  public void visitLCMP(LCMP instruction) {
    Expression left = context.getExpressions().pop();
    Expression right = context.getExpressions().pop();
   
    MultiConditional eq = new MultiConditional(context.getCurrentInstruction(), left, right, OperationType.EQ);
    MultiConditional logic = new MultiConditional(context.getCurrentInstruction(), left, right, OperationType.GREATER);
   
    Resolved r0 = new Resolved(context.getCurrentInstruction(), Type.INT, "0");
View Full Code Here

  public void visitTABLESWITCH(TABLESWITCH instruction) {
    handleSwitch();
  }

  public void handleSwitch() {
    Expression switchVal = context.getExpressions().pop();
    Switch switchExpression = new Switch(context.getCurrentInstruction(), switchVal);

    MultiBranchIntermediate mbi = new MultiBranchIntermediate(context.getCurrentInstruction(), switchExpression);
    context.pushIntermediateToInstruction(mbi);
  }
View Full Code Here

    return null;
  }
 
  private boolean firstMatchesGeneratedVariables(StatementIntermediate first, GeneratedVariable generatedArrayRef, GeneratedVariable generatedArrayIterator) {
    Declaration childDeclaration = (Declaration)first.getExpression();
    Expression right = childDeclaration.getAssignment().getRightHandSide();
   
    if(right instanceof ArrayAccess) {
      ArrayAccess apr = (ArrayAccess)right;
     
      if(!(apr.getIndex() instanceof Variable)) {
View Full Code Here

  }
 
  @Override
  public void write(Writer builder) throws IOException {
    final String indent = buildIndent();
    Expression expression = intermediate.getExpression();
   
    builder.write(indent);
    expression.write(builder);
    builder.write(";");
  }
View Full Code Here

  }
 
  public void setup(EdgeTraversalEvent<InstructionHandle, IntermediateEdge> e) {
    switchStack((InstructionHandle)e.getEdge().getTarget());
    if(e.getEdge().getType() == EdgeType.EXCEPTION) {
      Expression exExp = (Expression)e.getEdge().getAttributes().get(ExceptionEdgeEnhancer.EXCEPTION_STACK_KEY);
      ic.getExpressions().add(exExp);
    }
  }
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.