[ctypes-commit] ctypes/sandbox/tools/codegen gccxmlparser.py,1.14,1.15
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2005-01-21 10:33:33
|
Update of /cvsroot/ctypes/ctypes/sandbox/tools/codegen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6791 Modified Files: gccxmlparser.py Log Message: Handle the CPP_DUMP element. Index: gccxmlparser.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/sandbox/tools/codegen/gccxmlparser.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** gccxmlparser.py 19 Jan 2005 08:30:29 -0000 1.14 --- gccxmlparser.py 21 Jan 2005 10:33:25 -0000 1.15 *************** *** 20,23 **** --- 20,24 ---- self.all = {} self.artificial = [] + self.cpp_data = {} def demangle(self, name): *************** *** 52,59 **** --- 53,62 ---- self.context.append(result) + cdata = None def endElement(self, name): # if this element has children, pop the context if name in self.has_values: self.context.pop() + self.cdata = None ################################ *************** *** 73,76 **** --- 76,90 ---- # real element handlers + def CPP_DUMP(self, attrs): + name = attrs["name"] + # Insert a new list for each named section into self.cpp_data, + # and point self.cdata to it. self.cdata will be set to None + # again at the end of each section. + self.cpp_data[name] = self.cdata = [] + + def characters(self, content): + if self.cdata is not None: + self.cdata.append(content) + def File(self, attrs): name = attrs["name"] *************** *** 311,314 **** --- 325,333 ---- if isinstance(i, interesting): result.append(i) + + # todo: get cpp_data, and convert it into typedesc nodes. + # functions = self.cpp_data.get("functions") + # aliases = self.cpp_data.get("aliases") + return result |