Has anyone had experience with Parsec vs. --  the Parser combinators
supplied with Manuel M. T. Chakravarty's Compiler Toolkit: Self-optimizing
LL(1) parser combinators?

As someone trying to learn FP, I have been playing with the Compiler Toolkit
lexical analyzer combinators, but I have had some roadblocks:
- there are no examples and the tests do not cover the typical use cases.
- regular expression support is limited -- there is no "." operator to match
any char, nor any exclusion operator i.e. [^abc] for anything in abc.
I anticipate success, but I think the Compiler Toolkit needs some
improvements.



I am currently trying to lex xpath and hopefully will have some success
soon, but I would consider rewriting with another library.

Eventually I hope to parse xpath, and then xslt using nodes in an xml tree
as tokens. If I get that far, I would like to find a way to implement an
xslt processor that makes one pass over an xml document using an algebra for
low-memory processing.  Of course, I barely know what I am doing with
Haskell, which is why I am doing this project in the first place.  Any
suggestions are welcome.



I am currently doing all my work in hugs.

>
>
> -----Original Message-----
> From: Daan Leijen [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 18, 2000 9:41 AM
> To: '[EMAIL PROTECTED]'
> Subject: combinator parsers
>
>
> > Are combinator parsers recursive decent?
> > Do they have any disadvantages over generated parsers like that yacc
would
> produce?
> Yes, combinator parsers are recursive decent (ie. LL parsers). Some
> libraries, like the ones that produce parse tables, are restricted to
LL(1)
> while others can handle arbitrary LL(n) grammars and even
context-sensitive
> infinite look-ahead grammars.
> The Parsec library is an 'industrial strength' parser combinator library
> that is simple, safe, well documented, has extensive libraries and good
> error messages. The documentation discusses problems and advantages of
using
> a combinator library with respect to a parser generator. The main
advantage
> of Parsec is that it can parse a much larger class of grammars that
LALR(1)
> (like yacc).
> Parsec is part of HsLibs distributed with GHC and it can be found at:
> http://www.cs.uu.nl/~daan/parsec.html
> You might also want to take a look at an elegant parser generator for
> Haskell, called Happy.
> http://www.haskell.org/happy
>
> All the best,
> Daan.
>


Reply via email to