Frown is an LALR(k) parser generator for Haskell 98 written in Haskell 98.
The work on Frown started as an experiment in generating genuinely functional LR parsers. The first version was written within three days—yes, Haskell is a wonderful language for rapid prototyping. Since then Frown has gone through several cycles of reorganization and rewriting. It also grew considerably: dozens of features were added, examples were conceived and tested, and this manual was written. In the end, Frown has become a useable tool. I hope you will find it useful, too.
The parser generator is available from
http://www.informatik.uni-bonn.de/~ralf/frown.
The bundle includes the sources and the complete documentation (dvi, ps, PDF, and HTML).
You should be able to build Frown with every Haskell 98-compliant compiler. You have to use a not too ancient compiler as there have been some changes to the Haskell language in Sep. 2001 (GHC 5.02 and later versions will do).
The Haskell interpreter Hugs 98 is needed for running the testsuite.
Various tools are required to generate the documentation from scratch: lhs2TeX, LATEX, functional , HEVEA and HACHA. Note, however, that the bundle already includes the complete documentation.
Unzip and untar the bundle. This creates a directory called Frown. Enter this directory.
ralf> tar xzf frown.tar.gz |
ralf> cd Frown |
The documentation resides in the directory Manual; example grammars can be found in Examples and Manual/Examples (the files ending in .g and .lg).
You can install Frown using either traditional makefiles or Cabal.
Optionally, edit the Makefile to specify destinations for the binary and the documentation (this information is only used by make install). Now, you can trigger
ralf/Frown> make |
which compiles Frown generating an executable called frown (to use Frown you only need this executable). Optionally, continue with
ralf/Frown> make install |
to install the executable and the documentation.
For reference, here is a list of possible targets:
Alternatively, you can build Frown using Cabal (version 1.1.3 or later), Haskell’s Common Architecture for Building Applications and Libraries.
For a global install, type:
ralf/Frown> runhaskell Setup.hs configure --ghc |
ralf/Frown> runhaskell Setup.hs build |
ralf/Frown> runhaskell Setup.hs install |
If you want to install Frown locally, use (you may wish to replace $HOME by a directory of your choice):
ralf/Frown> runhaskell Setup.hs configure --ghc --prefix=$HOME |
ralf/Frown> runhaskell Setup.hs build |
ralf/Frown> runhaskell Setup.hs install --user |
The call
ralf/Frown> frown -h |
displays the various options. For more information consult this manual.
Bug reports should be send to Ralf Hinze (ralf@cs.uni-bonn.de). The report should include all information necessary to reproduce the bug: the compiler used to compile Frown, the grammar source file (and possibly auxiliary Haskell source files), and the command-line invocation of Frown.
Suggestions for improvements or request for features should also be sent to the above address.
Frown is distributed under the GNU general public licence (version 2).
Frown wouldn’t have seen the light of day without the work of Ross Paterson and Doaitse Swierstra. Ross invoked my interest in LR parsing and he devised the --code=stackless and --code=gvstack output formats. Doaitse invented the --code=standard format, which was historically the first format Frown supported.
A big thank you goes to Andres Löh and Ross Paterson for various bug reports and suggestions for improvement.