If you need to parse or process text data in Linux or Unix, this useful book explains how to use flex and bison to solve your problems quickly. flex & bison is the long-awaited sequel to the classic O'Reilly book, lex & yacc. In the nearly two decades since the original book was published, the flex and bison utilities have proven to be more reliable and more powerful than the original Unix tools.
flex & bison covers the same core functionality vital to Linux and Unix program development, along with several important new topics. You'll find revised tutorials for novices and references for advanced users, as well as an explanation of each utility's basic usage and simple, standalone applications you can create with them. With flex & bison, you'll discover the wide range of uses these flexible tools offer.
Address syntax crunching that regular expressions tools can't handle
Build compilers and interpreters, and handle a wide range of text processing functions
Interpret code, configuration files, or any other structured format
Learn key programming techniques, including abstract syntax trees and symbol tables
Implement a full SQL grammar-with complete sample code
Use new features such as pure (reentrant) lexers and parsers, powerful GLR parsers, and interfaces to C++
Chapter 1 Introducing Flex and Bison
Lexical Analysis and Parsing
Regular Expressions and Scanning
Grammars and Parsing
Ambiguous Grammars: Not Quite
Adding a Few More Rules
Flex and Bison vs. Handwritten Scanners and Parsers
John Levine, founder of Taughannock Networks, writes, speaks, and consults on e-mail, the Internet, and other computer topics. He has written over 20 technical books, and is the co-author of O'Reilly's lex & yacc, 2nd Edition and qmail. He's also deeply involved in Internet e-mail in general and spam issues in particular as co-chair of the Internet Research Task Force's Anti-Spam Research Group (http://asrg.sp.am ) and a board member of the Coalition Against Unsolicited Commercial E-mail (http://www.cauce.org.)He lives and works in the tiny village of Trumansburg NY (http://www.trumansburg.ny.us) where he reports that being the municipal sewer commissioner was a much cleaner job than dealing with spammers.
Our look is the result of reader comments, our own experimentation, and feedbackfrom distribution channels. Distinctive covers complement our distinctive approach totechnical topics, breathing personality and life into potentially dry subjects.
The animals on the cover of flex & bison are Nicobar pigeons (Caloenas nicobarica).This large (approximately 40 cm) bird with gray, yellow, and iridescent green plumageresides on islands from the Bay of Bengal and Malaysia through New Guinea. DNAanalysis suggests that it is the closest living relative of the Dodo (Raphus cucullatus).The cover image is adapted from part of a plate in The Royal Natural History, writtenby English naturalist Richard Lydekker in 1895. The cover font is Adobe ITC Garamond.The text font is Linotype Birka; the heading font is Adobe Myriad Condensed;and the code font is LucasFont's TheSansMonoCondensed.
The book is somewhat useful for a beginner. However the link claiming to point to examples, points to the book page with no such info. Examples have errors and options that don't exist are mentioned. Exercises have no answers, looks like the author was in a hurry to finish, If the author and editors were more careful, it could be a great book. It is of limited value as is.
Bottom Line No, I would not recommend this to a friend
Overall, this has been a helpful book for me in learning flex & bison.
As usual with O'Reilly, it's attractive and well-edited. There's a useful index and glossary section.
It expects you to be competent in C and makefiles, but does not assume significant experience with other tools. It covers the (tiny) differences needed to follow the examples on Windows, Linux, and OS X.
There are two significant challenges, however:
- there are several errors in the code, including a glaring error in the first serious example (the calculator). This error makes the example compile and run, but return incorrect results. It has been noted several times on the reported ("unconfirmed") errata page but, as this book has no author- or publisher-confirmed errata, it is not noted there. While a few typos are sadly to be expected in a technical work, it's troubling that such important and noticeable ones slipped through and annoying that no one has confirmed these errata.
- the book has very interesting exercises but provides no answers (or even hints or pointers) to them. If you are reading this with a flex or bison expert nearby, this is not a problem, but for self-learners, this could be very frustrating.
Bottom Line Yes, I would recommend this to a friend