[pygccxml-commit] SF.net SVN: pygccxml: [1128] pygccxml_dev/pygccxml/parser
Brought to you by:
mbaas,
roman_yakovenko
|
From: <rom...@us...> - 2007-11-07 21:24:10
|
Revision: 1128
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1128&view=rev
Author: roman_yakovenko
Date: 2007-11-07 13:24:10 -0800 (Wed, 07 Nov 2007)
Log Message:
-----------
adding support for GCCXML 0.9
Modified Paths:
--------------
pygccxml_dev/pygccxml/parser/linker.py
pygccxml_dev/pygccxml/parser/patcher.py
pygccxml_dev/pygccxml/parser/scanner.py
Modified: pygccxml_dev/pygccxml/parser/linker.py
===================================================================
--- pygccxml_dev/pygccxml/parser/linker.py 2007-11-07 18:33:13 UTC (rev 1127)
+++ pygccxml_dev/pygccxml/parser/linker.py 2007-11-07 21:24:10 UTC (rev 1128)
@@ -19,6 +19,12 @@
self.__files = files
self.__inst = None
+ self.__compiler = None
+ if self.__decls:
+ for d in self.__decls.itervalues():
+ self.__compiler = d.compiler
+ break
+
def _get_inst(self):
return self.__inst
def _set_inst(self, inst):
@@ -40,7 +46,7 @@
else:
return unknown_t()
- def __link_compound_type(self):
+ def __link_compound_type(self):
self.__inst.base = self.__link_type( self.__inst.base )
def __link_members(self):
@@ -229,7 +235,13 @@
self.__link_compound_type()
def visit_pointer( self ):
- self.__link_compound_type()
+ if '0.9' in self.__compiler and isinstance( self.__inst.base, member_variable_type_t ):
+ original_inst = self.__inst
+ self.__inst = self.__inst.base
+ self.visit_member_variable_type()
+ self.__inst = original_inst
+ else:
+ self.__link_compound_type()
def visit_reference( self ):
self.__link_compound_type()
Modified: pygccxml_dev/pygccxml/parser/patcher.py
===================================================================
--- pygccxml_dev/pygccxml/parser/patcher.py 2007-11-07 18:33:13 UTC (rev 1127)
+++ pygccxml_dev/pygccxml/parser/patcher.py 2007-11-07 21:24:10 UTC (rev 1128)
@@ -132,6 +132,8 @@
return call_invocation.join( dv[:found1[0]], args2 )
def __is_constructor_call( self, func, arg ):
+ #if '0.9' in func.compiler:
+ # return False
call_invocation = declarations.call_invocation
dv = arg.default_value
if not call_invocation.is_call_invocation( dv ):
@@ -184,4 +186,4 @@
default_arg_patcher( decl )
if isinstance( decl, declarations.casting_operator_t):
_casting_oper_patcher_( decl )
-
+
\ No newline at end of file
Modified: pygccxml_dev/pygccxml/parser/scanner.py
===================================================================
--- pygccxml_dev/pygccxml/parser/scanner.py 2007-11-07 18:33:13 UTC (rev 1127)
+++ pygccxml_dev/pygccxml/parser/scanner.py 2007-11-07 21:24:10 UTC (rev 1128)
@@ -308,7 +308,8 @@
size = self.__guess_int_value( attrs.get(XML_AN_MAX, '' ) )
if size is None:
size = array_t.SIZE_UNKNOWN
- warnings.warn( 'unable to find out array size from expression "%s"' % attrs[ XML_AN_MAX ] )
+ msg = 'unable to find out array size from expression "%s"' % attrs[ XML_AN_MAX ]
+ warnings.warn( msg )
return array_t( type_, size + 1 )
def __read_cv_qualified_type( self, attrs ):
@@ -339,7 +340,10 @@
def __read_offset_type( self,attrs ):
base = attrs[ XML_AN_BASE_TYPE ]
type_ = attrs[ XML_AN_TYPE ]
- return member_variable_type_t( class_inst=base, variable_type=type_ )
+ if '0.9' in self.__compiler:
+ return pointer_t( member_variable_type_t( class_inst=base, variable_type=type_ ) )
+ else:
+ return member_variable_type_t( class_inst=base, variable_type=type_ )
def __read_argument( self, attrs ):
if isinstance( self.__inst, calldef_type_t ):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|