Package edu.cmu.cs.fusion.xml

Examples of edu.cmu.cs.fusion.xml.NamedTypeBinding


    List<StubVariable> vars = new LinkedList<StubVariable>();
    vars.add(new StubVariable("p0", "Bar"));
   
    StubNewObjectInstruction instr = new StubNewObjectInstruction(vars,
         new StubMethodBinding(new NamedTypeBinding("Foo"), new NamedTypeBinding[]{new NamedTypeBinding("Bar")}), new StubVariable("tVar", "Foo"));
   
    TestAliasContext aliases = new TestAliasContext();
    aliases.addAlias(instr.getTarget(), labels[3]);
    aliases.addAlias(instr.getArgOperands().get(0), labels[5]);
   
View Full Code Here


  private StubMethodCallInstruction getMCI() {
    List<StubVariable> vars = new LinkedList<StubVariable>();
    vars.add(new StubVariable("p0""Bar"));
   
    StubMethodCallInstruction instr = new StubMethodCallInstruction("methodName", new StubVariable("rVar", "Foo"), vars,
         new StubMethodBinding(new NamedTypeBinding("Foo"), new NamedTypeBinding[]{new NamedTypeBinding("Bar")}), new StubVariable("tVar", "java.lang.Object"));
    return instr;
  }
View Full Code Here

    assertEquals(1, fv.size());
  }
 
  @Test
  public void testMatchWrongInstr() {
    NamedTypeBinding[] vBindings = new NamedTypeBinding[] {new NamedTypeBinding("Bar"), new NamedTypeBinding("Baz")};
    List<StubVariable> params = new ArrayList<StubVariable>();
    params.add(new StubVariable());
    params.add(new StubVariable());
   
    NamedTypeBinding rBinding = new NamedTypeBinding("Foo");   
   
    StubMethodCallInstruction instr = new StubMethodCallInstruction("mName", new StubVariable(), params, new StubMethodBinding(rBinding, vBindings), new StubVariable())
   
    EndOfMethodOp op = new EndOfMethodOp(null, null, null, null, null, false);
   
View Full Code Here

    assertTrue(map.contains(new Binding(Constraint.RESULT, retVar)));
    assertTrue(map.contains(new Binding(Constraint.RECEIVER, var)));
 
 
  private Pair<ReturnInstruction, Method> getRetAndMethod(StubVariable tarVar, List<Variable> params, StubVariable rVar) {
    NamedTypeBinding rBinding = new NamedTypeBinding("Foo");   
    NamedTypeBinding[] vBindings = new NamedTypeBinding[] {new NamedTypeBinding("Bar"), new NamedTypeBinding("Baz")};
    IMethodBinding methodBinding = new StubMethodBinding("name", rBinding, vBindings);

    Variable[] vArr = new Variable[params.size()];
    int ndx = 0;
    for (Variable var : params) {
View Full Code Here

    assertEquals(2, fv.size());
  }
 
  @Test
  public void testMatchWrongInstr() {
    NamedTypeBinding[] vBindings = new NamedTypeBinding[] {new NamedTypeBinding("Bar"), new NamedTypeBinding("Baz")};
    List<StubVariable> params = new ArrayList<StubVariable>();
    params.add(new StubVariable());
    params.add(new StubVariable());
   
    NamedTypeBinding rBinding = new NamedTypeBinding("Foo");   
   
    StubMethodCallInstruction instr = new StubMethodCallInstruction("mName", new StubVariable(), params, new StubMethodBinding(rBinding, vBindings), new StubVariable())
   
    SpecVar[] vars = new SpecVar[] {utils.getVar(0)};
    String[] vTypes = new String[] {"Bar"};
View Full Code Here

  }

  private NewObjectInstruction getNOI(StubVariable tarVar, StubVariable param) {
    List<StubVariable> params = new LinkedList<StubVariable>();
    params.add(param);
    NamedTypeBinding rBinding = new NamedTypeBinding("Foo");   
    NamedTypeBinding[] vBindings = new NamedTypeBinding[] {new NamedTypeBinding("Bar")};
   
    return new StubNewObjectInstruction(params, new StubMethodBinding(rBinding, vBindings), tarVar)
  }
View Full Code Here

    assertEquals(3, fv.size());
  }
 
  @Test
  public void testMatchWrongInstr() {
    NamedTypeBinding[] vBindings = new NamedTypeBinding[] {new NamedTypeBinding("Bar"), new NamedTypeBinding("Baz")};
    StubVariable v1 = new StubVariable();
    StubVariable v2 = new StubVariable();
   
    List<StubVariable> params = new ArrayList<StubVariable>();
    params.add(v1);
    params.add(v2);
   
    StubMethodBinding binding = new StubMethodBinding(new NamedTypeBinding("Foo"), vBindings);
    Method method = new Method(new Variable[] {v1, v2}, null, binding);
   
    NewObjectInstruction instr = new StubNewObjectInstruction(params, binding, new StubVariable())
    BeginOfMethodOp op = new BeginOfMethodOp(null, null, null, null, false);
   
View Full Code Here

    assertEquals(3, list.size());

  }

  private Pair<EntryInstruction, Method> getEntryAndMethod(StubVariable tarVar, List<Variable> params) {
    NamedTypeBinding rBinding = new NamedTypeBinding("Foo");   
    NamedTypeBinding[] vBindings = new NamedTypeBinding[] {new NamedTypeBinding("Bar"), new NamedTypeBinding("Baz")};
    IMethodBinding methodBinding = new StubMethodBinding("name", rBinding, vBindings);
   
    Variable[] vArr = new Variable[params.size()];
    int ndx = 0;
    for (Variable var : params) {
View Full Code Here

  private NamedTypeBinding type;

  public StubVariable(String name, String type) {
    super();
    this.name = name;
    this.type = new NamedTypeBinding(type);
  }
View Full Code Here

    assertEquals(4, fv.size());
  }
 
  @Test
  public void testMatchWrongInstr() {
    NamedTypeBinding[] vBindings = new NamedTypeBinding[] {new NamedTypeBinding("Bar"), new NamedTypeBinding("Baz")};
    List<StubVariable> params = new ArrayList<StubVariable>();
    params.add(new StubVariable());
    params.add(new StubVariable());
   
    NewObjectInstruction instr = new StubNewObjectInstruction(params, new StubMethodBinding(new NamedTypeBinding("Foo"), vBindings), new StubVariable())
    SpecVar[] vars = new SpecVar[] {utils.getVar(0), utils.getVar(1)};
    String[] vTypes = new String[] {"Bar", "Baz"};
    MethodInvocationOp op = new MethodInvocationOp("testtesttest", "Foo", vars, vTypes, "void", false);
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
View Full Code Here

TOP

Related Classes of edu.cmu.cs.fusion.xml.NamedTypeBinding

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.