mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 22:03:02 +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:
@@ -3155,14 +3155,14 @@ type:
|
||||
%code requires @{ #include "type1.h" @}
|
||||
%union @{ type1 field1; @}
|
||||
%destructor @{ type1_free ($$); @} <field1>
|
||||
%printer @{ type1_print ($$); @} <field1>
|
||||
%printer @{ type1_print (yyoutput, $$); @} <field1>
|
||||
@end group
|
||||
|
||||
@group
|
||||
%code requires @{ #include "type2.h" @}
|
||||
%union @{ type2 field2; @}
|
||||
%destructor @{ type2_free ($$); @} <field2>
|
||||
%printer @{ type2_print ($$); @} <field2>
|
||||
%printer @{ type2_print (yyoutput, $$); @} <field2>
|
||||
@end group
|
||||
@end example
|
||||
|
||||
@@ -10244,7 +10244,7 @@ regular destructors. All the values are printed using their
|
||||
@c FIXME: Document %printer, and mention that it takes a braced-code operand.
|
||||
@comment file: calc++-parser.yy
|
||||
@example
|
||||
%printer @{ debug_stream () << $$; @} <*>;
|
||||
%printer @{ yyoutput << $$; @} <*>;
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
|
||||
Reference in New Issue
Block a user