#pragma once class EnumMember { std::string name; std::string value; int sourceIndex; public: EnumMember( const std::string &name, const std::string &value, int sourceIndex ) : name( name ) , value( value ) , sourceIndex( sourceIndex ) { } const std::string &GetName() const { return name; } const std::string &GetValueStr() const { return value; } int GetSourceIndex() const { return sourceIndex; } }; class EnumInfo : public Symbol { BOOL bConst; std::vector members; public: EnumInfo( const NamespaceScopes &namespaceScopes, const std::string &name ) : Symbol( namespaceScopes, name ) { } const std::vector &GetMembers() const { return members; } const EnumMember &GetEnumMember( const std::string &memberName ) const { foreach( const EnumMember &member, members ) { if( member.GetName() == memberName ) { return member; } } throw; } std::vector &GetEnumMembers() { return members; } }; class EnumInfoCollection : public std::vector { public: const EnumInfo *Find( const Symbol &symbol ) const { const EnumInfoCollection &thisEnumInfoCollection = *this; foreach( const EnumInfo &enumInfo, thisEnumInfoCollection ) { if( enumInfo.IsEqualSymbol( symbol ) ) { return &enumInfo; } } return NULL; }; };