1using System.Collections.Generic;
2using System.Threading.Tasks;
17 private string variableReference;
36 this.variableReference = Ref.VariableName;
38 this.variableReference =
null;
62 bool b = !Callback(this.node, out
ScriptNode NewNode, State);
63 if (!(NewNode is
null))
68 this.isAsync = NewNode.IsAsynchronous;
71 this.variableReference = Ref.VariableName;
73 this.variableReference =
null;
76 if (b || (Order ==
SearchMethod.TreeOrder && !
this.node.ForAllChildNodes(Callback, State, Order)))
96 if (
string.IsNullOrEmpty(this.variableReference))
119 if (
string.IsNullOrEmpty(this.variableReference))
160 if (CheckAgainst is XmlAttribute)
162 else if (CheckAgainst is
null)
176 if (CheckAgainst is
null)
Class managing a script expression.
static bool TryGetConstant(string Name, Variables Variables, out IElement ValueElement)
Tries to get a constant value, given its name.
Base class for all nodes in a parsed script tree.
bool ForAllChildNodes(ScriptNodeEventHandler Callback, object State, bool DepthFirst)
Calls the callback method for all child nodes.
int Length
Length of expression covered by node.
virtual PatternMatchResult PatternMatch(IElement CheckAgainst, Dictionary< string, IElement > AlreadyFound)
Performs a pattern match operation.
ScriptNode Parent
Parent node.
int Start
Start position in script expression.
virtual bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
void SetParent(ScriptNode Parent)
Sets the parent node. Can only be used when expression is being parsed.
Represents a variable reference.
static readonly ObjectValue Null
Null value.
Contains information about a variable.
virtual bool TryGetVariable(string Name, out Variable Variable)
Tries to get a variable object, given its name.
Abstract base class for XML Script attribute nodes.
string Name
Attribute name.
XML Script attribute node, whose value is defined by script.
override PatternMatchResult PatternMatch(XmlNode CheckAgainst, Dictionary< string, IElement > AlreadyFound)
Performs a pattern match operation.
override bool ForAllChildNodes(ScriptNodeEventHandler Callback, object State, SearchMethod Order)
Calls the callback method for all child nodes.
override bool IsApplicable(string CheckAgainst)
If the node is applicable in pattern matching against CheckAgainst .
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
XmlScriptAttributeScript(string Name, ScriptNode Node, int Start, int Length, Expression Expression)
XML Script attribute node, whose value is defined by script.
override PatternMatchResult PatternMatch(string CheckAgainst, Dictionary< string, IElement > AlreadyFound)
Performs a pattern match operation.
static string EvaluateString(ScriptNode Node, Variables Variables)
Evaluates a script node to a string.
static async Task< string > EvaluateStringAsync(ScriptNode Node, Variables Variables)
Evaluates a script node to a string.
Basic interface for all types of elements.
delegate bool ScriptNodeEventHandler(ScriptNode Node, out ScriptNode NewNode, object State)
Delegate for ScriptNode callback methods.
PatternMatchResult
Status result of a pattern matching operation.
SearchMethod
Method to traverse the expression structure