2 /* Compiler implementation of the D programming language
3 * Copyright (C) 1999-2018 by The D Language Foundation, All Rights Reserved
4 * written by Walter Bright
5 * http://www.digitalmars.com
6 * Distributed under the Boost Software License, Version 1.0.
7 * http://www.boost.org/LICENSE_1_0.txt
8 * https://github.com/dlang/dmd/blob/master/src/dmd/import.h
19 class AliasDeclaration
;
21 class Import
: public Dsymbol
24 /* static import aliasId = pkg1.pkg2.id : alias1 = name1, alias2 = name2;
27 Identifiers
*packages
; // array of Identifier's representing packages
28 Identifier
*id
; // module Identifier
30 int isstatic
; // !=0 if static import
33 // Pairs of alias=name to bind into current namespace
38 Package
*pkg
; // leftmost package/module
40 AliasDeclarations aliasdecls
; // corresponding AliasDeclarations for alias=name pairs
42 Import(Loc loc
, Identifiers
*packages
, Identifier
*id
, Identifier
*aliasId
,
44 void addAlias(Identifier
*name
, Identifier
*alias
);
45 const char *kind() const;
47 Dsymbol
*syntaxCopy(Dsymbol
*s
); // copy only syntax trees
49 void importAll(Scope
*sc
);
50 void semantic(Scope
*sc
);
51 void semantic2(Scope
*sc
);
53 void addMember(Scope
*sc
, ScopeDsymbol
*sds
);
54 void setScope(Scope
* sc
);
55 Dsymbol
*search(const Loc
&loc
, Identifier
*ident
, int flags
= SearchLocalsOnly
);
56 bool overloadInsert(Dsymbol
*s
);
58 Import
*isImport() { return this; }
59 void accept(Visitor
*v
) { v
->visit(this); }