Skip to Content
flex & bison
book

flex & bison

by John Levine
August 2009
Intermediate to advanced
292 pages
7h 31m
English
O'Reilly Media, Inc.
Content preview from flex & bison

Preface

Flex and bison are tools designed for writers of compilers and interpreters, although they are also useful for many applications that will interest noncompiler writers. Any application that looks for patterns in its input or has an input or command language is a good candidate for flex and bison. Furthermore, they allow for rapid application prototyping, easy modification, and simple maintenance of programs. To stimulate your imagination, here are a few things people have used flex and bison, or their predecessors lex and yacc, to develop:

  • The desktop calculator bc

  • The tools eqn and pic, typesetting preprocessors for mathematical equations and complex pictures

  • Many other “domain-specific languages” targeted for a particular application

  • PCC, the Portable C Compiler used with many Unix systems

  • Flex itself

  • A SQL database language translator

Scope of This Book

Chapter 1, Introducing Flex and Bison, gives an overview of how and why flex and bison are used to create compilers and interpreters and demonstrates some simple applications including a calculator built in flex and bison. It also introduces basic terms we use throughout the book.

Chapter 2, Using Flex, describes how to use flex. It develops flex applications that count words in files, handle multiple and nested input files, and compute statistics on C programs.

Chapter 3, Using Bison, gives a full example using flex and bison to develop a fully functional desktop calculator with variables, procedures, loops, and conditional expressions. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Rust in Action

Rust in Action

Tim McNamara
Learning React, 2nd Edition

Learning React, 2nd Edition

Alex Banks, Eve Porcello
Generative AI Design Patterns

Generative AI Design Patterns

Valliappa Lakshmanan, Hannes Hapke

Publisher Resources

ISBN: 9780596805418Errata Page