mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 14:53:03 +00:00
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:
@@ -127,9 +127,6 @@ muscle_init (void)
|
||||
|
||||
muscle_table = hash_xinitialize (HT_INITIAL_CAPACITY, NULL, hash_muscle,
|
||||
hash_compare_muscles, muscle_entry_free);
|
||||
|
||||
/* Version and input file. */
|
||||
MUSCLE_INSERT_STRING ("version", VERSION);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "scan-skel.h"
|
||||
#include "symtab.h"
|
||||
#include "tables.h"
|
||||
#include "strversion.h"
|
||||
|
||||
static struct obstack format_obstack;
|
||||
|
||||
@@ -807,6 +808,9 @@ prepare (void)
|
||||
char const *cp = getenv ("BISON_USE_PUSH_FOR_PULL");
|
||||
bool use_push_for_pull_flag = cp && *cp && strtol (cp, 0, 10);
|
||||
|
||||
/* Versions. */
|
||||
MUSCLE_INSERT_STRING ("version_string", VERSION);
|
||||
MUSCLE_INSERT_INT ("version", strversion_to_int (VERSION));
|
||||
MUSCLE_INSERT_INT ("required_version", required_version);
|
||||
|
||||
/* Flags. */
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
USER NAME SPACE" below. */
|
||||
|
||||
/* Identify Bison output. */
|
||||
#define YYBISON 1
|
||||
#define YYBISON 30703
|
||||
|
||||
/* Bison version. */
|
||||
#define YYBISON_VERSION "3.7.3.7-d831b"
|
||||
|
||||
Reference in New Issue
Block a user