Files
mercury/java/TypeCtorRep.java
Zoltan Somogyi 228ddfdd0b Fix a bug by distinguishing the type_ctor_reps of type_infos and
Estimated hours taken: 12
Branches: main

Fix a bug by distinguishing the type_ctor_reps of type_infos and
type_ctor_infos. The type_ctor_infos of types with nonzero arity
cannot be printed, copied etc like type_infos; any attempt to do so
causes a core dump.

For similar reasons, add a separate type_ctor_rep for
base_typeclass_infos separate from typeclass_infos.

runtime/mercury_type_info.h:
runtime/mercury_mcpp.h:
compiler/mlds_to_gcc.m:
library/rtti_implementation.m:
java/TypeCtorRep.java:
	Add new type_ctor_reps for type_ctor_infos and base_typeclass_infos.

library/private_builtin.m:
runtime/mercury.c:
	Use the new type_ctor_reps in the type_ctor_infos of the builtin types
	type_ctor_info and base_typeclass_info.

runtime/mercury_type_info.[ch]:
	Add a function for comparing type_ctor_infos.

	Move some interface documentation from the source file to the header
	file.

runtime/mercury_deep_copy_body.h:
	Add code to handle the new type_ctor_reps.

	Simplify some code.

	Make the whole file use 4-space indentation.

library/std_util.m:
runtime/mercury_ml_expand_body.h:
runtime/mercury_unify_compare_body.h:
runtime/mercury_ho_call.c:
runtime/mercury_tabling.c:
	Add code to handle the new type_ctor_reps.
2002-01-28 17:28:01 +00:00

61 lines
2.4 KiB
Java

//
// Copyright (C) 2001-2002 The University of Melbourne.
// This file may only be copied under the terms of the GNU Library General
// Public License - see the file COPYING.LIB in the Mercury distribution.
//
package mercury.runtime;
public class TypeCtorRep {
// Constants
public static final int MR_TYPECTOR_REP_ENUM = 0;
public static final int MR_TYPECTOR_REP_ENUM_USEREQ = 1;
public static final int MR_TYPECTOR_REP_DU = 2;
public static final int MR_TYPECTOR_REP_DU_USEREQ = 3;
public static final int MR_TYPECTOR_REP_NOTAG = 4;
public static final int MR_TYPECTOR_REP_NOTAG_USEREQ = 5;
public static final int MR_TYPECTOR_REP_EQUIV = 6;
public static final int MR_TYPECTOR_REP_EQUIV_VAR = 7;
public static final int MR_TYPECTOR_REP_INT = 8;
public static final int MR_TYPECTOR_REP_CHAR = 9;
public static final int MR_TYPECTOR_REP_FLOAT = 10;
public static final int MR_TYPECTOR_REP_STRING = 11;
public static final int MR_TYPECTOR_REP_PRED = 12;
public static final int MR_TYPECTOR_REP_UNIV = 13;
public static final int MR_TYPECTOR_REP_VOID = 14;
public static final int MR_TYPECTOR_REP_C_POINTER = 15;
public static final int MR_TYPECTOR_REP_TYPEINFO = 16;
public static final int MR_TYPECTOR_REP_TYPECLASSINFO = 17;
public static final int MR_TYPECTOR_REP_ARRAY = 18;
public static final int MR_TYPECTOR_REP_SUCCIP = 19;
public static final int MR_TYPECTOR_REP_HP = 20;
public static final int MR_TYPECTOR_REP_CURFR = 21;
public static final int MR_TYPECTOR_REP_MAXFR = 22;
public static final int MR_TYPECTOR_REP_REDOFR = 23;
public static final int MR_TYPECTOR_REP_REDOIP = 24;
public static final int MR_TYPECTOR_REP_TRAIL_PTR = 25;
public static final int MR_TYPECTOR_REP_TICKET = 26;
public static final int MR_TYPECTOR_REP_NOTAG_GROUND = 27;
public static final int MR_TYPECTOR_REP_NOTAG_GROUND_USEREQ = 28;
public static final int MR_TYPECTOR_REP_EQUIV_GROUND = 29;
public static final int MR_TYPECTOR_REP_TUPLE = 30;
public static final int MR_TYPECTOR_REP_RESERVED_ADDR = 31;
public static final int MR_TYPECTOR_REP_RESERVED_ADDR_USEREQ = 32;
public static final int MR_TYPECTOR_REP_TYPECTORINFO = 33;
public static final int MR_TYPECTOR_REP_BASETYPECLASSINFO = 34;
public static final int MR_TYPECTOR_REP_UNKNOWN = 35;
// Instance variable for TypeCtorRep objects.
public int value;
// Constructor
public TypeCtorRep(int arg) {
this.value = arg;
}
}