util
Class JavaToLisp

java.lang.Object
  |
  +--util.JavaToLisp
Direct Known Subclasses:
StartConnection

public class JavaToLisp
extends Object

This is a tool for connecting to Lisp through JLinker. Use the connectToLisp() method to make the connection. Then other methods such as runInLisp and loadFile may be used. The main method will pop up a dialog box into which expressions may be typed and evaluated. Created: Fri Jan 26 12:36:44 2001


Field Summary
protected  String m_lispRoot
           
protected static String PROGRAMDATA_DIR
           
 
Constructor Summary
JavaToLisp()
          Creates a new JavaToLisp instance.
JavaToLisp(boolean useFileToConnect)
          Creates a new JavaToLisp instance.
 
Method Summary
 boolean connectToLisp()
          Start a Lisp process (if one is not already running) and connect to JLinker.
 String escapeBackslashes(String input)
          Returns input with backslashes escaped.
protected  void finalize()
           
static String list(List list)
           
static String list(List list, boolean isQuoted)
           
static String list(String[] items)
           
static String list(String[] items, boolean isQuoted)
           
 boolean loadFile(String file)
           
 boolean loadFile(String path, String file)
           
static void main(String[] args)
          Pops up a dialog box for evaluating expressions in Lisp.
static String quotes(String string)
           
 LispObj readEval(String form)
           
 String readEvalPrint(String form)
           
 LispObj runInLisp(String command)
           
 LispObj runInLisp(String command, String arg)
           
 LispObj runInLisp(String command, String arg1, String arg2)
           
 LispObj runInLisp(String command, String arg1, String arg2, String arg3)
           
 LispObj runInLisp(String command, com.franz.jlinker.TranStruct[] args)
           
 LispObj runInLisp(com.franz.jlinker.TranStruct cmd, com.franz.jlinker.TranStruct[] args)
           
 void runInLispNoReturn(String cmd)
           
 void setq(String var, com.franz.jlinker.TranStruct value)
           
 void shutdown()
          Disconnect from JLinker, and kill the Lisp process if it was started.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROGRAMDATA_DIR

protected static final String PROGRAMDATA_DIR

m_lispRoot

protected String m_lispRoot
Constructor Detail

JavaToLisp

public JavaToLisp()
Creates a new JavaToLisp instance.

JavaToLisp

public JavaToLisp(boolean useFileToConnect)
Creates a new JavaToLisp instance.
Parameters:
useFileToConnect - if true, uses a file to advertise ports. otherwise, connects directly on an open port
Method Detail

connectToLisp

public boolean connectToLisp()
Start a Lisp process (if one is not already running) and connect to JLinker. (Note: If you have trouble connecting to JLinker, check that old alisp processes have been killed (nicely) or wait several minutes til they die on their own. If you still have trouble, try using a file to connect by using the constructor that takes a boolean value.)
Returns:
true if connected, false if the Lisp process or JLinker could not be started.

shutdown

public void shutdown()
Disconnect from JLinker, and kill the Lisp process if it was started.

readEvalPrint

public String readEvalPrint(String form)

readEval

public LispObj readEval(String form)

runInLisp

public LispObj runInLisp(String command)

runInLisp

public LispObj runInLisp(String command,
                         String arg)

runInLisp

public LispObj runInLisp(String command,
                         String arg1,
                         String arg2)

runInLisp

public LispObj runInLisp(String command,
                         String arg1,
                         String arg2,
                         String arg3)

runInLisp

public LispObj runInLisp(String command,
                         com.franz.jlinker.TranStruct[] args)

runInLisp

public LispObj runInLisp(com.franz.jlinker.TranStruct cmd,
                         com.franz.jlinker.TranStruct[] args)

runInLispNoReturn

public void runInLispNoReturn(String cmd)

setq

public void setq(String var,
                 com.franz.jlinker.TranStruct value)

loadFile

public boolean loadFile(String path,
                        String file)

loadFile

public boolean loadFile(String file)

list

public static String list(List list)

list

public static String list(List list,
                          boolean isQuoted)

list

public static String list(String[] items)

list

public static String list(String[] items,
                          boolean isQuoted)

quotes

public static String quotes(String string)

escapeBackslashes

public String escapeBackslashes(String input)
Returns input with backslashes escaped. ('\' becomes '\\')
Parameters:
input - a String value
Returns:
a String value

main

public static void main(String[] args)
Pops up a dialog box for evaluating expressions in Lisp.
Parameters:
args - (no arguments required)

finalize

protected void finalize()
Overrides:
finalize in class Object