Update of /cvsroot/pygccxml/source/pygccxml/parser
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31240/pygccxml/parser
Modified Files:
patcher.py project_reader.py source_reader.py
Log Message:
1. porting some tests to use new "select" interface
2. adding new type traits: has_public_assign
3. adding new patcher to treat GCC-XML default value typedef bug
Index: patcher.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/parser/patcher.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** patcher.py 6 Apr 2006 06:15:58 -0000 1.11
--- patcher.py 23 Apr 2006 12:13:25 -0000 1.12
***************
*** 143,148 ****
name = call_invocation.name( dv )
base_type = declarations.base_type( arg.type )
! return isinstance( base_type, declarations.declarated_t ) \
! and base_type.declaration.name == name
def __fix_constructor_call( self, func, arg ):
--- 143,152 ----
name = call_invocation.name( dv )
base_type = declarations.base_type( arg.type )
! if not isinstance( base_type, declarations.declarated_t ):
! return False
! decl = base_type.declaration
! return decl.name == name \
! or ( isinstance( decl, declarations.class_t ) \
! and name in map( lambda typedef: typedef.name, decl.typedefs ) )
def __fix_constructor_call( self, func, arg ):
***************
*** 152,158 ****
return False
base_type = declarations.base_type( arg.type )
name, args = call_invocation.split( dv )
! f_q_name = self.__join_names( declarations.full_name( base_type.declaration.parent )
! , name )
return call_invocation.join( f_q_name, args )
--- 156,174 ----
return False
base_type = declarations.base_type( arg.type )
+ decl = base_type.declaration
name, args = call_invocation.split( dv )
! if decl.name != name:
! #we have some alias to the class
! relevant_typedefs = filter( lambda typedef: typedef.name == name
! , decl.typedefs )
! if 1 == len( relevant_typedefs ):
! f_q_name = self.__join_names( declarations.full_name( relevant_typedefs[0].parent )
! , name )
! else:#in this case we can not say which typedef user uses:
! f_q_name = self.__join_names( declarations.full_name( decl.parent )
! , decl.name )
! else:
! f_q_name = self.__join_names( declarations.full_name( decl.parent ), name )
!
return call_invocation.join( f_q_name, args )
Index: source_reader.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/parser/source_reader.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** source_reader.py 20 Apr 2006 04:32:16 -0000 1.29
--- source_reader.py 23 Apr 2006 12:13:25 -0000 1.30
***************
*** 41,44 ****
--- 41,45 ----
for decl in classes:
+ del decl.typedefs[:]
for typedef in typedefs:
type_ = remove_alias( typedef.type )
***************
*** 49,53 ****
class source_reader_t:
! def __init__( self, config, cache=None, decl_factory=None, enable_bind_typedefs=True):
self.__search_directories = []
self.__config = config
--- 50,54 ----
class source_reader_t:
! def __init__( self, config, cache=None, decl_factory=None ):
self.__search_directories = []
self.__config = config
***************
*** 61,65 ****
if not decl_factory:
self.__decl_factory = decl_factory_t()
- self.__enable_bind_typedefs = enable_bind_typedefs
def __raise_on_wrong_settings(self):
--- 62,65 ----
***************
*** 259,264 ****
linker_.instance = decl
apply_visitor( linker_, decl )
! if self.__enable_bind_typedefs:
! bind_typedefs( decls.itervalues() )
decls = filter( lambda inst: isinstance(inst, declaration_t) and not inst.parent, decls.itervalues() )
#some times gccxml report typedefs defined in no namespace
--- 259,263 ----
linker_.instance = decl
apply_visitor( linker_, decl )
! bind_typedefs( decls.itervalues() )
decls = filter( lambda inst: isinstance(inst, declaration_t) and not inst.parent, decls.itervalues() )
#some times gccxml report typedefs defined in no namespace
Index: project_reader.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/parser/project_reader.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** project_reader.py 20 Apr 2006 04:32:16 -0000 1.31
--- project_reader.py 23 Apr 2006 12:13:25 -0000 1.32
***************
*** 169,174 ****
reader = source_reader.source_reader_t( config
, self.__dcache
! , self.__decl_factory
! , False )
decls = None
if content_type == file_configuration_t.CONTENT_TYPE.STANDARD_SOURCE_FILE:
--- 169,173 ----
reader = source_reader.source_reader_t( config
, self.__dcache
! , self.__decl_factory )
decls = None
if content_type == file_configuration_t.CONTENT_TYPE.STANDARD_SOURCE_FILE:
|