Related articles |
---|
parser generator in forth available ertl@vip.at (1991-02-05) |
Newsgroups: | comp.compilers |
From: | ertl@vip.at (Anton Ertl) |
Keywords: | parse, forth |
Organization: | Compilers Central |
Date: | Tue, 5 Feb 91 19:26:20 MEZ |
Gray is a parser generator written in Forth. It takes grammars in an
extended BNF and produces executable Forth code for recursive descent
parsers. There is no special support for error handling.
The Release 2 of Gray is now available. If you send me a notice, I
will send you Gray. Its size is 64K including documentation and
example programs.
Gray runs on TILE Release 2, a Unix Forth written in C by Mikael
Patel, but it can be ported to other Forths easily.
An interesting advantage over parser generators like yacc is the use
of Forth's stack for the actions. E.g., in the ubiquitous calculator
example you write
term K_+ expr {{ + }}
instead of
expr K_PLUS expr { $$ = $1 + $3 }
Martin Anton Ertl
ertl@vip.at, ...!mcsun!tuvie!vip!ertl
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.