Table of Contents

Class SqlNodeMutatorContext

Namespace
LfrlAnvil.Sql.Expressions.Visitors
Assembly
LfrlAnvil.Sql.Core.dll

Represents a context of an ISqlNodeVisitor that allows to replace parts of an SQL syntax tree.

public class SqlNodeMutatorContext
Inheritance
SqlNodeMutatorContext
Inherited Members

Methods

Leaf(SqlNodeBase)

Creates a new SqlNodeMutatorContext.MutationResult instance with IsNode equal to false.

[Pure]
protected static SqlNodeMutatorContext.MutationResult Leaf(SqlNodeBase value)

Parameters

value SqlNodeBase

SQL node that is the result of a mutation.

Returns

SqlNodeMutatorContext.MutationResult

New SqlNodeMutatorContext.MutationResult instance.

Mutate(SqlNodeBase, SqlNodeAncestors)

Mutates the provided node.

[Pure]
protected virtual SqlNodeMutatorContext.MutationResult Mutate(SqlNodeBase node, SqlNodeAncestors ancestors)

Parameters

node SqlNodeBase

Node to mutate.

ancestors SqlNodeAncestors

SqlNodeAncestors associated with the node to mutate.

Returns

SqlNodeMutatorContext.MutationResult

Mutation result.

Remarks

See Node(SqlNodeBase) and Leaf(SqlNodeBase) for more information on how the result affects an SQL syntax tree traversal.

Node(SqlNodeBase)

Creates a new SqlNodeMutatorContext.MutationResult instance with IsNode equal to true.

[Pure]
protected static SqlNodeMutatorContext.MutationResult Node(SqlNodeBase value)

Parameters

value SqlNodeBase

SQL node that is the result of a mutation.

Returns

SqlNodeMutatorContext.MutationResult

New SqlNodeMutatorContext.MutationResult instance.

Visit(SqlNodeBase)

Visits the provided node and returns the result of its mutation.

[Pure]
public SqlNodeBase Visit(SqlNodeBase node)

Parameters

node SqlNodeBase

Node to visit.

Returns

SqlNodeBase

Result of node mutation.