lex & yacc

Front Cover
"O'Reilly Media, Inc.", Oct 1, 1992 - Computers - 388 pages

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
 

Contents

Chapter 1 Lex and Yacc
1
Chapter 2 Using Lex
25
Chapter 3 Using Yacc
47
Chapter 4 A Menu Generation Language
77
Chapter 5 Parsing SQL
105
Chapter 6 A Reference for Lex Specifications
143
Chapter 7 A Reference for Yacc Grammars
175
Chapter 8 Yacc Ambiguities and Conflicts
209
Appendix C Berkeley Yacc
261
Appendix D GNU Bison
267
Appendix E Flex
269
Appendix F MKS lex and yacc
279
Appendix G Abraxas lex and yacc
281
Appendix H POSIX lex and yacc
283
Appendix I MGL Compiler Code
285
Appendix J SQL Parser Code
299

Chapter 9 Error Reporting and Recovery
233
Appendix A ATT Lex
243
Appendix B ATT Yacc
251
Appendix K SQL Parser Code
323
Glossary
331
Copyright

Other editions - View all

Common terms and phrases

About the author (1992)

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.

Bibliographic information