Go to the first, previous, next, last section, table of contents.


Bison Declaration Summary

Here is a summary of all Bison declarations:

%union
Declare the collection of data types that semantic values may have (see section The Collection of Value Types).
%token
Declare a terminal symbol (token type name) with no precedence or associativity specified (see section Token Type Names).
%right
Declare a terminal symbol (token type name) that is right-associative (see section Operator Precedence).
%left
Declare a terminal symbol (token type name) that is left-associative (see section Operator Precedence).
%nonassoc
Declare a terminal symbol (token type name) that is nonassociative (using it in a way that would be associative is a syntax error) (see section Operator Precedence).
%type
Declare the type of semantic values for a nonterminal symbol (see section Nonterminal Symbols).
%start
Specify the grammar's start symbol (see section The Start-Symbol).
%expect
Declare the expected number of shift-reduce conflicts (see section Suppressing Conflict Warnings).
%pure_parser
Request a pure (reentrant) parser program (see section A Pure (Reentrant) Parser).
%no_lines
Don't generate any #line preprocessor commands in the parser file. Ordinarily Bison writes these commands in the parser file so that the C compiler and debuggers will associate errors and object code with your source file (the grammar file). This directive causes them to associate errors with the parser file, treating it an independent source file in its own right.
%raw
The output file `name.h' normally defines the tokens with Yacc-compatible token numbers. If this option is specified, the internal Bison numbers are used instead. (Yacc-compatible numbers start at 257 except for single character tokens; Bison assigns token numbers sequentially for all tokens starting at 3.)
%token_table
Generate an array of token names in the parser file. The name of the array is yytname; yytname[i] is the name of the token whose internal Bison token code number is i. The first three elements of yytname are always "$", "error", and "$illegal"; after these come the symbols defined in the grammar file. For single-character literal tokens and literal string tokens, the name in the table includes the single-quote or double-quote characters: for example, "'+'" is a single-character literal and "\"<=\"" is a literal string token. All the characters of the literal string token appear verbatim in the string found in the table; even double-quote characters are not escaped. For example, if the token consists of three characters `*"*', its string in yytname contains `"*"*"'. (In C, that would be written as "\"*\"*\""). When you specify %token_table, Bison also generates macro definitions for macros YYNTOKENS, YYNNTS, and YYNRULES, and YYNSTATES:
YYNTOKENS
The highest token number, plus one.
YYNNTS
The number of non-terminal symbols.
YYNRULES
The number of grammar rules,
YYNSTATES
The number of parser states (see section Parser States).


Go to the first, previous, next, last section, table of contents.