Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!medar!jseymour From: jseymour@medar.com (James Seymour) Newsgroups: comp.lang.c Subject: Re: yacc Message-ID: <109@hdwr1.medar.com> Date: 6 Apr 91 13:12:29 GMT References: Organization: Medar, Inc. Farmington Hills, MI Lines: 27 In article mef@romulus.rutgers.edu (Marc E. Fiuczynski) writes: >This is a desperate move. I need a good example of a yacc grammar. What you really need, IMHO, is a copy of "The UNIX Programming Environment" by Kernighan and Pike. There is a complete chapter on yacc (with lex also covered briefly). In that chapter is a complete example of a yacc program that they call "hoc" (high order calculator). In the example, hoc is implemented in steps, starting with the simplest concepts and working up to the more complex. Each iteration of the program (there are, I think, five or six) adds new concepts. I recommend it highly. Be warned, there are a couple of design/coding snafus. Boy, did I learn a lot about how that program works from tracking those down :-). On the other hand, these did not bite me until I went on to "extending" the thing. >Thanks in advance! >-Marc >-- >______________________________________________________________________________ >Marc E. Fiuczynski \\ Home: (609) 683-4416 School: (908) 878-9388 >mef@remus.rutgers.edu // UUCP: {backbone}!rutgers!remus.rutgers.edu!mef -- Jim Seymour | Medar, Inc. ...!uunet!medar!jseymour | 38700 Grand River Ave. jseymour@medar.com | Farmington Hills, MI. 48331 CIS: 72730,1166 GEnie: jseymour | FAX: (313)477-8897