Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
FunctionDefinition.cs
1using System;
2using System.Threading.Tasks;
5
7{
12 {
13 private readonly string functionName;
14
27 {
28 this.functionName = FunctionName;
29 }
30
34 public string FunctionName => this.functionName;
35
42 {
43 Variables[this.functionName + " " + this.ArgumentNames.Length.ToString()] = this;
44 return this;
45 }
46
52 public override Task<IElement> EvaluateAsync(Variables Variables)
53 {
54 Variables[this.functionName + " " + this.ArgumentNames.Length.ToString()] = this;
55 return Task.FromResult<IElement>(this);
56 }
57
58 }
59}
Class managing a script expression.
Definition: Expression.cs:39
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
FunctionDefinition(string FunctionName, string[] ArgumentNames, ArgumentType[] ArgumentTypes, ScriptNode Body, int Start, int Length, Expression Expression)
Function definition operator.
override Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
ArgumentType[] ArgumentTypes
Argument types.
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:20
ArgumentType
Type of parameter used in a function definition or a lambda definition.
Definition: IFunction.cs:9