Table of Contents

Class BlockFormatter<TInstruction>

Namespace
Echo.ControlFlow.Blocks
Assembly
Echo.ControlFlow.dll

Provides a mechanism for formatting a tree of blocks into an indented string representation.

public class BlockFormatter<TInstruction> : IBlockListener<TInstruction> where TInstruction : notnull

Type Parameters

TInstruction

The type of instructions stored in the block.

Inheritance
BlockFormatter<TInstruction>
Implements
IBlockListener<TInstruction>
Inherited Members

Constructors

BlockFormatter(string)

Creates a new block formatter.

public BlockFormatter(string indentationString)

Parameters

indentationString string

The string to use when indenting a block.

Methods

EnterEpilogueBlock(HandlerBlock<TInstruction>)

Enters the epilogue region of a handler block.

public void EnterEpilogueBlock(HandlerBlock<TInstruction> block)

Parameters

block HandlerBlock<TInstruction>

The parent handler block this epilogue is added to.

EnterExceptionHandlerBlock(ExceptionHandlerBlock<TInstruction>)

Enters an exception handler block.

public void EnterExceptionHandlerBlock(ExceptionHandlerBlock<TInstruction> block)

Parameters

block ExceptionHandlerBlock<TInstruction>

The block.

EnterHandlerBlock(ExceptionHandlerBlock<TInstruction>, int)

Enters a handler region of an exception handler block.

public void EnterHandlerBlock(ExceptionHandlerBlock<TInstruction> block, int handlerIndex)

Parameters

block ExceptionHandlerBlock<TInstruction>

The block.

handlerIndex int

The index of the handler that was entered.

EnterHandlerContents(HandlerBlock<TInstruction>)

Enters the main code of a handler block.

public void EnterHandlerContents(HandlerBlock<TInstruction> block)

Parameters

block HandlerBlock<TInstruction>

The parent handler block this scope is added to.

EnterPrologueBlock(HandlerBlock<TInstruction>)

Enters the prologue region of a handler block.

public void EnterPrologueBlock(HandlerBlock<TInstruction> block)

Parameters

block HandlerBlock<TInstruction>

The parent handler block this prologue is added to.

EnterProtectedBlock(ExceptionHandlerBlock<TInstruction>)

Enters the protected region of an exception handler block.

public void EnterProtectedBlock(ExceptionHandlerBlock<TInstruction> block)

Parameters

block ExceptionHandlerBlock<TInstruction>

The block.

EnterScopeBlock(ScopeBlock<TInstruction>)

Enters a scope block.

public void EnterScopeBlock(ScopeBlock<TInstruction> block)

Parameters

block ScopeBlock<TInstruction>

The block.

ExitEpilogueBlock(HandlerBlock<TInstruction>)

Exits the epilogue region of a handler block.

public void ExitEpilogueBlock(HandlerBlock<TInstruction> block)

Parameters

block HandlerBlock<TInstruction>

The parent handler block this epilogue is added to.

ExitExceptionHandlerBlock(ExceptionHandlerBlock<TInstruction>)

Exits an exception handler block.

public void ExitExceptionHandlerBlock(ExceptionHandlerBlock<TInstruction> block)

Parameters

block ExceptionHandlerBlock<TInstruction>

The block.

ExitHandlerBlock(ExceptionHandlerBlock<TInstruction>, int)

Exits a handler region of an exception handler block.

public void ExitHandlerBlock(ExceptionHandlerBlock<TInstruction> block, int handlerIndex)

Parameters

block ExceptionHandlerBlock<TInstruction>

The block.

handlerIndex int

The index of the handler that was exit.

ExitHandlerContents(HandlerBlock<TInstruction>)

Exits the main code of a handler block.

public void ExitHandlerContents(HandlerBlock<TInstruction> block)

Parameters

block HandlerBlock<TInstruction>

The parent handler block this scope is added to.

ExitPrologueBlock(HandlerBlock<TInstruction>)

Exits the prologue region of a handler block.

public void ExitPrologueBlock(HandlerBlock<TInstruction> block)

Parameters

block HandlerBlock<TInstruction>

The parent handler block this prologue is added to.

ExitProtectedBlock(ExceptionHandlerBlock<TInstruction>)

Exits the protected region of an exception handler block.

public void ExitProtectedBlock(ExceptionHandlerBlock<TInstruction> block)

Parameters

block ExceptionHandlerBlock<TInstruction>

The block.

ExitScopeBlock(ScopeBlock<TInstruction>)

Exits a scope block.

public void ExitScopeBlock(ScopeBlock<TInstruction> block)

Parameters

block ScopeBlock<TInstruction>

The block.

Format(IBlock<TInstruction>)

Formats a block into an indented string representation.

public static string Format(IBlock<TInstruction> block)

Parameters

block IBlock<TInstruction>

The block to format.

Returns

string

The indented string.

GetOutput()

Obtains the raw string output.

public string GetOutput()

Returns

string

VisitBasicBlock(BasicBlock<TInstruction>)

Visits a basic block.

public void VisitBasicBlock(BasicBlock<TInstruction> block)

Parameters

block BasicBlock<TInstruction>

The block.