Commit Graph

73 Commits

Author SHA1 Message Date
Akim Demaille
459a57a90f tests: fix regressions.
Exit status 63 is documented for version-mismatch.
	* bootstrap.conf (gnulib_modules): Remove sysexits.
	* src/system.h (EX_MISMATCH): Define.
	* src/parse-gram.y (version_check): Use it instead of EX_CONFIG.

Missing includes.
	* tests/calc.at, tests/named-refs.at: Include assert.h.
2012-02-21 15:42:13 +01:00
Akim Demaille
d0f2b7f856 maint: avoid "magic number exit".
* cfg.mk (local-checks-to-skip): No longer skip it.
	* bootstrap.conf (gnulib_modules): Add sysexits.
	* doc/bison.texinfo, etc/bench.pl.in, src/parse-gram.y,
	* src/system.h, tests/calc.at, tests/named-refs.at: Use assert
	where appropriate instead of "if (...) exit".
	Use symbolic exit status elsewhere.
2012-02-18 19:32:18 +01:00
Akim Demaille
3b4d62d526 maint: remove obsolete file.
* etc/make-ChangeLogs: Remove (used for rcs to cvs migration!).
	Reported by Tys Lefering.
2012-02-14 20:08:11 +01:00
Jim Meyering
219139f521 build: generalize etc/prefix-gnulib-mk
This script hard-coded "libbison" and lib/gnulib.mk.
Adjust the script to require a --lib-name=$gnulib_name option
and a FILE argument like lib/$gnulib_mk.
Also add support for --help and --version.
* etc/prefix-gnulib-mk: Generalize.
* bootstrap.conf (bootstrap_post_import_hook): Update its invocation.
2012-01-23 09:43:19 +01:00
Jim Meyering
85ad742d4e build: manually update bootstrap from gnulib, and adapt
Updating to the latest bootstrap from gnulib involves more of a
change than usual, and updating to the latest gnulib would involve
its own set of challenges with the upcoming quoting changes, so
we update bootstrap manually and separately.
* bootstrap: Update from gnulib.
* Makefile.am: Initialize more variables to empty, so that gnulib.mk
can append to them with "+=".
* bootstrap.conf (gnulib_mk_hook): Remove.  No longer honored.
(bootstrap_post_import_hook): Instead, run the same command,
etc/prefix-gnulib-mk lib/$gnulib_mk, via slightly different API.
Temporarily disable "bootstrap_sync=true".
* etc/prefix-gnulib-mk: Don't prepend "lib/" to tokens like -I$(...
or "\".
2012-01-19 09:09:38 +01:00
Jim Meyering
34136e65fc maint: run "make update-copyright". 2012-01-13 10:09:44 +01:00
Joel E. Denny
e969014232 global: remove unnecessary horizontal tabs.
This change was made by applying emacs' untabify function to
nearly all files in Bison's repository.  Required tabs in make
files, ChangeLog, regexps, and test code were manually skipped.
Other notable exceptions and changes are listed below.
* bootstrap: Skip because we sync this with gnulib.
* data/m4sugar/foreach.m4
* data/m4sugar/m4sugar.m4: Skip because we sync these with
Autoconf.
* djgpp: Skip because I don't know how to test djgpp properly, and
this code appears to be unmaintained anyway.
* README-hacking (Hacking): Specify that tabs should be avoided
where not required.
2011-07-24 18:13:05 -04:00
Joel E. Denny
575619af5e maint: run "make update-copyright". 2011-01-02 10:02:43 -05:00
Paul Eggert
95aed8db15 Adjust to recent changes to gnulib bootstrap.
* .cvsignore, build-aux/.cvsignore, doc/.cvsignore, etc/.cvsignore:
* examples/calc++/.cvsignore, lib/.cvsignore, m4/.cvsignore:
* po/.cvsignore, runtime-po/.cvsignore, src/.cvsignore:
* tests/.cvsignore: Remove; I don't use CVS to maintain Bison
anymore and don't know of anybody else who does.  If someone needs
these files, they can resurrect them.
* .gitignore, build-aux/.gitignore, doc/.gitignore, lib/.gitignore:
* m4/.gitignore, po/.gitignore, runtime-po/.gitignore:
Omit leading '/', since bootstrap omits it.
Adjust file names to match current contents better.
* bootstrap: Sync from gnulib: this contains the new gnulib_mk_hook
installed just for us.
* bootstrap.conf (excluded_files): Don't exclude codeset.m4,
glibc21.m4, inttypes_h.m4, size_max.m4, xsize.m4, as they are now
needed somehow.  Don't have time to look into why.
(gnulib_modules): Change malloc to malloc-gnu.  Do we really assume
the GNU malloc behavior, where malloc (0) != NULL unless we're
out of storage?  If not, we can omit malloc-gnu; but for now I left
it in to be safe.
(vc_ignore): Remove.
(gnulib_mk_hook): New function.
* README-hacking: Renamed from HACKING, since gnulib bootstrap now
uses that convention.
2010-10-08 11:11:51 -07:00
Paul Eggert
7d424de14c Do not use date ranges in copyright notices.
See http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices

