Table of Contents

Class MethodReferencePattern.MatchNode

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Represents a match node produced by a MethodReferencePattern.

public sealed record MethodReferencePattern.MatchNode : IMatchNode<IMethodDescriptor>, IMatchNode, IEquatable<MethodReferencePattern.MatchNode>
Inheritance
MethodReferencePattern.MatchNode
Implements
Inherited Members

Constructors

MatchNode(Pattern<IMethodDescriptor>, IMethodDescriptor, IMatchNode<bool>, IMatchNode<TypeSignature>, IMatchNode<ITypeDefOrRef?>, IMatchNode<string?>, IMatchNode<IReadOnlyList<TypeSignature>>, IMatchNode<IReadOnlyList<TypeSignature>>)

Represents a match node produced by a MethodReferencePattern.

public MatchNode(Pattern<IMethodDescriptor> Pattern, IMethodDescriptor ConcreteValue, IMatchNode<bool> HasThis, IMatchNode<TypeSignature> ReturnType, IMatchNode<ITypeDefOrRef?> DeclaringType, IMatchNode<string?> Name, IMatchNode<IReadOnlyList<TypeSignature>> TypeArguments, IMatchNode<IReadOnlyList<TypeSignature>> ParameterTypes)

Parameters

Pattern Pattern<IMethodDescriptor>
ConcreteValue IMethodDescriptor
HasThis IMatchNode<bool>
ReturnType IMatchNode<TypeSignature>
DeclaringType IMatchNode<ITypeDefOrRef>
Name IMatchNode<string>
TypeArguments IMatchNode<IReadOnlyList<TypeSignature>>
ParameterTypes IMatchNode<IReadOnlyList<TypeSignature>>

Properties

ConcreteValue

Gets the value that matched the pattern.

public IMethodDescriptor ConcreteValue { get; init; }

Property Value

IMethodDescriptor

DeclaringType

public IMatchNode<ITypeDefOrRef?> DeclaringType { get; init; }

Property Value

IMatchNode<ITypeDefOrRef>

HasThis

public IMatchNode<bool> HasThis { get; init; }

Property Value

IMatchNode<bool>

Name

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

Property Value

IMatchNode<string>

ParameterTypes

public IMatchNode<IReadOnlyList<TypeSignature>> ParameterTypes { get; init; }

Property Value

IMatchNode<IReadOnlyList<TypeSignature>>

Pattern

Gets the pattern that was matched.

public Pattern<IMethodDescriptor> Pattern { get; init; }

Property Value

Pattern<IMethodDescriptor>

ReturnType

public IMatchNode<TypeSignature> ReturnType { get; init; }

Property Value

IMatchNode<TypeSignature>

TypeArguments

public IMatchNode<IReadOnlyList<TypeSignature>> TypeArguments { get; init; }

Property Value

IMatchNode<IReadOnlyList<TypeSignature>>

Methods

Deconstruct(out Pattern<IMethodDescriptor>, out IMethodDescriptor, out IMatchNode<bool>, out IMatchNode<TypeSignature>, out IMatchNode<ITypeDefOrRef?>, out IMatchNode<string?>, out IMatchNode<IReadOnlyList<TypeSignature>>, out IMatchNode<IReadOnlyList<TypeSignature>>)

public void Deconstruct(out Pattern<IMethodDescriptor> Pattern, out IMethodDescriptor ConcreteValue, out IMatchNode<bool> HasThis, out IMatchNode<TypeSignature> ReturnType, out IMatchNode<ITypeDefOrRef?> DeclaringType, out IMatchNode<string?> Name, out IMatchNode<IReadOnlyList<TypeSignature>> TypeArguments, out IMatchNode<IReadOnlyList<TypeSignature>> ParameterTypes)

Parameters

Pattern Pattern<IMethodDescriptor>
ConcreteValue IMethodDescriptor
HasThis IMatchNode<bool>
ReturnType IMatchNode<TypeSignature>
DeclaringType IMatchNode<ITypeDefOrRef>
Name IMatchNode<string>
TypeArguments IMatchNode<IReadOnlyList<TypeSignature>>
ParameterTypes IMatchNode<IReadOnlyList<TypeSignature>>

Equals(MatchNode?)

public bool Equals(MethodReferencePattern.MatchNode? other)

Parameters

other MethodReferencePattern.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 ==(MethodReferencePattern.MatchNode? left, MethodReferencePattern.MatchNode? right)

Parameters

left MethodReferencePattern.MatchNode
right MethodReferencePattern.MatchNode

Returns

bool

operator !=(MatchNode?, MatchNode?)

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

Parameters

left MethodReferencePattern.MatchNode
right MethodReferencePattern.MatchNode

Returns

bool