An Example Application: A Simple FSA Editor
This example has been tested with
version 0.3.0 of the CIDER toolkit.
Important Note: CIDER requires Java version 1.4
Also: The Simple FSA editor should be built and run in a different
directory to the Complex FSA editor (as both applications use files that share
the same name).
Quick Example
For a quick and easy way to run the example application, download the file
SimpleFSA-0.3.0.jar (573,283 bytes), then
type the following command:
java -jar SimpleFSA-0.3.0.jar
You do not need any other files to run the quick example.
To use the editor, use the buttons on the panel and the
mouse button to manipulate the symbol attributes.
Constraints can be broken by holding down the shift key when
manipulating the symbol attributes.
Using CIDER to Create the Application
To create this example application, download and unzip
this file (8,539 bytes) which contains the
following:
- a Grammar File
- a Transformations File
- a Java class for the functions used in the grammar specification
- three Java classes implement the terminal symbols as drawable objects
- a Java class which implements the FSA editor
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:
- The text version represents a specific CIDER version number.
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:
- The text version represents a specific CIDER version number.
- The : character used in the classpath argument will need
to be replaced with ; on some platforms (such as Windows).
- The / character used to separate directories when specifying a file
location will need to be replaced with \ on some platforms (such as
Windows).
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.Editor
With regard to this command:
- The text version represents a specific CIDER version number.
- The : character used in the classpath argument will need
to be replaced with ; on some platforms (such as Windows).
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.3.0 Page.
Anthony.Jansen@infotech.monash.edu.au
Last Modified:
Mon May 31 15:26:11 EST 2004