
[ moved to glasgow-haskell-users@haskell.org ]
we would like to adapt a Haskell parser for whatever purposes, and looked for one in the ghc distribution. However, in ghc 5.02, we found two happy-generated parsers, one in ghc/compiler/parser and one in hslibs/hssource which both look similar, but seem to be slightly different (at least their version numbers are). Could someone tell me what the differences are and which one we really ought to use?
The parser in hslibs/hssource is designed to be portable (it's written in standard Haskell 98). GHC's parser, and in particular the lexer, by contrast uses several GHC extensions. Also, the hssource parser doesn't handle any GHC extensions to the Haskell syntax. If you're looking for a standalone Haskell parser, then hslibs/hssource is almost certainly the way to go. Cheers, Simon