ohmm
Class OHMMShell

java.lang.Object
  extended by ohmm.OHMMShell

public class OHMMShell
extends java.lang.Object

OHMM JScheme command shell.

This is a JScheme interpreter for debug and exercise of the OHMM host library. The main(java.lang.String[]) method can be invoked in the usual Java way. In addition, OHMMShell is specified as the main-class of OHMM.jar.

Communications are established according to command-line parameters:

The scheme symbol ohmm is bound to the OHMM instance. ohmm-shell-api.scm and ohmm-shell-extra.scm are loaded to define the scheme-level API and conveniences.

Communication errors including timeouts are internally detected, and the ErrorHandler, if any, is notified.

Author:
Marsette Vona

Field Summary
static java.lang.String BANNER
          Startup banner.
protected  jscheme.JScheme js
          Our JScheme interpreter.
protected  OHMM ohmm
          Our OHMM.
static java.lang.String OHMM_SHELL_API
          The name of the scheme bindings for the api.
static java.lang.String OHMM_SHELL_EXTRA
          The name of the scheme bindings for the extra stuff.
static java.lang.String PROMPT
          Shell prompt.
private static java.lang.String svnid
           
 
Constructor Summary
OHMMShell(OHMM ohmm)
          Make a new OHMMShell wrapping an OHMM instance.
 
Method Summary
static boolean charReady()
          jscheme does not implement char-ready?
protected  void initJScheme()
          Initialize JScheme.
protected  boolean loadJSchemeFileFromResource(java.lang.String resourceName)
          Load a scheme file into js from a resource for this class.
protected  void loadJSchemeFiles()
          load initial JScheme values
static void main(java.lang.String[] argv)
          Command line driver, see OHMM.USAGE.
 void readEvalPrintLoop()
          readEvalPrintLoop(String) with default PROMPT
 void readEvalPrintLoop(java.lang.String prompt)
          Run the scheme REPL.
protected  void setJSGlobals()
          bind global JScheme values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

svnid

private static final java.lang.String svnid
See Also:
Constant Field Values

PROMPT

public static final java.lang.String PROMPT

Shell prompt.

See Also:
Constant Field Values

BANNER

public static final java.lang.String BANNER

Startup banner.

See Also:
Constant Field Values

OHMM_SHELL_API

public static final java.lang.String OHMM_SHELL_API

The name of the scheme bindings for the api.

See Also:
Constant Field Values

OHMM_SHELL_EXTRA

public static final java.lang.String OHMM_SHELL_EXTRA

The name of the scheme bindings for the extra stuff.

See Also:
Constant Field Values

ohmm

protected OHMM ohmm

Our OHMM.


js

protected jscheme.JScheme js

Our JScheme interpreter.

Constructor Detail

OHMMShell

public OHMMShell(OHMM ohmm)
          throws java.io.IOException
Make a new OHMMShell wrapping an OHMM instance.

Throws:
java.io.IOException
Method Detail

charReady

public static boolean charReady()
                         throws java.io.IOException
jscheme does not implement char-ready?

Throws:
java.io.IOException

readEvalPrintLoop

public void readEvalPrintLoop(java.lang.String prompt)
Run the scheme REPL. This call will block until the REPL is (exit)ed.


readEvalPrintLoop

public void readEvalPrintLoop()
readEvalPrintLoop(String) with default PROMPT


initJScheme

protected void initJScheme()
                    throws java.io.IOException

Initialize JScheme.

Throws:
java.io.IOException

setJSGlobals

protected void setJSGlobals()
bind global JScheme values


loadJSchemeFiles

protected void loadJSchemeFiles()
load initial JScheme values


loadJSchemeFileFromResource

protected boolean loadJSchemeFileFromResource(java.lang.String resourceName)

Load a scheme file into js from a resource for this class.

Parameters:
resourceName - the name of the resource (i.e. the name of a scheme file in the same package as this class)
Returns:
true iff the file was loaded

main

public static void main(java.lang.String[] argv)
                 throws java.io.IOException

Command line driver, see OHMM.USAGE.

Throws:
java.io.IOException