From: | "Joachim Durchholz" <joachim_d@gmx.de> |
Newsgroups: | comp.compilers |
Date: | 6 Oct 2001 16:35:54 -0400 |
Organization: | Compilers Central |
References: | 01-09-087 |
Keywords: | design |
Posted-Date: | 06 Oct 2001 16:35:54 EDT |
Nick Maclaren <nmm1@cus.cam.ac.uk> wrote:
> What I want is something enough beyond BNF that I can define
> type-consistency, scoping, aliasing and value-constraint rules. The
> really fancy stuff can be said in English.
Take a look at two-level grammars (van Wijngaarden). It's a sort of
"grammars with attributes"; you stuff the types (and scoping
information etc.) into the attributes.
I'm not sure whether van Wijngaarden-style grammars are the best way
to do this today, or even when I first read about them. However, I
once saw a Pascal-style language defined with it, and I found the
grammar extremely readable even though I had no knowledge of these
grammars at the time. (Actually I don't know much about them today; in
fact I think somebody mentioned that progress has been made on the
field since the early 80ies.)
Two-level grammars are on the "context-sensitive" tier of the Chomsky
hierarchy.
Regards,
Joachim
Return to the
comp.compilers page.
Search the
comp.compilers archives again.