The Strafunski-Sdf2Haskell package

[Tags: bsd3, program]

Generates code for using SDF grammars in Haskell. See for more information about SDF.

[Skip to ReadMe]


Change logChangeLog
Dependenciesbase (<=, directory (<=, haskell-src (<=1.0.2), mtl (<=2.1.2), pretty (<=, process (<=, Strafunski-ATermLib (<=1.6.1), Strafunski-StrategyLib (<=5.0.1), template-haskell [details]
AuthorRalf Laemmel, Joost Visser
Source repositoryhead: git clone
UploadedFri May 3 10:02:27 UTC 2013 by JamesKoppel
Downloads474 total (11 in last 30 days)
0 []
StatusDocs not available [build log]
All reported builds failed as of 2015-11-12 [all 6 reports]


Maintainers' corner

For package maintainers and hackage trustees

Readme for Strafunski-Sdf2Haskell-



                   Sdf2Haskell version 1.0, November 2002

                   Ralf Laemmel                Joost Visser
               CWI & VU, Amsterdam            CWI, Amsterdam

This package contains Sdf2Haskell, a generator that takes an SDF
grammar as input and produces a corresponding set of Haskell datatype
definitions as output.

--- GENERAL ------------------------------------------------------------------

For information see:

Contents of this package:

  - generator	Directory with the files that make up the generator
  - examples	Directory with examples of using the generator
  - scripts     Directory with sets of reusable make rules

--- PREREQUISITES ------------------------------------------------------------


 I. Your path must contain the following programs:
   - GHC (version 6.4 or higher)
   - DrIFT (version 2.1.2)
   - sdf2table (version 1.10)
   - sglr (version 3.4.1 or higher)
   - implodePT (version 1.1 is known to work)
 II. The following Strafunski packages must be available:
   - StrategyLib-5.0
   - haterm-1.5
   Preferably, these packages should be placed in the same directory
   as this Sdf2Haskell package.

GHC and DrIFT can easily be found via the Haskell organization home
page at:

The programs sdf2haskell, sglr, and implodePT can be obtained in various
   - by installing the "sdf2" package from the Online Package Base at (source
     distribution only).
   - by installing StrategoXT's prerequisite package "sdf2-bundle"
     from (source and bindary
     distributions available).
   - by installing the ASF+SDF Meta-Environment, which can be obtained
     as "asfsdf-meta" from

The required Strafunski packages can be downloaded from the
Strafunfski home page

--- INSTALL ------------------------------------------------------------------

The Sdf2Haskell generator can be configured, built, and installed IN PLACE,
as follows:

  ./configure [flags]
For help on the configuration flags, type:

  ./configure --help

In particular, you might want to use the --with-haterm and --with-StrategyLib
flags to point out where the required Strafunksi packages are.  

--- RUN ----------------------------------------------------------------------
After configuration and builing, the Sdf2Haskell generator is available in:

You may want to extend your PATH to include ./generator.

You can now run the generator as follows:

  sdf2haskell -i <grammarfile> -m <modulename> -o <haskellfile>
where the <grammarfile> is a file containing the SDF grammar you want to feed
to the generator as input, <modulename> is the name of the Haskell module
you want to be generated, and <haskellfile> is the name of the file into which
you want the generated Haskell file to be written. Use the -p option if you
want to generate customizable pretty-print functions instead of datatypes
that represent abstract syntax trees.

--- EXAMPLES -----------------------------------------------------------------

To see the examples in action, you can type:

  gmake check

Do this in the top level directory to run all examples, or in a
specific example directory to run a single one. The example in
examples/twosorts is the most simple one which only invokes the
generator. The other examples (for Java and Cobol) also involve
compilation of code depending on the generated Haskell datatypes
as well as parser generation and parser invocation.