Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlILVisitor.cs
Go to the documentation of this file.
9
10namespace System.Xml.Xsl.IlGen;
11
12internal sealed class XmlILVisitor : QilVisitor
13{
15
17
19
21
22 private int _indexId;
23
24 [RequiresUnreferencedCode("Method VisitXsltInvokeEarlyBound will require code that cannot be statically analyzed.")]
25 public XmlILVisitor()
26 {
27 }
28
30 {
31 _qil = qil;
32 _helper = helper;
33 _iterNested = null;
34 _indexId = 0;
35 PrepareGlobalValues(qil.GlobalParameterList);
36 PrepareGlobalValues(qil.GlobalVariableList);
37 VisitGlobalValues(qil.GlobalParameterList);
38 VisitGlobalValues(qil.GlobalVariableList);
39 foreach (QilFunction function in qil.FunctionList)
40 {
41 Function(function);
42 }
45 Visit(qil.Root);
48 }
49
60
62 {
64 {
66 MethodInfo globalLocation = XmlILAnnotation.Write(globalIterator).CachedIteratorDescriptor.Storage.GlobalLocation;
67 bool isCached = !globalIterator.XmlType.IsSingleton;
77 if (qilParameter != null)
78 {
79 LocalBuilder locBldr = _helper.DeclareLocal("$$$param", typeof(object));
80 _helper.CallGetParameter(qilParameter.Name.LocalName, qilParameter.Name.NamespaceUri);
92 }
94 if (globalIterator.Binding != null)
95 {
100 }
101 else
102 {
104 GenerateHelper helper = _helper;
107 object[] args = new string[2]
108 {
109 qilParameter.Name.LocalName,
111 };
114 }
119 }
120 }
121
123 {
124 foreach (QilIterator argument in ndFunc.Arguments)
125 {
127 int paramIndex = XmlILAnnotation.Write(argument).ArgumentPosition + 1;
129 XmlILAnnotation.Write(argument).CachedIteratorDescriptor = iteratorDescriptor;
130 }
132 bool flag = XmlILConstructInfo.Read(ndFunc).ConstructMethod == XmlILConstructMethod.Writer;
133 _helper.MethodBegin(functionBinding, ndFunc.SourceLine, flag);
134 foreach (QilIterator argument2 in ndFunc.Arguments)
135 {
136 if (_qil.IsDebug && argument2.SourceLine != null)
137 {
139 }
140 if (argument2.Binding != null)
141 {
142 int paramIndex = (argument2.Annotation as XmlILAnnotation).ArgumentPosition + 1;
154 }
155 }
157 if (flag)
158 {
159 NestedVisit(ndFunc.Definition);
160 }
161 else
162 {
163 NestedVisitEnsureStack(ndFunc.Definition, GetItemStorageType(ndFunc), !ndFunc.XmlType.IsSingleton);
164 }
167 }
168
169 protected override QilNode Visit(QilNode nd)
170 {
171 if (nd == null)
172 {
173 return null;
174 }
175 if (_qil.IsDebug && nd.SourceLine != null && !(nd is QilIterator))
176 {
177 _helper.DebugSequencePoint(nd.SourceLine);
178 }
179 switch (XmlILConstructInfo.Read(nd).ConstructMethod)
180 {
181 case XmlILConstructMethod.WriterThenIterator:
183 break;
184 case XmlILConstructMethod.IteratorThenWriter:
186 break;
187 default:
188 base.Visit(nd);
189 break;
190 }
191 return nd;
192 }
193
194 protected override QilNode VisitChildren(QilNode parent)
195 {
196 return parent;
197 }
198
206
207 private void CopySequence(QilNode nd)
208 {
209 XmlQueryType xmlType = nd.XmlType;
211 if (xmlType.IsSingleton)
212 {
214 base.Visit(nd);
216 }
217 else
218 {
219 base.Visit(nd);
221 _iterCurr.EnsureNoStackNoCache("$$$copyTemp");
223 }
227 }
228
242
243 protected override QilNode VisitNop(QilUnary ndNop)
244 {
245 return Visit(ndNop.Child);
246 }
247
249 {
250 return Visit(ndBarrier.Child);
251 }
252
253 protected override QilNode VisitError(QilUnary ndErr)
254 {
258 if (XmlILConstructInfo.Read(ndErr).ConstructMethod == XmlILConstructMethod.Writer)
259 {
261 }
262 else
263 {
266 }
267 return ndErr;
268 }
269
271 {
275 if (XmlILConstructInfo.Read(ndWarning).ConstructMethod == XmlILConstructMethod.Writer)
276 {
278 }
279 else
280 {
282 }
283 return ndWarning;
284 }
285
300
315
317 {
318 _helper.Emit(OpCodes.Ldstr, (string)ndStr);
320 return ndStr;
321 }
322
324 {
327 return ndInt;
328 }
329
331 {
334 return ndLong;
335 }
336
338 {
339 _helper.Emit(OpCodes.Ldc_R8, (double)ndDbl);
341 return ndDbl;
342 }
343
350
352 {
353 _helper.ConstructLiteralQName(ndQName.LocalName, ndQName.NamespaceUri);
355 return ndQName;
356 }
357
358 protected override QilNode VisitAnd(QilBinary ndAnd)
359 {
362 Label lblOnFalse = StartConjunctiveTests(iterCurr.CurrentBranchingContext, iterCurr.LabelBranch);
363 Visit(ndAnd.Left);
366 StartLastConjunctiveTest(iterCurr.CurrentBranchingContext, iterCurr.LabelBranch, lblOnFalse);
367 Visit(ndAnd.Right);
369 EndConjunctiveTests(iterCurr.CurrentBranchingContext, iterCurr.LabelBranch, lblOnFalse);
370 return ndAnd;
371 }
372
384
396
398 {
399 switch (brctxt)
400 {
401 case BranchingContext.OnTrue:
403 goto case BranchingContext.OnFalse;
404 case BranchingContext.OnFalse:
406 break;
407 case BranchingContext.None:
410 break;
411 }
412 }
413
414 protected override QilNode VisitOr(QilBinary ndOr)
415 {
416 Label label = default(Label);
418 {
419 case BranchingContext.OnFalse:
422 break;
423 case BranchingContext.OnTrue:
425 break;
426 default:
429 break;
430 }
432 {
433 case BranchingContext.OnFalse:
435 break;
436 case BranchingContext.OnTrue:
438 break;
439 default:
441 break;
442 }
444 {
445 case BranchingContext.OnFalse:
447 goto case BranchingContext.OnTrue;
448 case BranchingContext.OnTrue:
450 break;
451 case BranchingContext.None:
454 break;
455 }
456 return ndOr;
457 }
458
459 protected override QilNode VisitNot(QilUnary ndNot)
460 {
461 Label lblBranch = default(Label);
463 {
464 case BranchingContext.OnFalse:
466 break;
467 case BranchingContext.OnTrue:
469 break;
470 default:
473 break;
474 }
476 {
479 }
480 else
481 {
483 }
484 return ndNot;
485 }
486
488 {
490 if (xmlILConstructInfo.ConstructMethod == XmlILConstructMethod.Writer)
491 {
494 NestedVisit(ndCond.Center);
495 if (ndCond.Right.NodeType == QilNodeType.Sequence && ndCond.Right.Count == 0)
496 {
498 NestedVisit(ndCond.Right);
499 }
500 else
501 {
505 NestedVisit(ndCond.Right);
507 }
509 }
510 else
511 {
516 if (ndCond.XmlType.IsSingleton)
517 {
519 }
520 else
521 {
523 localBuilder = _helper.DeclareLocal("$$$boolResult", typeof(bool));
527 }
534 if (!ndCond.XmlType.IsSingleton)
535 {
540 _helper.Emit(OpCodes.Brtrue, iterNested.GetLabelNext());
543 }
545 }
546 return ndCond;
547 }
548
569
571 {
572 NestedVisit(ndChoice.Expression);
573 QilNode branches = ndChoice.Branches;
574 int num = branches.Count - 1;
575 Label[] array = new Label[num];
576 int i;
577 for (i = 0; i < num; i++)
578 {
580 }
585 for (i = 0; i < num; i++)
586 {
590 }
595 return ndChoice;
596 }
597
628
629 protected override QilNode VisitSequence(QilList ndSeq)
630 {
631 if (XmlILConstructInfo.Read(ndSeq).ConstructMethod == XmlILConstructMethod.Writer)
632 {
633 foreach (QilNode item in ndSeq)
634 {
636 }
637 }
638 else if (ndSeq.Count == 0)
639 {
641 }
642 else
643 {
645 }
646 return ndSeq;
647 }
648
655
656 private void Sequence(QilList ndSeq)
657 {
658 Label label = default(Label);
660 if (ndSeq.XmlType.IsSingleton)
661 {
662 foreach (QilNode item in ndSeq)
663 {
664 if (item.XmlType.IsSingleton)
665 {
667 continue;
668 }
673 }
675 return;
676 }
678 LocalBuilder locBldr = _helper.DeclareLocal("$$$idxList", typeof(int));
679 Label[] array = new Label[ndSeq.Count];
681 for (int i = 0; i < ndSeq.Count; i++)
682 {
683 if (i != 0)
684 {
686 }
695 }
702 }
703
708
713
718
720 {
729 NestedVisit(ndSet.Left, label);
734 NestedVisit(ndSet.Right, label);
745 if (ndSet.XmlType.IsSingleton)
746 {
747 _helper.Emit(OpCodes.Switch, new Label[3] { label3, labelNext, labelNext2 });
749 }
750 else
751 {
753 {
754 _iterCurr.GetLabelNext(),
755 label3,
756 labelNext,
757 labelNext2
758 });
760 }
761 return ndSet;
762 }
763
769
775
781
787
814
815 protected override QilNode VisitNegate(QilUnary ndNeg)
816 {
818 _helper.CallArithmeticOp(QilNodeType.Negate, ndNeg.XmlType.TypeCode);
820 return ndNeg;
821 }
822
823 protected override QilNode VisitAdd(QilBinary ndPlus)
824 {
825 return ArithmeticOp(ndPlus);
826 }
827
829 {
830 return ArithmeticOp(ndMinus);
831 }
832
834 {
835 return ArithmeticOp(ndMul);
836 }
837
838 protected override QilNode VisitDivide(QilBinary ndDiv)
839 {
840 return ArithmeticOp(ndDiv);
841 }
842
843 protected override QilNode VisitModulo(QilBinary ndMod)
844 {
845 return ArithmeticOp(ndMod);
846 }
847
849 {
850 NestedVisitEnsureStack(ndOp.Left, ndOp.Right);
851 _helper.CallArithmeticOp(ndOp.NodeType, ndOp.XmlType.TypeCode);
853 return ndOp;
854 }
855
863
865 {
866 QilNode qilNode = ndStrConcat.Delimiter;
867 if (qilNode.NodeType == QilNodeType.LiteralString && ((string)(QilLiteral)qilNode).Length == 0)
868 {
869 qilNode = null;
870 }
872 bool flag;
873 if (values.NodeType == QilNodeType.Sequence && values.Count < 5)
874 {
875 flag = true;
876 foreach (QilNode item in values)
877 {
878 if (!item.XmlType.IsSingleton)
879 {
880 flag = false;
881 }
882 }
883 }
884 else
885 {
886 flag = false;
887 }
888 if (flag)
889 {
890 foreach (QilNode item2 in values)
891 {
893 }
895 }
896 else
897 {
901 if (qilNode != null)
902 {
906 }
908 if (values.NodeType == QilNodeType.Sequence)
909 {
910 foreach (QilNode item3 in values)
911 {
913 }
914 }
915 else
916 {
918 }
920 }
922 return ndStrConcat;
923 }
924
937
943
945 {
946 if (!preservePrefix)
947 {
949 }
951 if (ndParsedTagName.Right.XmlType.TypeCode == XmlTypeCode.String)
952 {
954 if (!preservePrefix)
955 {
956 _helper.CallParseTagName(GenerateNameType.TagNameAndNamespace);
957 }
958 }
959 else
960 {
961 if (ndParsedTagName.Right.NodeType == QilNodeType.Sequence)
962 {
964 }
965 else
966 {
967 _helper.LoadInteger(_helper.StaticData.DeclarePrefixMappings(new QilNode[1] { ndParsedTagName.Right }));
968 }
969 if (!preservePrefix)
970 {
971 _helper.CallParseTagName(GenerateNameType.TagNameAndMappings);
972 }
973 }
975 }
976
977 protected override QilNode VisitNe(QilBinary ndNe)
978 {
979 Compare(ndNe);
980 return ndNe;
981 }
982
983 protected override QilNode VisitEq(QilBinary ndEq)
984 {
985 Compare(ndEq);
986 return ndEq;
987 }
988
989 protected override QilNode VisitGt(QilBinary ndGt)
990 {
991 Compare(ndGt);
992 return ndGt;
993 }
994
995 protected override QilNode VisitGe(QilBinary ndGe)
996 {
997 Compare(ndGe);
998 return ndGe;
999 }
1000
1001 protected override QilNode VisitLt(QilBinary ndLt)
1002 {
1003 Compare(ndLt);
1004 return ndLt;
1005 }
1006
1007 protected override QilNode VisitLe(QilBinary ndLe)
1008 {
1009 Compare(ndLe);
1010 return ndLe;
1011 }
1012
1014 {
1015 QilNodeType nodeType = ndComp.NodeType;
1016 if ((nodeType == QilNodeType.Eq || nodeType == QilNodeType.Ne) && (TryZeroCompare(nodeType, ndComp.Left, ndComp.Right) || TryZeroCompare(nodeType, ndComp.Right, ndComp.Left) || TryNameCompare(nodeType, ndComp.Left, ndComp.Right) || TryNameCompare(nodeType, ndComp.Right, ndComp.Left)))
1017 {
1018 return;
1019 }
1021 XmlTypeCode typeCode = ndComp.Left.XmlType.TypeCode;
1022 switch (typeCode)
1023 {
1024 case XmlTypeCode.String:
1025 case XmlTypeCode.Decimal:
1026 case XmlTypeCode.QName:
1027 if (nodeType == QilNodeType.Eq || nodeType == QilNodeType.Ne)
1028 {
1029 _helper.CallCompareEquals(typeCode);
1030 ZeroCompare((nodeType == QilNodeType.Eq) ? QilNodeType.Ne : QilNodeType.Eq, isBoolVal: true);
1031 }
1032 else
1033 {
1034 _helper.CallCompare(typeCode);
1036 ClrCompare(nodeType, typeCode);
1037 }
1038 break;
1039 case XmlTypeCode.Boolean:
1040 case XmlTypeCode.Double:
1041 case XmlTypeCode.Integer:
1042 case XmlTypeCode.Int:
1043 ClrCompare(nodeType, typeCode);
1044 break;
1045 }
1046 }
1047
1048 protected override QilNode VisitIs(QilBinary ndIs)
1049 {
1050 NestedVisitEnsureStack(ndIs.Left, ndIs.Right);
1053 return ndIs;
1054 }
1055
1057 {
1059 return ndBefore;
1060 }
1061
1063 {
1065 return ndAfter;
1066 }
1067
1069 {
1074 ClrCompare((ndComp.NodeType == QilNodeType.Before) ? QilNodeType.Lt : QilNodeType.Gt, XmlTypeCode.String);
1075 }
1076
1077 protected override QilNode VisitFor(QilIterator ndFor)
1078 {
1081 if (_iterCurr.Storage.Location == ItemLocation.Global)
1082 {
1084 }
1085 return ndFor;
1086 }
1087
1088 protected override QilNode VisitLet(QilIterator ndLet)
1089 {
1090 return VisitFor(ndLet);
1091 }
1092
1094 {
1095 return VisitFor(ndParameter);
1096 }
1097
1098 protected override QilNode VisitLoop(QilLoop ndLoop)
1099 {
1101 StartBinding(ndLoop.Variable);
1102 Visit(ndLoop.Body);
1103 EndBinding(ndLoop.Variable);
1105 return ndLoop;
1106 }
1107
1109 {
1111 {
1112 return ndFilter;
1113 }
1114 StartBinding(ndFilter.Variable);
1118 Visit(ndFilter.Body);
1120 EndBinding(ndFilter.Variable);
1121 return ndFilter;
1122 }
1123
1125 {
1127 bool flag = optimizerPatterns.MatchesPattern(OptimizerPatternName.FilterElements);
1128 if (flag || optimizerPatterns.MatchesPattern(OptimizerPatternName.FilterContentKind))
1129 {
1132 if (flag)
1133 {
1135 qilName = (QilName)optimizerPatterns.GetArgument(OptimizerPatternArgument.ElementQName);
1136 }
1137 else
1138 {
1139 xmlNodeKindFlags = ((XmlQueryType)optimizerPatterns.GetArgument(OptimizerPatternArgument.ElementQName)).NodeKinds;
1140 qilName = null;
1141 }
1144 switch (qilNode.NodeType)
1145 {
1146 case QilNodeType.Content:
1147 if (flag)
1148 {
1156 }
1157 else if (xmlNodeKindFlags == XmlNodeKindFlags.Content)
1158 {
1160 }
1161 else
1162 {
1169 }
1170 return true;
1171 case QilNodeType.Parent:
1173 return true;
1174 case QilNodeType.Ancestor:
1175 case QilNodeType.AncestorOrSelf:
1177 return true;
1178 case QilNodeType.Descendant:
1179 case QilNodeType.DescendantOrSelf:
1181 return true;
1182 case QilNodeType.Preceding:
1184 return true;
1185 case QilNodeType.FollowingSibling:
1187 return true;
1188 case QilNodeType.PrecedingSibling:
1190 return true;
1191 case QilNodeType.NodeRange:
1193 return true;
1194 case QilNodeType.XPathFollowing:
1196 return true;
1197 case QilNodeType.XPathPreceding:
1199 return true;
1200 }
1201 }
1202 else
1203 {
1204 if (optimizerPatterns.MatchesPattern(OptimizerPatternName.FilterAttributeKind))
1205 {
1208 return true;
1209 }
1210 if (optimizerPatterns.MatchesPattern(OptimizerPatternName.EqualityIndex))
1211 {
1229 Visit(n);
1245 _indexId++;
1246 return true;
1247 }
1248 }
1249 return false;
1250 }
1251
1253 {
1255 if (_qil.IsDebug && ndIter.SourceLine != null)
1256 {
1257 _helper.DebugSequencePoint(ndIter.SourceLine);
1258 }
1259 if (ndIter.NodeType == QilNodeType.For || ndIter.XmlType.IsSingleton)
1260 {
1262 }
1263 else
1264 {
1266 }
1267 XmlILAnnotation.Write(ndIter).CachedIteratorDescriptor = _iterNested;
1268 }
1269
1271 {
1274 {
1276 }
1277 else
1278 {
1279 StartNestedIterator(ndFor.Binding);
1280 }
1281 if (patt.MatchesPattern(OptimizerPatternName.IsPositional))
1282 {
1283 localBuilder = _helper.DeclareLocal("$$$pos", typeof(int));
1286 }
1287 Visit(ndFor.Binding);
1288 if (_qil.IsDebug && ndFor.DebugName != null)
1289 {
1291 _iterCurr.EnsureLocalNoCache("$$$for");
1292 }
1293 else
1294 {
1296 }
1297 if (patt.MatchesPattern(OptimizerPatternName.IsPositional))
1298 {
1303 if (patt.MatchesPattern(OptimizerPatternName.MaxPosition))
1304 {
1306 _helper.LoadInteger((int)patt.GetArgument(OptimizerPatternArgument.ElementQName));
1308 }
1310 }
1311 EndNestedIterator(ndFor.Binding);
1313 }
1314
1316 {
1318 NestedVisit(ndLet.Binding, GetItemStorageType(ndLet), !ndLet.XmlType.IsSingleton);
1319 if (_qil.IsDebug && ndLet.DebugName != null)
1320 {
1322 _iterCurr.EnsureLocal("$$$cache");
1323 }
1324 else
1325 {
1326 _iterCurr.EnsureNoStack("$$$cache");
1327 }
1329 }
1330
1332 {
1333 if (_qil.IsDebug && ndIter.DebugName != null)
1334 {
1336 }
1337 }
1338
1340 {
1342 LocalBuilder localPosition = XmlILAnnotation.Write(nd).CachedIteratorDescriptor.LocalPosition;
1344 return ndPos;
1345 }
1346
1347 protected override QilNode VisitSort(QilLoop ndSort)
1348 {
1361 StartBinding(ndSort.Variable);
1363 _iterCurr.EnsureItemStorageType(ndSort.Variable.XmlType, GetItemStorageType(ndSort.Variable));
1366 foreach (QilSortKey item in ndSort.Body)
1367 {
1369 }
1377 _helper.Call(xmlILStorageMethods.SeqSortByKeys);
1379 EndBinding(ndSort.Variable);
1380 EndNestedIterator(ndSort.Variable);
1382 return ndSort;
1383 }
1384
1386 {
1388 if (ndKey.Collation.NodeType == QilNodeType.LiteralString)
1389 {
1391 }
1392 else
1393 {
1395 NestedVisitEnsureStack(ndKey.Collation);
1397 }
1398 if (ndKey.XmlType.IsSingleton)
1399 {
1401 _helper.AddSortKey(ndKey.Key.XmlType);
1402 return;
1403 }
1406 Visit(ndKey.Key);
1409 _helper.AddSortKey(ndKey.Key.XmlType);
1413 _helper.AddSortKey(null);
1416 }
1417
1419 {
1420 if (ndDod.XmlType.IsSingleton)
1421 {
1422 return Visit(ndDod.Child);
1423 }
1425 {
1426 return ndDod;
1427 }
1432 return ndDod;
1433 }
1434
1436 {
1438 bool flag = optimizerPatterns.MatchesPattern(OptimizerPatternName.JoinAndDod);
1439 if (flag || optimizerPatterns.MatchesPattern(OptimizerPatternName.DodReverse))
1440 {
1444 if (optimizerPatterns2.MatchesPattern(OptimizerPatternName.FilterElements))
1445 {
1446 kinds = XmlNodeKindFlags.Element;
1447 ndName = (QilName)optimizerPatterns2.GetArgument(OptimizerPatternArgument.ElementQName);
1448 }
1449 else if (optimizerPatterns2.MatchesPattern(OptimizerPatternName.FilterContentKind))
1450 {
1451 kinds = ((XmlQueryType)optimizerPatterns2.GetArgument(OptimizerPatternArgument.ElementQName)).NodeKinds;
1452 ndName = null;
1453 }
1454 else
1455 {
1457 ndName = null;
1458 }
1460 if (flag)
1461 {
1462 switch (qilNode.NodeType)
1463 {
1464 case QilNodeType.Content:
1466 return true;
1467 case QilNodeType.Descendant:
1468 case QilNodeType.DescendantOrSelf:
1470 return true;
1471 case QilNodeType.XPathFollowing:
1473 return true;
1474 case QilNodeType.FollowingSibling:
1476 return true;
1477 case QilNodeType.XPathPreceding:
1479 return true;
1480 }
1481 }
1482 else
1483 {
1485 switch (qilNode.NodeType)
1486 {
1487 case QilNodeType.Ancestor:
1488 case QilNodeType.AncestorOrSelf:
1490 return true;
1491 case QilNodeType.PrecedingSibling:
1493 return true;
1494 case QilNodeType.XPathPreceding:
1496 return true;
1497 }
1498 }
1499 }
1500 else if (optimizerPatterns.MatchesPattern(OptimizerPatternName.DodMerge))
1501 {
1509 Visit(ndDod.Child);
1514 EndNestedIterator(ndDod.Child);
1517 return true;
1518 }
1519 return false;
1520 }
1521
1523 {
1524 QilFunction function = ndInvoke.Function;
1525 MethodInfo functionBinding = XmlILAnnotation.Write(function).FunctionBinding;
1526 bool flag = XmlILConstructInfo.Read(function).ConstructMethod == XmlILConstructMethod.Writer;
1528 for (int i = 0; i < ndInvoke.Arguments.Count; i++)
1529 {
1530 QilNode nd = ndInvoke.Arguments[i];
1531 QilNode qilNode = ndInvoke.Function.Arguments[i];
1533 }
1534 if (OptimizerPatterns.Read(ndInvoke).MatchesPattern(OptimizerPatternName.TailCall))
1535 {
1537 }
1538 else
1539 {
1541 }
1542 if (!flag)
1543 {
1545 }
1546 else
1547 {
1549 }
1550 return ndInvoke;
1551 }
1552
1558
1572
1583
1593
1601
1607
1613
1615 {
1617 return ndAnc;
1618 }
1619
1625
1627 {
1629 return ndPrec;
1630 }
1631
1637
1643
1649
1660
1662 {
1665 if (XmlILConstructInfo.Read(ndElem.Right).FinalStates == PossibleXmlStates.Any)
1666 {
1667 flag = true;
1668 }
1669 if (xmlILConstructInfo.FinalStates == PossibleXmlStates.Any)
1670 {
1671 flag = true;
1672 }
1673 if (!flag)
1674 {
1676 }
1679 NestedVisit(ndElem.Right);
1680 if (XmlILConstructInfo.Read(ndElem.Right).FinalStates == PossibleXmlStates.EnumAttrs && !flag)
1681 {
1683 }
1684 nameType = LoadNameAndType(XPathNodeType.Element, ndElem.Left, isStart: false, flag);
1686 if (!flag)
1687 {
1689 }
1691 return ndElem;
1692 }
1693
1695 {
1697 bool flag = CheckEnumAttrs(xmlILConstructInfo) || !xmlILConstructInfo.IsNamespaceInScope;
1698 if (!flag)
1699 {
1701 }
1702 GenerateNameType nameType = LoadNameAndType(XPathNodeType.Attribute, ndAttr.Left, isStart: true, flag);
1704 NestedVisit(ndAttr.Right);
1706 if (!flag)
1707 {
1709 }
1711 return ndAttr;
1712 }
1713
1722
1723 protected override QilNode VisitPICtor(QilBinary ndPI)
1724 {
1728 NestedVisit(ndPI.Right);
1731 return ndPI;
1732 }
1733
1735 {
1737 }
1738
1740 {
1742 }
1743
1745 {
1748 bool flag = (uint)(initialStates - 4) > 2u && CheckWithinContent(xmlILConstructInfo);
1749 if (!flag)
1750 {
1752 }
1755 switch (xmlILConstructInfo.InitialStates)
1756 {
1757 case PossibleXmlStates.WithinAttr:
1759 break;
1760 case PossibleXmlStates.WithinComment:
1762 break;
1763 case PossibleXmlStates.WithinPI:
1765 break;
1766 default:
1768 break;
1769 }
1770 if (!flag)
1771 {
1773 }
1775 return ndText;
1776 }
1777
1779 {
1781 NestedVisit(ndDoc.Child);
1784 return ndDoc;
1785 }
1786
1788 {
1791 if (!flag)
1792 {
1794 }
1799 if (!flag)
1800 {
1802 }
1804 return ndNmsp;
1805 }
1806
1827
1829 {
1830 return VisitNodeProperty(ndName);
1831 }
1832
1834 {
1835 return VisitNodeProperty(ndName);
1836 }
1837
1839 {
1840 return VisitNodeProperty(ndName);
1841 }
1842
1844 {
1845 return VisitNodeProperty(ndName);
1846 }
1847
1849 {
1851 switch (ndProp.NodeType)
1852 {
1853 case QilNodeType.NameOf:
1859 break;
1860 case QilNodeType.LocalNameOf:
1863 break;
1864 case QilNodeType.NamespaceUriOf:
1867 break;
1868 case QilNodeType.PrefixOf:
1871 break;
1872 }
1873 return ndProp;
1874 }
1875
1877 {
1878 if (!ndTypeAssert.Source.XmlType.IsSingleton && ndTypeAssert.XmlType.IsSingleton && !_iterCurr.HasLabelNext)
1879 {
1883 }
1884 else
1885 {
1886 Visit(ndTypeAssert.Source);
1887 }
1889 return ndTypeAssert;
1890 }
1891
1893 {
1894 XmlQueryType xmlType = ndIsType.Source.XmlType;
1895 XmlQueryType targetType = ndIsType.TargetType;
1896 if (xmlType.IsSingleton && (object)targetType == XmlQueryTypeFactory.Node)
1897 {
1901 return ndIsType;
1902 }
1903 if (MatchesNodeKinds(ndIsType, xmlType, targetType))
1904 {
1905 return ndIsType;
1906 }
1908 if (xmlTypeCode != 0)
1909 {
1915 return ndIsType;
1916 }
1922 return ndIsType;
1923 }
1924
1926 {
1927 bool flag = true;
1928 if (!typBase.IsNode || !typBase.IsSingleton)
1929 {
1930 return false;
1931 }
1932 if (!typDerived.IsNode || !typDerived.IsSingleton || !typDerived.IsNotRtf)
1933 {
1934 return false;
1935 }
1937 foreach (XmlQueryType item in typBase)
1938 {
1939 if ((object)item == XmlQueryTypeFactory.Element)
1940 {
1942 continue;
1943 }
1944 if ((object)item == XmlQueryTypeFactory.Attribute)
1945 {
1947 continue;
1948 }
1949 if ((object)item == XmlQueryTypeFactory.Text)
1950 {
1952 continue;
1953 }
1954 if ((object)item == XmlQueryTypeFactory.Document)
1955 {
1957 continue;
1958 }
1959 if ((object)item == XmlQueryTypeFactory.Comment)
1960 {
1962 continue;
1963 }
1964 if ((object)item == XmlQueryTypeFactory.PI)
1965 {
1967 continue;
1968 }
1969 if ((object)item == XmlQueryTypeFactory.Namespace)
1970 {
1972 continue;
1973 }
1974 return false;
1975 }
1977 if (!Bits.ExactlyOne((uint)xmlNodeKindFlags))
1978 {
1980 flag = !flag;
1981 }
1983 switch (xmlNodeKindFlags)
1984 {
1985 case XmlNodeKindFlags.Element:
1986 xPathNodeType = XPathNodeType.Element;
1987 break;
1988 case XmlNodeKindFlags.Attribute:
1989 xPathNodeType = XPathNodeType.Attribute;
1990 break;
1991 case XmlNodeKindFlags.Namespace:
1992 xPathNodeType = XPathNodeType.Namespace;
1993 break;
1994 case XmlNodeKindFlags.PI:
1995 xPathNodeType = XPathNodeType.ProcessingInstruction;
1996 break;
1997 case XmlNodeKindFlags.Comment:
1998 xPathNodeType = XPathNodeType.Comment;
1999 break;
2000 case XmlNodeKindFlags.Document:
2002 break;
2003 default:
2006 break;
2007 }
2010 if (xPathNodeType == XPathNodeType.All)
2011 {
2013 int num = 0;
2014 if ((xmlNodeKindFlags & XmlNodeKindFlags.Document) != 0)
2015 {
2016 num |= 1;
2017 }
2018 if ((xmlNodeKindFlags & XmlNodeKindFlags.Element) != 0)
2019 {
2020 num |= 2;
2021 }
2022 if ((xmlNodeKindFlags & XmlNodeKindFlags.Attribute) != 0)
2023 {
2024 num |= 4;
2025 }
2026 if ((xmlNodeKindFlags & XmlNodeKindFlags.Text) != 0)
2027 {
2028 num |= 0x70;
2029 }
2030 if ((xmlNodeKindFlags & XmlNodeKindFlags.Comment) != 0)
2031 {
2032 num |= 0x100;
2033 }
2034 if ((xmlNodeKindFlags & XmlNodeKindFlags.PI) != 0)
2035 {
2036 num |= 0x80;
2037 }
2038 if ((xmlNodeKindFlags & XmlNodeKindFlags.Namespace) != 0)
2039 {
2040 num |= 8;
2041 }
2042 _helper.LoadInteger(num);
2044 ZeroCompare(flag ? QilNodeType.Ne : QilNodeType.Eq, isBoolVal: false);
2045 }
2046 else
2047 {
2049 ClrCompare(flag ? QilNodeType.Eq : QilNodeType.Ne, XmlTypeCode.Int);
2050 }
2051 return true;
2052 }
2053
2055 {
2056 if (CachesResult(ndIsEmpty.Child))
2057 {
2061 {
2062 case BranchingContext.OnFalse:
2064 break;
2065 case BranchingContext.OnTrue:
2067 break;
2068 default:
2069 {
2073 break;
2074 }
2075 }
2076 }
2077 else
2078 {
2081 if (iterCurr.CurrentBranchingContext == BranchingContext.OnTrue)
2082 {
2084 }
2085 else
2086 {
2088 }
2089 Visit(ndIsEmpty.Child);
2092 switch (iterCurr.CurrentBranchingContext)
2093 {
2094 case BranchingContext.OnFalse:
2097 break;
2098 case BranchingContext.None:
2100 break;
2101 }
2103 }
2105 {
2107 }
2108 else
2109 {
2111 }
2112 return ndIsEmpty;
2113 }
2114
2116 {
2117 if (ndVal.Child.XmlType.IsSingleton)
2118 {
2121 }
2122 else
2123 {
2126 Visit(ndVal.Child);
2134 EndNestedIterator(ndVal.Child);
2135 }
2137 return ndVal;
2138 }
2139
2145
2151
2157
2185
2211
2212 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2072:RequiresUnreferencedCode", Justification = "Supressing warning about not having the RequiresUnreferencedCode attribute since we added the attribute to this subclass' constructor. This allows us to not have to annotate the whole QilNode hirerarchy.")]
2214 {
2215 QilName name = ndInvoke.Name;
2216 XmlExtensionFunction xmlExtensionFunction = new XmlExtensionFunction(name.LocalName, name.NamespaceUri, ndInvoke.ClrMethod);
2217 Type clrReturnType = xmlExtensionFunction.ClrReturnType;
2219 if (clrReturnType != storageType && !ndInvoke.XmlType.IsEmpty)
2220 {
2223 }
2224 if (!xmlExtensionFunction.Method.IsStatic)
2225 {
2226 if (name.NamespaceUri.Length == 0)
2227 {
2229 }
2230 else
2231 {
2232 _helper.CallGetEarlyBoundObject(_helper.StaticData.DeclareEarlyBound(name.NamespaceUri, xmlExtensionFunction.Method.DeclaringType), xmlExtensionFunction.Method.DeclaringType);
2233 }
2234 }
2235 for (int i = 0; i < ndInvoke.Arguments.Count; i++)
2236 {
2237 QilNode qilNode = ndInvoke.Arguments[i];
2238 XmlQueryType xmlArgumentType = xmlExtensionFunction.GetXmlArgumentType(i);
2239 Type clrArgumentType = xmlExtensionFunction.GetClrArgumentType(i);
2240 if (name.NamespaceUri.Length == 0)
2241 {
2244 {
2246 }
2248 {
2250 }
2251 else if ((qilNode.XmlType.IsSingleton && clrArgumentType == itemStorageType) || qilNode.XmlType.TypeCode == XmlTypeCode.None)
2252 {
2254 }
2255 else if (qilNode.XmlType.IsSingleton && clrArgumentType == typeof(XPathItem))
2256 {
2258 }
2259 }
2260 else
2261 {
2263 if (xmlArgumentType.TypeCode == XmlTypeCode.Item || !clrArgumentType.IsAssignableFrom(storageType2))
2264 {
2272 }
2273 else
2274 {
2276 }
2277 }
2278 }
2280 if (ndInvoke.XmlType.IsEmpty)
2281 {
2283 }
2284 else if (clrReturnType != storageType)
2285 {
2289 }
2290 else if (name.NamespaceUri.Length != 0 && !clrReturnType.IsValueType)
2291 {
2299 }
2301 return ndInvoke;
2302 }
2303
2319
2328
2330 {
2331 XmlQueryType xmlType = ndConv.Source.XmlType;
2332 XmlQueryType targetType = ndConv.TargetType;
2334 {
2336 }
2337 else
2338 {
2341 }
2342 if (meth != null)
2343 {
2344 _helper.Call(meth);
2345 }
2347 return ndConv;
2348 }
2349
2351 {
2352 meth = null;
2353 if ((object)typDst == XmlQueryTypeFactory.BooleanX)
2354 {
2355 if ((object)typSrc == XmlQueryTypeFactory.Item)
2356 {
2358 }
2359 else if ((object)typSrc == XmlQueryTypeFactory.ItemS)
2360 {
2362 }
2363 }
2364 else if ((object)typDst == XmlQueryTypeFactory.DateTimeX)
2365 {
2366 if ((object)typSrc == XmlQueryTypeFactory.StringX)
2367 {
2369 }
2370 }
2371 else if ((object)typDst == XmlQueryTypeFactory.DecimalX)
2372 {
2373 if ((object)typSrc == XmlQueryTypeFactory.DoubleX)
2374 {
2376 }
2377 }
2378 else if ((object)typDst == XmlQueryTypeFactory.DoubleX)
2379 {
2380 if ((object)typSrc == XmlQueryTypeFactory.DecimalX)
2381 {
2383 }
2384 else if ((object)typSrc == XmlQueryTypeFactory.IntX)
2385 {
2387 }
2388 else if ((object)typSrc == XmlQueryTypeFactory.Item)
2389 {
2391 }
2392 else if ((object)typSrc == XmlQueryTypeFactory.ItemS)
2393 {
2395 }
2396 else if ((object)typSrc == XmlQueryTypeFactory.LongX)
2397 {
2399 }
2400 else if ((object)typSrc == XmlQueryTypeFactory.StringX)
2401 {
2403 }
2404 }
2405 else if ((object)typDst == XmlQueryTypeFactory.IntX)
2406 {
2407 if ((object)typSrc == XmlQueryTypeFactory.DoubleX)
2408 {
2410 }
2411 }
2412 else if ((object)typDst == XmlQueryTypeFactory.LongX)
2413 {
2414 if ((object)typSrc == XmlQueryTypeFactory.DoubleX)
2415 {
2417 }
2418 }
2419 else if ((object)typDst == XmlQueryTypeFactory.NodeNotRtf)
2420 {
2421 if ((object)typSrc == XmlQueryTypeFactory.Item)
2422 {
2424 }
2425 else if ((object)typSrc == XmlQueryTypeFactory.ItemS)
2426 {
2428 }
2429 }
2430 else if ((object)typDst == XmlQueryTypeFactory.NodeSDod || (object)typDst == XmlQueryTypeFactory.NodeNotRtfS)
2431 {
2432 if ((object)typSrc == XmlQueryTypeFactory.Item)
2433 {
2435 }
2436 else if ((object)typSrc == XmlQueryTypeFactory.ItemS)
2437 {
2439 }
2440 }
2441 else if ((object)typDst == XmlQueryTypeFactory.StringX)
2442 {
2443 if ((object)typSrc == XmlQueryTypeFactory.DateTimeX)
2444 {
2446 }
2447 else if ((object)typSrc == XmlQueryTypeFactory.DoubleX)
2448 {
2450 }
2451 else if ((object)typSrc == XmlQueryTypeFactory.Item)
2452 {
2454 }
2455 else if ((object)typSrc == XmlQueryTypeFactory.ItemS)
2456 {
2458 }
2459 }
2460 return meth != null;
2461 }
2462
2470
2479
2497
2517
2527
2556
2558 {
2559 _helper.LoadQueryOutput();
2560 GenerateNameType result = GenerateNameType.StackName;
2561 if (ndName.NodeType == QilNodeType.LiteralQName)
2562 {
2563 if (isStart || !callChk)
2564 {
2566 string prefix = qilName.Prefix;
2567 string localName = qilName.LocalName;
2568 string namespaceUri = qilName.NamespaceUri;
2569 if (qilName.NamespaceUri.Length == 0)
2570 {
2571 _helper.Emit(OpCodes.Ldstr, qilName.LocalName);
2572 return GenerateNameType.LiteralLocalName;
2573 }
2574 if (!ValidateNames.ValidateName(prefix, localName, namespaceUri, nodeType, ValidateNames.Flags.CheckPrefixMapping))
2575 {
2576 if (isStart)
2577 {
2578 _helper.Emit(OpCodes.Ldstr, localName);
2579 _helper.Emit(OpCodes.Ldstr, namespaceUri);
2580 _helper.Construct(XmlILConstructors.QName);
2581 result = GenerateNameType.QName;
2582 }
2583 }
2584 else
2585 {
2586 _helper.Emit(OpCodes.Ldstr, prefix);
2587 _helper.Emit(OpCodes.Ldstr, localName);
2588 _helper.Emit(OpCodes.Ldstr, namespaceUri);
2589 result = GenerateNameType.LiteralName;
2590 }
2591 }
2592 }
2593 else if (isStart)
2594 {
2595 if (ndName.NodeType == QilNodeType.NameOf)
2596 {
2597 NestedVisitEnsureStack((ndName as QilUnary).Child);
2598 result = GenerateNameType.CopiedName;
2599 }
2600 else if (ndName.NodeType == QilNodeType.StrParseQName)
2601 {
2602 VisitStrParseQName(ndName as QilBinary, preservePrefix: true);
2603 result = (((ndName as QilBinary).Right.XmlType.TypeCode != XmlTypeCode.String) ? GenerateNameType.TagNameAndMappings : GenerateNameType.TagNameAndNamespace);
2604 }
2605 else
2606 {
2607 NestedVisitEnsureStack(ndName);
2608 result = GenerateNameType.QName;
2609 }
2610 }
2611 return result;
2612 }
2613
2615 {
2616 switch (ndFirst.NodeType)
2617 {
2618 case QilNodeType.LiteralInt64:
2619 if ((int)(QilLiteral)ndFirst != 0)
2620 {
2621 return false;
2622 }
2623 break;
2624 case QilNodeType.LiteralInt32:
2625 if ((int)(QilLiteral)ndFirst != 0)
2626 {
2627 return false;
2628 }
2629 break;
2630 case QilNodeType.True:
2631 relOp = ((relOp == QilNodeType.Eq) ? QilNodeType.Ne : QilNodeType.Eq);
2632 break;
2633 default:
2634 return false;
2635 case QilNodeType.False:
2636 break;
2637 }
2638 NestedVisitEnsureStack(ndSecond);
2639 ZeroCompare(relOp, ndSecond.XmlType.TypeCode == XmlTypeCode.Boolean);
2640 return true;
2641 }
2642
2644 {
2645 if (ndFirst.NodeType == QilNodeType.NameOf)
2646 {
2647 QilNodeType nodeType = ndSecond.NodeType;
2648 if (nodeType == QilNodeType.LiteralQName || nodeType == QilNodeType.NameOf)
2649 {
2650 _helper.LoadQueryRuntime();
2651 NestedVisitEnsureStack((ndFirst as QilUnary).Child);
2652 if (ndSecond.NodeType == QilNodeType.LiteralQName)
2653 {
2655 _helper.LoadInteger(_helper.StaticData.DeclareName(qilName.LocalName));
2656 _helper.LoadInteger(_helper.StaticData.DeclareName(qilName.NamespaceUri));
2657 _helper.Call(XmlILMethods.QNameEqualLit);
2658 }
2659 else
2660 {
2661 NestedVisitEnsureStack(ndSecond);
2662 _helper.Call(XmlILMethods.QNameEqualNav);
2663 }
2664 ZeroCompare((relOp == QilNodeType.Eq) ? QilNodeType.Ne : QilNodeType.Eq, isBoolVal: true);
2665 return true;
2666 }
2667 }
2668 return false;
2669 }
2670
2672 {
2673 OpCode opcode;
2674 switch (_iterCurr.CurrentBranchingContext)
2675 {
2676 case BranchingContext.OnFalse:
2677 opcode = ((code == XmlTypeCode.Double || code == XmlTypeCode.Float) ? (relOp switch
2678 {
2685 _ => OpCodes.Nop,
2686 }) : (relOp switch
2687 {
2694 _ => OpCodes.Nop,
2695 }));
2696 _helper.Emit(opcode, _iterCurr.LabelBranch);
2698 return;
2699 case BranchingContext.OnTrue:
2700 opcode = relOp switch
2701 {
2708 _ => OpCodes.Nop,
2709 };
2710 _helper.Emit(opcode, _iterCurr.LabelBranch);
2712 return;
2713 }
2714 Label label;
2715 switch (relOp)
2716 {
2717 case QilNodeType.Gt:
2718 _helper.Emit(OpCodes.Cgt);
2719 break;
2720 case QilNodeType.Lt:
2721 _helper.Emit(OpCodes.Clt);
2722 break;
2723 case QilNodeType.Eq:
2724 _helper.Emit(OpCodes.Ceq);
2725 break;
2726 case QilNodeType.Ge:
2727 opcode = OpCodes.Bge_S;
2728 goto IL_0207;
2729 case QilNodeType.Le:
2730 opcode = OpCodes.Ble_S;
2731 goto IL_0207;
2732 case QilNodeType.Ne:
2733 opcode = OpCodes.Bne_Un_S;
2734 goto IL_0207;
2735 default:
2736 {
2737 opcode = OpCodes.Nop;
2738 goto IL_0207;
2739 }
2740 IL_0207:
2741 label = _helper.DefineLabel();
2742 _helper.Emit(opcode, label);
2743 _helper.ConvBranchToBool(label, isTrueBranch: true);
2744 break;
2745 }
2747 }
2748
2750 {
2751 switch (_iterCurr.CurrentBranchingContext)
2752 {
2753 case BranchingContext.OnTrue:
2754 _helper.Emit((relOp == QilNodeType.Eq) ? OpCodes.Brfalse : OpCodes.Brtrue, _iterCurr.LabelBranch);
2756 return;
2757 case BranchingContext.OnFalse:
2758 _helper.Emit((relOp == QilNodeType.Eq) ? OpCodes.Brtrue : OpCodes.Brfalse, _iterCurr.LabelBranch);
2760 return;
2761 }
2762 if (!isBoolVal || relOp == QilNodeType.Eq)
2763 {
2764 Label label = _helper.DefineLabel();
2765 _helper.Emit((relOp == QilNodeType.Eq) ? OpCodes.Brfalse : OpCodes.Brtrue, label);
2766 _helper.ConvBranchToBool(label, isTrueBranch: true);
2767 }
2769 }
2770
2772 {
2774 hasOnEnd = false;
2775 lblOnEnd = default(Label);
2776 if (xmlILConstructInfo.PushToWriterLast && !nd.XmlType.IsSingleton && !_iterCurr.HasLabelNext)
2777 {
2778 hasOnEnd = true;
2779 lblOnEnd = _helper.DefineLabel();
2780 _iterCurr.SetIterator(lblOnEnd, StorageDescriptor.None());
2781 }
2782 }
2783
2785 {
2787 if (xmlILConstructInfo.PushToWriterLast)
2788 {
2790 if (!nd.XmlType.IsSingleton && hasOnEnd)
2791 {
2792 _iterCurr.LoopToEnd(lblOnEnd);
2793 }
2794 }
2795 }
2796
2798 {
2799 if (info != null)
2800 {
2801 info = info.ParentElementInfo;
2802 }
2803 return info?.MightHaveNamespacesAfterAttributes ?? true;
2804 }
2805
2807 {
2808 if (!info.MightHaveDuplicateAttributes)
2809 {
2810 return info.MightHaveNamespacesAfterAttributes;
2811 }
2812 return true;
2813 }
2814
2816 {
2817 switch (XmlILConstructInfo.Read(ndCtor).InitialStates)
2818 {
2819 case PossibleXmlStates.WithinSequence:
2820 _helper.CallStartTree(QilConstructorToNodeType(ndCtor.NodeType));
2821 break;
2822 case PossibleXmlStates.EnumAttrs:
2823 {
2824 QilNodeType nodeType = ndCtor.NodeType;
2825 if (nodeType == QilNodeType.ElementCtor || (uint)(nodeType - 83) <= 3u)
2826 {
2827 _helper.CallStartElementContent();
2828 }
2829 break;
2830 }
2831 }
2832 }
2833
2835 {
2836 if (XmlILConstructInfo.Read(ndCtor).FinalStates == PossibleXmlStates.WithinSequence)
2837 {
2838 _helper.CallEndTree();
2839 }
2840 }
2841
2843 {
2844 PossibleXmlStates initialStates = info.InitialStates;
2845 if ((uint)(initialStates - 1) <= 2u)
2846 {
2847 return false;
2848 }
2849 return true;
2850 }
2851
2853 {
2854 PossibleXmlStates initialStates = info.InitialStates;
2855 if ((uint)(initialStates - 1) <= 1u)
2856 {
2857 return false;
2858 }
2859 return true;
2860 }
2861
2863 {
2864 return xmlTypes switch
2865 {
2870 _ => XPathNodeType.ProcessingInstruction,
2871 };
2872 }
2873
2875 {
2876 return typ switch
2877 {
2882 QilNodeType.PICtor => XPathNodeType.ProcessingInstruction,
2886 _ => XPathNodeType.All,
2887 };
2888 }
2889
2891 {
2892 if (ndName != null)
2893 {
2894 _helper.CallGetNameFilter(_helper.StaticData.DeclareNameFilter(ndName.LocalName, ndName.NamespaceUri));
2895 }
2896 else if (IsNodeTypeUnion(xmlTypes))
2897 {
2898 if ((xmlTypes & XmlNodeKindFlags.Attribute) != 0)
2899 {
2900 _helper.CallGetTypeFilter(XPathNodeType.All);
2901 }
2902 else
2903 {
2904 _helper.CallGetTypeFilter(XPathNodeType.Attribute);
2905 }
2906 }
2907 else
2908 {
2909 _helper.CallGetTypeFilter(QilXmlToXPathNodeType(xmlTypes));
2910 }
2911 }
2912
2914 {
2915 return (xmlTypes & (xmlTypes - 1)) != 0;
2916 }
2917
2918 [MemberNotNull("_iterCurr")]
2920 {
2921 IteratorDescriptor iterCurr = _iterCurr;
2922 if (iterCurr == null)
2923 {
2924 _iterCurr = new IteratorDescriptor(_helper);
2925 }
2926 else
2927 {
2928 _iterCurr = new IteratorDescriptor(iterCurr);
2929 }
2930 _iterNested = null;
2931 }
2932
2934 {
2935 StartNestedIterator(nd);
2936 _iterCurr.SetIterator(lblOnEnd, StorageDescriptor.None());
2937 }
2938
2940 {
2941 if (_iterCurr.IsBranching && _iterCurr.Storage.Location != 0)
2942 {
2943 _iterCurr.EnsureItemStorageType(nd.XmlType, typeof(bool));
2944 _iterCurr.EnsureStackNoCache();
2945 if (_iterCurr.CurrentBranchingContext == BranchingContext.OnTrue)
2946 {
2947 _helper.Emit(OpCodes.Brtrue, _iterCurr.LabelBranch);
2948 }
2949 else
2950 {
2951 _helper.Emit(OpCodes.Brfalse, _iterCurr.LabelBranch);
2952 }
2954 }
2955 _iterNested = _iterCurr;
2956 _iterCurr = _iterCurr.ParentIterator;
2957 }
2958
2960 {
2961 if (XmlILConstructInfo.Read(nd).PushToWriterLast)
2962 {
2963 StartNestedIterator(nd);
2964 Visit(nd);
2965 EndNestedIterator(nd);
2967 }
2968 else if (!isCached && nd.XmlType.IsSingleton)
2969 {
2970 StartNestedIterator(nd);
2971 Visit(nd);
2972 _iterCurr.EnsureNoCache();
2973 _iterCurr.EnsureItemStorageType(nd.XmlType, itemStorageType);
2974 EndNestedIterator(nd);
2975 _iterCurr.Storage = _iterNested.Storage;
2976 }
2977 else
2978 {
2979 NestedVisitEnsureCache(nd, itemStorageType);
2980 }
2981 }
2982
2983 private void NestedVisit(QilNode nd)
2984 {
2985 NestedVisit(nd, GetItemStorageType(nd), !nd.XmlType.IsSingleton);
2986 }
2987
2989 {
2990 StartNestedIterator(nd, lblOnEnd);
2991 Visit(nd);
2992 _iterCurr.EnsureNoCache();
2993 _iterCurr.EnsureItemStorageType(nd.XmlType, GetItemStorageType(nd));
2994 EndNestedIterator(nd);
2995 _iterCurr.Storage = _iterNested.Storage;
2996 }
2997
2999 {
3000 NestedVisit(nd);
3001 _iterCurr.EnsureStack();
3002 }
3003
3005 {
3006 NestedVisitEnsureStack(ndLeft);
3007 NestedVisitEnsureStack(ndRight);
3008 }
3009
3011 {
3012 NestedVisit(nd, itemStorageType, isCached);
3013 _iterCurr.EnsureStack();
3014 }
3015
3017 {
3018 NestedVisit(nd);
3019 _iterCurr.EnsureLocal(loc);
3020 }
3021
3023 {
3024 StartNestedIterator(nd);
3025 _iterCurr.SetBranching(brctxt, lblBranch);
3026 Visit(nd);
3027 EndNestedIterator(nd);
3029 }
3030
3032 {
3033 bool flag = CachesResult(nd);
3034 Label lblOnEnd = _helper.DefineLabel();
3035 if (flag)
3036 {
3037 StartNestedIterator(nd);
3038 Visit(nd);
3039 EndNestedIterator(nd);
3040 _iterCurr.Storage = _iterNested.Storage;
3041 if (_iterCurr.Storage.ItemStorageType == itemStorageType)
3042 {
3043 return;
3044 }
3045 if (_iterCurr.Storage.ItemStorageType == typeof(XPathNavigator) || itemStorageType == typeof(XPathNavigator))
3046 {
3047 _iterCurr.EnsureItemStorageType(nd.XmlType, itemStorageType);
3048 return;
3049 }
3050 _iterCurr.EnsureNoStack("$$$cacheResult");
3051 }
3052 Type type = ((GetItemStorageType(nd) == typeof(XPathNavigator)) ? typeof(XPathNavigator) : itemStorageType);
3054 LocalBuilder localBuilder = _helper.DeclareLocal("$$$cache", xmlILStorageMethods.SeqType);
3055 _helper.Emit(OpCodes.Ldloc, localBuilder);
3056 if (nd.XmlType.IsSingleton)
3057 {
3058 NestedVisitEnsureStack(nd, type, isCached: false);
3059 _helper.Call(xmlILStorageMethods.SeqReuseSgl);
3060 _helper.Emit(OpCodes.Stloc, localBuilder);
3061 }
3062 else
3063 {
3064 _helper.Call(xmlILStorageMethods.SeqReuse);
3065 _helper.Emit(OpCodes.Stloc, localBuilder);
3066 _helper.Emit(OpCodes.Ldloc, localBuilder);
3067 StartNestedIterator(nd, lblOnEnd);
3068 if (flag)
3069 {
3070 _iterCurr.Storage = _iterCurr.ParentIterator.Storage;
3071 }
3072 else
3073 {
3074 Visit(nd);
3075 }
3076 _iterCurr.EnsureItemStorageType(nd.XmlType, type);
3077 _iterCurr.EnsureStackNoCache();
3078 _helper.Call(xmlILStorageMethods.SeqAdd);
3079 _helper.Emit(OpCodes.Ldloc, localBuilder);
3080 _iterCurr.LoopToEnd(lblOnEnd);
3081 EndNestedIterator(nd);
3082 _helper.Emit(OpCodes.Pop);
3083 }
3085 }
3086
3088 {
3089 switch (nd.NodeType)
3090 {
3091 case QilNodeType.Let:
3092 case QilNodeType.Parameter:
3093 case QilNodeType.Invoke:
3094 case QilNodeType.XsltInvokeLateBound:
3095 case QilNodeType.XsltInvokeEarlyBound:
3096 return !nd.XmlType.IsSingleton;
3097 case QilNodeType.Filter:
3098 {
3100 return optimizerPatterns.MatchesPattern(OptimizerPatternName.EqualityIndex);
3101 }
3102 case QilNodeType.DocOrderDistinct:
3103 {
3104 if (nd.XmlType.IsSingleton)
3105 {
3106 return false;
3107 }
3109 if (!optimizerPatterns.MatchesPattern(OptimizerPatternName.JoinAndDod))
3110 {
3111 return !optimizerPatterns.MatchesPattern(OptimizerPatternName.DodReverse);
3112 }
3113 return false;
3114 }
3115 case QilNodeType.TypeAssert:
3116 {
3118 if (CachesResult(qilTargetType.Source))
3119 {
3120 return GetItemStorageType(qilTargetType.Source) == GetItemStorageType(qilTargetType);
3121 }
3122 return false;
3123 }
3124 default:
3125 return false;
3126 }
3127 }
3128
3130 {
3131 return XmlILTypeHelper.GetStorageType(nd.XmlType);
3132 }
3133
3138
3140 {
3141 return XmlILTypeHelper.GetStorageType(nd.XmlType.Prime);
3142 }
3143
3145 {
3146 return XmlILTypeHelper.GetStorageType(typ.Prime);
3147 }
3148}
static readonly OpCode Ldloca
Definition OpCodes.cs:427
static readonly OpCode Ldarg_2
Definition OpCodes.cs:13
static readonly OpCode Brfalse
Definition OpCodes.cs:117
static readonly OpCode Bge_S
Definition OpCodes.cs:97
static readonly OpCode Blt_Un
Definition OpCodes.cs:139
static readonly OpCode Ldc_I8
Definition OpCodes.cs:71
static readonly OpCode Blt
Definition OpCodes.cs:129
static readonly OpCode Bge_Un
Definition OpCodes.cs:133
static readonly OpCode Brtrue
Definition OpCodes.cs:119
static readonly OpCode Clt
Definition OpCodes.cs:411
static readonly OpCode Br_S
Definition OpCodes.cs:89
static readonly OpCode Ble_Un
Definition OpCodes.cs:137
static readonly OpCode Stloc
Definition OpCodes.cs:429
static readonly OpCode Bgt_Un
Definition OpCodes.cs:135
static readonly OpCode Bne_Un_S
Definition OpCodes.cs:105
static readonly OpCode Bgt
Definition OpCodes.cs:125
static readonly OpCode Cgt
Definition OpCodes.cs:407
static readonly OpCode Add
Definition OpCodes.cs:179
static readonly OpCode Ble
Definition OpCodes.cs:127
static readonly OpCode Beq
Definition OpCodes.cs:121
static readonly OpCode And
Definition OpCodes.cs:193
static readonly OpCode Br
Definition OpCodes.cs:115
static readonly OpCode Shl
Definition OpCodes.cs:199
static readonly OpCode Bne_Un
Definition OpCodes.cs:131
static readonly OpCode Ceq
Definition OpCodes.cs:405
static readonly OpCode Bge
Definition OpCodes.cs:123
static readonly OpCode Ldc_I4_1
Definition OpCodes.cs:51
static readonly OpCode Ldc_I4_0
Definition OpCodes.cs:49
static readonly OpCode Ldstr
Definition OpCodes.cs:231
static readonly OpCode Pop
Definition OpCodes.cs:79
static readonly OpCode Ldelema
Definition OpCodes.cs:285
static readonly OpCode Stobj
Definition OpCodes.cs:257
static readonly OpCode Ldarg_1
Definition OpCodes.cs:11
static readonly OpCode Ldsfld
Definition OpCodes.cs:251
static readonly OpCode Switch
Definition OpCodes.cs:141
static readonly OpCode Nop
Definition OpCodes.cs:5
static readonly OpCode Ldloc
Definition OpCodes.cs:425
static readonly OpCode Ldnull
Definition OpCodes.cs:45
static readonly OpCode Brfalse_S
Definition OpCodes.cs:91
static readonly OpCode Ldc_R8
Definition OpCodes.cs:75
static readonly OpCode Dup
Definition OpCodes.cs:77
static readonly OpCode Ble_S
Definition OpCodes.cs:101
static readonly OpCode Newarr
Definition OpCodes.cs:281
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Xslt_ItemNull
Definition SR.cs:1988
static string XmlIl_UnknownParam
Definition SR.cs:2044
Definition SR.cs:7
static bool ExactlyOne(uint num)
Definition Bits.cs:15
static bool ValidateName(string prefix, string localName, string ns, XPathNodeType nodeKind, Flags flags)
void TestAndBranch(int i4, Label lblBranch, OpCode opcodeBranch)
void TreatAs(Type clrTypeSrc, Type clrTypeDst)
void AddSortKey(XmlQueryType keyType)
void CallWriteString(bool disableOutputEscaping, bool callChk)
void ConstructLiteralQName(string localName, string namespaceName)
void CallGetParameter(string localName, string namespaceUri)
void DebugSequencePoint(ISourceLineInfo sourceInfo)
void Construct(ConstructorInfo constr)
void CallArithmeticOp(QilNodeType opType, XmlTypeCode code)
void CallWriteStartAttribute(GenerateNameType nameType, bool callChk)
LocalBuilder DeclareLocal(string name, Type type)
void CallStartRtfConstruction(string baseUri)
void CallGetEarlyBoundObject(int idxObj, Type clrType)
void CallCompareEquals(XmlTypeCode code)
void EmitUnconditionalBranch(OpCode opcode, Label lblTarget)
void ConvBranchToBool(Label lblBranch, bool isTrueBranch)
void CallWriteStartElement(GenerateNameType nameType, bool callChk)
void CallParseTagName(GenerateNameType nameType)
void CallCacheCount(Type itemStorageType)
void MethodBegin(MethodBase methInfo, ISourceLineInfo sourceInfo, bool initWriters)
void CallWriteEndElement(GenerateNameType nameType, bool callChk)
void CallGetGlobalValue(int idxValue, Type clrType)
void EnsureItemStorageType(XmlQueryType xmlType, Type storageTypeDest)
void SetBranching(BranchingContext brctxt, Label lblBranch)
void SetIterator(Label lblNext, StorageDescriptor storage)
static OptimizerPatterns Read(QilNode nd)
int DeclarePrefixMappings(IList< QilNode > list)
int DeclareEarlyBound(string namespaceUri, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type ebType)
static XmlILAnnotation Write(QilNode nd)
static XmlILConstructInfo Read(QilNode nd)
static readonly ConstructorInfo QName
static readonly MethodInfo PreSibDOCreate
static readonly Dictionary< Type, XmlILStorageMethods > StorageMethods
static readonly MethodInfo EndCopy
static readonly MethodInfo StrCatDelim
static readonly MethodInfo XPFollMergeCurrent
static readonly MethodInfo XPPrecMergeCreate
static readonly MethodInfo XPPrecCreate
static readonly MethodInfo DodMergeSeq
static readonly MethodInfo ParentCurrent
static readonly MethodInfo ItemsToNode
static readonly MethodInfo ContentCurrent
static readonly MethodInfo Value
static readonly MethodInfo KindContentNext
static readonly MethodInfo PrecCurrent
static readonly MethodInfo NodeRangeCreate
static readonly MethodInfo ContentMergeNext
static readonly MethodInfo ChangeTypeXsltArg
static readonly MethodInfo PrecCreate
static readonly MethodInfo NavMoveRoot
static readonly MethodInfo ParentNext
static readonly MethodInfo XPPrecMergeCurrent
static readonly MethodInfo AncDOCreate
static readonly MethodInfo AddNewIndex
static readonly MethodInfo StrToDbl
static readonly MethodInfo FollSibMergeCreate
static readonly MethodInfo DblToStr
static readonly MethodInfo DiffNext
static readonly MethodInfo DblToDec
static readonly MethodInfo GlobalComputed
static readonly MethodInfo PreSibCreate
static readonly MethodInfo DescMergeCurrent
static readonly MethodInfo FindIndex
static readonly MethodInfo DescCurrent
static readonly MethodInfo IdCurrent
static readonly MethodInfo DescNext
static readonly MethodInfo GenId
static readonly MethodInfo ItemToBool
static readonly MethodInfo FollSibCreate
static readonly MethodInfo InvokeXsltLate
static readonly MethodInfo AncDONext
static readonly MethodInfo AncCreate
static readonly MethodInfo NodeRangeCurrent
static readonly MethodInfo ItemToNode
static readonly MethodInfo StrCatResult
static readonly MethodInfo PreSibCurrent
static readonly MethodInfo AttrCreate
static readonly MethodInfo AncNext
static readonly MethodInfo NodeRangeNext
static readonly MethodInfo XPFollCreate
static readonly MethodInfo GetDataSource
static readonly MethodInfo XPPrecNext
static readonly MethodInfo XPPrecMergeNext
static readonly MethodInfo DecToDbl
static readonly MethodInfo CreateCollation
static readonly MethodInfo ItemsToDbl
static readonly MethodInfo StrCatCat
static readonly MethodInfo DescMergeCreate
static readonly MethodInfo StrLen
static readonly MethodInfo PIText
static readonly MethodInfo PreSibDONext
static readonly MethodInfo StartCopy
static readonly MethodInfo NmspNext
static readonly MethodInfo AttrCurrent
static readonly MethodInfo SortKeyKeys
static readonly MethodInfo PrecNext
static readonly MethodInfo GetDefaultDataSource
static readonly MethodInfo NavNmsp
static readonly MethodInfo ItemIsNode
static readonly MethodInfo IdCreate
static readonly MethodInfo DescMergeNext
static readonly MethodInfo DescCreate
static readonly MethodInfo ItemMatchesCode
static readonly MethodInfo KindContentCreate
static readonly MethodInfo ThrowException
static readonly MethodInfo NavSamePos
static readonly MethodInfo FollSibCurrent
static readonly MethodInfo LngToDbl
static readonly MethodInfo UnionCreate
static readonly MethodInfo ChangeTypeXsltResult
static readonly MethodInfo RtfConstr
static readonly MethodInfo InterCurrent
static readonly MethodInfo DodMergeAdd
static readonly MethodInfo NmspCurrent
static readonly MethodInfo XPPrecCurrent
static readonly MethodInfo QNameEqualNav
static readonly MethodInfo ItemToDbl
static readonly MethodInfo NavMoveParent
static readonly MethodInfo XPFollCurrent
static readonly MethodInfo DiffCurrent
static readonly MethodInfo UnionCurrent
static readonly MethodInfo IndexLookup
static readonly MethodInfo ItemToNodes
static readonly MethodInfo CompPos
static readonly MethodInfo FollSibNext
static readonly MethodInfo SortKeyCreate
static readonly MethodInfo ItemsToNodes
static readonly MethodInfo AttrNext
static readonly MethodInfo XPFollMergeNext
static readonly MethodInfo FollSibMergeCurrent
static readonly MethodInfo SeqMatchesType
static readonly MethodInfo CopyOf
static readonly MethodInfo InterNext
static readonly MethodInfo SortKeyFinish
static readonly MethodInfo XPPrecDONext
static readonly MethodInfo AttrContentCurrent
static readonly MethodInfo ItemsToStr
static readonly MethodInfo IntToDbl
static readonly MethodInfo AttrContentNext
static readonly MethodInfo AncDOCurrent
static readonly MethodInfo AncCurrent
static readonly MethodInfo ItemsToBool
static readonly MethodInfo ItemToStr
static readonly MethodInfo KindContentCurrent
static readonly MethodInfo ElemContentNext
static readonly MethodInfo XPFollNext
static readonly MethodInfo QNameEqualLit
static readonly MethodInfo InterCreate
static readonly MethodInfo NavMoveAttr
static readonly MethodInfo ParentCreate
static readonly MethodInfo ContentNext
static readonly MethodInfo CommentText
static readonly MethodInfo AttrContentCreate
static readonly MethodInfo ElemContentCreate
static readonly MethodInfo DblToInt
static readonly MethodInfo WriteItem
static readonly MethodInfo UnionNext
static readonly MethodInfo NavLocalName
static readonly MethodInfo NavType
static readonly MethodInfo DTToStr
static readonly MethodInfo ContentMergeCurrent
static readonly MethodInfo ContentMergeCreate
static readonly MethodInfo FollSibMergeNext
static readonly MethodInfo PreSibDOCurrent
static readonly MethodInfo XPPrecDOCreate
static readonly MethodInfo DblToLng
static readonly MethodInfo NmspCreate
static readonly MethodInfo DiffCreate
static readonly MethodInfo XPFollMergeCreate
static readonly MethodInfo ItemMatchesType
static readonly MethodInfo NavPrefix
static readonly MethodInfo SeqMatchesCode
static readonly MethodInfo IdNext
static readonly MethodInfo IndexAdd
static readonly MethodInfo SendMessage
static readonly MethodInfo StrCatClear
static readonly MethodInfo XPPrecDOCurrent
static readonly MethodInfo ContentCreate
static readonly MethodInfo PreSibNext
static readonly MethodInfo DodMergeCreate
static readonly MethodInfo StrToDT
static readonly MethodInfo DocOrder
static readonly MethodInfo ElemContentCurrent
static Type GetStorageType(XmlQueryType qyTyp)
override QilNode VisitDataSource(QilDataSource ndSrc)
override QilNode VisitOr(QilBinary ndOr)
override QilNode VisitLength(QilUnary ndSetLen)
override QilNode VisitTypeAssert(QilTargetType ndTypeAssert)
override QilNode VisitGe(QilBinary ndGe)
override QilNode VisitXsltCopyOf(QilUnary ndCopyOf)
override QilNode VisitLiteralDecimal(QilLiteral ndDec)
override QilNode VisitDivide(QilBinary ndDiv)
void EndBinding(QilIterator ndIter)
override QilNode VisitXPathFollowing(QilUnary ndFoll)
override QilNode VisitIsEmpty(QilUnary ndIsEmpty)
override QilNode VisitConditional(QilTernary ndCond)
QilNode ArithmeticOp(QilBinary ndOp)
override QilNode VisitAncestor(QilUnary ndAnc)
void LoadSelectFilter(XmlNodeKindFlags xmlTypes, QilName ndName)
override QilNode VisitLiteralDouble(QilLiteral ndDbl)
bool HandleFilterPatterns(QilLoop ndFilter)
XPathNodeType QilXmlToXPathNodeType(XmlNodeKindFlags xmlTypes)
override QilNode VisitNameOf(QilUnary ndName)
override QilNode VisitMaximum(QilUnary ndMax)
override QilNode VisitXsltCopy(QilBinary ndCopy)
override QilNode VisitLt(QilBinary ndLt)
bool MatchesNodeKinds(QilTargetType ndIsType, XmlQueryType typDerived, XmlQueryType typBase)
void GenerateConcat(QilNode ndStr, LocalBuilder locStringConcat)
override QilNode VisitFor(QilIterator ndFor)
override QilNode VisitError(QilUnary ndErr)
void VisitGlobalValues(QilList globalIterators)
override QilNode VisitXsltInvokeLateBound(QilInvokeLateBound ndInvoke)
override QilNode VisitAfter(QilBinary ndAfter)
void BeforeStartChecks(QilNode ndCtor)
override QilNode VisitGt(QilBinary ndGt)
override QilNode VisitAverage(QilUnary ndAvg)
override QilNode VisitDocOrderDistinct(QilUnary ndDod)
void StartLetBinding(QilIterator ndLet)
override QilNode VisitInvoke(QilInvoke ndInvoke)
override QilNode VisitPICtor(QilBinary ndPI)
override QilNode VisitNamespaceDecl(QilBinary ndNmsp)
Type GetStorageType(XmlQueryType typ)
override QilNode VisitChoice(QilChoice ndChoice)
void NestedVisit(QilNode nd, Label lblOnEnd)
override QilNode VisitMinimum(QilUnary ndMin)
void StartBinding(QilIterator ndIter)
override QilNode VisitElementCtor(QilBinary ndElem)
override QilNode VisitFilter(QilLoop ndFilter)
override QilNode VisitLoop(QilLoop ndLoop)
override QilNode VisitUnion(QilBinary ndUnion)
override QilNode VisitParameter(QilParameter ndParameter)
bool CheckWithinContent(XmlILConstructInfo info)
override QilNode VisitTextCtor(QilUnary ndText)
GenerateNameType LoadNameAndType(XPathNodeType nodeType, QilNode ndName, bool isStart, bool callChk)
bool MightHaveNamespacesAfterAttributes(XmlILConstructInfo info)
override QilNode VisitRoot(QilUnary ndRoot)
override QilNode VisitContent(QilUnary ndContent)
void CreateContainerIterator(QilUnary ndDod, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext, MethodInfo methCurrent, XmlNodeKindFlags kinds, QilName ndName, TriState orSelf)
override QilNode VisitXsltGenerateId(QilUnary ndGenId)
override QilNode VisitLet(QilIterator ndLet)
void NestedVisitWithBranch(QilNode nd, BranchingContext brctxt, Label lblBranch)
void SyncToNavigator(LocalBuilder locNav, QilNode ndCtxt)
void EndWriterLoop(QilNode nd, bool hasOnEnd, Label lblOnEnd)
void Function(QilFunction ndFunc)
override QilNode VisitStrLength(QilUnary ndLen)
Type GetItemStorageType(XmlQueryType typ)
bool CheckEnumAttrs(XmlILConstructInfo info)
override QilNode VisitPrefixOf(QilUnary ndName)
QilNode CreateSetIterator(QilBinary ndSet, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext, MethodInfo methCurrent)
void ZeroCompare(QilNodeType relOp, bool isBoolVal)
QilNode CreateAggregator(QilUnary ndAgg, string aggName, XmlILStorageMethods methods, MethodInfo methAgg, MethodInfo methResult)
bool ElementCachesAttributes(XmlILConstructInfo info)
override QilNode VisitDescendant(QilUnary ndDesc)
bool TryZeroCompare(QilNodeType relOp, QilNode ndFirst, QilNode ndSecond)
override QilNode VisitChildren(QilNode parent)
override QilNode VisitFollowingSibling(QilUnary ndFollSib)
override QilNode VisitIs(QilBinary ndIs)
override QilNode VisitDescendantOrSelf(QilUnary ndDesc)
override QilNode VisitLocalNameOf(QilUnary ndName)
override QilNode VisitAttribute(QilBinary ndAttr)
void AfterEndChecks(QilNode ndCtor)
void StartWriterLoop(QilNode nd, out bool hasOnEnd, out Label lblOnEnd)
void ComparePosition(QilBinary ndComp)
void CreateFilteredIterator(QilNode ndCtxt, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext, MethodInfo methCurrent, XmlNodeKindFlags kinds, QilName ndName, TriState orSelf, QilNode ndEnd)
override QilNode VisitOptimizeBarrier(QilUnary ndBarrier)
override QilNode VisitIsType(QilTargetType ndIsType)
override QilNode VisitTrue(QilNode ndTrue)
override QilNode VisitPrecedingSibling(QilUnary ndPreSib)
override QilNode VisitEq(QilBinary ndEq)
bool HandleDodPatterns(QilUnary ndDod)
override QilNode VisitModulo(QilBinary ndMod)
bool TryNameCompare(QilNodeType relOp, QilNode ndFirst, QilNode ndSecond)
override QilNode VisitNe(QilBinary ndNe)
void NestedVisitEnsureStack(QilNode nd, Type itemStorageType, bool isCached)
override QilNode VisitNamespaceUriOf(QilUnary ndName)
override QilNode Visit(QilNode nd)
Label StartConjunctiveTests(BranchingContext brctxt, Label lblBranch)
void GenerateContainerIterator(QilNode nd, LocalBuilder locIter, Label lblOnEndNested, MethodInfo methNext, MethodInfo methCurrent, Type itemStorageType)
override QilNode VisitWarning(QilUnary ndWarning)
override QilNode VisitNot(QilUnary ndNot)
override QilNode VisitCommentCtor(QilUnary ndComment)
override QilNode VisitLiteralInt32(QilLiteral ndInt)
override QilNode VisitRtfCtor(QilBinary ndRtf)
override QilNode VisitParent(QilUnary ndParent)
override QilNode VisitRawTextCtor(QilUnary ndText)
QilNode VisitNodeProperty(QilUnary ndProp)
override QilNode VisitFalse(QilNode ndFalse)
override QilNode VisitXPathPreceding(QilUnary ndPrec)
override QilNode VisitXPathNodeValue(QilUnary ndVal)
void Compare(QilBinary ndComp)
override QilNode VisitLiteralString(QilLiteral ndStr)
void CreateSimpleIterator(QilNode ndCtxt, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext, MethodInfo methCurrent)
override QilNode VisitDifference(QilBinary ndDiff)
void EndConjunctiveTests(BranchingContext brctxt, Label lblBranch, Label lblOnFalse)
bool GetXsltConvertMethod(XmlQueryType typSrc, XmlQueryType typDst, out MethodInfo meth)
override QilNode VisitDeref(QilBinary ndDeref)
void NestedVisitEnsureLocal(QilNode nd, LocalBuilder loc)
override QilNode VisitLiteralInt64(QilLiteral ndLong)
override QilNode VisitSequence(QilList ndSeq)
override QilNode VisitNodeRange(QilBinary ndRange)
override QilNode VisitMultiply(QilBinary ndMul)
XPathNodeType QilConstructorToNodeType(QilNodeType typ)
void StartLastConjunctiveTest(BranchingContext brctxt, Label lblBranch, Label lblOnFalse)
void VisitSortKey(QilSortKey ndKey, LocalBuilder locKeys)
void StartNestedIterator(QilNode nd, Label lblOnEnd)
QilNode VisitTextCtor(QilUnary ndText, bool disableOutputEscaping)
void VisitStrParseQName(QilBinary ndParsedTagName, bool preservePrefix)
override QilNode VisitIntersection(QilBinary ndInter)
override QilNode VisitAncestorOrSelf(QilUnary ndAnc)
override QilNode VisitBefore(QilBinary ndBefore)
override QilNode VisitStrParseQName(QilBinary ndParsedTagName)
override QilNode VisitPreceding(QilUnary ndPrec)
static bool IsNodeTypeUnion(XmlNodeKindFlags xmlTypes)
override QilNode VisitXsltConvert(QilTargetType ndConv)
override QilNode VisitNegate(QilUnary ndNeg)
void StartForBinding(QilIterator ndFor, OptimizerPatterns patt)
override QilNode VisitSubtract(QilBinary ndMinus)
void NestedVisitEnsureCache(QilNode nd, Type itemStorageType)
void ConditionalBranch(QilNode ndBranch, Type itemStorageType, LocalBuilder locResult)
override QilNode VisitAdd(QilBinary ndPlus)
override QilNode VisitAnd(QilBinary ndAnd)
override QilNode VisitDocumentCtor(QilUnary ndDoc)
override QilNode VisitPositionOf(QilUnary ndPos)
void NestedVisitEnsureStack(QilNode ndLeft, QilNode ndRight)
override QilNode VisitLe(QilBinary ndLe)
void Visit(QilExpression qil, GenerateHelper helper, MethodInfo methRoot)
void PrepareGlobalValues(QilList globalIterators)
override QilNode VisitNop(QilUnary ndNop)
override QilNode VisitXsltInvokeEarlyBound(QilInvokeEarlyBound ndInvoke)
override QilNode VisitSum(QilUnary ndSum)
override QilNode VisitXmlContext(QilNode ndCtxt)
void ClrCompare(QilNodeType relOp, XmlTypeCode code)
override QilNode VisitXPathNamespace(QilUnary ndNmsp)
override QilNode VisitAttributeCtor(QilBinary ndAttr)
void GenerateSimpleIterator(Type itemStorageType, LocalBuilder locIter, MethodInfo methNext, MethodInfo methCurrent)
override QilNode VisitSort(QilLoop ndSort)
override QilNode VisitStrConcat(QilStrConcat ndStrConcat)
void NestedVisit(QilNode nd, Type itemStorageType, bool isCached)
override QilNode VisitLiteralQName(QilName ndQName)
static readonly XmlQueryType NodeSDod
static readonly XmlQueryType Namespace
static readonly XmlQueryType String
static readonly XmlQueryType DecimalX
static readonly XmlQueryType DoubleX
static readonly XmlQueryType Text
static readonly XmlQueryType StringX
static readonly XmlQueryType IntX
static readonly XmlQueryType LongX
static readonly XmlQueryType Attribute
static readonly XmlQueryType Node
static readonly XmlQueryType Element
static readonly XmlQueryType Comment
static readonly XmlQueryType NodeNotRtfS
static readonly XmlQueryType Double
static readonly XmlQueryType PI
static readonly XmlQueryType ItemS
static readonly XmlQueryType BooleanX
static readonly XmlQueryType DateTimeX
static readonly XmlQueryType Document
static readonly XmlQueryType Item
static readonly XmlQueryType NodeNotRtf
static readonly XmlQueryType Boolean
static StorageDescriptor Global(MethodInfo methGlobal, Type itemStorageType, bool isCached)
static StorageDescriptor Parameter(int paramIndex, Type itemStorageType, bool isCached)
static StorageDescriptor Stack(Type itemStorageType, bool isCached)
static StorageDescriptor Current(LocalBuilder locIter, MethodInfo currentMethod, Type itemStorageType)
static StorageDescriptor Local(LocalBuilder loc, Type itemStorageType, bool isCached)