[m-rev.] for review: additions to the temporary Mercury library in Java

Michael Wybrow mjwybrow at cs.mu.OZ.AU
Thu Jan 16 16:49:05 AEDT 2003


This probably doesn't need to be reviewed as such, it certainly wont break
the compiler.  Many of the new files are empty, and most of the additional
code was generated by the Java back-end anyway.  I just wanted to commit
this because it allows me to run the back-end over a few extra test cases
and hopefully make sure my changes are leading forwards rather than
backwards.  :)

Michael


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

Estimated hours taken: 4
Branches: main

Add some more code to the temporary, partial Java versions of the
Mercury library modules.  This allows us to test the Java back-end
on a few extra test cases and could help prevent regression errors.


mercury/java/library/array.java:
mercury/java/library/benchmarking.java:
mercury/java/library/bintree.java:
mercury/java/library/bintree_set.java:
mercury/java/library/construct.java:
mercury/java/library/dir.java:
mercury/java/library/exception.java:
mercury/java/library/lexer.java:
mercury/java/library/math.java:
mercury/java/library/parser.java:
mercury/java/library/random.java:
mercury/java/library/rtti_implementation.java:
mercury/java/library/set_ordlist.java:
mercury/java/library/set_unordlist.java:
mercury/java/library/store.java:
mercury/java/library/table_builtin.java:
mercury/java/library/term_io.java:
mercury/java/library/varset.java:
	Added these files.  They are partial (or empty) versions of
	the Mercury library modules written in Java.

mercury/java/library/bool.java:
mercury/java/library/builtin.java:
mercury/java/library/io.java:
mercury/java/library/mr_int.java:
mercury/java/library/private_builtin.java:
mercury/java/library/std_util.java:
mercury/java/library/string.java:
	Add additional code to these files.


Index: library/array.java
===================================================================
RCS file: library/array.java
diff -N library/array.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/array.java	8 Jan 2003 02:19:17 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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 array
+ {
+ }
+
Index: library/benchmarking.java
===================================================================
RCS file: library/benchmarking.java
diff -N library/benchmarking.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/benchmarking.java	8 Jan 2003 02:19:41 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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 benchmarking
+ {
+ }
+
Index: library/bintree.java
===================================================================
RCS file: library/bintree.java
diff -N library/bintree.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/bintree.java	8 Jan 2003 02:19:54 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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 bintree
+ {
+ }
+
Index: library/bintree_set.java
===================================================================
RCS file: library/bintree_set.java
diff -N library/bintree_set.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/bintree_set.java	8 Jan 2003 02:20:10 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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 bintree_set
+ {
+ }
+
Index: library/bool.java
===================================================================
RCS file: /home/mercury1/repository/mercury/java/library/bool.java,v
retrieving revision 1.1
diff -u -r1.1 bool.java
--- library/bool.java	11 Feb 2002 06:31:24 -0000	1.1
+++ library/bool.java	16 Jan 2003 04:51:27 -0000
@@ -9,5 +9,16 @@
 
 public class bool
  {
+    public static class bool_0
+     {
+        public static final int no = (int) 0;
+        public static final int yes = (int) 1;
+        public int value;
+   
+        public bool_0(int val) {
+	    this.value = val;
+	    return;
+	}
+     }
  }
 
Index: library/builtin.java
===================================================================
RCS file: /home/mercury1/repository/mercury/java/library/builtin.java,v
retrieving revision 1.2
diff -u -r1.2 builtin.java
--- library/builtin.java	16 Oct 2002 08:15:47 -0000	1.2
+++ library/builtin.java	16 Jan 2003 04:52:07 -0000
@@ -15,6 +15,8 @@
     
     public static mercury.private_builtin.type_info_1 builtin__type_ctor_info_string_0 = new mercury.private_builtin.type_info_1();
 
+    public static mercury.private_builtin.type_info_1 builtin__type_ctor_info_character_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;
@@ -30,14 +32,14 @@
     public static boolean unify_2_p_0(mercury.private_builtin.type_info_1 ti,
 		    java.lang.Object x, java.lang.Object y)
     {
-      throw new Java.lang.Error("unify/3 not implemented");
+      throw new java.lang.Error("unify/3 not implemented");
     }
 
     public static comparison_result_0 compare_3_p_0(
 	mercury.private_builtin.type_info_1 ti,
 	java.lang.Object x, java.lang.Object y)
     {
-      throw new Java.lang.Error("compare/3 not implemented");
+      throw new java.lang.Error("compare/3 not implemented");
     }
  }
 
