use of org.candle.decompiler.intermediate.expression.Ternary in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method visitLCMP.
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");
Resolved rN = new Resolved(context.getCurrentInstruction(), Type.INT, "-1");
Resolved rP = new Resolved(context.getCurrentInstruction(), Type.INT, "1");
Ternary tern2 = new Ternary(context.getCurrentInstruction(), ObjectType.INT, logic, rP, rN);
Ternary tern1 = new Ternary(context.getCurrentInstruction(), Type.INT, eq, r0, tern2);
context.getExpressions().push(tern1);
}
Aggregations