[m-rev.] for review: java enumerations

Peter Wang novalazy at gmail.com
Tue May 26 11:42:15 AEST 2009


Branches: main

For Java backend, use static instances to represent enumeration constants
instead of dynamically allocating them.  This is similar to using native Java
enums but leaves the possibility of manually assigning ordinal values, which
might be needed to make `:- pragma foreign_enum' do something sensible.

Support `:- pragma foreign_export_enum' for Java.


compiler/add_pragma.m:
        Don't abort on seeing `:- pragma foreign_export_enum' for Java.

compiler/export.m:
        Only output exported enums if `:- pragma foreign_export_enum' was
        declared for C.  Previously it ignored the language.

compiler/mlds.m:
        Remember in `mlds_exported_enum' the type constructor of the exported
        enumeration.  This is needed for mlds_to_java.m.

        Delete the `mlds_type' in `mlds_exported_enum' as it was useless.

        For each exported constant, keep a `mlds_initializer' of its integer
        value, instead of a `mlds_entity_defn'.

compiler/ml_type_gen.m:
compiler/mlds_to_c.m:
        Conform to previous changes.

compiler/mlds_to_java.m:
        Output static instances of enumeration constants.  These are named
        `K<n>' where <n> is the integer value of the constant.

        Use the `K<n>' instances instead of dynamically allocating objects
        for enumeration classes.

        Don't output int fields which hold the integer value for each
        enumeration constructor as they are now useless.

        Output foreign exported enumerations.  These are static class members
        (at the module level) which point to the `K<n>' instances, giving
        them predictable names for foreign code.

library/io.m:
        Fix Java implementation of `io.file_type_2' which previously relied
        on the representation of enums.

diff --git a/compiler/add_pragma.m b/compiler/add_pragma.m
index aaeef6a..d49508d 100644
--- a/compiler/add_pragma.m
+++ b/compiler/add_pragma.m
@@ -879,7 +879,7 @@ build_export_enum_name_map(ContextPieces, Lang,
TypeName, TypeArity,
         list.cons(InvalidRenamingSpec, !Specs),
         MaybeMapping = no
         % NOTE: in the presence of this error we do not report if
-        % contructors could not be converted to names in the foreign
+        % constructors could not be converted to names in the foreign
         % language.
     ;
         (
@@ -892,8 +892,10 @@ build_export_enum_name_map(ContextPieces, Lang,
TypeName, TypeArity,
                 Lang = lang_c,
                 What = "C identifiers."
             ;
+                Lang = lang_java,
+                What = "Java identifiers."
+            ;
                 ( Lang = lang_csharp
-                ; Lang = lang_java
                 ; Lang = lang_il
                 ; Lang = lang_erlang
                 ),
@@ -994,11 +996,13 @@ add_ctor_to_name_map(Lang, Prefix,
MakeUpperCase, _TypeModQual, Ctor,
     ),
     ForeignName = Prefix ++ ForeignNameTail,
     (
-        Lang  = lang_c,
+        Lang = lang_c,
+        IsValidForeignName = pred_to_bool(is_valid_c_identifier(ForeignName))
+    ;
+        Lang = lang_java,
         IsValidForeignName = pred_to_bool(is_valid_c_identifier(ForeignName))
     ;
         ( Lang = lang_csharp
-        ; Lang = lang_java
         ; Lang = lang_il
         ; Lang = lang_erlang
         ),
diff --git a/compiler/export.m b/compiler/export.m
index 9760b8a..951f2b6 100644
--- a/compiler/export.m
+++ b/compiler/export.m
@@ -801,6 +801,22 @@ output_foreign_decl(MaybeDesiredIsLocal, DeclCode, !IO) :-
     io::di, io::uo) is det.

 output_exported_enum(ModuleInfo, ExportedEnumInfo, !IO) :-
+    ExportedEnumInfo = exported_enum_info(Lang, _, _, _),
+    (
+        Lang = lang_c,
+        output_exported_enum_2(ModuleInfo, ExportedEnumInfo, !IO)
+    ;
+        ( Lang = lang_csharp
+        ; Lang = lang_java
+        ; Lang = lang_il
+        ; Lang = lang_erlang
+        )
+    ).
+
+:- pred output_exported_enum_2(module_info::in, exported_enum_info::in,
+    io::di, io::uo) is det.
+
+output_exported_enum_2(ModuleInfo, ExportedEnumInfo, !IO) :-
     ExportedEnumInfo = exported_enum_info(_Lang, Context, TypeCtor,
         NameMapping),
     module_info_get_type_table(ModuleInfo, TypeTable),
@@ -835,7 +851,7 @@ output_exported_enum(ModuleInfo, ExportedEnumInfo, !IO) :-
             term.context_line(Context, Line),
             c_util.set_line_num(File, Line, !IO),
             io.write_list(ForeignNamesAndTags, "\n",
-                output_exported_enum_2(ModuleInfo), !IO),
+                output_exported_enum_3(ModuleInfo), !IO),
             io.nl(!IO),
             c_util.reset_line_num(!IO)
         )
@@ -848,10 +864,10 @@ output_exported_enum(ModuleInfo, ExportedEnumInfo, !IO) :-
     --->    ee_tag_rep_int(int)
     ;       ee_tag_rep_string(string).

-:- pred output_exported_enum_2(module_info::in,
+:- pred output_exported_enum_3(module_info::in,
     pair(string, exported_enum_tag_rep)::in, io::di, io::uo) is det.

-output_exported_enum_2(_, ConstName - Tag, !IO) :-
+output_exported_enum_3(_, ConstName - Tag, !IO) :-
     (
         Tag = ee_tag_rep_int(RawIntTag),
         io.format("#define %s %d", [s(ConstName), i(RawIntTag)], !IO)
diff --git a/compiler/ml_type_gen.m b/compiler/ml_type_gen.m
index 980e348..47db570 100644
--- a/compiler/ml_type_gen.m
+++ b/compiler/ml_type_gen.m
@@ -1123,17 +1123,17 @@ ml_gen_exported_enum(_ModuleInfo, TypeTable,
ExportedEnumInfo,
             _IsEnumOrDummy, _MaybeUserEq, _ReservedTag, _ReservedAddr,
             _IsForeignType),
         list.foldl(generate_foreign_enum_constant(Mapping, TagValues),
-            Ctors, [], NamesAndTags),
-        MLDS_ExportedEnum = mlds_exported_enum(Lang, Context,
-            mlds_native_int_type, NamesAndTags)
+            Ctors, [], ExportConstants),
+        MLDS_ExportedEnum = mlds_exported_enum(Lang, Context, TypeCtor,
+            ExportConstants)
     ).

 :- pred generate_foreign_enum_constant(map(sym_name, string)::in,
     cons_tag_values::in, constructor::in,
-    assoc_list(string, mlds_entity_defn)::in,
-    assoc_list(string, mlds_entity_defn)::out) is det.
+    list(mlds_exported_enum_constant)::in,
+    list(mlds_exported_enum_constant)::out) is det.

