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

@@ -103,12 +103,12 @@ m4_define([b4_location_type_if],
# b4_identification
# -----------------
m4_define([b4_identification],
[/** Version number for the Bison executable that generated this parser. */
public static immutable string yy_bison_version = "b4_version";
[[/** Version number for the Bison executable that generated this parser. */
public static immutable string yy_bison_version = "]b4_version_string[";
/** Name of the skeleton that generated this parser. */
public static immutable string yy_bison_skeleton = b4_skeleton;
])
public static immutable string yy_bison_skeleton = ]b4_skeleton[;
]])
## ------------ ##