Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ NextLex()

void System.Xml.Xsl.XPath.XPathScanner.NextLex ( )
inline

Definition at line 106 of file XPathScanner.cs.

107 {
110 SkipSpace();
112 switch (_curChar)
113 {
114 case '\0':
115 _kind = LexKind.Eof;
116 return;
117 case '$':
118 case '(':
119 case ')':
120 case ',':
121 case '@':
122 case '[':
123 case ']':
124 case '}':
126 NextChar();
127 return;
128 case '.':
129 NextChar();
130 if (_curChar == '.')
131 {
132 _kind = LexKind.DotDot;
133 NextChar();
134 return;
135 }
137 {
139 goto case '0';
140 }
141 _kind = LexKind.Dot;
142 return;
143 case ':':
144 NextChar();
145 if (_curChar == ':')
146 {
147 _kind = LexKind.ColonColon;
148 NextChar();
149 }
150 else
151 {
152 _kind = LexKind.Unknown;
153 }
154 return;
155 case '*':
156 _kind = LexKind.Star;
157 NextChar();
158 CheckOperator(star: true);
159 return;
160 case '/':
161 NextChar();
162 if (_curChar == '/')
163 {
164 _kind = LexKind.SlashSlash;
165 NextChar();
166 }
167 else
168 {
169 _kind = LexKind.Slash;
170 }
171 return;
172 case '|':
173 _kind = LexKind.Union;
174 NextChar();
175 return;
176 case '+':
177 _kind = LexKind.Plus;
178 NextChar();
179 return;
180 case '-':
181 _kind = LexKind.Minus;
182 NextChar();
183 return;
184 case '=':
185 _kind = LexKind.Eq;
186 NextChar();
187 return;
188 case '!':
189 NextChar();
190 if (_curChar == '=')
191 {
192 _kind = LexKind.Ne;
193 NextChar();
194 }
195 else
196 {
197 _kind = LexKind.Unknown;
198 }
199 return;
200 case '<':
201 NextChar();
202 if (_curChar == '=')
203 {
204 _kind = LexKind.Le;
205 NextChar();
206 }
207 else
208 {
209 _kind = LexKind.Lt;
210 }
211 return;
212 case '>':
213 NextChar();
214 if (_curChar == '=')
215 {
216 _kind = LexKind.Ge;
217 NextChar();
218 }
219 else
220 {
221 _kind = LexKind.Gt;
222 }
223 return;
224 case '"':
225 case '\'':
226 _kind = LexKind.String;
227 ScanString();
228 return;
229 case '0':
230 case '1':
231 case '2':
232 case '3':
233 case '4':
234 case '5':
235 case '6':
236 case '7':
237 case '8':
238 case '9':
239 _kind = LexKind.Number;
240 ScanNumber();
241 return;
242 }
243 if (XmlCharType.IsStartNCNameSingleChar(_curChar))
244 {
245 _kind = LexKind.Name;
246 _name = ScanNCName();
247 _prefix = string.Empty;
248 _canBeFunction = false;
249 _axis = XPathAxis.Unknown;
250 bool flag = false;
251 int curIndex = _curIndex;
252 if (_curChar == ':')
253 {
254 NextChar();
255 if (_curChar == ':')
256 {
257 NextChar();
258 flag = true;
260 }
261 else if (_curChar == '*')
262 {
263 NextChar();
264 _prefix = _name;
265 _name = "*";
266 }
267 else if (XmlCharType.IsStartNCNameSingleChar(_curChar))
268 {
269 _prefix = _name;
270 _name = ScanNCName();
272 SkipSpace();
273 _canBeFunction = _curChar == '(';
275 }
276 else
277 {
279 }
280 }
281 else
282 {
283 SkipSpace();
284 if (_curChar == ':')
285 {
286 NextChar();
287 if (_curChar == ':')
288 {
289 NextChar();
290 flag = true;
291 }
293 }
294 else
295 {
296 _canBeFunction = _curChar == '(';
297 }
298 }
299 if (!CheckOperator(star: false) && flag)
300 {
301 _axis = CheckAxis();
302 }
303 }
304 else
305 {
306 _kind = LexKind.Unknown;
307 NextChar();
308 }
309 }
static bool IsAsciiDigit(char ch)

References System.Xml.Xsl.XPath.XPathScanner._axis, System.Xml.Xsl.XPath.XPathScanner._canBeFunction, System.Xml.Xsl.XPath.XPathScanner._curChar, System.Xml.Xsl.XPath.XPathScanner._curIndex, System.Xml.Xsl.XPath.XPathScanner._kind, System.Xml.Xsl.XPath.XPathScanner._lexStart, System.Xml.Xsl.XPath.XPathScanner._name, System.Xml.Xsl.XPath.XPathScanner._prefix, System.Xml.Xsl.XPath.XPathScanner._prevKind, System.Xml.Xsl.XPath.XPathScanner._prevLexEnd, System.Xml.Xsl.XPath.XPathScanner.CheckAxis(), System.Xml.Xsl.XPath.XPathScanner.CheckOperator(), System.Xml.Dictionary, System.Xml.Xsl.XPath.XPathScanner.IsAsciiDigit(), System.Xml.XmlCharType.IsStartNCNameSingleChar(), System.Xml.Xsl.XPath.XPathScanner.NextChar(), System.Xml.Xsl.XPath.XPathScanner.ScanNCName(), System.Xml.Xsl.XPath.XPathScanner.ScanNumber(), System.Xml.Xsl.XPath.XPathScanner.ScanString(), System.Xml.Xsl.XPath.XPathScanner.SetSourceIndex(), and System.Xml.Xsl.XPath.XPathScanner.SkipSpace().

Referenced by System.Xml.Xsl.XPath.XPathScanner.XPathScanner(), System.Xml.Xsl.XPath.XPathParser< Node >.ParseFunctionCall(), System.Xml.Xsl.Xslt.XPathPatternParser.ParseIdKeyPattern(), System.Xml.Xsl.XPath.XPathParser< Node >.ParseLocationPath(), System.Xml.Xsl.Xslt.XPathPatternParser.ParseLocationPathPattern(), System.Xml.Xsl.XPath.XPathParser< Node >.ParsePathExpr(), System.Xml.Xsl.Xslt.XPathPatternParser.ParsePattern(), System.Xml.Xsl.Xslt.XPathPatternParser.ParsePredicate(), System.Xml.Xsl.XPath.XPathParser< Node >.ParsePrimaryExpr(), System.Xml.Xsl.XPath.XPathParser< Node >.ParseRelativeLocationPath(), System.Xml.Xsl.Xslt.XPathPatternParser.ParseRelativePathPattern(), System.Xml.Xsl.XPath.XPathParser< Node >.ParseStep(), System.Xml.Xsl.Xslt.XPathPatternParser.ParseStepPattern(), System.Xml.Xsl.XPath.XPathParser< Node >.ParseSubExpr(), System.Xml.Xsl.XPath.XPathParser< Node >.ParseUnionExpr(), and System.Xml.Xsl.XPath.XPathScanner.PassToken().