Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
OwnerDocument.cs
1using System.Threading.Tasks;
2using System.Xml;
7
9{
14 {
23 : base(Xml, Start, Length, Expression)
24 {
25 }
26
30 public override string FunctionName => nameof(OwnerDocument);
31
35 public override string[] DefaultArgumentNames => new string[] { "XML" };
36
44 {
45 object Obj = Argument.AssociatedObjectValue;
46
47 if (Obj is null)
48 return Argument;
49 else if (Obj is XmlNode N)
50 return new ObjectValue(N.OwnerDocument);
51 else
52 throw new ScriptRuntimeException("XML node expected.", this);
53 }
54
61 public override Task<IElement> EvaluateScalarAsync(IElement Argument, Variables Variables)
62 {
63 return Task.FromResult(this.EvaluateScalar(Argument, Variables));
64 }
65 }
66}
Class managing a script expression.
Definition: Expression.cs:39
Base class for funcions of one scalar variable.
ScriptNode Argument
Function argument.
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Collection of variables.
Definition: Variables.cs:25
Gets the XML Document owning an XML Node.
override Task< IElement > EvaluateScalarAsync(IElement Argument, Variables Variables)
Evaluates the function on a scalar argument.
override IElement EvaluateScalar(IElement Argument, Variables Variables)
Evaluates the function on two scalar arguments.
OwnerDocument(ScriptNode Xml, int Start, int Length, Expression Expression)
Gets the XML Document owning an XML Node.
override string[] DefaultArgumentNames
Default Argument names
override string FunctionName
Name of the function
Basic interface for all types of elements.
Definition: IElement.cs:20