Related articles |
---|
extending a grammar maatwerk@euronet.nl (1996-03-12) |
Re: extending a grammar foggia@amalfi.dis.unina.it (1996-03-21) |
Re: extending a grammar platon!adrian@uunet.uu.net (1996-03-25) |
Re: extending a grammar mw@ipx2.rz.uni-mannheim.de (1996-03-27) |
Re: extending a grammar franka@europa.com (1996-03-27) |
From: | mw@ipx2.rz.uni-mannheim.de (Marc Wachowitz) |
Newsgroups: | comp.compilers |
Date: | 27 Mar 1996 00:08:07 -0500 |
Organization: | --- |
References: | 96-03-082 |
Keywords: | design, parse |
M.M. van der Laan (maatwerk@euronet.nl) wrote:
> A solution might be to be able to expand the grammar by means of some
> EBNF notation, written in the language itself.
> Has anyone done this / thought of this / seen this before? Any remarks?
Dylan can be extended by adding macros, which are - unlike more
traditional Lisp macros - based on the grammar, and permit only
particular categories of syntactic extensions, rather than arbitrary
programmable replacement. It's still quite powerful - most of the
specified language syntax could be defined this way, and [circular]
examples how to do that are part of the Dylan Reference Manual (see
http://www.cambridge.apple.com/dylan/dylan.html, where the manual is
also available, or comp.lang.dylan for discussions).
Sure, the power of syntax extension can be abused, but with restraint
(e.g. style guidelines and discussion of new macros in a design
team), I'd never- theless like to have such a capability available, to
support abstractions for some application domains. I consider that
preferrable to any kind of additional preprocessor (often used for
SQL), or separate languages (usually a brain-damaged 4GL combined with
C). Who likes to do database application programming through a
low-level C interface? :-(
-- Marc Wachowitz <mw@ipx2.rz.uni-mannheim.de>
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.