* Precedence Decl:: Declaring terminals with precedence and associativity.
* Union Decl:: Declaring the set of all semantic value types.
* Type Decl:: Declaring the choice of type for a nonterminal symbol.
+* Destructor Decl:: Declaring how symbols are freed.
* Expect Decl:: Suppressing warnings about shift/reduce conflicts.
* Start Decl:: Specifying the start symbol.
* Pure Decl:: Requesting a reentrant parser.
* Bison Options:: All the options described in detail,
in alphabetical order by short options.
* Option Cross Key:: Alphabetical list of long options.
-* VMS Invocation:: Bison command syntax on @acronym{VMS}.
Frequently Asked Questions
user-defined function on the resulting values to produce an arbitrary
merged result.
-Let's consider an example, vastly simplified from C++.
+Let's consider an example, vastly simplified from a C++ grammar.
@example
%@{
| decl %dprec 2
;
-expr : ID @{ printf ("%s ", $$); @}
+expr : ID @{ printf ("%s ", $$); @}
| TYPENAME '(' expr ')'
- @{ printf ("%s <cast> ", $1); @}
- | expr '+' expr @{ printf ("+ "); @}
- | expr '=' expr @{ printf ("= "); @}
+ @{ printf ("%s <cast> ", $1); @}
+ | expr '+' expr @{ printf ("+ "); @}
+ | expr '=' expr @{ printf ("= "); @}
;
decl : TYPENAME declarator ';'
- @{ printf ("%s <declare> ", $1); @}
+ @{ printf ("%s <declare> ", $1); @}
| TYPENAME declarator '=' expr ';'
- @{ printf ("%s <init-declare> ", $1); @}
+ @{ printf ("%s <init-declare> ", $1); @}
;
-declarator : ID @{ printf ("\"%s\" ", $1); @}
+declarator : ID @{ printf ("\"%s\" ", $1); @}
| '(' declarator ')'
;
@end example
#include <stdio.h>
void
-yyerror (const char *s) /* called by yyparse on error */
+yyerror (const char *s) /* Called by yyparse on error. */
@{
printf ("%s\n", s);
@}
%right '^' /* Exponentiation */
/* Grammar follows */
-
%%
@end smallexample
@group
/* Function type. */
typedef double (*func_t) (double);
+@end group
+@group
/* Data type for links in the chain of symbols. */
struct symrec
@{
@group
void
-yyerror (const char *s) /* Called by yyparse on error */
+yyerror (const char *s) /* Called by yyparse on error. */
@{
printf ("%s\n", s);
@}
@end example
Comments enclosed in @samp{/* @dots{} */} may appear in any of the sections.
+As a @acronym{GNU} extension, @samp{//} introduces a comment that
+continues until end of line.
@menu
* Prologue:: Syntax and usage of the prologue.
used in Bison as well, but you must not use the null character as a
character literal because its numeric code, zero, signifies
end-of-input (@pxref{Calling Convention, ,Calling Convention
-for @code{yylex}}).
+for @code{yylex}}). Also, unlike standard C, trigraphs have no
+special meaning in Bison character literals, nor is backslash-newline
+allowed.
@item
@cindex string token
read your program will be confused.
All the escape sequences used in string literals in C can be used in
-Bison as well. A literal string token must contain two or more
-characters; for a token containing just one character, use a character
-token (see above).
+Bison as well. However, unlike Standard C, trigraphs have no special
+meaning in Bison string literals, nor is backslash-newline allowed. A
+literal string token must contain two or more characters; for a token
+containing just one character, use a character token (see above).
@end itemize
How you choose to write a terminal symbol has no effect on its
semantic values associated with tokens or smaller groupings.
An action consists of C statements surrounded by braces, much like a
-compound statement in C@. It can be placed at any position in the rule;
+compound statement in C@. An action can contain any sequence of C
+statements. Bison does not look for trigraphs, though, so if your C
+code uses trigraphs you should ensure that they do not affect the
+nesting of braces or the boundaries of comments, strings, or character
+literals.
+
+An action can be placed at any position in the rule;
it is executed at that position. Most rules have just one action at the
end of the rule, following all the components. Actions in the middle of
a rule are tricky and used only for special purposes (@pxref{Mid-Rule
@cindex default action
If you don't specify an action for a rule, Bison supplies a default:
-@w{@code{$$ = $1}.} Thus, the value of the first symbol in the rule becomes
-the value of the whole rule. Of course, the default rule is valid only
-if the two data types match. There is no meaningful default action for
-an empty rule; every empty rule must have an explicit action unless the
-rule's value does not matter.
+@w{@code{$$ = $1}.} Thus, the value of the first symbol in the rule
+becomes the value of the whole rule. Of course, the default action is
+valid only if the two data types match. There is no meaningful default
+action for an empty rule; every empty rule must have an explicit action
+unless the rule's value does not matter.
@code{$@var{n}} with @var{n} zero or negative is allowed for reference
to tokens and groupings on the stack @emph{before} those that match the
* Precedence Decl:: Declaring terminals with precedence and associativity.
* Union Decl:: Declaring the set of all semantic value types.
* Type Decl:: Declaring the choice of type for a nonterminal symbol.
+* Destructor Decl:: Declaring how symbols are freed.
* Expect Decl:: Suppressing warnings about shift/reduce conflicts.
* Start Decl:: Specifying the start symbol.
* Pure Decl:: Requesting a reentrant parser.
terminal symbol. All kinds of token declarations allow
@code{<@var{type}>}.
+@node Destructor Decl
+@subsection Freeing Discarded Symbols
+@cindex freeing discarded symbols
+@findex %destructor
+
+Some symbols can be discarded by the parser, typically during error
+recovery (@pxref{Error Recovery}). Basically, during error recovery,
+embarrassing symbols already pushed on the stack, and embarrassing
+tokens coming from the rest of the file are thrown away until the parser
+falls on its feet. If these symbols convey heap based information, this
+memory is lost. While this behavior is tolerable for batch parsers,
+such as in compilers, it is unacceptable for parsers that can
+possibility ``never end'' such as shells, or implementations of
+communication protocols.
+
+The @code{%destructor} directive allows for the definition of code that
+is called when a symbol is thrown away.
+
+@deffn {Directive} %destructor @{ @var{code} @} @var{symbols}
+@findex %destructor
+Declare that the @var{code} must be invoked for each of the
+@var{symbols} that will be discarded by the parser. The @var{code}
+should use @code{$$} to designate the semantic value associated to the
+@var{symbols}. The additional parser parameters are also avaible
+(@pxref{Parser Function, , The Parser Function @code{yyparse}}).
+
+@strong{Warning:} as of Bison 1.875, this feature is still considered as
+experimental, as there was not enough users feedback. In particular,
+the syntax might still change.
+@end deffn
+
+For instance:
+
+@smallexample
+%union
+@{
+ char *string;
+@}
+%token <string> STRING
+%type <string> string
+%destructor @{ free ($$); @} STRING string
+@end smallexample
+
+@noindent
+guarantees that when a @code{STRING} or a @code{string} will be discarded,
+its associated memory will be freed.
+
+Note that in the future, Bison might also consider that right hand side
+members that are not mentioned in the action can be destroyed. For
+instance, in:
+
+@smallexample
+comment: "/*" STRING "*/";
+@end smallexample
+
+@noindent
+the parser is entitled to destroy the semantic value of the
+@code{string}. Of course, this will not apply to the default action;
+compare:
+
+@smallexample
+typeless: string; // $$ = $1 does not apply; $1 is destroyed.
+typefull: string; // $$ = $1 applies, $1 is not destroyed.
+@end smallexample
+
@node Expect Decl
@subsection Suppressing Conflict Warnings
@cindex suppressing conflict warnings
be able to refer to token type codes and the variable
@code{yylval}. @xref{Token Values, ,Semantic Values of Tokens}.
+@item %destructor
+Specifying how the parser should reclaim the memory associated to
+discarded symbols. @xref{Destructor Decl, , Freeing Discarded Symbols}.
+
@item %file-prefix="@var{prefix}"
Specify a prefix to use for all Bison output file names. The names are
chosen as if the input file were named @file{@var{prefix}.y}.
Rename the external symbols used in the parser so that they start with
@var{prefix} instead of @samp{yy}. The precise list of symbols renamed
is @code{yyparse}, @code{yylex}, @code{yyerror}, @code{yynerrs},
-@code{yylval}, @code{yychar}, @code{yydebug}, and possible
-@code{yylloc}. For example, if you use @samp{%name-prefix="c_"}, the
-names become @code{c_parse}, @code{c_lex}, and so on. @xref{Multiple
-Parsers, ,Multiple Parsers in the Same Program}.
+@code{yylval}, @code{yylloc}, @code{yychar}, @code{yydebug}, and
+possible @code{yylloc}. For example, if you use
+@samp{%name-prefix="c_"}, the names become @code{c_parse}, @code{c_lex},
+and so on. @xref{Multiple Parsers, ,Multiple Parsers in the Same
+Program}.
@item %no-parser
Do not include any C code in the parser file; generate tables only. The
that state. @xref{Understanding, , Understanding Your Parser}, for more
information.
-
-
@item %yacc
Pretend the option @option{--yacc} was given, i.e., imitate Yacc,
including its naming conventions. @xref{Bison Options}, for more.
names that do not conflict.
The precise list of symbols renamed is @code{yyparse}, @code{yylex},
-@code{yyerror}, @code{yynerrs}, @code{yylval}, @code{yychar} and
-@code{yydebug}. For example, if you use @samp{-p c}, the names become
-@code{cparse}, @code{clex}, and so on.
+@code{yyerror}, @code{yynerrs}, @code{yylval}, @code{yylloc},
+@code{yychar} and @code{yydebug}. For example, if you use @samp{-p c},
+the names become @code{cparse}, @code{clex}, and so on.
@strong{All the other variables and macros associated with Bison are not
renamed.} These others are not global; there is no conflict if the same
write an action which directs @code{yyparse} to return immediately
without reading further.
+
+@deftypefun int yyparse (void)
The value returned by @code{yyparse} is 0 if parsing was successful (return
is due to end-of-input).
The value is 1 if parsing failed (return is due to a syntax error).
+@end deftypefun
In an action, you can cause immediate return from @code{yyparse} by using
these macros:
-@table @code
-@item YYACCEPT
+@defmac YYACCEPT
@findex YYACCEPT
Return immediately with value 0 (to report success).
+@end defmac
-@item YYABORT
+@defmac YYABORT
@findex YYABORT
Return immediately with value 1 (to report failure).
-@end table
+@end defmac
+
+If you use a reentrant parser, you can optionally pass additional
+parameter information to it in a reentrant way. To do so, use the
+declaration @code{%parse-param}:
+
+@deffn {Directive} %parse-param @var{argument-declaration} @var{argument-name}
+@findex %parse-param
+Declare that @code{argument-name} is an additional @code{yyparse}
+argument. This argument is also passed to @code{yyerror}. The
+@var{argument-declaration} is used when declaring functions or
+prototypes.
+@end deffn
+
+Here's an example. Write this in the parser:
+
+@example
+%parse-param "int *nastiness" "nastiness"
+%parse-param "int *randomness" "randomness"
+@end example
+
+@noindent
+Then call the parser like this:
+
+@example
+@{
+ int nastiness, randomness;
+ @dots{} /* @r{Store proper data in @code{nastiness} and @code{randomness}.} */
+ value = yyparse (&nastiness, &randomness);
+ @dots{}
+@}
+@end example
+
+@noindent
+In the grammar actions, use expressions like this to refer to the data:
+
+@example
+exp: @dots{} @{ @dots{}; *randomness += 1; @dots{} @}
+@end example
+
@node Lexical
@section The Lexical Analyzer Function @code{yylex}
this case, omit the second argument; @code{yylex} will be called with
only one argument.
-@vindex YYPARSE_PARAM
-If you use a reentrant parser, you can optionally pass additional
-parameter information to it in a reentrant way. To do so, define the
-macro @code{YYPARSE_PARAM} as a variable name. This modifies the
-@code{yyparse} function to accept one argument, of type @code{void *},
-with that name.
-
-When you call @code{yyparse}, pass the address of an object, casting the
-address to @code{void *}. The grammar actions can refer to the contents
-of the object by casting the pointer value back to its proper type and
-then dereferencing it. Here's an example. Write this in the parser:
-@example
-%@{
-struct parser_control
-@{
- int nastiness;
- int randomness;
-@};
+If you wish to pass the additional parameter data to @code{yylex}, use
+@code{%lex-param} just like @code{%parse-param} (@pxref{Parser
+Function}).
-#define YYPARSE_PARAM parm
-%@}
-@end example
+@deffn {Directive} lex-param @var{argument-declaration} @var{argument-name}
+@findex %lex-param
+Declare that @code{argument-name} is an additional @code{yylex}
+argument.
+@end deffn
-@noindent
-Then call the parser like this:
+For instance:
@example
-struct parser_control
-@{
- int nastiness;
- int randomness;
-@};
-
-@dots{}
-
-@{
- struct parser_control foo;
- @dots{} /* @r{Store proper data in @code{foo}.} */
- value = yyparse ((void *) &foo);
- @dots{}
-@}
+%parse-param "int *nastiness" "nastiness"
+%lex-param "int *nastiness" "nastiness"
+%parse-param "int *randomness" "randomness"
@end example
@noindent
-In the grammar actions, use expressions like this to refer to the data:
+results in the following signature:
@example
-((struct parser_control *) parm)->randomness
+int yylex (int *nastiness);
+int yyparse (int *nastiness, int *randomness);
@end example
-@vindex YYLEX_PARAM
-If you wish to pass the additional parameter data to @code{yylex},
-define the macro @code{YYLEX_PARAM} just like @code{YYPARSE_PARAM}, as
-shown here:
+If @code{%pure-parser} is added:
@example
-%@{
-struct parser_control
-@{
- int nastiness;
- int randomness;
-@};
-
-#define YYPARSE_PARAM parm
-#define YYLEX_PARAM parm
-%@}
+int yylex (YYSTYPE *lvalp, int *nastiness);
+int yyparse (int *nastiness, int *randomness);
@end example
-You should then define @code{yylex} to accept one additional
-argument---the value of @code{parm}. (This makes either two or three
-arguments in total, depending on whether an argument of type
-@code{YYLTYPE} is passed.) You can declare the argument as a pointer to
-the proper object type, or you can declare it as @code{void *} and
-access the contents as shown above.
+@noindent
+and finally, if both @code{%pure-parser} and @code{%locations} are used:
-You can use @samp{%pure-parser} to request a reentrant parser without
-also using @code{YYPARSE_PARAM}. Then you should call @code{yyparse}
-with no arguments, as usual.
+@example
+int yylex (YYSTYPE *lvalp, YYLTYPE *llocp, int *nastiness);
+int yyparse (int *nastiness, int *randomness);
+@end example
@node Error Reporting
@section The Error Reporting Function @code{yyerror}
receives one argument. For a parse error, the string is normally
@w{@code{"parse error"}}.
-@findex YYERROR_VERBOSE
-If you define the macro @code{YYERROR_VERBOSE} in the Bison declarations
-section (@pxref{Bison Declarations, ,The Bison Declarations Section}),
-then Bison provides a more verbose and specific error message string
-instead of just plain @w{@code{"parse error"}}. It doesn't matter what
-definition you use for @code{YYERROR_VERBOSE}, just whether you define
-it.
+@findex %error-verbose
+If you invoke the directive @code{%error-verbose} in the Bison
+declarations section (@pxref{Bison Declarations, ,The Bison Declarations
+Section}), then Bison provides a more verbose and specific error message
+string instead of just plain @w{@code{"parse error"}}.
The parser can detect one other kind of error: stack overflow. This
happens when the input contains constructions that are very deeply
@example
@group
void
-yyerror (char *s)
+yyerror (const char *s)
@{
@end group
@group
(@pxref{Error Recovery}). If recovery is impossible, @code{yyparse} will
immediately return 1.
+Obviously, in location tracking pure parsers, @code{yyerror} should have
+an access to the current location. This is indeed the case for the GLR
+parsers, but not for the Yacc parser, for historical reasons. I.e., if
+@samp{%locations %pure-parser} is passed then the prototypes for
+@code{yyerror} are:
+
+@example
+void yyerror (const char *msg); /* Yacc parsers. */
+void yyerror (YYLTYPE *locp, const char *msg); /* GLR parsers. */
+@end example
+
+If @samp{%parse-param "int *nastiness" "nastiness"} is used, then:
+
+@example
+void yyerror (int *randomness, const char *msg); /* Yacc parsers. */
+void yyerror (int *randomness, const char *msg); /* GLR parsers. */
+@end example
+
+Finally, GLR and Yacc parsers share the same @code{yyerror} calling
+convention for absolutely pure parsers, i.e., when the calling
+convention of @code{yylex} @emph{and} the calling convention of
+@code{%pure-parser} are pure. I.e.:
+
+@example
+/* Location tracking. */
+%locations
+/* Pure yylex. */
+%pure-parser
+%lex-param "int *nastiness" "nastiness"
+/* Pure yyparse. */
+%parse-param "int *nastiness" "nastiness"
+%parse-param "int *randomness" "randomness"
+@end example
+
+@noindent
+results in the following signatures for all the parser kinds:
+
+@example
+int yylex (YYSTYPE *lvalp, YYLTYPE *llocp, int *nastiness);
+int yyparse (int *nastiness, int *randomness);
+void yyerror (YYLTYPE *locp,
+ int *nastiness, int *randomness,
+ const char *msg);
+@end example
+
+@noindent
+Please, note that the prototypes are only indications of how the code
+produced by Bison will use @code{yyerror}; you still have freedom on the
+exit value, and even on making @code{yyerror} a variadic function. It
+is precisely to enable this that the message is always passed last.
+
@vindex yynerrs
The variable @code{yynerrs} contains the number of syntax errors
encountered so far. Normally this variable is global; but if you
applicable in the ordinary way.
But Bison can force the situation to fit the rule, by discarding part of
-the semantic context and part of the input. First it discards states and
-objects from the stack until it gets back to a state in which the
+the semantic context and part of the input. First it discards states
+and objects from the stack until it gets back to a state in which the
@code{error} token is acceptable. (This means that the subexpressions
-already parsed are discarded, back to the last complete @code{stmnts}.) At
-this point the @code{error} token can be shifted. Then, if the old
+already parsed are discarded, back to the last complete @code{stmnts}.)
+At this point the @code{error} token can be shifted. Then, if the old
look-ahead token is not acceptable to be shifted next, the parser reads
tokens and discards them until it finds a token which is acceptable. In
-this example, Bison reads and discards input until the next newline
-so that the fourth rule can apply.
+this example, Bison reads and discards input until the next newline so
+that the fourth rule can apply. Note that discarded symbols are
+possible sources of memory leaks, see @ref{Destructor Decl, , Freeing
+Discarded Symbols}, for a means to reclaim this memory.
The choice of error rules in the grammar is a choice of strategies for
error recovery. A simple and useful strategy is simply to skip the rest of
$accept -> . exp $ (rule 0)
- NUM shift, and go to state 1
+ NUM shift, and go to state 1
- exp go to state 2
+ exp go to state 2
@end example
This reads as follows: ``state 0 corresponds to being at the very
exp -> NUM . (rule 5)
- $default reduce using rule 5 (exp)
+ $default reduce using rule 5 (exp)
@end example
@noindent
exp -> exp . '*' exp (rule 3)
exp -> exp . '/' exp (rule 4)
- $ shift, and go to state 3
- '+' shift, and go to state 4
- '-' shift, and go to state 5
- '*' shift, and go to state 6
- '/' shift, and go to state 7
+ $ shift, and go to state 3
+ '+' shift, and go to state 4
+ '-' shift, and go to state 5
+ '*' shift, and go to state 6
+ '/' shift, and go to state 7
@end example
@noindent
$accept -> exp $ . (rule 0)
- $default accept
+ $default accept
@end example
@noindent
exp -> exp '+' . exp (rule 1)
- NUM shift, and go to state 1
+ NUM shift, and go to state 1
- exp go to state 8
+ exp go to state 8
state 5
exp -> exp '-' . exp (rule 2)
- NUM shift, and go to state 1
+ NUM shift, and go to state 1
- exp go to state 9
+ exp go to state 9
state 6
exp -> exp '*' . exp (rule 3)
- NUM shift, and go to state 1
+ NUM shift, and go to state 1
- exp go to state 10
+ exp go to state 10
state 7
exp -> exp '/' . exp (rule 4)
- NUM shift, and go to state 1
+ NUM shift, and go to state 1
- exp go to state 11
+ exp go to state 11
@end example
As was announced in beginning of the report, @samp{State 8 contains 1
exp -> exp . '*' exp (rule 3)
exp -> exp . '/' exp (rule 4)
- '*' shift, and go to state 6
- '/' shift, and go to state 7
+ '*' shift, and go to state 6
+ '/' shift, and go to state 7
- '/' [reduce using rule 1 (exp)]
- $default reduce using rule 1 (exp)
+ '/' [reduce using rule 1 (exp)]
+ $default reduce using rule 1 (exp)
@end example
Indeed, there are two actions associated to the lookahead @samp{/}:
exp -> exp . '*' exp (rule 3)
exp -> exp . '/' exp (rule 4)
- '*' shift, and go to state 6
- '/' shift, and go to state 7
+ '*' shift, and go to state 6
+ '/' shift, and go to state 7
- '/' [reduce using rule 2 (exp)]
- $default reduce using rule 2 (exp)
+ '/' [reduce using rule 2 (exp)]
+ $default reduce using rule 2 (exp)
state 10
exp -> exp '*' exp . (rule 3)
exp -> exp . '/' exp (rule 4)
- '/' shift, and go to state 7
+ '/' shift, and go to state 7
- '/' [reduce using rule 3 (exp)]
- $default reduce using rule 3 (exp)
+ '/' [reduce using rule 3 (exp)]
+ $default reduce using rule 3 (exp)
state 11
exp -> exp . '/' exp (rule 4)
exp -> exp '/' exp . (rule 4)
- '+' shift, and go to state 4
- '-' shift, and go to state 5
- '*' shift, and go to state 6
- '/' shift, and go to state 7
+ '+' shift, and go to state 4
+ '-' shift, and go to state 5
+ '*' shift, and go to state 6
+ '/' shift, and go to state 7
- '+' [reduce using rule 4 (exp)]
- '-' [reduce using rule 4 (exp)]
- '*' [reduce using rule 4 (exp)]
- '/' [reduce using rule 4 (exp)]
- $default reduce using rule 4 (exp)
+ '+' [reduce using rule 4 (exp)]
+ '-' [reduce using rule 4 (exp)]
+ '*' [reduce using rule 4 (exp)]
+ '/' [reduce using rule 4 (exp)]
+ $default reduce using rule 4 (exp)
@end example
@noindent
* Bison Options:: All the options described in detail,
in alphabetical order by short options.
* Option Cross Key:: Alphabetical list of long options.
-* VMS Invocation:: Bison command syntax on @acronym{VMS}.
@end menu
@node Bison Options
@end example
@end ifinfo
-@node VMS Invocation
-@section Invoking Bison under @acronym{VMS}
-@cindex invoking Bison under @acronym{VMS}
-@cindex @acronym{VMS}
-
-The command line syntax for Bison on @acronym{VMS} is a variant of the usual
-Bison command syntax---adapted to fit @acronym{VMS} conventions.
-
-To find the @acronym{VMS} equivalent for any Bison option, start with the long
-option, and substitute a @samp{/} for the leading @samp{--}, and
-substitute a @samp{_} for each @samp{-} in the name of the long option.
-For example, the following invocation under @acronym{VMS}:
-
-@example
-bison /debug/name_prefix=bar foo.y
-@end example
-
-@noindent
-is equivalent to the following command under @acronym{POSIX}.
-
-@example
-bison --debug --name-prefix=bar foo.y
-@end example
-
-The @acronym{VMS} file system does not permit filenames such as
-@file{foo.tab.c}. In the above example, the output file
-would instead be named @file{foo_tab.c}.
-
@c ================================================= Invoking Bison
@node FAQ
@code{yyparse} return 1. @xref{Error Recovery}.
@item YYERROR_VERBOSE
-Macro that you define with @code{#define} in the Bison declarations
-section to request verbose, specific error message strings when
-@code{yyerror} is called.
+An obsolete macro that you define with @code{#define} in the Bison
+declarations section to request verbose, specific error message strings
+when @code{yyerror} is called. It doesn't matter what definition you
+use for @code{YYERROR_VERBOSE}, just whether you define it. Using
+@code{%error-verbose} is preferred.
@item YYINITDEPTH
Macro for specifying the initial size of the parser stack.
@xref{Stack Overflow}.
@item YYLEX_PARAM
-Macro for specifying an extra argument (or list of extra arguments) for
-@code{yyparse} to pass to @code{yylex}. @xref{Pure Calling,, Calling
-Conventions for Pure Parsers}.
+An obsolete macro for specifying an extra argument (or list of extra
+arguments) for @code{yyparse} to pass to @code{yylex}. he use of this
+macro is deprecated, and is supported only for Yacc like parsers.
+@xref{Pure Calling,, Calling Conventions for Pure Parsers}.
@item YYLTYPE
Macro for the data type of @code{yylloc}; a structure with four
@xref{Stack Overflow}.
@item YYPARSE_PARAM
-Macro for specifying the name of a parameter that @code{yyparse} should
-accept. @xref{Pure Calling,, Calling Conventions for Pure Parsers}.
+An obsolete macro for specifying the name of a parameter that
+@code{yyparse} should accept. The use of this macro is deprecated, and
+is supported only for Yacc like parsers. @xref{Pure Calling,, Calling
+Conventions for Pure Parsers}.
@item YYRECOVERING
Macro whose value indicates whether the parser is recovering from a
Bison declaration to create a header file meant for the scanner.
@xref{Decl Summary}.
+@item %destructor
+Specifying how the parser should reclaim the memory associated to
+discarded symbols. @xref{Destructor Decl, , Freeing Discarded Symbols}.
+
@item %dprec
Bison declaration to assign a precedence to a rule that is used at parse
time to resolve reduce/reduce conflicts. @xref{GLR Parsers, ,Writing
@acronym{GLR} Parsers}.
+@item %error-verbose
+Bison declaration to request verbose, specific error message strings
+when @code{yyerror} is called.
+
@item %file-prefix="@var{prefix}"
Bison declaration to set the prefix of the output files. @xref{Decl
Summary}.
Bison declaration to assign left associativity to token(s).
@xref{Precedence Decl, ,Operator Precedence}.
+@item %lex-param "@var{argument-declaration}" "@var{argument-name}"
+Bison declaration to specifying an additional parameter that
+@code{yylex} should accept. @xref{Pure Calling,, Calling Conventions
+for Pure Parsers}.
+
@item %merge
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
Bison declaration to set the name of the parser file. @xref{Decl
Summary}.
+@item %parse-param "@var{argument-declaration}" "@var{argument-name}"
+Bison declaration to specifying an additional parameter that
+@code{yyparse} should accept. @xref{Parser Function,, The Parser
+Function @code{yyparse}}.
+
@item %prec
Bison declaration to assign a precedence to a specific rule.
@xref{Contextual Precedence, ,Context-Dependent Precedence}.