Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site gatech.CSNET Path: utzoo!linus!gatech!arnold From: arnold@gatech.CSNET (Arnold Robbins) Newsgroups: net.lang.c Subject: Re: Grammar for C Message-ID: <468@gatech.CSNET> Date: Wed, 1-May-85 13:49:35 EDT Article-I.D.: gatech.468 Posted: Wed May 1 13:49:35 1985 Date-Received: Thu, 2-May-85 06:32:45 EDT References: <738@mako.UUCP> Distribution: net Organization: Pr1mebusters! Lines: 26 > Various people have asked about the availability > of a grammar for C. The book "A C Reference Manual" > by Harbison & Steele (Prentice-Hall) contains a > complete LALR(1) grammar for the language. > > Glen McCluskey > ..tektronix!mako!glenm Unfortunately, the grammar (along w/the rest of the book) is copyrighted by the publisher, which will may be a problem should you wish to base your C compiler on their grammar. I know that Guy Steele is on the net someplace; maybe he has something more authoritative to say about this. On the other hand, the grammar given in the current draft(s) of the ANSI C standard can be easily made LALR(1). A YACC grammar based on the Nov 11 draft was posted awhile back by my office mate, Jeff Lee (gatech!jeff). It is for the ANSI C, but could be easily made K&R C w/very little work. Check your archives for net.sources for it, or if enough requests come flooding in (as will probably happen), we'll repost it. -- Arnold Robbins CSNET: arnold@gatech ARPA: arnold%gatech.csnet@csnet-relay.arpa UUCP: { akgua, allegra, hplabs, ihnp4, seismo, ut-sally }!gatech!arnold How come nobody likes good ideas when they don't come up with them?