[Haskell-beginners] Consuming Rule Based Parsing

Christopher Howard christopher.howard at frigidcode.com
Fri Nov 16 09:55:39 CET 2012

I haven't learned anything substantive yet regarding Haskell approaches
to parsing, so I would appreciate any pointers towards appropriate
modules, abstractions, tutorials, or such like.

Specifically: For a particular application, I want to play around with a
rules (grammer) based parsing which consumes an incoming data stream.
That is, I'm not parsing a single type of document with a set structure.
Rather, the idea is that I have a list of symbols (characters, numbers,
whatever) and pattern match the front part of the list according to some
(grammer) rule (which itself could be a conjunction or disjunction of
rules) in a set of rules. If the match succeeds, then I consume that
part of the list, and then analyze the remaining list, starting again
with the first rule in my rule set. If the match fails, then I try the
next rule in my rule set. (Sort of like Prolog's context free grammars
and difference lists.) Backtracking would also be cool (to see what
other results I can get).

Is there a particular Haskell abstraction or system suitable for what I
have described?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 551 bytes
Desc: OpenPGP digital signature
URL: <http://www.haskell.org/pipermail/beginners/attachments/20121115/4838762b/attachment.pgp>

More information about the Beginners mailing list