* HACKING, Makefile.am, NEWS, PACKAGING, README, README-alpha:
* TODO, bootstrap, bootstrap.conf:
* build-aux/update-b4-copyright, cfg.mk, configure.ac:
* data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4:
* data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc:
* data/java-skel.m4, data/java.m4, data/lalr1.cc:
* data/lalr1.java, data/local.mk, data/location.cc:
* data/stack.hh, data/variant.hh, data/xslt/bison.xsl:
* data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl:
* data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint:
* djgpp/README.in, djgpp/config.bat, djgpp/config.sed:
* djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat:
* djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h:
* djgpp/testsuite.sed, doc/bison.texinfo, doc/local.mk:
* doc/refcard.tex, etc/README, etc/bench.pl.in, etc/local.mk:
* examples/calc++/Makefile.am, examples/extexi:
* examples/local.mk, lib/abitset.c, lib/abitset.h:
* lib/bbitset.h, lib/bitset.c, lib/bitset.h:
* lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
* lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
* lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
* lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
* lib/libiberty.h, lib/local.mk, lib/main.c, lib/timevar.c:
* lib/timevar.def, lib/timevar.h, lib/vbitset.c:
* lib/vbitset.h, lib/yyerror.c, m4/bison-i18n.m4:
* m4/c-working.m4, m4/cxx.m4, m4/subpipe.m4, m4/timevar.m4:
* src/AnnotationList.c, src/AnnotationList.h:
* src/InadequacyList.c, src/InadequacyList.h, src/LR0.c:
* src/LR0.h, src/Sbitset.c, src/Sbitset.h, src/assoc.c:
* src/assoc.h, src/closure.c, src/closure.h, src/complain.c:
* src/complain.h, src/conflicts.c, src/conflicts.h:
* src/derives.c, src/derives.h, src/files.c, src/files.h:
* src/flex-scanner.h, src/getargs.c, src/getargs.h:
* src/gram.c, src/gram.h, src/graphviz.c, src/ielr.c:
* src/ielr.h, src/lalr.c, src/lalr.h, src/local.mk:
* src/location.c, src/location.h, src/main.c:
* src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c:
* src/named-ref.h, src/nullable.c, src/nullable.h:
* src/output.c, src/output.h, src/parse-gram.y:
* src/print-xml.c, src/print-xml.h, src/print.c, src/print.h:
* src/print_graph.c, src/print_graph.h, src/reader.c:
* src/reader.h, src/reduce.c, src/reduce.h, src/relation.c:
* src/relation.h, src/scan-code.h, src/scan-code.l:
* src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
* src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
* src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
* src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
* tests/actions.at, tests/atlocal.in, tests/c++.at:
* tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
* tests/existing.at, tests/glr-regression.at:
* tests/headers.at, tests/input.at, tests/java.at:
* tests/local.at, tests/local.mk, tests/named-refs.at:
* tests/output.at, tests/push.at, tests/reduce.at:
* tests/regression.at, tests/sets.at, tests/skeletons.at:
* tests/synclines.at, tests/testsuite.at, tests/torture.at:
Don't use date ranges in copyright notices.

Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010 Free Software Foundation, Inc.
2010-06-17 23:16:36 -07:00
Joel E. Denny
8b9e021fd1 portability: fix spawning on at least FreeBSD 8 and FreeBSD 9.
Reported by Johan van Selst at
<http://lists.gnu.org/archive/html/bug-bison/2010-03/msg00014.html>.
* NEWS (2.4.3): New.
* THANKS (Johan van Selst): Add.
* etc/prefix-gnulib-mk (prefix): Adjust regex for makefile
targets so that gnulib's new c++defs.h is matched.
* gnulib: Update to latest.
(cherry picked from commit 311b2e56ea)