Index: library/construct.java
===================================================================
RCS file: library/construct.java
diff -N library/construct.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/construct.java	8 Jan 2003 02:20:23 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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 construct
+ {
+ }
+
Index: library/dir.java
===================================================================
RCS file: library/dir.java
diff -N library/dir.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/dir.java	8 Jan 2003 02:20:40 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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 dir
+ {
+ }
+
Index: library/exception.java
===================================================================
RCS file: library/exception.java
diff -N library/exception.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/exception.java	8 Jan 2003 02:20:58 -0000
@@ -0,0 +1,18 @@
+//
+// Copyright (C) 2003 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 exception
+ {
+    public static void throw_1_p_0(mercury.private_builtin.type_info_1 arg1, java.lang.Object arg2)
+     {
+	 throw new java.lang.Error((java.lang.String) arg2);
+     }
+
+ }
+
Index: library/io.java
===================================================================
RCS file: /home/mercury1/repository/mercury/java/library/io.java,v
retrieving revision 1.1
diff -u -r1.1 io.java
--- library/io.java	11 Feb 2002 06:31:24 -0000	1.1
+++ library/io.java	12 Jan 2003 02:13:24 -0000
@@ -20,6 +20,11 @@
         System.out.print(val);
      }
     
+    public static void write_char_3_p_0(char val)
+     {
+        System.out.print(val);
+     }
+
     public static void nl_2_p_0()
      {
         System.out.print("\n");
Index: library/lexer.java
===================================================================
RCS file: library/lexer.java
diff -N library/lexer.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/lexer.java	8 Jan 2003 02:21:12 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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 lexer
+ {
+ }
+
Index: library/math.java
===================================================================
RCS file: library/math.java
diff -N library/math.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/math.java	16 Jan 2003 04:54:09 -0000
@@ -0,0 +1,24 @@
+//
+// Copyright (C) 2003 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 math
+ {
+    public static mercury.private_builtin.type_info_1 math__type_ctor_info_domain_error_0 = new mercury.private_builtin.type_info_1();
+    
+    public static class domain_error_0
+     {
+        public java.lang.String F1 = null;
+
+        public domain_error_0(java.lang.String F1)
+         {
+            ((math.domain_error_0) (this)).F1 = F1;
+         }
+     }
+ }
+
Index: library/mr_int.java
===================================================================
RCS file: /home/mercury1/repository/mercury/java/library/mr_int.java,v
retrieving revision 1.1
diff -u -r1.1 mr_int.java
--- library/mr_int.java	11 Feb 2002 06:31:25 -0000	1.1
+++ library/mr_int.java	16 Jan 2003 05:03:42 -0000
@@ -14,6 +14,11 @@
         return val1 - (val1 / val2) * val2;
      }
     
+    public static int div_2_f_0(int val1, int val2)
+     {
+        return val1 / val2;
+     }
+
     public static int f_47_47_2_f_0(int val1, int val2)
      {
         int div_res = val1 / val2;
@@ -27,5 +32,10 @@
 	return val1 + val2;
      }
  
+    public static boolean domain_checks_0_p_0()
+     {
+	return false;
+     }
+	
  }
 
Index: library/parser.java
===================================================================
RCS file: library/parser.java
diff -N library/parser.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/parser.java	8 Jan 2003 02:21:39 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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 parser
+ {
+ }
+
Index: library/private_builtin.java
===================================================================
RCS file: /home/mercury1/repository/mercury/java/library/private_builtin.java,v
retrieving revision 1.1
diff -u -r1.1 private_builtin.java
--- library/private_builtin.java	11 Feb 2002 06:31:25 -0000	1.1
+++ library/private_builtin.java	16 Jan 2003 05:03:00 -0000
@@ -49,6 +49,11 @@
      }
     
 
