From owner-freebsd-current Mon Jan 27 08:59:08 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id IAA13474 for current-outgoing; Mon, 27 Jan 1997 08:59:08 -0800 (PST) Received: from halloran-eldar.lcs.mit.edu (halloran-eldar.lcs.mit.edu [18.26.0.159]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id IAA13466 for ; Mon, 27 Jan 1997 08:58:50 -0800 (PST) Received: by halloran-eldar.lcs.mit.edu; (5.65v3.2/1.1.8.2/19Aug95-0530PM) id AA27187; Mon, 27 Jan 1997 11:58:38 -0500 Date: Mon, 27 Jan 1997 11:58:38 -0500 From: Garrett Wollman Message-Id: <9701271658.AA27187@halloran-eldar.lcs.mit.edu> To: VaX#n8 Cc: tech-userlevel@netbsd.org, freebsd-current@FreeBSD.ORG Subject: ash & POSIX 1003.2 q's In-Reply-To: <199701270724.BAA12986@linkdead.paranoia.com> References: <199701270724.BAA12986@linkdead.paranoia.com> Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk < said: > I'm a little disappointed that pdksh doesn't use something > like yacc, but perhaps there is a good reason (the tables get too big? > suboptimal generated parsers?) Tom Duff once noted that the grammar given in the AT&T sh(1) man page did not allow even such simple commands as `who | wc'. He then went on to say, ``[There is] an even darker secret: nobody really knows what the Bourne shell's grammar is.'' (Sorry, I can't find the reference for this right now.) The original Bourne shell was implemented with a recursive-descent parser, but with so many flags and special options to each function that it was next-to-impossible for someone to determine by inspection precisely what language it would accept. Add to that the fact that it was written in BOURNEGOL, and it's no wonder people had difficulty writing programs which attempted to interpret the same language. Of course, the POSIX folk have actually come up with a grammar for their version of the Bourne shell, but I would be surprised if anybody knew whether it actually described the input language of the original. (Actually, I am quite certain that it doesn't, since the original Bourne shell didn't have shell functions. But the point still stands even stipulating this.) -GAWollman -- Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same wollman@lcs.mit.edu | O Siem / The fires of freedom Opinions not those of| Dance in the burning flame MIT, LCS, ANA, or NSA| - Susan Aglukark and Chad Irschick