Tuesday, October 17, 2006

Parser combinators example

Chris Double has put together a lovely example of parsing s-expressions using his parser combinators library.

Parser combinators are one of the Haskell community's nicest contributions to computer science at large.

4 comments:

Anonymous said...

Parser combinators eh... /me prints out some stuff to read on ride home.

Anonymous said...

So whats so great about parser combinators that spirit (from boost) can't do???

Looks like hocus pocus.

Slava Pestov said...

Well if boost can implement an arbitrary grammar with unlimited lookahead, then obviously parser combinators cannot do anything boost can do. They are written in a more elegant language than C++ though.

Anonymous said...

When you have arbitrary lookahead, then doesn't that imply you can implement an arbitrary grammar?