[Haskell-cafe] Re: Parsec is being weird at me

Stefan O'Rear stefanor at cox.net
Sat Aug 25 15:37:59 EDT 2007


On Sat, Aug 25, 2007 at 08:18:29PM +0100, Andrew Coppin wrote:
> But hang on a minute...
>
> "many" parses 0 or more occurrances of an item.
>
> "sepBy" parses 0 or more occurrances of an item, seperated by another item.
>
> "endBy" parses 0 or more occurrances of an item, terminated by another 
> item.
>
> "sepEndBy" parses 0 or more occurrances of an item, seperated *and* 
> terminated by another item.
>
> ...except that "endBy" doesn't seem to be working right. :-S

There is one other little bit of documented behavior.  Parsec's normal
combinators only parse LL(1) grammars.  Consult any work on formal
languages for the exact meaning and all the consequences, however for
this example it serves to note that after seeing abc, the single
character of lookahead '#' is not sufficient to determine the correct
parse.

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20070825/c7bed87d/attachment.bin


More information about the Haskell-Cafe mailing list