mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
%printer: support both yyo and yyoutput.
lalr1.cc used to support yyo, but not yyoutput. Support both, but document only yyoutput (at least until there is some consensus on this). * data/c.m4 (yy_symbol_value_print): Also support yyo. * data/glr.cc (yy_symbol_value_print_): Support both yyo and yyoutput. * data/lalr1.cc: Also support yyoutput. * doc/bison.texinfo: Explicitly use yyoutput in the examples. * examples/mfcalc/mfcalc.test: Test the -p option.
This commit is contained in:
@@ -549,11 +549,11 @@ b4_percent_code_get[]dnl
|
||||
]b4_parser_class_name[::yy_destroy_ (const char* yymsg,
|
||||
symbol_base_type<Exact>& yysym) const
|
||||
{
|
||||
int yytype = yysym.type_get ();
|
||||
if (yymsg)
|
||||
YY_SYMBOL_PRINT (yymsg, yysym);
|
||||
|
||||
// User destructor.
|
||||
int yytype = yysym.type_get ();
|
||||
switch (yytype)
|
||||
{
|
||||
]b4_symbol_foreach([b4_symbol_destructor])dnl
|
||||
@@ -571,6 +571,8 @@ b4_percent_code_get[]dnl
|
||||
]b4_parser_class_name[::yy_print_ (std::ostream& yyo,
|
||||
const symbol_base_type<Exact>& yysym) const
|
||||
{
|
||||
std::ostream& yyoutput = yyo;
|
||||
YYUSE (yyoutput);
|
||||
int yytype = yysym.type_get ();
|
||||
yyo << (yytype < yyntokens_ ? "token" : "nterm")
|
||||
<< ' ' << yytname_[yytype] << " ("]b4_locations_if([
|
||||
|
||||
Reference in New Issue
Block a user