stage3/datatype_functions.hh
changeset 425 c8e6cf57324a
parent 417 d48f53715f77
child 434 c1278e52bcbc
equal deleted inserted replaced
424:43d73e28eca8 425:c8e6cf57324a
    44 extern const struct widen_entry widen_ADD_table[];
    44 extern const struct widen_entry widen_ADD_table[];
    45 extern const struct widen_entry widen_SUB_table[];
    45 extern const struct widen_entry widen_SUB_table[];
    46 extern const struct widen_entry widen_MUL_table[];
    46 extern const struct widen_entry widen_MUL_table[];
    47 extern const struct widen_entry widen_DIV_table[];
    47 extern const struct widen_entry widen_DIV_table[];
    48 
    48 
       
    49 /* Search for a datatype inside a candidate_datatypes list.
       
    50  * Returns: position of datatype in the list, or -1 if not found.
       
    51  */
       
    52 int search_in_datatype_list(symbol_c *datatype, std::vector <symbol_c *> candidate_datatypes);
       
    53 
    49 /* A helper function... */
    54 /* A helper function... */
    50 bool is_ANY_ELEMENTARY_type         (symbol_c *type_symbol);
    55 bool is_ANY_ELEMENTARY_type         (symbol_c *type_symbol);
    51 bool is_ANY_SAFEELEMENTARY_type     (symbol_c *type_symbol);
    56 bool is_ANY_SAFEELEMENTARY_type     (symbol_c *type_symbol);
    52 bool is_ANY_ELEMENTARY_compatible   (symbol_c *type_symbol);
    57 bool is_ANY_ELEMENTARY_compatible   (symbol_c *type_symbol);
    53 
    58 
    81 
    86 
    82 bool is_BOOL_type                   (symbol_c *type_symbol);
    87 bool is_BOOL_type                   (symbol_c *type_symbol);
    83 bool is_SAFEBOOL_type               (symbol_c *type_symbol);
    88 bool is_SAFEBOOL_type               (symbol_c *type_symbol);
    84 bool is_ANY_BOOL_compatible         (symbol_c *type_symbol);
    89 bool is_ANY_BOOL_compatible         (symbol_c *type_symbol);
    85 
    90 
       
    91 #if 0
    86 bool is_nonneg_literal_integer_type (symbol_c *type_symbol);
    92 bool is_nonneg_literal_integer_type (symbol_c *type_symbol);
    87 bool is_literal_integer_type        (symbol_c *type_symbol);
    93 bool is_literal_integer_type        (symbol_c *type_symbol);
    88 bool is_literal_real_type           (symbol_c *type_symbol);
    94 bool is_literal_real_type           (symbol_c *type_symbol);
    89 bool is_literal_bool_type           (symbol_c *type_symbol);
    95 bool is_literal_bool_type           (symbol_c *type_symbol);
    90 
    96 
   100  * If two literals, then return the literal that requires more bits...
   106  * If two literals, then return the literal that requires more bits...
   101  */
   107  */
   102 symbol_c *common_type(symbol_c *first_type, symbol_c *second_type);
   108 symbol_c *common_type(symbol_c *first_type, symbol_c *second_type);
   103 bool is_valid_assignment(symbol_c *var_type, symbol_c *value_type);
   109 bool is_valid_assignment(symbol_c *var_type, symbol_c *value_type);
   104 bool is_compatible_type(symbol_c *first_type, symbol_c *second_type);
   110 bool is_compatible_type(symbol_c *first_type, symbol_c *second_type);
       
   111 #endif
       
   112 
   105 bool is_type_equal(symbol_c *first_type, symbol_c *second_type);
   113 bool is_type_equal(symbol_c *first_type, symbol_c *second_type);
   106 
   114 
   107 typedef bool (*helper_function_t) (symbol_c *type_symbol);  /* a pointer to a function! */
   115 // typedef bool (*helper_function_t) (symbol_c *type_symbol);  /* a pointer to a function! */
   108 
   116 
   109 
   117 
   110 
   118 
   111 #endif /* _HELPER_FUNCTIONS_HH_ */
   119 #endif /* _HELPER_FUNCTIONS_HH_ */