Because of the numerous different ways that an omegahat session can be configured, the descriptions below may not apply due to confounding with other options in effect.This gives a description of the sequence of steps performed when a basic omegahat session is started. We focus here on the standard omegahat session which is created by running theomegaclass as an application. Other classes can be used as the entry point for he Java Virtual Machine (JVM) via the-iflag of theomegahatscript.The
The application starts by creating an instance of itself, storing the command line arguments both internally and for future reference by other objects in a static field in theomegaapplicationGlobalsclass. Then it calls itsinit()method.The
init()method creates anEvaluatorManagerwhich is used to coordinate (some of) the differentEvaluators. It also knows how to create newEvaluatorinstances. We use this to obtain an initialevaluator. The manager does this by finding the class name for the default evaluators under the propertyevaluatorClassName. This can be specified as a system level property, in the options file controlling the session, or as a last resort is hard-coded in the Java class.At this point, we have an evaluator but it has nothing to do. One of the goals of omega is to create highly modifiable and extensible software. In order to keep the environment flexible, the remainder of the initialization is performed by using the omegahat language itself. By default, this is named
OmegaInit. It can be located in a variety of different places, e.g. within the omegahat source tree, in the binaryEnvironment.jarfile, or a different file can be specified on the command line via the-sargument. In this last example, the script can even be a URL:omegahat -s 'http://www.omegahat.org/Scripts/OmegaInit'The file is handed to the
source()method. This can use the manager'sFileLocatorobject to find the file. Additionally it is intended to check whether the string identifies a URL and dispatch a call to the appropriatesource()method accordingly.n
Default OmegaInit Script
The defaultOmegaInitscript is quite simple and divided into 3 sections. The first displays a message containing information about the version/release of the software. This is read from theOmegaOptionsif possible or else is displayed as unkown.Next, the script sets the
OmegaFinalScriptto the name of a file whose contents are evaluated as an Omegahat script when the session is being terminated via theq()method of the standardEvaluator.The next element of the default
.omegahatrcOmegaInitscript is to read the user's own script. By default, this is in the home directory of the user in the file named.omegahatrc. A different file can be specified via the+uflag to theomegahatscript.omegahat +u /a/b/cAlternatively, we can avoid reading the user's file via the-uflag. (This takes no following argument.)This script can contain any legal Omegahat expressions. (Terminate each with a semi-colon.)
One should keep in mind the
endSource().At this point, the script potentially sources two other scripts. The first is a splash screen that displays the Omegahat logo, etc. This is simply a frill and only used to show that something is happening should the user be alarmed by a slow startup time. The display of this window is governed by the presence of the property
UseGUI. The second script that is evaluated sets up the prompt.Prompt and User Input
The prompt is an interesting aspect of the Omegahat system.
OmegaOptions
Duncan Temple Lang <duncan@research.bell-labs.com> Last modified: Sun Oct 3 18:39:13 EDT 1999