[Haskell-cafe] Parselib sample

Stephen Tetley stephen.tetley at gmail.com
Tue Jun 1 10:29:12 EDT 2010


Hello

For non-trivial parsing Parsec or UU-Parse are much better candidates.

If you have Parsec installed from Hackage, I'd still recommend you get
the manual and source distribution from:

http://legacy.cs.uu.nl/daan/parsec.html

The source distribution has some examples - Tiger, Mondrian, Henk -
full, if small languages.
C is quite a large language and its grammar is usually presented for
LR parsing so you are unlikely to find a parser for C or even a subset
of C with a combinator library, as parser combinators are LL. To
convert LR to LL needs a lot of left factoring and wouldn't be fun,
though I believe there is a C parser for the ANTLR system which is
LL(k).

Best wishes

Stephen


More information about the Haskell-Cafe mailing list