An Example Application: A Simple FSA Editor

This example has been tested with version 0.2.0 of the CIDER toolkit.

Using CIDER to Create the Application

To create this example application, download and unzip this file (9,576 bytes) which contains the following:

Important Points

The directory in which the editor is to be created will be referred to as the base directory.

Note that all of the Java classes listed above belong to the package fsa_editor and thus must be placed in a directory of the same name (relative the base directory). This should happen automatically when they are unzipped.

The base directory should contain the Grammar and Transformations files, the CIDER DTD file, and two CIDER JAR files (the CIDER Compiler and the CIDER Core Components).

All JAR files and the DTD file should have the same version number.

Running the CIDER Compiler

To create the grammar specific source code for the CIDER toolkit, the Grammar and Transformations files must be processed by the CIDER Compiler. This is done using the command:

       java -jar CiderCompiler-version.jar -g fsa.grammar -t fsa.transformations

With regard to this command: If successful, this command will first translate the Grammar and Transformations files into XML files, and them process these XML files to produce CIDER Interpreter source code files (in the directory au/edu/monash/csse/tonyj/cider/interpreter relative to the base directory).

Compiling the Application with the Java Compiler

The application source code (both that produced by the CIDER Compiler and that contained in the files in the fsa_editor directory) can now be compiled. This is done using the command:

       javac -classpath .:CiderCore-version.jar au/edu/monash/csse/tonyj/cider/interpreter/*.java fsa_editor/*.java

With regard to this command:

Running the FSA Editor

If the application compiled successfully, it can now be run by using the following command:

       java -classpath .:CiderCore-version.jar fsa_editor.FSAEditor

With regard to this command: Of course, for many applications it will be convenient to gather all of the required .class files into a single JAR file to allow for a more succinct command line to be used and to make the application more portable. This can be done by using the jar tool.

Back to the Version 0.2.0 Page.

Anthony.Jansen@infotech.monash.edu.au
Last Modified: Friday March 12 18:01:37 EST 2004