From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 79feead0 for ; Wed, 16 Jan 2019 18:23:16 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id 4845E94FC5; Thu, 17 Jan 2019 04:23:15 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 8EA9C94FB8; Thu, 17 Jan 2019 04:22:53 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 1A63594FB8; Thu, 17 Jan 2019 04:22:52 +1000 (AEST) Received: from frenzy.freefriends.org (freefriends.org [96.88.95.60]) by minnie.tuhs.org (Postfix) with ESMTPS id 50EE294FB7 for ; Thu, 17 Jan 2019 04:22:51 +1000 (AEST) X-Envelope-From: arnold@skeeve.com Received: from freefriends.org (freefriends.org [96.88.95.60]) by frenzy.freefriends.org (8.14.7/8.14.7) with ESMTP id x0GIMnw8026813 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 16 Jan 2019 11:22:49 -0700 Received: (from arnold@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id x0GIMmQW026812; Wed, 16 Jan 2019 11:22:48 -0700 From: arnold@skeeve.com Message-Id: <201901161822.x0GIMmQW026812@freefriends.org> X-Authentication-Warning: frenzy.freefriends.org: arnold set sender to arnold@skeeve.com using -f Date: Wed, 16 Jan 2019 11:22:48 -0700 To: scj@yaccman.com, robpike@gmail.com References: <20190113044018.B235E156E410@mail.bitblocks.com> In-Reply-To: User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [TUHS] Knuth and Unix X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tuhs@tuhs.org Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" You can't lay the blame for that on Steve. The GNU Awk grammar has only 36 shift-reduce conflicts and no reduce-reduce conflicts. The mawk 1.3.4 grammar has an amazing count of only *four* shift-reduce conflicts. (But then, Mike Brennan is an amazing programmer.) I have no idea what happens if you run the POSIX awk grammar through yacc / bison, but it'd be an interesting experiment. Arnold Rob Pike wrote: > So you're the reason (Plan 9) awk has 83 reduce-reduce conflicts (and > 42 shift-reduce). > > -rob > > On Wed, Jan 16, 2019 at 9:39 AM Steve Johnson wrote: > > > > I remember reading Knuth's paper, and certainly heard DeRemer's name, but it didn't affect much of what I did. There was a paper out of Stanford about that time that influenced me greatly -- it was about pattern matching languages, and proposed separating two ideas: 1. "Here are the patterns that match this tree". And 2. "If more than one pattern matches, here's how to decide which one to use." Given the constraints of size on the PDP 11, anything but LR(1) was infeasable. But using ambiguous grammars and broadening the shift/reduce test to trest operator precedence fit right into that pattern. Another thing that I think was unique to Yacc at the time was introducing symbols that matched the empty string whose reduction caused program actions. Many similar parser systems at the time could not deal with these "empty" symbols. > > > > Steve > > > > > > > > ----- Original Message ----- > > From: "Bakul Shah" > > To:"Steve Johnson" > > Cc:, , , > > Sent:Sat, 12 Jan 2019 20:40:11 -0800 > > Subject:Re: [TUHS] Knuth and Unix > > > > > > On Sat, 12 Jan 2019 19:41:26 -0800 "Steve Johnson" wrote: > > > One connection Knuth had to Unix was inventing LALR parsing, the basic > > > algorithm used in Yacc. I added some things (notably, the precedence > > > mechanism) and had to do a lot of engineering to be able to handle large > > > grammars (e.g. F77) on a PDP-11. But the underlying algorithm (taught to > > > my be Al Aho) was all Knuth. > > > > Knuth invented LR parsing but IIRC it was DeRemer who came up > > with LALR parsing. In 78-79 I was implementing a LALR(1) > > parser generator in Pascal on strength of which I got my first > > real job. At that job I used DeRemer and Pennello's 1979 > > paper to reimplement the parser generator. > >