Merge tag 'v2.5.1_rc2'

Bison 2.5.1_rc2.

* tag 'v2.5.1_rc2': (34 commits)
  Bison 2.5.1_rc2.
  doc: fixes.
  build: fix ChangeLog generation.
  c++: compute the header guards.
  skeletons: remove support for unused directive.
  lalr1.cc: improve Doxygen documentation.
  lalr1.cc: extract stack.hh.
  news: convert to double quotes.
  space changes.
  build: do not prototype flex-generated functions.
  build: fix ChangeLog generation.
  Bison 2.5.1_rc1.
  tests: save/restore Autotest special files when checking XML support.
  tests: AT_SAVE_SPECIAL_FILES / AT_RESTORE_SPECIAL_FILES.
  tests: honor TESTSUITEFLAGS in all the check targets.
  build: do not enable c++ warnings on 0 when nullptr is not supported.
  maint: update gnulib.
  build: config.in.h.
  build: move silent rules.
  glr.c: reduce variable scopes.
  maint: maintainer-release-check.
  maint: shush a syntax-check.
  maint: prefer "commit message" to "log entry".
  command line: fix minor leaks.
  maint: we no longer maintain the ChangeLog.
  maint: fix the generation of the synclines for bison's parser.
  maint: regen.
  maint: import the xmemdup0 gnulib module.
  maint: remove left-over gnulib modules.
  maint: ignore files imported by autopoint.
  build: AC_PROG_LEX: use more readable variable names.
  maint: regen src/parse-gram.[ch]
  maint: simplify parse-gram.y
  maint: s/strncpy/memcpy/, when equivalent

Conflicts:
	Makefile.am
	NEWS
	data/glr.c
	data/lalr1.cc
	data/stack.hh
	examples/rpcalc/local.mk
	src/flex-scanner.h
	src/getargs.c
	src/output.c
	src/parse-gram.c
	src/parse-gram.h
	src/parse-gram.y
	tests/Makefile.am
	tests/bison.in
This commit is contained in:
Akim Demaille
2012-05-24 13:37:28 +02:00
29 changed files with 530 additions and 378 deletions

View File

@@ -21,7 +21,20 @@
# error "FLEX_PREFIX not defined"
#endif
/* Whether this version of Flex is (strictly) greater than
Major.Minor.Subminor. */
#define FLEX_VERSION_GT(Major, Minor, Subminor) \
(defined YY_FLEX_MAJOR_VERSION \
&& (Major < YY_FLEX_MAJOR_VERSION \
|| (Major == YY_FLEX_MAJOR_VERSION \
&& (defined YY_FLEX_MINOR_VERSION \
&& (Minor < YY_FLEX_MINOR_VERSION \
|| (Minor == YY_FLEX_MINOR_VERSION \
&& defined YY_FLEX_SUBMINOR_VERSION \
&& Subminor < YY_FLEX_SUBMINOR_VERSION))))))
/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */
#if ! FLEX_VERSION_GT (2, 5, 31)
int FLEX_PREFIX (get_lineno) (void);
FILE *FLEX_PREFIX (get_in) (void);
FILE *FLEX_PREFIX (get_out) (void);
@@ -33,6 +46,7 @@ void FLEX_PREFIX (set_out) (FILE *);
int FLEX_PREFIX (get_debug) (void);
void FLEX_PREFIX (set_debug) (int);
int FLEX_PREFIX (lex_destroy) (void);
#endif
#define last_string FLEX_PREFIX (last_string)
@@ -51,12 +65,7 @@ int FLEX_PREFIX (lex_destroy) (void);
versions according to the Flex manual) leak memory if yylex_destroy is not
invoked. However, yylex_destroy is not defined before Flex 2.5.9, so give
an implementation here that at least appears to work with Flex 2.5.4. */
#if !defined YY_FLEX_MAJOR_VERSION || YY_FLEX_MAJOR_VERSION < 2 \
|| (YY_FLEX_MAJOR_VERSION == 2 \
&& (!defined YY_FLEX_MINOR_VERSION || YY_FLEX_MINOR_VERSION < 5 \
|| (YY_FLEX_MINOR_VERSION == 5 \
&& (!defined YY_FLEX_SUBMINOR_VERSION \
|| YY_FLEX_SUBMINOR_VERSION < 9))))
#if ! FLEX_VERSION_GT (2, 5, 9)
# define yylex_destroy() yy_delete_buffer (YY_CURRENT_BUFFER)
#endif
@@ -73,16 +82,16 @@ int FLEX_PREFIX (lex_destroy) (void);
static struct obstack obstack_for_string;
#define STRING_GROW \
# define STRING_GROW \
obstack_grow (&obstack_for_string, yytext, yyleng)
#define STRING_FINISH \
# define STRING_FINISH \
do { \
obstack_1grow (&obstack_for_string, '\0'); \
last_string = obstack_finish (&obstack_for_string); \
} while (0)
#define STRING_FREE \
# define STRING_FREE \
obstack_free (&obstack_for_string, last_string)
#endif

