Class BlockWalker<TInstruction>
- Namespace
- Echo.ControlFlow.Blocks
- Assembly
- Echo.ControlFlow.dll
Provides a mechanism for traversing a scoped block tree in order.
public class BlockWalker<TInstruction> : IBlockVisitor<TInstruction> where TInstruction : notnull
Type Parameters
TInstruction
- Inheritance
-
BlockWalker<TInstruction>
- Implements
-
IBlockVisitor<TInstruction>
- Inherited Members
Constructors
BlockWalker(IBlockListener<TInstruction>)
Creates a new block walker.
public BlockWalker(IBlockListener<TInstruction> listener)
Parameters
listenerIBlockListener<TInstruction>The object that responds to traversal events.
Methods
VisitBasicBlock(BasicBlock<TInstruction>)
Visits a basic block.
public void VisitBasicBlock(BasicBlock<TInstruction> block)
Parameters
blockBasicBlock<TInstruction>The block.
VisitExceptionHandlerBlock(ExceptionHandlerBlock<TInstruction>)
Visits an exception handler block.
public void VisitExceptionHandlerBlock(ExceptionHandlerBlock<TInstruction> block)
Parameters
blockExceptionHandlerBlock<TInstruction>The block.
VisitHandlerBlock(HandlerBlock<TInstruction>)
Visits a handler block inside an ExceptionHandlerBlock<TInstruction>.
public void VisitHandlerBlock(HandlerBlock<TInstruction> block)
Parameters
blockHandlerBlock<TInstruction>The block.
VisitScopeBlock(ScopeBlock<TInstruction>)
Visits a scope block.
public void VisitScopeBlock(ScopeBlock<TInstruction> block)
Parameters
blockScopeBlock<TInstruction>The block.
Walk(IBlock<TInstruction>)
Traverses a block tree and notifies the listener with traversal events.
public void Walk(IBlock<TInstruction> block)
Parameters
blockIBlock<TInstruction>The root of the block tree to traverse.