mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-16 22:35:41 +00:00
Estimated hours taken: 3 Branches: main Added support for progname and exit status in grade Java. compiler/mlds_to_java.m: Added code to maybe_write_main_driver/5 to store the main class's name and exit status in mercury.runtime.JavaInternal's static variables. Also, main() now calls java.lang.System.exit() instead of returning, since Java insists that main must have void return type. java/runtime/JavaInternal.java: Added static variables "progname" and "exit_status".
24 lines
740 B
Java
24 lines
740 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.
|
|
//
|
|
//
|
|
// All modifications to this file will require changes to:
|
|
// compiler/mlds_to_java.m
|
|
//
|
|
//
|
|
// At the moment this class is used to store the main module's name (progname),
|
|
// command line arguments and the exit status. We can't put them in one of the
|
|
// library modules because we need to hold them in a class variable in a top
|
|
// level class.
|
|
//
|
|
|
|
package mercury.runtime;
|
|
|
|
public class JavaInternal {
|
|
public static java.lang.String progname;
|
|
public static java.lang.String[] args;
|
|
public static int exit_status;
|
|
}
|