gnu.expr

Class ModuleBody

public abstract class ModuleBody extends Procedure0

Class for the dummy top-level function of a module.
Field Summary
protected booleanrunDone
Method Summary
voidapply(CallContext ctx)
Objectapply0()
Objectapply0(ModuleMethod method)
A subclass will typically override this like: switch (method.selector) { case 3: return function3(); case 5: return function5(); default: super.apply0(method); }
Objectapply1(ModuleMethod method, Object arg1)
Objectapply2(ModuleMethod method, Object arg1, Object arg2)
Objectapply3(ModuleMethod method, Object arg1, Object arg2, Object arg3)
Objectapply4(ModuleMethod method, Object arg1, Object arg2, Object arg3, Object arg4)
ObjectapplyN(ModuleMethod method, Object[] args)
static booleangetMainPrintValues()
True if runAsMain should print values (in top-level expressions).
intmatch0(ModuleMethod proc, CallContext ctx)
intmatch1(ModuleMethod proc, Object arg1, CallContext ctx)
intmatch2(ModuleMethod proc, Object arg1, Object arg2, CallContext ctx)
intmatch3(ModuleMethod proc, Object arg1, Object arg2, Object arg3, CallContext ctx)
intmatch4(ModuleMethod proc, Object arg1, Object arg2, Object arg3, Object arg4, CallContext ctx)
intmatchN(ModuleMethod proc, Object[] args, CallContext ctx)
static voidprocessArgs(String[] args)
This is invoked by main when ModuleBody is compiled with --main.
voidrun(CallContext ctx)
voidrun()
voidrun(Consumer out)
voidrunAsMain()
This is invoked by main when ModuleBody is compiled with --main.
static voidrunCleanup(CallContext ctx, Throwable th, Consumer save)
static voidsetMainPrintValues(boolean value)

Field Detail

runDone

protected boolean runDone

Method Detail

apply

public void apply(CallContext ctx)

apply0

public Object apply0()

apply0

public Object apply0(ModuleMethod method)
A subclass will typically override this like: switch (method.selector) { case 3: return function3(); case 5: return function5(); default: super.apply0(method); }

apply1

public Object apply1(ModuleMethod method, Object arg1)

apply2

public Object apply2(ModuleMethod method, Object arg1, Object arg2)

apply3

public Object apply3(ModuleMethod method, Object arg1, Object arg2, Object arg3)

apply4

public Object apply4(ModuleMethod method, Object arg1, Object arg2, Object arg3, Object arg4)

applyN

public Object applyN(ModuleMethod method, Object[] args)

getMainPrintValues

public static boolean getMainPrintValues()
True if runAsMain should print values (in top-level expressions).

match0

public int match0(ModuleMethod proc, CallContext ctx)

match1

public int match1(ModuleMethod proc, Object arg1, CallContext ctx)

match2

public int match2(ModuleMethod proc, Object arg1, Object arg2, CallContext ctx)

match3

public int match3(ModuleMethod proc, Object arg1, Object arg2, Object arg3, CallContext ctx)

match4

public int match4(ModuleMethod proc, Object arg1, Object arg2, Object arg3, Object arg4, CallContext ctx)

matchN

public int matchN(ModuleMethod proc, Object[] args, CallContext ctx)

processArgs

public static void processArgs(String[] args)
This is invoked by main when ModuleBody is compiled with --main.

run

public void run(CallContext ctx)

run

public void run()

run

public void run(Consumer out)

runAsMain

public final void runAsMain()
This is invoked by main when ModuleBody is compiled with --main.

runCleanup

public static void runCleanup(CallContext ctx, Throwable th, Consumer save)

setMainPrintValues

public static void setMainPrintValues(boolean value)