Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
XmlScriptComment.cs
1using System;
2using System.Collections.Generic;
3using System.Xml;
6
8{
13 {
14 private readonly string text;
15
23 public XmlScriptComment(string Text, int Start, int Length, Expression Expression)
24 : base(Start, Length, Expression)
25 {
26 this.text = Text;
27 }
28
35 internal override void Build(XmlDocument Document, XmlElement Parent, Variables Variables)
36 {
37 Parent.AppendChild(Document.CreateComment(this.text));
38 }
39
46 public override PatternMatchResult PatternMatch(XmlNode CheckAgainst, Dictionary<string, IElement> AlreadyFound)
47 {
48 if (CheckAgainst is XmlComment)
49 return CheckAgainst.InnerText == this.text ? PatternMatchResult.Match : PatternMatchResult.NoMatch;
50 else
51 return PatternMatchResult.NoMatch;
52 }
53
59 public override bool IsApplicable(XmlNode CheckAgainst)
60 {
61 return (CheckAgainst is XmlComment);
62 }
63 }
64}
Class managing a script expression.
Definition: Expression.cs:39
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
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.
override bool IsApplicable(XmlNode CheckAgainst)
If the node is applicable in pattern matching against CheckAgainst .
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