Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mit-eddie!killer!elg From: elg@killer.DALLAS.TX.US (Eric Green) Newsgroups: comp.sys.amiga Subject: Re: FLEX/LEX and YACC/BISON Message-ID: <8188@killer.DALLAS.TX.US> Date: 25 May 89 04:08:28 GMT References: <18158@unix.cis.pittsburgh.edu> Distribution: usa Organization: The Unix(R) Connection, Dallas, Texas Lines: 40 in article <18158@unix.cis.pittsburgh.edu>, jgh2@unix.cis.pittsburgh.edu (John G. Hardie) says: > I was wondering if anyone out there knows a good tutorial on the use > of lex and yacc to generate a parser. I understand some things about > how parsers work, but am woefully ignorant about the functioning of > these two programs. I would like to play with them a bit, but don't > know how to get started. (the unix man pages were, uh, less than > enlightening, and the programmer docs were almost as bad. I suppose Book #1: _Introduction to Copmiler Construction with UNIX_, Axel T. Schreiner and H. George Friedman, Jr. Publisher: Prentice-Hall. ISBN 0-13-474396-2. Synopsis: Tells how to write Lex and Yacc definitions, tells how to do Yacc error recovery and other such "tricks of the Yacc trade", gives copious examples. Will NOT teach you how to write a compiler -- you're assumed to already know that. Simply runs you through the Unix tools to build a simple compiler. Book #2: The "New Dragon Book": _Compilers: Principles, Techniques, and Tools. Aho, Sethi, Ullman. Addison-Wesley ISBN 0-201-10088-6. Nearly definitive reference of current "state of the art". Tells about the algorithms underlying Lex and Yacc, amongst other things. Gives some example Yacc and Lex, e.g. a simple desk calculator on page 259, but not much. The entire book is nearly impenetrable for someone who hasn't taken a "Formal Languages" course, or who hasn't touched discrete math/logic in eons. Would greatly benefit from being re-written into English. Still, there's something to be said about having the definitive reference on your shelf, in case you get tired of dealing with black boxes and wonder what's REALLY happening. Just scan a formal languages book first (Ullman collaborated on one '78 ways that was pretty good, but I forget the title offhand). I got these through the Unix Bookstore, a few years back. There may be more up-to-date books available now. I don't have their number handy, maybe a couple of unix.wizards can help? -- | // Eric Lee Green P.O. Box 92191, Lafayette, LA 70509 | | // ..!{ames,decwrl,mit-eddie,osu-cis}!killer!elg (318)989-9849 | | // Join the Church of HAL, and worship at the altar of all computers | |\X/ with three-letter names (e.g. IBM and DEC). White lab coats optional.|