1
|
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
|
|
38 // Pairs of alias=name to bind into current namespace
|
|
39 Array names;
|
|
40 Array aliases;
|
|
41
|
|
42 Array aliasdecls; // AliasDeclarations for names/aliases
|
|
43
|
|
44 Module *mod;
|
|
45 Package *pkg; // leftmost package/module
|
|
46
|
|
47 Import(Loc loc, Array *packages, Identifier *id, Identifier *aliasId,
|
|
48 int isstatic);
|
|
49 void addAlias(Identifier *name, Identifier *alias);
|
|
50
|
336
|
51 const char *kind();
|
1
|
52 Dsymbol *syntaxCopy(Dsymbol *s); // copy only syntax trees
|
|
53 void load(Scope *sc);
|
|
54 void semantic(Scope *sc);
|
|
55 void semantic2(Scope *sc);
|
|
56 Dsymbol *toAlias();
|
|
57 int addMember(Scope *sc, ScopeDsymbol *s, int memnum);
|
|
58 Dsymbol *search(Loc loc, Identifier *ident, int flags);
|
|
59 int overloadInsert(Dsymbol *s);
|
|
60 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
|
|
61
|
|
62 Import *isImport() { return this; }
|
|
63 };
|
|
64
|
|
65 #endif /* DMD_IMPORT_H */
|