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".

Constructors

this
this(Identifier ident, Dsymbols* decl)
Undocumented in source.
this
this(Expression exp, Dsymbols* decl)
Undocumented in source.
this
this(Identifier ident, Expression exp, Dsymbols* decl, CPPNamespaceDeclaration parent)
Undocumented in source.

Members

Functions

accept
void accept(Visitor v)
Undocumented in source. Be warned that the author may not have intended to support it.
isCPPNamespaceDeclaration
inout(CPPNamespaceDeclaration) isCPPNamespaceDeclaration()
Undocumented in source. Be warned that the author may not have intended to support it.
newScope
Scope* newScope(Scope* sc)
syntaxCopy
Dsymbol syntaxCopy(Dsymbol s)
Undocumented in source. Be warned that the author may not have intended to support it.
toChars
const(char)* toChars()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
const(char)[] toString()
Undocumented in source. Be warned that the author may not have intended to support it.

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

include
Dsymbols* include(Scope* sc)
Undocumented in source. Be warned that the author may not have intended to support it.
createNewScope
Scope* createNewScope(Scope* sc, StorageClass stc, LINK linkage, CPPMANGLE cppmangle, Prot protection, int explicitProtection, AlignDeclaration aligndecl, PINLINE 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.

addMember
void addMember(Scope* sc, ScopeDsymbol sds)
Undocumented in source. Be warned that the author may not have intended to support it.
setScope
void setScope(Scope* sc)
Undocumented in source. Be warned that the author may not have intended to support it.
importAll
void importAll(Scope* sc)
Undocumented in source. Be warned that the author may not have intended to support it.
addComment
void addComment(const(char)* comment)
Undocumented in source. Be warned that the author may not have intended to support it.
kind
const(char)* kind()
Undocumented in source. Be warned that the author may not have intended to support it.
oneMember
bool oneMember(Dsymbol* ps, Identifier ident)
Undocumented in source. Be warned that the author may not have intended to support it.
setFieldOffset
void setFieldOffset(AggregateDeclaration ad, uint* poffset, bool isunion)
Undocumented in source. Be warned that the author may not have intended to support it.
hasPointers
bool hasPointers()
Undocumented in source. Be warned that the author may not have intended to support it.
hasStaticCtorOrDtor
bool hasStaticCtorOrDtor()
Undocumented in source. Be warned that the author may not have intended to support it.
checkCtorConstInit
void checkCtorConstInit()
Undocumented in source. Be warned that the author may not have intended to support it.
addLocalClass
void addLocalClass(ClassDeclarations* aclasses)
addObjcSymbols
void addObjcSymbols(ClassDeclarations* classes, ClassDeclarations* categories)
Undocumented in source. Be warned that the author may not have intended to support it.
isAttribDeclaration
inout(AttribDeclaration) isAttribDeclaration()
Undocumented in source. Be warned that the author may not have intended to support it.
accept
void accept(Visitor v)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta