Table of Contents

Class BlockExpressionContext

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

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

Instructions IList<CilInstruction>

The instructions the blocks are matched against.

BlockPatterns IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>>

The named block patterns.

Context MatchingContext

The matching context.

Properties

BlockMatches

Gets the currently evaluated match nodes of each block.

public Dictionary<string, IMatchNode<IList<CilInstruction>>?> BlockMatches { get; }

Property Value

Dictionary<string, IMatchNode<IList<CilInstruction>>>

BlockPatterns

The named block patterns.

public IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>> BlockPatterns { get; init; }

Property Value

IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>>

Context

The matching context.

public MatchingContext Context { get; init; }

Property Value

MatchingContext

Instructions

The instructions the blocks are matched against.

public IList<CilInstruction> Instructions { get; init; }

Property Value

IList<CilInstruction>

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

Instructions IList<CilInstruction>
BlockPatterns IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>>
Context MatchingContext

Equals(BlockExpressionContext?)

public bool Equals(BlockExpressionContext? other)

Parameters

other BlockExpressionContext

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

HasMatch(string)

Determines whether the condition for the provided block holds or not.

public bool HasMatch(string blockName)

Parameters

blockName string

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(BlockExpressionContext?, BlockExpressionContext?)

public static bool operator ==(BlockExpressionContext? left, BlockExpressionContext? right)

Parameters

left BlockExpressionContext
right BlockExpressionContext

Returns

bool

operator !=(BlockExpressionContext?, BlockExpressionContext?)

public static bool operator !=(BlockExpressionContext? left, BlockExpressionContext? right)

Parameters

left BlockExpressionContext
right BlockExpressionContext

Returns

bool