MrKWatkins.Ast Help

OrderedProcessorWithContext<TContext, TNode> Class

Definition

A Processor<TNode> that processes the nodes in a tree in a specified order and gives access to a context object during processing.

public abstract class OrderedProcessorWithContext<TContext, TNode> : Processor<TNode> where TNode : Node<TNode>

Type Parameters

Name

Description

TContext

The type of the context object.

TNode

The type of nodes in the tree.

Constructors

Properties

Name

Description

Traversal

Override this property to specify the ITraversal<TNode> to use to traverse the tree. Defaults to DepthFirstPreOrderTraversal<TNode>.

Methods

Name

Description

CreateContext(TNode)

Override to create the context object.

ProcessNode(TContext, TNode)

Process the specified node.

ShouldProcessChildren(TContext, TNode)

Override this method to optionally decide whether to process the children of the specified node or not. Defaults to processing all nodes.

ShouldProcessNode(TContext, TNode)

Override this method to optionally decide whether to process the specified node or not. Defaults to processing all nodes.

Last modified: 09 September 2024