
I took a quick look at this file. To me it seems a mixture of a lexer and a parser built on top of a home brewn parser library. I see function like maybeWork which (if I interpret correctly) test whether specific conditions hold for the input, etc. Indeed it would be nice to have a grammatical description of the input format. An important question is whether you can be assured that all input is indeed correct, or whether any checking has to be done. Doaitse On 26 jul 2010, at 12:38, Eric Kow wrote:
On Mon, Jul 26, 2010 at 03:01:54 +0000, Jason Dagit wrote:
I think the grammar is fairly simple, although I'm not confident classifying it. I know it can be parsed with just a simple pass over the data. The only uses of backtracking are just to figure out what is next, like a peek at the next token. Let me give you some samples of what the input looks like.
For the interested, I think you can view
http://darcs.net/src/Darcs/Patch/Read.hs
or better yet darcs get --lazy http://darcs.net
Here are three entries from the "inventory" they correspond to PatchInfos: [TAG 2.4 Reinier Lamers
**20100226180900 Ignore-this: 36ce0456c214345f55a7bc5fc142e985 ] If it turns out to be a sufficiently low-powered grammar, we should probably write it up formally and stick it in the source code for documentation.
Eric
PS. We've been making little bits of progress trying to document Darcs on a technical high level, eg.
- http://wiki.darcs.net/DarcsInternals/Record - http://wiki.darcs.net/DarcsInternals/CacheSystem
Such a grammar would be a nice addition to the good-enough-that-you-could-rewrite-Darcs-in-Fortran aspiration.
-- Eric Kow http://www.nltg.brighton.ac.uk/home/Eric.Kow For a faster response, please try +44 (0)1273 64 2905. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe