Make Java classes corresponding to Mercury types automatically serialisable.

Branches: main

Make Java classes corresponding to Mercury types automatically serialisable.

java/runtime/MercuryType.java:
        Make MercuryType extend java.io.Serializable.

compiler/mlds_to_java.m:
java/runtime/MercuryEnum.java:
        Add a MercuryEnum interface which is implemented by classes
        corresponding to Mercury enumerations.  Previously enumerations
        didn't implement MercuryType.

compiler/ml_type_gen.m:
        Make enumeration classes implement MercuryType and MercuryEnum.

library/builtin.m:
        Make builtin.copy check for MercuryEnum instead of relying on
        enumeration classes not to implement MercuryType.  This is not
        strictly necessary but avoids copying instances of enumeration
        classes.
This commit is contained in:
Peter Wang
2009-07-09 05:18:08 +00:00
parent db04ba3277
commit dfca5e04f0
5 changed files with 58 additions and 12 deletions

View File

@@ -0,0 +1,13 @@
//
// Copyright (C) 2009 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 all classes generated by the Java back-end
// which correspond to Mercury-defined enumeration types.
//
package jmercury.runtime;
public interface MercuryEnum {
}