// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; using System.Collections.Generic; using System.Linq; namespace ICSharpCode.NRefactory.VB.Ast { public class EnumDeclaration : AttributedNode { public readonly static Role MemberRole = new Role("Member"); public readonly static Role UnderlyingTypeRole = new Role("UnderlyingType", AstType.Null); public Identifier Name { get { return GetChildByRole(Roles.Identifier); } set { SetChildByRole(Roles.Identifier, value); } } public AstType UnderlyingType { get { return GetChildByRole(UnderlyingTypeRole); } set { SetChildByRole(UnderlyingTypeRole, value); } } public AstNodeCollection Member { get { return GetChildrenByRole(MemberRole); } } protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match) { var decl = other as EnumDeclaration; return decl != null && MatchAttributesAndModifiers(decl, match) && Name.DoMatch(decl.Name, match) && UnderlyingType.DoMatch(decl.UnderlyingType, match) && Member.DoMatch(decl.Member, match); } public override S AcceptVisitor(IAstVisitor visitor, T data) { return visitor.VisitEnumDeclaration(this, data); } } }