Mercurial > projects > ldc
annotate dmd/enum.h @ 1630:44b145be2ef5
Merge dmd 1.056.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Sat, 06 Feb 2010 15:53:52 +0000 |
parents | 6c36e3f49b28 |
children |
rev | line source |
---|---|
1587 | 1 |
2 // Compiler implementation of the D programming language | |
3 // Copyright (c) 1999-2008 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. | |
10 | |
11 #ifndef DMD_ENUM_H | |
12 #define DMD_ENUM_H | |
13 | |
14 #ifdef __DMC__ | |
15 #pragma once | |
16 #endif /* __DMC__ */ | |
17 | |
18 #include "root.h" | |
19 #include "dsymbol.h" | |
20 | |
21 struct Identifier; | |
22 struct Type; | |
23 struct Expression; | |
24 #ifdef _DH | |
25 struct HdrGenState; | |
26 #endif | |
27 | |
28 | |
29 struct EnumDeclaration : ScopeDsymbol | |
30 { /* enum ident : memtype { ... } | |
31 */ | |
32 Type *type; // the TypeEnum | |
33 Type *memtype; // type of the members | |
34 | |
35 #if DMDV1 | |
36 dinteger_t maxval; | |
37 dinteger_t minval; | |
38 dinteger_t defaultval; // default initializer | |
39 #else | |
40 Expression *maxval; | |
41 Expression *minval; | |
42 Expression *defaultval; // default initializer | |
43 #endif | |
44 int isdeprecated; | |
1628
6c36e3f49b28
Merge DMD r324: bugzilla 3663 and 3664 - fwd ref regressions
Leandro Lucarella <llucax@gmail.com>
parents:
1587
diff
changeset
|
45 int isdone; // 0: not done |
6c36e3f49b28
Merge DMD r324: bugzilla 3663 and 3664 - fwd ref regressions
Leandro Lucarella <llucax@gmail.com>
parents:
1587
diff
changeset
|
46 // 1: semantic() successfully completed |
1587 | 47 |
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); | |
53 Type *getType(); | |
54 const char *kind(); | |
55 #if DMDV2 | |
56 Dsymbol *search(Loc, Identifier *ident, int flags); | |
57 #endif | |
58 int isDeprecated(); // is Dsymbol deprecated? | |
59 | |
60 void emitComment(Scope *sc); | |
61 void toJsonBuffer(OutBuffer *buf); | |
62 void toDocBuffer(OutBuffer *buf); | |
63 | |
64 EnumDeclaration *isEnumDeclaration() { return this; } | |
65 | |
66 #if IN_DMD | |
67 void toObjFile(int multiobj); // compile to .obj file | |
68 void toDebug(); | |
69 int cvMember(unsigned char *p); | |
70 | |
71 Symbol *sinit; | |
72 Symbol *toInitializer(); | |
73 #endif | |
74 | |
75 #if IN_LLVM | |
76 void codegen(Ir*); | |
77 #endif | |
78 }; | |
79 | |
80 | |
81 struct EnumMember : Dsymbol | |
82 { | |
83 Expression *value; | |
84 | |
85 EnumMember(Loc loc, Identifier *id, Expression *value); | |
86 Dsymbol *syntaxCopy(Dsymbol *s); | |
87 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
88 const char *kind(); | |
89 | |
90 void emitComment(Scope *sc); | |
91 void toJsonBuffer(OutBuffer *buf); | |
92 void toDocBuffer(OutBuffer *buf); | |
93 | |
94 EnumMember *isEnumMember() { return this; } | |
95 }; | |
96 | |
97 #endif /* DMD_ENUM_H */ |