Commit Graph

3752 Commits

Author SHA1 Message Date
Akim Demaille
aebb55eb92 glr.c: reduce variable scopes.
* data/glr.c: Where appropriate, fuse variable declarations followed
by assignments by variable declarations with a value.
Where appropriate, introduce new scopes to limit variable spans.
2012-05-09 10:44:23 +02:00
Akim Demaille
a0cd287e64 maint: maintainer-release-check.
* tests/Makefile.am (maintainer-release-check): New.
* Makefile.am (MAINTAINER_CHECKS): New.
Support maintainer-release-check.
* README-hacking: Document it, and syntax-check too.
2012-05-08 12:07:29 +02:00
Akim Demaille
dc584206f9 maint: shush a syntax-check.
* cfg.mk: lib/timevar is not planned to be gnulib'ed, as it comes
from GCC.
2012-05-08 12:07:29 +02:00
Akim Demaille
7de42e52bf maint: prefer "commit message" to "log entry".
* README-hacking: here.
Suggested by Stefano Lattarini.
2012-05-08 12:07:29 +02:00
Akim Demaille
0b7fba1335 command line: fix minor leaks.
* src/getargs.c (getargs): Free pointers before allocating them new
content.
2012-05-08 10:27:34 +02:00
Akim Demaille
e2eb03d4e9 maint: we no longer maintain the ChangeLog.
* .gitattributes: No need to merge it.
* README-hacking: Update release instructions.
2012-05-08 10:17:46 +02:00
Akim Demaille
db0054f7e6 maint: fix the generation of the synclines for bison's parser.
* tests/bison.in: Import from master the changes that make
this script generate synclines that are independant of the
builddir/srcdir user's set up.
2012-05-06 10:38:29 +02:00
Akim Demaille
45aab21d77 maint: regen.
* src/parse-gram.c, src/parse-gram.h: Regen.
2012-05-06 10:29:43 +02:00
Akim Demaille
e54ec80c0c maint: import the xmemdup0 gnulib module.
* bootstrap.conf: Require this module.
* src/parse-gram.y: Include xmemdup0.h.
2012-05-06 10:20:43 +02:00
Akim Demaille
85557aa1cb maint: remove left-over gnulib modules.
* bootstrap.conf (gnulib_modules): Remove pipe-posix.
* lib/.gitignore, m4/.gitignore: Remove files that we no longer use.
2012-05-06 10:08:18 +02:00
Akim Demaille
47dcfd5a5c maint: ignore files imported by autopoint.
* m4/.gitignore: here.
2012-05-06 10:08:18 +02:00
Akim Demaille
355e5a7255 build: AC_PROG_LEX: use more readable variable names.
* m4/flex.m4 (AC_PROG_LEX): Prefer LEX_IS_FLEX to FLEX.
Prefer true/false to yes/no for such variables.
* configure.ac: Adjust.
2012-05-06 10:08:18 +02:00
Jim Meyering
9c883a6bb0 maint: regen src/parse-gram.[ch] 2012-05-06 09:30:52 +02:00
Jim Meyering
60457f308d maint: simplify parse-gram.y
* src/parse-gram.y (add_param): Use xmemdup0 in place of
xmalloc+memcpy, and strspn in place of an open-coded loop.

Co-authored-by: Akim Demaille <akim@lrde.epita.fr>
2012-05-06 09:29:36 +02:00
Jim Meyering
bb3b912b0a maint: s/strncpy/memcpy/, when equivalent
* src/output.c (output_skeleton): Use memcpy, not strncpy,
since the source is known to fit in the destination buffer.
* src/parse-gram.y (%skeleton): Likewise.
2012-05-06 09:13:51 +02:00
Akim Demaille
7020e5f050 glr.c: untabify.
* data/glr.c: here.
2012-05-04 14:53:49 +02:00
Akim Demaille
dd8d335174 glr.cc: untabify.
* data/glr.cc: here.
2012-05-04 14:53:49 +02:00
Akim Demaille
021a7cfb3e glr.cc: formatting changes.
* data/glr.cc: Fit in 80 columns.
2012-05-04 14:53:49 +02:00
Akim Demaille
30bc96ceca glr.cc: remove unused signature.
* data/glr.cc (yydestruct_): Not used, remove.
It is yydestruct which is used.
2012-05-04 14:53:49 +02:00
Akim Demaille
78ab351c4f glr.cc: properly declare locations are const where appropriate.
* data/glr.cc (yyerror): The location is const.
2012-05-04 14:53:48 +02:00
Akim Demaille
15cd62c2c1 doc: fix @xref.
* doc/bison.texinfo: here.
2012-05-04 14:53:48 +02:00
Akim Demaille
95e343fea3 tests: ignore code coverage/profiling failure messages
The Hydra buildfarm provides code coverage analysis.  For some reason,
in some test cases, code coverage data seem to be incompatible, and
generate error messages at parser run-time.  Ignore these messages so
that (i) these tests do pass, (ii) coverage results be provided by
Hydra.

