TemplatedExpressionParser Class

Represents a template based token substitution parser that supports binary and advanced expressions.

Definition

Namespace: Gemstone.Expressions
Assembly: Gemstone.Expressions (in Gemstone.Expressions.dll) Version: 1.0.128 -- Release Build+cfed08c7efcabf54b006110ecd862a6bfcb7b819
public class TemplatedExpressionParser
Inheritance
Object    TemplatedExpressionParser

Remarks

As an example, this parser can use a templated expression of the form:

C#
{CompanyAcronym}_{DeviceAcronym}[?{SignalType.Source}=Phasor[-{SignalType.Suffix}{SignalIndex}]]:{Signal.Acronym}
then replace the tokens with actual values and properly evaluate the expressions. Example results could look like: GPA_SHELBY-PA1:IPHA and GPA_SHELBY:FREQ

Parser also supports more complex C# style expressions using the "eval{}" function, e.g.:

C#
eval{'{CompanyAcronym}'.Substring(0,3)}_{DeviceAcronym}eval{'[?{SignalType.Source}=Phasor[-{SignalType.Suffix}]]'.Length}

Constructors

TemplatedExpressionParser Creates a new TemplatedExpressionParser.
TemplatedExpressionParser(Char, Char, Char, Char) Creates a new TemplatedExpressionParser with desired delimiters.

Properties

EndExpressionDelimiter Gets the character that identifies the end of an expression.
EndTokenDelimiter Gets the character that identifies the end of a token.
ReservedSymbols Gets the reserved symbols - this includes all delimiters and expression operators.
StartExpressionDelimiter Gets the character that identifies the start of an expression.
StartTokenDelimiter Gets the character that identifies the beginning of a token.
TemplatedExpression Gets or sets the templated expression to use.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Execute Executes replacements using provided substitutions dictionary on the currently defined TemplatedExpression value and optionally evaluates any expressions.
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also