Package edu.cmu.cs.fusion.relationship

Examples of edu.cmu.cs.fusion.relationship.EntryInstruction


      vArr[ndx] = var;
      ndx++;
    }
                                 
   
    return new Pair<EntryInstruction, Method>(new EntryInstruction(tarVar, params, methodBinding), new Method(vArr, tarVar, methodBinding))
  }
View Full Code Here


  public ConsList<Binding> matches(TypeHierarchy types, Method method, TACInstruction instr) {
    if (!(instr instanceof EntryInstruction))
      return null;

    EntryInstruction invoke = (EntryInstruction) instr;

    IMethodBinding binding = invoke.resolveBinding();
   
    if (methodName != null && !(methodName.equals(binding.getName())))
      return null;

    if (thisType != null && !types.existsCommonSubtype(thisType, binding.getDeclaringClass().getQualifiedName()))
      return null;
   
    //it's ok if we have a receiver and we're static (we just won't use it), but not the other way around.
    if (invoke.getReceiver() == null && !isStatic)
      return null;

    ConsList<Binding> vars = ConsList.empty();
    if (paramTypes != null) {
      if (binding.getParameterTypes().length != paramTypes.length)
        return null;
     
      Variable[] params = method.getParams();
 
      for (int ndx = 0; ndx < paramTypes.length; ndx++) {
        if (!types.existsCommonSubtype(paramTypes[ndx], binding.getParameterTypes()[ndx].getQualifiedName()))
          return null;
        vars = ConsList.cons(new Binding(paramNames[ndx], params[ndx]), vars);
      }
    }
   
    if (!isStatic)
      vars = ConsList.cons(new Binding(Constraint.RECEIVER, invoke.getReceiver()), vars);
   
    return vars;
  }
View Full Code Here

TOP

Related Classes of edu.cmu.cs.fusion.relationship.EntryInstruction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.