Class ScopeRegion<TInstruction>
- Namespace
- Echo.ControlFlow.Regions
- Assembly
- Echo.ControlFlow.dll
Represents a simple unordered region defining an inner scope in the control flow graph.
public class ScopeRegion<TInstruction> : ControlFlowRegion<TInstruction>, IScopeControlFlowRegion<TInstruction>, IControlFlowRegion<TInstruction>, ISubGraph where TInstruction : notnull
Type Parameters
TInstructionThe type of data that each node in the graph stores.
- Inheritance
-
ControlFlowRegion<TInstruction>ScopeRegion<TInstruction>
- Implements
-
IScopeControlFlowRegion<TInstruction>IControlFlowRegion<TInstruction>
- Inherited Members
- Extension Methods
Constructors
ScopeRegion()
Creates a new empty scope region with no extra semantics attached.
public ScopeRegion()
ScopeRegion(ScopeRegionType)
Creates a new empty scope region of the provided scope type.
public ScopeRegion(ScopeRegionType type)
Parameters
typeScopeRegionTypeThe type.
Properties
EntryPoint
Gets or sets the first node that is executed in the region.
public ControlFlowNode<TInstruction>? EntryPoint { get; set; }
Property Value
- ControlFlowNode<TInstruction>
Nodes
Gets a collection of top-level nodes that this region consists of.
public RegionNodeCollection<TInstruction> Nodes { get; }
Property Value
- RegionNodeCollection<TInstruction>
Remarks
This collection does not include any nodes in the nested sub regions.
Regions
Gets a collection of nested subregions that this region defines.
public RegionCollection<TInstruction, ControlFlowRegion<TInstruction>> Regions { get; }
Property Value
- RegionCollection<TInstruction, ControlFlowRegion<TInstruction>>
ScopeType
Gets or sets the type of scope.
public ScopeRegionType ScopeType { get; set; }
Property Value
Methods
GetEntryPoint()
Obtains the first node that is executed in the region (if available).
public override ControlFlowNode<TInstruction>? GetEntryPoint()
Returns
- ControlFlowNode<TInstruction>
The node, or
nullif no entrypoint was specified.
GetNodes()
Gets a collection of all nodes in the control flow graph region. This includes all nodes in the nested regions.
public override IEnumerable<ControlFlowNode<TInstruction>> GetNodes()
Returns
- IEnumerable<ControlFlowNode<TInstruction>>
The nodes.
GetSubRegions()
Gets a collection of all nested regions defined in this region.
public override IEnumerable<ControlFlowRegion<TInstruction>> GetSubRegions()
Returns
- IEnumerable<ControlFlowRegion<TInstruction>>
The subregions.
RemoveNode(ControlFlowNode<TInstruction>)
Removes the node from the region.
public override bool RemoveNode(ControlFlowNode<TInstruction> node)
Parameters
nodeControlFlowNode<TInstruction>The node to remove.
Returns
- bool
trueif the node was found and removed,falseotherwise.