Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
InvokeGenerator.cs
Go to the documentation of this file.
3
4namespace System.Xml.Xsl.Xslt;
5
6internal sealed class InvokeGenerator : QilCloneVisitor
7{
8 private readonly bool _debug;
9
11
13
15
16 private int _curArg;
17
18 private readonly XsltQilFactory _fac;
19
21 : base(f.BaseFactory)
22 {
23 _debug = debug;
24 _fac = f;
26 }
27
29 {
31 _formalArgs = func.Arguments;
34 {
37 if (qilNode == null)
38 {
39 qilNode = ((!_debug) ? Clone(qilParameter.DefaultValue) : ((!(qilParameter.Name.NamespaceUri == "urn:schemas-microsoft-com:xslt-debug")) ? _fac.DefaultValueMarker() : Clone(qilParameter.DefaultValue)));
40 }
41 XmlQueryType xmlType = qilParameter.XmlType;
43 if (!xmlType2.IsSubtypeOf(xmlType))
44 {
45 qilNode = _fac.TypeAssert(qilNode, xmlType);
46 }
48 }
50 while (_iterStack.Count != 0)
51 {
53 }
54 return qilNode2;
55 }
56
58 {
59 QilName name = formalArg.Name;
60 foreach (XslNode actualArg in actualArgs)
61 {
62 if (actualArg.Name.Equals(name))
63 {
64 return ((VarPar)actualArg).Value;
65 }
66 }
67 return null;
68 }
69
70 protected override QilNode VisitReference(QilNode n)
71 {
73 if (qilNode != null)
74 {
75 return qilNode;
76 }
77 for (int i = 0; i < _curArg; i++)
78 {
79 if (n == _formalArgs[i])
80 {
82 {
84 }
85 if (!(_invokeArgs[i] is QilIterator))
86 {
90 }
91 return _invokeArgs[i];
92 }
93 }
94 return n;
95 }
96
97 protected override QilNode VisitFunction(QilFunction n)
98 {
99 return n;
100 }
101}
QilNode FindClonedReference(QilNode node)
QilIterator Let(QilNode binding)
override QilNode ShallowClone(QilFactory f)
Definition QilList.cs:71
virtual void Add(QilNode node)
Definition QilNode.cs:121
QilNode Invoke(QilFunction func, QilList args)
QilNode Loop(QilIterator variable, QilNode body)
QilNode TypeAssert(QilNode expr, XmlQueryType t)
override QilNode VisitFunction(QilFunction n)
QilNode FindActualArg(QilParameter formalArg, IList< XslNode > actualArgs)
readonly Stack< QilIterator > _iterStack
InvokeGenerator(XsltQilFactory f, bool debug)
QilNode GenerateInvoke(QilFunction func, IList< XslNode > actualArgs)
override QilNode VisitReference(QilNode n)