Search in sources :

Example 21 with Expression

use of org.candle.decompiler.intermediate.expression.Expression in project candle-decompiler by bradsdavis.

the class MethodIntermediateVisitor method visitIFGE.

@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);
}
Also used : TypedExpression(org.candle.decompiler.intermediate.expression.TypedExpression) Expression(org.candle.decompiler.intermediate.expression.Expression) Resolved(org.candle.decompiler.intermediate.expression.Resolved)

Example 22 with Expression

use of org.candle.decompiler.intermediate.expression.Expression in project candle-decompiler by bradsdavis.

the class MethodIntermediateVisitor method visitIRETURN.

public void visitIRETURN(IRETURN instruction) {
    Expression exp = context.getExpressions().pop();
    Return ret = new Return(context.getCurrentInstruction(), exp);
    processReturn(ret);
}
Also used : Return(org.candle.decompiler.intermediate.expression.Return) TypedExpression(org.candle.decompiler.intermediate.expression.TypedExpression) Expression(org.candle.decompiler.intermediate.expression.Expression)

Example 23 with Expression

use of org.candle.decompiler.intermediate.expression.Expression in project candle-decompiler by bradsdavis.

the class MethodIntermediateVisitor method visitANEWARRAY.

/**
	 * 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);
    } else {
        nai = new ArrayCreation(context.getCurrentInstruction(), type, count);
    }
    context.getExpressions().push(nai);
}
Also used : OperationType(org.candle.decompiler.intermediate.expression.OperationType) ArithmeticType(org.candle.decompiler.intermediate.expression.ArithmeticType) TypedExpression(org.candle.decompiler.intermediate.expression.TypedExpression) Expression(org.candle.decompiler.intermediate.expression.Expression) ArrayCreation(org.candle.decompiler.intermediate.expression.ArrayCreation) NewConstantArrayInstance(org.candle.decompiler.intermediate.expression.NewConstantArrayInstance)

Example 24 with Expression

use of org.candle.decompiler.intermediate.expression.Expression in project candle-decompiler by bradsdavis.

the class MethodIntermediateVisitor method visitIFLE.

@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);
}
Also used : TypedExpression(org.candle.decompiler.intermediate.expression.TypedExpression) Expression(org.candle.decompiler.intermediate.expression.Expression) Resolved(org.candle.decompiler.intermediate.expression.Resolved)

Example 25 with Expression

use of org.candle.decompiler.intermediate.expression.Expression in project candle-decompiler by bradsdavis.

the class MethodIntermediateVisitor method visitARETURN.

public void visitARETURN(ARETURN instruction) {
    Expression exp = context.getExpressions().pop();
    Return ret = new Return(context.getCurrentInstruction(), exp);
    processReturn(ret);
}
Also used : Return(org.candle.decompiler.intermediate.expression.Return) TypedExpression(org.candle.decompiler.intermediate.expression.TypedExpression) Expression(org.candle.decompiler.intermediate.expression.Expression)

Aggregations

Expression (org.candle.decompiler.intermediate.expression.Expression)52 TypedExpression (org.candle.decompiler.intermediate.expression.TypedExpression)46 Resolved (org.candle.decompiler.intermediate.expression.Resolved)11 StatementIntermediate (org.candle.decompiler.intermediate.code.StatementIntermediate)10 ArithmeticType (org.candle.decompiler.intermediate.expression.ArithmeticType)10 OperationType (org.candle.decompiler.intermediate.expression.OperationType)10 ArrayList (java.util.ArrayList)6 Assignment (org.candle.decompiler.intermediate.expression.Assignment)6 BooleanBranchIntermediate (org.candle.decompiler.intermediate.code.BooleanBranchIntermediate)5 Return (org.candle.decompiler.intermediate.expression.Return)5 ArrayAccess (org.candle.decompiler.intermediate.expression.ArrayAccess)4 GeneratedVariable (org.candle.decompiler.intermediate.expression.GeneratedVariable)4 MethodInvocation (org.candle.decompiler.intermediate.expression.MethodInvocation)4 MultiConditional (org.candle.decompiler.intermediate.expression.MultiConditional)4 Variable (org.candle.decompiler.intermediate.expression.Variable)4 IntermediateVariable (org.candle.decompiler.intermediate.IntermediateVariable)3 ArrayCreation (org.candle.decompiler.intermediate.expression.ArrayCreation)3 Declaration (org.candle.decompiler.intermediate.expression.Declaration)3 NewConstantArrayInstance (org.candle.decompiler.intermediate.expression.NewConstantArrayInstance)3 AbstractIntermediate (org.candle.decompiler.intermediate.code.AbstractIntermediate)2