Buying Options
flex & bison
Print $29.99
Add to Cart
Print+Ebook $32.99
Add to Cart
Ebook $23.99
Add to Cart
Safari Books Online
Add to Cart
What is this?
Print £22.99
Add to Cart
What is this?

Product Editions

  1. flex & bison - August 2009
  2. lex & yacc, Second Edition - October 1992
Description
Learn how to use flex and bison to process text data in Linux or Unix with the updated edition of this classic book. Whether you're interpreting code, configuration files, or any other structured format, flex & bison explains how these flexible utilities solve your problems quickly. 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.
Full Description
Table of Contents
  1. Chapter 1 Introducing Flex and Bison

    1. Lexical Analysis and Parsing

    2. Regular Expressions and Scanning

    3. Grammars and Parsing

    4. Ambiguous Grammars: Not Quite

    5. Adding a Few More Rules

    6. Flex and Bison vs. Handwritten Scanners and Parsers

    7. Exercises

  2. Chapter 2 Using Flex

    1. Regular Expressions

    2. File I/O in Flex Scanners

    3. Reading Several Files

    4. The I/O Structure of a Flex Scanner

    5. Start States and Nested Input Files

    6. Symbol Tables and a Concordance Generator

    7. C Language Cross-Reference

    8. Exercises

  3. Chapter 3 Using Bison

    1. How a Bison Parser Matches Its Input

    2. Shift/Reduce Parsing

    3. A Bison Parser

    4. Abstract Syntax Trees

    5. An Improved Calculator That Creates ASTs

    6. Shift/Reduce Conflicts and Operator Precedence

    7. An Advanced Calculator

    8. Using the Advanced Calculator

    9. Exercises

  4. Chapter 4 Parsing SQL

    1. A Quick Overview of SQL

    2. Manipulating Relations

    3. Three Ways to Use SQL

    4. SQL to RPN

    5. The Lexer

    6. The Parser

    7. The Makefile for the SQL Parser

    8. Exercises

  5. Chapter 5 A Reference for Flex Specifications

    1. Structure of a Flex Specification

    2. BEGIN

    3. C++ Scanners

    4. Context Sensitivity

    5. Definitions (Substitutions)

    6. ECHO

    7. Input Management

    8. Flex Library

    9. Interactive and Batch Scanners

    10. Line Numbers and yylineno

    11. Literal Block

    12. Multiple Lexers in One Program

    13. Options When Building a Scanner

    14. Portability of Flex Lexers

    15. Reentrant Scanners

    16. Regular Expression Syntax

    17. REJECT

    18. Returning Values from yylex()

    19. Start States

    20. unput()

    21. yyinput() yyunput()

    22. yyleng

    23. yyless()

    24. yylex() and YY_DECL

    25. yymore()

    26. yyrestart()

    27. yy_scan_string and yy_scan_buffer

    28. YY_USER_ACTION

    29. yywrap()

  6. Chapter 6 A Reference for Bison Specifications

    1. Structure of a Bison Grammar

    2. Actions

    3. Ambiguity and Conflicts

    4. Bugs in Bison Programs

    5. C++ Parsers

    6. %code Blocks

    7. End Marker

    8. Error Token and Error Recovery

    9. Inherited Attributes ($0)

    10. %initial-action

    11. Lexical Feedback

    12. Literal Block

    13. Literal Tokens

    14. Locations

    15. %parse-param

    16. Portability of Bison Parsers

    17. Precedence and Associativity Declarations

    18. Recursive Rules

    19. Rules

    20. Special Characters

    21. %start Declaration

    22. Symbol Values

    23. Tokens

    24. Variant and Multiple Grammars

    25. Multiple Parsers

    26. y.output Files

    27. Bison Library

    28. YYABORT

    29. YYACCEPT

    30. YYBACKUP

    31. yyclearin

    32. yydebug and YYDEBUG

    33. yyerrok

    34. YYERROR

    35. yyerror()

    36. yyparse()

    37. YYRECOVERING()

  7. Chapter 7 Ambiguities and Conflicts

    1. The Pointer Model and Conflicts

    2. Kinds of Conflicts

    3. Parser States

    4. Contents of name.output

    5. Reduce/Reduce Conflicts

    6. Shift/Reduce Conflicts

    7. Review of Conflicts in name.output

    8. Common Examples of Conflicts

    9. How Do You Fix the Conflict?

    10. Summary

    11. Exercises

  8. Chapter 8 Error Reporting and Recovery

    1. Error Reporting

    2. Locations

    3. Error Recovery

    4. Bison Error Recovery

    5. Compiler Error Recovery

    6. Exercises

  9. Chapter 9 Advanced Flex and Bison

    1. Pure Scanners and Parsers

    2. GLR Parsing

    3. C++ Parsers

    4. Exercises

  1. Appendix SQL Parser Grammar and Cross-Reference

  2. Glossary

  3. Colophon

View Full Table of Contents
Product Details
Title:
flex & bison
By:
John Levine
Publisher:
O'Reilly Media
Formats:
  • Print
  • Ebook
  • Safari Books Online
Print Release:
August 2009
Ebook Release:
August 2009
Pages:
304
Print ISBN:
978-0-596-15597-1
| ISBN 10:
0-596-15597-2
Ebook ISBN:
978-0-596-80638-5
| ISBN 10:
0-596-80638-8
Customer Reviews
About the Author
  1. John Levine

    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.

    View John Levine's full profile page.

Colophon

Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical 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 plumage resides on islands from the Bay of Bengal and Malaysia through New Guinea. DNA analysis 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, written by 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.

  • Book cover of flex & bison