Search in sources :

Example 51 with Expression

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

the class ExpressionEnhancer method visitStatementIntermediate.

@Override
public void visitStatementIntermediate(StatementIntermediate line) {
    Expression exp = line.getExpression();
    // ok, now we can visit the expression...
    exp.visit(new ASTListener() {

        @Override
        public void accept(Expression e) {
            if (e instanceof NewInstance) {
                if (((NewInstance) e).getType() instanceof ObjectType) {
                    ObjectType obj = (ObjectType) ((NewInstance) e).getType();
                    if (StringUtils.equals("java.lang.StringBuilder", obj.getClassName())) {
                        System.out.println(obj.getClassName());
                    }
                }
            }
        }
    });
}
Also used : ObjectType(org.apache.bcel.generic.ObjectType) Expression(org.candle.decompiler.intermediate.expression.Expression) ASTListener(org.candle.decompiler.intermediate.expression.ASTListener) NewInstance(org.candle.decompiler.intermediate.expression.NewInstance)

Example 52 with Expression

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

the class StackClonePointListener method setup.

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);
    }
}
Also used : 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