Conflicts:

	NEWS
2010-03-23 12:38:24 -04:00
Joel E. Denny
e141f4d4bb maint: run "make update-copyright" 2010-01-04 13:47:36 -05:00
Joel E. Denny
75f94c6ddf gnulib: update for fix of fprintf-posix, which we'll use soon.
* etc/prefix-gnulib-mk (prefix): Adjust regex for make file
targets so that gnulib's new arg-nonnull.h and link-warning.h
are matched.
* gnulib: Update.
2009-12-15 17:22:15 -05:00
Joel E. Denny
37318e2fe9 benchmarks: use %debug consistently among grammars.
* etc/bench.pl.in (generate_grammar_triangular): Do not activate
%debug by default.  It can affect the timings even if yydebug=0.
(generate_grammar_calc): For consistency with other grammars,
use YYDEBUG environment variable to set yydebug.
2009-10-04 14:35:12 -04:00
Akim Demaille
d1b55e8115 gnulib: improve prefixing.
* configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
	change the value of...
	(gl_LIBOBJS): this.
	Adjust more variables.
	* etc/prefix-gnulib-mk (prefix_assignment): Don't rename
	gl_LIBOBJS.
	(prefix): Also transform rules whose targets have slashes.
	Use $prefix liberally.
	Map @MKDIR_P@ to $(MKDIR_P).
	Prefix directories that are mkdir'd.
2009-08-12 16:30:43 +02:00
Joel E. Denny
401b73afdf maint: run "make update-copyright" 2009-08-06 19:17:44 -04:00
Joel E. Denny
6721294104 Convert underscores to dashes in some %define variable names.
For now, just api.push-pull and lr.keep-unreachable-states.
Maintain old names for backward compatibility.
* NEWS (2.5): Document.
* data/c.m4 (b4_identification): Update comment.
* data/yacc.c: Update access.
* doc/bison.texinfo: Update.
* etc/bench.pl.in (bench_push_parser): Update use.
* src/files.c (tr): Move to...
* src/getargs.c, src/getargs.h (tr): ... here because I can't
think of a better place to expose it.  My logic is that, for all
uses of tr so far, command-line arguments can be involved, and
getargs.h is already included.
* src/main.c (main): Update access.
* src/muscle_tab.c (muscle_percent_define_insert): Convert old
variable names to new variable names before assigning value.
* src/reader.c (reader): Update setting default.
* tests/calc.at: Update uses.
* tests/conflicts.at (Unreachable States After Conflict
Resolution): Update use.
* tests/input.at (%define enum variables): Update use.
(%define backward compatibility): New test group.
* tests/push.at: Update uses.
* tests/reduce.at: Update uses.
* tests/torture.at: Update uses.
(cherry picked from commit 812775a039)

Conflicts:

	data/c.m4
	etc/bench.pl.in
	src/parse-gram.c
	src/parse-gram.h
	tests/conflicts.at
2009-04-30 03:43:58 -04:00
Akim Demaille
11c073b7e5 gnulib: update.
* gnulib: Update to latest.
	* src/local.mk (AM_CFLAGS): Move to...
	* Makefile.am: here.
	* etc/prefix-gnulib-mk (prefix_assignment): Also transform
	AM_CFLAGS.
2009-03-27 07:23:53 +01:00
Akim Demaille
07a6e87d46 Style changes.
* etc/bench.pl.in (generate_grammar_list): Consitently use
	location_type, not yy::location.
2009-02-25 23:31:34 +01:00
Akim Demaille
feda5527b3 Convert lib/Makefile.am into lib/local.mk.
The real problem is rather gnulib.mk, which itself is extracted from a
Makefile.am that gnulib expects to the "recursive".  The tool
prefix-gnulib-mk converts such a gnulib.mk to be non-recursive.  Also,
some AC_SUBST variables need to be adjusted.

	* etc/prefix-gnulib-mk: New.
	* bootstrap (slurp): Use it to convert further gnulib.mk.
	* lib/Makefile.am: Rename as...
	* lib/local.mk: this.
	Adjust to be prefixed.
	* Makefile.am, configure.ac: Adjust.
	* src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
2008-11-26 11:09:19 +01:00
Akim Demaille
932b0c960a Get rid of lalr1-split.cc.
It was no longer maintainer.

	* data/lalr1-split.cc: Remove.
	* etc/bench.pl.in (bench_fusion_parser): Remove.
	Adjust.
