Table of Contents

Class TypeIdentifierPattern

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Defines the pattern matching on top-level type identifiers.

[GenerateKeyedMatchNode]
public record TypeIdentifierPattern : Pattern<ITypeDefOrRef?>, IEquatable<Pattern>, IEquatable<Pattern<ITypeDefOrRef?>>, IEquatable<TypeIdentifierPattern>
Inheritance
TypeIdentifierPattern
Implements
Inherited Members
Extension Methods

Constructors

TypeIdentifierPattern(Pattern<IResolutionScope?>, Pattern<string?>, Pattern<string?>)

Defines the pattern matching on top-level type identifiers.

public TypeIdentifierPattern(Pattern<IResolutionScope?> Scope, Pattern<string?> Namespace, Pattern<string?> Name)

Parameters

Scope Pattern<IResolutionScope>

The pattern describing the scope defining the type.

Namespace Pattern<string>

The pattern describing the namespace of the type.

Name Pattern<string>

The pattern describing the name of the type.

TypeIdentifierPattern(Pattern<IResolutionScope>, string?, string?)

Constructs a new concrete type identifier pattern.

public TypeIdentifierPattern(Pattern<IResolutionScope> scope, string? ns, string? name)

Parameters

scope Pattern<IResolutionScope>

The expected resolution scope.

ns string

The expected namespace.

name string

The expected name.

TypeIdentifierPattern(TypeIdentifierPattern)

protected TypeIdentifierPattern(TypeIdentifierPattern original)

Parameters

original TypeIdentifierPattern

TypeIdentifierPattern(string?, string?)

Constructs a new concrete type identifier pattern.

public TypeIdentifierPattern(string? ns, string? name)

Parameters

ns string

The expected namespace.

name string

The expected name.

Fields

Boolean

public static readonly TypeIdentifierPattern Boolean

Field Value

TypeIdentifierPattern

Byte

public static readonly TypeIdentifierPattern Byte

Field Value

TypeIdentifierPattern

Char

public static readonly TypeIdentifierPattern Char

Field Value

TypeIdentifierPattern

Double

public static readonly TypeIdentifierPattern Double

Field Value

TypeIdentifierPattern

Int16

public static readonly TypeIdentifierPattern Int16

Field Value

TypeIdentifierPattern

Int32

public static readonly TypeIdentifierPattern Int32

Field Value

TypeIdentifierPattern

Int64

public static readonly TypeIdentifierPattern Int64

Field Value

TypeIdentifierPattern

IntPtr

public static readonly TypeIdentifierPattern IntPtr

Field Value

TypeIdentifierPattern

Object

public static readonly TypeIdentifierPattern Object

Field Value

TypeIdentifierPattern

SByte

public static readonly TypeIdentifierPattern SByte

Field Value

TypeIdentifierPattern

Single

public static readonly TypeIdentifierPattern Single

Field Value

TypeIdentifierPattern

String

public static readonly TypeIdentifierPattern String

Field Value

TypeIdentifierPattern

TypedReference

public static readonly TypeIdentifierPattern TypedReference

Field Value

TypeIdentifierPattern

UInt16

public static readonly TypeIdentifierPattern UInt16

Field Value

TypeIdentifierPattern

UInt32

public static readonly TypeIdentifierPattern UInt32

Field Value

TypeIdentifierPattern

UInt64

public static readonly TypeIdentifierPattern UInt64

Field Value

TypeIdentifierPattern

UIntPtr

public static readonly TypeIdentifierPattern UIntPtr

Field Value

TypeIdentifierPattern

Void

public static readonly TypeIdentifierPattern Void

Field Value

TypeIdentifierPattern

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Name

The pattern describing the name of the type.

public Pattern<string?> Name { get; init; }

Property Value

Pattern<string>

Namespace

The pattern describing the namespace of the type.

public Pattern<string?> Namespace { get; init; }

Property Value

Pattern<string>

Scope

The pattern describing the scope defining the type.

public Pattern<IResolutionScope?> Scope { get; init; }

Property Value

Pattern<IResolutionScope>

Methods

Deconstruct(out Pattern<IResolutionScope?>, out Pattern<string?>, out Pattern<string?>)

public void Deconstruct(out Pattern<IResolutionScope?> Scope, out Pattern<string?> Namespace, out Pattern<string?> Name)

Parameters

Scope Pattern<IResolutionScope>
Namespace Pattern<string>
Name Pattern<string>

Equals(Pattern<ITypeDefOrRef?>?)

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

Parameters

other Pattern<ITypeDefOrRef>

Returns

bool

Equals(TypeIdentifierPattern?)

public virtual bool Equals(TypeIdentifierPattern? other)

Parameters

other TypeIdentifierPattern

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(ITypeDefOrRef?, MatchingContext)

Attempts to match the provided input to the pattern.

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

Parameters

input ITypeDefOrRef

The input to match.

context MatchingContext

The context in which to match the pattern to.

Returns

IMatchNode<ITypeDefOrRef>

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

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

Parameters

left TypeIdentifierPattern
right TypeIdentifierPattern

Returns

bool

operator !=(TypeIdentifierPattern?, TypeIdentifierPattern?)

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

Parameters

left TypeIdentifierPattern
right TypeIdentifierPattern

Returns

bool