mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-14 05:12:33 +00:00
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.
63 lines
1.3 KiB
Java
63 lines
1.3 KiB
Java
//
|
|
// 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;
|
|
}
|
|
}
|
|
|