The expression "x in dict" is now a maybe type
[delight/core.git] / dmd / import.h
blob464708f8e8718b3400ea51fafdaae361433aa1d8
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.
11 #ifndef DMD_IMPORT_H
12 #define DMD_IMPORT_H
14 #ifdef __DMC__
15 #pragma once
16 #endif /* __DMC__ */
18 #include "dsymbol.h"
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
31 struct Import : Dsymbol
33 Array *packages; // array of Identifier's representing packages
34 Identifier *id; // module Identifier
35 Identifier *aliasId;
36 int isstatic; // !=0 if static import
38 // Pairs of alias=name to bind into current namespace
39 Array names;
40 Array aliases;
42 Array aliasdecls; // AliasDeclarations for names/aliases
44 Module *mod;
45 Package *pkg; // leftmost package/module
47 Import(Loc loc, Array *packages, Identifier *id, Identifier *aliasId,
48 int isstatic);
49 void addAlias(Identifier *name, Identifier *alias);
51 char *kind();
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);
62 Import *isImport() { return this; }
65 #endif /* DMD_IMPORT_H */