Commit Graph

432 Commits

Author SHA1 Message Date
Paul Eggert
f6ebdb3174 (struct bitset_vtable.size, struct bitset_vtable.count,
struct bitset_vtable.list, struct bitset_vtable.list_reverse,
bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
bitset_count_):
Use bitset_bindex, not int or unsigned int or size_t, to count bits.

(BITSET_BINDEX_MAX, BITSET_WINDEX_MAX, BITSET_SIZE_MAX): New macros.
(BITSET_INDEX_MAX): Remove.  It wasn't right, since it assumed that
sizeof (bitset_word) == sizeof (bitset_windex).  All uses changed
to BITSET_WINDEX_MAX.
2002-10-02 07:44:07 +00:00
Paul Eggert
8207d52123 (abitset_bytes): Use size_t, not unsigned int, to count bytes. 2002-10-02 07:42:26 +00:00
Paul Eggert
62a34c3eb6 (struct abitset_struct.n_bits, abitset_small_list, abitset_size,
abitset_list, abitset_list_reverse, abitset_list):
Use bitset_bindex, not int or unsigned int or size_t, to count bits.

(abitset_ones, abitset_zero, abitset_bytes):
Use size_t, not unsigned int, to count bytes.

(abitset_empty_p, abitset_not, abitset_equal_p,
abitset_subset_p, abitset_disjoint_p, abitset_and,
abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
abitset_or_and, abitset_or_and_cmp): Use bitset_windex instead of
unsigned int.
2002-10-02 07:41:04 +00:00
Akim Demaille
6aa452a643 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
* lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
Updates from Michael Hayes.
2002-09-30 12:50:49 +00:00
Akim Demaille
8280e1797d Playing with Autoscan.
* configure.ac: Remove the old LIBOBJ tweaks.
(AC_REPLACE_FUNCS): Add strrchr and strtol.
* lib/strrchr.c: New.
* lib/strtol.c: New, from the Coreutils 4.5.1.
2002-09-27 13:19:59 +00:00
Akim Demaille
ae64af3556 Playing with Autoscan.
* m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
* lib/Makefile.am (libbison_a_SOURCES): No longer include
argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
* lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
Coreutils 4.5.1.
2002-09-27 13:03:32 +00:00
Paul Eggert
eb9568566a Sync with fileutils. 2002-08-12 14:25:24 +00:00
Paul Eggert
d5629ce34a Sync with diffutils. 2002-08-12 14:25:03 +00:00
Paul Eggert
c340180d81 (lbitset_set, lbitset_reset): Do not assume that
bitset_word is the same width as int.
(lbitset_op1): Use -1, not ~0, as memset arg (for
portability to one's complement hosts!).
2002-08-12 14:22:08 +00:00
Paul Eggert
c837b82803 (ebitset_set, ebitset_reset): Do not assume that bitset_word is the
same width as int.
(ebitset_op1): Use -1, not ~0, as memset arg (for portability to one's
complement hosts!).
2002-08-12 14:20:35 +00:00
Paul Eggert
e601ff27f4 (bitset_set, bitset_reset): Do not assume that bitset_word is the same
width as int.
2002-08-12 14:19:02 +00:00
Paul Eggert
c131cbff03 Include "gettext.h".
(_): New macro.
(bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
name locals "index", as it generates unnecessary warnings on some
hosts that have an "index" function.

(bitset_stats_print_1, bitset_stats_print, bitset_stats_read,
bitset_stats_write): Wrap strings in _() if they need translation.

(bitset_stats_set, bitset_stats_reset): Do not assume that bitset_word
is the same width as int.
2002-08-12 14:16:49 +00:00
Paul Eggert
50f095c92f (BITSET_WORD_BITS): Now of type unsigned, not
size_t; the old version tried to do this but casted improperly.
(bitset_bindex, bitset_windex): Now size_t, not unsigned long.
(bitset_test): Now returns int, not unsigned long.
2002-08-12 14:13:56 +00:00
Paul Eggert
16cb098b72 Sync with fileutils, except use
PROTOTYPES to check for prototypes, and "defined __STDC__" to
check for void *.
2002-08-12 14:12:57 +00:00
Paul Eggert
9742c552f2 Use GPL, not LGPL. 2002-08-12 14:12:13 +00:00
Paul Eggert
8434f2222e Sync with GNU tar. 2002-08-12 14:10:23 +00:00
Paul Eggert
d6eba4239f (abitset_reverse_list, ebitset_reverse_list):
Do not assume that bitset_windex is the same width as unsigned.
(abitset_unused_clear): Do not assume that bitset_word is the same
width as int.
(abitset_op1): Use -1, not ~0, as memset arg (for portability to one's
complement hosts!).
2002-08-12 14:09:24 +00:00
Paul Eggert
81fe8b23e9 (INCLUDES): Do not include from the intl directory, which has been
removed.
(libbison_a_SOURCES): Add unlocked-io.h.  Avoid +=, a GNU make extension.
(bitsets_sources, additional_bitsets_sources, timevars_sources): New vars.
2002-08-12 14:08:04 +00:00
Paul Eggert
87b7d7bad5 From fileutils. 2002-08-12 14:04:17 +00:00
Akim Demaille
3325ddc49c * lib/timevar.c (get_time): Include children time.
* src/lalr.h (LA, LArule): Don't export them: used with the
state_t.
* src/lalr.c (LA, LArule): Static.
* src/lalr.h, src/lalr.c (lalr_free): New.
* src/main.c (main): Call it.
* src/tables.c (pack_vector): Check whether loc is >= to the
table_size, not >.
(pack_tables): Don't free froms, tos, conflict_tos, and pos...
(tables_generate): do it, since that's also it which allocates
them.
Don't free LA and LArule, main does.
2002-08-01 18:12:11 +00:00
Akim Demaille
1509d42fcb Steal GCC's --time-report support.
* lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
stolen/adjusted from GCC.
* m4/stage.m4: Remove time related checks.
* m4/timevar.m4: New.
* configure.in: Adjust.
* src/system.h: Adjust to using timevar.h.
* src/getargs.h, src/getargs.c: Support trace_time for
--trace=time.
* src/main.c (stage): Remove.
(main): Replace `stage' invocations with timevar calls.
* src/output.c: Insert pertinent timevar calls.
2002-07-31 19:52:13 +00:00
Paul Eggert
7601152fab Fix dates in copyright notice. 2002-07-10 06:24:51 +00:00
Akim Demaille
1a715ef2fc * lib/quotearg.h: Protect against multiple inclusions.
* src/location.h (location_t): Add a `file' member.
(LOCATION_RESET, LOCATION_PRINT): Adjust.
* src/complain.c (warn_at, complain_at, fatal_at): Drop
`error_one_per_line' support.
2002-07-09 16:24:57 +00:00
Akim Demaille
613f5e1a89 * lib/libiberty.h: New.
* lib: Update the bitset implementation from upstream.
* src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
* src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
* src/main.c: Adjust bitset stats calls.
2002-07-02 13:51:27 +00:00
Akim Demaille
54049e5db0 Add. 2002-05-27 06:18:41 +00:00
Akim Demaille
ec3bc3961d * doc/bison.texinfo (Debugging): Split into...
(Tracing): this new section, its former contents, and...
(Understanding): this new section.
* src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
by...
(report_flag): this.
Adjust all dependencies.
(report_args, report_types, report_argmatch): New.
(usage, getargs): Report/support -r, --report.
* src/options.h
(struct option_table_struct): Rename as..,
(struct option_table_s): this.
Rename the `set_flag' member to `flag' to match with getopt_long's
struct.
* src/options.c (option_table): Split verbose into an entry for
%verbose, and another for --verbose.
Support --report/-r, so remove -r from the obsolete --raw.
* src/print.c: Attach full item sets and lookaheads reports to
report_flag instead of trace_flag.
* lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
2002-05-25 16:12:40 +00:00
Akim Demaille
1565b72064 * src/closure.c (print_firsts): Display of the symbol tags.
(bitmatrix_print): Move to...
* lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
here.
* tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
2002-05-06 08:42:24 +00:00
Akim Demaille
9208d17fa9 Use Gettext 0.11.1. 2002-03-14 18:31:14 +00:00
Akim Demaille
345cea780a * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
* lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
Update.
From Michael Hayes.
2002-03-04 14:15:01 +00:00
Akim Demaille
ef01750240 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
* lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
* lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
latest sources from Michael.
2002-03-04 12:07:08 +00:00
Akim Demaille
7086e7071e * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
* lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
* lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
* src/closure.c (fderives): Be an array of bitsets.
2002-03-04 11:58:52 +00:00
Akim Demaille
381fb12e1e * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
Fileutils 4.1.5.
* configure.in: Invoke UTILS_FUNC_MKSTEMP.
* src/output.c (output_skeleton): Use mkstemp to create a real
temporary file.
Move the filling of `skeleton' and its muscle to...
(prepare): here.
(output): Move the definition of the prologue muscle to...
(prepare): here.
* src/system.h (DEFAULT_TMPDIR): New.
2002-02-25 13:44:43 +00:00
Akim Demaille
842e86794f * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c. 2002-02-14 11:51:42 +00:00
Akim Demaille
11ee57d90c Really add readpipe to the repo. 2002-02-05 10:14:20 +00:00
Akim Demaille
be2a1a68ef Give a try to M4 as a back end.
* lib/readpipe.c: New, from wdiff.
* src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
BISON_HAIRY.
* src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
specific values.  Now it is m4 that performs the lookup.
* src/parse-skel.y: Remove.
* src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
* src/output.c (actions_output, guards_output)
(token_definitions_output): No longer keeps track of the output
line number, hence remove the second argument.
(guards_output): Check against the guard member of a rule, not the
action member.
Adjust callers.
(output_skeleton): Don't look for the skeleton location, let m4 do
that.
Create `/tmp/muscles.m4'.  This is temporary, a proper temporary
file will be used.
Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
(prepare): Given that for the time being changesyntax is not
usable in M4, rename the muscles using `-' to `_'.
Define `defines_flag', `output_parser_name' and `output_header_name'.
* src/output.h (actions_output, guards_output)
(token_definitions_output): Adjust prototypes.
* src/scan-skel.l: Instead of scanning the skeletons, it now
processes the output of m4: `__oline__' and `#output'.
* data/bison.simple: Adjust to be used by M4(sugar).
* tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
to date.
* tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
* data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
shamelessly stolen from CVS Autoconf.
2002-02-05 10:08:59 +00:00
Akim Demaille
beda758b1f * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
* configure.in: Check for the declarations of free and malloc.
* src/muscle_tab.c: Adjust.
2002-02-05 10:00:47 +00:00
Tim Van Holder
a10778dc32 * lib/hash.h, lib/hash.c (__P): Renamed to PARAMS; canonical definition used. 2002-01-11 15:26:56 +00:00
Akim Demaille
22312b71e0 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
New, stolen from the Fileutils 4.1.
* lib/Makefile.am (libbison_a_SOURCES): Adjust.
* configure.in: Check for the presence of memrchr, and of its
prototype.
2002-01-08 17:27:46 +00:00
Tim Van Holder
a67cef01b1 * lib/hash.h (__P): Added definition for this macro.
* src/Makefile.am: Add parse-skel.c and scan-skel.c to BUILT_SOURCES, to ensure they are generated first.
* src/parse-skel.y: Use YYERROR_VERBOSE instead of %error-verbose to allow bootstrapping with bison 1.30x.
2002-01-07 23:00:39 +00:00
Akim Demaille
fab5b110fb * lib/quotearg.c: Use #include "..."' instead of #include <...>'
for non system headers.
2002-01-03 09:55:33 +00:00
Akim Demaille
a4b36db458 * src/system.h: We don't need nor want bcopy.
Throw away MS-DOS crap: we don't need getpid.
* configure.in: We don't need strndup.  It was even causing
problems: because Flex includes the headers *before* us,
_GNU_SOURCE is not defined by config.h, and therefore strndup was
not visible.
* lib/xstrndup.c: New.
* src/scan-skel.l: Use it.
Be sure to initialize yylval.muscle member when scanning a MUSCLE.
* src/parse-skel.y: Use %directives instead of #defines.
2001-12-30 21:06:22 +00:00
Akim Demaille
ec2da99ffe * configure.in: Check the protos of strchr ans strspn.
Replace strchr if needed.
* src/system.h: Provide the protos of strchr, strspn and memchr if
missing.
* lib/strchr.c: New.
* src/reader.c (symbols_save): Use strchr.
2001-12-27 18:12:48 +00:00
Akim Demaille
a64d6fe0c3 Fix INCLUDES. 2001-12-15 16:35:48 +00:00
Akim Demaille
1a4648ff0d Make `make distcheck' work.
* lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
system.h which uses libgettext.h.
2001-12-15 16:31:04 +00:00
Akim Demaille
a870c5670e Clean up GCC warnings.
* src/reader.c (copy_action): `buf' is not used.
(parse_skel_decl): Be static.
* src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
* src/options.h (create_long_option_table): Have a real prototype.
* lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
(hash_delete_at): Return const void *.
Adjust casts to preserve the const.
2001-12-10 09:05:47 +00:00
Akim Demaille
2c8a9dfa1d * configure.in (WARNING_CFLAGS): Add -Werror when possible.
(CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
Gettext doesn't compile cleanly, and dies with -Werror.
* src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
Include WARNING_CFLAGS here.
* lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
before being defined.
2001-11-30 14:25:16 +00:00
Akim Demaille
f4e421e6e4 * lib/quotearg.h (quotearg_n, quotearg_n_style):
First arg is int, not unsigned.
* lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
(SIZE_MAX, UINT_MAX): New macros.
(quotearg_n_options): Abort if N is negative.
Avoid overflow check on hosts where size_t is 64 bits and int
is 32 bits, as overflow is impossible there.
Fix off-by-one typo that caused unnecessary reallocation.
2001-11-30 14:04:24 +00:00
Akim Demaille
5e147124b5 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
* lib/Makefile.am (libbison_a_SOURCES): Adjust.
2001-11-26 09:35:38 +00:00
Akim Demaille
c64a20f3dc * lib/alloca.c: Update, from fileutils. 2001-11-23 14:56:30 +00:00
Akim Demaille
5b0d29bb52 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@. 2001-11-23 14:19:09 +00:00