In an action, the location of the left-hand side of the rule. See section Tracking Locations.
In an action, the location of the n-th symbol of the right-hand side of the rule. See section Tracking Locations.
In a grammar, the Bison-generated nonterminal symbol for a midrule action with a semantic value. See section Midrule Action Translation.
In an action, the location of a symbol addressed by name. See section Tracking Locations.
In a grammar, the Bison-generated nonterminal symbol for a midrule action with no semantics value. See section Midrule Action Translation.
In an action, the semantic value of the left-hand side of the rule. See section Actions.
In an action, the semantic value of the n-th symbol of the right-hand side of the rule. See section Actions.
In an action, the semantic value of a symbol addressed by name. See section Actions.
Delimiter used to separate the grammar rule section from the Bison declarations section or the epilogue. See section The Overall Layout of a Bison Grammar.
All code listed between ‘%{’ and ‘%}’ is copied verbatim to the parser implementation file. Such code forms the prologue of the grammar file. See section Outline of a Bison Grammar.
Predicate actions. This is a type of action clause that may appear in rules. The expression is evaluated, and if false, causes a syntax error. In GLR parsers during nondeterministic operation, this silently causes an alternative parse to die. During deterministic operation, it is the same as the effect of YYERROR. See section Controlling a Parse with Arbitrary Predicates.
Comments, as in C/C++.
Separates a rule’s result from its components. See section Grammar Rules.
Terminates a rule. See section Grammar Rules.
Separates alternate rules for the same result nonterminal. See section Grammar Rules.
Used to define a default tagged %destructor
or default tagged
%printer
.
See section Freeing Discarded Symbols.
Used to define a default tagless %destructor
or default tagless
%printer
.
See section Freeing Discarded Symbols.
The predefined nonterminal whose only rule is ‘$accept: start $end’, where start is the start symbol. See section The Start-Symbol. It cannot be used in the grammar.
Insert code verbatim into the output parser source at the default location or at the location specified by qualifier. See section %code Summary.
Equip the parser for debugging. See section Bison Declaration Summary.
Define a variable to adjust Bison’s behavior. See section %define Summary.
Bison declaration to create a parser header file, which is usually meant for the scanner. See section Bison Declaration Summary.
Same as above, but save in the file defines-file. See section Bison Declaration Summary.
Specify how the parser should reclaim the memory associated to discarded symbols. See section Freeing Discarded Symbols.
Bison declaration to assign a precedence to a rule that is used at parse time to resolve reduce/reduce conflicts. See section Writing GLR Parsers.
Bison declaration to declare make explicit that a rule has an empty right-hand side. See section Empty Rules.
The predefined token marking the end of the token stream. It cannot be used in the grammar.
A token name reserved for error recovery. This token may be used in
grammar rules so as to allow the Bison parser to recognize an error in
the grammar without halting the process. In effect, a sentence
containing an error may be recognized as valid. On a syntax error, the
token error
becomes the current lookahead token. Actions
corresponding to error
are then executed, and the lookahead
token is reset to the token that originally caused the violation.
See section Error Recovery.
An obsolete directive standing for ‘%define parse.error verbose’.
Bison declaration to set the prefix of the output files. See section Bison Declaration Summary.
Bison declaration to produce a GLR parser. See section Writing GLR Parsers.
Run user code before parsing. See section Performing Actions before Parsing.
Specify the programming language for the generated parser. See section Bison Declaration Summary.
Bison declaration to assign precedence and left associativity to token(s). See section Operator Precedence.
Bison declaration to specifying additional arguments that
yylex
should accept. See section Calling Conventions for Pure Parsers.
Bison declaration to assign a merging function to a rule. If there is a reduce/reduce conflict with a rule having the same merging function, the function is applied to the two semantic values to get a single result. See section Writing GLR Parsers.
Obsoleted by the %define
variable api.prefix
(see section Multiple Parsers in the Same Program).
Rename the external symbols (variables and functions) used in the parser so
that they start with prefix instead of ‘yy’. Contrary to
api.prefix
, do no rename types and macros.
The precise list of symbols renamed in C parsers is yyparse
,
yylex
, yyerror
, yynerrs
, yylval
, yychar
,
yydebug
, and (if locations are used) yylloc
. If you use a
push parser, yypush_parse
, yypull_parse
, yypstate
,
yypstate_new
and yypstate_delete
will also be renamed. For
example, if you use ‘%name-prefix "c_"’, the names become
c_parse
, c_lex
, and so on. For C++ parsers, see the
%define api.namespace
documentation in this section.
Bison declaration to avoid generating #line
directives in the
parser implementation file. See section Bison Declaration Summary.
Bison declaration to assign precedence and nonassociativity to token(s). See section Operator Precedence.
Bison declaration to declare nonterminals. See section Nonterminal Symbols.
Bison declaration to set the name of the parser implementation file. See section Bison Declaration Summary.
Bison declaration to specify additional arguments that both
yylex
and yyparse
should accept. See section The Parser Function yyparse
.
Bison declaration to specify additional arguments that yyparse
should accept. See section The Parser Function yyparse
.
Bison declaration to assign a precedence to a specific rule. See section Context-Dependent Precedence.
Bison declaration to assign precedence to token(s), but no associativity See section Operator Precedence.
Deprecated version of ‘%define api.pure’ (see section %define Summary), for which Bison is more careful to warn about unreasonable usage.
Require version version or higher of Bison. See section Require a Version of Bison.
Bison declaration to assign precedence and right associativity to token(s). See section Operator Precedence.
Specify the skeleton to use; usually for development. See section Bison Declaration Summary.
Bison declaration to specify the start symbol. See section The Start-Symbol.
Bison declaration to declare token(s) without specifying precedence. See section Token Kind Names.
Bison declaration to include a token name table in the parser implementation file. See section Bison Declaration Summary.
Bison declaration to declare symbol value types. See section Nonterminal Symbols.
The predefined token onto which all undefined values returned by
yylex
are mapped. It cannot be used in the grammar, rather, use
error
.
Bison declaration to specify several possible data types for semantic values. See section The Union Declaration.
Macro to pretend that an unrecoverable syntax error has occurred, by making
yyparse
return 1 immediately. The error reporting function
yyerror
is not called. See section The Parser Function yyparse
.
For Java parsers, this functionality is invoked using return YYABORT;
instead.
Macro to pretend that a complete utterance of the language has been
read, by making yyparse
return 0 immediately.
See section The Parser Function yyparse
.
For Java parsers, this functionality is invoked using return YYACCEPT;
instead.
Macro to discard a value from the parser stack and fake a lookahead token. See section Special Features for Use in Actions.
The version of Bison as an integer, for instance 30704 for version 3.7.4.
Defined in yacc.c only. Before version 3.7.4, YYBISON
was
defined to 1.
External integer variable that contains the integer value of the
lookahead token. (In a pure parser, it is a local variable within
yyparse
.) Error-recovery rule actions may examine this variable.
See section Special Features for Use in Actions.
Macro used in error-recovery rule actions. It clears the previous lookahead token. See section Error Recovery.
Macro to define to equip the parser with tracing code. See section Tracing Your Parser.
External integer variable set to zero by default. If yydebug
is given a nonzero value, the parser will output information on input
symbols and parser action. See section Tracing Your Parser.
The pseudo token kind when there is no lookahead token.
The token kind denoting is the end of the input stream.
Macro to cause parser to recover immediately to its normal mode after a syntax error. See section Error Recovery.
Cause an immediate syntax error. This statement initiates error
recovery just as if the parser itself had detected an error; however, it
does not call yyerror
, and does not print any message. If you
want to print an error message, call yyerror
explicitly before
the ‘YYERROR;’ statement. See section Error Recovery.
For Java parsers, this functionality is invoked using return YYERROR;
instead.
User-supplied function to be called by yyparse
on error.
See section The Error Reporting Function yyerror
.
Macro used to output run-time traces in C. See section Enabling Traces.
Macro for specifying the initial size of the parser stack. See section Memory Management, and How to Avoid Memory Exhaustion.
User-supplied lexical analyzer function, called with no arguments to get
the next token. See section The Lexical Analyzer Function yylex
.
External variable in which yylex
should place the line and column
numbers associated with a token. (In a pure parser, it is a local
variable within yyparse
, and its address is passed to
yylex
.)
You can ignore this variable if you don’t use the ‘@’ feature in the
grammar actions.
See section Textual Locations of Tokens.
In semantic actions, it stores the location of the lookahead token.
See section Actions and Locations.
Data type of yylloc
. By default in C, a structure with four members
(start/end line/column). See section Data Type of Locations.
External variable in which yylex
should place the semantic
value associated with a token. (In a pure parser, it is a local
variable within yyparse
, and its address is passed to
yylex
.)
See section Semantic Values of Tokens.
In semantic actions, it stores the semantic value of the lookahead token.
See section Actions.
Macro for specifying the maximum size of the parser stack. See section Memory Management, and How to Avoid Memory Exhaustion.
Global variable which Bison increments each time it reports a syntax error.
(In a pure parser, it is a local variable within yyparse
. In a
pure push parser, it is a member of yypstate
.)
See section The Error Reporting Function yyerror
.
The parser function produced by Bison; call this function to start
parsing. See section The Parser Function yyparse
.
Macro used to output token semantic values. For yacc.c only.
Deprecated, use %printer
instead (see section Printing Semantic Values).
See section The YYPRINT
Macro.
The function to delete a parser instance, produced by Bison in push mode;
call this function to delete the memory associated with a parser.
See yypstate_delete
. Does nothing when called
with a null pointer.
The function to create a parser instance, produced by Bison in push mode;
call this function to create a new parser.
See yypstate_new
.
The parser function produced by Bison in push mode; call this function to
parse the rest of the input stream.
See yypull_parse
.
The parser function produced by Bison in push mode; call this function to
parse a single token.
See yypush_parse
.
The expression YYRECOVERING ()
yields 1 when the parser
is recovering from a syntax error, and 0 otherwise.
See section Special Features for Use in Actions.
Macro used to control the use of alloca
when the
deterministic parser in C needs to extend its stacks. If defined to 0,
the parser will use malloc
to extend its stacks and memory exhaustion
occurs if malloc
fails (see section Memory Management, and How to Avoid Memory Exhaustion). If defined to
1, the parser will use alloca
. Values other than 0 and 1 are
reserved for future Bison extensions. If not defined,
YYSTACK_USE_ALLOCA
defaults to 0.
In the all-too-common case where your code may run on a host with a
limited stack and with unreliable stack-overflow checking, you should
set YYMAXDEPTH
to a value that cannot possibly result in
unchecked stack overflow on any of your target hosts when
alloca
is called. You can inspect the code that Bison
generates in order to determine the proper numeric values. This will
require some expertise in low-level implementation details.
Deprecated in favor of the %define
variable api.value.type
.
Data type of semantic values; int
by default.
See section Data Types of Semantic Values.
An enum of all the symbols, tokens and nonterminals, of the grammar.
See section The Syntax Error Reporting Function yyreport_syntax_error
. The symbol kinds are used
internally by the parser, and should not be confused with the token kinds:
the symbol kind of a terminal symbol is not equal to its token kind! (Unless
‘%define api.token.raw’ was used.)
An enum of all the token kinds declared with %token
(see section Token Kind Names). These are the return values for yylex
. They
should not be confused with the symbol kinds, used internally by the
parser.
The token kind denoting an unknown token.