-
Chapter 1 Introducing Flex and Bison
-
Lexical Analysis and Parsing
-
Regular Expressions and Scanning
-
Grammars and Parsing
-
Ambiguous Grammars: Not Quite
-
Adding a Few More Rules
-
Flex and Bison vs. Handwritten Scanners and Parsers
-
Exercises
-
-
Chapter 2 Using Flex
-
Regular Expressions
-
File I/O in Flex Scanners
-
Reading Several Files
-
The I/O Structure of a Flex Scanner
-
Start States and Nested Input Files
-
Symbol Tables and a Concordance Generator
-
C Language Cross-Reference
-
Exercises
-
-
Chapter 3 Using Bison
-
How a Bison Parser Matches Its Input
-
Shift/Reduce Parsing
-
A Bison Parser
-
Abstract Syntax Trees
-
An Improved Calculator That Creates ASTs
-
Shift/Reduce Conflicts and Operator Precedence
-
An Advanced Calculator
-
Using the Advanced Calculator
-
Exercises
-
-
Chapter 4 Parsing SQL
-
A Quick Overview of SQL
-
Manipulating Relations
-
Three Ways to Use SQL
-
SQL to RPN
-
The Lexer
-
The Parser
-
The Makefile for the SQL Parser
-
Exercises
-
-
Chapter 5 A Reference for Flex Specifications
-
Structure of a Flex Specification
-
BEGIN
-
C++ Scanners
-
Context Sensitivity
-
Definitions (Substitutions)
-
ECHO
-
Input Management
-
Flex Library
-
Interactive and Batch Scanners
-
Line Numbers and yylineno
-
Literal Block
-
Multiple Lexers in One Program
-
Options When Building a Scanner
-
Portability of Flex Lexers
-
Reentrant Scanners
-
Regular Expression Syntax
-
REJECT
-
Returning Values from yylex()
-
Start States
-
unput()
-
yyinput() yyunput()
-
yyleng
-
yyless()
-
yylex() and YY_DECL
-
yymore()
-
yyrestart()
-
yy_scan_string and yy_scan_buffer
-
YY_USER_ACTION
-
yywrap()
-
-
Chapter 6 A Reference for Bison Specifications
-
Structure of a Bison Grammar
-
Actions
-
Ambiguity and Conflicts
-
Bugs in Bison Programs
-
C++ Parsers
-
%code Blocks
-
End Marker
-
Error Token and Error Recovery
-
Inherited Attributes ($0)
-
%initial-action
-
Lexical Feedback
-
Literal Block
-
Literal Tokens
-
Locations
-
%parse-param
-
Portability of Bison Parsers
-
Precedence and Associativity Declarations
-
Recursive Rules
-
Rules
-
Special Characters
-
%start Declaration
-
Symbol Values
-
Tokens
-
Variant and Multiple Grammars
-
Multiple Parsers
-
y.output Files
-
Bison Library
-
YYABORT
-
YYACCEPT
-
YYBACKUP
-
yyclearin
-
yydebug and YYDEBUG
-
yyerrok
-
YYERROR
-
yyerror()
-
yyparse()
-
YYRECOVERING()
-
-
Chapter 7 Ambiguities and Conflicts
-
The Pointer Model and Conflicts
-
Kinds of Conflicts
-
Parser States
-
Contents of name.output
-
Reduce/Reduce Conflicts
-
Shift/Reduce Conflicts
-
Review of Conflicts in name.output
-
Common Examples of Conflicts
-
How Do You Fix the Conflict?
-
Summary
-
Exercises
-
-
Chapter 8 Error Reporting and Recovery
-
Error Reporting
-
Locations
-
Error Recovery
-
Bison Error Recovery
-
Compiler Error Recovery
-
Exercises
-
-
Chapter 9 Advanced Flex and Bison
-
Pure Scanners and Parsers
-
GLR Parsing
-
C++ Parsers
-
Exercises
-
-
Appendix SQL Parser Grammar and Cross-Reference
-
Glossary
-
Colophon
- Title:
- flex & bison
- By:
- John Levine
- Publisher:
- O'Reilly Media
- Formats:
-
- 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
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.
