The Omegahat Script

This is the script that runs most of the omegahat tools, or generally a Java application with the environment and system variables set to include the Omegahat variables. It handles creation of the appropriate classpath for the JVM including the different Omegahat packages (as jar files or directly from the source tree). Additionally, it determines which Java class to "run".

Any existing elements in the environment variable CLASSPATH are prepended to the value constructed in the script and passed to the JVM via the -classpath argument.

If the environment variable OMEGA_DEVELOPER is not set, and the file Jars/Omegahat/Environment.jar exists, then this is used as the source of the classes in the omegahat package. Other Jar files in the Jars/Omegahat/ directory will also be added to the classpath.

-i fully qualified class
a different Java application class (containing a static main) is invoked by specifying the toplevel class via the -i argument e.g.
          omegahat -i org.omegahat.environment.GUI.omega
      
The argument specifies the Java class to use as the one providing the entry point \JMethod{main}. This allows a variety of different applications and interfaces to be instantiated from this common \OMega{} script. The class must be fully specified as package and class name and must be resolvable from the classpath supploeed to the JVM. \\
-ix class name
A simplified version of the -i flag, allowing one to specify an partially qualified class name within the org.omegahat package. e.g.
      omegahat -ix omega
The -ix flag is the same as -i except it does not require a fully qualified classname, but instead will locate the class within the org.omegahat tree in the same way that classes are located within the language.

This flag will only work when we are running from non-Jar files for the environment. It uses the expandOmegaClass perl script.

-c file name
allows a different configuration file to be used for the evaluator (other than OmegaOptions).
-s script name
specifies the full name of a file containing Omegahat commands that are run a single time at the beginning of the session. The default is the script OmegaInit. The file is located using the FileLocator class parameterized by the searchPath property in the configuration file.
-v
The -verbose flag causes information from this script to be written to the terminal. This includes settings for the variables OMEGA_HOME, the classpath, the final command that is executed by the script and so on. This information is useful for debugging settings controlling the invocation of the Omegahat session. It should be added to bug reports
-verbose
The -verbose has the same effect as the -v flag and additionally is also passed to the JVM causing it to display a lot of information regarding the loading of classes and their origin, etc.
-verify
The -verify flag causes the Java virtual machine to "verify" all classes as they are loaded, including those usually trusted from disk. This checks that all classes are valid. This is useful for debugging dynamically compiled classes via the Jas package.

The -verbose and -verify arguments are simple boolean flags and do not take a second argument as a value.

-u
This avoids the default behavior of source'ing the users initialization script, $HOME/.omegahatrc. This takes no value.
+u filename
identifies a file (that is located using the file location mechanism of the default evaluator) that is treated as an Omegahat script that is source'd by the default initialization scripts (OmegaInit).
-e full class name
specifies the fully qualified name of a class to use when creating an evaluator. E.g.
         omegahat -e org.omegahat.Interfaces.CORBA.Parser.OrbacusEvaluator
      
(See also -CORBA
-ex
specifies a partially qualified class name to use when creating an evaluator. This is to -e as -ix is to -i.
-help
displays a brief description of these arguments.
-CORBA
(takes no argument.) Use a CORBA aware evaluator & parser which allows calls of the form
          x.foo(a,b)
      
to be interpreted as remote method calls on a server x made available as an Omegahat variable from the naming service. Appends the CORBA packages to the classpath.
-w
sets a property UseGUI in the System level properties. The initialization scripts check for the presence of this (currently not the actual value) and creates a splash screen accordingly. To run the GUI interface version of Omegahat, use
     omegahat -ix GUI.omega
    
-xp
Force all the Jar files in the the directory $OMEGA_HOME/Jars/Omegahat to be included in the classpath, ahead of the regular system classpath files. This allows one to put add-on packages there and have them automatically included. Note that this applies only to jar files, and not directories.
-Dname=value
passed directly to the JVM, specifying a system property named name with value value.
-X
pass the entire argument as a non-standard argument of the JVM. This is used for profiling, setting certain characteristics of the JVM, etc.
-Jarg
pass the entire argument directly to the JVM unaltered, i.e. with the -J prefix still present. These can be used to control initialization and run-time parameters of the VM such as maximum memory size, initial heap size, etc. See the documentation for the JVM.
--home
Instruction to print the value of the environment variable OMEGA_HOME and exit. This is used in autoconf and other configuration tools for computing the location of the distribution and hence where classes, help files, C/C++ libraries, etc. are located.
--
all arguments after this are not processed by this script but passed directly to the Java application being invoked. This effectively escapes arguments from this script and allows them to be interpreted by the application. This allows an application to have arguments that are also arguments to this script.
Any arguments not recognized by this script are concatenated together in the order they are supplied here and passed to the Java application. along with all other arguments are passed to the application.

Properties

The following is a list of (some of) the properties that the Omegahat interpreter and classes recognize and with which one can configure these classes.
OmegahatClassLists logical controls whether the list of all classes in the CLASSPATH elements are constructed are at initialization of the Omegahat session. If this is false, no classes are available using partially qualified class names. Instead, one must use the import command or Import method
groupedClassList logical indicates whether the collection of classes for each jar file and top-level directory in the CLASSPATH should be divided by directory or grouped in one large list.
OmegahatClassListsA list of directories, jar files and URLs which are to be scanned for files so that their files can be referenced by partially qualified names (i.e. without the complete package name). If this is omitted, every element of the JVM classpath is scanned. This greatly increases startup time.
defaultLexerClass
defaultDatabaseClass
errorHandlerClass
EvaluatorClassName
FinalScriptProperty
OmegahatSearchPathA list of directories, jar files and URLs in which files are searched when not explicitly identified. This is a convenient way to allow the interpreter look for files that may be in different directories without the user having to commit to where they are.
promptA string or expression that is used as the primary interactive prompt that indicates the evaluator is ready to process input.
continueThe continuation prompt when there is partially complete user input pending.
OMEGA_CONFIG_FILEThis is the name of a file that contains a collection of properties which configure the Omegahat session. This is a more convenient way of specifying -Dname=value pairs that are numerous and/or repeated frequently. By default, the value used for this is org/omegahat/Environment/Interpreter/OmegaOptions or specifically the OmegaOptions resource associated with Options class used by the EvaluatorManager.
taskDisplayAbove
taskDisplayBelow
debug
debug<class name>

Duncan Temple Lang <duncan@research.bell-labs.com>
Last modified: Wed Jul 19 07:08:45 EDT 2000