mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
%printer: promote yyo rather than yyoutput
* doc/bison.texi: Promote yyo rather than yyoutput. * data/c.m4, data/glr.cc, tests/types.at, tests/calc.at, tests/regression.at: Adjust.
This commit is contained in:
@@ -247,8 +247,8 @@ AT_SKEL_CC_IF(
|
||||
{
|
||||
semantic_value ival;
|
||||
};
|
||||
%printer { ]AT_SKEL_CC_IF([[yyoutput << $$]],
|
||||
[[fprintf (yyoutput, "%d", $$)]])[; } <ival>;
|
||||
%printer { ]AT_SKEL_CC_IF([[yyo << $$]],
|
||||
[[fprintf (yyo, "%d", $$)]])[; } <ival>;
|
||||
|
||||
%code provides
|
||||
{
|
||||
|
||||
@@ -1012,7 +1012,7 @@ start:
|
||||
;
|
||||
|
||||
%destructor { fprintf (stderr, "DESTRUCTOR\n"); } 'a';
|
||||
%printer { fprintf (yyoutput, "PRINTER"); } 'a';
|
||||
%printer { fprintf (yyo, "PRINTER"); } 'a';
|
||||
|
||||
%%
|
||||
]AT_YYERROR_DEFINE[
|
||||
|
||||
@@ -175,7 +175,7 @@ m4_foreach([b4_skel], [[yacc.c], [glr.c], [lalr1.cc], [glr.cc]],
|
||||
};
|
||||
}
|
||||
%token <up->ival> '1' '2'
|
||||
%printer { ]AT_SKEL_CC_IF([[yyoutput << $$]],
|
||||
%printer { ]AT_SKEL_CC_IF([[yyo << $$]],
|
||||
[[fprintf (yyo, "%d", $$)]])[; } <up->ival>
|
||||
],
|
||||
['1' '2'
|
||||
@@ -231,9 +231,9 @@ m4_foreach([b4_skel], [[yacc.c], [glr.c], [lalr1.cc], [glr.cc]],
|
||||
%define api.value.type union],
|
||||
[%token <int> ONE 101;
|
||||
%token <float> TWO 102 THREE 103;
|
||||
%printer { ]AT_SKEL_CC_IF([[yyoutput << $$]],
|
||||
%printer { ]AT_SKEL_CC_IF([[yyo << $$]],
|
||||
[[fprintf (yyo, "%d", $$)]])[; } <int>
|
||||
%printer { ]AT_SKEL_CC_IF([[yyoutput << $$]],
|
||||
%printer { ]AT_SKEL_CC_IF([[yyo << $$]],
|
||||
[[fprintf (yyo, "%f", $$)]])[; } <float>
|
||||
],
|
||||
[ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }],
|
||||
@@ -255,9 +255,9 @@ m4_foreach([b4_skel], [[yacc.c], [glr.c], [lalr1.cc], [glr.cc]],
|
||||
['1' '2' { std::cout << $1 << ", " << $2 << '\n'; }],
|
||||
["12"],
|
||||
[if (res == '1')
|
||||
AT_VAL.build(10);
|
||||
AT_VAL.build (10);
|
||||
else if (res == '2')
|
||||
AT_VAL.build<std::string>("two");],
|
||||
AT_VAL.build<std::string> ("two");],
|
||||
[10, two])])
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user