Class ExpressionSlimVisitor<TExpression>
Base class for expression visitors that rewrite an expression tree into a target type.
Inheritance
Namespace: System.Linq.Expressions
Assembly: Nuqleon.Linq.Expressions.Bonsai.dll
Syntax
public abstract class ExpressionSlimVisitor<TExpression> : Object
Type Parameters
Name | Description |
---|---|
TExpression | Target type for expressions. |
Constructors
ExpressionSlimVisitor()
Declaration
protected ExpressionSlimVisitor()
Methods
Visit(ExpressionSlim)
Visits the specified expression and rewrites it to the target expression type.
Declaration
public virtual TExpression Visit(ExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
ExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
Visit<T>(ReadOnlyCollection<T>)
Visits the collection of expression nodes and rewrites them to the target expression type.
Declaration
protected ReadOnlyCollection<TExpression> Visit<T>(ReadOnlyCollection<T> nodes)
where T : ExpressionSlim
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.ReadOnlyCollection<T> | nodes | Expression nodes to rewrite. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<TExpression> | Collection of rewritten expression nodes. |
Type Parameters
Name | Description |
---|---|
T | Type of the expressions to rewrite. This type should derive from Expression. |
VisitAndConvert<TStronglyTypedResult>(ExpressionSlim)
Visits the specified expression and rewrites it to the specified target expression type.
Declaration
protected TStronglyTypedResult VisitAndConvert<TStronglyTypedResult>(ExpressionSlim node)
where TStronglyTypedResult : TExpression
Parameters
Type | Name | Description |
---|---|---|
ExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TStronglyTypedResult | Result of visiting the expression. |
Type Parameters
Name | Description |
---|---|
TStronglyTypedResult | Type of the result of the rewrite. This type should derive from TExpression. |
VisitAndConvert<T, TStronglyTypedResult>(ReadOnlyCollection<T>)
Visits the collection of expression nodes and rewrites them to the specified target expression type.
Declaration
protected ReadOnlyCollection<TStronglyTypedResult> VisitAndConvert<T, TStronglyTypedResult>(ReadOnlyCollection<T> nodes)
where T : ExpressionSlim where TStronglyTypedResult : TExpression
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.ReadOnlyCollection<T> | nodes | Expression nodes to rewrite. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<TStronglyTypedResult> | Collection of rewritten expression nodes. |
Type Parameters
Name | Description |
---|---|
T | Type of the expressions to rewrite. This type should derive from Expression. |
TStronglyTypedResult | Type of the results of the rewrite. This type should derive from TExpression. |
VisitArguments(IArgumentProviderSlim)
Visits the arguments in an argument provider.
Declaration
protected ReadOnlyCollection<TExpression> VisitArguments(IArgumentProviderSlim nodes)
Parameters
Type | Name | Description |
---|---|---|
IArgumentProviderSlim | nodes | The argument provider whose arguments to visit. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<TExpression> | The rewritten arguments. |
VisitBinary(BinaryExpressionSlim)
Visits the children of the BinaryExpression.
Declaration
protected abstract TExpression VisitBinary(BinaryExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
BinaryExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitBlock(BlockExpressionSlim)
Visits the children of the BlockExpression.
Declaration
protected abstract TExpression VisitBlock(BlockExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
BlockExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitConditional(ConditionalExpressionSlim)
Visits the children of the ConditionalExpression.
Declaration
protected abstract TExpression VisitConditional(ConditionalExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
ConditionalExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitConstant(ConstantExpressionSlim)
Visits the children of the ConstantExpression.
Declaration
protected abstract TExpression VisitConstant(ConstantExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
ConstantExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitDefault(DefaultExpressionSlim)
Visits the children of the DefaultExpression.
Declaration
protected abstract TExpression VisitDefault(DefaultExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
DefaultExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitExtension(ExpressionSlim)
Visits the children of the extension expression node.
Declaration
protected abstract TExpression VisitExtension(ExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
ExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitGoto(GotoExpressionSlim)
Visits the children of the GotoExpression.
Declaration
protected abstract TExpression VisitGoto(GotoExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
GotoExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitIfNotNull<T, TResult>(T, Func<T, TResult>)
Visits the specified node using the specified visitor function if it's not null.
Declaration
protected static TResult VisitIfNotNull<T, TResult>(T node, Func<T, TResult> nodeVisitor)
Parameters
Type | Name | Description |
---|---|---|
T | node | Node to visit. |
System.Func<T, TResult> | nodeVisitor | Visitor function to apply to the node. |
Returns
Type | Description |
---|---|
TResult | Result of applying the visitor function to the node. |
Type Parameters
Name | Description |
---|---|
T | Type of the node to visit. |
TResult | Type of the result of visiting the node. |
VisitIndex(IndexExpressionSlim)
Visits the children of the IndexExpression.
Declaration
protected abstract TExpression VisitIndex(IndexExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
IndexExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitInvocation(InvocationExpressionSlim)
Visits the children of the InvocationExpression.
Declaration
protected abstract TExpression VisitInvocation(InvocationExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
InvocationExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitLabel(LabelExpressionSlim)
Visits the children of the LabelExpression.
Declaration
protected abstract TExpression VisitLabel(LabelExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
LabelExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitLambda(LambdaExpressionSlim)
Visits the children of the LambdaExpression.
Declaration
protected abstract TExpression VisitLambda(LambdaExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
LambdaExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitListInit(ListInitExpressionSlim)
Visits the children of the ListInitExpression.
Declaration
protected abstract TExpression VisitListInit(ListInitExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
ListInitExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitLoop(LoopExpressionSlim)
Visits the children of the LoopExpression.
Declaration
protected abstract TExpression VisitLoop(LoopExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
LoopExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitMember(MemberExpressionSlim)
Visits the children of the MemberExpression.
Declaration
protected abstract TExpression VisitMember(MemberExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
MemberExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitMemberInit(MemberInitExpressionSlim)
Visits the children of the MemberInitExpression.
Declaration
protected abstract TExpression VisitMemberInit(MemberInitExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
MemberInitExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitMethodCall(MethodCallExpressionSlim)
Visits the children of the MethodCallExpression.
Declaration
protected abstract TExpression VisitMethodCall(MethodCallExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
MethodCallExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitNew(NewExpressionSlim)
Visits the children of the NewExpression.
Declaration
protected abstract TExpression VisitNew(NewExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
NewExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitNewArray(NewArrayExpressionSlim)
Visits the children of the NewArrayExpression.
Declaration
protected abstract TExpression VisitNewArray(NewArrayExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
NewArrayExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitParameter(ParameterExpressionSlim)
Visits the children of the ParameterExpression.
Declaration
protected abstract TExpression VisitParameter(ParameterExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
ParameterExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitSwitch(SwitchExpressionSlim)
Visits the children of the SwitchExpression.
Declaration
protected abstract TExpression VisitSwitch(SwitchExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
SwitchExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitTry(TryExpressionSlim)
Visits the children of the TryExpression.
Declaration
protected abstract TExpression VisitTry(TryExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
TryExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitTypeBinary(TypeBinaryExpressionSlim)
Visits the children of the TypeBinaryExpression.
Declaration
protected abstract TExpression VisitTypeBinary(TypeBinaryExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
TypeBinaryExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |
VisitUnary(UnaryExpressionSlim)
Visits the children of the UnaryExpression.
Declaration
protected abstract TExpression VisitUnary(UnaryExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
UnaryExpressionSlim | node | Expression to visit. |
Returns
Type | Description |
---|---|
TExpression | Result of visiting the expression. |