options: rename --defines as --header

The name "defines" is incorrect, the generated file contains far more
than just #defines.

* src/getargs.h, src/getargs.c (-H, --header): New option.
With optional argument, just like --defines, --xml, etc.
(defines_flag): Rename as...
(header_flag): this.
Adjust dependencies.
* data/skeletons/bison.m4, data/skeletons/c.m4, data/skeletons/glr.c,
* data/skeletons/glr.cc, data/skeletons/glr2.cc, data/skeletons/lalr1.cc,
* data/skeletons/yacc.c:
Adjust.
* examples, doc/bison.texi: Adjust.
* tests/headers.at, tests/local.at, tests/output.at: Convert most
tests from using --defines to using --header.
This commit is contained in:
Akim Demaille
2020-09-06 13:30:23 +02:00
parent b329f0b5df
commit 75c3746ce2
27 changed files with 78 additions and 63 deletions

View File

@@ -56,7 +56,7 @@ location spec_name_prefix_loc = EMPTY_LOCATION_INIT;
char *spec_verbose_file = NULL; /* for --verbose. */
char *spec_graph_file = NULL; /* for -g. */
char *spec_xml_file = NULL; /* for -x. */
char *spec_header_file = NULL; /* for --defines. */
char *spec_header_file = NULL; /* for --header. */
char *spec_mapped_header_file = NULL;
char *parser_file_name;
@@ -411,7 +411,7 @@ compute_output_file_names (void)
? xstrdup (spec_outfile)
: concat2 (all_but_ext, src_extension));
if (defines_flag)
if (header_flag)
{
if (! spec_header_file)
spec_header_file = concat2 (all_but_ext, header_extension);