Commit Graph

40 Commits

Author SHA1 Message Date
Paul Eggert
1930ac784a (EXTRA_DIST): Add stdbool_.h.
(MOSTLYCLEANFILES): New var.
($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
(stdbool.h): New rule.
2003-06-16 19:41:37 +00:00
Paul Eggert
f61aad9399 Merge changes from gnulib. This was prompted because the CVS
snapshot of Bison didn't build on Solaris 7 due to strnlen problems.
2003-03-12 23:08:11 +00:00
Akim Demaille
f0057011f7 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@. 2003-01-09 12:45:08 +00:00
Paul Eggert
66abff154f (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
(EXTRA_LIBRARIES): New var, for liby.a.
2003-01-05 06:26:25 +00:00
Paul Eggert
f6a8ccf40a (libbison_a_SOURCES): Add get-errno.h, get-errno.c. 2002-12-11 05:26:00 +00:00
Paul Eggert
1f14d97ae5 (lib_LIBRARIES, liby_a_SOURCES): New macros. 2002-11-30 09:10:55 +00:00
Paul Eggert
aad8382e8d (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c. 2002-11-03 08:39:43 +00:00
Paul Eggert
6d55632cb7 (libbison_a_SOURCES): Remove readpipe.c.
Add subpipe.h, subpipe.c.
2002-10-20 06:29:41 +00:00
Paul Eggert
24c7b92b25 (AUTOMAKE_OPTIONS): Remove. 2002-10-17 01:29:01 +00:00
Paul Eggert
cd931d9b53 (AM_CFLAGS): Renamed from CFLAGS. 2002-10-05 04:53:54 +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
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
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
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
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
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
842e86794f * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c. 2002-02-14 11:51:42 +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
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
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
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
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
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
5b0d29bb52 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@. 2001-11-23 14:19:09 +00:00
Robert Anisko
9c76d118cc * lib/Makefile.am: Adjust. 2001-08-25 15:28:07 +00:00
Robert Anisko
68bd3b6bfa * lib/hash.c: New file.
* lib/hash.h: New file.
* lib/Makefile.am: Update.
2001-08-25 14:15:11 +00:00
Robert Anisko
bbb5bcc6f8 Revert to 1.28c 2001-08-25 13:13:14 +00:00
Robert Anisko
83cd972a1a 2001-08-20 Robert Anisko <robert.anisko@epita.fr>
* src/output.c (prepare): Add prefixed names.
	(output_parser): Output semantic actions.
	(output_parser): Fix bug on '%%line' directives.

2001-08-19  Robert Anisko  <robert.anisko@epita.fr>

	* src/output.c (output_rule_data): Do not output tables to
	the table obstack.

	* src/reader.c (reader): Remove calls to 'output_headers' and
	'output_trailers'. Remove some C output.
	(readgram): Disable a piece of code that was writing a default
	definition for 'YYSTYPE'.
	(reader_output_yylsp): Remove.
	(packsymbols): Output token defintions to a macro.
	(copy_definition): Disable C output.

	* src/output.c (output_headers): Remove. The C code printed by this
	function should now be in the skeletons.
	(output_trailers): Remove.
	(output): Disable call to 'reader_output_yylsp'.

2001-08-18  Robert Anisko  <robert.anisko@epita.fr>

	* src/output.c: Remove some C dedicated output.

2001-08-18  Robert Anisko  <robert.anisko@epita.fr>

	* src/output.c (output_defines): Remove.

2001-08-18  Robert Anisko  <robert.anisko@epita.fr>

	* src/output.c: Improve the use of macro and output obstacks.

2001-08-18  Robert Anisko  <robert.anisko@epita.fr>

	* src/output.c (output_token_translations): Associate 'translate' table
	with a macro. No output to the table obstack.
	(output_gram): Same for 'rhs' and 'prhs'.
	(output_stos): Same for 'stos'.
	(output_rule_data): Same for 'r1' and 'r2'.
	(token_actions): Same for 'defact'.
	(goto_actions): Same for 'defgoto'.
	(output_base): Same for 'pact' and 'pgoto'.
	(output_table): Same for 'table'.
	(output_check): Same for 'check'.

2001-08-18  Robert Anisko  <robert.anisko@epita.fr>

	* src/output.c (output_table_data): New function.
	(output_short_table): Remove.
	(output_short_or_char_table): Remove.

2001-08-17  Robert Anisko  <robert.anisko@epita.fr>

	* src/main.c (main): Initialize the macro table.

2001-08-17  Robert Anisko  <robert.anisko@epita.fr>

	* src/output.c (output_parser): Use the macro table.
	* src/macrotab.c: New file.
	* src/macrotab.h: New file.

2001-08-17  Robert Anisko  <robert.anisko@epita.fr>

	* lib/xalloc.h (CALLOC, MALLOC, REALLOC): New macros.

2001-08-17  Robert Anisko  <robert.anisko@epita.fr>

	* lib/hash.c: New file.
	* lib/hash.h: New file.

2001-08-16  Robert Anisko  <robert.anisko@epita.fr>

	* src/reader.c (parse_macro_decl): Read macro identifiers using
	copy_identifier rather than lex.

2001-08-16  Robert Anisko  <robert.anisko@epita.fr>

	* src/reader.c (copy_identifier): New.

2001-08-16  Robert Anisko  <robert.anisko@epita.fr>

	* src/reader.c (read_declarations): Add case for macro definition.
	* src/lex.c (percent_table): Add tok_define.
	* src/lex.h: Add tok_define.

2001-08-16  Robert Anisko  <robert.anisko@epita.fr>

	* src/reader.c (parse_macro_decl): New function used to parse macro
	declarations.
	(copy_string2): Put the body of copy_string into this new function.
	Add a parameter to let the caller choose whether he wants to copy the
	string delimiters or not.
	(copy_string): Be a simple call to copy_string2 with the last argument
	bound to true.

2001-08-15  Robert Anisko  <robert.anisko@epita.fr>

	* src/output.c (output_parser): Replace most of the skeleton copy code
	with something new. Skeletons are now processed character by character
	rather than line by line, and Bison looks for '%%' macros. This is the
	first step in making Bison's output process (a lot) more flexible.
2001-08-21 19:47:13 +00:00
Akim Demaille
79282c6c57 alloca.c, alloca.h and allocate.c are really to be removed. 2001-08-13 14:54:50 +00:00
Akim Demaille
18569462db * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
New, from fileutils 4.0.37.
* configure.in: Require Autoconf 2.49c.  I took some time before
making this decision.  This is the only way out for portability
issues in Bison, it would mean way too much duplicate effort to
import in Bison features implemented in 2.49c since 2.13.
AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
2001-02-08 14:32:10 +00:00
Akim Demaille
8c7ebe4946 Introduce obstacks.
Change each use of `faction' into a use of `action_obstack'.
* lib/obstack.h, lib/obstack.c: New files.
* src/files.c (faction): Remove.
(action_obstack): New.
Adjust all dependencies.
2000-11-01 16:03:50 +00:00
Akim Demaille
ff4a34be27 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
* m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
New files, from Fileutils 4.0.27.
* src/main.c (printable_version): Remove.
* src/lex.c, src/reader.c: Use `quote'.


* lib/error.c, lib/error.h: New files, needed by xmalloc.c.
2000-10-16 17:28:41 +00:00
Akim Demaille
95e36146a5 * lib/xstrdup.c: New file, from the fileutils.
* src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
(parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
instead of strlen + xmalloc + strcpy.
* src/symtab.c (copys): Remove, use xstrdup instead.
2000-10-02 09:01:19 +00:00
Akim Demaille
d7913476c4 Use the more standard files xalloc.h' and xmalloc.c' instead of
Bison's `allocate.c' and `alloc.h'.  This patch was surprisingly
difficult and introduced a lot of core dump.  It turns out that
Bison used an implementation of `xmalloc' based on `calloc', and
at various places it does depend upon the initialization to 0.  I
have not tried to isolate the pertinent places, and all the former
calls to Bison's `xmalloc' are now using `XCALLOC'.  Someday,
someone should address this issue.
* src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
* lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
files.
Adjust dependencies.
* src/warshall.h: New file.
Propagate.
2000-10-02 08:48:32 +00:00
Akim Demaille
a0f6b07611 Clean the error reporting functions.
* src/report.c: New file.
* src/report.h: Likewise.
* src/Makefile.am: Adjust.
* m4/error.m4: New file.
* m4/Makefile.am: Adjust.
* configure.in (jm_PREREQ_ERROR): Call it.
* src/main.c (int_to_string, banner, fatal_banner, warn_banner):
Remove.
(fatal, fatals): Remove.  All callers use complain.c::fatal.
(warn, warni, warns, warnss, warnss): Remove.  All callers use
complain.c::complain.
(toomany): Remove, use fatal instead.
* src/files.c (done): No argument, use complain_message_count.
* src/main.c (main): Register `done' to `atexit'.

* src/getargs.c (usage): More `fputs', less `fprintf'.
2000-03-31 13:54:30 +00:00
Akim Demaille
1853982561 * lib/: New directory.
* Makefile.am (SUBDIRS): Adjust.
* configure.in: Adjust.
(LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
useless.
* src/alloca.c: Moved to lib/.
* src/getopt.c: Likewise.
* src/getopt1.c: Likewise.
* src/getopt.h: Likewise.
* src/ansi2knr.c: Likewise.
* src/ansi2knr.1: Likewise.
* src/Makefile.am: Adjust.
* lib/Makefile.am: New file.
2000-03-28 13:30:57 +00:00