-generate_foreign_enum_constant(Mapping, TagValues, Ctor, !NamesAndTags) :-
+generate_foreign_enum_constant(Mapping, TagValues, Ctor, !ExportConstants) :-
     Ctor = ctor(_, _, QualName, Args, _),
     list.length(Args, Arity),
     map.lookup(TagValues, cons(QualName, Arity), TagVal),
@@ -1164,12 +1164,12 @@ generate_foreign_enum_constant(Mapping,
TagValues, Ctor, !NamesAndTags) :-
     ),
     % Sanity check.
     expect(unify(Arity, 0), this_file, "enum constant arity != 0"),
-    EntityDefn = mlds_data(mlds_native_int_type, init_obj(ConstValue),
-        gc_no_stmt),
     UnqualName = unqualify_name(QualName),
     UnqualSymName = unqualified(UnqualName),
     map.lookup(Mapping, UnqualSymName, ForeignName),
-    !:NamesAndTags = [ForeignName - EntityDefn | !.NamesAndTags].
+    ExportConstant = mlds_exported_enum_constant(ForeignName,
+        init_obj(ConstValue)),
+    !:ExportConstants = [ExportConstant | !.ExportConstants].

 %-----------------------------------------------------------------------------%

diff --git a/compiler/mlds.m b/compiler/mlds.m
index de58e48..e0f72c1 100644
--- a/compiler/mlds.m
+++ b/compiler/mlds.m
@@ -343,7 +343,6 @@
 :- import_module parse_tree.prog_type.
 :- import_module parse_tree.prog_foreign.

-:- import_module assoc_list.
 :- import_module bool.
 :- import_module list.
 :- import_module map.
