public QilList SortKeyList(QilSortKey key) { QilList list = f.SortKeyList(); list.Add(key); return(list); }
public QilSortKey SortKey(QilNode key, QilNode collation) { QilSortKey n = new QilSortKey(QilNodeType.SortKey, key, collation); n.XmlType = this.typeCheck.CheckSortKey(n); TraceNode(n); return(n); }
protected virtual QilNode VisitSortKey(QilSortKey n) { return(VisitChildren(n)); }
public QilList SortKeyList(QilSortKey key) { QilList list = f.SortKeyList(); list.Add(key); return list; }
public XmlQueryType CheckSortKey(QilSortKey node) { CheckAtomicX(node.Key); CheckXmlType(node.Collation, XmlQueryTypeFactory.StringX); return(node.Key.XmlType); }
public XmlQueryType CheckSortKey(QilSortKey node) { CheckAtomicX(node.Key); CheckXmlType(node.Collation, XmlQueryTypeFactory.StringX); return node.Key.XmlType; }
protected virtual QilNode VisitSortKey(QilSortKey n) { return VisitChildren(n); }
protected override QilNode VisitSortKey(QilSortKey n) { return NoReplace(n); }
protected override QilNode VisitSortKey(QilSortKey n) { return(NoReplace(n)); }
protected override QilNode VisitSortKey(QilSortKey local0) { QilNode local1 = local0[0]; QilNode local2 = local0[1]; if (this[XmlILOptimization.NormalizeSortXsltConvert]) { if (local1.NodeType == QilNodeType.XsltConvert) { QilNode local3 = local1[0]; QilNode local4 = local1[1]; if (local4.NodeType == QilNodeType.LiteralType) { XmlQueryType local5 = (XmlQueryType)((QilLiteral)local4).Value; if (( ( (local3).XmlType ) == ( XmlQueryTypeFactory.IntX ) ) && ( (local5) == ( XmlQueryTypeFactory.DoubleX ) )) { if (AllowReplace(XmlILOptimization.NormalizeSortXsltConvert, local0)) { return Replace(XmlILOptimization.NormalizeSortXsltConvert, local0, VisitSortKey(f.SortKey(local3, local2))); } } } } } return NoReplace(local0); }
public QilSortKey SortKey(QilNode key, QilNode collation) { QilSortKey n = new QilSortKey(QilNodeType.SortKey, key, collation); n.XmlType = this.typeCheck.CheckSortKey(n); TraceNode(n); return n; }
/// <summary> /// Generate code to add a (value, collation) sort key to the XmlSortKeyAccumulator. /// </summary> private void VisitSortKey(QilSortKey ndKey, LocalBuilder locKeys) { Label lblOnEndKey; Debug.Assert(ndKey.Key.XmlType.IsAtomicValue, "Sort key must be an atomic value."); // Push collation onto the stack _helper.Emit(OpCodes.Ldloca, locKeys); if (ndKey.Collation.NodeType == QilNodeType.LiteralString) { // collation = runtime.GetCollation(idx); _helper.CallGetCollation(_helper.StaticData.DeclareCollation((string)(QilLiteral)ndKey.Collation)); } else { // collation = runtime.CreateCollation(str); _helper.LoadQueryRuntime(); NestedVisitEnsureStack(ndKey.Collation); _helper.Call(XmlILMethods.CreateCollation); } if (ndKey.XmlType.IsSingleton) { NestedVisitEnsureStack(ndKey.Key); // keys.AddSortKey(collation, value); _helper.AddSortKey(ndKey.Key.XmlType); } else { lblOnEndKey = _helper.DefineLabel(); StartNestedIterator(ndKey.Key, lblOnEndKey); Visit(ndKey.Key); _iterCurr.EnsureStackNoCache(); _iterCurr.EnsureItemStorageType(ndKey.Key.XmlType, GetItemStorageType(ndKey.Key)); // Non-empty sort key // keys.AddSortKey(collation, value); _helper.AddSortKey(ndKey.Key.XmlType); // goto LabelDone; // LabelOnEnd: Label lblDone = _helper.DefineLabel(); _helper.EmitUnconditionalBranch(OpCodes.Br_S, lblDone); _helper.MarkLabel(lblOnEndKey); // Empty sequence key // keys.AddSortKey(collation); _helper.AddSortKey(null); _helper.MarkLabel(lblDone); EndNestedIterator(ndKey.Key); } }
protected override QilNode VisitSortKey(QilSortKey local0) { QilNode local1 = local0[0]; QilNode local2 = local0[1]; if (this[XmlILOptimization.NormalizeSortXsltConvert]) { if (local1.NodeType == QilNodeType.XsltConvert) { QilNode local3 = local1[0]; QilNode local4 = local1[1]; if (local4.NodeType == QilNodeType.LiteralType) { XmlQueryType local5 = (XmlQueryType)((QilLiteral)local4).Value; if ((((local3).XmlType) == (XmlQueryTypeFactory.IntX)) && ((local5) == (XmlQueryTypeFactory.DoubleX))) { // PATTERN: [NormalizeSortXsltConvert] (SortKey (XsltConvert $expr:* (LiteralType $typ:*)) ^ (Equal? (TypeOf $expr) (ConstructType {IntX})) ^ (Equal? $typ (ConstructType {DoubleX})) $coll:*) => (SortKey $expr $coll) if (AllowReplace(XmlILOptimization.NormalizeSortXsltConvert, local0)) { return Replace(XmlILOptimization.NormalizeSortXsltConvert, local0, VisitSortKey(f.SortKey(local3, local2))); } } } } } return NoReplace(local0); }