Jim Burton <[EMAIL PROTECTED]> wrote:
> After posting I realised the difference between parsing "(a)" <|>
> "(b)" and parsing "a" <|> "aa" ... so Parsec doesn't do the latter
> well or at all?
Exactly. Parsec is designed to avoid backtracking altogether, and to
give only one answer, so it is the wrong tool for the job. You could
look into alternative parser combinators like the Hutton Meijer ones
from way back - they are non-deterministic and backtracking, and can
explicitly represent all possible parses as a list, which I think is
what you want. You can find them in the polyparse package:
http://www.cs.york.ac.uk/fp/polyparse
Regards,
Malcolm
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe