Ever wanted a LISP S-expressions parser?
I have. I do some natural language processing work, where some people like to output parse trees as S-expressions. Very natural. But then I always balk because I have to go whip up a little parser for it, which I know to be easy in principle, but... well, you know how that goes.
Anyway, if you're at my level of programming mediocrity, the one where "write an S-expressions parser" makes you think "I know this is easy, but do I have to?", then perhaps the lispparser package is for you! I guess this is too minor a package to warrant a mailing list announcement, but I've taken a bit of Jonathan Tang's tutorial code and put it on hackage as lispparser. If you think it needs improvement, I might consider putting a darcs2 repository online somewhere.
Hobby-hacking Eric
2008-05-09
Subscribe to:
Post Comments (Atom)
3 comments:
I've built a similar (though much larger) parser needed for my senior project. If you'd be interested in adding quoted and quasiquoted lists and other such features, I'd be more than willing to share my stuff (as gross as it may be).
vanenkj (at) gmail (dot) com
Interesting. Do you think it could be bolted on? Perhaps you'd be willing to start a code.haskell.org project taking this over?
Probably not bolted on. It would take some re-working, but would definitely be interesting to see. I also have parsers for (i think) all the constant number representations Common Lisp allows, though I don't know if adding all that support would make the parser more verbose than it needs to be.
Post a Comment