[Haskell] grammar for Haskell?

P.C.Callaghan p.c.callaghan at durham.ac.uk
Thu Nov 4 08:24:20 EST 2004


> We are looking into parsing full Haskell98 (probably using SableCC)
> [...]
> b) any LALR(1) grammar for Haskell98,

This file contains the grammar used in GHC.


Note that there's also a module in the GHC libraries which can parse H-98
modules.  It might be easier to parse with this, then convert the result
into suitable trees in Java.


> e) any other concise Haskell98 grammar which is less
>      fragmented than the Haskell98 report.

I'm starting to look at adapting the grammar above for use with a
Generalized LR parser. This removes the need for the tricks required to
make the grammar LALR(1), because GLR can cope with local ambiguities.
Result: a more readable grammar. (Watch this page for news:


Dr Paul Callaghan       (Lecturer)      Email: P.C.Callaghan at durham.ac.uk
Computer Assisted Reasoning Group, Department of Computer Science, Durham

More information about the Haskell mailing list