Class BlockExpressionContext
Describes a context in which a BlockExpression can be evaluated in.
public sealed record BlockExpressionContext : IEquatable<BlockExpressionContext>
- Inheritance
-
BlockExpressionContext
- Implements
- Inherited Members
Constructors
BlockExpressionContext(IList<CilInstruction>, IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>>, MatchingContext)
Describes a context in which a BlockExpression can be evaluated in.
public BlockExpressionContext(IList<CilInstruction> Instructions, IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>> BlockPatterns, MatchingContext Context)
Parameters
InstructionsIList<CilInstruction>The instructions the blocks are matched against.
BlockPatternsIReadOnlyDictionary<string, Pattern<IList<CilInstruction>>>The named block patterns.
ContextMatchingContextThe matching context.
Properties
BlockMatches
Gets the currently evaluated match nodes of each block.
public Dictionary<string, IMatchNode<IList<CilInstruction>>?> BlockMatches { get; }
Property Value
BlockPatterns
The named block patterns.
public IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>> BlockPatterns { get; init; }
Property Value
Context
The matching context.
public MatchingContext Context { get; init; }
Property Value
Instructions
The instructions the blocks are matched against.
public IList<CilInstruction> Instructions { get; init; }
Property Value
Methods
Deconstruct(out IList<CilInstruction>, out IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>>, out MatchingContext)
public void Deconstruct(out IList<CilInstruction> Instructions, out IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>> BlockPatterns, out MatchingContext Context)
Parameters
InstructionsIList<CilInstruction>BlockPatternsIReadOnlyDictionary<string, Pattern<IList<CilInstruction>>>ContextMatchingContext
Equals(BlockExpressionContext?)
public bool Equals(BlockExpressionContext? other)
Parameters
otherBlockExpressionContext
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
HasMatch(string)
Determines whether the condition for the provided block holds or not.
public bool HasMatch(string blockName)
Parameters
blockNamestring
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(BlockExpressionContext?, BlockExpressionContext?)
public static bool operator ==(BlockExpressionContext? left, BlockExpressionContext? right)
Parameters
leftBlockExpressionContextrightBlockExpressionContext
Returns
operator !=(BlockExpressionContext?, BlockExpressionContext?)
public static bool operator !=(BlockExpressionContext? left, BlockExpressionContext? right)
Parameters
leftBlockExpressionContextrightBlockExpressionContext