Classes that add Metropolis specific commands to a Jacl shell.


Jacl is a 100% Java implementation of a subset of Tcl.

We use a version of Jacl from the Ptolemy Project. This version is based on Jacl 1.1.1

For more information about Jacl, see http://www.tcl.tk/software/java/

Jacl adds the java:: Tcl command to provide access to Java objects. For details, see the java:: man page

Adding Backends to the shell

In order to add a backend to the metroshell, do the following:
  1. Write a file, say NewCmd.java, that contains a subclass of MetropolisCmd, say NewCmd, which implements the following methods:
           public void cmdProc(Interp interp, TclObject objv[])
           public HelpTopic getHelpTopic()
    
    The first parses the command line arguments and calls the backend, while the second implements a description displayed by the help command.

    See {@link metropolis.metamodel.shell.SimulateCmd} as an example of their implementations.

  2. 2. In Shell.java, add the constructor of the subclass to a variable called _commandObject[], e.g.
           private static String _commandObjects[] = 
                                     { ... , new NewCmd()  }
    
    
  3. In Shell.java, add the name of the new command, say newcmd, to a variable called _commandNames[], e.g.
           private static String _commandNames[] = 
                                     { ..., "newcmd" }
    
  4. In Makefile, add the name of the new file, NewCmd.java, to the variable JSRCS.