Class PatternExtensions
- Namespace
- ICSharpCode.Decompiler.CSharp.Syntax.PatternMatching
- Assembly
- ICSharpCode.Decompiler.dll
public static class PatternExtensions
- Inheritance
-
PatternExtensions
- Inherited Members
Methods
IsMatch(INode, INode)
public static bool IsMatch(this INode pattern, INode other)
Parameters
Returns
Match(INode, INode)
Performs a pattern matching operation.
this
is the pattern, other
is the AST that is being matched.
public static Match Match(this INode pattern, INode other)
Parameters
Returns
Remarks
Patterns are ASTs that contain special pattern nodes (from the PatternMatching namespace). However, it is also possible to match two ASTs without any pattern nodes - doing so will produce a successful match if the two ASTs are structurally identical.
ToExpression(Pattern)
public static Expression ToExpression(this Pattern pattern)
Parameters
pattern
Pattern
Returns
ToStatement(Pattern)
public static Statement ToStatement(this Pattern pattern)
Parameters
pattern
Pattern
Returns
ToType(Pattern)
public static AstType ToType(this Pattern pattern)
Parameters
pattern
Pattern
Returns
WithName(Expression, string)
public static Expression WithName(this Expression node, string patternGroupName)
Parameters
node
ExpressionpatternGroupName
string
Returns
WithName(Statement, string)
public static Statement WithName(this Statement node, string patternGroupName)