CPPNamespaceDeclaration

A node to represent an extern(C++) namespace attribute

There are two ways to declarate a symbol as member of a namespace: Nspace and CPPNamespaceDeclaration. The former creates a scope for the symbol, and inject them in the parent scope at the same time. The later, this class, has no semantic implications and is only used for mangling. Additionally, this class allows one to use reserved identifiers (D keywords) in the namespace.

A CPPNamespaceDeclaration can be created from an Identifier (already resolved) or from an Expression, which is CTFE-ed and can be either a TupleExp, in which can additional CPPNamespaceDeclaration nodes are created, or a StringExp.

Note that this class, like Nspace, matches only one identifier part of a namespace. For the namespace "foo::bar", the will be a CPPNamespaceDeclaration with its ident set to "bar", and its namespace field pointing to another CPPNamespaceDeclaration with its ident set to "foo".

extern (C++) final
class CPPNamespaceDeclaration : AttribDeclaration {}

Members

Functions

newScope
Scope* newScope(Scope* sc)

Variables

exp
Expression exp;

CTFE-able expression, resolving to TupleExp or StringExp

Inherited Members

From AttribDeclaration

decl
Dsymbols* decl;

Dsymbol's affected by this AttribDeclaration

createNewScope
Scope* createNewScope(Scope* sc, StorageClass stc, LINK linkage, CPPMANGLE cppmangle, Visibility visibility, int explicitVisibility, AlignDeclaration aligndecl, PragmaDeclaration inlining)

Create a new scope if one or more given attributes are different from the sc's. If the returned scope != sc, the caller should pop the scope after it used.

newScope
Scope* newScope(Scope* sc)

A hook point to supply scope for members. addMember, setScope, importAll, semantic, semantic2 and semantic3 will use this.

addObjcSymbols
void addObjcSymbols(ClassDeclarations* classes, ClassDeclarations* categories)

Meta