Class BottomUpExpressionRewriter<TTarget>
Defines a bottom-up rewriter for LINQ expression trees to TTarget trees.
Inheritance
System.Object
BottomUpExpressionRewriter<TTarget>
Inherited Members
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public class BottomUpExpressionRewriter<TTarget> : BottomUpRewriter<ExpressionTreeBase, ExpressionTreeNode, TTarget, ExpressionTreeWildcardFactory> where TTarget : ITree
Type Parameters
Name | Description |
---|---|
TTarget | Type of the target trees. Needs to implement ITree. |
Constructors
BottomUpExpressionRewriter()
Creates a new bottom up rewriter instance with no initial rewrite rule definitions. Collection initializer syntax can be used for the Leaves, Rules, and Fallbacks properties.
Declaration
public BottomUpExpressionRewriter()
Properties
Fallbacks
Gets the collection of fallback rules used by the rewriter.
Declaration
public ExpressionRewriterFallbackCollection<TTarget> Fallbacks { get; }
Property Value
Type | Description |
---|---|
ExpressionRewriterFallbackCollection<TTarget> |
Leaves
Gets the collection of leaves recognized by the rewriter.
Declaration
public ExpressionRewriterLeafCollection<TTarget> Leaves { get; }
Property Value
Type | Description |
---|---|
ExpressionRewriterLeafCollection<TTarget> |
Rules
Gets the collection of rewrite pattern rules recognized by the rewriter.
Declaration
public ExpressionRewriterRuleCollection<TTarget> Rules { get; }
Property Value
Type | Description |
---|---|
ExpressionRewriterRuleCollection<TTarget> |
Methods
Rewrite(Expression)
Rewrites the given expression tree to a target tree using the rules in the table.
Declaration
public TTarget Rewrite(Expression expression)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression | expression | Expression tree to rewrite. |
Returns
Type | Description |
---|---|
TTarget | Target tree after applying the rewrite rules in the table. |