示例#1
0
        public void ReductionFoo()
        {
            var lhs        = Node.Make(new A(42));
            var rhs        = Node.Make(new A(-41));
            var production = ProductionRule.Load(mFooInfo);
            var product    = production.Reduce(new[] { lhs, rhs });

            Assert.AreEqual(1, (product.Payload as A).Val);
        }
示例#2
0
        public void ReductionBar()
        {
            var lhs        = Node.Make(new A(1));
            var mid        = Node.Make(new A.B(2));
            var rhs        = Node.Make(new A(3));
            var production = ProductionRule.Load(mBarInfo);
            var product    = production.Reduce(new[] { lhs, mid, rhs });

            Assert.AreEqual(6, (product.Payload as A).Val);
        }