![]() |
Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
|
Class managing a script expression. More...
Public Member Functions | |
| Expression (string Script) | |
| Class managing a script expression. More... | |
| Expression (string Script, string Source) | |
| Class managing a script expression. More... | |
| Expression (string Script, object Tag) | |
| Class managing a script expression. More... | |
| Expression (string Script, string Source, object Tag) | |
| Class managing a script expression. More... | |
| object | Evaluate (Variables Variables) |
| Evaluates the expression, using the variables provided in the Variables collection. This method should be used for evaluating expressions in a synchronous (blocking) context. More... | |
| async Task< object > | EvaluateAsync (Variables Variables) |
| Evaluates the expression, using the variables provided in the Variables collection. This method should be used for evaluating expressions in an asynchronous (non-blocking) context. More... | |
| override bool | Equals (object obj) |
| override int | GetHashCode () |
| bool | ReferencesImplicitPrint (Variables Variables) |
| If the expression, or any function call references, contain implicit print operations. More... | |
| bool | ForAll (ScriptNodeEventHandler Callback, object State, bool DepthFirst) |
| Calls the callback method for all script nodes defined for the expression. More... | |
| bool | ForAll (ScriptNodeEventHandler Callback, object State, SearchMethod Order) |
| Calls the callback method for all script nodes defined for the expression. More... | |
Static Public Member Functions | |
| static bool | TryGetConstant (string Name, Variables Variables, out IElement ValueElement) |
| Tries to get a constant value, given its name. More... | |
| static string | Transform (string s, string StartDelimiter, string StopDelimiter, Variables Variables) |
| Transforms a string by executing embedded script. More... | |
| static string | Transform (string s, string StartDelimiter, string StopDelimiter, Variables Variables, string Source) |
| Transforms a string by executing embedded script. More... | |
| static Task< string > | TransformAsync (string s, string StartDelimiter, string StopDelimiter, Variables Variables) |
| Transforms a string by executing embedded script. More... | |
| static async Task< string > | TransformAsync (string s, string StartDelimiter, string StopDelimiter, Variables Variables, string Source) |
| Transforms a string by executing embedded script. More... | |
| static bool | IsNullOrVoid (object Result) |
| Checks if a result object value is equal to null or void (i.e. its type equal to System.Threading.Tasks.VoidTaskResult). More... | |
| static bool | IsVoid (Type ResultType) |
| Checks if a result object type is equal to void (i.e. its type equal to System.Threading.Tasks.VoidTaskResult). More... | |
| static string | ToString (double Value) |
| Converts a value to a string, that can be parsed as part of an expression. More... | |
| static string | ToString (decimal Value) |
| Converts a value to a string, that can be parsed as part of an expression. More... | |
| static bool | TryParse (string s, out double Value) |
| Tries to parse a double-precision floating-point value. More... | |
| static bool | TryParse (string s, out float Value) |
| Tries to parse a single-precision floating-point value. More... | |
| static bool | TryParse (string s, out decimal Value) |
| Tries to parse a decimal-precision floating-point value. More... | |
| static string | ToString (Complex Value) |
| Converts a value to a string, that can be parsed as part of an expression. More... | |
| static string | ToString (BigInteger Value) |
| Converts a value to a string, that can be parsed as part of an expression. More... | |
| static string | ToString (bool Value) |
| Converts a value to a string, that can be parsed as part of an expression. More... | |
| static string | ToString (double[] Value) |
| Converts a value to a string, that can be parsed as part of an expression. More... | |
| static string | ToString (Complex[] Value) |
| Converts a value to a string, that can be parsed as part of an expression. More... | |
| static string | ToString (DateTime Value) |
| Converts a value to a string, that can be parsed as part of an expression. More... | |
| static string | ToString (TimeSpan Value) |
| Converts a value to a string, that can be parsed as part of an expression. More... | |
| static string | ToString (Enum Value) |
| Converts a value to a string, that can be parsed as part of an expression. More... | |
| static string | EncodeString (string s) |
| Converts a string value to a parsable expression string. More... | |
| static string | ToString (object Value) |
| Converts an object to a string, that can be parsed as part of an expression. More... | |
| static string | ToString (string Value) |
| Converts an object to a string, that can be parsed as part of an expression. More... | |
| static string | ToExpressionString (object Value) |
| Converts an object to a string, that can be parsed as part of an expression. More... | |
| static double | ToDouble (object Object) |
| Converts an object to a double value. More... | |
| static decimal | ToDecimal (object Object) |
| Converts an object to a double value. More... | |
| static Complex | ToComplex (object Object) |
| Converts an object to a complex value. More... | |
| static IElement | Encapsulate (object Value) |
| Encapsulates an object. More... | |
| static bool | UpgradeField (ref IElement E1, ref ISet Set1, ref IElement E2, ref ISet Set2) |
| Upgrades elements if necessary, to a common field extension, trying to make them compatible. Information loss is not accepted in type conversions. More... | |
| static object | ConvertTo (IElement Value, Type DesiredType, ScriptNode Node) |
| Tries to conevert an element value to a desired type. More... | |
| static object | ConvertTo (object Obj, Type DesiredType, ScriptNode Node) |
| Tries to conevert an object to a desired type. More... | |
| static bool | TryConvert< T > (object Value, out T Result) |
| Tries to convert an object Value to an object of type T . More... | |
| static bool | TryConvert (object Value, Type DesiredType, bool AcceptInformationLoss, out object Result) |
| Tries to convert an object Value to an object of type DesiredType . More... | |
| static bool | TryConvert (object Value, Type DesiredType, double WeightThreshold, out object Result) |
| Tries to convert an object Value to an object of type DesiredType . More... | |
| static bool | TryConvert (IElement Value, Type DesiredType, bool AcceptInformationLoss, out IElement Result) |
| Tries to convert an element Value to an element whose associated object is of type DesiredType . More... | |
| static bool | TryConvert (IElement Value, Type DesiredType, double WeightThreshold, out IElement Result) |
| Tries to convert an element Value to an element whose associated object is of type DesiredType . More... | |
| static bool | TryGetTypeConverter (Type From, Type To, out ITypeConverter Converter) |
| Tries to get a type converter, converting objects from type From to objects of type To . More... | |
| static object | Eval (string Script) |
| Evaluates script, in string format. More... | |
| static object | Eval (string Script, Variables Variables) |
| Evaluates script, in string format. More... | |
| static Task< object > | EvalAsync (string Script) |
| Evaluates script, in string format. More... | |
| static Task< object > | EvalAsync (string Script, Variables Variables) |
| Evaluates script, in string format. More... | |
Properties | |
| string | Script [get] |
| Original script string. More... | |
| string | Source [get] |
| Source of script, or null if not defined. More... | |
| bool | IsAsynchronous [get] |
| If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluated using EvaluateAsync(Variables). More... | |
| ScriptNode | Root [get] |
| Root script node. More... | |
| bool | ContainsImplicitPrint [get] |
| If the expression contains implicit print operations. More... | |
| object | Tag [get, set] |
| This property allows the caller to tag the expression with an arbitrary object. More... | |
Class managing a script expression.
Definition at line 40 of file Expression.cs.
| Waher.Script.Expression.Expression | ( | string | Script | ) |
Class managing a script expression.
Definition at line 63 of file Expression.cs.
| Waher.Script.Expression.Expression | ( | string | Script, |
| string | Source | ||
| ) |
Class managing a script expression.
Definition at line 73 of file Expression.cs.
| Waher.Script.Expression.Expression | ( | string | Script, |
| object | Tag | ||
| ) |
Class managing a script expression.
| Script | Script expression. |
| Tag | This property allows the caller to tag the expression with an arbitrary object. |
Definition at line 84 of file Expression.cs.
| Waher.Script.Expression.Expression | ( | string | Script, |
| string | Source, | ||
| object | Tag | ||
| ) |
Class managing a script expression.
| Script | Script expression. |
| Source | Source of script. |
| Tag | This property allows the caller to tag the expression with an arbitrary object. |
Definition at line 96 of file Expression.cs.
|
static |
Tries to conevert an element value to a desired type.
| Value | Element value. |
| DesiredType | Desired type. |
| Node | Script node making the request. |
Definition at line 5385 of file Expression.cs.
|
static |
Tries to conevert an object to a desired type.
| Obj | Object to convert. |
| DesiredType | Desired type. |
| Node | Script node making the request. |
Definition at line 5397 of file Expression.cs.
|
static |
Encapsulates an object.
| Value | Object |
Definition at line 5241 of file Expression.cs.
|
static |
Converts a string value to a parsable expression string.
| s | Value |
Definition at line 4986 of file Expression.cs.
| override bool Waher.Script.Expression.Equals | ( | object | obj | ) |
Definition at line 4499 of file Expression.cs.
|
static |
|
static |
|
static |
|
static |
| object Waher.Script.Expression.Evaluate | ( | Variables | Variables | ) |
Evaluates the expression, using the variables provided in the Variables collection. This method should be used for evaluating expressions in a synchronous (blocking) context.
Definition at line 4423 of file Expression.cs.
| async Task< object > Waher.Script.Expression.EvaluateAsync | ( | Variables | Variables | ) |
Evaluates the expression, using the variables provided in the Variables collection. This method should be used for evaluating expressions in an asynchronous (non-blocking) context.
Definition at line 4461 of file Expression.cs.
| bool Waher.Script.Expression.ForAll | ( | ScriptNodeEventHandler | Callback, |
| object | State, | ||
| bool | DepthFirst | ||
| ) |
Calls the callback method for all script nodes defined for the expression.
| Callback | Callback method to call. |
| State | State object to pass on to the callback method. |
| DepthFirst | If calls are made depth first (true) or on each node and then its leaves (false). |
Definition at line 5456 of file Expression.cs.
| bool Waher.Script.Expression.ForAll | ( | ScriptNodeEventHandler | Callback, |
| object | State, | ||
| SearchMethod | Order | ||
| ) |
Calls the callback method for all script nodes defined for the expression.
| Callback | Callback method to call. |
| State | State object to pass on to the callback method. |
| Order | Order to traverse the nodes. |
Definition at line 5468 of file Expression.cs.
| override int Waher.Script.Expression.GetHashCode | ( | ) |
Definition at line 4508 of file Expression.cs.
|
static |
Checks if a result object value is equal to null or void (i.e. its type equal to System.Threading.Tasks.VoidTaskResult).
| Result | Result object. |
Definition at line 4721 of file Expression.cs.
|
static |
Checks if a result object type is equal to void (i.e. its type equal to System.Threading.Tasks.VoidTaskResult).
| ResultType | Result type. |
Definition at line 4735 of file Expression.cs.
| bool Waher.Script.Expression.ReferencesImplicitPrint | ( | Variables | Variables | ) |
If the expression, or any function call references, contain implicit print operations.
Definition at line 4523 of file Expression.cs.
|
static |
Converts an object to a complex value.
| Object | Object. |
Definition at line 5228 of file Expression.cs.
|
static |
Converts an object to a double value.
| Object | Object. |
Definition at line 5169 of file Expression.cs.
|
static |
Converts an object to a double value.
| Object | Object. |
Definition at line 5110 of file Expression.cs.
|
static |
Converts an object to a string, that can be parsed as part of an expression.
| Value | Value |
Definition at line 5052 of file Expression.cs.
|
static |
Converts a value to a string, that can be parsed as part of an expression.
| Value | Value |
Definition at line 4823 of file Expression.cs.
|
static |
Converts a value to a string, that can be parsed as part of an expression.
| Value | Value |
Definition at line 4833 of file Expression.cs.
|
static |
Converts a value to a string, that can be parsed as part of an expression.
| Value | Value |
Definition at line 4813 of file Expression.cs.
|
static |
Converts a value to a string, that can be parsed as part of an expression.
| Value | Value |
Definition at line 4871 of file Expression.cs.
|
static |
Converts a value to a string, that can be parsed as part of an expression.
| Value | Value |
Definition at line 4899 of file Expression.cs.
|
static |
Converts a value to a string, that can be parsed as part of an expression.
| Value | Value |
Definition at line 4770 of file Expression.cs.
|
static |
Converts a value to a string, that can be parsed as part of an expression.
| Value | Value |
Definition at line 4760 of file Expression.cs.
|
static |
Converts a value to a string, that can be parsed as part of an expression.
| Value | Value |
Definition at line 4843 of file Expression.cs.
|
static |
Converts a value to a string, that can be parsed as part of an expression.
| Value | Value |
Definition at line 4970 of file Expression.cs.
|
static |
Converts an object to a string, that can be parsed as part of an expression.
| Value | Value |
Definition at line 5031 of file Expression.cs.
|
static |
Converts an object to a string, that can be parsed as part of an expression.
| Value | Value |
Definition at line 5042 of file Expression.cs.
|
static |
Converts a value to a string, that can be parsed as part of an expression.
| Value | Value |
Definition at line 4941 of file Expression.cs.
|
static |
Transforms a string by executing embedded script.
| s | String to transform. |
| StartDelimiter | Start delimiter. |
| StopDelimiter | Stop delimiter. |
| Variables | Collection of variables. |
Definition at line 4581 of file Expression.cs.
|
static |
Transforms a string by executing embedded script.
| s | String to transform. |
| StartDelimiter | Start delimiter. |
| StopDelimiter | Stop delimiter. |
| Variables | Collection of variables. |
| Source | Optional source of s . |
Definition at line 4596 of file Expression.cs.
|
static |
Transforms a string by executing embedded script.
| s | String to transform. |
| StartDelimiter | Start delimiter. |
| StopDelimiter | Stop delimiter. |
| Variables | Collection of variables. |
Definition at line 4652 of file Expression.cs.
|
static |
Transforms a string by executing embedded script.
| s | String to transform. |
| StartDelimiter | Start delimiter. |
| StopDelimiter | Stop delimiter. |
| Variables | Collection of variables. |
| Source | Optional source of s . |
Definition at line 4666 of file Expression.cs.
|
static |
Tries to convert an element Value to an element whose associated object is of type DesiredType .
| Value | Element to convert. |
| DesiredType | Desired type of associated object. |
| AcceptInformationLoss | If information loss is acceptable in the conversion. |
| Result | Conversion result, if successful. |
Definition at line 5722 of file Expression.cs.
|
static |
Tries to convert an element Value to an element whose associated object is of type DesiredType .
| Value | Element to convert. |
| DesiredType | Desired type of associated object. |
| WeightThreshold | Minimum weight threshold for acceptance of conversion. 1 = no loss acceptable, 0 = loss of everything acceptable. |
| Result | Conversion result, if successful. |
Definition at line 5738 of file Expression.cs.
|
static |
Tries to convert an object Value to an object of type DesiredType .
| Value | Value to convert. |
| DesiredType | Desired type. |
| AcceptInformationLoss | If information loss is acceptable in the conversion. |
| Result | Converted object value, if successful. |
Definition at line 5530 of file Expression.cs.
|
static |
Tries to convert an object Value to an object of type DesiredType .
| Value | Value to convert. |
| DesiredType | Desired type. |
| WeightThreshold | Minimum weight threshold for acceptance of conversion. 1 = no loss acceptable, 0 = loss of everything acceptable. |
| Result | Converted object value, if successful. |
Definition at line 5545 of file Expression.cs.
|
static |
Tries to convert an object Value to an object of type T .
| T | Desired type. |
| Value | Value to convert. |
| Result | Conversion result. |
Definition at line 5501 of file Expression.cs.
|
static |
Tries to get a constant value, given its name.
| Name | Name |
| Variables | Current set of variables. Can be null. |
| ValueElement | If found, constant value will be placed here. |
Definition at line 3382 of file Expression.cs.
|
static |
Tries to get a type converter, converting objects from type From to objects of type To .
| From | Start type. |
| To | Desired type. |
| Converter | Type Converter found, or null if not found. |
Definition at line 5771 of file Expression.cs.
|
static |
Tries to parse a decimal-precision floating-point value.
| s | String-representation |
| Value | Parsed value. |
Definition at line 4803 of file Expression.cs.
|
static |
Tries to parse a double-precision floating-point value.
| s | String-representation |
| Value | Parsed value. |
Definition at line 4781 of file Expression.cs.
|
static |
Tries to parse a single-precision floating-point value.
| s | String-representation |
| Value | Parsed value. |
Definition at line 4792 of file Expression.cs.
|
static |
Upgrades elements if necessary, to a common field extension, trying to make them compatible. Information loss is not accepted in type conversions.
| E1 | Element 1. |
| Set1 | Set containing element 1. |
| E2 | Element 2. |
| Set2 | Set containing element 2. |
Definition at line 5327 of file Expression.cs.
|
get |
If the expression contains implicit print operations.
Definition at line 4516 of file Expression.cs.
|
get |
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluated using EvaluateAsync(Variables).
Definition at line 4414 of file Expression.cs.
|
get |
Root script node.
Definition at line 4496 of file Expression.cs.
|
get |
Original script string.
Definition at line 207 of file Expression.cs.
|
get |
Source of script, or null if not defined.
Definition at line 212 of file Expression.cs.
|
getset |
This property allows the caller to tag the expression with an arbitrary object.
Definition at line 5442 of file Expression.cs.