Skip to content

ICompositeVisitorBuilder<TContext, TBaseNode, TResult> Interface ​

Definition ​

Fluent interface to build a CompositeVisitor<TContext, TBaseNode, TResult>.

c#
public abstract interface ICompositeVisitorBuilder<TContext, TBaseNode, TResult>
   where TBaseNode : Node<TBaseNode>

Type Parameters ​

NameDescription
TContextThe type of the context object.
TBaseNodeThe base type of all nodes in the tree.
TResultThe type of the result of visiting a node.

Methods ​

NameDescription
ToVisitor()Builds the CompositeVisitor<TContext, TBaseNode, TResult>.
With(Visitor<TContext, TBaseNode, TResult>)Add a visitor for the base node type. Useful to provide a fallback visitor when there is no visitor for the specific node type registered.
With<TNode>(NodeVisitor<TContext, TBaseNode, TNode, TResult>)Add a visitor for the specific node type TNode. This can be a base node type which will be used if there is no visitor for the specific node type registered.