Table of Contents

Class ScopeBlock<TInstruction>

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

Represents a collection of blocks grouped together into one single block.

public class ScopeBlock<TInstruction> : IBlock<TInstruction> where TInstruction : notnull

Type Parameters

TInstruction

The type of instructions that this block contains.

Inheritance
ScopeBlock<TInstruction>
Implements
IBlock<TInstruction>
Inherited Members

Properties

Blocks

Gets an ordered, mutable collection of blocks that are present in this scope.

public IList<IBlock<TInstruction>> Blocks { get; }

Property Value

IList<IBlock<TInstruction>>

Methods

AcceptVisitor(IBlockVisitor<TInstruction>)

Visit the current block using the provided visitor.

public void AcceptVisitor(IBlockVisitor<TInstruction> visitor)

Parameters

visitor IBlockVisitor<TInstruction>

The visitor to accept.

AcceptVisitor<TState, TResult>(IBlockVisitor<TInstruction, TState, TResult>, TState)

Visit the current block using the provided visitor.

public TResult AcceptVisitor<TState, TResult>(IBlockVisitor<TInstruction, TState, TResult> visitor, TState state)

Parameters

visitor IBlockVisitor<TInstruction, TState, TResult>

The visitor to accept.

state TState

An argument to pass onto the visitor.

Returns

TResult

Type Parameters

TState
TResult

GetAllBlocks()

Gets an ordered collection of all basic blocks that can be found in this block.

public IEnumerable<BasicBlock<TInstruction>> GetAllBlocks()

Returns

IEnumerable<BasicBlock<TInstruction>>

The ordered basic blocks.

GetFirstBlock()

Gets the first basic block that appears in the ordered list of blocks.

public BasicBlock<TInstruction>? GetFirstBlock()

Returns

BasicBlock<TInstruction>

The first basic block, or null if the block contains no basic blocks..

GetLastBlock()

Gets the last basic block that appears in the ordered list of blocks.

public BasicBlock<TInstruction>? GetLastBlock()

Returns

BasicBlock<TInstruction>

The last basic block, or null if the block contains no basic blocks..

ToString()

public override string ToString()

Returns

string