Grammar for (Glasgow) Haskell

Is this available as a happy file (or something similar)? I tried searching the 6.10.1 source package for *.y, but the three files I found don't seem to be what I'm looking for. What I want to try to do is to generate C wrappers to call GHC-compiled code by parsing foreign export declarations. But I figure just searching the code for a regular expression on the lines of foreign[ ]+export is going to be over-simplistic. But I'd rather not type in all the Haskell grammar myself (I'm lazy - you wouldn't expect any other sort of person on this list, I assume :-) ). -- Colin Adams Preston Lancashire

On Sun, 2008-11-23 at 16:22 +0000, Colin Paul Adams wrote:
Is this available as a happy file (or something similar)?
I tried searching the 6.10.1 source package for *.y, but the three files I found don't seem to be what I'm looking for.
ls compiler/parser reveals... Lexer.x Parser.y.pp However you might get further using the ghc api package. Duncan

waldmann@afa:~/software/haskell/ghc-6.10.1> find . -name "*.y*" ./compiler/main/ParsePkgConf.y.source ./compiler/parser/ParserCore.y.source ./compiler/parser/Parser.y.pp.source ./compiler/parser/HaddockParse.y.source ...
participants (3)
-
Colin Paul Adams
-
Duncan Coutts
-
Johannes Waldmann