Package edu.cmu.cs.crystal.tac.model

Examples of edu.cmu.cs.crystal.tac.model.NewObjectInstruction


    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
   
    Assert.assertFalse(newobj.isAnonClassType());
    Assert.assertNotNull(newobj.resolveInstantiatedType());
    Assert.assertEquals(instance.resolveTypeBinding(), newobj.resolveInstantiatedType());
   
    Assert.assertFalse(newobj.hasOuterObjectSpecifier());
    Assert.assertNull(newobj.getOuterObjectSpecifierOperand());
  }
View Full Code Here


    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
   
    Assert.assertFalse(newobj.isAnonClassType());
    Assert.assertNotNull(newobj.resolveInstantiatedType());
    Assert.assertEquals(instance.resolveTypeBinding(), newobj.resolveInstantiatedType());
   
    Assert.assertFalse(newobj.hasOuterObjectSpecifier());
    Assert.assertNull(newobj.getOuterObjectSpecifierOperand());
  }
View Full Code Here

    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
   
    Assert.assertFalse(newobj.isAnonClassType());
    Assert.assertNotNull(newobj.resolveInstantiatedType());
    Assert.assertEquals(instance.resolveTypeBinding(), newobj.resolveInstantiatedType());
   
    Assert.assertTrue(newobj.hasOuterObjectSpecifier());
    Assert.assertNotNull(newobj.getOuterObjectSpecifierOperand());
    Assert.assertEquals(tac.thisVariable(), newobj.getOuterObjectSpecifierOperand());
  }
View Full Code Here

    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
   
    Assert.assertFalse(newobj.isAnonClassType());
    Assert.assertNotNull(newobj.resolveInstantiatedType());
    Assert.assertEquals(instance.resolveTypeBinding(), newobj.resolveInstantiatedType());
   
    Assert.assertTrue(newobj.hasOuterObjectSpecifier());
    Assert.assertNotNull(newobj.getOuterObjectSpecifierOperand());
    Assert.assertEquals(tac.variable(instance.getExpression()), newobj.getOuterObjectSpecifierOperand());
  }
View Full Code Here

    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
   
    Assert.assertFalse(newobj.isAnonClassType());
    Assert.assertNotNull(newobj.resolveInstantiatedType());
    Assert.assertEquals(instance.resolveTypeBinding(), newobj.resolveInstantiatedType());
   
    Assert.assertFalse(newobj.hasOuterObjectSpecifier());
    Assert.assertNull(newobj.getOuterObjectSpecifierOperand());
  }
View Full Code Here

    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
   
    Assert.assertFalse(newobj.isAnonClassType());
    Assert.assertNotNull(newobj.resolveInstantiatedType());
    Assert.assertEquals(instance.resolveTypeBinding(), newobj.resolveInstantiatedType());
   
    Assert.assertFalse(newobj.hasOuterObjectSpecifier());
    Assert.assertNull(newobj.getOuterObjectSpecifierOperand());
  }
View Full Code Here

    EclipseTAC tac = new EclipseTAC(m.resolveBinding());
    ClassInstanceCreation instance = (ClassInstanceCreation) EclipseTACSimpleTestDriver.getLastStatementReturn(m).getExpression();
    TACInstruction instr = tac.instruction(instance);
    Assert.assertTrue(instr != null);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
    NewObjectInstruction newobj = (NewObjectInstruction) instr;
   
    Assert.assertTrue(newobj.isAnonClassType());
    Assert.assertNotNull(newobj.resolveInstantiatedType());
    Assert.assertEquals(instance.resolveTypeBinding(), newobj.resolveInstantiatedType());
   
    Assert.assertFalse(newobj.hasOuterObjectSpecifier());
    Assert.assertNull(newobj.getOuterObjectSpecifierOperand());
  }
View Full Code Here

    TACInstruction instr = tac.instruction(init);
    Assert.assertNotNull(instr);
    Assert.assertTrue(instr instanceof NewObjectInstruction);
   
    NewObjectInstruction alloc = (NewObjectInstruction) instr;
    Assert.assertEquals(alloc.getTarget(), store.getSourceOperand());
  }
View Full Code Here

    assertTrue(map == null);
  }
 
  @Test
  public void testMatchWrongType() {
    NewObjectInstruction instr = getNOI(new StubVariable(), new StubVariable());
   
    ConstructorOp op = new ConstructorOp("Baz", new SpecVar[] {utils.getVar(1)}, new String[] {"Bar"});
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
View Full Code Here

    assertTrue(map == null);
  }

  @Test
  public void testMatchWrongParamType() {
    NewObjectInstruction instr = getNOI(new StubVariable(), new StubVariable());

    ConstructorOp op = new ConstructorOp("Foo", new SpecVar[] {utils.getVar(1)}, new String[] {"Baz"});
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
View Full Code Here

TOP

Related Classes of edu.cmu.cs.crystal.tac.model.NewObjectInstruction

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.