Class SubstituteAndUnquoteRewriter
Visitor to rewrite the types of expression tree nodes while also unquoting unary expressions representing quotes.
Inheritance
System.Object
SubstituteAndUnquoteRewriter
Namespace: Reaqtor
Assembly: Reaqtor.Shared.Core.dll
Syntax
public class SubstituteAndUnquoteRewriter : TypeSubstitutionExpressionVisitor
Constructors
SubstituteAndUnquoteRewriter(IDictionary<Type, Type>)
Creates a new type substitution and unquoting visitor using the specified type map.
Declaration
public SubstituteAndUnquoteRewriter(IDictionary<Type, Type> map)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.Type, System.Type> | map | Dictionary mapping original types to their rewrite targets. |
Methods
VisitInvocation(InvocationExpression)
Visit invocation expressions to strip out invocations of the identity function.
Declaration
protected override Expression VisitInvocation(InvocationExpression node)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.InvocationExpression | node | Expression to analyze and rewrite. |
Returns
Type | Description |
---|---|
System.Linq.Expressions.Expression | The original node if the invocation does not apply an identity function; otherwise, the operand of the identity function application. |
VisitUnary(UnaryExpression)
Visits unary expression nodes in order to unquote quote nodes.
Declaration
protected override Expression VisitUnary(UnaryExpression node)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.UnaryExpression | node | Expression to analyze and rewrite. |
Returns
Type | Description |
---|---|
System.Linq.Expressions.Expression | The original node if it doesn't represent a quote; otherwise, the unquoted node. |