This is Realease 3 of Gray, a parser generator written in Forth. It
takes grammars in an extended BNF syntax and generates recursive
descent parsers as executable Forth code. It has no special support
for error recovery.


FILES

README		You are reading it
CHANGES		describes differences to earlier releases
gray.f83	parser generator source file
gray.doc	parser generator manual
else.f83	a very tiny example grammar
oberon.f83	a medium-sized example grammar
calc.f83	an example interpreter
mini.f83	an example compiler
test.mini	a program for mini (computes the square)
graylist.f83	example extension for gray
test.f83	runs the examples
test.out	output of test.f83 on TILE


PORTING AND TESTING

The current version runs on TILE Release 2.1, a Forth 83 written in C by
Mikael Patel (mip@ida.liu.se). TILE can be found on GNU ftp servers in
gnu/tile-forth-2.1.tar.Z.

If you have TILE Release 2.1, you can run the examples with
  forth -r400 test.f83
The output should look like test.out. Note that you have to leave TILE
manually.

If you have Release 2 of Tile, change '$print' to '$.' in gray.f83.
If you have Release 1, get Release 2 or 2.1.

Gray should be easy to port to other Forths. You may have to add some
words. All places you may have to change are marked with '!!' in
gray.f83:

Remove the "#include" line in the beginning.
Change the definition of ":noname" to suit your forth.
Change "bits/cell" and the subsequent cell words.
Change the references to 'source' and 'line' to something suitable for
  getting the current source position on your system.
Adjust "alignment" (not strictly necessary).
If your Forth is not direct or indirect threaded, change "compile,".

I made no effort to make the test programs portable, but I only expect
problems with mini and perhaps with calc.

Now you should be able to run the test programs (make sure your return
stack is big enough (360 cells for oberon)). 

If you want more speed, you can change a lot of multiply, divide and
remainder operations into shifts and ands.


DEPENDENCIES

Apart from the problems mentioned in the section on porting there are
a few other noteworthy things:

Your Forth should support long names
Gray needs a big return stack (e.g. ~360 cells for oberon). Adjust
your Forth-System (On older TILEs change RETURNSIZE in forth.c and
recompile; On Release 2.1 you can use TILE's -r command line option).


AKNOWLEDGEMENTS

Thanks to Mikael Patel giving me 'source' and 'line'.


COPYRIGHT

Copyright 1990, 1991 Martin Anton Ertl
This program is distributed WITHOUT ANY WARRANTY.
See gray.doc or gray.f83 for the license.
