stage3/declaration_check.cc
changeset 718 a9f8cc778444
parent 676 ca4f17211251
child 812 6679b6b21214
equal deleted inserted replaced
717:44f74fad2cc0 718:a9f8cc778444
    84   return error_count;
    84   return error_count;
    85 }
    85 }
    86 
    86 
    87 void declaration_check_c::check_global_decl(symbol_c *p_decl) {
    87 void declaration_check_c::check_global_decl(symbol_c *p_decl) {
    88 	symbol_c *var_name;
    88 	symbol_c *var_name;
    89 	search_base_type_c search_base_type;
       
    90 
    89 
    91 	search_var_instance_decl_c search_var_instance_glo_decl(current_pou_decl);
    90 	search_var_instance_decl_c search_var_instance_glo_decl(current_pou_decl);
    92 	search_var_instance_decl_c search_var_instance_ext_decl(p_decl);
    91 	search_var_instance_decl_c search_var_instance_ext_decl(p_decl);
    93 	function_param_iterator_c fpi(p_decl);
    92 	function_param_iterator_c fpi(p_decl);
    94 	while((var_name = fpi.next()) != NULL) {
    93 	while((var_name = fpi.next()) != NULL) {
   107          *       We need a new class (like search_base_type class) to get type id by variable declaration.
   106          *       We need a new class (like search_base_type class) to get type id by variable declaration.
   108          *  symbol_c *glo_type = ????;
   107          *  symbol_c *glo_type = ????;
   109          *  symbol_c *ext_type = fpi.param_type();
   108          *  symbol_c *ext_type = fpi.param_type();
   110 	 */
   109 	 */
   111 	/* For the moment, we will just use search_base_type_c instead... */
   110 	/* For the moment, we will just use search_base_type_c instead... */
   112         symbol_c *glo_type = search_base_type.get_basetype_decl(glo_decl);
   111         symbol_c *glo_type = search_base_type_c::get_basetype_decl(glo_decl);
   113         symbol_c *ext_type = search_base_type.get_basetype_decl(ext_decl);
   112         symbol_c *ext_type = search_base_type_c::get_basetype_decl(ext_decl);
   114         if (! get_datatype_info_c::is_type_equal(glo_type, ext_type))
   113         if (! get_datatype_info_c::is_type_equal(glo_type, ext_type))
   115           STAGE3_ERROR(0, ext_decl, ext_decl, "Declaration error an external redefinition data type.");
   114           STAGE3_ERROR(0, ext_decl, ext_decl, "Declaration error an external redefinition data type.");
   116       }
   115       }
   117 	}
   116 	}
   118 
   117