Buy new:
-46% $16.23$16.23
Delivery Tuesday, October 15
Ships from: Amazon Sold by: Agarta USA
Save with Used - Good
$7.98$7.98
Delivery October 14 - 25
Ships from: Amazon Sold by: Pro Reads
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
lex & yacc Second Edition
Purchase options and add-ons
This book shows you how to use two Unix utilities, lex andyacc, in program development. These tools help programmers build compilers and interpreters, but they also have a wider range of applications.The second edition contains completely revised tutorial sections for novice users and reference sections for advanced users. This edition is twice the size of the first and has an expanded index.The following material has been added:
- Each utility is explained in a chapter that covers basic usage and simple, stand-alone applications
- How to implement a full SQL grammar, with full sample code
- Major MS-DOS and Unix versions of lex and yacc are explored in depth, including AT&T lex and yacc, Berkeley yacc, Berkeley/GNU Flex, GNU Bison, MKS lex andyacc, and Abraxas PCYACC
- ISBN-101565920007
- ISBN-13978-1565920002
- EditionSecond
- PublisherO'Reilly Media
- Publication dateOctober 11, 1992
- LanguageEnglish
- Dimensions6 x 0.95 x 9 inches
- Print length388 pages
Frequently bought together

Customers who bought this item also bought


The AWK Programming Language (Addison-Wesley Professional Computing Series)Alfred AhoPaperback$12.79 shipping
Standard C Library, ThePaperback$14.42 shippingGet it as soon as Monday, Oct 14Only 2 left in stock - order soon.
Editorial Reviews
From the Publisher
About the Author
Gregory Satir helps develop online publishing tools in the Portland, Oregon, office of Electronic Book Technologies. He graduated with a B.S. in computer science from Brown University. Doug Brown is a consultant/contractor in Beaverton, Oregon. He has been developing software for circuit simulation, synthesis, and testing since 1977. Doug coauthored lex & yacc, another O'Reilly & Associates Nutshell Handbook. He received an M.S. in electrical engineering from the University of Illinois at Urbana-Champaign in 1976.
John R. Levine writes, lectures, and consults on Unix and compiler topics. He moderates the online comp.compilers discussion group at Usenet. He worked on Unix versions Lotus 1-2-3 and the Norton Utilities and was one of the architects of AIX for the IBM RT PC. He received a Ph.D in computer science from Yale in 1984.
Tony Mason is currently a member of the AFS development team at Transarc Corporation, a small start-up company specializing in distributed systems software. Previously, he worked with the Distributed Systems Group at Stanford University in the area of distributed operating systems and data communications. He received a B.S. in mathematics from the University of Chicago in 1987.
Product details
- Publisher : O'Reilly Media; Second edition (October 11, 1992)
- Language : English
- Paperback : 388 pages
- ISBN-10 : 1565920007
- ISBN-13 : 978-1565920002
- Item Weight : 1.16 pounds
- Dimensions : 6 x 0.95 x 9 inches
- Best Sellers Rank: #1,692,983 in Books (See Top 100 in Books)
- #209 in Unix Operating System
- #345 in Computer Operating Systems (Books)
- #5,756 in Computer Software (Books)
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read book recommendations and more.
Products related to this item
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on Amazon-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
Lex and Yacc are commonly used together. Yacc uses a formal grammar to parse an input stream, something which lex cannot do using simple regular expressions since lex is limited to simple finite state automata. However, yacc cannot read from a simple input stream - it requires a series of tokens. Lex is often used to provide yacc with these tokens. As a result, building an application in lex and yacc is often used as an exercise in classes on programming languages and the theory of computation to demonstrate key concepts.
The book starts out building a simple character-driven calculator, and then moves on to build a menu generation language that produces C code that uses the standard "curses" library to draw menus on the screen. The final application is a SQL parser which includes a quick overview of both relational databases and SQL. Some readers will dislike the fact that Lex and Yacc are only capable of generating C code. Thus, the logical conclusion is that you must be able to write C code in order to use these tools. While it would be nice if the sections about the menu generation language and the SQL parser had some information about how to do typechecking and other such things, this book is not about writing a compiler/interpreter using Lex & Yacc. Rather it is just a beginner's guide.
The sections about shift/reduce and reduce/reduce conflicts are especially helpful, as are the sections going over the differences and caveats relating to the major versions of lex and yacc such as AT&T's Lex & YACC, GNU's Flex & Bison, and Berkeley's Yacc. In summary, if you've never used lex or yacc before and think they might be useful tools for you, and you already know the C programming language, this is a handy book to have.
something that is hard to get intorduced to. The book is not a
definitive guide, but a definitive guide has no starting point.
After reading this book, you should be able to construct some
simple scanners with lex/flex and parsers with yacc/bison, but
more importantly, you should be able to read more definitive
documentation.
Top reviews from other countries
Lex and yacc are powerful tools for software engineers, providing efficient ways for parsing source code (and lyric works, if you write any...)
On the other hand, versatility goes along with complexity. Doug Brown understands how to systematically dissect the field into consecutive steps, each accompanied by well chosen examples, leading the reader safely through the jungle of regular expressions, EBNF, symbol tables, grammars and tokens. This book is a good refresher for experienced software developers but a beginner should be aware that the study of the art of compiler construction is inevitable to fully deploy the massive amount of knowledge packed up in this book. Surely not a bedside reading, as you feel the urge to hack in the lines of the examples and see what they do. Considering the mature state of both tools I was not sure if this edition was a good choice - now I am glad to own it.
C'est un livre technique, connu pour son haut niveau, une sorte de
bible pour les specialistes, j'en avais besoin et ait été content de
le trouver chez amazon.

