summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* version 3.4.91v3.4.91Akim Demaille2019-11-201-1/+1
| | | | * NEWS: Record release date.
* style: pacify syntax-checkAkim Demaille2019-11-205-12/+15
| | | | | * cfg.mk: No need to translate *.md files. * data/skeletons/glr.c, data/skeletons/yacc.c: Fix space issues.
* gnulib: updateAkim Demaille2019-11-191-0/+0
|
* doc: don't promote dangling aliasesAkim Demaille2019-11-181-1/+15
| | | | | | | | | | | | | String literals as tokens serve two distinct purposes: freeing from having to implement the keyword matching in the scanner, and improving error messages. Most of the time both can be achieved at the same time, but on occasions, it does not work so well. We promote their use for error messages. We will also still support the former case, but it is _not_ the recommended approach. * doc/bison.texi (Tokens from Literals): Clearly state that we don't recommend looking up the token types in the list of token names.
* diagnostics: complain about undeclared string tokensAkim Demaille2019-11-176-13/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | String literals, which allow for better error messages, are (too) liberally accepted by Bison, which might result in silent errors. For instance %type <exVal> cond "condition" does not define “condition” as a string alias to 'cond' (nonterminal symbols do not have string aliases). It is rather equivalent to %nterm <exVal> cond %token <exVal> "condition" i.e., it gives the type 'exVal' to the "condition" token, which was clearly not the intention. Introduce -Wdangling-alias to catch this. * src/complain.h, src/complain.c: Add support for -Wdangling-alias. (argmatch_warning_args): Sort. * src/symtab.c (symbol_check_defined): Complain about dangling aliases. * doc/bison.texi: Document it. * tests/input.at (Dangling aliases): New test.
* diagnostics: yacc reserves %type to nonterminalsAkim Demaille2019-11-177-28/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On %token TOKEN1 %type <ival> TOKEN1 TOKEN2 't' %token TOKEN2 %% expr: bison -Wyacc gives input.y:2.15-20: warning: POSIX yacc reserves %type to nonterminals [-Wyacc] 2 | %type <ival> TOKEN1 TOKEN2 't' | ^~~~~~ input.y:2.29-31: warning: POSIX yacc reserves %type to nonterminals [-Wyacc] 2 | %type <ival> TOKEN1 TOKEN2 't' | ^~~ input.y:2.22-27: warning: POSIX yacc reserves %type to nonterminals [-Wyacc] 2 | %type <ival> TOKEN1 TOKEN2 't' | ^~~~~~ The messages appear to be out of order, but they are emitted when the error is found. * src/symtab.h (symbol_class): Add pct_type_sym, used to denote symbols appearing in %type. * src/symtab.c (complain_pct_type_on_token): New. (symbol_class_set): Check that %type is not applied to tokens. (symbol_check_defined): pct_type_sym also means undefined. * src/parse-gram.y (symbol_decl.1): Set the class to pct_type_sym. * src/reader.c (grammar_current_rule_begin): pct_type_sym also means undefined. * tests/input.at (Yacc's %type): New.
* doc: promote %nterm over %typeAkim Demaille2019-11-161-40/+43
| | | | | | | | | | | | | | As an extension to POSIX Yacc, Bison's %type accepts tokens. Unfortunately with string literals as implicit tokens, this is misleading, and led some users to write %type <exVal> cond "condition" believing that "condition" would be associated to the 'cond' nonterminal (see https://github.com/apache/httpd/pull/72). * doc/bison.texi: Promote %nterm rather than %type to declare the type of nonterminals.
* doc: formatting changesAkim Demaille2019-11-161-105/+90
| | | | * doc/bison.texi: No visible changes.
* doc: work around warnings when Flex C output is compiled in C++Akim Demaille2019-11-161-9/+19
| | | | | * doc/bison.texi (calc++/scanner.ll): here. While at it, clarify clang vs. warnings.
* tests: be robust to old Perl versions on CygwinAkim Demaille2019-11-161-2/+6
| | | | | | | Reported by Denis Excoffier. https://lists.gnu.org/archive/html/bug-bison/2019-11/msg00008.html. * tests/output.at: Be sure to remove back up files.
* regenAkim Demaille2019-11-162-18/+29
|
* gram.c: Fix condition of averkaneko y2019-11-121-1/+1
| | | | | * src/gram.c (grammar_dump): Fix condition of aver. What we want to check is that rhs is followed by its rule.
* doc: clarify build instructionsAkim Demaille2019-11-115-173/+215
| | | | | | | | | * README: A few fixes. Explain how to install color support. * README-hacking: Rename as... * README-hacking.md: this, and convert to Markdown. Improve typography. Improve explanations about update-test.
* gnulib: updateAkim Demaille2019-11-113-0/+4
|
* gram.c: also print terminals in grammar_dumpYuichiro Kaneko2019-11-112-9/+117
| | | | | | * src/gram.c (grammar_dump): Print terminals likewise non terminals. * tests/sets.at (Reduced Grammar): Update test case to catch up the change and add a test case where prec and assoc are used.
* doc: work around Texinfo 6.7 bugAkim Demaille2019-11-101-0/+17
| | | | | | | | When @code is used in a @deftype... definition, it issues quotes. Remove them. See https://lists.gnu.org/archive/html/help-texinfo/2019-11/msg00004.html. * doc/local.mk: here.
* doc: formatting changesAkim Demaille2019-11-091-24/+22
| | | | | * doc/bison.texi: Wrap lines. No semantical difference.
* doc: use upper case for tokensAkim Demaille2019-11-091-1/+1
| | | | * doc/bison.texi: here.
* doc: type-face fixesAkim Demaille2019-11-071-64/+64
| | | | * doc/bison.texi: Use @code for types in function definitions.
* c++: expose the type used to store line and column numbersAkim Demaille2019-11-063-51/+68
| | | | | | | * data/skeletons/location.cc (position::counter_type) (location::counter_type): New. Use them. * doc/bison.texi (C++ position, C++ location): Adjust.
* tests: fix comment and adjust to locale names on GNU/LinuxAkim Demaille2019-11-031-4/+5
| | | | | | Reported by Denis Excoffier. * tests/diagnostics.at: here.
* tests: really check complaints from m4Akim Demaille2019-11-031-38/+15
| | | | | | | * tests/diagnostics.at (Locations from M4, Tabulations and multibyte characters from M4): These tests are actually checking a message coming from C, not from M4. Replace with... (Complaints from M4): This.
* tests: simplify prologueAkim Demaille2019-11-031-5/+4
| | | | * tests/testsuite.h: We no longer load gnulib in the tests.
* diagnostics: add missing translationAkim Demaille2019-11-031-4/+4
| | | | * src/muscle-tab.c (muscle_percent_define_check_kind): Here.
* c++: fix old cast warningsAkim Demaille2019-11-0214-137/+186
| | | | | | | | | | | | | | | | | | | | | | | We still have a few old C casts in lalr1.cc, let's get rid of them. Reported by Frank Heckenbach. Actually, let's monitor all our casts using easy to grep macros. Let's use these macros to use the C++ standard casts when we are in C++. * data/skeletons/c.m4 (b4_cast_define): New. * data/skeletons/glr.c, data/skeletons/glr.cc, * data/skeletons/lalr1.cc, data/skeletons/stack.hh, * data/skeletons/yacc.c: Use it and/or its casts. * tests/actions.at, tests/cxx-type.at, * tests/glr-regression.at, tests/headers.at, tests/torture.at, * tests/types.at: Use YY_CAST instead of C casts. * configure.ac (warn_cxx): Add -Wold-style-cast. * doc/bison.texi: Disable it.
* tests: be robust to tput errorsAkim Demaille2019-11-011-1/+1
| | | | | | Reported by Denis Excoffier. * tests/bison.in: here.
* git: update ignoresAkim Demaille2019-11-011-0/+16
| | | | | I don't understand what happened in 10acc148bb90fac8a52a5d35f2bd18bd824c1639.
* maint: post-release administriviaAkim Demaille2019-10-292-1/+4
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 3.4.90v3.4.90Akim Demaille2019-10-292-17/+1
| | | | * NEWS: Record release date.
* C++: finish propagating the unsigned->signed conversion in locationsAkim Demaille2019-10-293-14/+18
| | | | | | * data/skeletons/location.cc: Remove the u (for unsigned) suffix from the initial line and column. * NEWS: AFAICT, only C++ backends have their location types changed.
* style: fix cpp indentationAkim Demaille2019-10-291-10/+10
| | | | | | Reported by syntax-check. * src/system.h: here.
* style: glr.c: comment changesAkim Demaille2019-10-291-4/+4
| | | | * data/skeletons/glr.c: here.
* CI: pass -O1 to GCC8 with sanitizersAkim Demaille2019-10-261-1/+2
| | | | | | | This build never finishes in the 50min credit given by Travis. See if with optimizations it works better. * .travis.yml: here.
* reader: reduce the "scope" of global variablesAkim Demaille2019-10-268-34/+30
| | | | | | | | | | | | | | | We have too many global variables, adding structure would help. For a start, let's hide some of the variables closer to their usage. * src/getargs.c, src/files.h (current_file): Move to... * src/scan-gram.c: here. * src/scan-gram.h (gram_in, gram__flex_debug): Remove, make them private to the scanner. * src/reader.h, src/reader.c (reader): Take a grammar file as argument. Move the handling of scanner variables to... * src/scan-gram.l (gram_scanner_open, gram_scanner_close): here. (gram_scanner_initialize): Remove, replaced by gram_scanner_open. * src/main.c: Adjust.
* regenAkim Demaille2019-10-262-10/+10
|
* parser: use grammar_file instead of current_fileAkim Demaille2019-10-261-6/+6
| | | | | | | * src/parse-gram (%initial-action): here. (handle_skeleton): Don't depend on the current file name to look for "local" skeletons (subject to changes coming from "#lines"): depend only on the initial file name, the one given on the command line.
* diagnostics: use grammar_file instead of current_fileAkim Demaille2019-10-262-2/+2
| | | | | | | | | Currently there are two globals denoting the input file: grammar_file is the one from the command line, and current_file which might change because of #line. Use only the former. * src/complain.c (error_message): here. * tests/diagnostics.at: Adjust.
* reader: let symtab deal with the symbolsAkim Demaille2019-10-253-19/+23
| | | | | * src/reader.c (reader): Move the setting up of the builtin symbols to... * src/symtab.c (symbols_new): here.
* style: remove incorrect commentAkim Demaille2019-10-251-1/+0
| | | | | | Reported by Paul Eggert. * src/system.h: here.
* lalr1.cc: fix previous commit: printing of state numbersAkim Demaille2019-10-241-2/+2
| | | | | * data/skeletons/lalr1.cc: Printing a char prints... a char. Print ints instead.
* lalr1.cc: use computed state typesAkim Demaille2019-10-241-5/+4
| | | | | | | | | | | | | | This skeleton uses a single stack of state structures, so it is less likely to benefit from a stack size reduction than yacc.c (which uses several stacks: state number, value and location). But it will reduce the size of the LAC stack. This skeleton was already using int for state numbers, so, contrary to yacc.c, this brings nothing for large automata. Overall, it is still nicer to make the skeletons alike. * data/skeletons/lalr1.cc (state_type): Here.
* README: Fix a typokaneko y2019-10-241-1/+1
| | | | * README: Fix a typo. Git command name is submodule.
* examples: fix missing dependenciesAkim Demaille2019-10-243-3/+31
| | | | | | | | | | | Reported by Thomas Petazzoni. https://lists.gnu.org/archive/html/bug-bison/2019-08/msg00000.html * examples/c/reccalc/local.mk: Complete dependencies, including for earlier versions of Automake (for sake of our CI, on top of Ubuntu Xenial/Bionic, which feature only Automake 1.15). (%D%/scan.c %D%/scan.h): Upgrade to the full version provided in Automake's documentation.
* diagnostics: simplify location handlingAkim Demaille2019-10-242-11/+11
| | | | | | | Locations start at line 1. Don't accept line 0. * src/location.c (location_print): Don't print locations with line 0. (location_caret): Simplify.
* build: reenable -Wtype-limitsAkim Demaille2019-10-246-6/+25
| | | | | | | | | | | | | | | | See https://lists.gnu.org/archive/html/bug-bison/2019-10/msg00061.html to https://lists.gnu.org/archive/html/bug-bison/2019-10/msg00073.html. Paul Eggert's changes in gnulib do fix the issue for modern GCCs (7, 8, 9) on macOS. Unfortunately these warnings are back on the CI (GNU/Linux) with GCC 4.6, 4.7, (not 4.8) and 4.9. Disable the warning locally. * configure.ac (warn_common, warn_tests): Remove -Wtype-limits. * src/system.h (IGNORE_TYPE_LIMITS_BEGIN, IGNORE_TYPE_LIMITS_END): New. * src/InadequacyList.c, src/parse-gram.c, src/parse-gram.y, * src/symtab.c: Use it.
* build: remove dmalloc supportAkim Demaille2019-10-243-33/+0
| | | | | | | Today sanitizers are a better alternative. * m4/dmalloc.m4: Remove. * configure.ac, src/system.h: Adjust.
* gitignore: updateAkim Demaille2019-10-231-0/+2
|
* build: update gnulib submodule to latestPaul Eggert2019-10-231-0/+0
|
* style: update comment in reader.cYuichiro Kaneko2019-10-233-4/+8
| | | | | | rrhs and rlhs were removed by b2ed6e5826e772162719db595446b2c58e4ac5d6. * src/reader.c (packgram): Update comment.
* yacc.c: fix a typokaneko y2019-10-221-1/+1
| | | | * data/skeletons/yacc.c (yysetstate): fix comment.