Table of Contents

Class BlocksBodyPattern.MatchNode

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Represents the match node corresponding to a BlocksBodyPattern

public sealed record BlocksBodyPattern.MatchNode : IMatchNode<CilMethodBody?>, IMatchNode, IEquatable<BlocksBodyPattern.MatchNode>
Inheritance
BlocksBodyPattern.MatchNode
Implements
Inherited Members

Constructors

MatchNode(Pattern<CilMethodBody?>, CilMethodBody?, IReadOnlyDictionary<string, IMatchNode<IList<CilInstruction>>>)

Represents the match node corresponding to a BlocksBodyPattern

public MatchNode(Pattern<CilMethodBody?> Pattern, CilMethodBody? ConcreteValue, IReadOnlyDictionary<string, IMatchNode<IList<CilInstruction>>> Blocks)

Parameters

Pattern Pattern<CilMethodBody>
ConcreteValue CilMethodBody
Blocks IReadOnlyDictionary<string, IMatchNode<IList<CilInstruction>>>

Properties

Blocks

public IReadOnlyDictionary<string, IMatchNode<IList<CilInstruction>>> Blocks { get; init; }

Property Value

IReadOnlyDictionary<string, IMatchNode<IList<CilInstruction>>>

ConcreteValue

Gets the value that matched the pattern.

public CilMethodBody? ConcreteValue { get; init; }

Property Value

CilMethodBody

Pattern

Gets the pattern that was matched.

public Pattern<CilMethodBody?> Pattern { get; init; }

Property Value

Pattern<CilMethodBody>

Methods

Deconstruct(out Pattern<CilMethodBody?>, out CilMethodBody?, out IReadOnlyDictionary<string, IMatchNode<IList<CilInstruction>>>)

public void Deconstruct(out Pattern<CilMethodBody?> Pattern, out CilMethodBody? ConcreteValue, out IReadOnlyDictionary<string, IMatchNode<IList<CilInstruction>>> Blocks)

Parameters

Pattern Pattern<CilMethodBody>
ConcreteValue CilMethodBody
Blocks IReadOnlyDictionary<string, IMatchNode<IList<CilInstruction>>>

Equals(MatchNode?)

public bool Equals(BlocksBodyPattern.MatchNode? other)

Parameters

other BlocksBodyPattern.MatchNode

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetChildren()

Enumerates all child nodes of this match node.

public IEnumerable<(string Name, IMatchNode Match)> GetChildren()

Returns

IEnumerable<(string Name, IMatchNode Match)>

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(MatchNode?, MatchNode?)

public static bool operator ==(BlocksBodyPattern.MatchNode? left, BlocksBodyPattern.MatchNode? right)

Parameters

left BlocksBodyPattern.MatchNode
right BlocksBodyPattern.MatchNode

Returns

bool

operator !=(MatchNode?, MatchNode?)

public static bool operator !=(BlocksBodyPattern.MatchNode? left, BlocksBodyPattern.MatchNode? right)

Parameters

left BlocksBodyPattern.MatchNode
right BlocksBodyPattern.MatchNode

Returns

bool