Class CilInstructionPattern
Defines a pattern matching on individual CIL instructions.
[GenerateKeyedMatchNode]
public record CilInstructionPattern : Pattern<CilInstruction>, IEquatable<Pattern>, IEquatable<Pattern<CilInstruction>>, IEquatable<CilInstructionPattern>
- Inheritance
-
CilInstructionPattern
- Implements
- Inherited Members
Constructors
CilInstructionPattern(CilInstructionPattern)
protected CilInstructionPattern(CilInstructionPattern original)
Parameters
originalCilInstructionPattern
CilInstructionPattern(Pattern<CilOpCode>, Pattern<object?>)
Defines a pattern matching on individual CIL instructions.
public CilInstructionPattern(Pattern<CilOpCode> OpCode, Pattern<object?> Operand)
Parameters
OpCodePattern<CilOpCode>The pattern describing the opcode of the instruction.
OperandPattern<object>The pattern describing the operand of the instruction.
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
OpCode
The pattern describing the opcode of the instruction.
public Pattern<CilOpCode> OpCode { get; init; }
Property Value
Operand
The pattern describing the operand of the instruction.
public Pattern<object?> Operand { get; init; }
Property Value
Methods
Deconstruct(out Pattern<CilOpCode>, out Pattern<object?>)
public void Deconstruct(out Pattern<CilOpCode> OpCode, out Pattern<object?> Operand)
Parameters
Equals(CilInstructionPattern?)
public virtual bool Equals(CilInstructionPattern? other)
Parameters
otherCilInstructionPattern
Returns
Equals(Pattern<CilInstruction>?)
public override sealed bool Equals(Pattern<CilInstruction>? other)
Parameters
otherPattern<CilInstruction>
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
Format(IndentedTextWriter)
Serializes the pattern to a readable string.
public override void Format(IndentedTextWriter writer)
Parameters
writerIndentedTextWriterThe output stream.
GetHashCode()
public override int GetHashCode()
Returns
Match(CilInstruction, MatchingContext)
Attempts to match the provided input to the pattern.
public override IMatchNode<CilInstruction>? Match(CilInstruction input, MatchingContext context)
Parameters
inputCilInstructionThe input to match.
contextMatchingContextThe context in which to match the pattern to.
Returns
- IMatchNode<CilInstruction>
When successful, returns the root node of the match tree, otherwise
null.
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
Operators
operator ==(CilInstructionPattern?, CilInstructionPattern?)
public static bool operator ==(CilInstructionPattern? left, CilInstructionPattern? right)
Parameters
leftCilInstructionPatternrightCilInstructionPattern
Returns
operator !=(CilInstructionPattern?, CilInstructionPattern?)
public static bool operator !=(CilInstructionPattern? left, CilInstructionPattern? right)
Parameters
leftCilInstructionPatternrightCilInstructionPattern