printf ("local or auto Automatic setting based on source file\n");
printf ("c Use the C language\n");
printf ("c++ Use the C++ language\n");
- /* start-sanitize-chill */
printf ("chill Use the Chill language\n");
- /* end-sanitize-chill */
printf ("modula-2 Use the Modula-2 language\n");
/* Restore the silly string. */
set_language(current_language->la_language);
not needed. */
return l1 > l2 ? VALUE_TYPE(v1) : VALUE_TYPE(v2);
break;
- /* start-sanitize-chill */
- case language_chill:
+ case language_chill:
error ("Missing Chill support in function binop_result_check.");/*FIXME*/
- /* end-sanitize-chill */
}
abort();
return (struct type *)0; /* For lint */
strcat (form, local_octal_format_suffix ());
return form;
}
+
+/* Returns the appropriate printf format for decimal numbers. */
+char *
+local_decimal_format_custom(pre)
+ char *pre;
+{
+ static char form[50];
+
+ strcpy (form, local_decimal_format_prefix ());
+ strcat (form, "%");
+ strcat (form, pre);
+ strcat (form, local_decimal_format_specifier ());
+ strcat (form, local_decimal_format_suffix ());
+ return form;
+}
\f
/* This page contains functions that are used in type/range checking.
They all return zero if the type/range check fails.
(TYPE_CODE(type) != TYPE_CODE_ENUM) ? 0 : 1;
case language_m2:
return TYPE_CODE(type) != TYPE_CODE_INT ? 0 : 1;
- /* start-sanitize-chill */
case language_chill:
error ("Missing Chill support in function integral_type."); /*FIXME*/
- /* end-sanitize-chill */
default:
error ("Language not supported.");
}
{
switch(current_language->la_language)
{
- /* start-sanitize-chill */
case language_chill:
- /* end-sanitize-chill */
case language_m2:
return TYPE_CODE(type) != TYPE_CODE_CHAR ? 0 : 1;
}
}
+/* Returns non-zero if the value is a string type */
+int
+string_type (type)
+ struct type *type;
+{
+ switch(current_language->la_language)
+ {
+ case language_chill:
+ case language_m2:
+ return TYPE_CODE(type) != TYPE_CODE_STRING ? 0 : 1;
+
+ case language_c:
+ case language_cplus:
+ /* C does not have distinct string type. */
+ return (0);
+ default:
+ return (0);
+ }
+}
+
/* Returns non-zero if the value is a boolean type */
int
boolean_type (type)
{
switch(current_language->la_language)
{
- /* start-sanitize-chill */
case language_chill:
- /* end-sanitize-chill */
case language_m2:
return TYPE_CODE(type) != TYPE_CODE_BOOL ? 0 : 1;
return (TYPE_CODE(type) == TYPE_CODE_STRUCT) ||
(TYPE_CODE(type) == TYPE_CODE_SET) ||
(TYPE_CODE(type) == TYPE_CODE_ARRAY);
- /* start-sanitize-chill */
case language_chill:
error ("Missing Chill support in function structured_type."); /*FIXME*/
- /* end-sanitize-chill */
default:
return (0);
}
return 0; /* BOOLEAN with value FALSE */
break;
- /* start-sanitize-chill */
case language_chill:
error ("Missing Chill support in function value_type."); /*FIXME*/
- /* end-sanitize-chill */
default:
error ("Language not supported.");
break;
case BINOP_REM:
+ case BINOP_MOD:
if (!integral_type(t1) || !integral_type(t2))
type_op_error ("Arguments to %s must be of integral type.",op);
break;
type_op_error ("Arguments to %s must be of the same type.",op);
break;
+ case BINOP_CONCAT:
+ /* FIXME: Needs to handle bitstrings as well. */
+ if (!(string_type(t1) || character_type(t1) || integral_type(t1))
+ || !(string_type(t2) || character_type(t2) || integral_type(t2)))
+ type_op_error ("Arguments to %s must be strings or characters.", op);
+ break;
+
/* Unary checks -- arg2 is null */
case UNOP_LOGICAL_NOT:
}
#endif
-/* start-sanitize-chill */
#ifdef _LANG_chill
case language_chill:
error ("Missing Chill support in function binop_type_check.");/*FIXME*/
#endif
-/* end-sanitize-chill */
}
}
fprintf (stderr, "\n");
va_end (args);
if (type_check==type_check_on)
- return_to_top_level();
+ return_to_top_level (RETURN_ERROR);
}
void
fprintf (stderr, "\n");
va_end (args);
if (range_check==range_check_on)
- return_to_top_level();
+ return_to_top_level (RETURN_ERROR);
}
\f
static struct type ** const (unknown_builtin_types[]) = { 0 };
static const struct op_print unk_op_print_tab[] = {
- {NULL, 0, 0, 0}
+ {NULL, OP_NULL, PREC_NULL, 0}
};
const struct language_defn unknown_language_defn = {