absyntax_utils/get_datatype_info.cc
changeset 695 5760f1043ba4
parent 693 51a2fa6441b9
child 699 0307fa16db3f
equal deleted inserted replaced
694:a010763dd4cb 695:5760f1043ba4
    59 
    59 
    60 
    60 
    61 
    61 
    62 
    62 
    63 bool get_datatype_info_c::is_type_equal(symbol_c *first_type, symbol_c *second_type) {
    63 bool get_datatype_info_c::is_type_equal(symbol_c *first_type, symbol_c *second_type) {
    64   if ((NULL == first_type) || (NULL == second_type))
    64   if ((NULL == first_type) || (NULL == second_type))                 {return false;}
    65       return false;
    65   if (typeid(* first_type) == typeid(invalid_type_name_c))           {return false;}
    66   if (typeid(* first_type) == typeid(invalid_type_name_c))
    66   if (typeid(*second_type) == typeid(invalid_type_name_c))           {return false;}
    67       return false;
       
    68   if (typeid(*second_type) == typeid(invalid_type_name_c))
       
    69       return false;
       
    70     
    67     
    71   if (get_datatype_info_c::is_ANY_ELEMENTARY(first_type)) {
    68   if ((get_datatype_info_c::is_ANY_ELEMENTARY(first_type)) &&
    72       if (typeid(*first_type) == typeid(*second_type))
    69       (typeid(*first_type) == typeid(*second_type)))                 {return true;}
    73           return true;
    70   /* ANY_DERIVED */
    74   } else   /* ANY_DERIVED */
    71   return (first_type == second_type);
    75       return (first_type == second_type);
       
    76 
       
    77   return false;
       
    78 }
    72 }
    79 
    73 
    80 
    74 
    81 
    75 
    82 bool get_datatype_info_c::is_type_valid(symbol_c *type) {
    76 bool get_datatype_info_c::is_type_valid(symbol_c *type) {
    83   if (NULL == type)
    77   if (NULL == type)                                                  {return false;}
    84       return false;
    78   if (typeid(*type) == typeid(invalid_type_name_c))                  {return false;}
    85   if (typeid(*type) == typeid(invalid_type_name_c))
       
    86       return false;
       
    87 
       
    88   return true;
    79   return true;
    89 }
    80 }
    90 
    81 
    91 
    82 
    92 
    83