[Haskell-cafe] Re: Frisby grammars that have context

apfelmus apfelmus at quantentunnel.de
Tue May 29 11:05:40 EDT 2007


Mark T.B. Carroll wrote:
> apfelmus <apfelmus at quantentunnel.de> writes:
> (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.

(I'm not sure whether I've been clear: this probably allows you to use a
context-free grammar. I wanted to say that the language of all valid
Pascal programs is context-sensitive but that you can parse it with a
context-free grammar and decide "semantic" validity later on.)

Regards,
apfelmus



More information about the Haskell-Cafe mailing list