View File

@@ -603,13 +603,19 @@ getargs (int argc, char *argv[])
/* Here, the -d and --defines options are differentiated. */
defines_flag = true;
if (optarg)
spec_defines_file = xstrdup (AS_FILE_NAME (optarg));
{
free (spec_defines_file);
spec_defines_file = xstrdup (AS_FILE_NAME (optarg));
}
break;
case 'g':
graph_flag = true;
if (optarg)
spec_graph_file = xstrdup (AS_FILE_NAME (optarg));
{
free (spec_graph_file);
spec_graph_file = xstrdup (AS_FILE_NAME (optarg));
}
break;
case 'h':
@@ -648,7 +654,10 @@ getargs (int argc, char *argv[])
case 'x':
xml_flag = true;
if (optarg)
spec_xml_file = xstrdup (AS_FILE_NAME (optarg));
{
free (spec_xml_file);
spec_xml_file = xstrdup (AS_FILE_NAME (optarg));
}
break;
case 'y':
@@ -669,6 +678,7 @@ getargs (int argc, char *argv[])
exit (EXIT_SUCCESS);
case REPORT_FILE_OPTION:
free (spec_verbose_file);
spec_verbose_file = xstrdup (AS_FILE_NAME (optarg));
break;

View File

@@ -32,6 +32,7 @@
#include "symlist.h"
#include "scan-gram.h"
#include "scan-code.h"
#include "xmemdup0.h"
#define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
static YYLTYPE lloc_default (YYLTYPE const *, int);
@@ -353,7 +354,7 @@ prologue_declaration:
xmalloc (dir_length + 1 + strlen (skeleton_user) + 1);
if (dir_length > 0)
{
strncpy (skeleton_build, current_file, dir_length);
memcpy (skeleton_build, current_file, dir_length);
skeleton_build[dir_length++] = '/';
}
strcpy (skeleton_build + dir_length, skeleton_user);
@@ -775,17 +776,7 @@ add_param (param_type type, char *decl, location loc)
complain_at (loc, _("missing identifier in parameter declaration"));
else
{
char *name;
size_t name_len;
for (name_len = 1;
memchr (alphanum, name_start[name_len], sizeof alphanum);
name_len++)
continue;
name = xmalloc (name_len + 1);
memcpy (name, name_start, name_len);
name[name_len] = '\0';
char *name = xmemdup0 (name_start, strspn (name_start, alphanum));
if (type & param_lex)
muscle_pair_list_grow ("lex_param", decl, name);
if (type & param_parse)

View File

@@ -77,7 +77,6 @@ static void fail_for_invalid_at (char const *at);
"@oline@" fprintf (yyout, "%d", out_lineno + 1);
"@ofile@" QPUTS (outname);
"@dir_prefix@" QPUTS (dir_prefix);
@[a-z_]+"(" {
yytext[yyleng-1] = '\0';