1 
2 /* Compiler implementation of the D programming language
3  * Copyright (C) 1999-2019 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/nspace.h
9  */
10 
11 #pragma once
12 
13 #include "dsymbol.h"
14 
15 /* A namespace corresponding to a C++ namespace.
16  * Implies extern(C++).
17  */
18 
19 class Nspace : public ScopeDsymbol
20 {
21   public:
22     bool mangleOnly;
23     Nspace(Loc loc, Identifier *ident, Dsymbols *members, bool mangleOnly);
24 
25     Dsymbol *syntaxCopy(Dsymbol *s);
26     void addMember(Scope *sc, ScopeDsymbol *sds);
27     void setScope(Scope *sc);
28     void semantic(Scope *sc);
29     void semantic2(Scope *sc);
30     void semantic3(Scope *sc);
31     bool oneMember(Dsymbol **ps, Identifier *ident);
32     Dsymbol *search(const Loc &loc, Identifier *ident, int flags = SearchLocalsOnly);
33     int apply(Dsymbol_apply_ft_t fp, void *param);
34     bool hasPointers();
35     void setFieldOffset(AggregateDeclaration *ad, unsigned *poffset, bool isunion);
36     const char *kind() const;
isNspace()37     Nspace *isNspace() { return this; }
accept(Visitor * v)38     void accept(Visitor *v) { v->visit(this); }
39 };
40