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.