+-----------------------------------------------------------------+ | | | This file delineates how to use the Command Line Environment. | | | +-----------------------------------------------------------------+ After compilation (see Build.README), the Command Line Environment can be started with the command 'cle'. Note that your PATH environment variable must include the 'bin' directory of the AspOEv framework, or '%ASPOEV_HOME%\bin'. +-------------------------+ | Running Vejal programs: | +-------------------------+ Vejal programs can be run from the command line environment with the 'run' command. If the Vejal program has already been loaded, simply specify the name of the type whose 'main' method should be executed. If the Vejal program is not already loaded, specify the name of the file containing the program omitting the '.vj' extension (Currently the file must be in the base Vejal directory, i.e. '%ASPOEV_HOME%\vejal') - the run command attempts to parse and execute the contents, starting with the 'main' method. e.g. AspOEv> run Foo; -or- AspOEv> run Foo; The run command creates a separate execution environment in the Vejal interpreter (via a new Java Thread). However, currenly, the spawned execution environment and program outputs to the command line from which it was created. +--------------------+ | Supplied commands: | +--------------------+ The command line environent needs few specially defined commands, as it accepts and executes any valid Vejal statement. Supplied commands do not require semi colon termination, unlike Vejal statements. Supplied commands are: vars - display all visible variables in the environment types - display all types loaded into the interpreter bye / exit - quit the command line environment help - print help message help -edit - print help message about primitive declarations +-------------------+ | Vejal Statements: | +-------------------+ The command line environment parses and executes all valid Vejal syntax, and subsequently echos the value of the statement. If the value of the statement is a Vejal MetaObject or a POJO, the toString method is executed on the object and printed. e.g. AspOEv> vars Visible variables: double foo; JavaObject SchemaManager; JavaObject InstanceAdapter; JavaObject Runtime; . . . AspOEv> foo; // Vejal statement 6.0 // value of 'foo' AspOEv> SchemaManager; ContextVersioningManager { // toString for 'SchemaManager' Context { InsuranceCompany } Context { Physician, Nurse } } AspOEv> Valid Vejal statements include everything from assignment to 'while' loops, however, multiple line command do have some special requirements for parsing. +-------------------------+ | Multiple line commands: | +-------------------------+ Multiple line vejal statements can also be executed on the command line, however, these statements must be wihin a Vejal block. Also, the commands must end in '};' (the end of the vejal block, and a semi colon to indicate the end of the command). e.g. AspOEv> if (false) { // multiple line command print("true!"); } else { print("false!"); }; false! // output AspOEv> Note that without the trailing semi colon, there would be a conflict in parsing the above statement at the terminal '}' to the 'if' block. (The command line environment would not know when you were done inputing the command, and would have simply executed the 'if' statement) +--------------------------------+ | Changing evolution strategies: | +--------------------------------+ Evolution strategies (Schema management and instance adaptation) are introduced as global variables ('SchemaManager' and 'InstanceAdapter' respectively) in the AspOEv interpreter. This means that they are accessible from all execution environments, and can be changed via a simple assignment statement. e.g. AspOEv> SchemaManager = new aspoev.manager.schema.SchemaModificationManager(); -or- AspOEv> InstanceAdapter = new aspoev.manager.adapter.UpdateBackdateAdapter(); Transition between schema managers can be achieved by storing the Schema Extent of the previous strategy and calling the 'transitionFrom' method on the new schema manager. A schema manager's schema extent is stored in the global variable SchemaExtent'. e.g. AspOEv> SchemaExtent oldSchema = SchemaExtent; AspOEv> SchemaManager = new SomeSchemaManagementStrategy(); AspOEv> SchemaManager.transitionFrom(oldSchema);