Table of Contents

Class LocalsPattern

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Defines the pattern matching the locals within a CIL method body.

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

Constructors

LocalsPattern(LocalsPattern)

protected LocalsPattern(LocalsPattern original)

Parameters

original LocalsPattern

LocalsPattern(Pattern<bool>, Pattern<IList<CilLocalVariable>>)

Defines the pattern matching the locals within a CIL method body.

public LocalsPattern(Pattern<bool> InitializeLocals, Pattern<IList<CilLocalVariable>> Locals)

Parameters

InitializeLocals Pattern<bool>

The pattern describing the init locals flag.

Locals Pattern<IList<CilLocalVariable>>

The pattern describing the defined locals in the body.

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

InitializeLocals

The pattern describing the init locals flag.

public Pattern<bool> InitializeLocals { get; init; }

Property Value

Pattern<bool>

Locals

The pattern describing the defined locals in the body.

public Pattern<IList<CilLocalVariable>> Locals { get; init; }

Property Value

Pattern<IList<CilLocalVariable>>

Methods

Deconstruct(out Pattern<bool>, out Pattern<IList<CilLocalVariable>>)

public void Deconstruct(out Pattern<bool> InitializeLocals, out Pattern<IList<CilLocalVariable>> Locals)

Parameters

InitializeLocals Pattern<bool>
Locals Pattern<IList<CilLocalVariable>>

Equals(LocalsPattern?)

public virtual bool Equals(LocalsPattern? other)

Parameters

other LocalsPattern

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 ==(LocalsPattern?, LocalsPattern?)

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

Parameters

left LocalsPattern
right LocalsPattern

Returns

bool

operator !=(LocalsPattern?, LocalsPattern?)

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

Parameters

left LocalsPattern
right LocalsPattern

Returns

bool