Books & Videos

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