grammar for Haskell?
Hi! We are looking into parsing full Haskell98 (probably using SableCC) as an input language to our program verification environment (http://www-i2.informatik.rwth-aachen.de/AProVE). Does anyone know about and can point me to either a) a SableCC style Haskell98 grammar description, b) any LALR(1) gramamr for Haskell98, c) a Haskell98 grammar for either JavaCC, ANTLR or another Java-based compiler compiler, d) a Haskell98 grammar for a compiler compiler whose output can be compiled to Java classes/bytecode, or e) any other concise Haskell98 grammar which is less fragmented than the Haskell98 report. Any help in this matter is appreciated. The lower the letter, the better :-) Kind regards, Peter -- Peter Schneider-Kamp mailto:psk@informatik.rwth-aachen.de LuFG Informatik II http://www-i2.informatik.rwth-aachen.de/~nowonder RWTH Aachen phone: ++49 241 80-21211
Hello,
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. http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/ghc/compiler/parser/Parser... 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. http://www.haskell.org/ghc/docs/latest/html/libraries/haskell-src/Language.H...
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: http://www.dur.ac.uk/p.c.callaghan/happy-glr/) Paul -------------------------------------------------------------------------------- Dr Paul Callaghan (Lecturer) Email: P.C.Callaghan@durham.ac.uk Computer Assisted Reasoning Group, Department of Computer Science, Durham http://www.dur.ac.uk/CARG
participants (2)
-
P.C.Callaghan -
Peter Schneider-Kamp