+    public static int builtin_strcmp_3_p_0(java.lang.String string1, java.lang.String string2)
+     {
+        return string1.compareTo(string2);
+     }
+    
     public static void compare_error_0_p_0()
      {
 	throw new java.lang.Error("internal error in compare/3");
Index: library/random.java
===================================================================
RCS file: library/random.java
diff -N library/random.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/random.java	8 Jan 2003 02:21:54 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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 random
+ {
+ }
+
Index: library/rtti_implementation.java
===================================================================
RCS file: library/rtti_implementation.java
diff -N library/rtti_implementation.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/rtti_implementation.java	8 Jan 2003 02:22:05 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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 rtti_implementation
+ {
+ }
+
Index: library/set_ordlist.java
===================================================================
RCS file: library/set_ordlist.java
diff -N library/set_ordlist.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/set_ordlist.java	8 Jan 2003 02:22:15 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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_ordlist
+ {
+ }
+
Index: library/set_unordlist.java
===================================================================
RCS file: library/set_unordlist.java
diff -N library/set_unordlist.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/set_unordlist.java	8 Jan 2003 02:22:28 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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_unordlist
+ {
+ }
+
Index: library/std_util.java
===================================================================
RCS file: /home/mercury1/repository/mercury/java/library/std_util.java,v
retrieving revision 1.1
diff -u -r1.1 std_util.java
--- library/std_util.java	11 Feb 2002 06:31:25 -0000	1.1
+++ library/std_util.java	12 Jan 2003 02:35:12 -0000
@@ -15,5 +15,37 @@
         return true;
      }
 
+  public static mercury.list.list_1 cons_3_p_0(
+    mercury.private_builtin.type_info_1 TypeInfo_for_T_6,
+    java.lang.Object H_4,
+    mercury.list.list_1 T_5)
+  {
+    {
+      boolean succeeded = false;
+      mercury.list.list_1 HeadVar__3_3 = null;
+
+      {
+        HeadVar__3_3 = new mercury.list.list_1.f_cons_2(H_4, T_5);
+      }
+      return HeadVar__3_3;
+    }
+  }
+
+  public static class pair_2
+  {
+    public java.lang.Object F1 = null;
+    public java.lang.Object F2 = null;
+
+    public pair_2(
+      java.lang.Object F1,
+      java.lang.Object F2)
+    {
+      {
+        ((mercury.std_util.pair_2) (this)).F1 = F1;
+        ((mercury.std_util.pair_2) (this)).F2 = F2;
+      }
+    }
+  }
+
  }
 
Index: library/store.java
===================================================================
RCS file: library/store.java
diff -N library/store.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/store.java	8 Jan 2003 02:22:51 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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 store
+ {
+ }
+
Index: library/string.java
===================================================================
RCS file: /home/mercury1/repository/mercury/java/library/string.java,v
retrieving revision 1.1
diff -u -r1.1 string.java
--- library/string.java	11 Feb 2002 06:31:25 -0000	1.1
+++ library/string.java	16 Jan 2003 04:57:18 -0000
@@ -9,5 +9,17 @@
 
 public class string
  {
+    public static java.lang.String append_3_p_2(java.lang.String s1, java.lang.String s2)
+     {
+        return s1.concat(s2);
+     }
+
+    public static java.lang.Object [] append_3_p_1(java.lang.String s1, java.lang.String s2)
+     {
+	java.lang.Boolean success = new java.lang.Boolean(s2.startsWith(s1));
+	java.lang.String answer = s2.substring(s1.length());
+	java.lang.Object [] result = {(java.lang.Object) success, (java.lang.Object) answer};
+        return result;
+     }
  }
 
Index: library/table_builtin.java
===================================================================
RCS file: library/table_builtin.java
diff -N library/table_builtin.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/table_builtin.java	8 Jan 2003 02:23:03 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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 table_builtin
+ {
+ }
+
Index: library/term_io.java
===================================================================
RCS file: library/term_io.java
diff -N library/term_io.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/term_io.java	8 Jan 2003 02:23:15 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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_io
+ {
+ }
+
Index: library/varset.java
===================================================================
RCS file: library/varset.java
diff -N library/varset.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/varset.java	8 Jan 2003 02:23:34 -0000
@@ -0,0 +1,13 @@
+//
+// Copyright (C) 2003 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 varset
+ {
+ }
+


--------------------------------------------------------------------------
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