2008-11-26 09:48:24 +01:00
Akim Demaille
c5fc95d688 Update ignores.
* data/.cvsignore, data/.gitignore, examples/.cvsignore,
	* examples/.gitignore:
	Remove.
	* build-aux/.cvsignore, build-aux/.gitignore, doc/.cvsignore,
	* doc/.gitignore, etc/.cvsignore, etc/.gitignore, src/.cvsignore,
	* src/.gitignore, tests/.cvsignore, tests/.gitignore:
	Remove MAkefile and Makefile.in.
2008-11-16 19:46:16 +01:00
Akim Demaille
4fc55348e5 Simplify code for variants bench marks.
* etc/bench.pl.in (&generate_grammar_list): Define and use
	location_type.
	Factor the common code in yylex.
2008-11-15 14:17:15 +01:00
Akim Demaille
b0d79ec65d Comment changes.
* data/local.mk, etc/local.mk, examples/local.mk: Use Automake
	comments for the license.
2008-11-15 11:23:53 +01:00
Akim Demaille
7cb794dcdd Remove etc/Makefile.am.
* etc/Makefile.am: Rename as...
	* etc/local.mk: this.
	Adjust.
	* Makefile.am, configure.ac: Adjust.
2008-11-15 10:34:53 +01:00
Akim Demaille
fe1b448ada Instead of using make_symbol<TOK_FOO>, generate make_FOO for each token type.
Using template buys us nothing, and makes it uselessly complex to
construct a symbol.  Besides, it could not be generalized to other
languages, while make_FOO would work in C/Java etc.

	* data/lalr1.cc (b4_symbol_): New.
	(b4_symbol): Use it.
	(b4_symbol_constructor_declaration_)
	(b4_symbol_constructor_definition_): Instead of generating
	specializations of an overloaded template function, just generate
	several functions whose names are forged from the token names
	without the token.prefix.
	(b4_symbol_constructor_declarations): Generate them for all the
	symbols, not just by class of symbol type, now that instead of
	specializing a function template by the token, we generate a
	function named after the token.
	(b4_symbol_constructor_specialization_)
	(b4_symbol_constructor_specializations): Remove.
	* etc/bench.pl.in: Adjust to this new API.
2008-11-15 10:20:02 +01:00
Akim Demaille
0927787504 Make it possible to return a symbol_type from yylex.
* data/lalr1.cc (b4_lex_symbol_if): New.
	(parse): When lex_symbol is defined, expected yylex to return the
	complete lookahead.
	* etc/bench.pl.in (generate_grammar_list): Extend to support this
	yylex interface.
	(bench_variant_parser): Exercise it.
2008-11-11 15:48:52 +01:00
Akim Demaille
64c1b92a4f Remove useless bench case.
* etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
	no longer used.
2008-11-11 15:45:45 +01:00
Akim Demaille
2722aa42bd Improve display of directives.
* etc/bench.pl.in (parse_term): Don't add useless eol.
2008-11-11 15:42:40 +01:00
Akim Demaille
918eb7c5ae Use string_cast in the bench.
* etc/bench.pl.in (generate_grammar_list): Define and use
	string_cast.
2008-11-11 15:39:28 +01:00
Akim Demaille
fce629c0ef Bench: syntactic sugar for %define/#define.
* etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
	(&bench_push_parser, bench_variant_parser): Use this feature.
	(&eat): New.
	Use it.
2008-11-11 15:23:13 +01:00
Akim Demaille
ce6719605b Less memory pressure on the "list" bench.
* etc/bench.pl.in (generate_grammar_list): Do not accumulate all
	the values, to limit memory pressure.
2008-11-11 15:20:03 +01:00
Akim Demaille
c17f9a4a62 Shortcuts in bench directives.
* etc/bench.pl.in (parse_dirs): New.
	Use it.
	(bench_variant_parser, bench_fusion_parser): Use %s and %d.
	Create the benches in "benches/".
2008-11-10 11:35:54 +01:00
Akim Demaille
6e0977873a Adjust verbose message to using emacs.
* etc/bench.pl.in: Inform compilation-mode when we change the
	directory.
	(generate_grammar_list): Recognize %define "variant" in addition
	to %define variant.
2008-11-10 11:29:06 +01:00
Akim Demaille
c85be41a07 Make benches in a sub dirs.
* etc/bench.pl.in ($dir): New.
	Use it.
	Check the use of constructors with an argument.
	(bench_variant_parser): Fix.
