00001 /*! 00002 \file 00003 \brief ss_type to tm_data type convertor. 00004 \author jaz 00005 */ 00006 #include <lestes/md/types/ss_type2tm_type.g.hh> 00007 #include <lestes/md/types/tm_data_type.g.hh> 00008 #include <lestes/md/registers/tm_register.g.hh> 00009 #include <lestes/lang/cplus/sem/ss_misc.g.hh> 00010 #include <lestes/lang/cplus/sem/ss_type_builtin.g.hh> 00011 #include <lestes/lang/cplus/sem/ss_type.g.hh> 00012 #include <lestes/std/list.hh> 00013 00014 00015 package(lestes); 00016 package(md); 00017 package(types); 00018 00019 using namespace ::lestes::md::types; 00020 using namespace ::lestes::lang::cplus::sem; 00021 00022 ptr< tm_dt_simple_base > ss_type2tm_type::conditional_preg_type_get(){ 00023 return tm_dt_simple::instance(DT_COND); 00024 } 00025 00026 00027 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_union(ptr<ss_union>){ 00028 lassert(false); 00029 return NULL; 00030 } 00031 00032 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_class(ptr<ss_class>){ 00033 lassert(false); 00034 return NULL; 00035 } 00036 00037 00038 00039 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_array(ptr<ss_array>){ 00040 return visit_ss_type_ulong(ss_type_ulong::create()); 00041 } 00042 00043 00044 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_const(ptr<ss_const> type){ 00045 lassert(type); 00046 //target type of const is target type of suffix 00047 return type->what_get()->accept_ss_type2tm_type_gen_base(this); 00048 } 00049 00050 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_volatile(ptr<ss_volatile> type){ 00051 lassert(type); 00052 //target type of volatile is target type of suffix 00053 return type->what_get()->accept_ss_type2tm_type_gen_base(this); 00054 } 00055 00056 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_const_volatile(ptr<ss_const_volatile> type){ 00057 lassert(type); 00058 //target type of const volatile is target type of suffix 00059 return type->what_get()->accept_ss_type2tm_type_gen_base(this); 00060 } 00061 00062 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_pointer(ptr<ss_pointer> type){ 00063 lassert(type); 00064 //pointer is unsigned long 00065 return visit_ss_type_ulong(ss_type_ulong::create()); 00066 } 00067 00068 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_reference(ptr<ss_reference> type){ 00069 lassert(type); 00070 //reference is unsigned long 00071 return visit_ss_type_ulong(ss_type_ulong::create()); 00072 } 00073 00074 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_enum(ptr<ss_enum> type){ 00075 lassert(type); 00076 //enum is equal unsigned integer 00077 return visit_ss_type_uint(ss_type_uint::create()); 00078 } 00079 00080 00081 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_member_pointer(ptr<ss_member_pointer> type){ 00082 lassert(type); 00083 /* 00084 TODO: 00085 member pointer is a special structure according to ABI. 00086 */ 00087 lassert(false); 00088 return (ptr< tm_data_type_base >)NULL; 00089 } 00090 00091 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_function(ptr<ss_function> type){ 00092 lassert(type); 00093 //what type ss_function is? nobody should convert just ss_function (without pointer) to target type 00094 lassert(false); 00095 return (ptr< tm_data_type_base >)NULL; 00096 } 00097 00098 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_member_function(ptr<ss_member_function> type){ 00099 lassert(type); 00100 //what type ss_member_function is? 00101 lassert(false); 00102 return (ptr< tm_data_type_base >)NULL; 00103 } 00104 00105 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_type_wchar_t(ptr<ss_type_wchar_t> type){ 00106 lassert(type); 00107 return visit_ss_type_ushort(ss_type_ushort::create()); 00108 } 00109 00110 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_void(ptr<ss_void> type){ 00111 lassert(type); 00112 //what type ss_void is? nobody should convert just ss_void (without pointer) to target type 00113 lassert(false); 00114 return (ptr< tm_data_type_base >)NULL; 00115 } 00116 00117 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_pseudoreference(ptr<ss_pseudoreference> type){ 00118 lassert(type); 00119 //tm_data_type_base of pseudoreference is tm_data_type_base of inner ss_type 00120 return type->what_get()->accept_ss_type2tm_type_gen_base(this); 00121 } 00122 00123 00124 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_type_float(ptr<ss_type_float>){ 00125 lassert(false); 00126 } 00127 00128 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_type_double(ptr<ss_type_double>){ 00129 lassert(false); 00130 } 00131 00132 ptr< tm_data_type_base > ss_type2tm_type::visit_ss_type_ldouble(ptr<ss_type_ldouble>){ 00133 lassert(false); 00134 } 00135 00136 00137 ptr< ss_type2tm_type > ss_type2tm_type::instance() 00138 { 00139 if ( !singleton_instance_get()) { 00140 singleton_instance_set(ss_type2tm_type::create()); 00141 } 00142 00143 return singleton_instance_get(); 00144 } 00145 00146 end_package(types); 00147 end_package(md); 00148 end_package(lestes); 00149
1.5.1-20070107