2 // Compiler implementation of the D programming language
3 // Copyright (c) 1999-2006 by Digital Mars
5 // written by Walter Bright
6 // http://www.digitalmars.com
7 // License for redistribution is by either the Artistic License
8 // in artistic.txt, or the GNU General Public License in gnu.txt.
9 // See the included readme.txt for details.
11 /* NOTE: This file has been patched from the original DMD distribution to
12 work with the GDC compiler.
14 Modified by David Friedman, December 2006
35 struct EnumDeclaration
: ScopeDsymbol
37 Type
*type
; // the TypeEnum
38 Type
*memtype
; // type of the members
41 integer_t defaultval
; // default initializer
42 Expressions
* attributes
; // GCC decl/type attributes
44 EnumDeclaration(Loc loc
, Identifier
*id
, Type
*memtype
);
45 Dsymbol
*syntaxCopy(Dsymbol
*s
);
46 void semantic(Scope
*sc
);
47 int oneMember(Dsymbol
**ps
);
48 void toCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
);
52 void emitComment(Scope
*sc
);
53 void toDocBuffer(OutBuffer
*buf
);
55 EnumDeclaration
*isEnumDeclaration() { return this; }
57 void toObjFile(int multiobj
); // compile to .obj file
59 int cvMember(unsigned char *p
);
62 Symbol
*toInitializer();
66 struct EnumMember
: Dsymbol
70 EnumMember(Loc loc
, Identifier
*id
, Expression
*value
);
71 Dsymbol
*syntaxCopy(Dsymbol
*s
);
72 void toCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
);
75 void emitComment(Scope
*sc
);
76 void toDocBuffer(OutBuffer
*buf
);
78 EnumMember
*isEnumMember() { return this; }
81 #endif /* DMD_ENUM_H */