absyntax_utils/get_datatype_info.cc
changeset 939 5074236fb3c4
parent 938 31e3b3f2eff1
child 945 477393b00f95
equal deleted inserted replaced
938:31e3b3f2eff1 939:5074236fb3c4
   415 
   415 
   416 symbol_c *get_datatype_info_c::get_struct_field_type_id(symbol_c *struct_datatype, symbol_c *struct_fieldname) {
   416 symbol_c *get_datatype_info_c::get_struct_field_type_id(symbol_c *struct_datatype, symbol_c *struct_fieldname) {
   417   return get_struct_info_c::get_field_type_id(struct_datatype, struct_fieldname);
   417   return get_struct_info_c::get_field_type_id(struct_datatype, struct_fieldname);
   418 }
   418 }
   419 
   419 
       
   420 symbol_c *get_datatype_info_c::get_array_storedtype_id(symbol_c *type_symbol) {
       
   421   // returns the datatype of the variables stored in the array
       
   422   symbol_c *basetype = search_base_type_c::get_basetype_decl(type_symbol);
       
   423   array_specification_c *symbol = dynamic_cast<array_specification_c *>(basetype);
       
   424 
       
   425   if (NULL != symbol) 
       
   426     return symbol->non_generic_type_name;
       
   427   return NULL; // this is not an array!
       
   428 }
       
   429   
       
   430   
   420 /* Returns true if both datatypes are equivalent (not necessarily equal!).
   431 /* Returns true if both datatypes are equivalent (not necessarily equal!).
   421  * WARNING: May return true even though the datatypes are not the same/identicial!!!
   432  * WARNING: May return true even though the datatypes are not the same/identicial!!!
   422  *          This occurs when at least one of the datatypes is of a generic
   433  *          This occurs when at least one of the datatypes is of a generic
   423  *          datatype (or a REF_TO a generic datatype). 
   434  *          datatype (or a REF_TO a generic datatype). 
   424  *          (Generic dataypes: ANY, ANY_INT, ANY_NUM, ...)
   435  *          (Generic dataypes: ANY, ANY_INT, ANY_NUM, ...)