* tests/local.at (AT_PARSER_CHECK): Ignore messages for failed merges
of code coverage/profiling results.
2012-05-02 17:32:53 +02:00
Akim Demaille
2ba031129a doc: fix some invalid @ref.
* doc/bison.texinfo: Fix incorrect @ref uses.
(cherry picked from commit e3fd1dcb8b)
2012-04-16 19:20:38 +02:00
Akim Demaille
fbca8023ed build: fix previous commit.
* bootstrap: Update from gnulib.
2012-04-16 19:18:58 +02:00
Akim Demaille
8ef26c2aa7 install-pdf: fix.
* gnulib: Fix install-pdf in po/ and runtime-po/.
Reported by Hans Aberg.
Fixed by Joel E. Denny.
http://lists.gnu.org/archive/html/bug-bison/2011-05/msg00008.html
2012-04-16 19:12:07 +02:00
Akim Demaille
7e508a2b2d NEWS: Update.
* NEWS: Spell check.
(%printer): is now documented.
2012-04-16 17:53:15 +02:00
Akim Demaille
68fff38a09 %printer: support both yyo and yyoutput.
lalr1.cc used to support yyo, but not yyoutput.  Support both,
but document only yyoutput (at least until there is some consensus
on this).

* data/c.m4 (yy_symbol_value_print): Also support yyo.
* data/glr.cc  (yy_symbol_value_print_): Support both yyo and yyoutput.
* data/lalr1.cc: Also support yyoutput.
* doc/bison.texinfo: Explicitly use yyoutput in the examples.
* examples/mfcalc/mfcalc.test: Test the -p option.
(cherry picked from commit c50263271d)

Conflicts:

	data/c.m4
	data/lalr1.cc
	doc/bison.texinfo
	etc/Makefile.am
2012-04-16 17:34:36 +02:00
Akim Demaille
56d60c1947 doc: mfcalc: demonstrate %printer.
* doc/bison.texinfo (Printer Decl): New.
Number mfcalc.y snippets so that they are output in
the proper order.
(The mfcalc Main): Use yydebug.
(Debugging): Simplify the text.
(Enabling Traces, Mfcalc Traces, The YYPRINT Macro): New.
(Table of Symbols): Document YYPRINT and YYFPRINTF.

(cherry picked from commit 93c150b666)

Conflicts:

	doc/bison.texinfo
2012-04-16 17:18:48 +02:00
Akim Demaille
a703b669b4 tests: style changes.
* tests/input.at: Use "print" in %printer instead of "destroy".
It is unused, so we don't care, yet it is less surprising.
* tests/actions.at: Comment changes.

(cherry picked from commit abcd36ca1b)
2012-04-16 17:18:31 +02:00
Akim Demaille
10232af808 build: require Flex.
* configure.ac: Require Flex.
2012-04-10 21:37:10 +02:00
Akim Demaille
0d49053a75 build: flex.m4: check for Flex.
* m4/flex.m4 (_AC_PROG_LEX_YYTEXT_DECL): Check that $LEX
supports some of the Flex options, and exclusive start conditions.
Define FLEX to 'yes'/'', as AC_PROG_CC does for GCC.
2012-04-10 21:37:06 +02:00
Akim Demaille
a4e4295ad2 build: flex.m4: quote properly.
* m4/flex.m4: Use quotes more systematically.
2012-04-10 21:37:02 +02:00
Akim Demaille
22cd137bc9 build: flex.m4.
* m4/flex.m4: New.
An exact copy of what is in Autoconf currently.
2012-04-10 21:36:59 +02:00
Akim Demaille
3d05bae83a build: autoconf: update.
* submodules/autoconf: Update.
There are no changes in data/m4sugar/foreach.m4, and the
changes in data/m4sugar/m4sugar.m4 are minor.
2012-04-10 21:36:55 +02:00
Akim Demaille
d834eca014 glr: eliminate last bits of unwanted locations.
* data/glr.c (YYLTYPE): Do not define when locations are
not demanded.
Adjust all dependencies.
2012-04-10 13:11:51 +02:00
Akim Demaille
debe2c03c4 NEWS: 2.6 will drop K&R.
* NEWS: here.
(glr.c): Fix a spello.
2012-04-10 13:11:39 +02:00
Akim Demaille
7beac80814 TODO: remove dead items.
* TODO (Documentation, %printer, Java): Remove, already done (or just
waiting for approval).
(Fortran, BTYacc): Remove, there does not seem to be demand.
2012-04-09 15:06:13 +02:00
Akim Demaille
ff1b7a1333 TODO: import from master.
* TODO: Copy the current version.
2012-04-09 15:06:13 +02:00
Akim Demaille
163bb3698f gnulib: update.
* bootstrap.conf (bootstrap_sync): True again.
It was disabled while waiting for changes to be integrated
in gnulib's bootstrap, which was done long ago.
* bootstrap, gnulib: Update.
2012-04-07 14:57:03 +02:00
Akim Demaille
466b4cf201 maint: update NEWS.
* NEWS: Fix entry about __attribute__.
Reorder by "decreasing" order of importance.
2012-04-04 10:11:50 +02:00
Akim Demaille
34a41a93c7 doc: fix index.
http://lists.gnu.org/archive/html/bison-patches/2012-04/msg00006.html

