Date: Mon, 27 Jan 1997 11:58:38 -0500 From: Garrett Wollman <wollman@lcs.mit.edu> To: VaX#n8 <vax@linkdead.paranoia.com> Cc: tech-userlevel@netbsd.org, freebsd-current@FreeBSD.ORG Subject: ash & POSIX 1003.2 q's Message-ID: <9701271658.AA27187@halloran-eldar.lcs.mit.edu> In-Reply-To: <199701270724.BAA12986@linkdead.paranoia.com> References: <199701270724.BAA12986@linkdead.paranoia.com>
next in thread | previous in thread | raw e-mail | index | archive | help
<<On Mon, 27 Jan 1997 01:23:46 -0600, VaX#n8 <vax@linkdead.paranoia.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9701271658.AA27187>