Search in sources :

Example 1 with Cast

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

the class MethodIntermediateVisitor method visitConversionInstruction.

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);
    Resolved resolve = new Resolved(context.getCurrentInstruction(), type, type.toString());
    Cast cast = new Cast(context.getCurrentInstruction(), resolve, right);
    context.getExpressions().push(cast);
}
Also used : Cast(org.candle.decompiler.intermediate.expression.Cast) 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) Resolved(org.candle.decompiler.intermediate.expression.Resolved)

Aggregations

ArithmeticType (org.candle.decompiler.intermediate.expression.ArithmeticType)1 Cast (org.candle.decompiler.intermediate.expression.Cast)1 Expression (org.candle.decompiler.intermediate.expression.Expression)1 OperationType (org.candle.decompiler.intermediate.expression.OperationType)1 Resolved (org.candle.decompiler.intermediate.expression.Resolved)1 TypedExpression (org.candle.decompiler.intermediate.expression.TypedExpression)1