2008-11-09 20:57:06 +01:00
Akim Demaille
db65ca1f12 fix eof condition 2008-11-09 20:54:03 +01:00
Akim Demaille
9b0efa5bc2 Fix --help. 2008-11-09 20:50:39 +01:00
Akim Demaille
f10e19fd1a Enhance bench.pl.
* etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
	(@token, $grammar, $bench): New.
	(generate_grammar_variant): Rename as...
	(generate_grammar_list): this.
	(generate_grammar): Adjust.
	(bench_grammar): Rename as...
	(bench): this.
	Use it in the various bench-marking routines.
	(-b, -g): New options.
2008-11-09 20:00:29 +01:00
Akim Demaille
757f8f98fc bench.pl -d, --directive.
* etc/bench.pl.in (@directive): New.
	(&bench_grammar): Use it.
	(&bench_list_grammar): New, to provide access to the "variant"
	grammar.
	Use it.
	(getopts): Support -d, --directive.
2008-11-09 19:54:29 +01:00
Akim Demaille
8901f32e4a The single-stack C++ parser is now the standard one.
* data/lalr1.cc: Rename as...
	* data/lalr1-split.cc: this.
	* data/lalr1-fusion.cc: Rename as...
	* data/lalr1.cc: this.
	* etc/bench.pl.in: Adjust.
2008-11-07 21:38:45 +01:00
Akim Demaille
2d32fc9fe2 Add "%define assert" to variants.
This is used to help the user catch cases where some value gets
ovewritten by a new one.  This should not happen, as this will
probably leak.

Unfortunately this uncovered a bug in the C++ parser itself: the
lookahead value was not destroyed between two calls to yylex.  For
instance if the previous lookahead was a std::string, and then an int,
then the value of the std::string was correctly taken (i.e., the
lookahead was now an empty string), but std::string structure itself
was not reclaimed.

This is now done in variant::build(other&) (which is used to take the
value of the lookahead): other is not only stolen from its value, it
is also destroyed.  This incurs a new performance penalty of a few
percent, and union becomes faster again.

	* data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
	(b4_variant_if): New.
	(variant::built): New.
	Use it whereever the status of the variant changes.
	* etc/bench.pl.in: Check the penalty of %define assert.
2008-11-07 21:38:06 +01:00
Akim Demaille
f6038cb8c3 Use "%define variant" in bench.pl.
* etc/bench.pl.in: No longer use the pseudo directive %variants,
	just use %define variants.
2008-11-07 21:37:56 +01:00
Akim Demaille
3a2803df74 Use strict on bench.pl.
* etc/bench.pl.in (&run, &generate_grammar): New.
	Rename the grammar generating functions for consistency.
	Change the interface so that the list of benches to run is passed
	as (optionless) arguments.
	(&compile): Use &run.
2008-11-04 21:43:41 +01:00
Akim Demaille
cac9e09bbf Improve the display of sizes.
* etc/bench.p.in: Higher precision.
	Sort by decreasing size.
2008-11-04 21:43:32 +01:00
Akim Demaille
ef05c4d6f9 Better defaults for bench.pl.
* etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
	default values.
	Adjust &verbose uses.
	(-q, --quiet): New.
2008-11-04 21:43:24 +01:00
Akim Demaille
a6df593dfe bench.pl --bench.
* etc/bench.pl.in (--bench, $bench): New.
2008-11-04 21:43:05 +01:00
Akim Demaille
429b4848d4 Bench the three-stack lalr1.cc.
* etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
	one-stack one.
2008-11-03 22:01:06 +01:00
Akim Demaille
0cc5bead40 bench: Improve output.
* etc/bench.pl.in (bench_grammar): Tune the printf format.
2008-11-03 22:00:53 +01:00
Akim Demaille
5b421a4e8e bench: check impact of %debug on variants.
* etc/bench.pl.in (variant_grammar): Fix the computation of
	$variant.
	Generate a grammar file that can work with or without %debug.
	Do use the @directive.
	(bench_variant_parser): Check impact of %debug.
	(@directives): Rename all the occurrences to...
	(@directive): this, for consistency.
2008-11-03 22:00:48 +01:00
Akim Demaille
d11ee647c3 bench: report the size too.
* etc/bench.pl.in ($iterations): Defaults to -3.
	(&bench_grammar): Require hireswallclock.
	Compute and display the size of the result.
	More comments.
2008-11-03 22:00:44 +01:00