Update of /cvsroot/pygccxml/source/pygccxml/declarations
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24990/pygccxml/declarations
Modified Files:
__init__.py filters.py
Log Message:
adding select interface to decl_wrapper class hierarchy
Documentation strings will come later
Index: __init__.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/__init__.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** __init__.py 6 Mar 2006 05:00:32 -0000 1.35
--- __init__.py 15 Mar 2006 09:27:06 -0000 1.36
***************
*** 141,144 ****
--- 141,145 ----
from filters import regex_matcher_t
from filters import access_type_matcher_t
+ from filters import operator_matcher_t
from matcher import matcher
Index: filters.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/filters.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** filters.py 8 Mar 2006 08:46:10 -0000 1.2
--- filters.py 15 Mar 2006 09:27:06 -0000 1.3
***************
*** 17,24 ****
class declaration_matcher_t( object ):
! def __init__( self, decl_type=None, name=None, header_file=None, header_dir=None ):
"""
header and header dir should be absolute!
"""
#An other option is that
#pygccxml will create absolute path using os.path.abspath function.
--- 17,29 ----
class declaration_matcher_t( object ):
! def __init__( self, *args, **keywds ):
"""
header and header dir should be absolute!
+ decl_type
+ name
+ header_file
+ header_dir
"""
+
#An other option is that
#pygccxml will create absolute path using os.path.abspath function.
***************
*** 26,42 ****
#cwd and this behaviour is fragile and not so easy to find the bug.
object.__init__( self )
! self.decl_type = decl_type
! self.name = name
! self.header_dir = header_dir
if self.header_dir:
! self.header_dir = utils.normalize_path( header_dir )
! self.header_file = header_file
if self.header_file:
! self.header_file = utils.normalize_path( header_file )
!
! if self.header_dir and not os.path.isabs( self.header_dir ):
! raise RuntimeError( "Path to header directory should be absolute!" )
! if self.header_file and not os.path.isabs( self.header_file ):
! raise RuntimeError( "Path to header file should be absolute!" )
def __call__( self, decl ):
--- 31,48 ----
#cwd and this behaviour is fragile and not so easy to find the bug.
object.__init__( self )
! self.decl_type = keywds.get('decl_type', None)
! self.name = keywds.get('name', None)
! self.header_dir = keywds.get('header_dir', None)
! self.header_file = keywds.get('header_file', None)
!
if self.header_dir:
! self.header_dir = utils.normalize_path( self.header_dir )
! if not os.path.isabs( self.header_dir ):
! raise RuntimeError( "Path to header directory should be absolute!" )
!
if self.header_file:
! self.header_file = utils.normalize_path( self.header_file )
! if not os.path.isabs( self.header_file ):
! raise RuntimeError( "Path to header file should be absolute!" )
def __call__( self, decl ):
***************
*** 64,75 ****
class variable_matcher_t( declaration_matcher_t ):
! def __init__( self, type=None, value=None, *arguments, **keywords):
"""
type could be string or instance of class derived from cpptypes.type_t
"""
! declaration_matcher_t.__init__( self, variable.variable_t, *arguments, **keywords )
!
! self.type = type
! self.value = value
def __call__( self, decl ):
--- 70,81 ----
class variable_matcher_t( declaration_matcher_t ):
! def __init__( self, *args, **keywds ):
"""
type could be string or instance of class derived from cpptypes.type_t
"""
! keywds.update(decl_type=variable.variable_t)
! declaration_matcher_t.__init__( self, *args, **keywds )
! self.type = keywds.get('type', None)
! self.value = keywds.get('value', None)
def __call__( self, decl ):
***************
*** 86,91 ****
class namespace_matcher_t( declaration_matcher_t ):
! def __init__( self, *arguments, **keywords ):
! declaration_matcher_t.__init__( self, namespace.namespace_t, *arguments, **keywords)
def __call__( self, decl ):
--- 92,98 ----
class namespace_matcher_t( declaration_matcher_t ):
! def __init__( self, *args, **keywds ):
! keywds.update(decl_type=namespace.namespace_t)
! declaration_matcher_t.__init__( self, namespace.namespace_t, *args, **keywds)
def __call__( self, decl ):
***************
*** 94,98 ****
class calldef_matcher_t( declaration_matcher_t ):
! def __init__( self, return_type=None, arg_types=None, *arguments, **keywords):
"""Constructor.
--- 101,105 ----
class calldef_matcher_t( declaration_matcher_t ):
! def __init__( self, *args, **keywds):
"""Constructor.
***************
*** 106,115 ****
default argument value and/or exception ....
"""
! if not keywords.has_key( 'decl_type' ):
! keywords[ 'decl_type' ] = calldef.calldef_t
! declaration_matcher_t.__init__( self, *arguments, **keywords )
! self.return_type = return_type
! self.arg_types = arg_types
def __call__( self, decl ):
--- 113,122 ----
default argument value and/or exception ....
"""
! if not keywds.has_key( 'decl_type' ):
! keywds.update( decl_type=calldef.calldef_t )
! declaration_matcher_t.__init__( self, *args, **keywds )
! self.return_type = keywds.get( 'return_type', None )
! self.arg_types = keywds.get( 'arg_types', None )
def __call__( self, decl ):
***************
*** 141,145 ****
return True
!
class regex_matcher_t:
def __init__( self, regex, function ):
--- 148,163 ----
return True
! class operator_matcher_t( calldef_matcher_t ):
! def __init__( self, symbol=None, *args, **keywds):
! if not keywds.has_key( 'decl_type' ):
! keywds.update( decl_type=calldef.operator_t )
! calldef_matcher_t.__init__( self, *args, **keywds )
! self.symbol = keywds.get( 'symbol', None )
!
! def __call__( self, decl ):
! if not super( operator_matcher_t, self ).__call__( decl ):
! return False
! return None != self.symbol and self.symbol == decl.symbol
!
class regex_matcher_t:
def __init__( self, regex, function ):
|