Package gnu.expr
Class ModuleBody
- java.lang.Object
-
- gnu.expr.ModuleBody
-
- All Implemented Interfaces:
RunnableModule
public abstract class ModuleBody extends Object implements RunnableModule
Class for the dummy top-level function of a module.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
runDone
-
Constructor Summary
Constructors Constructor Description ModuleBody()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkRunDone(boolean value)
Check if run has been invoked.static void
exitDecrement()
Work around an AWT bug, where AWT threads are non-daemon.static void
exitIncrement()
See exitDecrement.static boolean
getMainPrintValues()
True if runAsMain should print values (in top-level expressions).void
run()
static void
run(RunnableModule mod, Consumer out)
void
run(Consumer out)
void
run(CallContext ctx)
void
runAsMain()
This is invoked by main when ModuleBody is compiled with --main.static void
runAsMain(RunnableModule module)
This is invoked by main when ModuleBody is compiled with --main.static void
runCleanup(CallContext ctx, Throwable th, Consumer save)
static void
runToVoid(RunnableModule mod)
static void
setMainPrintValues(boolean value)
-
-
-
Method Detail
-
checkRunDone
public boolean checkRunDone(boolean value)
Description copied from interface:RunnableModule
Check if run has been invoked.- Specified by:
checkRunDone
in interfaceRunnableModule
- Parameters:
value
- - should be true - probably pointless.
-
run
public void run(CallContext ctx) throws Throwable
- Specified by:
run
in interfaceRunnableModule
- Throws:
Throwable
-
run
public void run()
-
runToVoid
public static void runToVoid(RunnableModule mod)
-
run
public void run(Consumer out)
-
run
public static void run(RunnableModule mod, Consumer out)
-
runCleanup
public static void runCleanup(CallContext ctx, Throwable th, Consumer save)
-
getMainPrintValues
public static boolean getMainPrintValues()
True if runAsMain should print values (in top-level expressions).
-
setMainPrintValues
public static void setMainPrintValues(boolean value)
-
exitIncrement
public static void exitIncrement()
See exitDecrement.
-
exitDecrement
public static void exitDecrement()
Work around an AWT bug, where AWT threads are non-daemon. Thus if you start up AWT, the JVM will wait for the AWT to finish, even if there are no other non-daemon threads. So call exitIncrement() each time a Freme is created, and call exitDecrement() when a Frame is closed.
-
runAsMain
public final void runAsMain()
This is invoked by main when ModuleBody is compiled with --main.
-
runAsMain
public static void runAsMain(RunnableModule module)
This is invoked by main when ModuleBody is compiled with --main.
-
-