mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 18:23:03 +00:00
Merge branch 'origin/maint'
* origin/maint: maint: credit Wojciech Polak maint: post-release administrivia version 2.7 yacc.c: scope reduction tests: C90 compliance fix C90 compliance glr.c: scope reduction gnulib: update Conflicts: NEWS gnulib src/scan-gram.l src/system.h
This commit is contained in:
@@ -1 +1 @@
|
|||||||
2.6.90
|
2.7
|
||||||
|
|||||||
12
NEWS
12
NEWS
@@ -240,17 +240,14 @@ GNU Bison NEWS
|
|||||||
It used to be an error only if used in non GLR mode, _and_ if there are
|
It used to be an error only if used in non GLR mode, _and_ if there are
|
||||||
reduce/reduce conflicts.
|
reduce/reduce conflicts.
|
||||||
|
|
||||||
* Noteworthy changes in release ?.? (????-??-??) [?]
|
* Noteworthy changes in release 2.7 (2012-12-12) [stable]
|
||||||
|
|
||||||
** %language is no longer an experimental feature.
|
|
||||||
|
|
||||||
The introduction of this feature, in 2.4, was four years ago. The --language
|
|
||||||
option and the %language directive are no longer experimental.
|
|
||||||
|
|
||||||
** Bug fixes
|
** Bug fixes
|
||||||
|
|
||||||
Warnings about uninitialized yylloc in yyparse have been fixed.
|
Warnings about uninitialized yylloc in yyparse have been fixed.
|
||||||
|
|
||||||
|
Restored C90 compliance (yet no report was ever made).
|
||||||
|
|
||||||
** Diagnostics are improved
|
** Diagnostics are improved
|
||||||
|
|
||||||
*** Changes in the format of error messages
|
*** Changes in the format of error messages
|
||||||
@@ -748,6 +745,7 @@ GNU Bison NEWS
|
|||||||
|
|
||||||
These features are experimental in this version. More user feedback
|
These features are experimental in this version. More user feedback
|
||||||
will help to stabilize them.
|
will help to stabilize them.
|
||||||
|
Contributed by Alex Rozenman.
|
||||||
|
|
||||||
** IELR(1) and canonical LR(1):
|
** IELR(1) and canonical LR(1):
|
||||||
|
|
||||||
@@ -1264,6 +1262,7 @@ GNU Bison NEWS
|
|||||||
|
|
||||||
The current Java interface is experimental and may evolve. More user
|
The current Java interface is experimental and may evolve. More user
|
||||||
feedback will help to stabilize it.
|
feedback will help to stabilize it.
|
||||||
|
Contributed by Paolo Bonzini.
|
||||||
|
|
||||||
** %language
|
** %language
|
||||||
|
|
||||||
@@ -1277,6 +1276,7 @@ GNU Bison NEWS
|
|||||||
Bison can now generate an XML report of the LALR(1) automaton using the new
|
Bison can now generate an XML report of the LALR(1) automaton using the new
|
||||||
"--xml" option. The current XML schema is experimental and may evolve. More
|
"--xml" option. The current XML schema is experimental and may evolve. More
|
||||||
user feedback will help to stabilize it.
|
user feedback will help to stabilize it.
|
||||||
|
Contributed by Wojciech Polak.
|
||||||
|
|
||||||
** The grammar file may now specify the name of the parser header file using
|
** The grammar file may now specify the name of the parser header file using
|
||||||
%defines. For example:
|
%defines. For example:
|
||||||
|
|||||||
1
THANKS
1
THANKS
@@ -127,6 +127,7 @@ Vin Shelton acs@alumni.princeton.edu
|
|||||||
W.C.A. Wijngaards wouter@NLnetLabs.nl
|
W.C.A. Wijngaards wouter@NLnetLabs.nl
|
||||||
Wayne Green wayne@infosavvy.com
|
Wayne Green wayne@infosavvy.com
|
||||||
Wei Song wsong83@gmail.com
|
Wei Song wsong83@gmail.com
|
||||||
|
Wojciech Polak polak@gnu.org
|
||||||
Wolfgang S. Kechel wolfgang.kechel@prs.de
|
Wolfgang S. Kechel wolfgang.kechel@prs.de
|
||||||
Wolfram Wagner ww@mpi-sb.mpg.de
|
Wolfram Wagner ww@mpi-sb.mpg.de
|
||||||
Wwp subscript@free.fr
|
Wwp subscript@free.fr
|
||||||
|
|||||||
21
data/glr.c
21
data/glr.c
@@ -286,7 +286,7 @@ b4_percent_code_get[]dnl
|
|||||||
# include <setjmp.h>
|
# include <setjmp.h>
|
||||||
# define YYJMP_BUF jmp_buf
|
# define YYJMP_BUF jmp_buf
|
||||||
# define YYSETJMP(Env) setjmp (Env)
|
# define YYSETJMP(Env) setjmp (Env)
|
||||||
// Pacify clang.
|
/* Pacify clang. */
|
||||||
# define YYLONGJMP(Env, Val) (longjmp (Env, Val), YYASSERT (0))
|
# define YYLONGJMP(Env, Val) (longjmp (Env, Val), YYASSERT (0))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1997,10 +1997,10 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
#if ! YYERROR_VERBOSE
|
#if ! YYERROR_VERBOSE
|
||||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||||
#else
|
#else
|
||||||
|
{
|
||||||
yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
|
yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
|
||||||
size_t yysize0 = yytnamerr (YY_NULL, yytokenName (yytoken));
|
size_t yysize0 = yytnamerr (YY_NULL, yytokenName (yytoken));
|
||||||
size_t yysize = yysize0;
|
size_t yysize = yysize0;
|
||||||
size_t yysize1;
|
|
||||||
yybool yysize_overflow = yyfalse;
|
yybool yysize_overflow = yyfalse;
|
||||||
char* yymsg = YY_NULL;
|
char* yymsg = YY_NULL;
|
||||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||||
@@ -2060,9 +2060,11 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
yyarg[yycount++] = yytokenName (yyx);
|
yyarg[yycount++] = yytokenName (yyx);
|
||||||
yysize1 = yysize + yytnamerr (YY_NULL, yytokenName (yyx));
|
{
|
||||||
yysize_overflow |= yysize1 < yysize;
|
size_t yysz = yysize + yytnamerr (YY_NULL, yytokenName (yyx));
|
||||||
yysize = yysize1;
|
yysize_overflow |= yysz < yysize;
|
||||||
|
yysize = yysz;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2082,9 +2084,11 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
#undef YYCASE_
|
#undef YYCASE_
|
||||||
}
|
}
|
||||||
|
|
||||||
yysize1 = yysize + strlen (yyformat);
|
{
|
||||||
yysize_overflow |= yysize1 < yysize;
|
size_t yysz = yysize + strlen (yyformat);
|
||||||
yysize = yysize1;
|
yysize_overflow |= yysz < yysize;
|
||||||
|
yysize = yysz;
|
||||||
|
}
|
||||||
|
|
||||||
if (!yysize_overflow)
|
if (!yysize_overflow)
|
||||||
yymsg = (char *) YYMALLOC (yysize);
|
yymsg = (char *) YYMALLOC (yysize);
|
||||||
@@ -2114,6 +2118,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
yyerror (]b4_lyyerror_args[YY_("syntax error"));
|
||||||
yyMemoryExhausted (yystackp);
|
yyMemoryExhausted (yystackp);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif /* YYERROR_VERBOSE */
|
#endif /* YYERROR_VERBOSE */
|
||||||
yynerrs += 1;
|
yynerrs += 1;
|
||||||
}
|
}
|
||||||
|
|||||||
23
data/yacc.c
23
data/yacc.c
@@ -1147,7 +1147,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
|||||||
{
|
{
|
||||||
YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
|
YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
|
||||||
YYSIZE_T yysize = yysize0;
|
YYSIZE_T yysize = yysize0;
|
||||||
YYSIZE_T yysize1;
|
|
||||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||||
/* Internationalized format string. */
|
/* Internationalized format string. */
|
||||||
const char *yyformat = YY_NULL;
|
const char *yyformat = YY_NULL;
|
||||||
@@ -1224,11 +1223,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
yyarg[yycount++] = yytname[yyx];
|
yyarg[yycount++] = yytname[yyx];
|
||||||
yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
|
{
|
||||||
if (! (yysize <= yysize1
|
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
|
||||||
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
if (! (yysize <= yysize1
|
||||||
return 2;
|
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||||
yysize = yysize1;
|
return 2;
|
||||||
|
yysize = yysize1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}]b4_lac_if([[
|
}]b4_lac_if([[
|
||||||
# if ]b4_api_PREFIX[DEBUG
|
# if ]b4_api_PREFIX[DEBUG
|
||||||
@@ -1252,10 +1253,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
|||||||
# undef YYCASE_
|
# undef YYCASE_
|
||||||
}
|
}
|
||||||
|
|
||||||
yysize1 = yysize + yystrlen (yyformat);
|
{
|
||||||
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
|
||||||
return 2;
|
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||||
yysize = yysize1;
|
return 2;
|
||||||
|
yysize = yysize1;
|
||||||
|
}
|
||||||
|
|
||||||
if (*yymsg_alloc < yysize)
|
if (*yymsg_alloc < yysize)
|
||||||
{
|
{
|
||||||
|
|||||||
2
gnulib
2
gnulib
Submodule gnulib updated: daf7f8c022...4a8c422f31
@@ -24,38 +24,48 @@
|
|||||||
|
|
||||||
#include "state.h"
|
#include "state.h"
|
||||||
|
|
||||||
/// Begin a Dot graph.
|
/** Begin a Dot graph.
|
||||||
/// \param fout output stream.
|
*
|
||||||
|
* \param fout output stream.
|
||||||
|
*/
|
||||||
void start_graph (FILE *fout);
|
void start_graph (FILE *fout);
|
||||||
|
|
||||||
/// Output a Dot node.
|
/** Output a Dot node.
|
||||||
/// \param id identifier of the node
|
*
|
||||||
/// \param label human readable label of the node (no Dot escaping needed).
|
* \param id identifier of the node
|
||||||
/// \param fout output stream.
|
* \param label human readable label of the node (no Dot escaping needed).
|
||||||
|
* \param fout output stream.
|
||||||
|
*/
|
||||||
void output_node (int id, char const *label, FILE *fout);
|
void output_node (int id, char const *label, FILE *fout);
|
||||||
|
|
||||||
/// Output a Dot edge.
|
/** Output a Dot edge.
|
||||||
/// \param source id of the source node
|
* \param source id of the source node
|
||||||
/// \param destination id of the target node
|
* \param destination id of the target node
|
||||||
/// \param label human readable label of the edge
|
* \param label human readable label of the edge
|
||||||
/// (no Dot escaping needed). Can be 0.
|
* (no Dot escaping needed). Can be 0.
|
||||||
/// \param style Dot style of the edge (e.g., "dotted" or "solid").
|
* \param style Dot style of the edge (e.g., "dotted" or "solid").
|
||||||
/// \param fout output stream.
|
* \param fout output stream.
|
||||||
|
*/
|
||||||
void output_edge (int source, int destination, char const *label,
|
void output_edge (int source, int destination, char const *label,
|
||||||
char const *style, FILE *fout);
|
char const *style, FILE *fout);
|
||||||
|
|
||||||
/// Output a reduction.
|
/** Output a reduction.
|
||||||
/// \param s current state
|
* \param s current state
|
||||||
/// \param reds the set of reductions
|
* \param reds the set of reductions
|
||||||
/// \param fout output stream.
|
* \param fout output stream.
|
||||||
|
*/
|
||||||
void output_red (state const *s, reductions const *reds, FILE *fout);
|
void output_red (state const *s, reductions const *reds, FILE *fout);
|
||||||
|
|
||||||
/// End a Dot graph.
|
/** End a Dot graph.
|
||||||
/// \param fout output stream.
|
*
|
||||||
|
* \param fout output stream.
|
||||||
|
*/
|
||||||
void finish_graph (FILE *fout);
|
void finish_graph (FILE *fout);
|
||||||
|
|
||||||
/// Escape a lookahead token.
|
/** Escape a lookahead token.
|
||||||
/// \param name the token.
|
*
|
||||||
|
* \param name the token.
|
||||||
|
*/
|
||||||
char const *escape (char const *name);
|
char const *escape (char const *name);
|
||||||
|
|
||||||
#endif /* ! GRAPHVIZ_H_ */
|
#endif /* ! GRAPHVIZ_H_ */
|
||||||
|
|||||||
@@ -758,8 +758,8 @@ ielr_compute_state (bitsetv follow_kernel_items, bitsetv always_follows,
|
|||||||
if (!bitset_empty_p (lookaheads[i]))
|
if (!bitset_empty_p (lookaheads[i]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// bitset_equal_p uses the size of the first argument, so
|
/* bitset_equal_p uses the size of the first argument,
|
||||||
// lookaheads[i] must be the second argument.
|
so lookaheads[i] must be the second argument. */
|
||||||
else if (!bitset_equal_p ((*this_isocorep)->lookaheads[i],
|
else if (!bitset_equal_p ((*this_isocorep)->lookaheads[i],
|
||||||
lookaheads[i]))
|
lookaheads[i]))
|
||||||
break;
|
break;
|
||||||
@@ -1187,8 +1187,8 @@ ielr (void)
|
|||||||
free (to_state);
|
free (to_state);
|
||||||
if (lr_type == LR_TYPE__CANONICAL_LR)
|
if (lr_type == LR_TYPE__CANONICAL_LR)
|
||||||
{
|
{
|
||||||
// Reduction lookaheads are computed in ielr_split_states above but are
|
/* Reduction lookaheads are computed in ielr_split_states above
|
||||||
// timed as part of phase 4.
|
but are timed as part of phase 4. */
|
||||||
set_goto_map ();
|
set_goto_map ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1012,7 +1012,7 @@ unexpected_end (boundary start, char const *msgid, char const *token_end)
|
|||||||
loc.start = start;
|
loc.start = start;
|
||||||
loc.end = scanner_cursor;
|
loc.end = scanner_cursor;
|
||||||
token_end = quote (token_end);
|
token_end = quote (token_end);
|
||||||
// Instead of '\'', display "'".
|
/* Instead of '\'', display "'". */
|
||||||
if (STREQ (token_end, "'\\''"))
|
if (STREQ (token_end, "'\\''"))
|
||||||
token_end = "\"'\"";
|
token_end = "\"'\"";
|
||||||
complain (&loc, complaint, _(msgid), token_end);
|
complain (&loc, complaint, _(msgid), token_end);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
typedef size_t uintptr_t;
|
typedef size_t uintptr_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Version mismatch.
|
/* Version mismatch. */
|
||||||
#define EX_MISMATCH 63
|
#define EX_MISMATCH 63
|
||||||
|
|
||||||
/*---------.
|
/*---------.
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ AT_DATA_GRAMMAR([[input.y]],
|
|||||||
%code
|
%code
|
||||||
{
|
{
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# include <stdlib.h> // getenv
|
# include <stdlib.h> /* getenv */
|
||||||
]AT_YYERROR_DECLARE[
|
]AT_YYERROR_DECLARE[
|
||||||
]AT_YYLEX_DECLARE[
|
]AT_YYLEX_DECLARE[
|
||||||
}
|
}
|
||||||
@@ -195,7 +195,7 @@ AT_DATA_GRAMMAR([[input.y]],
|
|||||||
%code
|
%code
|
||||||
{
|
{
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# include <stdlib.h> // getenv
|
# include <stdlib.h> /* getenv */
|
||||||
]AT_YYERROR_DECLARE[
|
]AT_YYERROR_DECLARE[
|
||||||
]AT_YYLEX_DECLARE[
|
]AT_YYLEX_DECLARE[
|
||||||
}
|
}
|
||||||
@@ -223,6 +223,7 @@ main (void)
|
|||||||
|
|
||||||
TEST(7, 2, 0, 2);
|
TEST(7, 2, 0, 2);
|
||||||
TEST(8, 0, 8, 0);
|
TEST(8, 0, 8, 0);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
|||||||
@@ -195,10 +195,11 @@ yylex (void)
|
|||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
int res;
|
||||||
input = stdin;
|
input = stdin;
|
||||||
if (argc == 2 && !(input = fopen (argv[1], "r")))
|
if (argc == 2 && !(input = fopen (argv[1], "r")))
|
||||||
return 3;
|
return 3;
|
||||||
int res = yyparse ();
|
res = yyparse ();
|
||||||
if (argc == 2 && fclose (input))
|
if (argc == 2 && fclose (input))
|
||||||
return 4;
|
return 4;
|
||||||
return res;
|
return res;
|
||||||
@@ -327,10 +328,11 @@ int yylex (void)
|
|||||||
int
|
int
|
||||||
main(int argc, char* argv[])
|
main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
int res;
|
||||||
input = stdin;
|
input = stdin;
|
||||||
if (argc == 2 && !(input = fopen (argv[1], "r")))
|
if (argc == 2 && !(input = fopen (argv[1], "r")))
|
||||||
return 3;
|
return 3;
|
||||||
int res = yyparse ();
|
res = yyparse ();
|
||||||
if (argc == 2 && fclose (input))
|
if (argc == 2 && fclose (input))
|
||||||
return 4;
|
return 4;
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ AT_BISON_OPTION_PUSHDEFS
|
|||||||
|
|
||||||
AT_DATA([syncline.c],
|
AT_DATA([syncline.c],
|
||||||
[[#error "1"
|
[[#error "1"
|
||||||
int i; // avoids -pedantic warning about an empty translation unit
|
int i; /* avoids -pedantic warning about an empty translation unit. */
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_SYNCLINES_COMPILE([syncline.c])
|
AT_SYNCLINES_COMPILE([syncline.c])
|
||||||
|
|||||||
Reference in New Issue
Block a user