|
|
|
@ -45,6 +45,52 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
@@ -45,6 +45,52 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
|
|
|
|
|
public static readonly TokenRole ThisModifierRole = new TokenRole("this"); |
|
|
|
|
public static readonly TokenRole InModifierRole = new TokenRole("in"); |
|
|
|
|
|
|
|
|
|
#region PatternPlaceholder
|
|
|
|
|
public static implicit operator ParameterDeclaration(PatternMatching.Pattern pattern) |
|
|
|
|
{ |
|
|
|
|
return pattern != null ? new PatternPlaceholder(pattern) : null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sealed class PatternPlaceholder : ParameterDeclaration, PatternMatching.INode |
|
|
|
|
{ |
|
|
|
|
readonly PatternMatching.Pattern child; |
|
|
|
|
|
|
|
|
|
public PatternPlaceholder(PatternMatching.Pattern child) |
|
|
|
|
{ |
|
|
|
|
this.child = child; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override NodeType NodeType { |
|
|
|
|
get { return NodeType.Pattern; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void AcceptVisitor(IAstVisitor visitor) |
|
|
|
|
{ |
|
|
|
|
visitor.VisitPatternPlaceholder(this, child); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override T AcceptVisitor<T>(IAstVisitor<T> visitor) |
|
|
|
|
{ |
|
|
|
|
return visitor.VisitPatternPlaceholder(this, child); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data) |
|
|
|
|
{ |
|
|
|
|
return visitor.VisitPatternPlaceholder(this, child, data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
|
|
|
|
{ |
|
|
|
|
return child.DoMatch(other, match); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool PatternMatching.INode.DoMatchCollection(Role role, PatternMatching.INode pos, PatternMatching.Match match, PatternMatching.BacktrackingInfo backtrackingInfo) |
|
|
|
|
{ |
|
|
|
|
return child.DoMatchCollection(role, pos, match, backtrackingInfo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
public override NodeType NodeType { |
|
|
|
|
get { |
|
|
|
|
return NodeType.Unknown; |
|
|
|
|