Class ExpressionSlimVisitor
Visitor for lightweight expression trees.
Namespace: System.Linq.Expressions
Assembly: Nuqleon.Linq.Expressions.Bonsai.dll
Syntax
public class ExpressionSlimVisitor : Object
Constructors
ExpressionSlimVisitor()
Declaration
public ExpressionSlimVisitor()
Methods
Visit(ReadOnlyCollection<ExpressionSlim>)
Visits a collection of expression tree nodes.
Declaration
public ReadOnlyCollection<ExpressionSlim> Visit(ReadOnlyCollection<ExpressionSlim> nodes)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.ReadOnlyCollection<ExpressionSlim> | nodes | Nodes to visit. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<ExpressionSlim> | Result of visiting the nodes. |
Visit(ExpressionSlim)
Visits the specified expression tree node.
Declaration
public virtual ExpressionSlim Visit(ExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
ExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
Visit<T>(ReadOnlyCollection<T>, Func<T, T>)
Visits a collection of objects using the specified visit function.
Declaration
public static ReadOnlyCollection<T> Visit<T>(ReadOnlyCollection<T> nodes, Func<T, T> elementVisitor)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.ReadOnlyCollection<T> | nodes | Nodes to visit. |
System.Func<T, T> | elementVisitor | Function to visit each of the elements in the collection. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<T> | Result of visiting the nodes. |
Type Parameters
Name | Description |
---|---|
T | Type of the objects in the collection. |
VisitAndConvert<T>(T)
Visits and converts an expression tree node.
Declaration
public T VisitAndConvert<T>(T expression)
where T : ExpressionSlim
Parameters
Type | Name | Description |
---|---|---|
T | expression | Node to visit. |
Returns
Type | Description |
---|---|
T | Result of visiting and converting the node. |
Type Parameters
Name | Description |
---|---|
T | Type of the expression to convert to. |
VisitAndConvert<T>(T, String)
Visits and converts an expression tree node.
Declaration
public T VisitAndConvert<T>(T expression, string callerName)
where T : ExpressionSlim
Parameters
Type | Name | Description |
---|---|---|
T | expression | Node to visit. |
System.String | callerName | Name of the caller. |
Returns
Type | Description |
---|---|
T | Result of visiting and converting the node. |
Type Parameters
Name | Description |
---|---|
T | Type of the expression to convert to. |
VisitAndConvert<T>(ReadOnlyCollection<T>)
Visits and converts a collection of expression tree nodes.
Declaration
public ReadOnlyCollection<T> VisitAndConvert<T>(ReadOnlyCollection<T> nodes)
where T : ExpressionSlim
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.ReadOnlyCollection<T> | nodes | Nodes to visit. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<T> | Result of visiting and converting the nodes. |
Type Parameters
Name | Description |
---|---|
T | Type of the expression to convert to. |
VisitAndConvert<T>(ReadOnlyCollection<T>, String)
Visits and converts a collection of expression tree nodes.
Declaration
public ReadOnlyCollection<T> VisitAndConvert<T>(ReadOnlyCollection<T> nodes, string callerName)
where T : ExpressionSlim
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.ReadOnlyCollection<T> | nodes | Nodes to visit. |
System.String | callerName | Name of the caller. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<T> | Result of visiting and converting the nodes. |
Type Parameters
Name | Description |
---|---|
T | Type of the expression to convert to. |
VisitArguments(IArgumentProviderSlim)
Visits the arguments in an argument provider.
Declaration
protected ExpressionSlim[] VisitArguments(IArgumentProviderSlim nodes)
Parameters
Type | Name | Description |
---|---|---|
IArgumentProviderSlim | nodes | The argument provider whose arguments to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim[] | The rewritten arguments, if any; otherwise, null. |
VisitBinary(BinaryExpressionSlim)
Visits a binary expression tree node.
Declaration
protected virtual ExpressionSlim VisitBinary(BinaryExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
BinaryExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitBlock(BlockExpressionSlim)
Visits a block expression tree node.
Declaration
protected virtual ExpressionSlim VisitBlock(BlockExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
BlockExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitCatchBlock(CatchBlockSlim)
Visits a block expression tree node.
Declaration
protected virtual CatchBlockSlim VisitCatchBlock(CatchBlockSlim node)
Parameters
Type | Name | Description |
---|---|---|
CatchBlockSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
CatchBlockSlim | Result of visiting the node. |
VisitConditional(ConditionalExpressionSlim)
Visits a conditional expression tree node.
Declaration
protected virtual ExpressionSlim VisitConditional(ConditionalExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
ConditionalExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitConstant(ConstantExpressionSlim)
Visits a constant expression tree node.
Declaration
protected virtual ExpressionSlim VisitConstant(ConstantExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
ConstantExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitDefault(DefaultExpressionSlim)
Visits a default expression tree node.
Declaration
protected virtual ExpressionSlim VisitDefault(DefaultExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
DefaultExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitElementInit(ElementInitSlim)
Visits an element initializer node.
Declaration
protected virtual ElementInitSlim VisitElementInit(ElementInitSlim node)
Parameters
Type | Name | Description |
---|---|---|
ElementInitSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ElementInitSlim | Result of visiting the node. |
VisitGoto(GotoExpressionSlim)
Visits an goto expression node.
Declaration
protected virtual ExpressionSlim VisitGoto(GotoExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
GotoExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitIfNotNull<T>(T, Func<T, T>)
Visits the specified node using the specified visitor function if it's not null.
Declaration
protected static T VisitIfNotNull<T>(T node, Func<T, T> nodeVisitor)
Parameters
Type | Name | Description |
---|---|---|
T | node | Node to visit. |
System.Func<T, T> | nodeVisitor | Visitor function to apply to the node. |
Returns
Type | Description |
---|---|
T | Result of applying the visitor function to the node. |
Type Parameters
Name | Description |
---|---|
T | Type of the node to visit. |
VisitIndex(IndexExpressionSlim)
Visits an index expression node.
Declaration
protected virtual ExpressionSlim VisitIndex(IndexExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
IndexExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitInvocation(InvocationExpressionSlim)
Visits an invocation expression tree node.
Declaration
protected virtual ExpressionSlim VisitInvocation(InvocationExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
InvocationExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitLabel(LabelExpressionSlim)
Visits an invocation expression tree node.
Declaration
protected virtual ExpressionSlim VisitLabel(LabelExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
LabelExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitLabelTarget(LabelTargetSlim)
Visits an invocation expression tree node.
Declaration
protected virtual LabelTargetSlim VisitLabelTarget(LabelTargetSlim node)
Parameters
Type | Name | Description |
---|---|---|
LabelTargetSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
LabelTargetSlim | Result of visiting the node. |
VisitLambda(LambdaExpressionSlim)
Visits a lambda expression tree node.
Declaration
protected virtual ExpressionSlim VisitLambda(LambdaExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
LambdaExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitListInit(ListInitExpressionSlim)
Visits a list initializer expression tree node.
Declaration
protected virtual ExpressionSlim VisitListInit(ListInitExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
ListInitExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitLoop(LoopExpressionSlim)
Visits a loop expression tree node.
Declaration
protected virtual ExpressionSlim VisitLoop(LoopExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
LoopExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitMember(MemberExpressionSlim)
Visits a member lookup expression tree node.
Declaration
protected virtual ExpressionSlim VisitMember(MemberExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
MemberExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitMemberAssignment(MemberAssignmentSlim)
Visits a member assignment binding node.
Declaration
protected virtual MemberAssignmentSlim VisitMemberAssignment(MemberAssignmentSlim node)
Parameters
Type | Name | Description |
---|---|---|
MemberAssignmentSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
MemberAssignmentSlim | Result of visiting the node. |
VisitMemberBinding(MemberBindingSlim)
Visits a member binding node.
Declaration
protected virtual MemberBindingSlim VisitMemberBinding(MemberBindingSlim node)
Parameters
Type | Name | Description |
---|---|---|
MemberBindingSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
MemberBindingSlim | Result of visiting the node. |
VisitMemberInit(MemberInitExpressionSlim)
Visits a member initializer expression tree node.
Declaration
protected virtual ExpressionSlim VisitMemberInit(MemberInitExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
MemberInitExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitMemberListBinding(MemberListBindingSlim)
Visits a member list binding node.
Declaration
protected virtual MemberListBindingSlim VisitMemberListBinding(MemberListBindingSlim node)
Parameters
Type | Name | Description |
---|---|---|
MemberListBindingSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
MemberListBindingSlim | Result of visiting the node. |
VisitMemberMemberBinding(MemberMemberBindingSlim)
Visits a member member binding node.
Declaration
protected virtual MemberMemberBindingSlim VisitMemberMemberBinding(MemberMemberBindingSlim node)
Parameters
Type | Name | Description |
---|---|---|
MemberMemberBindingSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
MemberMemberBindingSlim | Result of visiting the node. |
VisitMethodCall(MethodCallExpressionSlim)
Visits a method call expression tree node.
Declaration
protected virtual ExpressionSlim VisitMethodCall(MethodCallExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
MethodCallExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitNew(NewExpressionSlim)
Visits an object creation expression tree node.
Declaration
protected virtual ExpressionSlim VisitNew(NewExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
NewExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitNewArray(NewArrayExpressionSlim)
Visits an array creation expression tree node.
Declaration
protected virtual ExpressionSlim VisitNewArray(NewArrayExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
NewArrayExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitParameter(ParameterExpressionSlim)
Visits a parameter expression tree node.
Declaration
protected virtual ExpressionSlim VisitParameter(ParameterExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
ParameterExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitSwitch(SwitchExpressionSlim)
Visits a switch expression tree node.
Declaration
protected virtual ExpressionSlim VisitSwitch(SwitchExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
SwitchExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitSwitchCase(SwitchCaseSlim)
Visits a switch case tree node.
Declaration
protected virtual SwitchCaseSlim VisitSwitchCase(SwitchCaseSlim node)
Parameters
Type | Name | Description |
---|---|---|
SwitchCaseSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
SwitchCaseSlim | Result of visiting the node. |
VisitTry(TryExpressionSlim)
Visits a try expression tree node.
Declaration
protected virtual ExpressionSlim VisitTry(TryExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
TryExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitTypeBinary(TypeBinaryExpressionSlim)
Visits a type binary expression tree node.
Declaration
protected virtual ExpressionSlim VisitTypeBinary(TypeBinaryExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
TypeBinaryExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |
VisitUnary(UnaryExpressionSlim)
Visits a unary expression tree node.
Declaration
protected virtual ExpressionSlim VisitUnary(UnaryExpressionSlim node)
Parameters
Type | Name | Description |
---|---|---|
UnaryExpressionSlim | node | Node to visit. |
Returns
Type | Description |
---|---|
ExpressionSlim | Result of visiting the node. |