Commit Graph

6226 Commits

Author SHA1 Message Date
Akim Demaille
3ae81aa338 dogfooding: use api.value.type union
* src/parse-gram.y (api.value.type): Set to union.
Replace occurrences of %union with explicit %types.
* src/scan-gram.l: Adjust yylval's field names.
(RETURN_VALUE): No longer needs the Field argument.
Use it more.
2018-11-10 17:02:50 +01:00
Akim Demaille
c239e53bab djgpp: remove
Support for DJGPP was announced to be removed in the NEWS of Bison
3.1 (2018-08-27) unless someone expressed interest.  There was no answer.

* djgpp: Remove.
* NEWS, Makefile.am, cfg.mk, po/POTFILES.in: Adjust.
2018-11-10 17:02:50 +01:00
Akim Demaille
eee37354b5 scanner: simplify use of gettext
* src/scan-gram.l (unexpected_end): Leave the actual call to gettext
to the caller.
2018-11-10 17:02:50 +01:00
Akim Demaille
be737c3dd6 style: clean up the scanner and parser
* src/scan-gram.l: Formatting changes.
Add "missing" assertion for symmetry.
* src/parse-gram.y: Formatting changes.
2018-11-10 17:02:50 +01:00
Akim Demaille
a91873a1b9 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2018-11-09 06:51:46 +01:00
Akim Demaille
b590ad0292 version 3.2.1
* NEWS: Record release date.
v3.2.1
2018-11-09 06:34:16 +01:00
Akim Demaille
05e70adf22 build: fix issues in the generated tarball
Reported by Andre da Costa Barros.
https://savannah.gnu.org/patch/?9716

* examples/calc++/local.mk: We no longer generate position.hh and
stack.hh.  Leaving them here triggers their concurrent generation,
which fails.
(%C%_calc___CPPFLAGS): Fix the extracted headers in the source tree.
* examples/mfcalc/local.mk (%C%_mfcalc_CPPFLAGS): Ditto.
2018-11-08 08:33:16 +01:00
Akim Demaille
7efe0b5da3 build: fix typo
Reported by Horst Von Brand.
https://savannah.gnu.org/support/?109580

* examples/local.mk (.PHOMY): Rename as...
(.PHONY): this.
2018-11-07 21:51:27 +01:00
Akim Demaille
351e3630bb NEWS: update 2018-11-06 13:26:41 +01:00
Akim Demaille
4fd1fc70e0 examples: ship them
Currently, the examples are extracted on the user's side.
Unfortunately, that requires that the user has Perl, which is
otherwise not needed for Bison.  Let's ship the examples instead.

The examples were handled this way so that we could depend on
configure flags: if --enable-gcc-warnings is passed, it is understood
as "I'm a maintainer", so the examples are generated with `#line`s.
Regular users should not see them, so they are now unconditionally
removed when rolling a tarball.

Reported by Mike Frysinger.
https://lists.gnu.org/archive/html/bison-patches/2015-04/msg00000.html

* examples/local.mk: Ship all the extracted files.
(examples-unline): New.
Make sure that the generated tarballs do not contain the #lines.
2018-11-06 13:23:13 +01:00
Akim Demaille
e02ce4c7f0 build: minor fixes in doc/
* doc/local.mk: Consistently use *.tmp for temporary files.
Fix comments.
2018-11-06 07:26:01 +01:00
Akim Demaille
7cab285eda CI: maximize chances of errors sooner
* .travis.yml: Try clang and icc soon, so that we don't have to wait
for the end of the run to know that they fail.
2018-11-05 06:32:27 +01:00
Akim Demaille
86efe28222 c++: improve the generated documentation
* data/lalr1.cc, data/location.cc: Improve documenting comments.
* tests/c++.at (Doxygen Documentation): Fix AT_BISON_OPTION_PUSHDEFS,
so that the generated yyerror is correct.
* tests/c++.at, tests/headers.at: Prefer %empty.
2018-11-04 17:56:09 +01:00
Akim Demaille
cf1446dc9e tests: don't fail if the C++ compiler does not work
Also, make sure that `make dist` generates a correct tarball even if
the C++ compiler does not work.

Reported by Nelson H. F. Beebe.

* m4/cxx.m4 (BISON_CXX_WORKS): Define to true/false instead of
true/exit 77.  The latter is too dangerous to use (it directly quits).
(ENABLE_CXX): New name for the Automake conditional, for consistency
with ENABLE_CXX11 etc.
* tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Adjust to the new
semantics of BISON_CXX_WORKS.
* examples/c++/local.mk: Skip the variant test if C++ does not work.
* examples/calc++/local.mk: Likewise.
2018-11-04 17:56:09 +01:00
Akim Demaille
e93c40b33d tests: don't disable C++ warnings in C files
This triggers error with GCC.
See eff6739124.

* tests/testsuite.h: Disable -Wzero-as-null-pointer-constant only for
C++.
2018-11-04 17:56:09 +01:00
Akim Demaille
eff6739124 c++: workaround portability issue
On some systems (x86_64-pc-solaris2.11), with Developer Studio 12.5's
CC, we get:

    ".../include/CC/Cstd/vector.cc", line 127: Error: Cannot assign const yy::parser::stack_symbol_type to yy::parser::stack_symbol_type without "yy::parser::stack_symbol_type::operator=(const yy::parser::stack_symbol_type&)";.
    ".../include/CC/Cstd/vector", line 475:     Where: While instantiating "std::vector<yy::parser::stack_symbol_type>::__insert_aux(yy::parser::stack_symbol_type*, const yy::parser::stack_symbol_type&)".
    ".../include/CC/Cstd/vector", line 475:     Where: Instantiated from non-template code.
    1 Error(s) detected.

Don't expect __cplusplus to be always defined.  If it's not, consider
this is C++98.

Reported by Nelson H. F. Beebe.

* data/c++.m4, data/lalr1.cc, examples/c++/variant.yy, tests/local.at,
* tests/testsuite.h:
An undefined __cplusplus means pre C++11.
2018-11-04 08:00:01 +01:00
Akim Demaille
5a0d7802f4 tests: work around getopt portability issues
On some systems, we don't use our getopt.  As a consequence the error
messages vary:

    $ bison --skeleton
    bison: option requires an argument -- skeleton
    Try 'bison --help' for more information.

instead of

    bison: option '--skeleton' requires an argument
    Try 'bison --help' for more information.

Reported by Jannick and Nelson H. F. Beebe.
https://lists.gnu.org/archive/html/bison-patches/2018-10/msg00140.html

* tests/input.at (Invalid number of arguments): work around getopt
portability issues.
2018-11-03 08:02:15 +01:00
Akim Demaille
f1e0839c9e doc: -Wzero-as-null-pointer-constant was added to GCC 4.7
It is not supported by previous versions.
See https://www.gnu.org/software/gcc/gcc-4.7/changes.html
Reported by Nelson H. F. Beebe.

* doc/bison.texi (Calc++ Scanner): here.
2018-11-03 07:23:10 +01:00
Adam Sampson
3bf429aed8 examples: #include <cstring> in calc++
strerror is defined by <string.h>, and recent versions of GNU libstdc++
no longer include this automatically from <string>.
2018-11-02 10:20:30 +01:00
Akim Demaille
f8cadc731b c: provide a definition of _Noreturn that works for C++
On Solaris, GCC 7.3 defines:

                      -std=c++14  -std=c++17
    __cplusplus       201402L       201703L
    __STDC_VERSION__  199901L       201112L

So the current #definition of _Noreturn sees that 201112 <=
__STDC_VERSION__, i.e., that C11 is supported, so it expects _Noreturn
to be supported.  Apparently it is not.

This is only for C++, the test suite works for C.  However, the test
suite does not try several C standards, maybe we should...

http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00064.html

* data/c.m4 (b4_attribute_define): Define _Noreturn as [[noreturn]] in
modern C++.
2018-10-31 12:06:24 +01:00
Akim Demaille
bd7aebb8b0 c: update the definition of _Noreturn
Does not work on Solaris 11.3 x86/64:

    479. c++.at:1293: testing C++ GLR parser identifier shadowing ...
    ======== Testing with C++ standard flags: '-std=c++17'
    ./c++.at:1332: $BISON_CXX_WORKS
    stderr:
    stdout:
    ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS  $LDFLAGS -o input input.cc $LIBS
    stderr:
    input.cc:837:8: error: '_Noreturn' does not name a type
     static _Noreturn void
            ^~~~~~~~~
    input.cc:845:8: error: '_Noreturn' does not name a type
     static _Noreturn void
            ^~~~~~~~~

Reported by Kiyoshi Kanazawa.
http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00051.html

* data/c.m4 (b4_attribute_define): Use the snippet which is currently
in gnulib's m4/gnulib-common.m4 (which seems a little more advanced
than lib/_Noreturn.h).
2018-10-30 19:44:31 +01:00
Akim Demaille
ca8039e612 tests: don't expect the shell to support 'local'
It doesn't work on Solaris 11.3 x86/64.
Reported by Kiyoshi Kanazawa.
http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00051.html

* examples/test: Don't use 'local'.
2018-10-30 19:13:38 +01:00
Akim Demaille
5d07f4f726 bitset: fix warning
Reported by Hans Åberg.
http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00047.html

* lib/bitset.c (bitset_count_): here.
2018-10-30 07:01:57 +01:00
Akim Demaille
e605ad9679 build: fix use of gnulib Make variables
Reported by Kiyoshi Kanazawa.
http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00048.html

* lib/local.mk (lib_libbison_a_LIBADD): Merge into...
* src/local.mk (src_bison_LDADD): here.
2018-10-30 07:01:21 +01:00
Akim Demaille
50fac71d46 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2018-10-29 21:15:10 +01:00
Akim Demaille
a8455b072a version 3.2
* NEWS: Record release date.
v3.2
2018-10-29 20:37:13 +01:00
Akim Demaille
a9d6e16e0a build: don't depend on the libc to generate bison.help
The "Report translation bugs to..." part of --help is issued only on
glibc systems.  So if the tarball is not wrapped on such a system, and
used on such a system (or the converse), then bison.help will differ
on the user's system, and help2man will be called to update bison.1.

But help2man should not be a requirement.

Reported by Alexandre Duret-Lutz.

* doc/local.mk (doc/bison.help): Remove the possible doc about
translation bugs.
Pass LC_ALL=C, as reported in src/getargs.c's usage().
(doc/cross-options.texi): Use bison.help instead of calling bison
--help.
2018-10-29 20:24:30 +01:00
Akim Demaille
bd0cf11e00 c++: always issue the "generated by" message
Some users rely on this sentence to know that the file can be ignored.
Reported by Alexandre Duret-Lutz.

* data/bison.m4 (b4_generated_by): New.
(b4_copyright): Use it.
* data/location.cc, data/stack.hh: Use it too, for the stub files
(position.hh and stack.hh).
2018-10-29 20:07:21 +01:00
Akim Demaille
c8512e09e7 cfg.mk: remove exceptions for timevar
They appear to be no longer needed.

* cfg.mk: here.
2018-10-28 18:02:50 +01:00
Akim Demaille
96f503e197 style: clean up src/AnnotationList.c
* src/AnnotationList.c: Reduce scopes.
2018-10-28 17:56:22 +01:00
Akim Demaille
9912dd28ca style: clean up print.c
* src/print.c: Reduce scopes.
2018-10-28 16:32:12 +01:00
Akim Demaille
22aaad0c45 bitset: clean up bbitset.h
* lib/libiberty.h: Inline in...
* lib/bbitset.h: here.
* lib/local.mk: Adjust.
2018-10-27 19:27:41 +02:00
Akim Demaille
a45ed4ecc1 bitset: clean up bitset.h
* lib/bitset.h: Fix include order.
2018-10-27 19:27:41 +02:00
Akim Demaille
fef272bdf3 bitset: clean up vbitset.c
* lib/vbitset.c: Reduce scopes, etc.
2018-10-27 19:27:41 +02:00
Akim Demaille
d1f57a4ae5 bitset: clean up lbitset.c
* lib/lbitset.c: Reduce scopes, etc.
2018-10-27 19:27:41 +02:00
Akim Demaille
5d5f12fb0d bitset: clean up ebitset.c
* lib/ebitset.c: Reduce scopes, etc.
2018-10-27 19:09:08 +02:00
Akim Demaille
9f6013a0fd bitset: clean up bitset_stats.c
* lib/bitset_stats.c: Reduce scopes, etc.
2018-10-27 19:09:08 +02:00
Akim Demaille
fad0f9231b bitset: clean up bitset.c
* lib/bitset.c: Reduce scopes, etc.
2018-10-27 19:09:08 +02:00
Akim Demaille
81df326649 bitset: clean up abitset.c
* lib/abitset.c: Reduce scopes, etc.
2018-10-27 18:46:01 +02:00
Jannick
01c5b6ab0f xml2dot.xsl: fix typos in comments 2018-10-27 16:43:27 +02:00
Akim Demaille
c45f86d286 doc: fix distcheck
The extracted example, simple.yy, does not use %require "3.2", so it
generates a stack.hh, which breaks distcheck.

* doc/bison.texi: Fix it.
2018-10-27 08:53:30 +02:00
Akim Demaille
1664d1c5ed NEWS: prepare for 3.2 2018-10-27 08:30:50 +02:00
Akim Demaille
71758d854a tests: beware of Windows file name constraints
Don't expect to be able to build a file named '"\"".y' (6 characters)
on Windows.

Reported by Jannick.
http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00042.html

* tests/synclines.at (syncline escapes): Skip if we failed to create
the file.
2018-10-26 18:59:01 +02:00
Akim Demaille
3751d50e70 tests: fix invocation of m4_map
* tests/actions.at, tests/synclines.at: m4_map takes a list of
arguments in $2, m4_map_args takes arguments in $2, $3, etc.
2018-10-26 18:59:01 +02:00
Akim Demaille
3f5e6905da doc: spell check
* README, doc/bison.texi, examples/README, examples/c++/README: here.
2018-10-26 08:40:07 +02:00
Akim Demaille
719782e6ba examples: add a Makefile for C++ short examples
* examples/c++/Makefile: New.
* examples/c++/local.mk, examples/c++/README: Adjust.
2018-10-26 08:35:10 +02:00
Akim Demaille
ee175dfd00 doc: some improvements
* doc/bison.texi (Calc++ Scanner): Show how exception can be thrown
from auxiliary functions.
Clarify the meaning of the various flex %options we use.
Get rid of a warning.
(Calc++ Parsing Driver): Use the parser as a functor.
2018-10-26 07:42:28 +02:00
Akim Demaille
f3110c9b9a examples: check the errors
* examples/test (run): Check stderr, unless -noerr is passed.
* examples/calc++/calc++.test, examples/mfcalc/mfcalc.test: Check
errors.
2018-10-26 07:42:28 +02:00
Akim Demaille
18743948b5 doc: minor fixes
* doc/bison.texi: Simplify wording.
Fix Texinfo error.
(Complete Symbols): Handle the token EOF.
(Calc++ Parser): In the modern C++ world, prefer assignment to swap.
(Strings are Destroyed): Prefer an explicit 'continue' to a comment.
2018-10-25 07:03:15 +02:00
Akim Demaille
849d91bc02 configure: quit on trying to get ICC and Flex be friends
The CI is using Flex 2.5.35.  And ICC is too picky for it.  Let's stop
making these warnings errors.  I wish I could disable them in the
source files using the ICC version and the Flex version, but ICC's
pragma support is unclear, and I'm tired of fighting it.

* configure.ac (FLEX_SCANNER_CXXFLAGS): Make warnings warnings.
* examples/c++/local.mk: Comment changes.
2018-10-24 21:53:21 +02:00