
29 May
2007
29 May
'07
3:05 p.m.
Mark T.B. Carroll wrote:
apfelmus
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