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

@@ -151,7 +151,7 @@ m4_define([b4_rhs_location],
# b4_shared_declarations
# ----------------------
# Declaration that might either go into the header (if --defines)
# Declaration that might either go into the header (if --header)
# or open coded in the parser body. glr.cc has its own definition.
m4_if(b4_skeleton, ["glr.c"],
[m4_define([b4_shared_declarations],
@@ -185,7 +185,7 @@ int ]b4_prefix[parse (]m4_ifset([b4_parse_param], [b4_formals(b4_parse_param)],
# glr.cc produces its own header.
b4_glr_cc_if([],
[b4_defines_if(
[b4_header_if(
[b4_output_begin([b4_spec_header_file])
b4_copyright([Skeleton interface for Bison GLR parsers in C],
[2002-2015, 2018-2020])[
@@ -228,7 +228,7 @@ b4_copyright([Skeleton implementation for Bison GLR parsers in C],
]b4_cast_define[
]b4_null_define[
]b4_defines_if([[#include "@basename(]b4_spec_header_file[@)"]],
]b4_header_if([[#include "@basename(]b4_spec_header_file[@)"]],
[b4_shared_declarations])[
]b4_glr_cc_if([b4_glr_cc_setup],