Example #1
0
  public void outAFieldSignature(AFieldSignature node) {
    String className, fieldName;
    Type t;

    fieldName = (String) mProductions.removeLast();
    t = (Type) mProductions.removeLast();
    className = (String) mProductions.removeLast();

    SootClass cl = mResolver.makeClassRef(className);
    SootFieldRef field = Scene.v().makeFieldRef(cl, fieldName, t, false);

    mProductions.addLast(field);
  }
Example #2
0
  /*
    method_signature =
    cmplt [class_name]:class_name [first]:colon type [method_name]:name  l_paren parameter_list? r_paren cmpgt;
  */
  public void outAMethodSignature(AMethodSignature node) {
    String className, methodName;
    List parameterList = new ArrayList();
    Type returnType;

    if (node.getParameterList() != null) parameterList = (List) mProductions.removeLast();

    methodName = (String) mProductions.removeLast();
    Type type = (Type) mProductions.removeLast();
    className = (String) mProductions.removeLast();

    SootClass sootClass = mResolver.makeClassRef(className);
    SootMethodRef sootMethod =
        Scene.v().makeMethodRef(sootClass, methodName, parameterList, type, false);

    mProductions.addLast(sootMethod);
  }
Example #3
0
  public void outAStaticInvokeExpr(AStaticInvokeExpr node) {
    List args;

    if (node.getArgList() != null) args = (List) mProductions.removeLast();
    else args = new ArrayList();

    SootMethodRef method = (SootMethodRef) mProductions.removeLast();
    method =
        Scene.v()
            .makeMethodRef(
                method.declaringClass(),
                method.name(),
                method.parameterTypes(),
                method.returnType(),
                true);

    mProductions.addLast(Jimple.v().newStaticInvokeExpr(method, args));
  }
Example #4
0
 public void outASigFieldRef(ASigFieldRef node) {
   SootFieldRef field = (SootFieldRef) mProductions.removeLast();
   field = Scene.v().makeFieldRef(field.declaringClass(), field.name(), field.type(), true);
   mProductions.addLast(Jimple.v().newStaticFieldRef(field));
 }