[Haskell-cafe] Re: Frisby grammars that have context
Mark T.B. Carroll
Mark.Carroll at Aetion.com
Tue May 29 10:53:40 EDT 2007
apfelmus <apfelmus at quantentunnel.de> writes:
(snip)
> It's intentionally impossible. Frisby uses a dynamic programming
> approach that crucially depends on the fact that the grammar in question
> is context-free (actually something related, but the effect is the
> same). You're trying to parse a context-sensitive language.
Aha, thanks, that makes sense: I am glad that for once I wasn't missing
the obvious after all. Presumably this restriction allows it to gain
other benefits. I hadn't realised that the different implementations of
Frisby and Parsec had such far-reaching consequences.
(snip)
> This not a correct Pascal program, nevertheless the parse succeeds just
> fine. The missing declaration for y will be detected when processing the
> abstract syntax tree further. The key point is that the shape of the
> abstract syntax tree doesn't depend on whether y is declared or not.
Mmmmm, indeed it was a missing-declaration sort of problem I had in
mind. Thanks for the example.
-- Mark
More information about the Haskell-Cafe
mailing list