
7 Nov
2009
7 Nov
'09
3:53 a.m.
Matthias Guedemann wrote:
Hi Brent,
thanks for the illustrative example.
For example, consider parsing a file which contains a positive integer, followed by that many letters. For example,
3xyz 12abcdefghijkl
are two instances of this format. In order to parse this, a monadic interface is required, since the result of parsing the number must be used to decide how many things to parse after that.
I see, but as long as I want to parse context free grammars, it is sufficient?
Yep. The monadic version can handle context-sensitive grammars. Incidentally, this is why the Utrecht parsing libraries ( uu-parsinglib ) only offers an applicative interface. Regards, apfelmus -- http://apfelmus.nfshost.com