Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
XmlScriptComment.cs
2using System.Xml;
5
7{
12 {
13 private readonly string text;
14
22 public XmlScriptComment(string Text, int Start, int Length, Expression Expression)
23 : base(Start, Length, Expression)
24 {
25 this.text = Text;
26 }
27
31 public override bool IsWhitespace => true;
32
39 internal override void Build(XmlDocument Document, XmlElement Parent, Variables Variables)
40 {
41 Parent.AppendChild(Document.CreateComment(this.text));
42 }
43
50 public override PatternMatchResult PatternMatch(XmlNode CheckAgainst, Dictionary<string, IElement> AlreadyFound)
51 {
52 if (CheckAgainst is XmlComment)
53 return CheckAgainst.InnerText == this.text ? PatternMatchResult.Match : PatternMatchResult.NoMatch;
54 else
55 return PatternMatchResult.NoMatch;
56 }
57
64 public override bool IsApplicable(XmlNode CheckAgainst, XmlElement First)
65 {
66 return CheckAgainst is XmlComment;
67 }
68 }
69}
Class managing a script expression.
Definition: Expression.cs:41
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
ScriptNode Parent
Parent node.
Definition: ScriptNode.cs:126
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Collection of variables.
Definition: Variables.cs:25
override bool IsApplicable(XmlNode CheckAgainst, XmlElement First)
If the node is applicable in pattern matching against CheckAgainst .
override bool IsWhitespace
If the node represents whitespace.
XmlScriptComment(string Text, int Start, int Length, Expression Expression)
XML Script Comment node.
override PatternMatchResult PatternMatch(XmlNode CheckAgainst, Dictionary< string, IElement > AlreadyFound)
Performs a pattern match operation.
Base class for all XML Script leaf nodes in a parsed script tree.
PatternMatchResult
Status result of a pattern matching operation.
Definition: ScriptNode.cs:17