Kessel is a more clojure-fied version of clarsec, which itself is a port of Haskell's Parsec to Clojure.
Rather than rely on an external monad library, kessel relies on
clojure.algo.monads. This has the advantage that it can be dropped into other monadic code in Clojure should that be necessary.
There are two example parsers in the
kessel.examples. One parses dates, and the other parses a small subset of JSON. The JSON example serves as an example of building parsers with recursive grammars.
Forward references for recursive rules require some hackery. Instead of using
delay as clarsec does, kessel doesn't solve the problem for you. The JSON example uses
alter-root-var to get around the issue, which is currently the recommended way to go.
Left recursive grammars should be avoided as they will eventually explode. There's some smart memoization that can be done to avoid this, but I haven't done it yet.
- Solve the explosion problem for left recursive grammars.
- Make a better solution for forward references in recursive grammars
- Should probably write some tests. :)
Since this was originally a fork of clarsec and it used the Apache License version 2.0, so too does Kessel, though this is not necessarily desired.