support $<tag>$ in printers and destructors

* src/scan-code.l (SC_SYMBOL_ACTION): Accept $<tag>$, not just $$.
* data/c.m4 (b4_dollar_dollar_): New.
(b4_symbol_actions): Let b4_dollar_dollar use b4_dollar_dollar_.
* NEWS, doc/bison.texi: Document it.
* tests/actions.at: Check this for C and C++.
This commit is contained in:
Akim Demaille
2012-07-26 16:52:35 +02:00
parent 65a99eca25
commit 4982f078bf
6 changed files with 182 additions and 15 deletions

10
NEWS
View File

@@ -10,6 +10,16 @@ GNU Bison NEWS
*** glr.cc: set_debug_level and debug_level work as expected.
** Type names in printers and destructors
For consistency with rule actions, it is now possible to qualify $$ by a
type-name in printers and destructors. For instance:
%printer { fprintf (yyo, "(%d, %f)", $<ival>$, $<fval>$); } <*> <>;
will display two values for each typed and untyped symbol (provided
that YYSTYPE supports it).
* Noteworthy changes in release 2.6 (2012-07-19) [stable]
** Future Changes