Update of /cvsroot/pygccxml/source/pyplusplus/experimental
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28440
Modified Files:
pypp_api.py
Log Message:
1) parse() now returns the top-level namespace. 2) writeModule() checks for missing policies and aborts if there are still some missing. 3) Provided a shortcut to the pygccxml access types (by making them part of the high level API.
Index: pypp_api.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pyplusplus/experimental/pypp_api.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** pypp_api.py 10 Mar 2006 12:35:14 -0000 1.7
--- pypp_api.py 14 Mar 2006 10:22:10 -0000 1.8
***************
*** 33,36 ****
--- 33,37 ----
from pygccxml import parser
from pygccxml import declarations
+ from pygccxml.declarations import ACCESS_TYPES
import pygccxml.utils
***************
*** 52,55 ****
--- 53,60 ----
from pyplusplus.decl_wrappers import return_value_policy
+ PUBLIC = ACCESS_TYPES.PUBLIC
+ PROTECTED = ACCESS_TYPES.PROTECTED
+ PRIVATE = ACCESS_TYPES.PRIVATE
+
def cleanTemplateName(templateName):
""" Build a clean template name. """
***************
*** 110,113 ****
--- 115,119 ----
have been made.
+ @returns: Returns the root of the declaration tree
@postcondition: This class can act as a wrapper for namespace("::") and all declarations are set to be ignored.
"""
***************
*** 178,181 ****
--- 184,189 ----
print "completed parsing."
+ return self.mDeclRootWrapper
+
def buildCreators(self, moduleName, filename, useScope=False):
***************
*** 253,257 ****
extmodule = self.mExtModule
assert extmodule
!
if self.mVerbose:
print "Writing out files..."
--- 261,278 ----
extmodule = self.mExtModule
assert extmodule
!
! # Check for missing policies...
! print "Checking policies..."
! creators = code_creators.make_flatten(self.mExtModule)
! fmfunctions = filter(lambda creator: isinstance(creator, code_creators.function_t), creators)
! missing_flag = False
! for creator in fmfunctions:
! if not creator.call_policies:
! print "Missing policy:", declarations.full_name(creator.declaration)
! missing_flag = True
! if missing_flag:
! print "*** Aborting because of missing policies!"
! return
!
if self.mVerbose:
print "Writing out files..."
|