| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
* NEWS: Record release date.
|
|
|
|
|
| |
* cfg.mk: No need to translate *.md files.
* data/skeletons/glr.c, data/skeletons/yacc.c: Fix space issues.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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/bison.texi: No visible changes.
|
|
|
|
|
| |
* doc/bison.texi (calc++/scanner.ll): here.
While at it, clarify clang vs. warnings.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
* src/gram.c (grammar_dump): Fix condition of aver.
What we want to check is that rhs is followed by its rule.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
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/bison.texi: Wrap lines.
No semantical difference.
|
|
|
|
| |
* doc/bison.texi: here.
|
|
|
|
| |
* doc/bison.texi: Use @code for types in function definitions.
|
|
|
|
|
|
|
| |
* data/skeletons/location.cc (position::counter_type)
(location::counter_type): New.
Use them.
* doc/bison.texi (C++ position, C++ location): Adjust.
|
|
|
|
|
|
| |
Reported by Denis Excoffier.
* tests/diagnostics.at: here.
|
|
|
|
|
|
|
| |
* 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/testsuite.h: We no longer load gnulib in the tests.
|
|
|
|
| |
* src/muscle-tab.c (muscle_percent_define_check_kind): Here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Reported by Denis Excoffier.
* tests/bison.in: here.
|
|
|
|
|
| |
I don't understand what happened in
10acc148bb90fac8a52a5d35f2bd18bd824c1639.
|
|
|
|
|
|
| |
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
|
|
|
|
| |
* NEWS: Record release date.
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
Reported by syntax-check.
* src/system.h: here.
|
|
|
|
| |
* data/skeletons/glr.c: here.
|
|
|
|
|
|
|
| |
This build never finishes in the 50min credit given by Travis. See if
with optimizations it works better.
* .travis.yml: here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* src/reader.c (reader): Move the setting up of the builtin symbols to...
* src/symtab.c (symbols_new): here.
|
|
|
|
|
|
| |
Reported by Paul Eggert.
* src/system.h: here.
|
|
|
|
|
| |
* data/skeletons/lalr1.cc: Printing a char prints... a char.
Print ints instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 typo. Git command name is submodule.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Today sanitizers are a better alternative.
* m4/dmalloc.m4: Remove.
* configure.ac, src/system.h: Adjust.
|
| |
|
| |
|
|
|
|
|
|
| |
rrhs and rlhs were removed by b2ed6e5826e772162719db595446b2c58e4ac5d6.
* src/reader.c (packgram): Update comment.
|
|
|
|
| |
* data/skeletons/yacc.c (yysetstate): fix comment.
|