PR libstdc++/87308 adjust regex used in std::any pretty printer
[official-gcc.git] / gcc / d / dmd / import.h
blobdcaec5c7acbdbdfb60ae5ae981f680e7e6a4444f
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
9 */
11 #pragma once
13 #include "dsymbol.h"
15 class Identifier;
16 struct Scope;
17 class Module;
18 class Package;
19 class AliasDeclaration;
21 class Import : public Dsymbol
23 public:
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
29 Identifier *aliasId;
30 int isstatic; // !=0 if static import
31 Prot protection;
33 // Pairs of alias=name to bind into current namespace
34 Identifiers names;
35 Identifiers aliases;
37 Module *mod;
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,
43 int isstatic);
44 void addAlias(Identifier *name, Identifier *alias);
45 const char *kind() const;
46 Prot prot();
47 Dsymbol *syntaxCopy(Dsymbol *s); // copy only syntax trees
48 void load(Scope *sc);
49 void importAll(Scope *sc);
50 void semantic(Scope *sc);
51 void semantic2(Scope *sc);
52 Dsymbol *toAlias();
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); }