Пример #1
0
 public override void Visit(ConstrainedSortOp op, Node n)
 {
     base.Visit(op, n);
     AssertScalarOp(n.Child1.Op);
     Assert(TypeSemantics.IsIntegerNumericType(n.Child1.Op.Type), "ConstrainedSortOp Skip Count Node must have an integer result type");
     AssertScalarOp(n.Child2.Op);
     Assert(TypeSemantics.IsIntegerNumericType(n.Child2.Op.Type), "ConstrainedSortOp Limit Node must have an integer result type");
 }
Пример #2
0
        public override void Visit(ConstrainedSortOp op, Node n)
        {
            Dictionary <string, object> attrs = new Dictionary <string, object>();

            attrs.Add("WithTies", op.WithTies);
            using (new AutoXml(this, op, attrs)) {
                base.Visit(op, n);
            }
        }
Пример #3
0
        /// <summary>
        /// Copies a constrained sort node
        /// </summary>
        /// <param name="op">The Op to Copy</param>
        /// <param name="n">The Node that references the Op</param>
        /// <returns>A copy of the original Node that references a copy of the original Op</returns>
        public override Node Visit(ConstrainedSortOp op, Node n)
        {
            // Visit the Node's children and map their Vars
            List <Node> children = ProcessChildren(n);

            // Copy the ConstrainedSortOp's SortKeys
            List <SortKey> newSortKeys = Copy(op.Keys);

            // Create a new ConstrainedSortOp that uses the copied SortKeys and the original Op's WithTies value
            ConstrainedSortOp newSortOp = m_destCmd.CreateConstrainedSortOp(newSortKeys, op.WithTies);

            // Return a new Node that references the copied SortOp and has the copied child Nodes as its children
            return(m_destCmd.CreateNode(newSortOp, children));
        }