[pygccxml-commit] SF.net SVN: pygccxml: [154] pygccxml_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2006-05-23 18:39:31
|
Revision: 154 Author: roman_yakovenko Date: 2006-05-23 11:38:46 -0700 (Tue, 23 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=154&view=rev Log Message: ----------- adding java fundamental types Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/__init__.py pygccxml_dev/pygccxml/declarations/cpptypes.py pygccxml_dev/unittests/core_tester.py Modified: pygccxml_dev/pygccxml/declarations/__init__.py =================================================================== --- pygccxml_dev/pygccxml/declarations/__init__.py 2006-05-23 14:37:46 UTC (rev 153) +++ pygccxml_dev/pygccxml/declarations/__init__.py 2006-05-23 18:38:46 UTC (rev 154) @@ -54,7 +54,19 @@ from cpptypes import member_variable_type_t from cpptypes import declarated_t from cpptypes import type_qualifiers_t +#java types +from cpptypes import java_fundamental_t +from cpptypes import jbyte_t +from cpptypes import jshort_t +from cpptypes import jint_t +from cpptypes import jlong_t +from cpptypes import jfloat_t +from cpptypes import jdouble_t +from cpptypes import jchar_t +from cpptypes import jboolean_t + + from variable import variable_t from algorithm import full_name Modified: pygccxml_dev/pygccxml/declarations/cpptypes.py =================================================================== --- pygccxml_dev/pygccxml/declarations/cpptypes.py 2006-05-23 14:37:46 UTC (rev 153) +++ pygccxml_dev/pygccxml/declarations/cpptypes.py 2006-05-23 18:38:46 UTC (rev 154) @@ -89,7 +89,11 @@ def _clone_impl( self ): return self - + +class java_fundamental_t( fundamental_t ): + def __init__( self, name ): + fundamental_t.__init__( self, name ) + class void_t( fundamental_t ): CPPNAME = 'void' def __init__( self ): @@ -185,6 +189,48 @@ def __init__( self ): fundamental_t.__init__( self, complex_float_t.CPPNAME ) +class jbyte_t( java_fundamental_t ): + JNAME = 'jbyte' + def __init__( self ): + java_fundamental_t.__init__( self, jbyte_t.JNAME ) + +class jshort_t( java_fundamental_t ): + JNAME = 'jshort' + def __init__( self ): + java_fundamental_t.__init__( self, jshort_t.JNAME ) + +class jint_t( java_fundamental_t ): + JNAME = 'jint' + def __init__( self ): + java_fundamental_t.__init__( self, jint_t.JNAME ) + +class jlong_t( java_fundamental_t ): + JNAME = 'jlong' + def __init__( self ): + java_fundamental_t.__init__( self, jlong_t.JNAME ) + +class jfloat_t( java_fundamental_t ): + JNAME = 'jfloat' + def __init__( self ): + java_fundamental_t.__init__( self, jfloat_t.JNAME ) + + +class jdouble_t( java_fundamental_t ): + JNAME = 'jdouble' + def __init__( self ): + java_fundamental_t.__init__( self, jdouble_t.JNAME ) + + +class jchar_t( java_fundamental_t ): + JNAME = 'jchar' + def __init__( self ): + java_fundamental_t.__init__( self, jchar_t.JNAME ) + +class jboolean_t( java_fundamental_t ): + JNAME = 'jboolean' + def __init__( self ): + java_fundamental_t.__init__( self, jboolean_t.JNAME ) + FUNDAMENTAL_TYPES = { void_t.CPPNAME : void_t() , char_t.CPPNAME : char_t() @@ -208,6 +254,24 @@ , complex_long_double_t.CPPNAME : complex_long_double_t() , complex_double_t.CPPNAME : complex_double_t() , complex_float_t.CPPNAME : complex_float_t() + ##adding java types + , jbyte_t.JNAME : jbyte_t() + , jshort_t.JNAME : jshort_t() + , jint_t.JNAME : jint_t() + , jlong_t.JNAME : jlong_t() + , jfloat_t.JNAME : jfloat_t() + , jdouble_t.JNAME : jdouble_t() + , jchar_t.JNAME : jchar_t() + , jboolean_t.JNAME : jboolean_t() + , '__java_byte' : jbyte_t() + , '__java_short' : jshort_t() + , '__java_int' : jint_t() + , '__java_long' : jlong_t() + , '__java_float' : jfloat_t() + , '__java_double' : jdouble_t() + , '__java_char' : jchar_t() + , '__java_boolean' : jboolean_t() + } ################################################################################ Modified: pygccxml_dev/unittests/core_tester.py =================================================================== --- pygccxml_dev/unittests/core_tester.py 2006-05-23 14:37:46 UTC (rev 153) +++ pygccxml_dev/unittests/core_tester.py 2006-05-23 18:38:46 UTC (rev 154) @@ -184,6 +184,8 @@ for fundamental_type_name, fundamental_type in FUNDAMENTAL_TYPES.iteritems(): if 'complex' in fundamental_type_name: continue #I check this in an other tester + if isinstance( fundamental_type, java_fundamental_t ): + continue #I don't check this at all typedef_name = 'typedef_' + fundamental_type_name.replace( ' ', '_' ) typedef = self.global_ns.decl( decl_type=typedef_t, name=typedef_name ) self.failUnless( typedef, "unable to find typedef to build-in type '%s'" % fundamental_type_name ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |