yacc.c: provide the Bison version as an integral macro

Suggested by Balazs Scheidler.
https://github.com/akimd/bison/issues/55

* src/muscle-tab.c (muscle_init): Move/rename `b4_version` to/as...
* src/output.c (prepare): `b4_version_string`.
Also define `b4_version`.
* data/skeletons/bison.m4, data/skeletons/c.m4, data/skeletons/d.m4,
* data/skeletons/java.m4: Adjust.
* doc/bison.texi: Document it.
This commit is contained in:
Akim Demaille
2020-11-11 08:42:16 +01:00
parent d3c575a6c6
commit 21c147b6e5
9 changed files with 30 additions and 17 deletions

6
NEWS
View File

@@ -7,6 +7,12 @@ GNU Bison NEWS
In Yacc mode, all the tokens are defined twice: once as an enum, and then
as a macro. YYEMPTY was missing its macro.
** Changes
The YYBISON macro in generated "regular C parsers" (from the "yacc.c"
skeleton) used to be defined to 1. It is now defined to the version of
Bison as an integer (e.g., 30704 for version 3.7.4).
* Noteworthy changes in release 3.7.3 (2020-10-13) [stable]
** Bug fixes