mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-14 13:23:53 +00:00
Estimated hours taken: 18 Branches: main Some fixes to the Java back-end to make it support RTTI better. The aim is to at least be able to *compile* code that makes use of polymorphism (e.g. the Mercury standard library!), although that aim is not yet achieved with this diff. Getting code which actually *uses* the RTTI to work is still a long way off... compiler/rtti.m: compiler/mlds_to_java.m: Fix some bugs in the code to output RTTI type names. compiler/mlds_to_java.m: Output the RTTI definitions. This is needed to avoid errors in code which references them. Handle initializers better; in particular deal with nested initializers properly. Pass the current module name down to output_lval, so that we can module-qualify data names only if they occur in a different module. This is needed to ensure that static data defined in other modules gets module-qualified, but local variables don't. This also required change some places which were incorrectly calling output_fully_qualified_name to instead call output_name. Add comments in the generated output code when generating "java.lang.Object", so that it is clearer what kind of object is involved. Add some special treatment for the types with hand-defined RTTI. java/runtime/*.java: Add some definitions of RTTI types, and some new constructors for the RTTI types that were already defined. These are currently all just stubs.
20 lines
483 B
Java
20 lines
483 B
Java
//
|
|
// Copyright (C) 2001-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.runtime;
|
|
|
|
public class EnumFunctorDesc {
|
|
|
|
public java.lang.String enum_functor_name;
|
|
public int enum_functor_ordinal;
|
|
|
|
public EnumFunctorDesc(String name, int ordinal) {
|
|
enum_functor_name = name;
|
|
enum_functor_ordinal = ordinal;
|
|
}
|
|
|
|
}
|