[pygccxml-commit] SF.net SVN: pygccxml: [1121] pygccxml_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2007-11-05 16:48:07
|
Revision: 1121 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1121&view=rev Author: roman_yakovenko Date: 2007-11-05 08:48:02 -0800 (Mon, 05 Nov 2007) Log Message: ----------- adding info about compiler Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/declaration.py pygccxml_dev/pygccxml/parser/scanner.py pygccxml_dev/unittests/autoconfig.py pygccxml_dev/unittests/core_tester.py Modified: pygccxml_dev/pygccxml/declarations/declaration.py =================================================================== --- pygccxml_dev/pygccxml/declarations/declaration.py 2007-11-04 20:30:29 UTC (rev 1120) +++ pygccxml_dev/pygccxml/declarations/declaration.py 2007-11-05 16:48:02 UTC (rev 1121) @@ -66,7 +66,8 @@ self._attributes = attributes self._parent = None self._cache = algorithms_cache.declaration_algs_cache_t() - + self._compiler = None + def __str__(self): """Default __str__ method. @@ -229,7 +230,6 @@ """ ) - def _create_decl_string(self): return algorithm.full_name( self ) @@ -251,3 +251,11 @@ """return list of all types and declarations the declaration depends on""" print self raise NotImplementedError() + + def _get_compiler( self ): + return self._compiler + def _set_compiler( self, compiler ): + self._compiler = compiler + compiler = property( _get_compiler, _set_compiler + , doc="""compiler name + version + @type: str""" ) Modified: pygccxml_dev/pygccxml/parser/scanner.py =================================================================== --- pygccxml_dev/pygccxml/parser/scanner.py 2007-11-04 20:30:29 UTC (rev 1120) +++ pygccxml_dev/pygccxml/parser/scanner.py 2007-11-05 16:48:02 UTC (rev 1121) @@ -25,6 +25,7 @@ XML_AN_BITS = "bits" XML_AN_CONST = "const" XML_AN_CONTEXT = "context" +XML_AN_CVS_REVISION = "cvs_revision" XML_AN_DEFAULT = "default" XML_AN_DEMANGLED = "demangled" XML_AN_EXTERN = "extern" @@ -61,6 +62,7 @@ XML_NN_FUNCTION_TYPE = "FunctionType" XML_NN_FUNDAMENTAL_TYPE = "FundamentalType" XML_NN_FREE_OPERATOR = "OperatorFunction" +XML_NN_GCC_XML = "GCC_XML" XML_NN_MEMBER_OPERATOR = "OperatorMethod" XML_NN_METHOD = "Method" XML_NN_METHOD_TYPE = "MethodType" @@ -109,6 +111,7 @@ , XML_NN_FREE_OPERATOR : self.__read_free_operator , XML_NN_MEMBER_OPERATOR : self.__read_member_operator , XML_NN_METHOD : self.__read_method + , XML_NN_GCC_XML : self.__read_version } self.deep_declarations = [ XML_NN_CASTING_OPERATOR @@ -143,6 +146,8 @@ self.__inst = None #mapping from id to members self.__members = {} + + self.__compiler = None def read( self ): xml.sax.parse( self.gccxml_file, self ) @@ -197,6 +202,7 @@ self.__read_access( attrs ) element_id = attrs.get(XML_AN_ID, None) if isinstance( obj, declaration_t ): + obj.compiler = self.__compiler self.__update_membership( attrs ) self.__declarations[ element_id ] = obj if not isinstance( obj, namespace_t ): @@ -469,3 +475,13 @@ else: operator.name = 'operator' + operator.name return operator + + def __read_version(self, attrs): + version = float( attrs.get(XML_AN_CVS_REVISION, None) ) + if version is None: + version = "0.6" + elif version <= 1.114: + version = "0.7" + else: + version = "0.9" + self.__compiler = "GCC-XML " + version Modified: pygccxml_dev/unittests/autoconfig.py =================================================================== --- pygccxml_dev/unittests/autoconfig.py 2007-11-04 20:30:29 UTC (rev 1120) +++ pygccxml_dev/unittests/autoconfig.py 2007-11-05 16:48:02 UTC (rev 1121) @@ -18,7 +18,7 @@ if 'roman' in getpass.getuser(): if sys.platform == 'win32': compiler = 'msvc71' - gccxml_path = r'd:/dev/gccxml_cvs/gccxml-bin/bin/release/gccxml.exe' + gccxml_path = r'D:/dev/gccxml/gccxml.exe' else: gccxml_path = '/home/roman/gccxml/bin/gccxml' Modified: pygccxml_dev/unittests/core_tester.py =================================================================== --- pygccxml_dev/unittests/core_tester.py 2007-11-04 20:30:29 UTC (rev 1120) +++ pygccxml_dev/unittests/core_tester.py 2007-11-05 16:48:02 UTC (rev 1121) @@ -294,6 +294,9 @@ implementation = ns.class_( 'implementation' ) self.failUnless( not implementation.is_abstract, "class 'implementation' should not be abstract" ) + def test_versioning(self): + for d in self.global_ns.decls(): + self.failUnless( d.compiler ) class core_all_at_once_t( core_t ): COMPILATION_MODE = COMPILATION_MODE.ALL_AT_ONCE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |