Commit Graph

3950 Commits

Author SHA1 Message Date
Akim Demaille
e29f0771d7 maint: formatting changes.
* NEWS: Fix indentation of code snippets.
Untabify.
2012-06-19 17:01:35 +02:00
Akim Demaille
71c7e24f2e tests: support api.prefix.
* tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
Define AT_API_PREFIX.
(AT_YYERROR_DEFINE, AT_YYERROR_DECLARE_EXTERN, AT_YYLEX_DECLARE_EXTERN)
(AT_YYLEX_DEFINE): Use it.
* tests/input.at, tests/regression.at, tests/torture.at: Add
AT_BISON_OPTION_PUSHDEFS/POPDEFS.
2012-06-17 19:37:07 +02:00
Akim Demaille
5f7f1e210b tests: pacify font-lock-mode.
* tests/local.at: here.
2012-06-17 19:37:07 +02:00
Akim Demaille
eb83259dc1 tests: remove test covered elsewhere.
* tests/headers.at (%union and --defines): Remove, pretty useless and
insignificant.
2012-06-17 19:37:07 +02:00
Akim Demaille
55f48c4831 tests: factor the declaration/definition of yyerror and yylex.
* tests/local.at (AT_YYERROR_DECLARE, AT_YYERROR_DECLARE_EXTERN)
(AT_YYERROR_DEFINE, AT_YYLEX_DECLARE, AT_YYLEX_DECLARE_EXTERN)
(AT_YYLEX_DEFINE): New.
Must be used inside AT_BISON_OPTION_PUSHDEFS/POPDEFS pair.
* tests/actions.at, tests/conflicts.at, tests/glr-regression.at,
* tests/headers.at, tests/input.at, tests/named-refs.at,
* tests/regression.at, tests/skeletons.at, tests/synclines.at,
* tests/torture.at: Use them.
2012-06-17 19:37:07 +02:00
Akim Demaille
34d867d7d2 regen. 2012-06-17 12:13:20 +02:00
Akim Demaille
363bf73276 tests: portability issues.
* tests/calc.at (AT_CALC_MAIN): Missing include reported by Hydra.
2012-06-17 11:20:21 +02:00
Akim Demaille
c8c220d19a tests: call the parser from another compilation unit.
In order to improve the testing of %defines, which exports the
interface of the generated parser, change the calc.at tests so that
when %defines is passed, main will be in another compilation unit.  It
loads the generated header.

* tests/calc.at (AT_CALC_MAIN): New.
Includes the definition of the global variables.
Therefore, now declare them from the %requires section of the parser.
Adjust to yydebug and yyparse being renamed by %name-prefix.
2012-06-15 15:39:19 +02:00
Akim Demaille
56ca3d8fce glr.c, yacc.c: declare yydebug in the header.
* data/c.m4 (b4_declare_yydebug): New.
* data/glr.c, data/yacc.c (b4_shared_declarations): Use it.
Remove the corresponding code from the parser body.
* NEWS: Doc this.
2012-06-15 15:33:14 +02:00
Akim Demaille
c3e9f08f93 skeletons: use header guards.
* data/glr.c, data/glr.cc, data/yacc.c: here.
* NEWS: Document it.
2012-06-15 15:33:14 +02:00
Akim Demaille
6aef2e01a4 tests: improve AT_FULL_COMPILE.
* tests/local.at: Accept a third argument.
Simplify quotation pattern.
Calls for better refactoring, but will suffice for a while.
2012-06-15 15:20:53 +02:00
Akim Demaille
3d8082ad27 tests: reorder.
* tests/calc.at (power): Move its definition, as a preparation for
forthcoming changes.
And space changes.
2012-06-15 13:36:01 +02:00
Akim Demaille
9d67a52ad6 tests: strengthen the test on generated headers inclusion
* tests/headers.at (AT_TEST_CPP_GUARD_H): Accept Bison directives.
(Invalid CPP headers): Check glr.
2012-06-15 13:31:59 +02:00
Akim Demaille
0f11eec272 yacc.c: instead of duplicating y.tab.h inside y.tac.c, include it.
This is already what glr.c and lalr1.cc do.

* data/yacc.c: here.
2012-06-15 13:31:34 +02:00
Akim Demaille
ae6bdabbf6 yacc.c: factor.
yacc.c used to include two almost identical sections: one for the *.h
file, and another for the *.c file.  The main difference is that in
the *.c file we used the yy* names (as %name-prefix is handled by
"#define yy* <prefix>*" before), while the *.hh used <prefix>* names.
Keep only the later.  If this is troublesome, b4_shared_declarations
can easily take the desired prefix as argument.

* data/yacc.c (b4_shared_declarations): New.
Use it to factor duplicated declarations.
2012-06-13 21:52:38 +02:00
Akim Demaille
c0828abf9d skeletons: factor yacc.c and glr.c.
yacc.c and glr.c share common declarations.  Their YYLTYPE are exactly
equal, and their YYSTYPE are sufficiently alike to be fused (its
declaration was protected by YYSTYPE_IS_DECLARED in yacc.c, but not in
glr.c).  Besides, yacc.c duplicated the definitions of YYLTYPE and
YYSTYPE (*.h/*.c).

* data/c.m4 (b4_declare_yylstype): New.
* data/yacc.c, data/glr.c: Use it.
2012-06-12 14:49:48 +02:00
Akim Demaille
e9807a7934 glr.c: minor refactoring.
* data/glr.c (b4_shared_declarations): Move from the generated file
section, to the M4 prologue.
2012-06-12 14:49:48 +02:00
Akim Demaille
02287ec650 tests: remove all the -On flags.
* tests/atlocal.in: Here.
Reported by Gilles Espinasse.
2012-06-12 14:49:48 +02:00
Akim Demaille
6537c71fcc maint: fix spello.
* README-hacking: Here.
* THANKS: Reported by Gilles Espinasse.
2012-06-12 14:49:48 +02:00
Akim Demaille
6733d02476 maint: improve release procedure instructions.
* gnulib: Update, in particular (README-release).
* bootstrap.conf: don't require gendocs, provided by gnu-web-doc-update,
provided by readme-release.
* README-hacking: Update accordingly.
2012-06-12 14:49:15 +02:00
Akim Demaille
cc9fb4f6b6 gnulib: update readme-release.
* gnulib (readme-release): Now includes the modules it promotes.
* bootstrap.conf: Simplify accordingly.
2012-06-07 11:15:04 +02:00
Akim Demaille
f763e6ef67 maint: cfg.mk: manual title.
* cfg.mk (manuel_title): New.
2012-06-07 11:15:04 +02:00
Akim Demaille
c4576b484a maint: cfg.mk: simplify
* cfg.mk: Remove bits provided by maint.mk.
2012-06-07 11:15:04 +02:00
Akim Demaille
91aadcc7a9 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2012-06-07 11:15:04 +02:00
Akim Demaille
dfaac27242 version 2.5.1
* NEWS: Record release date.
v2.5.1
2012-06-05 10:03:25 +02:00
Akim Demaille
ed7658fe17 NEWS: prepare for 2.5.1.
* NEWS: Be compliant with do-release-commit-and-tag.
2012-06-05 10:02:17 +02:00
Akim Demaille
4d4777c786 maint: update release procedure
* bootstrap.conf: Request do-release-commit-and-tag and readme-release.
* README-hacking: Adjust.
2012-06-05 09:24:43 +02:00
Jim Meyering
cbdb6d9145 maint: fix comment typos
Using http://github.com/lyda/misspell-check, massage its
output into sed commands to perform the suggested changes.
Initially, I filtered out the THRU->Through changes, because
that failed to retain capitalization in the grammar token.
Instead, do this manually, beforehand:

sed -i s/THRU/THROUGH/ tests/existing.at
git ls-files|misspellings -f -|perl -nl \
  -e '/^(.*?)\[(\d+)\]: (\w+) -> "(.*?)"$/ or next;' \
  -e '($file,$n,$l,$r)=($1,$2,$3,$4); $q="'\''"; $r=~s/$q/$q\\$q$q/g;'\
  -e 'print "sed -i $q${n}s!$l!$r!$q $file"'|bash
2012-06-05 09:17:43 +02:00
Akim Demaille
6a4f5c6ea0 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2012-05-23 14:41:37 +02:00
Akim Demaille
3cd7c0bfce Bison 2.5.1_rc2.
* NEWS: Update.
v2.5.1_rc2
2012-05-23 14:30:22 +02:00
Akim Demaille
188867ac65 doc: fixes.
* doc/bison.texinfo: Fix errors spotted by syntax-check.
2012-05-23 14:24:30 +02:00
Akim Demaille
3f32a0d287 build: fix ChangeLog generation.
* gnulib: Update to get newest gitlog-to-changelog.
* bootstrap: Update.
* Makefile.am (gen-ChangeLog): Fix for Bison's git log style.
2012-05-23 14:24:30 +02:00
Akim Demaille
22172d4731 c++: compute the header guards.
This is a frequent request.  Recently pointed out by Wei Song,
<http://lists.gnu.org/archive/html/help-bison/2012-05/msg00002.html>.

* data/c.m4 (b4_tocpp, b4_cpp_guard, b4_cpp_guard_open)
(b4_cpp_guard_close): New.
* data/lalr1.cc, data/location.cc, data/stack.hh: Use them.
* TODO (Header Guards): Move to...
* NEWS: here.
Formatting changes.
2012-05-21 18:15:41 +02:00
Akim Demaille
a19728cbb5 skeletons: remove support for unused directive.
* src/scan-skel.l (@dir_prefix@): Remove support, has never been
used, not even in the commit that introduced it,
2b81e969ea.
2012-05-21 16:07:34 +02:00
Akim Demaille
03f1b545b9 lalr1.cc: improve Doxygen documentation.
* data/location.cc: Qualify file names with directory name.
2012-05-21 16:07:34 +02:00
Akim Demaille
a9b67b5b1e lalr1.cc: extract stack.hh.
See commit 51bacae6b5.
* data/stack.hh: New, extracted from...
* data/lalr1.cc: here.
* data/Makefile.am: Adjust.
2012-05-21 16:07:34 +02:00
Akim Demaille
e4ab12542b news: convert to double quotes.
* NEWS: Convert from `quoted' to "quoted".
Reported by Stefano Lattarini.
http://lists.gnu.org/archive/html/bison-patches/2012-05/msg00039.html
2012-05-21 16:07:34 +02:00
Akim Demaille
08f6341c01 space changes.
* src/flex-scanner.h: Indent nested cpp directives.
2012-05-21 14:48:52 +02:00
Akim Demaille
86b08b49b3 build: do not prototype flex-generated functions.
Some versions of Flex, possibly modified by the distribution package
maintainers, have incompatible signatures.  Since newer versions of
Flex prototype their functions, avoid the conflicts in that case.
Reported by Stefano Lattarini.
<http://lists.gnu.org/archive/html/bug-bison/2012-05/msg00012.html>.

* src/flex-scanner.h (FLEX_VERSION_GT): New.
Use it to issue prototypes for flex-generated functions only for
versions up to 2.5.31, in accordance with the comment.
See commit dc9701e848.
Use it to define yylex_destroy when needed.
2012-05-21 14:48:52 +02:00
Akim Demaille
7fb72c6e53 build: fix ChangeLog generation.
* Makefile.am (gen-ChangeLog): Fix for VPATH builds.
2012-05-16 10:36:13 +02:00
Akim Demaille
1ef57c947d Bison 2.5.1_rc1.
* NEWS: Update.
* src/parse-gram.c, src/parse-gram.h: Regen.
2012-05-14 14:29:36 +02:00
Akim Demaille
035810ed2e tests: save/restore Autotest special files when checking XML support.
Currently the test 248, "parse-gram.y: LALR = IELR", fails
BISON_TEST_XML is set.

* tests/local.at (AT_BISON_CHECK_XML): Belt: Save/restore files.
* tests/regression.at (parse-gram.y: LALR = IELR): Suspenders: Don't
rely on expout.
Each one of these changes suffices.
2012-05-11 17:13:48 +02:00
Akim Demaille
5192fd5d50 tests: AT_SAVE_SPECIAL_FILES / AT_RESTORE_SPECIAL_FILES.
Some of our macros play with expout and other Autotest special files,
which may break their callers (e.g., currently TESTSUITEFLAGS='248
BISON_TEST_XML=1' fails).

There is already some support for this.  Expand it to be ready to use
it elsewhere.

* tests/local.at (AT_RESTORE_SPECIAL_FILES, AT_SAVE_SPECIAL_FILES)
(at_save_special_files, at_restore_special_files): New.
(AT_BISON_CHECK_NO_XML): Use them.
2012-05-11 17:06:18 +02:00
Akim Demaille
7f7fdba418 tests: honor TESTSUITEFLAGS in all the check targets.
* tests/Makefile.am (installcheck-local): Simplify.
(maintainer-check-posix, maintainer-check-valgrind): Honor
$(TESTSUITEFLAGS).
2012-05-11 15:06:58 +02:00
Akim Demaille
7e3510e6dd build: do not enable c++ warnings on 0 when nullptr is not supported.
* configure.ac (WARN_CXXFLAGS): Enable -Wzero-as-null-pointer-constant
only when nullptr is supported..
2012-05-11 09:26:09 +02:00
Akim Demaille
b2c4c25d4a maint: update gnulib.
* bootstrap, gnulib: Update.
2012-05-11 09:26:09 +02:00
Akim Demaille
91fd2b60b6 build: config.in.h.
Historically we used config.hin (where everybody else used
config.h.in) to please DOS.  Now that we use gnulib, there are already
tons of files with several dots, especially *.in.h.

* configure.ac: Rename config.hin as config.in.h.
2012-05-09 11:21:34 +02:00
Akim Demaille
08ab0101bd build: move silent rules.
* tests/Makefile.am: In the generation of the test suite.
2012-05-09 10:44:24 +02:00
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