Update of /cvsroot/pygccxml/source/pygccxml/declarations
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25022/pygccxml/declarations
Modified Files:
declaration.py namespace.py variable.py
Log Message:
1. adding few classes that will make it easier to find some declaration within declaration tree
2. new unittests has been added
Index: namespace.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/namespace.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** namespace.py 28 Feb 2006 07:11:09 -0000 1.8
--- namespace.py 2 Mar 2006 05:55:39 -0000 1.9
***************
*** 49,58 ****
#add more comment about this.
#if not keep_parent:
! # decl.parent=None
!
! class namespace_matcher_t( declaration.declaration_matcher_t ):
! def __init__( self, name=None ):
! declaration.declaration_matcher_t.__init__( self, decl_type=namespace_t, name=name )
!
! def does_match( self, decl ):
! return True
\ No newline at end of file
--- 49,51 ----
#add more comment about this.
#if not keep_parent:
! # decl.parent=None
\ No newline at end of file
Index: variable.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/variable.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** variable.py 28 Feb 2006 07:11:09 -0000 1.6
--- variable.py 2 Mar 2006 05:55:39 -0000 1.7
***************
*** 54,73 ****
self._bits = bits
bits = property( _get_bits, _set_bits )
-
- class variable_matcher_t( declaration.declaration_matcher_t ):
- def __init__( self, name=None, type=None, type_str=None, value=None, location=None ):
- declaration.declaration_matcher_t.__init__( self
- , decl_type=variable_t
- , name=name
- , location=location )
-
- self.type = type
- self.type_str = type_str
- self.value = value
-
- def does_match( self, decl ):
- if None != self.type and self.type != decl.type:
- return False
- if None != self.type_str and self.type_str != decl.type.decl_string:
- return False
- return True
--- 54,55 ----
Index: declaration.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/declaration.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** declaration.py 28 Feb 2006 07:11:09 -0000 1.17
--- declaration.py 2 Mar 2006 05:55:39 -0000 1.18
***************
*** 15,18 ****
--- 15,19 ----
import templates
+
class location_t(object):
***************
*** 166,194 ****
return self._create_decl_string()
decl_string = property( _decl_string, doc="full name of the declaration" )
-
-
- class declaration_matcher_t( object ):
- def __init__( self, decl_type, name=None, location=None ):
- object.__init__( self )
- self.decl_type = decl_type
- self.location = location
- self.name = name
-
- def __call__( self, decl ):
- if not isinstance( decl, self.decl_type ):
- return False
- if None != self.location:
- if self.location != decl.location:
- return False
- if None != self.name:
- if '::' not in self.name:
- if decl.name != self.name:
- return False
- else:
- if self.name != algorithm.full_name( decl ):
- return False
- return self.does_match(decl)
-
- def does_match( self, decl ):
- raise NotImplementedError()
-
\ No newline at end of file
--- 167,168 ----
|