d: Merge dmd, druntime d8e3976a58, phobos 7a6e95688
[official-gcc.git] / gcc / d / dmd / import.h
blobbfbb5510134beeb74bb130ce30dadd8ac58f270a
2 /* Compiler implementation of the D programming language
3 * Copyright (C) 1999-2024 by The D Language Foundation, All Rights Reserved
4 * written by Walter Bright
5 * https://www.digitalmars.com
6 * Distributed under the Boost Software License, Version 1.0.
7 * https://www.boost.org/LICENSE_1_0.txt
8 * https://github.com/dlang/dmd/blob/master/src/dmd/import.h
9 */
11 #pragma once
13 #include "dsymbol.h"
15 class Identifier;
16 struct Scope;
17 class Module;
18 class Package;
20 class Import final : public Dsymbol
22 public:
23 /* static import aliasId = pkg1.pkg2.id : alias1 = name1, alias2 = name2;
26 DArray<Identifier*> packages; // array of Identifier's representing packages
27 Identifier *id; // module Identifier
28 Identifier *aliasId;
29 int isstatic; // !=0 if static import
30 Visibility visibility;
32 // Pairs of alias=name to bind into current namespace
33 Identifiers names;
34 Identifiers aliases;
36 Module *mod;
37 Package *pkg; // leftmost package/module
39 AliasDeclarations aliasdecls; // corresponding AliasDeclarations for alias=name pairs
41 const char *kind() const override;
42 Visibility visible() override;
43 Import *syntaxCopy(Dsymbol *s) override; // copy only syntax trees
44 Dsymbol *toAlias() override;
45 bool overloadInsert(Dsymbol *s) override;
47 Import *isImport() override { return this; }
48 void accept(Visitor *v) override { v->visit(this); }