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
/compile
/config.guess
/config.rpath
++/config.rpath~
/config.sub
/depcomp
/gendocs.sh
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/ \
)
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;
}
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]])[
/* 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], [],
[
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([#])
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> >
/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
/Makefile
/Makefile.in
/Makefile.in.in
++/Makefile.in.in~
/Makevars
/Makevars.template
/POTFILES
/Makefile
/Makefile.in
/Makefile.in.in
++/Makefile.in.in~
/Makevars
/Makevars.template
/POTFILES
# 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);
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
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)
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);
}
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