|
|
|
@ -34,19 +34,17 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
@@ -34,19 +34,17 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
|
|
|
|
|
public class FunctionPointerAstType : AstType |
|
|
|
|
{ |
|
|
|
|
public static readonly TokenRole PointerRole = new TokenRole("*"); |
|
|
|
|
public static readonly Role<Identifier> CallingConventionRole = new Role<Identifier>("Target", Identifier.Null); |
|
|
|
|
public static readonly Role<AstType> CallingConventionRole = new Role<AstType>("CallConv", AstType.Null); |
|
|
|
|
|
|
|
|
|
public string CallingConvention { |
|
|
|
|
public AstType CallingConvention { |
|
|
|
|
get { |
|
|
|
|
return GetChildByRole(CallingConventionRole).Name; |
|
|
|
|
return GetChildByRole(CallingConventionRole); |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
SetChildByRole(CallingConventionRole, Identifier.Create(value)); |
|
|
|
|
SetChildByRole(CallingConventionRole, value); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Identifier CallingConventionIdentifier => GetChildByRole(CallingConventionRole); |
|
|
|
|
|
|
|
|
|
public AstNodeCollection<ParameterDeclaration> Parameters { |
|
|
|
|
get { return GetChildrenByRole(Roles.Parameter); } |
|
|
|
|
} |
|
|
|
@ -73,7 +71,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
@@ -73,7 +71,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
|
|
|
|
|
|
|
|
|
|
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
|
|
|
|
{ |
|
|
|
|
return other is FunctionPointerAstType o && MatchString(this.CallingConvention, o.CallingConvention) |
|
|
|
|
return other is FunctionPointerAstType o |
|
|
|
|
&& this.CallingConvention.DoMatch(o.CallingConvention, match) |
|
|
|
|
&& this.Parameters.DoMatch(o.Parameters, match) |
|
|
|
|
&& this.ReturnType.DoMatch(o.ReturnType, match); |
|
|
|
|
} |
|
|
|
|