[m-rev.] diff: temporary Java framework.

Michael Wybrow mjwybrow at students.cs.mu.oz.au
Mon Feb 11 14:20:21 AEDT 2002



===================================================================

Estimated hours taken: 3
Branches: main


This change introduces some (partial) Java versions of the mercury library
which are currently needed to compile some .java files generated by the
mercury compiler for the tests/benchmarks test cases.
These additions are required temporarily for testing purposes until the
mercury library can be compiled in grade java.


mercury/java/Commit.java:
mercury/java/DuExistInfo.java:
mercury/java/DuExistLocn.java:
mercury/java/DuFunctorDesc.java:
mercury/java/DuPtagLayout.java:
mercury/java/EnumFunctorDesc.java:
mercury/java/JavaInternal.java:
mercury/java/MethodPtr.java:
mercury/java/NotagFunctorDesc.java:
mercury/java/PseudoTypeInfo.java:
mercury/java/Sectag_Locn.java:
mercury/java/TypeCtorInfo_Struct.java:
mercury/java/TypeCtorRep.java:
mercury/java/TypeFunctors.java:
mercury/java/TypeLayout.java:
mercury/java/UnreachableDefault.java:
	All files that were located in the mercury/java directory have
	been moved to mercury/java/runtime.

mercury/java/Makefile:
	A simple Makefile to set up a couple of symbolic links so we can 
	just include the mercury/java directory in our CLASSPATH.

mercury/java/library/assoc_list.java:
mercury/java/library/bool.java:
mercury/java/library/builtin.java:
mercury/java/library/deconstruct.java:
mercury/java/library/enum.java:
mercury/java/library/integer.java:
mercury/java/library/io.java:
mercury/java/library/list.java:
mercury/java/library/map.java:
mercury/java/library/mer_int.java:
mercury/java/library/mr_char.java:
mercury/java/library/mr_float.java:
mercury/java/library/mr_int.java:
mercury/java/library/ops.java:
mercury/java/library/private_builtin.java:
mercury/java/library/require.java:
mercury/java/library/set.java:
mercury/java/library/std_util.java:
mercury/java/library/string.java:
mercury/java/library/term.java:
mercury/java/library/time.java:
mercury/java/library/tree234.java:
mercury/java/library/type_desc.java:
	These are partial Java versions of mercury library modules. They are 
	very rough but will currently allow for most of the tests/benchmark
	directory to run in Java.


