Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!clyde!cbatt!cbosgd!gatech!jeff From: jeff@gatech.EDU (Jeff Lee) Newsgroups: comp.lang.c Subject: Re: YACC grammer for c Message-ID: <7275@gatech.EDU> Date: Thu, 4-Dec-86 13:36:09 EST Article-I.D.: gatech.7275 Posted: Thu Dec 4 13:36:09 1986 Date-Received: Fri, 5-Dec-86 04:56:30 EST References: <1338@nicmad.UUCP> <353@apple.UUCP> Reply-To: jeff@gatech.UUCP (Jeff Lee) Organization: School of Information and Computer Science, Georgia Tech, Atlanta Lines: 19 >Harbison and Steele's book (the exact name I'm not sure of now; I've lent >mine to a friend, but it's something like "C: A Reference Manual") contains >an appendix with a full LR(1) grammar for C. I've never tried YACCing it, >so I don't know if it works. The grammar in the back of Harbison and Steele is a real LALR(1) grammar and it YACC's just fine. They have even gone to the trouble of using "open" and "close" statements to remove the 1 shift/reduce error you normally get when compiling if-then-else statements. As a sideline, does anyone know what tool that they used to generate their grammar? The grammar contains all the split states that one would expect to come from an LALR(1) grammar that has been translated from an extended BNF. The split states were named strange things with numbers in them, also. (I haven't had a copy of H&S for over a year now so this is from memory). -- Jeff Lee CSNet: Jeff @ GATech ARPA: Jeff%GATech.CSNet @ CSNet-Relay.ARPA uucp: ...!{akgua,allegra,hplabs,ihnp4,linus,seismo,ulysses}!gatech!jeff