[Haskell-cafe] Parselib sample

C K Kashyap ckkashyap at gmail.com
Tue Jun 1 13:54:17 EDT 2010


Thanks Stephan,

In Haskell, what would be the right thing to parse "C" like languages.
Parsec literature seems to indicate that they can pretty much parse
anything.

The reason I had asked for a sample in Parselib was for me to understand the
monadic parser in action. The last time I tried looking at Parsec from RWH,
I could not follow it too well.

Regards,
Kashyap

On Tue, Jun 1, 2010 at 7:59 PM, Stephen Tetley <stephen.tetley at gmail.com>wrote:

> 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
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



-- 
Regards,
Kashyap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100601/1576d6e8/attachment.html


More information about the Haskell-Cafe mailing list