Search in sources :

Example 1 with ASTListener

use of org.candle.decompiler.intermediate.expression.ASTListener 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)

Aggregations

ObjectType (org.apache.bcel.generic.ObjectType)1 ASTListener (org.candle.decompiler.intermediate.expression.ASTListener)1 Expression (org.candle.decompiler.intermediate.expression.Expression)1 NewInstance (org.candle.decompiler.intermediate.expression.NewInstance)1