| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
* NEWS: Record release date.
|
|
|
|
|
| |
* doc/bison.texi (Syntax Error Reporting Function): Don't refer to
YY_LOCATION_PRINT, it is a private internal detail.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a pstate is used for multiple successive parses, some state may
leak from one run into the following one. That was introduced in
330552ea499ca474f65967160e9d4e50265f9631 "yacc.c: push: don't clear
the parser state when accepting/rejecting".
Reported by Ryan <dev@splintermail.com>
https://lists.gnu.org/r/bug-bison/2021-03/msg00000.html
* data/skeletons/yacc.c (yypush_parse): We reusing a pstate from a
previous run, do behave as if it were the first run.
* tests/push.at (Pstate reuse): Check this.
|
|
|
|
|
|
|
|
|
|
|
| |
The right-shift added in c22902e360e0fbbe9fd5657dcf107e03166da309
("tables: fix handling for useless tokens") is incorrect. In
particular, we need to reset the "new" bits.
Reported by Balázs Scheidler.
https://github.com/akimd/bison/issues/74
* src/tables.c (pos_set_set): Fix the right-shift.
|
|
|
|
| |
Also, fix a few http: URLs that were no longer working.
|
|
|
|
|
|
|
| |
Reported by Kaz Kylheku.
https://lists.gnu.org/r/bison-patches/2020-11/msg00019.html
* doc/bison.texi (Versioning): here.
|
|
|
|
|
| |
* doc/bison.texi (Versioning): New node about practices
regarding dealing with multiple versions of Bison.
|
|
|
|
|
|
| |
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
|
|
|
|
| |
* NEWS: Record release date.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some rare conditions, the generated parser can be wrong when there
are useless tokens.
Reported by Balázs Scheidler.
https://github.com/akimd/bison/issues/72
Balázs managed to prove that the bug was introduced in
commit af1c6f973a60a51c609903713ff8f7fce0887025
Author: Theophile Ranquet <ranquet@lrde.epita.fr>
Date: Tue Nov 13 10:38:49 2012 +0000
tables: use bitsets for a performance boost
Suggested by Yuri at
<http://lists.gnu.org/archive/html/bison-patches/2012-01/msg00000.html>.
The improvement is marginal for most grammars, but notable for large
grammars (e.g., PosgreSQL's postgre.y), and very large for the
sample.y grammar submitted by Yuri in
http://lists.gnu.org/archive/html/bison-patches/2012-01/msg00012.html.
Measured with --trace=time -fsyntax-only.
parser action tables postgre.y sample.y
Before 0,129 (44%) 37,095 (99%)
After 0,117 (42%) 5,046 (93%)
* src/tables.c (pos): Replace this set of integer coded as an unsorted
array of integers with...
(pos_set): this bitset.
which was implemented long ago, but that I installed only recently
(March 2019), first published in v3.3.90.
That patch introduces a bitset to represent a set of integers. It
managed negative integers by using a (fixed) base (the smallest
integer to represent). It avoided negative accesses into the bitset
by ignoring integers smaller than the base, under the asumption that
these cases correspond to useless tokens that are ignored anyway.
While it turns out to be true for all the test cases in the test suite
(!), Balázs' use case demonstrates that it is not always the case.
So we need to be able to accept negative integers that are smaller
than the current base.
"Amusingly" enough, the aforementioned patch was visibly unsure about
itself:
/* Store PLACE into POS_SET. PLACE might not belong to the set
of possible values for instance with useless tokens. It
would be more satisfying to eliminate the need for this
'if'. */
This commit needs several improvements in the future:
- support from bitset for bit assignment and shifts
- amortized resizing of pos_set
- test cases
* src/tables.c (pos_set_base, pos_set_dump, pos_set_set, pos_set_test):
New.
Use them instead of using bitset_set and bitset_test directly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There were several bugs in pruning that would leave the state-item
graph in an inconsistent state which could cause crashes later on:
- Pruning now happens in one pass instead of two.
- Disabled state-items no longer prune the state-items they transition
to if that state-item has other states that transition to it.
- State-items that transition to disabled state-items are always
pruned even if they have productions.
Reported by Michal Bartkowiak <michal.bartkowiak@nokia.com>
https://lists.gnu.org/r/bug-bison/2021-01/msg00000.html
and Zartaj Majeed
https://github.com/akimd/bison/issues/71
* src/state-item.c (prune_forward, prune_backward): Fuse into...
(prune_state_item): this.
Adjust callers.
|
|
|
|
|
|
|
| |
* cfg.mk: Currently we cannot update gnulib because of portability
issues with ancient versions of clang
(https://lists.gnu.org/r/bug-gnulib/2021-01/msg00241.html). So skip
the check about copyright date for gnulib.
|
| |
|
|
|
|
| |
Run 'make update-copyright'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently each time we meet %merge we record this location as the
defining location (and symbol). Instead, record the first definition.
In the generated code we go from
yy0->A = merge (*yy0, *yy1);
to
yy0->S = merge (*yy0, *yy1);
where S was indeed the first symbol, and in the diagnostics we go from
glr-regr18.y:30.18-24: error: result type clash on merge function 'merge': <type2> != <type1>
30 | sym2: sym3 %merge<merge> { $$ = $1; } ;
| ^~~~~~~
glr-regr18.y:29.18-24: note: previous declaration
29 | sym1: sym2 %merge<merge> { $$ = $1; } ;
| ^~~~~~~
glr-regr18.y:31.13-19: error: result type clash on merge function 'merge': <type3> != <type2>
31 | sym3: %merge<merge> { $$ = 0; } ;
| ^~~~~~~
glr-regr18.y:30.18-24: note: previous declaration
30 | sym2: sym3 %merge<merge> { $$ = $1; } ;
| ^~~~~~~
to
glr-regr18.y:30.18-24: error: result type clash on merge function 'merge': <type2> != <type1>
30 | sym2: sym3 %merge<merge> { $$ = $1; } ;
| ^~~~~~~
glr-regr18.y:29.18-24: note: previous declaration
29 | sym1: sym2 %merge<merge> { $$ = $1; } ;
| ^~~~~~~
glr-regr18.y:31.13-19: error: result type clash on merge function 'merge': <type3> != <type1>
31 | sym3: %merge<merge> { $$ = 0; } ;
| ^~~~~~~
glr-regr18.y:29.18-24: note: previous declaration
29 | sym1: sym2 %merge<merge> { $$ = $1; } ;
| ^~~~~~~
where both duplicates are reported against definition 1, rather than
using definition 1 as a reference when diagnosing about definition 2,
and then 2 as a reference for 3.
* src/reader.c (record_merge_function_type): Keep the first definition.
* tests/glr-regression.at: Adjust.
|
|
|
|
|
|
|
|
|
|
|
| |
Reported by Jot Dot.
https://lists.gnu.org/r/help-bison/2020-12/msg00014.html
* data/skeletons/glr.c, data/skeletons/glr2.cc (b4_call_merger): Use
the symbol's slot, not its type.
* examples/c/glr/c++-types.y: Use explicit per-symbol typing together
with api.value.type=union.
(yylex): Use yytoken_kind_t.
|
|
|
|
|
|
|
| |
Don't generate C code from bison, leave that to the skeletons.
* src/output.c (merger_output): Emit invocations to b4_call_merger.
* data/skeletons/glr.c (b4_call_merger): New.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Symbols are richer than types, and in M4 it is my simpler (and more
common) to deal with symbols rather than types. So let's associate
mergers to a symbol rather than a type name.
* src/reader.h (merger_list): Replace the 'type' member by a symbol
member.
* src/reader.c (record_merge_function_type): Take a symbol as
argument, rather than a type name.
* src/output.c (merger_output): Adjust.
|
|
|
|
| |
* tests/glr-regression.at: Use caret errors.
|
|
|
|
|
|
|
|
| |
Extracted from d9cf99b6a5cb0345e91dfb90fe6d6473024ea97a, in the master
branch.
* data/skeletons/bison.m4 (b4_symbol_slot): New, with safer semantics
than type and type_tag.
|
|
|
|
|
|
|
|
|
|
| |
This macro is not exposed to users, make start it with 'YY_'.
* data/skeletons/bison.m4, data/skeletons/c.m4, data/skeletons/glr.c,
* data/skeletons/glr.cc, data/skeletons/lalr1.cc,
* src/parse-gram.c, tests/actions.at, tests/c++.at, tests/headers.at,
* tests/local.at (YYUSE): Rename as...
(YY_USE): this.
|
|
|
|
| |
* src/parse-gram.y: Fix spelling.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The display of disabled state items is incorrect. The item is
stuttered, and lacks on end-of-line.
From
State 7:
1 exp: exp • "⊕" exp
-> 1 exp: exp "⊕" • exp
<- 1 exp: • exp "⊕" exp
2 exp: exp • "+" exp 2 exp: exp • "+" exp DISABLED
2 exp: exp "+" exp •
<- 2 exp: exp "+" • exp
3 exp: exp • "+" exp 3 exp: exp • "+" exp DISABLED
3 exp: exp "+" exp •
<- 3 exp: exp "+" • exp
to
State 7:
1 exp: exp • "⊕" exp
-> 1 exp: exp "⊕" • exp
<- 1 exp: • exp "⊕" exp
2 exp: exp • "+" exp DISABLED
2 exp: exp "+" exp •
<- 2 exp: exp "+" • exp
3 exp: exp • "+" exp DISABLED
3 exp: exp "+" exp •
<- 3 exp: exp "+" • exp
* src/state-item.c (state_items_report): Don't issue disabled items
twice, and issue two '\n' at their end.
* tests/conflicts.at: Check it.
|
|
|
|
|
|
|
|
| |
In 430ca0fc632f5e8072fe468b8a99c640985f6926, I completely forgot that
`puts` adds a `\n`.
* src/lssi.c, src/state-item.c: Restore missing end-of-lines in the
output.
|
|
|
|
|
|
|
| |
* src/counterexample.c (TIME_LIMIT): Replace with...
(time_limit): this.
(counterexample_init): Check $TIME_LIMIT.
* src/scan-gram.l: Reorder includes.
|
|
|
|
|
|
|
| |
When comparing traces from different machines, the mixture of
stdout/stderr in the output are making things uselessly difficult.
* src/lssi.c, src/state-item.c: Output debug traces on stderr.
|
|
|
|
|
| |
* doc/bison.texi: Disable another warning I'm tired to see.
New releases would be most welcome.
|
|
|
|
|
|
|
|
| |
When using glr.cc, the C function yyparse is an internal detail that
should not be exposed. Users might call it by accident (I did).
* data/skeletons/glr.c (yyparse): When used for glr.cc, rename as yy_parse_impl.
* data/skeletons/glr.cc: Adjust.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The yydefgoto table uses -1 as an invalid for an impossible case (we
never use yydefgoto[0], since it corresponds to the reduction to
$accept, which never happens). Since yydefgoto is a table of state
numbers, this -1 forces a signed type uselessly, which (1) might
trigger compiler warnings when storing a value from yydefgoto into a
state number (nonnegative), and (2) wastes bits which might result in
using a int16 where a uint8 suffices.
Reported by Jot Dot <jotdot@shaw.ca>.
https://lists.gnu.org/r/bug-bison/2020-11/msg00027.html
* src/tables.c (default_goto): Use 0 rather than -1 as invalid value.
* tests/regression.at: Adjust.
|
|
|
|
|
|
|
|
| |
Reported by Don Macpherson.
https://github.com/akimd/bison/issues/63
https://github.com/akimd/bison/issues/64
* data/skeletons/c++.m4, data/skeletons/lalr1.cc: here.
|
|
|
|
|
|
|
|
| |
When the shell option `nounset` is set, we may get "unbound variable"
errors.
https://lists.gnu.org/r/bug-bison/2020-11/msg00013.html
* examples/test (diff_opts): Be sure to initialize it.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Reported by Joe Nelson <joe@begriffs.com>.
https://lists.gnu.org/r/help-bison/2021-01/msg00004.html
Fixed by Paul Eggert in gnulib.
https://lists.gnu.org/r/bug-gnulib/2021-01/msg00156.html
* data/skeletons/c.m4 (b4_attribute_define): Adjust _Noreturn to
pedantic clang.
|
|
|
|
|
|
|
| |
Problem reported by Albert Chin in:
https://lists.gnu.org/r/bug-bison/2021-01/msg00029.html
* data/skeletons/c.m4 (b4_c99_int_type_define):
Work around HP-UX bug.
|
|
|
|
|
|
| |
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
|
|
|
|
| |
* NEWS: Record release date.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
YY_ASSERT (tok == token::YYEOF || tok == token::YYerror || tok == token::YYUNDEF || tok == 120 || tok == 49 || tok == 50 || tok == 51 || tok == 52 || tok == 53 || tok == 54 || tok == 55 || tok == 56 || tok == 57 || tok == 97 || tok == 98);
After:
YY_ASSERT (tok == token::YYEOF
|| (token::YYerror <= tok && tok <= token::YYUNDEF)
|| tok == 120
|| (49 <= tok && tok <= 57)
|| (97 <= tok && tok <= 98));
Clauses are now also wrapped on several lines. This is nicer to read
and diff, but also avoids pushing Visual C++ to its arbitrary
limits (640K and lines of 16380 bytes ought to be enough for anybody,
otherwise make an C2026 error).
The useless parens are there for the dummy warnings about
precedence (in the future, will we also have to put parens in
`1+2*3`?).
* data/skeletons/variant.hh (_b4_filter_tokens, b4_tok_in, b4_tok_in):
New.
(_b4_token_constructor_define): Use them.
|
|
|
|
|
|
| |
* data/skeletons/bison.m4 (b4_type_foreach): Accept a separator.
* data/skeletons/c++.m4: Use it.
And fix an incorrect comment.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Working on the previous commit I realized that YY_ASSERT was used in
the generated headers, so must follow api.prefix to avoid clashes when
multiple C++ parser with variants are used.
Actually many more macros should obey api.prefix (YY_CPLUSPLUS,
YY_COPY, etc.). There was no complaint so far, so it's not urgent
enough for 3.7.4, but it should be addressed in 3.8.
* data/skeletons/variant.hh (b4_assert): New.
Use it.
* tests/local.at (AT_YYLEX_RETURN): Fix.
* tests/headers.at: Make sure variant-based C++ parsers are checked
too.
This test did find that YY_ASSERT escaped renaming (before the fix in
this commit).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some extreme situations (about 800 tokens), we generate a
single-line assertion long enough for Visual C++ to discard the end of
the line, thus falling into parse ends for the missing `);`. On a
shorter example:
YY_ASSERT (tok == token::TOK_YYEOF || tok == token::TOK_YYerror || tok == token::TOK_YYUNDEF || tok == token::TOK_ASSIGN || tok == token::TOK_MINUS || tok == token::TOK_PLUS || tok == token::TOK_STAR || tok == token::TOK_SLASH || tok == token::TOK_LPAREN || tok == token::TOK_RPAREN);
Whether NDEBUG is used or not is irrelevant, the parser dies anyway.
Reported by Jot Dot <jotdot@shaw.ca>.
https://lists.gnu.org/r/bug-bison/2020-11/msg00002.html
We should avoid emitting lines so long.
We probably should also use a range-based assertion (with extraneous
parens to pacify fascist compilers):
YY_ASSERT ((token::TOK_YYEOF <= tok && tok <= token::TOK_YYUNDEF)
|| (token::TOK_ASSIGN <= tok && ...)
But anyway, we should simply not emit this assertion at all when not
asked for.
* data/skeletons/variant.hh: Do not define, nor use, YY_ASSERT when it
is not enabled.
|
|
|
|
| |
* data/skeletons/variant.hh: here.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Suggested by Balazs Scheidler.
https://github.com/akimd/bison/issues/55
* src/muscle-tab.c (muscle_init): Move/rename `b4_version` to/as...
* src/output.c (prepare): `b4_version_string`.
Also define `b4_version`.
* data/skeletons/bison.m4, data/skeletons/c.m4, data/skeletons/d.m4,
* data/skeletons/java.m4: Adjust.
* doc/bison.texi: Document it.
|
| |
|
|
|
|
|
|
| |
* src/parse-gram.y (str_to_version): Rename as/move to...
* src/strversion.h, src/strversion.c (strversion_to_int): these new
files.
|
|
|
|
|
|
| |
* src/parse-gram.y (str_to_version): Support three parts.
* data/skeletons/location.cc, data/skeletons/stack.hh:
Adjust.
|
|
|
|
|
|
|
|
|
| |
When generating a C parser, YYEMPTY is present in enum yytokentype but
there is no corresponding #define like there is for the other values.
There is a special case for YYEMPTY in b4_token_enums but no
corresponding case in b4_token_defines.
* data/skeletons/c.m4 (b4_token_defines): Do define YYEMPTY.
|
| |
|
|
|
|
|
|
|
|
| |
Reported by Gaurav Singh <gaurav.singh199709@yahoo.com>.
https://lists.gnu.org/r/bug-bison/2020-11/msg00000.html
* doc/bison.texi (Rpcalc Expr): Rename as...
(Rpcalc Exp): this, as the nterm is named 'exp'.
|
|
|
|
| |
* doc/bison.texi: Minor fixes in counterexamples section.
|
|
|
|
| |
* README: here.
|