summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* version 3.8.2v3.8.2Akim Demaille2021-09-251-1/+1
| | | | * NEWS: Record release date.
* tests: Apple clang issues warning on C++11 featuresAkim Demaille2021-09-252-1/+11
| | | | | | | | | | | | | | | | | | | | $ cat /tmp/foo.cc using foo = int; foo f; $ clang++ -Wc++11-extensions -c /tmp/foo.cc /tmp/foo.cc:1:13: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using foo = int; ^ 1 warning generated. $ clang++ --version Apple clang version 11.0.0 (clang-1100.0.33.17) Target: x86_64-apple-darwin18.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin * tests/local.at (AT_COMPILE_CXX): Make sure -std=c++11 is passed when running glr2.cc. It may be overridden by another flag in CXXFLAGS afterwards.
* avoid using atoiAkim Demaille2021-09-254-9/+18
| | | | | | * cfg.mk: Disable sc_indent as auto indent is too invasive for now. Enable sc_prohibit_atoi_atof, except where we don't care. * src/location.c, src/muscle-tab.c: Use strtol instead of atoi.
* news: updateAkim Demaille2021-09-241-0/+4
|
* gnulib: updateAkim Demaille2021-09-181-0/+0
| | | | | | | | | | | | | | | | To get commit 7818455627c5e54813ac89924b8b67d0bc869146 Author: Bruno Haible <bruno@clisp.org> Date: Fri Sep 17 22:22:50 2021 +0200 threadlib: Avoid crashes in thread-related functions on Cygwin 3.2.0. Reported by Brian Inglis via Akim Demaille in <https://lists.gnu.org/archive/html/bug-gnulib/2021-09/msg00063.html>. * m4/threadlib.m4 (gl_WEAK_SYMBOLS): Force a "guessing no" result on Cygwin.
* c++: use YY_NOEXCEPT where it helpsAkim Demaille2021-09-184-28/+28
| | | | | | | | | Suggested by Don Macpherson. <https://github.com/akimd/bison/issues/80> * data/skeletons/c++.m4, data/skeletons/glr2.cc, * data/skeletons/lalr1.cc, data/skeletons/stack.hh: Use YY_NOEXCEPT where it helps constructors.
* gnulib: updateAkim Demaille2021-09-133-0/+2
|
* glr2.cc: semantic_option: use a symbolAkim Demaille2021-09-132-39/+35
| | | | | | * data/skeletons/c++.m4 (basic_symbol): Add assignment operators. * data/skeletons/glr2.cc (semantic_option): Replace yytoken, yyvalue and yylocation by yyla.
* glr2.cc: don't publish move ctor to lalr1.ccAkim Demaille2021-09-131-6/+6
| | | | | | | These operators were introduced in "c++: add move assignments to the symbol type" (fdaedc780af0dd678a4f4fa3175a201a553be20a) for glr2.cc. * data/skeletons/c++.m4: Define them for glr2.cc only.
* glr2.cc: simplify semantic_optionAkim Demaille2021-09-121-3/+3
| | | | | | * data/skeletons/glr2.cc (semantic_option): Simplify the rule-based constructor. This shows that it should be easy to use a symbol_kind, instead of the kind/value/location triple.
* glr2.cc: we require C++11Akim Demaille2021-09-121-4/+0
| | | | * data/skeletons/glr2.cc: So no need for C++98 compatibility.
* glr2.cc: introduse b4_glr2_cc_ifAkim Demaille2021-09-122-9/+13
| | | | | * data/skeletons/bison.m4 (b4_glr2_cc_if): Intro. * data/skeletons/c++.m4: use.
* glr2.cc: don't pass %parse-param to destroyAkim Demaille2021-09-121-6/+6
| | | | | | | | | | | | | | | | | | | | I regret that %destructor and %printer give access to the %parse-param in lalr1.cc, since that prevents them from being implemented as a simple destructor and operator<<. Let's not repeat the mistake in glr2.cc. In addition, fixes a name conflict we have currently in tests 566 568 570 657: calc.cc:1395:85: error: declaration shadows a field of 'calc::parser' [-Werror,-Wshadow] void glr_state::destroy (char const* yymsg, calc::parser& yyparser, semantic_value *result, int *count, int *nerrs) ^ calc.hh:441:21: note: previous declaration is here semantic_value *result; ^ With this commit, the whole test suite passes for glr2.cc. * data/skeletons/glr2.cc (glr_state::destroy): Don't take the user arguments.
* glr2.cc: kill trailing white spacesAkim Demaille2021-09-121-15/+14
| | | | | | | | | | | | | | | | Fixes several calc tests. Tests 566 568 570 657 still fail because of a name clash when using %parse-param: calc.cc:1395:85: error: declaration shadows a field of 'calc::parser' [-Werror,-Wshadow] void glr_state::destroy (char const* yymsg, calc::parser& yyparser, semantic_value *result, int *count, int *nerrs) ^ calc.hh:441:21: note: previous declaration is here semantic_value *result; ^ * data/skeletons/glr2.cc: Fix indentation/trailing spaces.
* glr2.cc: check linking conflictsAkim Demaille2021-09-121-1/+6
| | | | * tests/headers.at (Several Headers): Link two glr2.cc parsers.
* glr2.cc: move strong_index_alias into the unnamed namespaceAkim Demaille2021-09-121-82/+82
| | | | * data/skeletons/glr2.cc: here.
* glr2.cc: use only symbol_kind_type, not yysymbol_kind_tAkim Demaille2021-09-121-22/+23
| | | | | * data/skeletons/glr2.cc: here. And prefer the unnamed namespace to static.
* glr2.cc: prefer using, and remove useless type aliasesAkim Demaille2021-09-121-30/+15
| | | | * data/skeletons/glr2.cc: here.
* glr2.cc: put glr_state_set and glr_stack_item in unnamed namespaceAkim Demaille2021-09-121-239/+248
| | | | * data/skeletons/glr2.cc: here.
* glr2.cc: move state_stack into the unnamed namespaceAkim Demaille2021-09-121-352/+354
| | | | | | * data/skeletons/glr2.cc: here. Prefer `using` to `typedef`, this is C++11. Use the type alias we introduced.
* glr2.cc: style: clarify control flowAkim Demaille2021-09-121-6/+7
| | | | * data/skeletons/glr2.cc (yypreference): Be more functional-style.
* glr2.cc: move glr_stack and glr_state into the parser classAkim Demaille2021-09-121-1238/+1244
| | | | | | | | | | | In order to be able to link several glr2.cc parser together, we cannot have glr_stack and glr_state be in no namespace. Putting them in the unnamed namespace is not doable, since we need to fwd declare them in the parser. Putting them in the specified namespace is not enough either, since some users would like to be able to put several parsers in the same name, only differing by the class name. * data/skeletons/glr2.cc (glr_state, glr_stack): Move into yy::parser.
* glr2.cc: put create_state_set_index in unnamed namespaceAkim Demaille2021-09-121-2/+5
| | | | * data/skeletons/glr2.cc: here.
* glr2.cc: prefer unnamed namespace to 'static'Akim Demaille2021-09-121-45/+69
| | | | * data/skeletons/glr2.cc: here.
* glr2.cc: put semantic_option into an unnamed namespaceAkim Demaille2021-09-121-231/+237
| | | | | | | | If we link several glr2.cc parsers together, we get linking failures because of duplicate symbols. * data/skeletons/glr2.cc (semantic_option::indexIn) (semantic_option::next): Remove the useless overloads.
* glr2.cc: don't publish YY_EXCEPTIONSAkim Demaille2021-09-122-11/+15
| | | | | | | | We don't need them in the header file. * data/skeletons/glr2.cc (YY_EXCEPTIONS): Define only in the implementation file. * tests/headers.at (Several Parsers): Also check glr2.cc.
* c++: demonstrate custom error messages in the examplesAkim Demaille2021-09-126-11/+58
| | | | | | | | | | | Let's use c++/glr to demonstrate custom error messages in C++ (not just in glr2.cc). * examples/c++/glr/c++-types.yy (report_syntax_error): New. * examples/c++/glr/c++-types.test: Adjust. * examples/c/bistromathic/parse.y: Comment changes. * tests/local.at (AT_YYERROR_DEFINE(c++)): Use a nicer way to print the lookakead's name.
* glr2.cc: custom error messagesAkim Demaille2021-09-122-96/+172
| | | | | | | | | | Reported by Tom Shields <thomas.evans.shields@icloud.com>. <https://lists.gnu.org/r/bug-bison/2021-08/msg00003.html> * data/skeletons/glr2.cc (context): New. Use it to generate the error messages. Add support for custom error messages. * tests/calc.at: Check support for custom error messages.
* glr2.cc: start the transition to using symbol_typeAkim Demaille2021-09-124-120/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently glr2.cc uses three variables/struct members to denote the symbols' kind (or state), value and location. lalr1.cc has two types for "complete" symbols: symbol_type and stack_symbol_type. Let's use that model in glr2.cc too. For a start use yyla (a symbol_type) to denote the lookahead, instead of the triple yytoken, yylval and yylloc. This will make easier the introduction of the "context" subclass, used in parse.error=custom. It simplifies the code in several places. For instance from: symbol_kind_type yytoken_current = this->yytoken;]b4_variant_if([[ value_type yylval_current; ]b4_symbol_variant([this->yytoken], [yylval_current], [move], [this->yylval])], [[ value_type yylval_current = this->yylval;]])[]b4_locations_if([ location_type yylloc_current = this->yylloc;])[ to: symbol_type yyla_current = std::move (this->yyla); * data/skeletons/glr2.cc (yytoken, yylval, yylloc): Replace by... (yyla): this. Adjust all dependencies. (yyloc_default): Remove, unused. * tests/c++.at, tests/glr-regression.at, tests/types.at: C++11 is required for glr2.cc. Adjust to changes in glr2.cc.
* c++: add move assignments to the symbol typeAkim Demaille2021-09-121-0/+28
| | | | | | This will be used in glr2.cc, which requires C++11. * data/skeletons/c++.m4 (basic_symbol, by_kind): Add move assignment.
* c++: avoid using the obsolete namesAkim Demaille2021-09-126-21/+28
| | | | | | | | * data/skeletons/c++.m4: Don't define obsolete identifiers in the case of glr2.cc. Let's not start with technical debt. * data/skeletons/glr2.cc, data/skeletons/lalr1.cc, * data/skeletons/variant.hh: Use token_kind_type, not token_type. * tests/c++.at, tests/local.at: Use value_type, not semantic_type.
* regenAkim Demaille2021-09-122-4/+4
|
* maint: post-release administriviaAkim Demaille2021-09-114-5/+8
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 3.8.1v3.8.1Akim Demaille2021-09-111-1/+1
| | | | * NEWS: Record release date.
* portability: don't use strtofAkim Demaille2021-09-114-6/+8
| | | | | | | | | | | | It is not available on HP-UX 11i. Reported by Larkin Nickle <me@larbob.org>. <https://lists.gnu.org/r/bug-bison/2021-09/msg00012.html> Gnulib provides no replacement, but anyway we should be using doubles, since difftime uses doubles. * bootstrap.conf: We want portability on stdtod. * src/counterexample.c: Use double, not float, for time measurements.
* yacc: declare yyerror/yylex only when POSIXLY_CORRECTAkim Demaille2021-09-1111-16/+53
| | | | | | | | | | | | | | | | | | | | The recent changes to comply with POSIX are breaking Automake's test suite. Reported by Kiyoshi Kanazawa. <https://lists.gnu.org/r/bug-bison/2021-09/msg00005.html> To limit the impact of POSIX changes, bind them to $POSIXLY_CORRECT. Suggested by Karl Berry. <https://lists.gnu.org/r/bug-bison/2021-09/msg00009.html> The existing `maintainer-check-posix` Make target checks these changes. * src/getargs.h, src/getargs.c (set_yacc): New. Use it. * data/skeletons/bison.m4 (b4_posix_if): New. * data/skeletons/yacc.c (b4_declare_yyerror_and_yylex): Use it. * doc/bison.texi, tests/local.at: Adjust.
* maint: post-release administriviaAkim Demaille2021-09-072-1/+4
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 3.8v3.8Akim Demaille2021-09-071-1/+1
| | | | * NEWS: Record release date.
* news: updateAkim Demaille2021-09-071-7/+0
|
* maint: post-release administriviaAkim Demaille2021-09-022-1/+4
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 3.7.91v3.7.91Akim Demaille2021-09-021-1/+1
| | | | * NEWS: Record release date.
* tests: disable "Multistart reports"Akim Demaille2021-09-022-1595/+1599
| | | | | | | | | For some reason this test fails on Solaris/x86. But multistart is not part of 3.8, so we can postpone the debugging of this issue. Reported by Dagobert Michelsen. <https://lists.gnu.org/r/bug-bison/2021-08/msg00027.html> * tests/report.at (Multistart reports): Comment out.
* style: c++: formatting changesAkim Demaille2021-08-292-13/+12
| | | | | * data/skeletons/variant.hh, data/skeletons/glr2.cc: Fix space before paren issue.
* style: rename stmtMerge as stmt_mergeAkim Demaille2021-08-294-31/+31
| | | | | | | Follow the GNU Coding Style. * doc/bison.texi, examples/c++/glr/c++-types.yy, * examples/c/glr/c++-types.y, tests/cxx-type.at: s/stmtMerge/stmt_merge/g.
* c++: beware of Visual C++ limitationsAkim Demaille2021-08-292-0/+3
| | | | | | | | | | | | | | Contrary to what commit d8cc6b073e2802d871a16dc62418a7eb62ed2216 "c++: shorten the assertions that check whether tokens are correct" believed, MS Visual C++'s preprocessor limitation is not on the input line length, but on the size of the line holding the full C++ statement. Reported by Vince Huffaker <vince@vincejulie.com> <https://lists.gnu.org/r/help-bison/2021-08/msg00003.html> * data/skeletons/variant.hh (_b4_symbol_constructor_define): Hide the assertion from Visual C++.
* tests: don't postprocess stderr with sedAkim Demaille2021-08-292-19/+11
| | | | | | | | | | | | | | | On Solaris, sed throws away the NUL bytes from the stream, even in C locale. So instead of postprocessing bison's stderr to neutralize changes in value of `argv[0]`, use an envvar to actually neutralize variations of `argv[0]` during tests. Reported by Dagobert Michelsen. <https://lists.gnu.org/r/bug-bison/2021-08/msg00025.html> * src/main.c (main): Change `argv[0]` if BISON_PROGRAM_NAME is defined. * tests/bison.in: No longer mess with stderr, just pass the expected BISON_PROGRAM_NAME value.
* CI: don't require Autoconf 2.71Akim Demaille2021-08-193-5/+4
|
* examples: don't demonstrate multistart, which is not part of 3.8Akim Demaille2021-08-194-58/+18
| | | | | | | | | Besides, for mysterious reasons, this fails on some environment. Reported by Dagobert Michelsen. <https://lists.gnu.org/archive/html/bug-bison/2021-08/msg00008.html> * examples/c/lexcalc/lexcalc.test, examples/c/lexcalc/parse.y, * examples/c/lexcalc/scan.l: Revert to a single-start example.
* tests: grep -E is not portableAkim Demaille2021-08-191-1/+1
| | | | | | | Reported by Dagobert Michelsen. <https://lists.gnu.org/r/bug-bison/2021-08/msg00008.html> * tests/calc.at: Use $EGREP.
* glr2.cc: require C++11Akim Demaille2021-08-196-29/+32
| | | | | | | | | | | | | | Reported by Dagobert Michelsen. https://lists.gnu.org/r/bug-bison/2021-08/msg00006.html * m4/bison-cxx-std.m4 (_BISON_CXXSTD_98_snippet): We don't need vector::data, it was only for glr2.cc, which is C++11 anyway. (_BISON_CXXSTD_11_snippet): We need vector::data and std::swap on arrays. * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): We don't need vector::data. * tests/local.at (AT_COMPILE_CXX): Skip when glr2.cc and no support for C++11.