* doc/bison.texinfo: Avoid using @def* variant with more
than the defined entity as main entity, as it results in
an incorrect index.  For instance, don't document
{return YYERROR;}, which results in a single index entry
"return YYERROR;", but rather as typed function whose
return type is "type", and whose argument list is ";".
2012-04-04 10:10:27 +02:00
Akim Demaille
4a11b85249 doc: fix documentation of YYERROR.
* doc/bison.texinfo (Table of Symbols): Fix the documentation
of YYERROR by copying that from "Action Features".
2012-04-04 10:10:27 +02:00
Akim Demaille
6557bcce8b c++: more YY_NULL
Caught by maintainer-check-g++.
* data/glr.c, data/lalr1.cc, data/yacc.c, tests/cxx-type.at,
* tests/glr-regression.at, tests/push.at:
When simple to do, avoid expliciting the null ptr.
Otherwise use YY_NULL.
(cherry picked from commit eeaf1dc646)

Conflicts:

	data/glr.c
	data/lalr1.cc
	tests/cxx-type.at
2012-04-01 14:02:27 +02:00
Akim Demaille
681dda24ba bump to 2012 in skeletons.
* data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
* data/location.cc, data/yacc.c: Bump copyright year ranges.
2012-04-01 12:16:46 +02:00
Akim Demaille
059736b7b5 build: remove ancient Autoconf tests.
lib/subpipe.c was removed in 47fa574761.

* m4/subpipe.m4: Remove.
* configure.ac (BISON_PREREQ_SUBPIPE): Remove.
2012-04-01 12:16:46 +02:00
Akim Demaille
936c88d178 doc: c++: complete the location documentation.
* data/location.cc (position::initialize, location::initialize):
Also accept line and column, with default values.
* doc/bison.texinfo (C++ position, C++ location): New nodes.
Describe more thoroughly these classes.
Fix several Texinfo misuses.
2012-03-31 12:30:10 +02:00
Akim Demaille
2091988f7e c++: locations: provide convenience constructors.
* data/location.cc (position::position): Accept file, line and
column as arguments with default values.
Always qualify initial line and column literals as unsigned.
(location::location): Provide convenience constructors.
(cherry picked from commit 0634493cdd)

Conflicts:

	ChangeLog-2012
	data/location.cc
2012-03-31 11:23:45 +02:00
Akim Demaille
2a1bd0d7fe c++: locations: remove useless "inline".
* data/location.cc: "inline" is implicit when defining
methods in the class definition.
2012-03-31 11:23:45 +02:00
Akim Demaille
769a8ef9bc glr: do not use locations when they are not requested
When the test suite runs with -O2 and warnings enabled, G++
complains of locations being used, but not initialized.
The simplest is to not use locations.

* data/glr.c (b4_locuser_formals, b4_locuser_args): New.
Use them when locations should not be used.
Use b4_locations_if where appropriate.
(yyuserAction): Modify the order to the arguments to make
it more alike the other routines, and to make use of
b4_locuser_args simpler.
2012-03-31 11:23:44 +02:00
Akim Demaille
ef51bfa744 c++: use nullptr for C++11.
C++11 introduces "nullptr" which plays the role of C's NULL, in
replacement of "0".  Fix the C++ skeletons to avoid warnings about
uses of "0" in place of "nullptr", and improve C skeletons to also use
this "nullptr" when compiled with a C++11 compiler.

* configure.ac: More C++ warnings.
* NEWS (2.5.1): Document this.
* data/c++.m4, data/c.m4 (b4_null_define): New.
(b4_null): Use YY_NULL instead of 0.
* data/glr.c, data/lalr1.cc, data/location.cc, data/yacc.c:
Call b4_null_define/b4_null where appropriate.
Use YY_NULL instead of NULL.
* data/location.cc (initialize): Accept a default argument,
YY_NULL.
* tests/actions.at, tests/calc.at: Adjust.

* data/glr.c, lib/libiberty.h, src/system.h (__attribute__):
Do not disable it when __STRICT_ANSI__ is defined, as, for
instance, it disables the __attribute__((unused)) which
protects us from some compiler warnings.
This was already done elsewhere in Bison, in 2001, see
4a0d893695.
* tests/regression.at: Adjust output.
2012-03-31 11:12:28 +02:00