Table of Contents

Class FlatBodyPattern

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Defines the pattern matching CIL method bodies as flat CIL instruction sequences.

[GenerateKeyedMatchNode]
public record FlatBodyPattern : Pattern<CilMethodBody?>, IEquatable<Pattern>, IEquatable<Pattern<CilMethodBody?>>, IEquatable<FlatBodyPattern>
Inheritance
FlatBodyPattern
Implements
Inherited Members

Constructors

FlatBodyPattern(FlatBodyPattern)

protected FlatBodyPattern(FlatBodyPattern original)

Parameters

original FlatBodyPattern

FlatBodyPattern(Pattern<IList<CilInstruction>>)

Defines the pattern matching CIL method bodies as flat CIL instruction sequences.

public FlatBodyPattern(Pattern<IList<CilInstruction>> Instructions)

Parameters

Instructions Pattern<IList<CilInstruction>>

The expected instruction sequence.

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Instructions

The expected instruction sequence.

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

Property Value

Pattern<IList<CilInstruction>>

Methods

Deconstruct(out Pattern<IList<CilInstruction>>)

public void Deconstruct(out Pattern<IList<CilInstruction>> Instructions)

Parameters

Instructions Pattern<IList<CilInstruction>>

Equals(FlatBodyPattern?)

public virtual bool Equals(FlatBodyPattern? other)

Parameters

other FlatBodyPattern

Returns

bool

Equals(Pattern<CilMethodBody?>?)

public override sealed bool Equals(Pattern<CilMethodBody?>? other)

Parameters

other Pattern<CilMethodBody>

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Format(IndentedTextWriter)

Serializes the pattern to a readable string.

public override void Format(IndentedTextWriter writer)

Parameters

writer IndentedTextWriter

The output stream.

GetHashCode()

public override int GetHashCode()

Returns

int

Match(CilMethodBody?, MatchingContext)

Attempts to match the provided input to the pattern.

public override IMatchNode<CilMethodBody?>? Match(CilMethodBody? input, MatchingContext context)

Parameters

input CilMethodBody

The input to match.

context MatchingContext

The context in which to match the pattern to.

Returns

IMatchNode<CilMethodBody>

When successful, returns the root node of the match tree, otherwise null.

PrintMembers(StringBuilder)

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

Operators

operator ==(FlatBodyPattern?, FlatBodyPattern?)

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

Parameters

left FlatBodyPattern
right FlatBodyPattern

Returns

bool

operator !=(FlatBodyPattern?, FlatBodyPattern?)

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

Parameters

left FlatBodyPattern
right FlatBodyPattern

Returns

bool