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

◆ ParseNodeTest()

AstNode MS.Internal.Xml.XPath.XPathParser.ParseNodeTest ( AstNode qyInput,
Axis::AxisType axisType,
XPathNodeType nodeType )
inlineprivate

Definition at line 392 of file XPathParser.cs.

393 {
394 string prefix;
395 string text;
396 switch (_scanner.Kind)
397 {
398 case XPathScanner.LexKind.Name:
400 {
401 prefix = string.Empty;
402 text = string.Empty;
403 nodeType = ((_scanner.Name == "comment") ? XPathNodeType.Comment : ((_scanner.Name == "text") ? XPathNodeType.Text : ((_scanner.Name == "node") ? XPathNodeType.All : ((_scanner.Name == "processing-instruction") ? XPathNodeType.ProcessingInstruction : XPathNodeType.Root))));
404 NextLex();
405 PassToken(XPathScanner.LexKind.LParens);
406 if (nodeType == XPathNodeType.ProcessingInstruction && _scanner.Kind != XPathScanner.LexKind.RParens)
407 {
408 CheckToken(XPathScanner.LexKind.String);
410 NextLex();
411 }
412 PassToken(XPathScanner.LexKind.RParens);
413 }
414 else
415 {
418 NextLex();
419 if (text == "*")
420 {
421 text = string.Empty;
422 }
423 }
424 break;
425 case XPathScanner.LexKind.Star:
426 prefix = string.Empty;
427 text = string.Empty;
428 NextLex();
429 break;
430 default:
432 }
433 return new Axis(axisType, qyInput, prefix, text, nodeType);
434 }
static string Xp_NodeSetExpected
Definition SR.cs:1244
Definition SR.cs:7
static XPathException Create(string res)
void PassToken(XPathScanner.LexKind t)
void CheckToken(XPathScanner.LexKind t)

References MS.Internal.Xml.XPath.XPathParser._scanner, MS.Internal.Xml.XPath.XPathScanner.CanBeFunction, MS.Internal.Xml.XPath.XPathParser.CheckToken(), System.Xml.XPath.XPathException.Create(), MS.Internal.Xml.XPath.XPathParser.IsNodeType, MS.Internal.Xml.XPath.XPathScanner.Kind, MS.Internal.Xml.XPath.XPathScanner.Name, MS.Internal.Xml.XPath.XPathParser.NextLex(), MS.Internal.Xml.XPath.XPathParser.PassToken(), System.prefix, MS.Internal.Xml.XPath.XPathScanner.Prefix, MS.Internal.Xml.XPath.XPathScanner.SourceText, MS.Internal.Xml.XPath.XPathScanner.StringValue, System.text, and System.SR.Xp_NodeSetExpected.

Referenced by MS.Internal.Xml.XPath.XPathParser.ParseStep(), and MS.Internal.Xml.XPath.XPathParser.ParseStepPattern().