Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
QilTypeChecker.cs
Go to the documentation of this file.
2
3namespace System.Xml.Xsl.Qil;
4
5internal sealed class QilTypeChecker
6{
8 {
9 return n.NodeType switch
10 {
118 _ => CheckUnknown(n),
119 };
120 }
121
126
128 {
129 foreach (QilNode item in node)
130 {
131 }
132 return node.XmlType;
133 }
134
136 {
137 foreach (QilNode item in node)
138 {
139 }
140 return node.XmlType;
141 }
142
144 {
145 foreach (QilNode item in node)
146 {
147 }
148 return node.XmlType;
149 }
150
152 {
153 return node.XmlType;
154 }
155
157 {
158 foreach (QilNode item in node)
159 {
160 }
161 return node.XmlType;
162 }
163
165 {
166 foreach (QilNode item in node)
167 {
168 }
169 return node.XmlType;
170 }
171
173 {
174 return node.XmlType;
175 }
176
178 {
179 return node.Child.XmlType;
180 }
181
183 {
184 return node.XmlType;
185 }
186
191
193 {
194 return node.Child.XmlType;
195 }
196
201
206
208 {
209 return node.Binding.XmlType.Prime;
210 }
211
213 {
214 return node.Binding.XmlType;
215 }
216
218 {
219 return node.XmlType;
220 }
221
226
231
236
241
246
251
256
261
266
268 {
269 return node;
270 }
271
276
281
283 {
284 return CheckAnd(node);
285 }
286
291
293 {
294 return XmlQueryTypeFactory.Choice(node.Center.XmlType, node.Right.XmlType);
295 }
296
298 {
299 return node.Branches.XmlType;
300 }
301
306
308 {
309 return node.XmlType;
310 }
311
313 {
314 return DistinctType(XmlQueryTypeFactory.Sequence(node.Left.XmlType, node.Right.XmlType));
315 }
316
318 {
319 return CheckUnion(node);
320 }
321
323 {
324 return XmlQueryTypeFactory.AtMost(node.Left.XmlType, node.Left.XmlType.Cardinality);
325 }
326
332
334 {
335 return CheckAverage(node);
336 }
337
339 {
340 return CheckAverage(node);
341 }
342
344 {
345 return CheckAverage(node);
346 }
347
349 {
350 return node.Child.XmlType;
351 }
352
354 {
355 if (node.Left.XmlType.TypeCode != 0)
356 {
357 return node.Left.XmlType;
358 }
359 return node.Right.XmlType;
360 }
361
363 {
364 return CheckAdd(node);
365 }
366
368 {
369 return CheckAdd(node);
370 }
371
373 {
374 return CheckAdd(node);
375 }
376
378 {
379 return CheckAdd(node);
380 }
381
386
391
396
401
403 {
404 return CheckNe(node);
405 }
406
408 {
409 return CheckNe(node);
410 }
411
413 {
414 return CheckNe(node);
415 }
416
418 {
419 return CheckNe(node);
420 }
421
423 {
424 return CheckNe(node);
425 }
426
431
433 {
434 return CheckIs(node);
435 }
436
438 {
439 return CheckIs(node);
440 }
441
443 {
444 XmlQueryType xmlType = node.Body.XmlType;
445 XmlQueryCardinality xmlQueryCardinality = ((node.Variable.NodeType == QilNodeType.Let) ? XmlQueryCardinality.One : node.Variable.Binding.XmlType.Cardinality);
447 }
448
450 {
452 if (xmlQueryType != null)
453 {
454 return xmlQueryType;
455 }
456 return XmlQueryTypeFactory.AtMost(node.Variable.Binding.XmlType, node.Variable.Binding.XmlType.Cardinality);
457 }
458
460 {
461 XmlQueryType xmlType = node.Variable.Binding.XmlType;
462 return XmlQueryTypeFactory.PrimeProduct(xmlType, xmlType.Cardinality);
463 }
464
466 {
467 return node.Key.XmlType;
468 }
469
471 {
472 return DistinctType(node.Child.XmlType);
473 }
474
476 {
477 return node.XmlType;
478 }
479
481 {
482 return node.Function.XmlType;
483 }
484
489
494
499
504
509
514
519
524
529
534
539
544
546 {
547 return XmlQueryTypeFactory.Choice(node.Left.XmlType, XmlQueryTypeFactory.ContentS, node.Right.XmlType);
548 }
549
554
559
564
569
574
579
584
589
594
599
604
609
614
619
621 {
622 return node.TargetType;
623 }
624
629
634
639
644
649
654
659
664
666 {
667 return node.XmlType;
668 }
669
671 {
672 return XmlQueryTypeFactory.Choice(node.Left.XmlType, node.Right.XmlType);
673 }
674
676 {
677 if ((node.Child.XmlType.NodeKinds & XmlNodeKindFlags.Document) != 0)
678 {
680 }
681 return node.Child.XmlType;
682 }
683
685 {
686 return node.TargetType;
687 }
688
690 {
691 if (type.Cardinality == XmlQueryCardinality.More)
692 {
694 }
695 if (type.Cardinality == XmlQueryCardinality.NotOne)
696 {
698 }
699 return type;
700 }
701
703 {
704 if (body.XmlType.TypeCode == XmlTypeCode.None)
705 {
707 }
708 switch (body.NodeType)
709 {
710 case QilNodeType.False:
712 case QilNodeType.IsType:
713 if (((QilTargetType)body).Source == variable)
714 {
715 return XmlQueryTypeFactory.AtMost(((QilTargetType)body).TargetType, variable.Binding.XmlType.Cardinality);
716 }
717 break;
718 case QilNodeType.And:
719 {
721 if (xmlQueryType != null)
722 {
723 return xmlQueryType;
724 }
725 return FindFilterType(variable, ((QilBinary)body).Right);
726 }
727 case QilNodeType.Eq:
728 {
730 if (qilBinary.Left.NodeType == QilNodeType.PositionOf && ((QilUnary)qilBinary.Left).Child == variable)
731 {
733 }
734 break;
735 }
736 }
737 return null;
738 }
739}
virtual XmlQueryType XmlType
Definition QilNode.cs:29
XmlQueryType CheckGe(QilBinary node)
XmlQueryType CheckXsltConvert(QilTargetType node)
XmlQueryType CheckXsltCopy(QilBinary node)
XmlQueryType CheckModulo(QilBinary node)
XmlQueryType CheckSortKey(QilSortKey node)
XmlQueryType CheckSort(QilLoop node)
XmlQueryType CheckNamespaceUriOf(QilUnary node)
XmlQueryType CheckLiteralDouble(QilLiteral node)
XmlQueryType CheckIsEmpty(QilUnary node)
XmlQueryType CheckXsltCopyOf(QilUnary node)
XmlQueryType CheckSum(QilUnary node)
XmlQueryType CheckAfter(QilBinary node)
XmlQueryType CheckXsltGenerateId(QilUnary node)
XmlQueryType CheckDescendantOrSelf(QilUnary node)
XmlQueryType CheckFormalParameterList(QilList node)
XmlQueryType CheckDifference(QilBinary node)
XmlQueryType CheckXPathFollowing(QilUnary node)
XmlQueryType CheckParameter(QilParameter node)
XmlQueryType CheckFollowingSibling(QilUnary node)
XmlQueryType CheckTypeAssert(QilTargetType node)
XmlQueryType CheckAnd(QilBinary node)
XmlQueryType CheckLiteralQName(QilName node)
XmlQueryType CheckTrue(QilNode node)
XmlQueryType CheckAdd(QilBinary node)
XmlQueryType CheckNegate(QilUnary node)
XmlQueryType FindFilterType(QilIterator variable, QilNode body)
XmlQueryType CheckOr(QilBinary node)
XmlQueryType CheckInvoke(QilInvoke node)
XmlQueryType CheckLt(QilBinary node)
XmlQueryType CheckStrLength(QilUnary node)
XmlQueryType CheckPrefixOf(QilUnary node)
XmlQueryType CheckLiteralInt32(QilLiteral node)
XmlQueryType CheckLiteralObject(QilLiteral node)
XmlQueryType CheckMultiply(QilBinary node)
XmlQueryType CheckGlobalParameterList(QilList node)
XmlQueryType CheckXPathNodeValue(QilUnary node)
XmlQueryType CheckSubtract(QilBinary node)
XmlQueryType CheckPICtor(QilBinary node)
XmlQueryType CheckConditional(QilTernary node)
XmlQueryType CheckIs(QilBinary node)
XmlQueryType CheckDocumentCtor(QilUnary node)
XmlQueryType CheckBranchList(QilList node)
XmlQueryType DistinctType(XmlQueryType type)
XmlQueryType CheckCommentCtor(QilUnary node)
XmlQueryType CheckIsType(QilTargetType node)
XmlQueryType CheckParent(QilUnary node)
XmlQueryType CheckRtfCtor(QilBinary node)
XmlQueryType CheckAncestorOrSelf(QilUnary node)
XmlQueryType CheckXmlContext(QilNode node)
XmlQueryType CheckIntersection(QilBinary node)
XmlQueryType CheckLiteralDecimal(QilLiteral node)
XmlQueryType CheckDataSource(QilDataSource node)
XmlQueryType CheckDeref(QilBinary node)
XmlQueryType CheckPositionOf(QilUnary node)
XmlQueryType CheckDescendant(QilUnary node)
XmlQueryType CheckRawTextCtor(QilUnary node)
XmlQueryType CheckContent(QilUnary node)
XmlQueryType CheckGt(QilBinary node)
XmlQueryType CheckLiteralString(QilLiteral node)
XmlQueryType CheckRoot(QilUnary node)
XmlQueryType CheckElementCtor(QilBinary node)
XmlQueryType CheckXsltInvokeLateBound(QilInvokeLateBound node)
XmlQueryType CheckStrParseQName(QilBinary node)
XmlQueryType CheckLoop(QilLoop node)
XmlQueryType CheckTextCtor(QilUnary node)
XmlQueryType CheckNe(QilBinary node)
XmlQueryType CheckQilExpression(QilExpression node)
XmlQueryType CheckPreceding(QilUnary node)
XmlQueryType CheckActualParameterList(QilList node)
XmlQueryType CheckDocOrderDistinct(QilUnary node)
XmlQueryType CheckFilter(QilLoop node)
XmlQueryType CheckNop(QilUnary node)
XmlQueryType CheckAncestor(QilUnary node)
XmlQueryType CheckDivide(QilBinary node)
XmlQueryType CheckMaximum(QilUnary node)
XmlQueryType CheckFunction(QilFunction node)
XmlQueryType CheckNot(QilUnary node)
XmlQueryType CheckOptimizeBarrier(QilUnary node)
XmlQueryType CheckLocalNameOf(QilUnary node)
XmlQueryType CheckError(QilUnary node)
XmlQueryType CheckLe(QilBinary node)
XmlQueryType CheckGlobalVariableList(QilList node)
XmlQueryType CheckPrecedingSibling(QilUnary node)
XmlQueryType CheckLiteralInt64(QilLiteral node)
XmlQueryType CheckFalse(QilNode node)
XmlQueryType CheckSortKeyList(QilList node)
XmlQueryType CheckUnion(QilBinary node)
XmlQueryType CheckXPathPreceding(QilUnary node)
XmlQueryType CheckXPathNamespace(QilUnary node)
XmlQueryType CheckBefore(QilBinary node)
XmlQueryType CheckSequence(QilList node)
XmlQueryType CheckAverage(QilUnary node)
XmlQueryType CheckMinimum(QilUnary node)
XmlQueryType CheckWarning(QilUnary node)
XmlQueryType CheckFor(QilIterator node)
XmlQueryType CheckXsltInvokeEarlyBound(QilInvokeEarlyBound node)
XmlQueryType CheckLength(QilUnary node)
XmlQueryType CheckNodeRange(QilBinary node)
XmlQueryType CheckLiteralType(QilLiteral node)
XmlQueryType CheckUnknown(QilNode node)
XmlQueryType CheckNameOf(QilUnary node)
XmlQueryType CheckStrConcat(QilStrConcat node)
XmlQueryType Check(QilNode n)
XmlQueryType CheckAttribute(QilBinary node)
XmlQueryType CheckLet(QilIterator node)
XmlQueryType CheckAttributeCtor(QilBinary node)
XmlQueryType CheckNamespaceDecl(QilBinary node)
XmlQueryType CheckEq(QilBinary node)
XmlQueryType CheckFunctionList(QilList node)
XmlQueryType CheckChoice(QilChoice node)
static XmlQueryType Choice(XmlQueryType left, XmlQueryType right)
static readonly XmlQueryType Namespace
static readonly XmlQueryType AttributeOrContentS
static readonly XmlQueryType AttributeQ
static readonly XmlQueryType NamespaceS
static readonly XmlQueryType DecimalX
static readonly XmlQueryType DoubleX
static readonly XmlQueryType Text
static readonly XmlQueryType QNameX
static readonly XmlQueryType StringX
static readonly XmlQueryType IntX
static XmlQueryType Sequence(XmlQueryType left, XmlQueryType right)
static readonly XmlQueryType Node
static readonly XmlQueryType NodeNotRtfQ
static XmlQueryType AtMost(XmlQueryType t, XmlQueryCardinality c)
static readonly XmlQueryType ContentS
static readonly XmlQueryType UntypedElement
static readonly XmlQueryType Comment
static readonly XmlQueryType None
static readonly XmlQueryType NodeNotRtfS
static readonly XmlQueryType DocumentOrContentS
static XmlQueryType PrimeProduct(XmlQueryType t, XmlQueryCardinality c)
static readonly XmlQueryType PI
static readonly XmlQueryType IntegerX
static readonly XmlQueryType ItemS
static readonly XmlQueryType DocumentOrElementS
static readonly XmlQueryType UntypedDocument
static readonly XmlQueryType BooleanX
static readonly XmlQueryType ElementS
static readonly XmlQueryType UntypedAttribute
static readonly XmlQueryType DocumentOrElementQ
static readonly XmlQueryType NodeNotRtf
static readonly XmlQueryType Empty
XmlQueryCardinality Cardinality
static XmlQueryCardinality ZeroOrOne
static XmlQueryCardinality OneOrMore
static XmlQueryCardinality ZeroOrMore
static XmlQueryCardinality NotOne