From 9ae0a98efee1671cb9824d9181800fb77c51a56c Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Tue, 19 May 2009 03:19:37 -0700 Subject: [PATCH] CppClassNode --- Cython/Compiler/Nodes.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 -- 2.26.2