From: Robert Bradshaw Date: Tue, 19 May 2009 10:19:37 +0000 (-0700) Subject: CppClassNode X-Git-Tag: 0.13.beta0~353^2~93 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=9ae0a98efee1671cb9824d9181800fb77c51a56c;p=cython.git CppClassNode --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 4e1c8606..9ea65569 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -910,6 +910,28 @@ class CStructOrUnionDefNode(StatNode): pass +class CppClassNode(CStructOrUnionDefNode): + + # name string + # cname string or None + # visibility "public" or "private" + # in_pxd boolean + # attributes [CVarDefNode] or None + # entry Entry + + def analyse_declarations(self, env): + scope = None + if self.attributes is not None: + scope = StructOrUnionScope(self.name) # for now + self.entry = env.declare_struct_or_union( + self.name, "struct", scope, 0, self.pos, + self.cname, visibility = self.visibility) + if self.attributes is not None: + if self.in_pxd and not env.in_cinclude: + self.entry.defined_in_pxd = 1 + for attr in self.attributes: + attr.analyse_declarations(env, scope) + class CEnumDefNode(StatNode): # name string or None # cname string or None