Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
PrintLine.cs
1using System.Threading.Tasks;
5
7{
12 {
22 {
23 }
24
28 public override string FunctionName => nameof(PrintLine);
29
33 public override string[] Aliases
34 {
35 get { return new string[] { "println" }; }
36 }
37
44 {
45 IElement E = this.Argument.Evaluate(Variables);
46 string Msg = E.AssociatedObjectValue is string s ? s : E.ToString();
47 Variables.ConsoleOut?.WriteLine(Msg);
48 return E;
49 }
50
56 public override async Task<IElement> EvaluateAsync(Variables Variables)
57 {
58 IElement E = await this.Argument.EvaluateAsync(Variables);
59 string Msg = E.AssociatedObjectValue is string s ? s : E.ToString();
60 Variables.ConsoleOut?.WriteLine(Msg);
61 return E;
62 }
63
71 {
72 return ObjectValue.Null;
73 }
74 }
75}
Class managing a script expression.
Definition: Expression.cs:39
Prints to the console, ending with a new line.
Definition: PrintLine.cs:12
override async Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
Definition: PrintLine.cs:56
override string FunctionName
Name of the function
Definition: PrintLine.cs:28
PrintLine(ScriptNode Argument, int Start, int Length, Expression Expression)
Prints to the console, ending with a new line.
Definition: PrintLine.cs:20
override IElement Evaluate(IElement Argument, Variables Variables)
Evaluates the function.
Definition: PrintLine.cs:70
override string[] Aliases
Optional aliases. If there are no aliases for the function, null is returned.
Definition: PrintLine.cs:34
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
Definition: PrintLine.cs:43
Base class for funcions of one 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
abstract IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection. This method should be ...
virtual Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection. This method should be ...
Definition: ScriptNode.cs:158
static readonly ObjectValue Null
Null value.
Definition: ObjectValue.cs:86
Collection of variables.
Definition: Variables.cs:25
TextWriter ConsoleOut
Console out interface. Can be used by functions and script to output data to the console.
Definition: Variables.cs:219
Basic interface for all types of elements.
Definition: IElement.cs:20