Rating:  Summary: Good book, but... Review: This is fairly complex subject. Consider the following: 1. Lex is quite useless. 2. Yacc is good but any bug is be VERY hard to fix and can potentialy destroy your project. 3. The book does not touch on some practical advice that can make or break a parser/lexer. 4. Unsuccesful error recovery can break your project. My recommendation: Don't invest ANY time on Lex & Yacc, learn to write a parser/lexer by hand and you WILL be better off.
Rating:  Summary: Outstanding Review: This was my first O'Reilly book, and one I've used ever since as a yardstick of what they're capable of producing. Faced with the daunting task of writing a compiler, I discovered this book and was amazed at the wealth and depth of information it contains. It could possibly do with a little extra theoretical background, but if you are looking at any sort of task involving lex and yacc or their derivatives, buy this excellent book.
Rating:  Summary: ok, but there is a better LEX/YACC book Review: To keep it simple, the book "Introduction to Compiler Construction in UNIX" introduces and explains LEX/YACC far better than this book. It uses a more realistic example and shows the error handling in more detail. This book is ok for a quick intro, but for a 'real" user, refer to the book I mentioned above.
Rating:  Summary: ok, but there is a better LEX/YACC book Review: To keep it simple, the book "Introduction to Compiler Construction in UNIX" introduces and explains LEX/YACC far better than this book. It uses a more realistic example and shows the error handling in more detail. This book is ok for a quick intro, but for a 'real" user, refer to the book I mentioned above.
Rating:  Summary: Good for what it is Review: WHAT IT IS: A sparse crash course, a jump start in Lex and Yacc for those who already know (1) front-end compiler technology, and (2) the C programming language. If you meet both these daunting prerequisites and can use a bit of sample code to get going, this is for you, but be advised that the Yacc example is only an interactive calculator, not a mini-language. Includes a reference section on Lex and Yacc, sections on Yacc ambiguities and error reporting, and a small glossary which is nice except that the definition of LALR(1) is slightly off (the LR in look-ahead LR means, "Left-to-right scanning of input, Rightmost derivation in reverse)." I found the Lex and Yacc command line options in the examples to be valuable information.
The Yacc information is more complete than any code samples I found on the web; those all required major surgery or additional pieces to get working. The only problem I had with *these* code samples was that the goofy version of Lex on my Slowlaris system gives an error if the first line of the translation rules section is a {substitution} --once I replaced that with the corresponding regular expression, it worked fine, and so did the rest of the code that I ran in chapters 2 and 3. You might have to do similar tweaking.
WHAT IT AIN'T: A primer on compilers or parsing (neither are some of the books purporting to be such, for that matter). There's no example of a mini programming language. And of course, it does not promise nor cover compiler back-end technology, like code generation.
WHAT IT COULD: I would like more examples --ideally, a mini-language compiler that reads source code from one file and puts output (say generated code quadruples) in another. And maybe a parser for some kind of output stream. Chapter 4 on a menu generation language and chapter 5 on a SQL parser are not needed today as far as I know --but I admit that's not very far. :-)
WHAT IT CAIN'T: I winced in sympathetic frustration as I read a scathing review screaming bloody murder that this book explains "NOTHING!!!" I know where that poor guy was at, and his frustration is understandable. This book is no substitute for a course on automata theory that covers regular expressions and context-free grammars, plus a *good* compiler course (those are hard to come by) that covers, say, chapters 3 and 4 of the "dragon book." The dragon on the cover of that book symbolizes the complexity of compiler design, correctly indicating that this is a recondite subject. If you are on your own and do not know the meaning of terms like "regular expression," "DFA," "CFG," "state diagram," and "LR," then you do not realize the odyssey you are embarking on, and this little book on Lex and Yacc won't save you. Many students of Computer Science (including yours truly) regard compilers as the hardest subject.
NOTE: Are there dudes out there without all that Comp Sci background who can write parsers? You bet! It can be done, and there are many other books on parser construction now.
Rating:  Summary: Yexx and lac Review: yeah cognac and lexuis' this is fnny. lexus is funny, COgnac rapper hip lexus. ZTHis is funnier than tight. Tight, lexus.
|