1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
6
namespace ICSharpCode.NRefactory.VB.Ast
8
public class MethodDeclaration : MemberDeclaration
10
public MethodDeclaration()
14
public bool IsSub { get; set; }
16
public Identifier Name {
17
get { return GetChildByRole(Roles.Identifier); }
18
set { SetChildByRole(Roles.Identifier, value); }
21
public AstNodeCollection<TypeParameterDeclaration> TypeParameters {
22
get { return GetChildrenByRole(Roles.TypeParameter); }
25
public AstNodeCollection<ParameterDeclaration> Parameters {
26
get { return GetChildrenByRole(Roles.Parameter); }
29
public AstNodeCollection<AttributeBlock> ReturnTypeAttributes {
30
get { return GetChildrenByRole(AttributeBlock.ReturnTypeAttributeBlockRole); }
33
public AstType ReturnType {
34
get { return GetChildByRole(Roles.Type); }
35
set { SetChildByRole(Roles.Type, value); }
38
public AstNodeCollection<EventMemberSpecifier> HandlesClause {
39
get { return GetChildrenByRole(EventMemberSpecifier.EventMemberSpecifierRole); }
42
public AstNodeCollection<InterfaceMemberSpecifier> ImplementsClause {
43
get { return GetChildrenByRole(InterfaceMemberSpecifier.InterfaceMemberSpecifierRole); }
46
public BlockStatement Body {
47
get { return GetChildByRole(Roles.Body); }
48
set { SetChildByRole(Roles.Body, value); }
51
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
53
var method = other as MethodDeclaration;
54
return method != null &&
55
MatchAttributesAndModifiers(method, match) &&
56
IsSub == method.IsSub &&
57
Name.DoMatch(method.Name, match) &&
58
TypeParameters.DoMatch(method.TypeParameters, match) &&
59
Parameters.DoMatch(method.Parameters, match) &&
60
ReturnTypeAttributes.DoMatch(method.ReturnTypeAttributes, match) &&
61
ReturnType.DoMatch(method.ReturnType, match) &&
62
HandlesClause.DoMatch(method.HandlesClause, match) &&
63
ImplementsClause.DoMatch(method.ImplementsClause, match) &&
64
Body.DoMatch(method.Body, match);
67
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
69
return visitor.VisitMethodDeclaration(this, data);