Index: java/Commit.java
===================================================================
RCS file: java/Commit.java
diff -N java/Commit.java
--- java/Commit.java	8 Feb 2002 00:42:22 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-//
-// Copyright (C) 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.
-//
-// This is a throwable class used for the Java implementation of commits.
-// 
-
-package mercury.runtime;
-
-public class Commit extends java.lang.Error {
-
-}
-
Index: java/DuExistInfo.java
===================================================================
RCS file: java/DuExistInfo.java
diff -N java/DuExistInfo.java
--- java/DuExistInfo.java	23 Feb 2001 01:11:02 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-//
-// Copyright (C) 2001 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 DuExistInfo {
-	
-	public int exist_typeinfos_plain;
-	public int exist_typeinfos_in_tci;
-	public int exist_tcis;
-	public /* final */ mercury.runtime.DuExistLocn[] exist_typeinfo_locns;
-
-}
Index: java/DuExistLocn.java
===================================================================
RCS file: java/DuExistLocn.java
diff -N java/DuExistLocn.java
--- java/DuExistLocn.java	23 Feb 2001 01:11:02 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-//
-// Copyright (C) 2001 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 DuExistLocn {
-	
-	public int exist_arg_num;
-	public int exist_offset_in_tci;
-
-}
Index: java/DuFunctorDesc.java
===================================================================
RCS file: java/DuFunctorDesc.java
diff -N java/DuFunctorDesc.java
--- java/DuFunctorDesc.java	23 Feb 2001 01:11:02 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-//
-// Copyright (C) 2001 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 DuFunctorDesc {
-    
-	public java.lang.String du_functor_name;
-	public int du_functor_orig_arity;
-	public int du_functor_arg_type_contains_var;
-	public mercury.runtime.Sectag_Locn du_functor_sectag_locn;
-	public int du_functor_primary;
-	public int du_functor_secondary;
-	public int du_functor_ordinal;
-	// XXX PseudoTypeInfo's have not been implemented properly
-	//     yet, so this may not be correct.
-	public /*final*/ mercury.runtime.PseudoTypeInfo[] du_functor_arg_types;
-	public /*final*/ java.lang.String[] du_functor_arg_names;
-	public /*final*/ mercury.runtime.DuExistInfo[] du_functor_exist_info;
-
-}
Index: java/DuPtagLayout.java
===================================================================
RCS file: java/DuPtagLayout.java
diff -N java/DuPtagLayout.java
--- java/DuPtagLayout.java	23 Feb 2001 01:11:02 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-//
-// Copyright (C) 2001 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 DuPtagLayout {
-	
-	public int sectag_sharers;
-	public mercury.runtime.Sectag_Locn sectag_locn;
-	public /* final */ DuFunctorDesc[] sectag_alternatives;
-
-}
Index: java/EnumFunctorDesc.java
===================================================================
RCS file: java/EnumFunctorDesc.java
diff -N java/EnumFunctorDesc.java
--- java/EnumFunctorDesc.java	23 Feb 2001 01:11:02 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-//
-// Copyright (C) 2001 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 EnumFunctorDesc {
-	
-	public java.lang.String enum_functor_name;
-	public int              enum_functor_ordinal;
-
-}
Index: java/JavaInternal.java
===================================================================
RCS file: java/JavaInternal.java
diff -N java/JavaInternal.java
--- java/JavaInternal.java	23 Feb 2001 01:11:02 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
-//
-// Copyright (C) 2001 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.
-//
-//
-// All modifications to this file will require changes to:
-// compiler/mlds_to_java.m
-// 
-//
-// At the moment this class is just used to store the command line
-//   arguments.  We can't put them in one of the library modules because
-//   we need to hold them in a class variable in a top level class.   
-//
-
-package mercury.runtime;
-
-public class JavaInternal {
-	public static java.lang.String[] args;
-}
Index: java/Makefile
===================================================================
RCS file: java/Makefile
diff -N java/Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/Makefile	11 Feb 2002 01:41:58 -0000
@@ -0,0 +1,26 @@
+
+# Copyright (C) 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.
+#
+# This Makefile sets up some symbolic links so that for the moment we can just
+# include this directory (mercury/java) in our CLASSPATH to be able to compile
+# some mercury files to java.
+#
+# The files in mercury/java/library are some hacked up versions of parts of
+# the mercury library written in java. These are classes such as mercury.list,
+# which require them to be in the CLASSPATH in a "mercury" directory, hence
+# the first link.
+# 
+# The files in mercury/java/runtime are the mercury runtime classes such as
+# mercury.runtime.MethodPtr. These should be in the CLASSPATH under the 
+# directory "mercury/runtime", hence the second link.
+#
+
+links:		
+		ln -s library mercury
+		(cd library ; ln -s ../runtime runtime)
+
+clean:
+		rm -f mercury library/runtime
+
Index: java/MethodPtr.java
===================================================================
RCS file: java/MethodPtr.java
diff -N java/MethodPtr.java
--- java/MethodPtr.java	23 Jan 2002 22:22:35 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-//
-// Copyright (C) 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.
-//
-// This interface is implemented by wrapper classes which are automatically 
-// generated by the Java back-end to implement method pointers in Java.
-//
-
-package mercury.runtime;
-
-public interface MethodPtr {
-	public abstract java.lang.Object call___0_0(java.lang.Object[] args); 
-}
-
Index: java/NotagFunctorDesc.java
===================================================================
RCS file: java/NotagFunctorDesc.java
diff -N java/NotagFunctorDesc.java
--- java/NotagFunctorDesc.java	23 Feb 2001 01:11:02 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-//
-// Copyright (C) 2001 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 NotagFunctorDesc {
-	
-	public java.lang.String no_tag_functor_name;
-	public mercury.runtime.PseudoTypeInfo no_tag_functor_arg_type;
-	public java.lang.String no_tag_functor_arg_name;
-}
-		
Index: java/PseudoTypeInfo.java
===================================================================
RCS file: java/PseudoTypeInfo.java
diff -N java/PseudoTypeInfo.java
--- java/PseudoTypeInfo.java	23 Feb 2001 01:11:02 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-//
-// Copyright (C) 2001 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 abstract class PseudoTypeInfo {
-	// This class is intentionally empty. 
-	// XXX PsuedoTypeInfo's have not been implemented yet.
-	//     They should all extend this class.
-}
Index: java/Sectag_Locn.java
===================================================================
RCS file: java/Sectag_Locn.java
diff -N java/Sectag_Locn.java
--- java/Sectag_Locn.java	28 Jan 2002 07:52:54 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,23 +0,0 @@
-//
-// 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 Sectag_Locn {
-	
-	public static final int MR_SECTAG_NONE = 0;
-	public static final int MR_SECTAG_LOCAL = 1;
-	public static final int MR_SECTAG_REMOTE = 2;
-
-	public int value;
-
-	public Sectag_Locn(int arg) {
-		this.value = arg;
-	}
-}
-
-
-
Index: java/TypeCtorInfo_Struct.java
===================================================================
RCS file: java/TypeCtorInfo_Struct.java
diff -N java/TypeCtorInfo_Struct.java
--- java/TypeCtorInfo_Struct.java	8 Feb 2002 00:42:22 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-//
-// 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 TypeCtorInfo_Struct {
-    
-	public int                              arity;
-	public int                              type_ctor_version;
-	public mercury.runtime.TypeCtorRep      type_ctor_rep;
-	public int                              type_ctor_num_ptags; // if DU
-	public mercury.runtime.MethodPtr        unify_pred;
-	public mercury.runtime.MethodPtr        compare_pred;
-	public java.lang.String                 type_ctor_module_name;
-	public java.lang.String                 type_ctor_name;
-	public mercury.runtime.TypeFunctors     type_functors;
-	public mercury.runtime.TypeLayout       type_layout;
-	public int 			        type_ctor_num_functors;
-}
Index: java/TypeCtorRep.java
===================================================================
RCS file: java/TypeCtorRep.java
diff -N java/TypeCtorRep.java
--- java/TypeCtorRep.java	30 Jan 2002 05:08:50 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,60 +0,0 @@
-//
-// 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_FUNC = 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;
-	}
-}
-	
Index: java/TypeFunctors.java
===================================================================
RCS file: java/TypeFunctors.java
diff -N java/TypeFunctors.java
--- java/TypeFunctors.java	23 Feb 2001 01:11:02 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-//
-// Copyright (C) 2001 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;
-
-//   XXX In the C backend this was a union.  
-//   It would (eventually) be better to have derived classes
-//   for each of the unions constructors and make them all extend
-//   this class (rather like we do with the generated code from the 
-//   mercury compiler.  That way we can just use the `instanceof' operator
-//   to work out what each instance is.
-
-public class TypeFunctors {
-	public java.lang.Object functors_init;
-	public mercury.runtime.DuFunctorDesc[] functors_du;
-	public mercury.runtime.EnumFunctorDesc[] functors_enum;
-	public mercury.runtime.NotagFunctorDesc functors_notag;
-}
Index: java/TypeLayout.java
===================================================================
RCS file: java/TypeLayout.java
diff -N java/TypeLayout.java
--- java/TypeLayout.java	23 Feb 2001 01:11:02 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,35 +0,0 @@
-//
-// Copyright (C) 2001 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 TypeLayout {
-		//
-		// In runtime/mercury_type_info.h:
-		// typedef MR_DuPtagLayout *MR_DuTypeLayout;
-		// so here we just use DuPtagLayout[]
-		//
-	public mercury.runtime.DuPtagLayout[] layout_du;
-		//
-		// In runtime/mercury_type_info.h:
-		// typedef MR_EnumFunctorDesc **EnumTypeLayout;
-		// so here we just use EnumFunctorDesc[][]
-		//
-	public mercury.runtime.EnumFunctorDesc[] layout_enum;
-		//
-		// In runtime/mercury_type_info.h:
-		// typedef MR_NotagFunctorDesc *MR_NotagTypeLayout;
-		// so here we just us NotagFunctorDesc[]
-		//
-	public mercury.runtime.NotagFunctorDesc[] layout_notag;
-		//
-		// In runtime/mercury_type_info.h:
-		// typedef MR_PseudoTypeInfo MR_EquivType;
-		// so here we just use MR_PseudoTypeInfo
-		//
-	public mercury.runtime.PseudoTypeInfo layout_equiv;
-}
-	
Index: java/UnreachableDefault.java
===================================================================
RCS file: java/UnreachableDefault.java
diff -N java/UnreachableDefault.java
--- java/UnreachableDefault.java	23 Feb 2001 01:11:02 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-//
-// Copyright (C) 2001 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.
-//
-// This exception signals when an unreachable default case of of a switch
-// statement is reached.
-//
-
-package mercury.runtime;
-
-public class UnreachableDefault extends java.lang.RuntimeException {
-	
-	public UnreachableDefault() {
-		super();
-	}
-
-	public UnreachableDefault(String s) {
-		super(s);
-	}
-}
Index: java/library/assoc_list.java
===================================================================
RCS file: java/library/assoc_list.java
diff -N java/library/assoc_list.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/assoc_list.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class assoc_list
+ {
+ }
+
Index: java/library/bool.java
===================================================================
RCS file: java/library/bool.java
diff -N java/library/bool.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/bool.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class bool
+ {
+ }
+
Index: java/library/builtin.java
===================================================================
RCS file: java/library/builtin.java
diff -N java/library/builtin.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/builtin.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,32 @@
+
+//
+// Copyright (C) 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;
+
+public class builtin 
+ { 
+
+    public static mercury.private_builtin.type_info_1 builtin__type_ctor_info_int_0 = new mercury.private_builtin.type_info_1();
+    
+    public static mercury.private_builtin.type_info_1 builtin__type_ctor_info_string_0 = new mercury.private_builtin.type_info_1();
+
+    public static class comparison_result_0 {
+      public static final int f_equal = (int) 0;
+      public static final int f_less_than = (int) 1;
+      public static final int f_greater_than = (int) 2;
+      public int value;
+
+      public comparison_result_0(int val) {
+        this.value = val;
+        return;
+      }
+    }
+  
+ }
+
+
Index: java/library/deconstruct.java
===================================================================
RCS file: java/library/deconstruct.java
diff -N java/library/deconstruct.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/deconstruct.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class deconstruct
+ {
+ }
+
Index: java/library/enum.java
===================================================================
RCS file: java/library/enum.java
diff -N java/library/enum.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/enum.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class enum
+ {
+ }
+
Index: java/library/integer.java
===================================================================
RCS file: java/library/integer.java
diff -N java/library/integer.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/integer.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class integer
+ {
+ }
+
Index: java/library/io.java
===================================================================
RCS file: java/library/io.java
diff -N java/library/io.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/io.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,30 @@
+//
+// Copyright (C) 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;
+import java.lang.System;
+
+public class io
+ {
+    public static void write_string_3_p_0(java.lang.String text)
+     {
+        System.out.print(text);
+     }
+ 
+    public static void write_int_3_p_0(int val)
+     {
+        System.out.print(val);
+     }
+    
+    public static void nl_2_p_0()
+     {
+        System.out.print("\n");
+     }
+
+    public static mercury.private_builtin.type_info_1 io__type_ctor_info_state_0 = new mercury.private_builtin.type_info_1();
+ }
+
Index: java/library/list.java
===================================================================
RCS file: java/library/list.java
diff -N java/library/list.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/list.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,62 @@
+//
+// Copyright (C) 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;
+
+public class list 
+ { 
+
+    public static class list_1
+     {  public int data_tag;
+    
+        public static class f_nil_0 extends list_1
+	 {   
+	    public f_nil_0() 
+	     {
+                this.data_tag = 0;
+	     }
+	 
+	 }
+
+        public static class f_cons_2 extends list_1
+	 {  
+	    public java.lang.Object F1;
+	    public list_1 F2;
+
+	    public f_cons_2(java.lang.Object item, list_1 list)
+	     {
+		 this.data_tag = 1;
+		 F1 = item;
+		 F2 = list;
+		 
+             }
+         }
+        
+	public list_1()
+	 {
+	 }
+
+     }
+
+    public static java.lang.Object foldl_4_p_0(
+		    mercury.private_builtin.type_info_1 ignore1,
+		    mercury.private_builtin.type_info_1 ignore2,
+		    java.lang.Object[] methodptrstruct,
+		    mercury.list.list_1 list,
+		    java.lang.Object nothing)
+     {
+	mercury.runtime.MethodPtr methodptr = (mercury.runtime.MethodPtr) methodptrstruct[1];
+	     int count;
+	while(list.data_tag == 1)
+	 {  methodptr.call___0_0(new java.lang.Object[] {null, ((mercury.list.list_1.f_cons_2) list).F1, null});
+	    list = (list_1) ((mercury.list.list_1.f_cons_2) list).F2;
+	 }
+	     
+       return null;
+     }
+ }
+
Index: java/library/map.java
===================================================================
RCS file: java/library/map.java
diff -N java/library/map.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/map.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class map
+ {
+ }
+
Index: java/library/mer_int.java
===================================================================
RCS file: java/library/mer_int.java
diff -N java/library/mer_int.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/mer_int.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,19 @@
+//
+// Copyright (C) 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;
+
+public class mer_int
+ {
+    public static int mod_2_f_0(int val1, int val2)
+     {
+        return val1 % val2;
+     }
+ 
+
+ }
+
Index: java/library/mr_char.java
===================================================================
RCS file: java/library/mr_char.java
diff -N java/library/mr_char.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/mr_char.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class mr_char
+ {
+ }
+
Index: java/library/mr_float.java
===================================================================
RCS file: java/library/mr_float.java
diff -N java/library/mr_float.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/mr_float.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class mr_float
+ {
+ }
+
Index: java/library/mr_int.java
===================================================================
RCS file: java/library/mr_int.java
diff -N java/library/mr_int.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/mr_int.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,31 @@
+//
+// Copyright (C) 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;
+
+public class mr_int
+ {
+    public static int mod_2_f_0(int val1, int val2)
+     {
+        return val1 - (val1 / val2) * val2;
+     }
+    
+    public static int f_47_47_2_f_0(int val1, int val2)
+     {
+        int div_res = val1 / val2;
+	int rem_res = val1 % val2;
+
+	return div_res;
+     }
+    
+    public static int f_plus_2_f_0(int val1, int val2)
+     {
+	return val1 + val2;
+     }
+ 
+ }
+
Index: java/library/ops.java
===================================================================
RCS file: java/library/ops.java
diff -N java/library/ops.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/ops.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class ops
+ {
+ }
+
Index: java/library/private_builtin.java
===================================================================
RCS file: java/library/private_builtin.java
diff -N java/library/private_builtin.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/private_builtin.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,57 @@
+
+//
+// Copyright (C) 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;
+
+public class private_builtin 
+ { 
+    public static class type_info_1
+     {
+	public int                              arity;
+	public int                              type_ctor_version;
+	public mercury.runtime.TypeCtorRep      type_ctor_rep;
+	public int                              type_ctor_num_ptags; // if DU
+	public mercury.runtime.MethodPtr        unify_pred;
+	public mercury.runtime.MethodPtr        compare_pred;
+	public java.lang.String                 type_ctor_module_name;
+	public java.lang.String                 type_ctor_name;
+	public mercury.runtime.TypeFunctors     type_functors;
+	public mercury.runtime.TypeLayout       type_layout;
+	public int 			        type_ctor_num_functors;
+   }
+   
+    public static mercury.builtin.comparison_result_0 builtin_compare_int_3_p_0(int val1, int val2)
+     {
+        if(val1 == val2)
+	     return new mercury.builtin.comparison_result_0(mercury.builtin.comparison_result_0.f_equal);
+	else if(val1 < val2)
+	     return new mercury.builtin.comparison_result_0(mercury.builtin.comparison_result_0.f_less_than);
+	else
+	     return new mercury.builtin.comparison_result_0(mercury.builtin.comparison_result_0.f_greater_than);
+	
+     }
+
+    public static mercury.builtin.comparison_result_0 builtin_compare_string_3_p_0(java.lang.String string1, java.lang.String string2)
+     {
+	int value = string1.compareTo(string2);
+	
+        if(value == 0)
+	     return new mercury.builtin.comparison_result_0(mercury.builtin.comparison_result_0.f_equal);
+	else if(value < 0)
+	     return new mercury.builtin.comparison_result_0(mercury.builtin.comparison_result_0.f_less_than);
+	else
+	     return new mercury.builtin.comparison_result_0(mercury.builtin.comparison_result_0.f_greater_than);
+     }
+    
+
+    public static void compare_error_0_p_0()
+     {
+	throw new java.lang.Error("internal error in compare/3");
+     }
+ }
+
Index: java/library/require.java
===================================================================
RCS file: java/library/require.java
diff -N java/library/require.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/require.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class require
+ {
+ }
+
Index: java/library/set.java
===================================================================
RCS file: java/library/set.java
diff -N java/library/set.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/set.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class set
+ {
+ }
+
Index: java/library/std_util.java
===================================================================
RCS file: java/library/std_util.java
diff -N java/library/std_util.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/std_util.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,19 @@
+//
+// Copyright (C) 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;
+
+public class std_util
+ {
+ 
+    public static boolean semidet_succeed_0_p_0()
+     {
+        return true;
+     }
+
+ }
+
Index: java/library/string.java
===================================================================
RCS file: java/library/string.java
diff -N java/library/string.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/string.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class string
+ {
+ }
+
Index: java/library/term.java
===================================================================
RCS file: java/library/term.java
diff -N java/library/term.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/term.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class term
+ {
+ }
+
Index: java/library/time.java
===================================================================
RCS file: java/library/time.java
diff -N java/library/time.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/time.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class time
+ {
+ }
+
Index: java/library/tree234.java
===================================================================
RCS file: java/library/tree234.java
diff -N java/library/tree234.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/tree234.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class tree234
+ {
+ }
+
Index: java/library/type_desc.java
===================================================================
RCS file: java/library/type_desc.java
diff -N java/library/type_desc.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/library/type_desc.java	8 Feb 2002 04:30:32 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 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;
+
+public class type_desc
+ {
+ }
+
Index: java/runtime/Commit.java
===================================================================
RCS file: java/runtime/Commit.java
diff -N java/runtime/Commit.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/Commit.java	8 Feb 2002 00:42:22 -0000
@@ -0,0 +1,14 @@
+//
+// Copyright (C) 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.
+//
+// This is a throwable class used for the Java implementation of commits.
+// 
+
+package mercury.runtime;
+
+public class Commit extends java.lang.Error {
+
+}
+
Index: java/runtime/DuExistInfo.java
===================================================================
RCS file: java/runtime/DuExistInfo.java
diff -N java/runtime/DuExistInfo.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/DuExistInfo.java	23 Feb 2001 01:11:02 -0000
@@ -0,0 +1,16 @@
+//
+// Copyright (C) 2001 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 DuExistInfo {
+	
+	public int exist_typeinfos_plain;
+	public int exist_typeinfos_in_tci;
+	public int exist_tcis;
+	public /* final */ mercury.runtime.DuExistLocn[] exist_typeinfo_locns;
+
+}
Index: java/runtime/DuExistLocn.java
===================================================================
RCS file: java/runtime/DuExistLocn.java
diff -N java/runtime/DuExistLocn.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/DuExistLocn.java	23 Feb 2001 01:11:02 -0000
@@ -0,0 +1,14 @@
+//
+// Copyright (C) 2001 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 DuExistLocn {
+	
+	public int exist_arg_num;
+	public int exist_offset_in_tci;
+
+}
Index: java/runtime/DuFunctorDesc.java
===================================================================
RCS file: java/runtime/DuFunctorDesc.java
diff -N java/runtime/DuFunctorDesc.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/DuFunctorDesc.java	23 Feb 2001 01:11:02 -0000
@@ -0,0 +1,24 @@
+//
+// Copyright (C) 2001 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 DuFunctorDesc {
+    
+	public java.lang.String du_functor_name;
+	public int du_functor_orig_arity;
+	public int du_functor_arg_type_contains_var;
+	public mercury.runtime.Sectag_Locn du_functor_sectag_locn;
+	public int du_functor_primary;
+	public int du_functor_secondary;
+	public int du_functor_ordinal;
+	// XXX PseudoTypeInfo's have not been implemented properly
+	//     yet, so this may not be correct.
+	public /*final*/ mercury.runtime.PseudoTypeInfo[] du_functor_arg_types;
+	public /*final*/ java.lang.String[] du_functor_arg_names;
+	public /*final*/ mercury.runtime.DuExistInfo[] du_functor_exist_info;
+
+}
Index: java/runtime/DuPtagLayout.java
===================================================================
RCS file: java/runtime/DuPtagLayout.java
diff -N java/runtime/DuPtagLayout.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/DuPtagLayout.java	23 Feb 2001 01:11:02 -0000
@@ -0,0 +1,15 @@
+//
+// Copyright (C) 2001 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 DuPtagLayout {
+	
+	public int sectag_sharers;
+	public mercury.runtime.Sectag_Locn sectag_locn;
+	public /* final */ DuFunctorDesc[] sectag_alternatives;
+
+}
Index: java/runtime/EnumFunctorDesc.java
===================================================================
RCS file: java/runtime/EnumFunctorDesc.java
diff -N java/runtime/EnumFunctorDesc.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/EnumFunctorDesc.java	23 Feb 2001 01:11:02 -0000
@@ -0,0 +1,14 @@
+//
+// Copyright (C) 2001 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 EnumFunctorDesc {
+	
+	public java.lang.String enum_functor_name;
+	public int              enum_functor_ordinal;
+
+}
Index: java/runtime/JavaInternal.java
===================================================================
RCS file: java/runtime/JavaInternal.java
diff -N java/runtime/JavaInternal.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/JavaInternal.java	23 Feb 2001 01:11:02 -0000
@@ -0,0 +1,20 @@
+//
+// Copyright (C) 2001 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.
+//
+//
+// All modifications to this file will require changes to:
+// compiler/mlds_to_java.m
+// 
+//
+// At the moment this class is just used to store the command line
+//   arguments.  We can't put them in one of the library modules because
+//   we need to hold them in a class variable in a top level class.   
+//
+
+package mercury.runtime;
+
+public class JavaInternal {
+	public static java.lang.String[] args;
+}
Index: java/runtime/MethodPtr.java
===================================================================
RCS file: java/runtime/MethodPtr.java
diff -N java/runtime/MethodPtr.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/MethodPtr.java	23 Jan 2002 22:22:35 -0000
@@ -0,0 +1,15 @@
+//
+// Copyright (C) 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.
+//
+// This interface is implemented by wrapper classes which are automatically 
+// generated by the Java back-end to implement method pointers in Java.
+//
+
+package mercury.runtime;
+
+public interface MethodPtr {
+	public abstract java.lang.Object call___0_0(java.lang.Object[] args); 
+}
+
Index: java/runtime/NotagFunctorDesc.java
===================================================================
RCS file: java/runtime/NotagFunctorDesc.java
diff -N java/runtime/NotagFunctorDesc.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/NotagFunctorDesc.java	23 Feb 2001 01:11:02 -0000
@@ -0,0 +1,15 @@
+//
+// Copyright (C) 2001 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 NotagFunctorDesc {
+	
+	public java.lang.String no_tag_functor_name;
+	public mercury.runtime.PseudoTypeInfo no_tag_functor_arg_type;
+	public java.lang.String no_tag_functor_arg_name;
+}
+		
Index: java/runtime/PseudoTypeInfo.java
===================================================================
RCS file: java/runtime/PseudoTypeInfo.java
diff -N java/runtime/PseudoTypeInfo.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/PseudoTypeInfo.java	23 Feb 2001 01:11:02 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2001 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 abstract class PseudoTypeInfo {
+	// This class is intentionally empty. 
+	// XXX PsuedoTypeInfo's have not been implemented yet.
+	//     They should all extend this class.
+}
Index: java/runtime/Sectag_Locn.java
===================================================================
RCS file: java/runtime/Sectag_Locn.java
diff -N java/runtime/Sectag_Locn.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/Sectag_Locn.java	28 Jan 2002 07:52:54 -0000
@@ -0,0 +1,23 @@
+//
+// 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 Sectag_Locn {
+	
+	public static final int MR_SECTAG_NONE = 0;
+	public static final int MR_SECTAG_LOCAL = 1;
+	public static final int MR_SECTAG_REMOTE = 2;
+
+	public int value;
+
+	public Sectag_Locn(int arg) {
+		this.value = arg;
+	}
+}
+
+
+
Index: java/runtime/TypeCtorInfo_Struct.java
===================================================================
RCS file: java/runtime/TypeCtorInfo_Struct.java
diff -N java/runtime/TypeCtorInfo_Struct.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/TypeCtorInfo_Struct.java	8 Feb 2002 00:42:22 -0000
@@ -0,0 +1,22 @@
+//
+// 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 TypeCtorInfo_Struct {
+    
+	public int                              arity;
+	public int                              type_ctor_version;
+	public mercury.runtime.TypeCtorRep      type_ctor_rep;
+	public int                              type_ctor_num_ptags; // if DU
+	public mercury.runtime.MethodPtr        unify_pred;
+	public mercury.runtime.MethodPtr        compare_pred;
+	public java.lang.String                 type_ctor_module_name;
+	public java.lang.String                 type_ctor_name;
+	public mercury.runtime.TypeFunctors     type_functors;
+	public mercury.runtime.TypeLayout       type_layout;
+	public int 			        type_ctor_num_functors;
+}
Index: java/runtime/TypeCtorRep.java
===================================================================
RCS file: java/runtime/TypeCtorRep.java
diff -N java/runtime/TypeCtorRep.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/TypeCtorRep.java	30 Jan 2002 05:08:50 -0000
@@ -0,0 +1,60 @@
+//
+// 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_FUNC = 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;
+	}
+}
+	
Index: java/runtime/TypeFunctors.java
===================================================================
RCS file: java/runtime/TypeFunctors.java
diff -N java/runtime/TypeFunctors.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/TypeFunctors.java	23 Feb 2001 01:11:02 -0000
@@ -0,0 +1,21 @@
+//
+// Copyright (C) 2001 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;
+
+//   XXX In the C backend this was a union.  
+//   It would (eventually) be better to have derived classes
+//   for each of the unions constructors and make them all extend
+//   this class (rather like we do with the generated code from the 
+//   mercury compiler.  That way we can just use the `instanceof' operator
+//   to work out what each instance is.
+
+public class TypeFunctors {
+	public java.lang.Object functors_init;
+	public mercury.runtime.DuFunctorDesc[] functors_du;
+	public mercury.runtime.EnumFunctorDesc[] functors_enum;
+	public mercury.runtime.NotagFunctorDesc functors_notag;
+}
Index: java/runtime/TypeLayout.java
===================================================================
RCS file: java/runtime/TypeLayout.java
diff -N java/runtime/TypeLayout.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/TypeLayout.java	23 Feb 2001 01:11:02 -0000
@@ -0,0 +1,35 @@
+//
+// Copyright (C) 2001 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 TypeLayout {
+		//
+		// In runtime/mercury_type_info.h:
+		// typedef MR_DuPtagLayout *MR_DuTypeLayout;
+		// so here we just use DuPtagLayout[]
+		//
+	public mercury.runtime.DuPtagLayout[] layout_du;
+		//
+		// In runtime/mercury_type_info.h:
+		// typedef MR_EnumFunctorDesc **EnumTypeLayout;
+		// so here we just use EnumFunctorDesc[][]
+		//
+	public mercury.runtime.EnumFunctorDesc[] layout_enum;
+		//
+		// In runtime/mercury_type_info.h:
+		// typedef MR_NotagFunctorDesc *MR_NotagTypeLayout;
+		// so here we just us NotagFunctorDesc[]
+		//
+	public mercury.runtime.NotagFunctorDesc[] layout_notag;
+		//
+		// In runtime/mercury_type_info.h:
+		// typedef MR_PseudoTypeInfo MR_EquivType;
+		// so here we just use MR_PseudoTypeInfo
+		//
+	public mercury.runtime.PseudoTypeInfo layout_equiv;
+}
+	
Index: java/runtime/UnreachableDefault.java
===================================================================
RCS file: java/runtime/UnreachableDefault.java
diff -N java/runtime/UnreachableDefault.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ java/runtime/UnreachableDefault.java	23 Feb 2001 01:11:02 -0000
@@ -0,0 +1,21 @@
+//
+// Copyright (C) 2001 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.
+//
+// This exception signals when an unreachable default case of of a switch
+// statement is reached.
+//
+
+package mercury.runtime;
+
+public class UnreachableDefault extends java.lang.RuntimeException {
+	
+	public UnreachableDefault() {
+		super();
+	}
+
+	public UnreachableDefault(String s) {
+		super(s);
+	}
+}


--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list