@@ -379,6 +378,7 @@
                 % The names of init and final preds.
                 % XXX These only work for the C backend because initialisers
                 % and finalisers do not (yet) work for the other backends.
+                % (These should possibly be moved into mlds_foreign_code_map.)
                 mlds_init_preds         :: list(string),
                 mlds_final_preds        :: list(string),
                 mlds_exported_enums     :: list(mlds_exported_enum)
@@ -1748,15 +1748,17 @@

 :- type mlds_exported_enum
     --->    mlds_exported_enum(
-                foreign_language,       % For sanity checking only.
-                prog_context,
-                mlds_type,              % Type of the constants (hard coded as
-                                        % mlds_native_int_type in
-                                        % ml_type_gen.m.)
-
-                assoc_list(string, mlds_entity_defn)
-                % The name of each constant
-                % plus a value to initialize it to.
+                exported_enum_lang      :: foreign_language,
+                exported_enum_context   :: prog_context,
+                exported_enum_type_ctor :: type_ctor,
+                exported_enum_constants :: list(mlds_exported_enum_constant)
+                % The name of each constant plus a value to initialize it to.
+            ).
+
+:- type mlds_exported_enum_constant
+    --->    mlds_exported_enum_constant(
+                exported_enum_constant_name     :: string,
+                exported_enum_constant_value    :: mlds_initializer
             ).

 %-----------------------------------------------------------------------------%
diff --git a/compiler/mlds_to_c.m b/compiler/mlds_to_c.m
index cd92c39..ae15cea 100644
--- a/compiler/mlds_to_c.m
+++ b/compiler/mlds_to_c.m
@@ -1221,14 +1221,14 @@ mlds_output_export_enums(ExportedEnums, Indent, !IO) :-
     io::di, io::uo) is det.

 mlds_output_export_enum(_Indent, ExportedEnum, !IO) :-
-    ExportedEnum = mlds_exported_enum(Lang, Context, _Type,
-        NamesAndTags0),
+    ExportedEnum = mlds_exported_enum(Lang, Context, _TypeCtor,
+        ExportConstants0),
     (
         Lang = lang_c,
         output_context(mlds_make_context(Context), !IO),
         % We reverse the list so the constants are printed out in order.
-        list.reverse(NamesAndTags0, NamesAndTags),
-        list.foldl(mlds_output_exported_enum_constant, NamesAndTags, !IO)
+        list.reverse(ExportConstants0, ExportConstants),
+        list.foldl(mlds_output_exported_enum_constant, ExportConstants, !IO)
     ;
         ( Lang = lang_csharp
         ; Lang = lang_java
@@ -1237,33 +1237,28 @@ mlds_output_export_enum(_Indent, ExportedEnum, !IO) :-
         )
     ).

-:- pred mlds_output_exported_enum_constant(pair(string, mlds_entity_defn)::in,
+:- pred mlds_output_exported_enum_constant(mlds_exported_enum_constant::in,
     io::di, io::uo) is det.

-mlds_output_exported_enum_constant(NameAndTag, !IO) :-
-    NameAndTag = Name - Tag,
+mlds_output_exported_enum_constant(ExportedConstant, !IO) :-
+    ExportedConstant = mlds_exported_enum_constant(Name, Initializer),
     io.write_string("#define ", !IO),
     io.write_string(Name, !IO),
     io.write_string(" ", !IO),
-    ( Tag = mlds_data(mlds_native_int_type, Initializer, gc_no_stmt) ->
-        (
-            Initializer = init_obj(const(mlconst_int(Value)))
-        ->
-            io.write_int(Value, !IO)
-        ;
-            Initializer = init_obj(const(mlconst_foreign(Lang, Value,
-                mlds_native_int_type)))
-        ->
-            expect(unify(Lang, lang_c), this_file,
-                "mlconst_foreign for language other than C."),
-            io.write_string(Value, !IO)
-        ;
-            unexpected(this_file,
-                "tag for export enumeration is not integer or foreign")
-        )
+    (
+        Initializer = init_obj(const(mlconst_int(Value)))
+    ->
+        io.write_int(Value, !IO)
+    ;
+        Initializer = init_obj(const(mlconst_foreign(Lang, Value,
+            mlds_native_int_type)))
+    ->
+        expect(unify(Lang, lang_c), this_file,
+            "mlconst_foreign for language other than C."),
+        io.write_string(Value, !IO)
     ;
         unexpected(this_file,
-            "exported enumeration constant is not mlds_data")
+            "tag for export enumeration is not integer or foreign")
     ),
     io.nl(!IO).

diff --git a/compiler/mlds_to_java.m b/compiler/mlds_to_java.m
index 1d91b9c..d840e2c 100644
--- a/compiler/mlds_to_java.m
+++ b/compiler/mlds_to_java.m
@@ -318,7 +318,7 @@ output_import(Import, !IO) :-
 output_java_src_file(ModuleInfo, Indent, MLDS, !IO) :-
     % Run further transformations on the MLDS.
     MLDS = mlds(ModuleName, AllForeignCode, Imports, Defns0,
-        InitPreds, _FinalPreds, _ExportedEnums),
+        InitPreds, _FinalPreds, ExportedEnums),

     % Do NOT enforce the outermost "mercury" qualifier here.  This module
     % name is compared with other module names in the MLDS, to avoid
