Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ucla-cs!zen!ucbvax!decvax!ima!johnl From: johnl@ima.UUCP Newsgroups: comp.compilers Subject: Re: Algol 68 Message-ID: <652@ima.ISC.COM> Date: Fri, 14-Aug-87 12:00:26 EDT Article-I.D.: ima.652 Posted: Fri Aug 14 12:00:26 1987 Date-Received: Sun, 16-Aug-87 05:45:46 EDT References: <646@ima.ISC.COM> <648@ima.ISC.COM> Sender: johnl@ima.ISC.COM Reply-To: harvard!ut-sally!utah-cs!shebs (Stanley Shebs) Organization: PASS Research Group Lines: 31 Approved: compilers@ima.UUCP Original-sender: In article <648@ima.ISC.COM> steven@cwi.nl (Steven Pemberton) writes: >[...] >On the subject of two-level grammars, it seems to me a pity that they >receive so little attention. They use an extremely simple mechanism, >and are as powerful as a Turing machine, so you can define the syntax, >context conditions, and semantics with the one formalism. Again I >blame the rather heavy style of the Algol 68 report for giving them a >bad name. For instance, if they'd only used ROWS-OPTION instead of >ROWSETY to indicate an optional ROWS, it would have made it much >easier reading. Two-level grammars have the same problem that attribute grammars do - they are based on the belief that the world is linear strings of tokens. Sooner or later, simple grammars don't work, so people have introduced some pretty bizarre schemes to patch things up. (My first response to attribute grammars was the word "kludge".) The schemes inevitably go all the way to Turing equivalence, which should be a warning signal that you're no longer dealing with strings of tokens, except in a purely formal sense, and that other general computational mechanisms are worth thinking about (recursive functions, logic, term rewriting, etc). Of course, the fact that I've been hacking Lisp for the past five years has nothing to do with this view of grammars. :-) stan shebs shebs@cs.utah.edu -- Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.ARPA Plausible paths are { ihnp4 | decvax | cbosgd | harvard | yale | cca}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request