Thanks Stephan,<br><br>In Haskell, what would be the right thing to parse &quot;C&quot; like languages. Parsec literature seems to indicate that they can pretty much parse anything.<br><br>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.<br>
<br>Regards,<br>Kashyap<br><br><div class="gmail_quote">On Tue, Jun 1, 2010 at 7:59 PM, Stephen Tetley <span dir="ltr">&lt;<a href="mailto:stephen.tetley@gmail.com">stephen.tetley@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello<br>
<br>
For non-trivial parsing Parsec or UU-Parse are much better candidates.<br>
<br>
If you have Parsec installed from Hackage, I&#39;d still recommend you get<br>
the manual and source distribution from:<br>
<br>
<a href="http://legacy.cs.uu.nl/daan/parsec.html" target="_blank">http://legacy.cs.uu.nl/daan/parsec.html</a><br>
<br>
The source distribution has some examples - Tiger, Mondrian, Henk -<br>
full, if small languages.<br>
C is quite a large language and its grammar is usually presented for<br>
LR parsing so you are unlikely to find a parser for C or even a subset<br>
of C with a combinator library, as parser combinators are LL. To<br>
convert LR to LL needs a lot of left factoring and wouldn&#39;t be fun,<br>
though I believe there is a C parser for the ANTLR system which is<br>
LL(k).<br>
<br>
Best wishes<br>
<br>
Stephen<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Kashyap<br>