absyntax_utils/get_datatype_info.cc
changeset 919 8da635655f37
parent 909 8b2a31dea131
child 921 d228aaa4d616
equal deleted inserted replaced
918:e9bde0aa93ed 919:8da635655f37
   246   /* ANY_ELEMENTARY */
   246   /* ANY_ELEMENTARY */
   247   if ((is_ANY_ELEMENTARY(first_type)) &&
   247   if ((is_ANY_ELEMENTARY(first_type)) &&
   248       (typeid(*first_type) == typeid(*second_type)))                 {return true;}
   248       (typeid(*first_type) == typeid(*second_type)))                 {return true;}
   249 
   249 
   250   /* ANY_DERIVED */
   250   /* ANY_DERIVED */
   251   if (is_ref_to(first_type) && is_ref_to(second_type))
   251   if (is_ref_to(first_type) && is_ref_to(second_type)) {
   252       return is_type_equal(search_base_type_c::get_basetype_decl(get_ref_to(first_type )),
   252     /* if either of them is the constant 'NULL' then we consider them 'equal', as NULL is compatible to a REF_TO any datatype! */
   253                            search_base_type_c::get_basetype_decl(get_ref_to(second_type)));
   253     if (typeid(* first_type) == typeid(ref_value_null_literal_c))    {return true;}  
       
   254     if (typeid(*second_type) == typeid(ref_value_null_literal_c))    {return true;}
       
   255     return is_type_equal(search_base_type_c::get_basetype_decl(get_ref_to(first_type )),
       
   256                          search_base_type_c::get_basetype_decl(get_ref_to(second_type)));
       
   257   }
   254 
   258 
   255   return (first_type == second_type);
   259   return (first_type == second_type);
   256 }
   260 }
   257 
   261 
   258 
   262 
   293   if (NULL == type_decl)                                                       {return false;}
   297   if (NULL == type_decl)                                                       {return false;}
   294   
   298   
   295   if (typeid(*type_decl) == typeid(ref_type_decl_c))                           {return true;}   /* identifier ':' ref_spec_init */
   299   if (typeid(*type_decl) == typeid(ref_type_decl_c))                           {return true;}   /* identifier ':' ref_spec_init */
   296   if (typeid(*type_decl) == typeid(ref_spec_init_c))                           {return true;}   /* ref_spec [ ASSIGN ref_initialization ]; */
   300   if (typeid(*type_decl) == typeid(ref_spec_init_c))                           {return true;}   /* ref_spec [ ASSIGN ref_initialization ]; */
   297   if (typeid(*type_decl) == typeid(ref_spec_c))                                {return true;}   /* REF_TO (non_generic_type_name | function_block_type_name) */
   301   if (typeid(*type_decl) == typeid(ref_spec_c))                                {return true;}   /* REF_TO (non_generic_type_name | function_block_type_name) */
       
   302   if (typeid(*type_decl) == typeid(ref_value_null_literal_c))                  {return true;}   /* REF_TO (non_generic_type_name | function_block_type_name) */
   298   return false;
   303   return false;
   299 }
   304 }
   300 
   305 
   301 
   306 
   302 
   307