Skip to content

CompositeVisitor<TBaseNode, TResult> Class ​

Definition ​

A Visitor<TNode, TResult> built from multiple other visitors that visit specific node types and do not take a context object. When a node is visited the visitor with the most specific type for the node will be used. If no suitable visitor is found an InvalidOperationException is thrown; register a visitor for the base node type to provide a fallback instead.

c#
public sealed class CompositeVisitor<TBaseNode, TResult> : Visitor<TBaseNode, TResult>, ICompositeVisitorBuilder<TBaseNode, TResult>
   where TBaseNode : Node<TBaseNode>

View source

Type Parameters ​

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

Methods ​

NameDescription
Build()Fluent interface to build a CompositeVisitor<TBaseNode, TResult>.
VisitNode(TBaseNode)Called to visit a node.