those cases your code should respect the identifiers reserved by those
headers. On some non-@sc{gnu} hosts, @code{<alloca.h>},
@code{<stddef.h>}, and @code{<stdlib.h>} are included as needed to
-declare memory allocators and related types. In the same situation,
-C++ parsers may include @code{<cstddef>} and @code{<cstdlib>} instead.
+declare memory allocators and related types.
Other system headers may be included if you define @code{YYDEBUG} to a
nonzero value (@pxref{Debugging, ,Debugging Your Parser}).
@subsection A Pure (Reentrant) Parser
@cindex reentrant parser
@cindex pure parser
-@findex %pure_parser
+@findex %pure-parser
A @dfn{reentrant} program is one which does not alter in the course of
execution; in other words, it consists entirely of @dfn{pure} (read-only)
including @code{yylval} and @code{yylloc}.)
Alternatively, you can generate a pure, reentrant parser. The Bison
-declaration @code{%pure_parser} says that you want the parser to be
+declaration @code{%pure-parser} says that you want the parser to be
reentrant. It looks like this:
@example
-%pure_parser
+%pure-parser
@end example
The result is that the communication variables @code{yylval} and
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}.
-@c @item %header_extension
+@c @item %header-extension
@c Specify the extension of the parser header file generated when
@c @code{%define} or @samp{-d} are used.
@c
@c For example, a grammar file named @file{foo.ypp} and containing a
-@c @code{%header_extension .hh} directive will produce a header file
+@c @code{%header-extension .hh} directive will produce a header file
@c named @file{foo.tab.hh}
@item %locations
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} and @code{yydebug}. 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{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
Request a pure (reentrant) parser program (@pxref{Pure Decl, ,A Pure
(Reentrant) Parser}).
-@c @item %source_extension
+@c @item %source-extension
@c Specify the extension of the parser output file.
@c
@c For example, a grammar file named @file{foo.yy} and containing a
-@c @code{%source_extension .cpp} directive will produce a parser file
+@c @code{%source-extension .cpp} directive will produce a parser file
@c named @file{foo.tab.cpp}
-@item %token_table
+@item %token-table
Generate an array of token names in the parser file. The name of the
array is @code{yytname}; @code{yytname[@var{i}]} is the name of the
token whose internal Bison token code number is @var{i}. The first three
contains @samp{"*"*"}. (In C, that would be written as
@code{"\"*\"*\""}).
-When you specify @code{%token_table}, Bison also generates macro
+When you specify @code{%token-table}, Bison also generates macro
definitions for macros @code{YYNTOKENS}, @code{YYNNTS}, and
@code{YYNRULES}, and @code{YYNSTATES}:
output file is called @file{foo.output}.@refill
@item %yacc
-@itemx %fixed-output-files
Pretend the option @option{--yacc} was given, i.e., imitate Yacc,
including its naming conventions. @xref{Bison Options}, for more.
@end table
@end smallexample
The @code{yytname} table is generated only if you use the
-@code{%token_table} declaration. @xref{Decl Summary}.
+@code{%token-table} declaration. @xref{Decl Summary}.
@end itemize
@node Token Values
@node Pure Calling
@subsection Calling Conventions for Pure Parsers
-When you use the Bison declaration @code{%pure_parser} to request a
+When you use the Bison declaration @code{%pure-parser} to request a
pure, reentrant parser, the global communication variables @code{yylval}
and @code{yylloc} cannot be used. (@xref{Pure Decl, ,A Pure (Reentrant)
Parser}.) In such parsers the two global variables are replaced by
the proper object type, or you can declare it as @code{void *} and
access the contents as shown above.
-You can use @samp{%pure_parser} to request a reentrant parser without
+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.
debugging is always possible.
The trace facility outputs messages with macro calls of the form
-@code{YYFPRINTF (YYSTDERR, @var{format}, @var{args})} where
+@code{YYFPRINTF (stderr, @var{format}, @var{args})} where
@var{format} and @var{args} are the usual @code{printf} format and
arguments. If you define @code{YYDEBUG} to a nonzero value but do not
define @code{YYFPRINTF}, @code{<stdio.h>} is automatically included
-and the macros are defined to @code{fprintf} and @code{stderr}. In
-the same situation, C++ parsers include @code{<cstdio.h>} instead, and
-use @code{std::fprintf} and @code{std::stderr}.
+and @code{YYPRINTF} is defined to @code{fprintf}.
Once you have compiled the program with trace facilities, the way to
request a trace is to store a nonzero value in the variable @code{yydebug}.
@need 1750
@item -y
@itemx --yacc
-@itemx --fixed-output-files
Equivalent to @samp{-o y.tab.c}; the parser output file is called
@file{y.tab.c}, and the other outputs are called @file{y.output} and
@file{y.tab.h}. The purpose of this option is to imitate Yacc's output
environment variable @code{BISON_SIMPLE} to the path of the file will
cause Bison to use that copy instead.
-When the @samp{%semantic_parser} declaration is used, Bison copies from
+When the @samp{%semantic-parser} declaration is used, Bison copies from
a file called @file{bison.hairy} instead. The location of this file can
also be specified or overridden in a similar fashion, with the
@code{BISON_HAIRY} environment variable.
\line{ --debug \leaderfill -t}
\line{ --defines \leaderfill -d}
\line{ --file-prefix \leaderfill -b}
-\line{ --fixed-output-files \leaderfill -y}
\line{ --graph \leaderfill -g}
\line{ --help \leaderfill -h}
\line{ --name-prefix \leaderfill -p}
--debug -t
--defines=@var{defines-file} -d
--file-prefix=@var{prefix} -b @var{file-prefix}
---fixed-output-files --yacc -y
--graph=@var{graph-file} -d
--help -h
--name-prefix=@var{prefix} -p @var{name-prefix}
--token-table -k
--verbose -v
--version -V
+--yacc -y
@end example
@end ifinfo
Bison declaration to set tge prefix of the output files. @xref{Decl
Summary}.
-@c @item %source_extension
+@c @item %source-extension
@c Bison declaration to specify the generated parser output file extension.
@c @xref{Decl Summary}.
@c
-@c @item %header_extension
+@c @item %header-extension
@c Bison declaration to specify the generated parser header file extension
@c if required. @xref{Decl Summary}.