Class BlocksBodyPattern
Defines the pattern matching CIL method bodies based on blocks of CIL instruction sequences.
public record BlocksBodyPattern : Pattern<CilMethodBody?>, IEquatable<Pattern>, IEquatable<Pattern<CilMethodBody?>>, IEquatable<BlocksBodyPattern>
- Inheritance
-
BlocksBodyPattern
- Implements
- Inherited Members
Constructors
BlocksBodyPattern(BlocksBodyPattern)
protected BlocksBodyPattern(BlocksBodyPattern original)
Parameters
originalBlocksBodyPattern
BlocksBodyPattern(IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>>, BlockExpression?)
Defines the pattern matching CIL method bodies based on blocks of CIL instruction sequences.
public BlocksBodyPattern(IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>> Blocks, BlockExpression? Condition = null)
Parameters
BlocksIReadOnlyDictionary<string, Pattern<IList<CilInstruction>>>The expected instruction blocks to find.
ConditionBlockExpressionThe expression describing which blocks should match and in what combination. When left as
null, all block patterns are considered.
Properties
Blocks
The expected instruction blocks to find.
public IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>> Blocks { get; init; }
Property Value
Condition
The expression describing which blocks should match and in what combination. When left as null, all
block patterns are considered.
public BlockExpression? Condition { get; init; }
Property Value
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Methods
Deconstruct(out IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>>, out BlockExpression?)
public void Deconstruct(out IReadOnlyDictionary<string, Pattern<IList<CilInstruction>>> Blocks, out BlockExpression? Condition)
Parameters
BlocksIReadOnlyDictionary<string, Pattern<IList<CilInstruction>>>ConditionBlockExpression
Equals(BlocksBodyPattern?)
public virtual bool Equals(BlocksBodyPattern? other)
Parameters
otherBlocksBodyPattern
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 ==(BlocksBodyPattern?, BlocksBodyPattern?)
public static bool operator ==(BlocksBodyPattern? left, BlocksBodyPattern? right)
Parameters
leftBlocksBodyPatternrightBlocksBodyPattern
Returns
operator !=(BlocksBodyPattern?, BlocksBodyPattern?)
public static bool operator !=(BlocksBodyPattern? left, BlocksBodyPattern? right)
Parameters
leftBlocksBodyPatternrightBlocksBodyPattern