Class FlatBodyPattern
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
originalFlatBodyPattern
FlatBodyPattern(Pattern<IList<CilInstruction>>)
Defines the pattern matching CIL method bodies as flat CIL instruction sequences.
public FlatBodyPattern(Pattern<IList<CilInstruction>> Instructions)
Parameters
InstructionsPattern<IList<CilInstruction>>The expected instruction sequence.
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Instructions
The expected instruction sequence.
public Pattern<IList<CilInstruction>> Instructions { get; init; }
Property Value
Methods
Deconstruct(out Pattern<IList<CilInstruction>>)
public void Deconstruct(out Pattern<IList<CilInstruction>> Instructions)
Parameters
InstructionsPattern<IList<CilInstruction>>
Equals(FlatBodyPattern?)
public virtual bool Equals(FlatBodyPattern? other)
Parameters
otherFlatBodyPattern
Returns
Equals(Pattern<CilMethodBody?>?)
public override sealed bool Equals(Pattern<CilMethodBody?>? other)
Parameters
otherPattern<CilMethodBody>
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(CilMethodBody?, MatchingContext)
Attempts to match the provided input to the pattern.
public override IMatchNode<CilMethodBody?>? Match(CilMethodBody? input, MatchingContext context)
Parameters
inputCilMethodBodyThe input to match.
contextMatchingContextThe 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
builderStringBuilder
Returns
Operators
operator ==(FlatBodyPattern?, FlatBodyPattern?)
public static bool operator ==(FlatBodyPattern? left, FlatBodyPattern? right)
Parameters
leftFlatBodyPatternrightFlatBodyPattern
Returns
operator !=(FlatBodyPattern?, FlatBodyPattern?)
public static bool operator !=(FlatBodyPattern? left, FlatBodyPattern? right)
Parameters
leftFlatBodyPatternrightFlatBodyPattern