2using System.Reflection;
3using System.Threading.Tasks;
14 private readonly
object obj;
15 private readonly MethodInfo method;
16 private readonly ParameterInfo[] parameters;
17 private readonly
int nrParameters;
18 private string[] argumentNames =
null;
30 this.parameters = Method.GetParameters();
31 this.nrParameters = this.parameters.Length;
46 if (this.argumentNames is
null)
48 string[]
Names =
new string[this.nrParameters];
51 for (i = 0; i < this.nrParameters; i++)
52 Names[i] = this.parameters[i].Name;
54 this.argumentNames =
Names;
57 return this.argumentNames;
68 if (this.argumentTypes is
null)
73 for (i = 0; i < this.nrParameters; i++)
75 Type T = this.parameters[i].GetType();
80 else if (T is Abstraction.Sets.ISet)
86 this.argumentTypes = Types;
89 return this.argumentTypes;
118 int i, c = Arguments.Length;
119 object[] P =
new object[c];
123 for (i = 0; i < c; i++)
129 T0 = this.parameters[i].ParameterType;
132 if (Arguments[i].TryConvertTo(T0, out
object Obj0))
140 object Result = this.method.Invoke(this.obj, P);
148 return Operators.LambdaDefinition.ToString(
this);
Class managing a script expression.
static IElement Encapsulate(object Value)
Encapsulates an object.
Lambda expression executing object methods.
int NrArguments
Number of arguments.
string[] ArgumentNames
Argument Names.
bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the lambda expression.
MethodLambda(object Object, MethodInfo Method)
Lambda expression executing object methods.
ArgumentType[] ArgumentTypes
Argument types.
override string ToString()
async Task< IElement > EvaluateAsync(IElement[] Arguments, Variables Variables)
Evaluates the lambda expression.
Extract the names of an enumeration type or an enumeration object.
Base class for all nodes in a parsed script tree.
static async Task< object > WaitPossibleTask(object Result)
Waits for any asynchronous process to terminate.
Basic interface for all types of elements.
object AssociatedObjectValue
Associated object value.
Basic interface for matrices.
Basic interface for vectors.
Base interface for lambda expressions.
ArgumentType
Type of parameter used in a function definition or a lambda definition.