# Compiled by:
#
src/lib/c-kit/src/ast/ast.sublib# equality for ctype enum (defined in ast.pkg)
#
package ctype_eq {
include package raw_syntax;
fun eq_storage_ilk (AUTO, AUTO) => TRUE;
eq_storage_ilk (EXTERN, EXTERN) => TRUE;
eq_storage_ilk (REGISTER, REGISTER) => TRUE;
eq_storage_ilk (STATIC, STATIC) => TRUE;
eq_storage_ilk (DEFAULT, DEFAULT) => TRUE;
eq_storage_ilk _ => FALSE;
end;
fun eq_qualifier (CONST, CONST) => TRUE;
eq_qualifier (VOLATILE, VOLATILE) => TRUE;
eq_qualifier _ => FALSE;
end;
fun eq_signedness (SIGNED, SIGNED) => TRUE;
eq_signedness (UNSIGNED, UNSIGNED) => TRUE;
eq_signedness _ => FALSE;
end;
fun eq_int_kind (CHAR, CHAR) => TRUE;
eq_int_kind (SHORT, SHORT) => TRUE;
eq_int_kind (INT, INT) => TRUE;
eq_int_kind (LONG, LONG) => TRUE;
eq_int_kind (LONGLONG, LONGLONG) => TRUE;
eq_int_kind (FLOAT, FLOAT) => TRUE;
eq_int_kind (DOUBLE, DOUBLE) => TRUE;
eq_int_kind (LONGDOUBLE, LONGDOUBLE) => TRUE;
eq_int_kind _ => FALSE;
end;
fun eq_fractionality (FRACTIONAL, FRACTIONAL) => TRUE;
eq_fractionality (WHOLENUM, WHOLENUM) => TRUE;
eq_fractionality _ => FALSE;
end;
fun eq_saturatedness (SATURATE, SATURATE) => TRUE;
eq_saturatedness (NONSATURATE, NONSATURATE) => TRUE;
eq_saturatedness _ => FALSE;
end;
fun eq_ctype (VOID, VOID) => TRUE;
eq_ctype (ELLIPSES, ELLIPSES) => TRUE;
eq_ctype (QUAL (q1, ct1), QUAL (q2, ct2)) => eq_qualifier (q1, q2) and eq_ctype (ct1, ct2);
eq_ctype (NUMERIC x1, NUMERIC x2) => x1 == x2;
eq_ctype (ARRAY (THE (i1, _), ct1), ARRAY (THE (i2, _), ct2)) => (i1==i2) and eq_ctype (ct1, ct2);
eq_ctype (POINTER ct1, POINTER ct2) => eq_ctype (ct1, ct2);
eq_ctype (FUNCTION (ct1, ctl1), FUNCTION (ct2, ctl2)) => eq_ctype (ct1, ct2) and eq_ctype_list (ctl1, ctl2);
eq_ctype (STRUCT_REF tid1, STRUCT_REF tid2) => tid1 == tid2;
eq_ctype (UNION_REF tid1, UNION_REF tid2) => tid1 == tid2;
eq_ctype (ENUM_REF tid1, ENUM_REF tid2) => tid1 == tid2;
eq_ctype (TYPE_REF tid1, TYPE_REF tid2) => tid1 == tid2;
eq_ctype (ERROR, ERROR) => TRUE;
eq_ctype _ => FALSE;
end
also
fun eq_ctype_list((ct1, _) ! ctl1, (ct2, _) ! ctl2) =>
eq_ctype (ct1, ct2) and eq_ctype_list (ctl1, ctl2);
eq_ctype_list (NIL, NIL) => TRUE;
eq_ctype_list _ => FALSE;
end;
};
## Copyright (c) 1998 by Lucent Technologies
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.