[ < ] | [ > ] | [ << ] | [ 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 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 Require a Version of Bison | Requiring a Bison version. | |
3.7.2 Token Type Names | Declaring terminal symbols. | |
3.7.3 Operator Precedence | Declaring terminals with precedence and associativity. | |
3.7.4 The Collection of Value Types | Declaring the set of all semantic value types. | |
3.7.5 Nonterminal Symbols | Declaring the choice of type for a nonterminal symbol. | |
3.7.6 Performing Actions before Parsing | Code run before parsing starts. | |
3.7.7 Freeing Discarded Symbols | Declaring how symbols are freed. | |
3.7.8 Suppressing Conflict Warnings | Suppressing warnings about parsing conflicts. | |
3.7.9 The Start-Symbol | Specifying the start symbol. | |
3.7.10 A Pure (Reentrant) Parser | Requesting a reentrant parser. | |
3.7.11 A Push Parser | Requesting a push parser. | |
3.7.12 Bison Declaration Summary | Table of all Bison declarations. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |