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)
5
using System.Collections.Generic;
7
using ICSharpCode.NRefactory.TypeSystem;
9
namespace ICSharpCode.NRefactory.VB.Ast
19
public class TypeDeclaration : AttributedNode
21
public readonly static Role<AttributedNode> MemberRole = new Role<AttributedNode>("Member");
22
public readonly static Role<AstType> InheritsTypeRole = new Role<AstType>("InheritsType", AstType.Null);
23
public readonly static Role<AstType> ImplementsTypesRole = new Role<AstType>("ImplementsTypes", AstType.Null);
25
public AstNodeCollection<AttributedNode> Members {
26
get { return base.GetChildrenByRole(MemberRole); }
29
public ClassType ClassType { get; set; }
31
public Identifier Name {
32
get { return GetChildByRole(Roles.Identifier); }
33
set { SetChildByRole(Roles.Identifier, value); }
36
public AstNodeCollection<TypeParameterDeclaration> TypeParameters {
37
get { return GetChildrenByRole(Roles.TypeParameter); }
40
public AstType InheritsType {
41
get { return GetChildByRole(InheritsTypeRole); }
42
set { SetChildByRole(InheritsTypeRole, value); }
45
public AstNodeCollection<AstType> ImplementsTypes {
46
get { return GetChildrenByRole(ImplementsTypesRole); }
49
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
51
TypeDeclaration t = other as TypeDeclaration;
53
MatchAttributesAndModifiers(t, match) &&
54
Members.DoMatch(t.Members, match) &&
55
ClassType == t.ClassType &&
56
Name.DoMatch(t.Name, match) &&
57
TypeParameters.DoMatch(t.TypeParameters, match) &&
58
InheritsType.DoMatch(t.InheritsType, match) &&
59
ImplementsTypes.DoMatch(t.ImplementsTypes, match);
62
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
64
return visitor.VisitTypeDeclaration(this, data);