本文整理汇总了C#中Assignment.Accept方法的典型用法代码示例。如果您正苦于以下问题:C# Assignment.Accept方法的具体用法?C# Assignment.Accept怎么用?C# Assignment.Accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assignment
的用法示例。
在下文中一共展示了Assignment.Accept方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EqbSimpleEquivalence
public void EqbSimpleEquivalence()
{
TypeFactory factory = new TypeFactory();
TypeStore store = new TypeStore();
EquivalenceClassBuilder eqb = new EquivalenceClassBuilder(factory, store);
Identifier id1 = new Identifier("id2", PrimitiveType.Word32, null);
Identifier id2 = new Identifier("id2", PrimitiveType.Word32, null);
Assignment ass = new Assignment(id1, id2);
ass.Accept(eqb);
Assert.IsNotNull(id1);
Assert.IsNotNull(id2);
Assert.AreEqual(2, id1.TypeVariable.Number, "id1 type number");
Assert.AreEqual(2, id1.TypeVariable.Number, "id2 type number");
Assert.AreEqual(id1.TypeVariable.Class, id2.TypeVariable.Class);
}
示例2: DtbSameMemFetch
public void DtbSameMemFetch()
{
Identifier foo = new Identifier("foo", PrimitiveType.Word32, null);
Identifier bar = new Identifier("bar", PrimitiveType.Word16, null);
Identifier baz = new Identifier("baz", PrimitiveType.Word16, null);
Assignment ass1 = new Assignment(bar, MemLoad(foo, 4, PrimitiveType.Word16));
Assignment ass2 = new Assignment(baz, MemLoad(foo, 4, PrimitiveType.Word16));
ass1.Accept(eqb);
ass2.Accept(eqb);
TraitCollector trco = new TraitCollector(factory, store, dtb, prog);
trco.VisitAssignment(ass1);
trco.VisitAssignment(ass2);
dtb.BuildEquivalenceClassDataTypes();
Verify("Typing/DtbSameMemFetch.txt");
}
示例3: DtbRepeatedLoads
public void DtbRepeatedLoads()
{
Identifier pfoo = new Identifier("pfoo", PrimitiveType.Word32, null);
Identifier x = new Identifier("x", PrimitiveType.Word32, null);
Assignment ass1 = new Assignment(x, MemLoad(pfoo, 4, PrimitiveType.Word32));
Assignment ass2 = new Assignment(x, MemLoad(pfoo, 4, PrimitiveType.Word32));
ass1.Accept(eqb);
ass2.Accept(eqb);
TraitCollector trco = new TraitCollector(factory, store, dtb, prog);
trco.VisitAssignment(ass1);
trco.VisitAssignment(ass2);
dtb.BuildEquivalenceClassDataTypes();
Verify("Typing/DtbRepeatedLoads.txt");
}