Mercurial > projects > ldc
comparison dmd2/import.h @ 758:f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Tue, 11 Nov 2008 01:38:48 +0100 |
parents | |
children | 54b3c1394d62 |
comparison
equal
deleted
inserted
replaced
757:2c730d530c98 | 758:f04dde6e882c |
---|---|
1 | |
2 // Compiler implementation of the D programming language | |
3 // Copyright (c) 1999-2007 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_IMPORT_H | |
12 #define DMD_IMPORT_H | |
13 | |
14 #ifdef __DMC__ | |
15 #pragma once | |
16 #endif /* __DMC__ */ | |
17 | |
18 #include "dsymbol.h" | |
19 | |
20 | |
21 struct Identifier; | |
22 struct Scope; | |
23 struct OutBuffer; | |
24 struct Module; | |
25 struct Package; | |
26 struct AliasDeclaration; | |
27 #ifdef _DH | |
28 struct HdrGenState; | |
29 #endif | |
30 | |
31 struct Import : Dsymbol | |
32 { | |
33 Array *packages; // array of Identifier's representing packages | |
34 Identifier *id; // module Identifier | |
35 Identifier *aliasId; | |
36 int isstatic; // !=0 if static import | |
37 enum PROT protection; | |
38 | |
39 // Pairs of alias=name to bind into current namespace | |
40 Array names; | |
41 Array aliases; | |
42 | |
43 Array aliasdecls; // AliasDeclarations for names/aliases | |
44 | |
45 Module *mod; | |
46 Package *pkg; // leftmost package/module | |
47 | |
48 Import(Loc loc, Array *packages, Identifier *id, Identifier *aliasId, | |
49 int isstatic); | |
50 void addAlias(Identifier *name, Identifier *alias); | |
51 | |
52 const char *kind(); | |
53 enum PROT prot(); | |
54 Dsymbol *syntaxCopy(Dsymbol *s); // copy only syntax trees | |
55 void load(Scope *sc); | |
56 void semantic(Scope *sc); | |
57 void semantic2(Scope *sc); | |
58 Dsymbol *toAlias(); | |
59 int addMember(Scope *sc, ScopeDsymbol *s, int memnum); | |
60 Dsymbol *search(Loc loc, Identifier *ident, int flags); | |
61 int overloadInsert(Dsymbol *s); | |
62 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
63 | |
64 Import *isImport() { return this; } | |
65 }; | |
66 | |
67 #endif /* DMD_IMPORT_H */ |