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
36 { /* enum ident : memtype { ... }
38 Type
*type
; // the TypeEnum
39 Type
*memtype
; // type of the members
43 Expression
*defaultval
; // default initializer
45 Scope
*scope
; // !=NULL means context to use
46 Expressions
* attributes
; // GCC decl/type attributes
48 EnumDeclaration(Loc loc
, Identifier
*id
, Type
*memtype
);
49 Dsymbol
*syntaxCopy(Dsymbol
*s
);
50 void semantic(Scope
*sc
);
51 int oneMember(Dsymbol
**ps
);
52 void toCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
);
55 Dsymbol
*search(Loc
, Identifier
*ident
, int flags
);
57 void emitComment(Scope
*sc
);
58 void toDocBuffer(OutBuffer
*buf
);
60 EnumDeclaration
*isEnumDeclaration() { return this; }
62 void toObjFile(int multiobj
); // compile to .obj file
64 int cvMember(unsigned char *p
);
67 Symbol
*toInitializer();
71 struct EnumMember
: Dsymbol
76 EnumMember(Loc loc
, Identifier
*id
, Expression
*value
, Type
*type
);
77 Dsymbol
*syntaxCopy(Dsymbol
*s
);
78 void toCBuffer(OutBuffer
*buf
, HdrGenState
*hgs
);
81 void emitComment(Scope
*sc
);
82 void toDocBuffer(OutBuffer
*buf
);
84 EnumMember
*isEnumMember() { return this; }
87 #endif /* DMD_ENUM_H */