本文整理汇总了C#中BinaryExpression.Accept方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryExpression.Accept方法的具体用法?C# BinaryExpression.Accept怎么用?C# BinaryExpression.Accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryExpression
的用法示例。
在下文中一共展示了BinaryExpression.Accept方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Exs_OrWithSelf
public void Exs_OrWithSelf()
{
BuildExpressionSimplifier();
var expr = new BinaryExpression(Operator.Or, foo.DataType, foo, foo);
var result = expr.Accept(simplifier);
Assert.AreSame(foo, result);
}
示例2: ExsConstants
public void ExsConstants()
{
BuildExpressionSimplifier();
Expression expr = new BinaryExpression(Operator.IAdd, PrimitiveType.Word32,
Constant.Word32(1), Constant.Word32(2));
Constant c = (Constant) expr.Accept(simplifier);
Assert.AreEqual(3, c.ToInt32());
}
示例3: VpAddZero
public void VpAddZero()
{
Identifier r = Reg32("r");
Identifier s = Reg32("s");
var sub = new BinaryExpression(Operator.ISub, PrimitiveType.Word32, new MemoryAccess(MemoryIdentifier.GlobalMemory, r, PrimitiveType.Word32), Constant.Word32(0));
var vp = new ExpressionSimplifier(new SsaEvaluationContext(arch, ssaIds));
var exp = sub.Accept(vp);
Assert.AreEqual("Mem0[r:word32]", exp.ToString());
}
示例4: CfAddMul
public void CfAddMul()
{
Identifier id1 = new Identifier("v1", PrimitiveType.Word16, null);
Identifier id2 = new Identifier("v2", PrimitiveType.Word16, null);
Expression e = new BinaryExpression(
Operator.IAdd, PrimitiveType.Word16, new BinaryExpression(
Operator.IMul, PrimitiveType.Word16, id1, id2), Constant.Word16(2));
e.Accept(cf);
Assert.AreEqual("v1 * v2 + 0x0002", sw.ToString());
}
示例5: ExsAddPositiveConstantToNegative
public void ExsAddPositiveConstantToNegative()
{
BuildExpressionSimplifier();
var expr = new BinaryExpression(
Operator.IAdd,
foo.DataType,
new BinaryExpression(
Operator.ISub,
foo.DataType,
foo,
Constant.Word32(4)),
Constant.Word32(1));
var result = expr.Accept(simplifier);
Assert.AreEqual("foo_0 - 0x00000003", result.ToString());
}