Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ Bison 1.25 - Table of Contents

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Bison 1.25 - Table of Contents

Bison

The YACC-compatible Parser Generator

November 1995, Bison Version 1.25

by Charles Donnelly and Richard Stallman


  • Introduction
  • Conditions for Using Bison
  • GNU GENERAL PUBLIC LICENSE
    • Preamble
    • TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    • How to Apply These Terms to Your New Programs
  • 2. The Concepts of Bison
    • 2.1 Languages and Context-Free Grammars
    • 2.2 From Formal Rules to Bison Input
    • 2.3 Semantic Values
    • 2.4 Semantic Actions
    • 2.5 Bison Output: the Parser File
    • 2.6 Stages in Using Bison
    • 2.7 The Overall Layout of a Bison Grammar
  • 3. Examples
    • 3.1 Reverse Polish Notation Calculator
      • 3.1.1 Declarations for rpcalc
      • 3.1.2 Grammar Rules for rpcalc
        • 3.1.2.1 Explanation of input
        • 3.1.2.2 Explanation of line
        • 3.1.2.3 Explanation of expr
      • 3.1.3 The rpcalc Lexical Analyzer
      • 3.1.4 The Controlling Function
      • 3.1.5 The Error Reporting Routine
      • 3.1.6 Running Bison to Make the Parser
      • 3.1.7 Compiling the Parser File
    • 3.2 Infix Notation Calculator: calc
    • 3.3 Simple Error Recovery
    • 3.4 Multi-Function Calculator: mfcalc
      • 3.4.1 Declarations for mfcalc
      • 3.4.2 Grammar Rules for mfcalc
      • 3.4.3 The mfcalc Symbol Table
    • 3.5 Exercises
  • 4. Bison Grammar Files
    • 4.1 Outline of a Bison Grammar
      • 4.1.1 The C Declarations Section
      • 4.1.2 The Bison Declarations Section
      • 4.1.3 The Grammar Rules Section
      • 4.1.4 The Additional C Code Section
    • 4.2 Symbols, Terminal and Nonterminal
    • 4.3 Syntax of Grammar Rules
    • 4.4 Recursive Rules
    • 4.5 Defining Language Semantics
      • 4.5.1 Data Types of Semantic Values
      • 4.5.2 More Than One Value Type
      • 4.5.3 Actions
      • 4.5.4 Data Types of Values in Actions
      • 4.5.5 Actions in Mid-Rule
    • 4.6 Bison Declarations
      • 4.6.1 Token Type Names
      • 4.6.2 Operator Precedence
      • 4.6.3 The Collection of Value Types
      • 4.6.4 Nonterminal Symbols
      • 4.6.5 Suppressing Conflict Warnings
      • 4.6.6 The Start-Symbol
      • 4.6.7 A Pure (Reentrant) Parser
      • 4.6.8 Bison Declaration Summary
    • 4.7 Multiple Parsers in the Same Program
  • 5. Parser C-Language Interface
    • 5.1 The Parser Function yyparse
    • 5.2 The Lexical Analyzer Function yylex
      • 5.2.1 Calling Convention for yylex
      • 5.2.2 Semantic Values of Tokens
      • 5.2.3 Textual Positions of Tokens
      • 5.2.4 Calling Conventions for Pure Parsers
    • 5.3 The Error Reporting Function yyerror
    • 5.4 Special Features for Use in Actions
  • 6. The Bison Parser Algorithm
    • 6.1 Look-Ahead Tokens
    • 6.2 Shift/Reduce Conflicts
    • 6.3 Operator Precedence
      • 6.3.1 When Precedence is Needed
      • 6.3.2 Specifying Operator Precedence
      • 6.3.3 Precedence Examples
      • 6.3.4 How Precedence Works
    • 6.4 Context-Dependent Precedence
    • 6.5 Parser States
    • 6.6 Reduce/Reduce Conflicts
    • 6.7 Mysterious Reduce/Reduce Conflicts
    • 6.8 Stack Overflow, and How to Avoid It
  • 7. Error Recovery
  • 8. Handling Context Dependencies
    • 8.1 Semantic Info in Token Types
    • 8.2 Lexical Tie-ins
    • 8.3 Lexical Tie-ins and Error Recovery
  • 9. Debugging Your Parser
  • 10. Invoking Bison
    • 10.1 Bison Options
    • 10.2 Option Cross Key
    • 10.3 Invoking Bison under VMS
  • A. Bison Symbols
  • B. Glossary
  • Index


This document was generated on 27 January 1999 using texi2html 1.55k.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026