Skip to content

Visitor<TContext, TNode, TResult>.Visit Method

Definition

Visits the specified node and returns the result.

public TResult? Visit(TContext? context, TNode node);

View source

Parameters

Name Type Description
context TContext The context object.
node TNode The node to visit.

Returns

TResult

The result of visiting node.

Remarks

If this visitor has been registered with a CompositeVisitor<TContext, TBaseNode, TResult> then the node will be dispatched through that composite, so that a visitor for one node type can visit children of other node types. Visitors should therefore always use this method, rather than VisitNode(TContext, TNode), to visit children.