Allow log_ statements outside of a class
[delight/core.git] / dmd / enum.h
blob6444c539ee299ea7dd4fa3a3649a0480d31805f3
2 // Compiler implementation of the D programming language
3 // Copyright (c) 1999-2006 by Digital Mars
4 // All Rights Reserved
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
17 #ifndef DMD_ENUM_H
18 #define DMD_ENUM_H
20 #ifdef __DMC__
21 #pragma once
22 #endif /* __DMC__ */
24 #include "root.h"
25 #include "dsymbol.h"
27 struct Identifier;
28 struct Type;
29 struct Expression;
30 #ifdef _DH
31 struct HdrGenState;
32 #endif
35 struct EnumDeclaration : ScopeDsymbol
37 Type *type; // the TypeEnum
38 Type *memtype; // type of the members
39 integer_t maxval;
40 integer_t minval;
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);
49 Type *getType();
50 char *kind();
52 void emitComment(Scope *sc);
53 void toDocBuffer(OutBuffer *buf);
55 EnumDeclaration *isEnumDeclaration() { return this; }
57 void toObjFile(int multiobj); // compile to .obj file
58 void toDebug();
59 int cvMember(unsigned char *p);
61 Symbol *sinit;
62 Symbol *toInitializer();
66 struct EnumMember : Dsymbol
68 Expression *value;
70 EnumMember(Loc loc, Identifier *id, Expression *value);
71 Dsymbol *syntaxCopy(Dsymbol *s);
72 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
73 char *kind();
75 void emitComment(Scope *sc);
76 void toDocBuffer(OutBuffer *buf);
78 EnumMember *isEnumMember() { return this; }
81 #endif /* DMD_ENUM_H */