[Haskell-beginners] Parsing Ambiguous Languages
Stephen Tetley
stephen.tetley at gmail.com
Mon Jul 19 15:30:21 EDT 2010
Hello Alex
Choice in Parsec is left-biased - the alternative combinator (<|>)
will return the fist successful parse. For reasons see the paper [1] -
in a nutshell error reporting is hard for ambiguous parsers and space
leaks become a problem.
Happy has some support for GLR parsing, but it might not working in
the current release.
If your interest is via natural language processing you might want to
search for Peter Ljunglof's (umlauts on o) thesis - "Pure Functional
Parsing an advanced tutorial". It covers Chart parsing (extending
Earley parsing) and GLR parsing. All source is within the paper.
[1] Daan Leijen & Erik Meijer
Parsec: Direct Style Monadic Parser Combinators For The Real World
More information about the Beginners
mailing list