use of org.candle.decompiler.intermediate.expression.Expression in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method printExpressions.
public void printExpressions() {
if (LOG.isDebugEnabled()) {
List<Expression> currentStack = new ArrayList<Expression>(context.getExpressions());
LOG.debug("Current Expression Stack: ");
for (Expression e : currentStack) {
LOG.debug("Expression Stack: " + e);
}
}
}
use of org.candle.decompiler.intermediate.expression.Expression in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method visitLDC2_W.
public void visitLDC2_W(LDC2_W instruction) {
//load from constant pool.
LOG.debug("Loading from constant pool" + instruction.getClass());
MethodGen mg = context.getMethodGen();
ConstantPoolGen cpg = mg.getConstantPool();
Type type = instruction.getType(cpg);
Object instructionValue = instruction.getValue(cpg);
if (Type.STRING == type) {
Expression resolved = new StringLiteral(context.getCurrentInstruction(), instructionValue.toString());
context.getExpressions().push(resolved);
return;
} else {
}
StringBuilder resolvedValue = new StringBuilder();
if (instructionValue instanceof ConstantClass) {
String clzName = getClassName((ConstantClass) instructionValue, cpg.getConstantPool());
resolvedValue.append(clzName);
} else {
resolvedValue.append(instructionValue.toString());
}
Expression resolved = new Resolved(context.getCurrentInstruction(), type, resolvedValue.toString());
context.getExpressions().push(resolved);
}
use of org.candle.decompiler.intermediate.expression.Expression in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method processArrayLoad.
//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);
}
use of org.candle.decompiler.intermediate.expression.Expression in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method visitDUP_X1.
public void visitDUP_X1(DUP_X1 instruction) {
Expression one = context.getExpressions().pop();
Expression two = context.getExpressions().pop();
context.getExpressions().push(one);
context.getExpressions().push(two);
context.getExpressions().push(one);
}
use of org.candle.decompiler.intermediate.expression.Expression in project candle-decompiler by bradsdavis.
the class MethodIntermediateVisitor method processMultiConditionalStatement.
public void processMultiConditionalStatement(OperationType operation) {
//first, get the things to be operated on.
Expression right = context.getExpressions().pop();
Expression left = context.getExpressions().pop();
processMultiConditionalStatement(operation, left, right);
}
Aggregations