]> git.saurik.com Git - bison.git/commitdiff
Merge tag 'v2.5.1_rc2'
authorAkim Demaille <akim@lrde.epita.fr>
Thu, 24 May 2012 11:37:28 +0000 (13:37 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Thu, 24 May 2012 11:54:55 +0000 (13:54 +0200)
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

23 files changed:
1  2 
Makefile.am
NEWS
README-hacking
THANKS
bootstrap.conf
build-aux/.gitignore
cfg.mk
configure.ac
data/c.m4
data/glr.c
data/lalr1.cc
data/location.cc
data/stack.hh
doc/bison.texinfo
m4/.gitignore
po/.gitignore
runtime-po/.gitignore
src/flex-scanner.h
src/getargs.c
src/parse-gram.y
src/scan-skel.l
tests/local.at
tests/regression.at

diff --cc Makefile.am
Simple merge
diff --cc NEWS
Simple merge
diff --cc README-hacking
Simple merge
diff --cc THANKS
Simple merge
diff --cc bootstrap.conf
Simple merge
index 3a663bf0ea32a4706c90b5c51042733bb9679550,f09add4fee02c2ce41762de4fa97feabb7a09ab9..008e7452f152e8deff297954ea0b30bdd88bb344
@@@ -4,6 -6,6 +4,7 @@@
  /compile
  /config.guess
  /config.rpath
++/config.rpath~
  /config.sub
  /depcomp
  /gendocs.sh
diff --cc cfg.mk
index ce7553932cc977519263e4f293ec96e1118eeacc,a208fe9ca46a022d40c39ec7fb66ca5cf1588165..6ccef9c92ac3da4292f528363b9e77f1d8a0886d
--- 1/cfg.mk
--- 2/cfg.mk
+++ b/cfg.mk
@@@ -56,11 -62,12 +56,12 @@@ $(call exclude,                                                            
    bindtextdomain=^lib/main.c$$                                                \
    program_name=^lib/main.c$$                                          \
    prohibit_always-defined_macros=^data/yacc.c|^djgpp/                 \
+   prohibit_always-defined_macros+=?|^lib/timevar.c$$                  \
    prohibit_always-defined_macros+=?|^src/(parse-gram.c|system.h)$$    \
    prohibit_always-defined_macros+=?|^tests/regression.at$$            \
 -  prohibit_empty_lines_at_EOF=^src/parse-gram.[ch]$$                  \
 +  prohibit_empty_lines_at_EOF=^src/parse-gram.h$$                     \
 +  prohibit_strcmp=^doc/bison\.texinfo$$                                       \
    require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$          \
    space_tab=^tests/(input|c\+\+)\.at$$                                        \
 -  trailing_blank=^src/parse-gram.[ch]$$                                       \
    unmarked_diagnostics=^djgpp/                                                \
  )
diff --cc configure.ac
Simple merge
diff --cc data/c.m4
Simple merge
diff --cc data/glr.c
index e6a8e3818a7adbec1ba9668b2ac0272aa3fdeb14,5f7aac84870ae0110d3ad29fc34fb5068342c335..8f77aa61d330b619770295cfd8bfe26a90b4661e
@@@ -810,21 -868,13 +810,20 @@@ static void yyfillin (yyGLRStackItem *
  static void
  yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
  {
-   yyGLRState* s;
    int i;
-   s = yyvsp[yylow0].yystate.yypred;
+   yyGLRState *s = yyvsp[yylow0].yystate.yypred;
    for (i = yylow0-1; i >= yylow1; i -= 1)
      {
 -      YYASSERT (s->yyresolved);
 -      yyvsp[i].yystate.yyresolved = yytrue;
 -      yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval;]b4_locations_if([[
 +#if YYDEBUG
 +      yyvsp[i].yystate.yylrState = s->yylrState;
 +#endif
 +      yyvsp[i].yystate.yyresolved = s->yyresolved;
 +      if (s->yyresolved)
 +        yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval;
 +      else
 +        /* The effect of using yysval or yyloc (in an immediate rule) is
 +         * undefined.  */
 +        yyvsp[i].yystate.yysemantics.yyfirstVal = YY_NULL;]b4_locations_if([[
        yyvsp[i].yystate.yyloc = s->yyloc;]])[
        s = yyvsp[i].yystate.yypred = s->yypred;
      }
diff --cc data/lalr1.cc
index ef5e1cee4a871030d8ef7e933bad51559b247e4b,4f0b268880d01b16ffa14eca65dcb3b839616993..92f93c2c75d6b98a9bdac4d4f10bd5d74a2f19cb
@@@ -124,24 -24,28 +124,27 @@@ m4_define([b4_parser_class_name]
  b4_defines_if([],
                [b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
  
 -b4_percent_define_ifdef([[location_type]], [],
 +b4_locations_if([b4_percent_define_ifdef([[location_type]], [],
    [# Backward compatibility.
--  m4_define([b4_location_constructors])
-   m4_include(b4_pkgdatadir/[location.cc])])])
 -  m4_include(b4_pkgdatadir/[location.cc])])
++   m4_define([b4_location_constructors])
++   m4_include(b4_pkgdatadir/[location.cc])])])
  m4_include(b4_pkgdatadir/[stack.hh])
 +b4_variant_if([m4_include(b4_pkgdatadir/[variant.hh])])
  
  # We do want M4 expansion after # for CPP macros.
  m4_changecom()
  m4_divert_push(0)dnl
 -b4_defines_if(
 -[@output(b4_spec_defines_file@)@
 -b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
 -             [2002-2012])
 +@output(b4_spec_defines_file@)@
 +b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++])
- dnl FIXME: This is wrong, we want computed header guards.
  [
+ /**
+  ** \file ]b4_spec_defines_file[
+  ** Define the ]b4_namespace_ref[::parser class.
+  */
  /* C++ LALR(1) parser skeleton written by Akim Demaille.  */
  
- #ifndef PARSER_HEADER_H
- # define PARSER_HEADER_H
+ ]b4_cpp_guard_open([b4_spec_defines_file])[
  
  ]b4_percent_code_get([[requires]])[
  
@@@ -358,12 -281,13 +361,11 @@@ b4_public_types_define])
   /* Redirection for backward compatibility.  */
  # define YYSTYPE b4_namespace_ref::b4_parser_class_name::semantic_type
  #endif
- ])
- b4_percent_code_get([[provides]])[]dnl
- [#endif /* ! defined PARSER_HEADER_H */]
+ ])[
+ ]b4_percent_code_get([[provides]])[
+ ]b4_cpp_guard_close([b4_spec_defines_file])
 -])dnl
  @output(b4_parser_file_name@)@
 -b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
 -             [2002-2012])
 +b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++])
  b4_percent_code_get([[top]])[]dnl
  m4_if(b4_prefix, [yy], [],
  [
index e750779c0fc8de053cf6c4e9ea3dd51d3ee664ba,f45f634e20b0dad26e1ea75c9912ec5732aa1855..976fc34b235fe9cec3f378ff9af61bc75d84145b
@@@ -22,10 -19,11 +22,10 @@@ m4_pushdef([b4_copyright_years]
  m4_changecom()
  m4_divert_push(0)dnl
  @output(b4_dir_prefix[]position.hh@)@
 -b4_copyright([Positions for Bison parsers in C++],
 -             [2002-2007, 2009-2012])[
 +b4_copyright([Positions for Bison parsers in C++])[
  
  /**
-  ** \file position.hh
+  ** \file ]b4_dir_prefix[position.hh
   ** Define the ]b4_namespace_ref[::position class.
   */
  
    }
  
  ]b4_namespace_close[
- #endif // not BISON_POSITION_HH]
+ ]b4_cpp_guard_close([b4_dir_prefix[]position.hh])
  @output(b4_dir_prefix[]location.hh@)@
 -b4_copyright([Locations for Bison parsers in C++],
 -             [2002-2007, 2009-2012])[
 +b4_copyright([Locations for Bison parsers in C++])[
  
  /**
-  ** \file location.hh
+  ** \file ]b4_dir_prefix[location.hh
   ** Define the ]b4_namespace_ref[::location class.
   */
  
  
  ]b4_namespace_close[
  
- #endif // not BISON_LOCATION_HH]
+ ]b4_cpp_guard_close([b4_dir_prefix[]location.hh])
  m4_divert_pop(0)
 +m4_popdef([b4_copyright_years])dnl
  m4_changecom([#])
diff --cc data/stack.hh
index dcd0832b1cbbf572dbd430c3c01d6debafdf89c3,ddedc79bef7d25e1415f0f4345043fd8a6b98901..cea7b41a80100f3b2486c0deec1a0af19dab8ce6
@@@ -22,12 -22,17 +22,16 @@@ m4_pushdef([b4_copyright_years]
  m4_changecom()
  m4_divert_push(0)dnl
  @output(b4_dir_prefix[]stack.hh@)@
 -b4_copyright([Stack handling for Bison parsers in C++],
 -             [2002-2012])[
 +b4_copyright([Stack handling for Bison parsers in C++])[
  
- #ifndef BISON_STACK_HH
- # define BISON_STACK_HH
+ /**
+  ** \file ]b4_dir_prefix[stack.hh
+  ** Define the ]b4_namespace_ref[::stack class.
+  */
  
- #include <deque>
+ ]b4_cpp_guard_open([b4_dir_prefix[]stack.hh])[
+ # include <deque>
  
  ]b4_namespace_open[
    template <class T, class S = std::deque<T> >
Simple merge
diff --cc m4/.gitignore
index 90e5ae15f760377d57d49e8fb11caedcb13f8bc6,d47aee025bfdb4aa01bbfbb705f8276f9163abbb..990b1a57ff71a4e7f760b96fabed58b302b554b4
  /iconv.m4
  /include_next.m4
  /inline.m4
+ /intdiv0.m4
+ /intl.m4
++/intl.m4~
+ /intldir.m4
  /intlmacosx.m4
+ /intmax.m4
  /intmax_t.m4
  /inttypes-pri.m4
  /inttypes.m4
  /multiarch.m4
  /nls.m4
  /nocrash.m4
++/off_t.m4
  /open.m4
  /pathmax.m4
  /perror.m4
- /pipe.m4
  /pipe2.m4
  /po.m4
++/po.m4~
  /posix_spawn.m4
  /printf-frexp.m4
  /printf-frexpl.m4
  /sys_ioctl_h.m4
  /sys_socket_h.m4
  /sys_stat_h.m4
++/sys_types_h.m4
  /sys_wait_h.m4
+ /sysexits.m4
  /threadlib.m4
  /time_h.m4
+ /uintmax_t.m4
  /unistd-safer.m4
  /unistd_h.m4
  /unlocked-io.m4
  /xalloc.m4
  /xsize.m4
  /xstrndup.m4
- /sysexits.m4
 -/off_t.m4
 -/sys_types_h.m4
diff --cc po/.gitignore
index 79594c04304c4a8b5f5545c7fdd7b3302fccbd77,79594c04304c4a8b5f5545c7fdd7b3302fccbd77..940ce9efe690d672f6cb2b0432d62df006ae5f45
@@@ -6,6 -6,6 +6,7 @@@
  /Makefile
  /Makefile.in
  /Makefile.in.in
++/Makefile.in.in~
  /Makevars
  /Makevars.template
  /POTFILES
index 44ff89631ff95a91c769e6eb4bd7f8d72a90ef14,44ff89631ff95a91c769e6eb4bd7f8d72a90ef14..8675428f03af08d946bf95ad25b0e53daf2f6d9c
@@@ -6,6 -6,6 +6,7 @@@
  /Makefile
  /Makefile.in
  /Makefile.in.in
++/Makefile.in.in~
  /Makevars
  /Makevars.template
  /POTFILES
index 572464afa469b29960e35ebf5136ffa6b597ecda,997984117848430a48d54896ba8999f64b11f9a3..cf2b6b9eb8ec78c1a1ac30f181aa1d6ecb630833
  # 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)
++#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);
@@@ -73,16 -82,16 +82,16 @@@ int   FLEX_PREFIX (lex_destroy) (void)
  
  static struct obstack obstack_for_string;
  
- #define STRING_GROW   \
 -# 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);       \
++# 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 \
++# define STRING_FREE                                    \
    obstack_free (&obstack_for_string, last_string)
  
  #endif
diff --cc src/getargs.c
index 06e6e972be3ee13f26970fadac923dec92534e94,3fa2a7af25c816f3a4bc3141e6416166d1d736de..8a3714e23f6995dfbb66ae7092f42228b68c4e6b
@@@ -607,73 -613,77 +610,80 @@@ getargs (int argc, char *argv[]
          break;
  
        case 'g':
 -      graph_flag = true;
 -      if (optarg)
 +        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;
 +        break;
  
        case 'h':
 -      usage (EXIT_SUCCESS);
 +        usage (EXIT_SUCCESS);
  
        case 'k':
 -      token_table_flag = true;
 -      break;
 +        token_table_flag = true;
 +        break;
  
        case 'l':
 -      no_lines_flag = true;
 -      break;
 +        no_lines_flag = true;
 +        break;
  
        case 'o':
 -      spec_outfile = AS_FILE_NAME (optarg);
 -      break;
 +        spec_outfile = AS_FILE_NAME (optarg);
 +        break;
  
        case 'p':
 -      spec_name_prefix = optarg;
 -      break;
 +        spec_name_prefix = optarg;
 +        break;
  
        case 'r':
 -      FLAGS_ARGMATCH (report, optarg);
 -      break;
 +        FLAGS_ARGMATCH (report, optarg);
 +        break;
  
        case 't':
 -      debug_flag = true;
 -      break;
 +        muscle_percent_define_insert ("parse.trace",
 +                                      command_line_location (), "",
 +                                      MUSCLE_PERCENT_DEFINE_D);
 +        break;
  
        case 'v':
 -      report_flag |= report_states;
 -      break;
 +        report_flag |= report_states;
 +        break;
  
        case 'x':
 -      xml_flag = true;
 -      if (optarg)
 +        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;
 +        break;
  
        case 'y':
 -      yacc_flag = true;
 -      break;
 +        yacc_flag = true;
 +        break;
  
        case LOCATIONS_OPTION:
 -      locations_flag = true;
 -      break;
 +        muscle_percent_define_ensure ("locations",
 +                                      command_line_location (), true);
 +        break;
  
        case PRINT_LOCALEDIR_OPTION:
 -      printf ("%s\n", LOCALEDIR);
 -      exit (EXIT_SUCCESS);
 +        printf ("%s\n", LOCALEDIR);
 +        exit (EXIT_SUCCESS);
  
        case PRINT_DATADIR_OPTION:
 -      printf ("%s\n", compute_pkgdatadir ());
 -      exit (EXIT_SUCCESS);
 +        printf ("%s\n", compute_pkgdatadir ());
 +        exit (EXIT_SUCCESS);
  
        case REPORT_FILE_OPTION:
 -      spec_verbose_file = xstrdup (AS_FILE_NAME (optarg));
 -      break;
+         free (spec_verbose_file);
 +        spec_verbose_file = xstrdup (AS_FILE_NAME (optarg));
 +        break;
  
        default:
 -      usage (EXIT_FAILURE);
 +        usage (EXIT_FAILURE);
        }
  
    if (argc - optind != 1)
index 532349bbe40230c346b85986efd8acffe4abe397,eb034b0823a18240fa325f12a3bb6f421ba04c35..74eb4aee2e81a2240c87700e5c6d557f8e7cb922
@@@ -775,21 -734,8 +776,11 @@@ add_param (param_type type, char *decl
      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));
 -      muscle_pair_list_grow (type, decl, name);
 +      if (type & param_lex)
 +        muscle_pair_list_grow ("lex_param", decl, name);
 +      if (type & param_parse)
 +        muscle_pair_list_grow ("parse_param", decl, name);
        free (name);
      }
  
diff --cc src/scan-skel.l
Simple merge
diff --cc tests/local.at
Simple merge
index 41a2939d182ec0d7d001f47f04397992159b389f,f5603eae9f49bef6b10d5c97dc5bd288dd5c5734..ff798a87a85cd0190b154210f8733cc0f49d6ae9
@@@ -1253,15 -1262,16 +1253,17 @@@ AT_CLEANU
  
  AT_SETUP([[parse-gram.y: LALR = IELR]])
  
 -# Avoid differences in synclines by telling bison that the output files
 -# have the same name.
 +# Avoid tests/bison's dark magic by processing a local copy of the
 +# grammar.  Avoid differences in synclines by telling bison that the
 +# output files have the same name.
  [cp $abs_top_srcdir/src/parse-gram.y input.y]
  AT_BISON_CHECK([[-o input.c -Dlr.type=lalr input.y]])
- [mv input.c expout]
+ [mv input.c lalr.c]
+ AT_CAPTURE_FILE([lalr.c])
  AT_BISON_CHECK([[-o input.c -Dlr.type=ielr input.y]])
  [mv input.c ielr.c]
- AT_CHECK([[cat ielr.c]], [[0]], [[expout]])
+ AT_CAPTURE_FILE([ielr.c])
+ AT_CHECK([[diff lalr.c ielr.c]], [[0]])
  
  AT_CLEANUP