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

View File

@@ -58,11 +58,11 @@ m4_define([b4_cpp_guard_close],
# b4_pull_flag if they use the values of the %define variables api.pure or
# api.push-pull.
m4_define([b4_identification],
[[/* Identify Bison output. */
#define YYBISON 1
[[/* Identify Bison output, and Bison version. */
#define YYBISON ]b4_version[
/* Bison version. */
#define YYBISON_VERSION "]b4_version["
/* Bison version string. */
#define YYBISON_VERSION "]b4_version_string["
/* Skeleton name. */
#define YYSKELETON_NAME ]b4_skeleton[]m4_ifdef([b4_pure_flag], [[