Re: Parsing ambiguities



On Thu, Jun 01, 2006 at 12:45:32AM -0400, Arthur J. O'Dwyer wrote:

Is there any (free and/or published) parser generator that can deal
with ambiguous grammars like this one by generating multiple parse trees?

There's a paper on parser combinators in Haskell that describes a very
elegant way to generate parsers that can deal with ambiguity. Indeed, it
generates (lazily, because it's Haskell) all possible parsings of the
input, discarding any that fail at higher levels. It would be
conceptually simple to build your interpreter on top of that.

I've made an implementation of the same parser combinators in Scheme. I
can send it to you if you're interested.

Kind regards,

Bob

---
The sendmail configuration file is one of those files that looks like someone
beat their head on the keyboard. After working with it... I can see why!
-- Harry Skelton

Attachment: pgpWFqq2EBLQS.pgp
Description: PGP signature