Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XPathPatternParser.cs
Go to the documentation of this file.
5
6namespace System.Xml.Xsl.Xslt;
7
8internal sealed class XPathPatternParser
9{
14
16
18
20
21 private int _parseRelativePath;
22
24 {
25 QilNode result = null;
26 ptrnBuilder.StartBuild();
27 try
28 {
31 result = ParsePattern();
33 }
34 finally
35 {
36 result = ptrnBuilder.EndBuild(result);
37 }
38 return result;
39 }
40
51
53 {
54 switch (_scanner.Kind)
55 {
56 case LexKind.Slash:
57 {
59 QilNode qilNode = _ptrnBuilder.Axis(XPathAxis.Root, XPathNodeType.All, null, null);
61 {
63 }
64 return qilNode;
65 }
66 case LexKind.SlashSlash:
69 case LexKind.Name:
70 if (_scanner.CanBeFunction && _scanner.Prefix.Length == 0 && (_scanner.Name == "id" || _scanner.Name == "key"))
71 {
73 switch (_scanner.Kind)
74 {
75 case LexKind.Slash:
78 break;
79 case LexKind.SlashSlash:
82 break;
83 }
84 return qilNode;
85 }
86 break;
87 }
89 }
90
116
137
139 {
141 switch (_scanner.Kind)
142 {
143 case LexKind.DotDot:
144 case LexKind.Dot:
146 case LexKind.At:
147 xPathAxis = XPathAxis.Attribute;
149 break;
150 case LexKind.Axis:
152 if (xPathAxis != XPathAxis.Child && xPathAxis != XPathAxis.Attribute)
153 {
155 }
158 break;
159 case LexKind.Name:
160 case LexKind.Star:
161 xPathAxis = XPathAxis.Child;
162 break;
163 default:
165 }
166 XPathParser<QilNode>.InternalParseNodeTest(_scanner, xPathAxis, out var nodeType, out var nodePrefix, out var nodeName);
169 {
171 while (_scanner.Kind == LexKind.LBracket)
172 {
174 }
175 if (list.Count > 0)
176 {
177 qilNode = xPathPatternBuilder.BuildPredicates(qilNode, list);
178 }
179 }
180 else
181 {
182 while (_scanner.Kind == LexKind.LBracket)
183 {
185 }
186 }
187 return qilNode;
188 }
189
191 {
195 return result;
196 }
197}
void Add(TKey key, TValue value)
static string XPath_InvalidAxisInPattern
Definition SR.cs:1840
static string XPath_UnexpectedToken
Definition SR.cs:1832
static string Xslt_InputTooComplex
Definition SR.cs:1862
Definition SR.cs:7
Node Parse(XPathScanner scanner, IXPathBuilder< Node > builder, LexKind endLex)
XPathCompileException CreateException(string resId, params string[] args)
readonly XPathParser< QilNode > _predicateParser
QilNode Parse(XPathScanner scanner, IPatternBuilder ptrnBuilder)
Node Axis(XPathAxis xpathAxis, XPathNodeType nodeType, string prefix, string name)
Node Operator(XPathOperator op, Node left, Node right)
Node JoinStep(Node left, Node right)
Node Predicate(Node node, Node condition, bool reverseStep)
Node Function(string prefix, string name, IList< Node > args)
IXPathBuilder< QilNode > GetPredicateBuilder(QilNode context)