Class LocalsPattern
Defines the pattern matching the locals within a CIL method body.
[GenerateKeyedMatchNode]
public record LocalsPattern : Pattern<CilMethodBody?>, IEquatable<Pattern>, IEquatable<Pattern<CilMethodBody?>>, IEquatable<LocalsPattern>
- Inheritance
-
LocalsPattern
- Implements
- Inherited Members
Constructors
LocalsPattern(LocalsPattern)
protected LocalsPattern(LocalsPattern original)
Parameters
originalLocalsPattern
LocalsPattern(Pattern<bool>, Pattern<IList<CilLocalVariable>>)
Defines the pattern matching the locals within a CIL method body.
public LocalsPattern(Pattern<bool> InitializeLocals, Pattern<IList<CilLocalVariable>> Locals)
Parameters
InitializeLocalsPattern<bool>The pattern describing the init locals flag.
LocalsPattern<IList<CilLocalVariable>>The pattern describing the defined locals in the body.
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
InitializeLocals
The pattern describing the init locals flag.
public Pattern<bool> InitializeLocals { get; init; }
Property Value
Locals
The pattern describing the defined locals in the body.
public Pattern<IList<CilLocalVariable>> Locals { get; init; }
Property Value
Methods
Deconstruct(out Pattern<bool>, out Pattern<IList<CilLocalVariable>>)
public void Deconstruct(out Pattern<bool> InitializeLocals, out Pattern<IList<CilLocalVariable>> Locals)
Parameters
InitializeLocalsPattern<bool>LocalsPattern<IList<CilLocalVariable>>
Equals(LocalsPattern?)
public virtual bool Equals(LocalsPattern? other)
Parameters
otherLocalsPattern
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 ==(LocalsPattern?, LocalsPattern?)
public static bool operator ==(LocalsPattern? left, LocalsPattern? right)
Parameters
leftLocalsPatternrightLocalsPattern
Returns
operator !=(LocalsPattern?, LocalsPattern?)
public static bool operator !=(LocalsPattern? left, LocalsPattern? right)
Parameters
leftLocalsPatternrightLocalsPattern