Mercurial > projects > ldc
comparison dmd/enum.h @ 336:aaade6ded589 trunk
[svn r357] Merged DMD 1.033
author | lindquist |
---|---|
date | Sat, 12 Jul 2008 19:38:31 +0200 |
parents | c53b6e3fe49a |
children | 1860414bf3b7 |
comparison
equal
deleted
inserted
replaced
335:17b844102023 | 336:aaade6ded589 |
---|---|
1 | 1 |
2 // Compiler implementation of the D programming language | 2 // Compiler implementation of the D programming language |
3 // Copyright (c) 1999-2006 by Digital Mars | 3 // Copyright (c) 1999-2008 by Digital Mars |
4 // All Rights Reserved | 4 // All Rights Reserved |
5 // written by Walter Bright | 5 // written by Walter Bright |
6 // http://www.digitalmars.com | 6 // http://www.digitalmars.com |
7 // License for redistribution is by either the Artistic License | 7 // License for redistribution is by either the Artistic License |
8 // in artistic.txt, or the GNU General Public License in gnu.txt. | 8 // in artistic.txt, or the GNU General Public License in gnu.txt. |
28 | 28 |
29 struct EnumDeclaration : ScopeDsymbol | 29 struct EnumDeclaration : ScopeDsymbol |
30 { | 30 { |
31 Type *type; // the TypeEnum | 31 Type *type; // the TypeEnum |
32 Type *memtype; // type of the members | 32 Type *memtype; // type of the members |
33 | |
34 #if DMDV1 | |
33 integer_t maxval; | 35 integer_t maxval; |
34 integer_t minval; | 36 integer_t minval; |
35 integer_t defaultval; // default initializer | 37 integer_t defaultval; // default initializer |
38 #else | |
39 Expression *maxval; | |
40 Expression *minval; | |
41 Expression *defaultval; // default initializer | |
42 | |
43 Scope *scope; // !=NULL means context to use | |
44 #endif | |
45 int isdeprecated; | |
36 | 46 |
37 EnumDeclaration(Loc loc, Identifier *id, Type *memtype); | 47 EnumDeclaration(Loc loc, Identifier *id, Type *memtype); |
38 Dsymbol *syntaxCopy(Dsymbol *s); | 48 Dsymbol *syntaxCopy(Dsymbol *s); |
39 void semantic(Scope *sc); | 49 void semantic(Scope *sc); |
40 int oneMember(Dsymbol **ps); | 50 int oneMember(Dsymbol **ps); |
41 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | 51 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); |
42 Type *getType(); | 52 Type *getType(); |
43 char *kind(); | 53 const char *kind(); |
54 #if DMDV2 | |
55 Dsymbol *search(Loc, Identifier *ident, int flags); | |
56 #endif | |
57 int isDeprecated(); // is Dsymbol deprecated? | |
44 | 58 |
45 void emitComment(Scope *sc); | 59 void emitComment(Scope *sc); |
46 void toDocBuffer(OutBuffer *buf); | 60 void toDocBuffer(OutBuffer *buf); |
47 | 61 |
48 EnumDeclaration *isEnumDeclaration() { return this; } | 62 EnumDeclaration *isEnumDeclaration() { return this; } |
49 | 63 |
50 void toObjFile(); // compile to .obj file | 64 void toObjFile(int multiobj); // compile to .obj file |
51 void toDebug(); | 65 void toDebug(); |
52 int cvMember(unsigned char *p); | 66 int cvMember(unsigned char *p); |
53 | 67 |
54 Symbol *sinit; | 68 Symbol *sinit; |
55 Symbol *toInitializer(); | 69 Symbol *toInitializer(); |
61 Expression *value; | 75 Expression *value; |
62 | 76 |
63 EnumMember(Loc loc, Identifier *id, Expression *value); | 77 EnumMember(Loc loc, Identifier *id, Expression *value); |
64 Dsymbol *syntaxCopy(Dsymbol *s); | 78 Dsymbol *syntaxCopy(Dsymbol *s); |
65 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | 79 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); |
66 char *kind(); | 80 const char *kind(); |
67 | 81 |
68 void emitComment(Scope *sc); | 82 void emitComment(Scope *sc); |
69 void toDocBuffer(OutBuffer *buf); | 83 void toDocBuffer(OutBuffer *buf); |
70 | 84 |
71 EnumMember *isEnumMember() { return this; } | 85 EnumMember *isEnumMember() { return this; } |