www.delorie.com/gnu/docs/bison/bison_58.html   search  
Buy the book!

Bison 1.875

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.7 Bison Declarations

The Bison declarations section of a Bison grammar defines the symbols used in formulating the grammar and the data types of semantic values. See section 3.2 Symbols, Terminal and Nonterminal.

All token type names (but not single-character literal tokens such as '+' and '*') must be declared. Nonterminal symbols must be declared if you need to specify which data type to use for the semantic value (see section More Than One Value Type).

The first rule in the file also specifies the start symbol, by default. If you want some other symbol to be the start symbol, you must declare it explicitly (see section Languages and Context-Free Grammars).

3.7.1 Token Type Names  Declaring terminal symbols.
3.7.2 Operator Precedence  Declaring terminals with precedence and associativity.
3.7.3 The Collection of Value Types  Declaring the set of all semantic value types.
3.7.4 Nonterminal Symbols  Declaring the choice of type for a nonterminal symbol.
3.7.5 Freeing Discarded Symbols  Declaring how symbols are freed.
3.7.6 Suppressing Conflict Warnings  Suppressing warnings about shift/reduce conflicts.
3.7.7 The Start-Symbol  Specifying the start symbol.
3.7.8 A Pure (Reentrant) Parser  Requesting a reentrant parser.
3.7.9 Bison Declaration Summary  Table of all Bison declarations.

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003