Expression Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An expression which can be analyzed or evaluated to produce a value.
public class Expression
type Expression = class
Public Class Expression
- Inheritance
-
Expression
- Derived
Remarks
This provides an open-ended wrapper that supports a number of built-in functions and can also be extended at runtime. It also supports validation of the correctness of an expression and evaluation that should be exception free.
Constructors
Expression(ExpressionEvaluator, Expression[]) |
Initializes a new instance of the Expression class. Expression constructor. |
Expression(String, Expression[]) |
Initializes a new instance of the Expression class. Built-in expression constructor. |
Fields
Functions |
Dictionary of function => ExpressionEvaluator. |
Properties
Children |
Gets or sets children expressions. |
Evaluator |
Gets expression evaluator. |
ReturnType |
Gets expected result of evaluating expression. |
Type |
Gets type of expression. |
Methods
Accessor(String, Expression) |
Construct and validate a property accessor. |
AndExpression(Expression[]) |
Construct and validate an And expression. |
ConstantExpression(Object) |
Construct a constant expression. |
DeepEquals(Expression) |
Do a deep equality between expressions. |
EqualsExpression(Expression[]) |
Construct and validate an Equals expression. |
LambaExpression(EvaluateExpressionDelegate) |
Construct an expression from a EvaluateExpressionDelegate. |
Lambda(Func<Object,Object>) |
Construct an expression from a lambda expression over the state. |
Lookup(String) |
Lookup a ExpressionEvaluator (function) by name. |
MakeExpression(ExpressionEvaluator, Expression[]) |
Make an expression and validate it. |
MakeExpression(String, Expression[]) |
Make an expression and validate it. |
NotExpression(Expression) |
Construct and validate a Not expression. |
OrExpression(Expression[]) |
Construct and validate an Or expression. |
Parse(String, EvaluatorLookup) |
Parse an expression string into an expression object. |
References() |
Return the static reference paths to memory. |
ReferenceWalk(Expression, Func<Expression,Boolean>) |
Walking function for identifying static memory references in an expression. |
SetPathToValue(Expression, Expression) |
Construct and validate an Set a property expression to a value expression. |
SetPathToValue(Expression, Object) |
Construct and validate an Set a property expression to a value expression. |
ToString() |
Returns a string that represents the current object. |
TryEvaluate(IMemory, Options) |
Evaluate the expression. |
TryEvaluate(Object, Options) |
Evaluate the expression. |
TryEvaluate<T>(IMemory, Options) |
Evaluate the expression. |
TryEvaluate<T>(Object, Options) |
Evaluate the expression. |
Validate() |
Validate immediate expression. |
ValidateTree() |
Recursively validate the expression tree. |
Operators
Implicit(String to Expression) |
allow a string to be implicitly assigned to an expression property. |
Extension Methods
DisjunctiveNormalForm(Expression) |
Rewrite expression into disjunctive normal form. |
PushDownNot(Expression) |
Rewrite the expression by pushing not down to the leaves. |