@@ -363,6 +363,8 @@ output_java_src_file(ModuleInfo, Indent, MLDS, !IO) :-
     io.write_string("\n// ExportDefns\n", !IO),
     output_exports(Indent + 1, ModuleInfo, MLDS_ModuleName, none,
         ExportDefns, !IO),
+    io.write_string("\n// ExportedEnums\n", !IO),
+    output_exported_enums(Indent + 1, ModuleInfo, ExportedEnums, !IO),
     io.write_string("\n// InitPreds\n", !IO),
     output_inits(Indent + 1, ModuleInfo, InitPreds, !IO),
     output_src_end(Indent, ModuleName, !IO).
@@ -378,7 +380,8 @@ output_java_src_file(ModuleInfo, Indent, MLDS, !IO) :-

 output_java_decl(Indent, DeclCode, !IO) :-
     DeclCode = foreign_decl_code(Lang, _IsLocal, Code, Context),
-    (   Lang = lang_java,
+    (
+        Lang = lang_java,
         indent_line(mlds_make_context(Context), Indent, !IO),
         io.write_string(Code, !IO),
         io.nl(!IO)
@@ -485,6 +488,60 @@ output_exports(Indent, ModuleInfo,
MLDS_ModuleName, OutputAux,

 %-----------------------------------------------------------------------------%
 %
+% Code for handling `pragma foreign_export_enum' for Java
+%
+
+:- pred output_exported_enums(indent::in, module_info::in,
+    list(mlds_exported_enum)::in, io::di, io::uo) is det.
+
+output_exported_enums(Indent, ModuleInfo, ExportedEnums, !IO) :-
+    module_info_get_name(ModuleInfo, ModuleName),
+    MLDS_ModuleName = mercury_module_name_to_mlds(ModuleName),
+    list.foldl(output_exported_enum(Indent, ModuleInfo, MLDS_ModuleName),
+        ExportedEnums, !IO).
+
+:- pred output_exported_enum(indent::in, module_info::in, mlds_module_name::in,
+    mlds_exported_enum::in, io::di, io::uo) is det.
+
+output_exported_enum(Indent, ModuleInfo, MLDS_ModuleName, ExportedEnum, !IO) :-
+    ExportedEnum = mlds_exported_enum(Lang, _, TypeCtor, ExportedConstants0),
+    (
+        Lang = lang_java,
+        ml_gen_type_name(TypeCtor, ClassName, ClassArity),
+        MLDS_Type = mlds_class_type(ClassName, ClassArity, mlds_enum),
+        % We reverse the list so the constants are printed out in order.
+        list.reverse(ExportedConstants0, ExportedConstants),
+        list.foldl(output_exported_enum_constant(Indent, ModuleInfo,
+            MLDS_ModuleName, MLDS_Type), ExportedConstants, !IO)
+    ;
+        ( Lang = lang_c
+        ; Lang = lang_csharp
+        ; Lang = lang_il
+        ; Lang = lang_erlang
+        )
+    ).
+
+:- pred output_exported_enum_constant(indent::in, module_info::in,
+    mlds_module_name::in, mlds_type::in, mlds_exported_enum_constant::in,
+    io::di, io::uo) is det.
+
+output_exported_enum_constant(Indent, ModuleInfo, MLDS_ModuleName, MLDS_Type,
+        ExportedConstant, !IO) :-
+    ExportedConstant = mlds_exported_enum_constant(Name, Initializer),
+    indent_line(Indent, !IO),
+    io.write_string("public static final ", !IO),
+    output_type(normal_style, MLDS_Type, !IO),
+    io.write_string(" ", !IO),
+    io.write_string(Name, !IO),
+    io.write_string(" = ", !IO),
+    output_type(normal_style, MLDS_Type, !IO),
+    io.write_string(".K", !IO),
+    % XXX this will break with `:- pragma foreign_enum'
+    output_initializer_body(ModuleInfo, Initializer, no, MLDS_ModuleName, !IO),
+    io.write_string(";\n", !IO).
+
+%-----------------------------------------------------------------------------%
+%
 % Code to search MLDS for all uses of function pointers.
 %

@@ -1285,9 +1342,10 @@ output_class_body(_Indent, _, mlds_struct, _,
_AllMembers, _, _, _) :-
 output_class_body(Indent, ModuleInfo, mlds_enum, Name, AllMembers, _, !IO) :-
     list.filter(defn_is_const, AllMembers, EnumConsts),
     Name = qual(ModuleName, _QualKind, UnqualName),
-    output_enum_constants(Indent + 1, ModuleInfo, ModuleName, EnumConsts, !IO),
+    output_enum_constants(Indent + 1, ModuleInfo, ModuleName, UnqualName,
+        EnumConsts, !IO),
     indent_line(Indent + 1, !IO),
-    io.write_string("public int MR_value;\n\n", !IO),
+    io.write_string("public final int MR_value;\n\n", !IO),
     output_enum_ctor(Indent + 1, UnqualName, !IO).

 %-----------------------------------------------------------------------------%
@@ -1312,7 +1370,7 @@ defn_is_const(Defn) :-

 output_enum_ctor(Indent, UnqualName, !IO) :-
     indent_line(Indent, !IO),
-    io.write_string("public ", !IO),
+    io.write_string("private ", !IO),
     output_name(UnqualName, !IO),
     io.write_string("(int val) {\n", !IO),
     indent_line(Indent + 1, !IO),
@@ -1326,27 +1384,46 @@ output_enum_ctor(Indent, UnqualName, !IO) :-
     io.write_string("}\n", !IO).

 :- pred output_enum_constants(indent::in, module_info::in,
-    mlds_module_name::in, list(mlds_defn)::in, io::di, io::uo) is det.
+    mlds_module_name::in, mlds_entity_name::in, list(mlds_defn)::in,
+    io::di, io::uo) is det.

-output_enum_constants(Indent, ModuleInfo, EnumModuleName, EnumConsts, !IO) :-
+output_enum_constants(Indent, ModuleInfo, EnumModuleName, EnumName,
+        EnumConsts, !IO) :-
     io.write_list(EnumConsts, "\n",
-        output_enum_constant(Indent, ModuleInfo, EnumModuleName), !IO),
+        output_enum_constant(Indent, ModuleInfo, EnumModuleName, EnumName),
+        !IO),
     io.nl(!IO).

 :- pred output_enum_constant(indent::in, module_info::in,
-    mlds_module_name::in, mlds_defn::in, io::di, io::uo) is det.
+    mlds_module_name::in, mlds_entity_name::in, mlds_defn::in,
+    io::di, io::uo) is det.

