
-- JFLAP v3.1  August 1999 --
JFLAP (c) 1999 Susan H. Rodger, Magda Procopiuc, Octavian Procopiuc,
               Eric Gramond, and Ted Hung.
All rights reserved. Read the COPYRIGHT file for more information.
---------------------------------------------------------------------
The official web page:		http://www.cs.duke.edu/~rodger/tools/
Mail any bugs or comments to:	rodger@cs.duke.edu
----------------------------------------------------------------------

JFLAP is a package of graphical tools which can be used as an aid in
learning the basic concepts of Formal Languages and Automata Theory. The
original program (FLAP) was written in C/C++ for X-window based
systems. Due to its success as a visual aid in introductory courses in
Theoretical Computer Science, the Java version of FLAP was created, which
works on any system running a JAVA engine.

Using JFLAP, one will be able to design and simulate several variations of
finite automata (FA), pushdown automata (PDA), one-tape Turing machines
(TM) and two-tape Turing machines (TTM). In addition, JFLAP allows one to
input grammars(GRM) and regular expressions(REX) and convert them between
each other. With the automata, the user draws the transition
diagram of the desired automaton and, once the picture is complete, the
user enters an input string and then "runs" the automaton, being able to
view all the generated configurations.  Features of JFLAP include
several conversions from one representation to another. The conversions are
nondeterministic finite automaton (NFA) to deterministic finite automaton
(DFA), DFA to minimum state DFA, NFA to regular expression, NFA to regular
grammar, regular grammar to NFA, nondeterministic pushdown automaton (NPDA)
to context-free grammar (CFG), and three algorithms for CFG to NPDA. Two of
the CFG to NPDA conversions are useful in studying LL and LR parsing.

See the paper: "Using JFLAP to Interact with Theorems in Automata Theory",
Eric Gramond and Susan Rodger, SIGCSE 99 p. 336-340, 1999.

The package is designed as a Java application. However, for demo purposes,
one can run the program from a Java-enabled Web browser, as a Java applet.

The program is compiled using JDK version 1.2. But it can also be compiled
using JDK 1.15 except for the HTML Help portion of the program.  Otherwise
everything should compile and run in JDK 1.15. Let us know if you have
any problems installing and/or running it. On Unix machines, if you are 
using another version of java, you may have to recompile the code.

The designing and programming work is done by Magda Procopiuc,
Octavian Procopiuc, Eric Gramond, and Ted Hung.

If you use this tool, please drop us a short note. 
(at rodger@cs.duke.edu).

To run the program:

On a UNIX station, type at the shell prompt:

 java JFLAP [-p parameters_file_name] [-fa|-pda|-tm|-ttm|-grm|rex [file_name_without_extension]]...

If JFLAP.class is not in the current directory, you have to specify 
the class path (INCLUDING THE JDK CLASS PATH!!). You can do that
in one of the following two ways:
 1. specify the classpath command line parameter.
   For example, assuming that java is installed in /usr/pkg/java, and 
   JFLAP is installed in /usr/pkg/jflap:
java -classpath /usr/pkg/java/lib/classes.zip:/usr/pkg/jflap JFLAP

 2. set the CLASSPATH environment variable.
   For example, assuming the same configuration:
setenv CLASSPATH /usr/pkg/java/lib/classes.zip:/usr/pkg/jflap
   and then:
	java JFLAP ...

On a PC running Windows 95, the command is identical, but you HAVE TO
specify the classpath (where the java interpreter looks for classes), by
setting the CLASSPATH environment variable, or by writing it in the command
line.
   For example, assuming java is installed in c:\java and jflap is installed 
   in c:\jflap 
	java -classpath c:\java\lib\classes.zip;c:\jflap JFLAP -fa

(a batch file with this classpath is provided; modify it to fit your installation)

On a Macintosh, double click on the JFLAP.class file.

NOTES: 

 1. The default parameters file is .flaprc. If you want to change the
appearance of the program, you can either edit it, or create a different
one, and  specify it in the command line. It has to be located in the
directory you run the program from. The format of the parameters file
is self explanatory. 

 2. All the files containing saved machines have a predefined extension:
	- .FA for files containing finite state automata;
	- .PDA for files containing pushdown automata;
	- .TM for files containing one-tape Turing machines;
	- .TTM for files containing two-tape Turing machines.
	- .GRM for files containing grammars.
	- .REX for files containing regular expressions.

 3. If you specify one or more machine types in the command line, a window
will be opened for each type. If the machine type is followed by a file
name, the program tries to open that file. 

 4. The FLAPApplet class is included in the package as a demo tool which
can be inserted in a web page and can be viewed with a Java-enabled web
browser (e.g. Netscape Navigator v2 or newer, HotJava). An example
html file is included to show how JFLAP can be added to a web page.

Your FLAPApplet.class file has to be in the same directory as the html
file, and the flap package has to be in the class path.

 5. Some example automata are in the examples directory. There is a README
file explaining which examples are good illustrations of a conversion method.
