Skip to content
Paperback Lex & Yacc Book

ISBN: 1565920007

ISBN13: 9781565920002

Lex & Yacc

Select Format

Select Condition ThriftBooks Help Icon

Recommended

Format: Paperback

Condition: Very Good

$5.19
Save $24.76!
List Price $29.95
Almost Gone, Only 1 Left!

Book Overview

This book shows you how to use two Unix utilities, "lex" and"yacc, " in program development. These tools help programmers build compilers and interpreters, but they also have a wider range of... This description may be from another edition of this product.

Customer Reviews

5 ratings

Very good guide to an old but useful programming tool

Yacc (yet another compiler compiler) and its companion lex (lexical analyzer) are primarily intended to allow quick and easy development of small special-purpose languages. The common mistake is assuming that they are only useful for creating compilers for massively complex eccentric languages. This is not the case, though you could no doubt use them for such a purpose. 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.

A very nice intro

About the previous review: if the book is "OK", why two stars? Nevertheless, the poster is correct in that the book by Alex Schreiner, Introduction to Compiler Construction With Unix, is very good, and much more detailed and practical than Lex and Yacc by Levine. Which doesn't make the latter a bad book: I think it's the best book to read first; it's simple, friendly, and -- as far as it goes -- very enlightening.

Still the best lex/yacc intorduction out there!

Like many O'Reilly books, this is really just an introduction tosomething that is hard to get intorduced to. The book is not adefinitive guide, but a definitive guide has no starting point.After reading this book, you should be able to construct somesimple scanners with lex/flex and parsers with yacc/bison, butmore importantly, you should be able to read more definitivedocumentation.

You will succeed

This book will get you writing language compilers in Lex and Yacc. It is clearly written, to the point, and has a wealth of useful information.It should be supplemented with a more theoretical work, like Aho, Sethi and Ullman's book on compilers.

A real page-turner. I couldn't put it down!

As someone who has written a number of programming language translators and who has read a number of books on compiler generation, I found that this book is very readable and gives the best introduction to compiler compilers I've ever seen.
Copyright © 2023 Thriftbooks.com Terms of Use | Privacy Policy | Do Not Sell/Share My Personal Information | Cookie Policy | Cookie Preferences | Accessibility Statement
ThriftBooks® and the ThriftBooks® logo are registered trademarks of Thrift Books Global, LLC
GoDaddy Verified and Secured