-output_enum_constant(Indent, ModuleInfo, EnumModuleName, Defn, !IO) :-
+output_enum_constant(Indent, ModuleInfo, EnumModuleName, EnumName, Defn,
+        !IO) :-
     Defn = mlds_defn(Name, _Context, _Flags, DefnBody),
     (
-        DefnBody = mlds_data(Type, Initializer, _GCStatement)
+        DefnBody = mlds_data(_Type, Initializer, _GCStatement)
     ->
+        % Make a static instance of the constant.  The MLDS doesn't retain enum
+        % constructor names so it's easier to derive the name of the constant
+        % later by naming them after the integer values.
+        % XXX this will break with `:- pragma foreign_enum'
         indent_line(Indent, !IO),
-        io.write_string("public static final int ", !IO),
+        io.write_string("public static final ", !IO),
+        output_name(EnumName, !IO),
+        io.write_string(" K", !IO),
+        output_initializer_body(ModuleInfo, Initializer, no, EnumModuleName,
+            !IO),
+        io.write_string(" = new ", !IO),
+        output_name(EnumName, !IO),
+        io.write_string("(", !IO),
+        output_initializer_body(ModuleInfo, Initializer, no, EnumModuleName,
+            !IO),
+        io.write_string(");", !IO),
+
+        io.write_string(" /* ", !IO),
         output_name(Name, !IO),
-        output_initializer(ModuleInfo, EnumModuleName, none, Type,
-            Initializer, !IO),
-        io.write_char(';', !IO)
+        io.write_string(" */", !IO)
     ;
         unexpected(this_file,
             "output_enum_constant: definition body was not data.")
@@ -1529,12 +1606,10 @@ output_initializer_body(ModuleInfo,
init_obj(Rval), MaybeType, ModuleName,
         type_is_object(Type),
         rval_is_int_const(Rval)
     ->
-        % If it is a enumeration object create new object.
-        io.write_string("new ", !IO),
+        % If it is a enumeration object make a reference to a static instance.
         output_type(normal_style, Type, !IO),
-        io.write_char('(', !IO),
-        output_rval_maybe_with_enum(ModuleInfo, Rval, ModuleName, !IO),
-        io.write_char(')', !IO)
+        io.write_string(".K", !IO),
+        output_rval_maybe_with_enum(ModuleInfo, Rval, ModuleName, !IO)
     ;
         MaybeType = yes(Type)
     ->
@@ -2963,13 +3038,12 @@ output_atomic_stmt(Indent, ModuleInfo,
FuncInfo, assign(Lval, Rval), _, !IO) :-
         LvalType = mlds_lval_type(Lval),
         type_is_object(LvalType)
     ->
-        % If the Lval is an object.
         ( rval_is_int_const(Rval) ->
-            io.write_string("new ", !IO),
+            % If it is a enumeration object make a reference to a static
+            % instance.
             output_type(normal_style, LvalType, !IO),
-            io.write_string("(", !IO),
-            output_rval(ModuleInfo, Rval, ModuleName, !IO),
-            io.write_string(")", !IO)
+            io.write_string(".K", !IO),
+            output_rval(ModuleInfo, Rval, ModuleName, !IO)
         ;
             output_rval(ModuleInfo, Rval, ModuleName, !IO)
         )
diff --git a/library/io.m b/library/io.m
index 2c7d523..b0e93a7 100644
--- a/library/io.m
+++ b/library/io.m
@@ -3135,14 +3135,11 @@ file_type_implemented :-
     // directories, and for everything else it just returns unknown.

     if (file.isFile()) {
-        Result = new mercury.io.Res_1.Ok_1(new mercury.io.File_type_0(
-            mercury.io.File_type_0.regular_file));
+        Result = new mercury.io.Res_1.Ok_1(ML_file_type_regular());
     } else if (file.isDirectory()) {
-        Result = new mercury.io.Res_1.Ok_1(new mercury.io.File_type_0(
-            mercury.io.File_type_0.directory));
+        Result = new mercury.io.Res_1.Ok_1(ML_file_type_directory());
     } else {
-        Result = new mercury.io.Res_1.Ok_1(new mercury.io.File_type_0(
-            mercury.io.File_type_0.unknown));
+        Result = new mercury.io.Res_1.Ok_1(ML_file_type_unknown());
     }
 ").

@@ -3230,6 +3227,8 @@ file_type_unknown = unknown.
     "ML_file_type_directory").
 :- pragma foreign_export("IL", file_type_directory = out,
     "ML_file_type_directory").
+:- pragma foreign_export("Java", file_type_directory = out,
+    "ML_file_type_directory").
 :- pragma foreign_export("Erlang", file_type_directory = out,
     "ML_file_type_directory").
 :- pragma foreign_export("C", file_type_socket = out,
@@ -3246,6 +3245,8 @@ file_type_unknown = unknown.
     "ML_file_type_regular").
 :- pragma foreign_export("IL", file_type_regular = out,
     "ML_file_type_regular").
+:- pragma foreign_export("Java", file_type_regular = out,
+    "ML_file_type_regular").
 :- pragma foreign_export("Erlang", file_type_regular = out,
     "ML_file_type_regular").
 :- pragma foreign_export("C", file_type_message_queue = out,
@@ -3264,6 +3265,8 @@ file_type_unknown = unknown.
     "ML_file_type_unknown").
 :- pragma foreign_export("IL", file_type_unknown = out,
     "ML_file_type_unknown").
+:- pragma foreign_export("Java", file_type_unknown = out,
+    "ML_file_type_unknown").
 :- pragma foreign_export("Erlang", file_type_unknown = out,
     "ML_file_type_unknown").
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list