2using System.Reflection;
3using System.Threading.Tasks;
17 private string variableName;
33 private void CheckArgument()
38 this.variableName =
string.Empty;
45 this.variableName = Ref.VariableName;
49 this.@
object = Member.Operand;
50 this.variableName = Member.Name;
79 if (this.@
object is
null)
84 return v.ValueElement;
91 IElement Obj = this.@
object.Evaluate(Variables);
93 MethodInfo MI = T.GetRuntimeMethod(
"Remove", stringArgument)
94 ??
throw new ScriptRuntimeException(
"Unable to remove property " + this.variableName +
" from objects of type " + T.FullName +
".",
this);
110 if (this.@
object is
null)
115 return v.ValueElement;
122 IElement Obj = await this.@
object.EvaluateAsync(Variables);
124 MethodInfo MI = T.GetRuntimeMethod(
"Remove", stringArgument)
125 ??
throw new ScriptRuntimeException(
"Unable to remove property " + this.variableName +
" from objects of type " + T.FullName +
".",
this);
133 internal static readonly Type[] stringArgument =
new Type[] { typeof(
string) };
170 this.CheckArgument();
Script runtime exception.
Class managing a script expression.
static IElement Encapsulate(object Value)
Encapsulates an object.
Removes a variable from the variables collection, without destroying its value.
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
override IElement Evaluate(IElement Argument, Variables Variables)
Evaluates the function.
override async Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection. This method should be ...
override Task< IElement > EvaluateAsync(IElement Argument, Variables Variables)
Evaluates the function.
Remove(ScriptNode Argument, int Start, int Length, Expression Expression)
Removes a variable from the variables collection, without destroying its value.
override bool ForAllChildNodes(ScriptNodeEventHandler Callback, object State, SearchMethod Order)
Calls the callback method for all child nodes.
override string[] DefaultArgumentNames
Default Argument names
override string FunctionName
Name of the function
string VariableName
Name of variable.
Base class for funcions of one variable.
ScriptNode Argument
Function argument.
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.
static async Task< object > WaitPossibleTask(object Result)
Waits for any asynchronous process to terminate.
int Start
Start position in script expression.
static object UnnestPossibleTaskSync(object Result)
Checks if Result is an asynchronous results. If so, blocks the current thread until the result is co...
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.
virtual bool Remove(string VariableName)
Removes a varaiable from the collection.
Basic interface for all types of elements.
object AssociatedObjectValue
Associated object value.
delegate bool ScriptNodeEventHandler(ScriptNode Node, out ScriptNode NewNode, object State)
Delegate for ScriptNode callback methods.
SearchMethod
Method to traverse the expression structure