Search in sources :

Example 1 with FooMethodCall

use of dk.brics.soot.intermediate.representation.FooMethodCall in project soot by Sable.

the class ExprTranslator method handleSpecialCall.

// any type
boolean handleSpecialCall(InstanceInvokeExpr expr, SootMethod target) {
    String mn = target.getName();
    int np = target.getParameterCount();
    SootClass dc = target.getDeclaringClass();
    // Is it a method in a Foo object?
    if (isFoo(dc)) {
        if (mn.equals("foo") && np == 1) {
            Variable lvar = new Variable(Variable.Type.FOO);
            Method foo = new Method("foo", new Variable[0]);
            FooMethodCall fmc = new FooMethodCall(foo);
            fmc.setAssignmentTarget(lvar);
            st.addStatement(fmc);
            return true;
        }
        // Unknown Foo method
        return false;
    }
    // Not a special call
    return false;
}
Also used : Variable(dk.brics.soot.intermediate.representation.Variable) FooMethodCall(dk.brics.soot.intermediate.representation.FooMethodCall) SootMethod(soot.SootMethod) Method(dk.brics.soot.intermediate.representation.Method) SootClass(soot.SootClass)

Aggregations

FooMethodCall (dk.brics.soot.intermediate.representation.FooMethodCall)1 Method (dk.brics.soot.intermediate.representation.Method)1 Variable (dk.brics.soot.intermediate.representation.Variable)1 SootClass (soot.SootClass)1 SootMethod (soot.SootMethod)1