* Noteworthy changes in release ?.? (????-??-??) [?]
+
+* Noteworthy changes in release 2.6.1 (2012-07-30) [stable]
+
Bison no longer executes user-specified M4 code when processing a grammar.
** Future Changes
gettext git-version-gen gitlog-to-changelog
gpl-3.0 hash inttypes isnan javacomp-script
javaexec-script ldexpl malloc-gnu
- mbswidth obstack perror progname
+ mbswidth
+ obstack
+ obstack-printf
+ perror progname
quote quotearg
readme-release
realloc-posix
$(call exclude, \
bindtextdomain=^lib/main.c$$ \
program_name=^lib/main.c$$ \
- prohibit_always-defined_macros=^data/yacc.c|^djgpp/ \
+ 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_defined_have_decl_tests=?|^lib/timevar.c$$ \
prohibit_empty_lines_at_EOF=^src/parse-gram.h$$ \
+ prohibit_magic_number_exit=^doc/bison.texi$$ \
+ prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \
prohibit_strcmp=^doc/bison\.texi$$ \
require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \
space_tab=^tests/(input|c\+\+)\.at$$ \
-Subproject commit dbd914496c99c52220e5f5ba4121d6cb55fb3beb
+Subproject commit 678815ea7c4d95e04a0fa6d3b491b3c872c677a7
/close.c
/closeout.c
/closeout.h
+/concat-filename.c
+/concat-filename.h
/config.charset
/config.h
/config.in.h
/fd-hook.h
/fd-safer-flag.c
/fd-safer.c
+/filename.h
/float+.h
/float.c
/float.h
/nonblocking.h
/obstack.c
/obstack.h
+/obstack_printf.c
/open.c
/pathmax.h
/perror.c
/sys_socket.in.h
/sys_stat.h
/sys_stat.in.h
+/sys_types.in.h
/sys_wait.h
/sys_wait.in.h
/sysexits.in.h
/xalloc-die.c
/xalloc-oversized.h
/xalloc.h
+/xconcat-filename.c
/xmalloc.c
+/xmemdup0.c
+/xmemdup0.h
/xsize.h
/xstrndup.c
/xstrndup.h
-/xmemdup0.c
-/xmemdup0.h
-/sys_types.in.h
-/concat-filename.c
-/concat-filename.h
-/filename.h
-/xconcat-filename.c
/xalloc.m4
/xsize.m4
/xstrndup.m4
+/obstack-printf.m4
{
case shift_resolution:
case right_resolution:
- obstack_fgrow2 (&solved_conflicts_obstack,
+ obstack_printf (&solved_conflicts_obstack,
_(" Conflict between rule %d and token %s"
" resolved as shift"),
r->number,
case reduce_resolution:
case left_resolution:
- obstack_fgrow2 (&solved_conflicts_obstack,
+ obstack_printf (&solved_conflicts_obstack,
_(" Conflict between rule %d and token %s"
" resolved as reduce"),
r->number,
break;
case nonassoc_resolution:
- obstack_fgrow2 (&solved_conflicts_obstack,
+ obstack_printf (&solved_conflicts_obstack,
_(" Conflict between rule %d and token %s"
" resolved as an error"),
r->number,
switch (resolution)
{
case shift_resolution:
- obstack_fgrow2 (&solved_conflicts_obstack,
+ obstack_printf (&solved_conflicts_obstack,
" (%s < %s)",
r->prec->tag,
symbols[token]->tag);
break;
case reduce_resolution:
- obstack_fgrow2 (&solved_conflicts_obstack,
+ obstack_printf (&solved_conflicts_obstack,
" (%s < %s)",
symbols[token]->tag,
r->prec->tag);
break;
case left_resolution:
- obstack_fgrow1 (&solved_conflicts_obstack,
+ obstack_printf (&solved_conflicts_obstack,
" (%%left %s)",
symbols[token]->tag);
break;
case right_resolution:
- obstack_fgrow1 (&solved_conflicts_obstack,
+ obstack_printf (&solved_conflicts_obstack,
" (%%right %s)",
symbols[token]->tag);
break;
case nonassoc_resolution:
- obstack_fgrow1 (&solved_conflicts_obstack,
+ obstack_printf (&solved_conflicts_obstack,
" (%%nonassoc %s)",
symbols[token]->tag);
break;
{
case shift_resolution:
case right_resolution:
- obstack_fgrow2 (&solved_conflicts_xml_obstack,
+ obstack_printf (&solved_conflicts_xml_obstack,
" <resolution rule=\"%d\" symbol=\"%s\""
" type=\"shift\">",
r->number,
case reduce_resolution:
case left_resolution:
- obstack_fgrow2 (&solved_conflicts_xml_obstack,
+ obstack_printf (&solved_conflicts_xml_obstack,
" <resolution rule=\"%d\" symbol=\"%s\""
" type=\"reduce\">",
r->number,
break;
case nonassoc_resolution:
- obstack_fgrow2 (&solved_conflicts_xml_obstack,
+ obstack_printf (&solved_conflicts_xml_obstack,
" <resolution rule=\"%d\" symbol=\"%s\""
" type=\"error\">",
r->number,
switch (resolution)
{
case shift_resolution:
- obstack_fgrow2 (&solved_conflicts_xml_obstack,
+ obstack_printf (&solved_conflicts_xml_obstack,
"%s < %s",
xml_escape_n (0, r->prec->tag),
xml_escape_n (1, symbols[token]->tag));
break;
case reduce_resolution:
- obstack_fgrow2 (&solved_conflicts_xml_obstack,
+ obstack_printf (&solved_conflicts_xml_obstack,
"%s < %s",
xml_escape_n (0, symbols[token]->tag),
xml_escape_n (1, r->prec->tag));
break;
case left_resolution:
- obstack_fgrow1 (&solved_conflicts_xml_obstack,
+ obstack_printf (&solved_conflicts_xml_obstack,
"%%left %s",
xml_escape (symbols[token]->tag));
break;
case right_resolution:
- obstack_fgrow1 (&solved_conflicts_xml_obstack,
+ obstack_printf (&solved_conflicts_xml_obstack,
"%%right %s",
xml_escape (symbols[token]->tag));
break;
case nonassoc_resolution:
- obstack_fgrow1 (&solved_conflicts_xml_obstack,
+ obstack_printf (&solved_conflicts_xml_obstack,
"%%nonassoc %s",
xml_escape (symbols[token]->tag));
break;
muscle_syncline_grow (char const *key, location loc)
{
char *extension = NULL;
- obstack_fgrow1 (&muscle_obstack, "]b4_syncline(%d, ", loc.start.line);
+ obstack_printf (&muscle_obstack, "]b4_syncline(%d, ", loc.start.line);
obstack_quote (&muscle_obstack,
quotearg_style (c_quoting_style, loc.start.file));
obstack_sgrow (&muscle_obstack, ")[");
obstack_sgrow (&muscle_obstack, "[[");
obstack_escape (&muscle_obstack, bound.file);
obstack_1grow (&muscle_obstack, ':');
- obstack_fgrow1 (&muscle_obstack, "%d", bound.line);
+ obstack_printf (&muscle_obstack, "%d", bound.line);
obstack_1grow (&muscle_obstack, '.');
- obstack_fgrow1 (&muscle_obstack, "%d", bound.column);
+ obstack_printf (&muscle_obstack, "%d", bound.column);
obstack_sgrow (&muscle_obstack, "]]");
obstack_1grow (&muscle_obstack, '\0');
extension = obstack_finish (&muscle_obstack);
#define MUSCLE_INSERT_INT(Key, Value) \
do { \
- obstack_fgrow1 (&muscle_obstack, "%d", Value); \
+ obstack_printf (&muscle_obstack, "%d", Value); \
obstack_1grow (&muscle_obstack, 0); \
muscle_insert (Key, obstack_finish (&muscle_obstack)); \
} while (0)
#define MUSCLE_INSERT_LONG_INT(Key, Value) \
do { \
- obstack_fgrow1 (&muscle_obstack, "%ld", Value); \
+ obstack_printf (&muscle_obstack, "%ld", Value); \
obstack_1grow (&muscle_obstack, 0); \
muscle_insert (Key, obstack_finish (&muscle_obstack)); \
} while (0)
int i; \
int j = 1; \
\
- obstack_fgrow1 (&format_obstack, "%6d", first); \
+ obstack_printf (&format_obstack, "%6d", first); \
for (i = begin; i < end; ++i) \
{ \
obstack_1grow (&format_obstack, ','); \
} \
else \
++j; \
- obstack_fgrow1 (&format_obstack, "%6d", table_data[i]); \
+ obstack_printf (&format_obstack, "%6d", table_data[i]); \
if (table_data[i] < min) \
min = table_data[i]; \
if (max < table_data[i]) \
lmin = min; \
lmax = max; \
/* Build `NAME_min' and `NAME_max' in the obstack. */ \
- obstack_fgrow1 (&format_obstack, "%s_min", name); \
+ obstack_printf (&format_obstack, "%s_min", name); \
obstack_1grow (&format_obstack, 0); \
MUSCLE_INSERT_LONG_INT (obstack_finish (&format_obstack), lmin); \
- obstack_fgrow1 (&format_obstack, "%s_max", name); \
+ obstack_printf (&format_obstack, "%s_max", name); \
obstack_1grow (&format_obstack, 0); \
MUSCLE_INSERT_LONG_INT (obstack_finish (&format_obstack), lmax); \
}
const char *value;
#define SET_KEY(Entry) \
- obstack_fgrow2 (&format_obstack, "symbol(%d, %s)", \
+ obstack_printf (&format_obstack, "symbol(%d, %s)", \
i, Entry); \
obstack_1grow (&format_obstack, 0); \
key = obstack_finish (&format_obstack);
#define SET_KEY2(Entry, Suffix) \
- obstack_fgrow3 (&format_obstack, "symbol(%d, %s_%s)", \
+ obstack_printf (&format_obstack, "symbol(%d, %s_%s)", \
i, Entry, Suffix); \
obstack_1grow (&format_obstack, 0); \
key = obstack_finish (&format_obstack);
snritems = nitemset;
}
- obstack_fgrow1 (oout, "%d", s->number);
+ obstack_printf (oout, "%d", s->number);
for (i = 0; i < snritems; i++)
{
item_number *sp;
r = item_number_as_rule_number (*sp);
- obstack_fgrow1 (oout, "\n%s -> ", rules[r].lhs->tag);
+ obstack_printf (oout, "\n%s -> ", rules[r].lhs->tag);
for (sp = rules[r].rhs; sp < sp1; sp++)
- obstack_fgrow1 (oout, "%s ", symbols[*sp]->tag);
+ obstack_printf (oout, "%s ", symbols[*sp]->tag);
obstack_1grow (oout, '.');
for (/* Nothing */; *sp >= 0; ++sp)
- obstack_fgrow1 (oout, " %s", symbols[*sp]->tag);
+ obstack_printf (oout, " %s", symbols[*sp]->tag);
/* Experimental feature: display the lookahead tokens. */
if (report_flag & report_lookahead_tokens
obstack_sgrow (oout, "[");
BITSET_FOR_EACH (biter, reds->lookahead_tokens[redno], k, 0)
{
- obstack_fgrow2 (oout, "%s%s", sep, symbols[k]->tag);
+ obstack_printf (oout, "%s%s", sep, symbols[k]->tag);
sep = ", ";
}
obstack_sgrow (oout, "]");
/* Create the explanation message. */
obstack_init (&msg_buf);
- obstack_fgrow1 (&msg_buf, _("possibly meant: %c"), dollar_or_at);
+ obstack_printf (&msg_buf, _("possibly meant: %c"), dollar_or_at);
if (contains_dot_or_dash (id))
- obstack_fgrow1 (&msg_buf, "[%s]", id);
+ obstack_printf (&msg_buf, "[%s]", id);
else
obstack_sgrow (&msg_buf, id);
obstack_sgrow (&msg_buf, tail);
if (var->err & VARIANT_HIDDEN)
{
- obstack_fgrow1 (&msg_buf, _(", hiding %c"), dollar_or_at);
+ obstack_printf (&msg_buf, _(", hiding %c"), dollar_or_at);
if (contains_dot_or_dash (var->id))
- obstack_fgrow1 (&msg_buf, "[%s]", var->id);
+ obstack_printf (&msg_buf, "[%s]", var->id);
else
obstack_sgrow (&msg_buf, var->id);
obstack_sgrow (&msg_buf, tail);
}
- obstack_fgrow1 (&msg_buf, _(" at %s"), at_spec);
+ obstack_printf (&msg_buf, _(" at %s"), at_spec);
if (var->err & VARIANT_NOT_VISIBLE_FROM_MIDRULE)
{
const char *format =
_(", cannot be accessed from mid-rule action at $%d");
- obstack_fgrow1 (&msg_buf, format, midrule_rhs_index);
+ obstack_printf (&msg_buf, format, midrule_rhs_index);
}
obstack_1grow (&msg_buf, '\0');
untyped_var_seen = true;
}
- obstack_fgrow2 (&obstack_for_string,
+ obstack_printf (&obstack_for_string,
"]b4_rhs_value(%d, %d, ", effective_rule_length, n);
obstack_quote (&obstack_for_string, type_name);
obstack_sgrow (&obstack_for_string, ")[");
break;
default:
- obstack_fgrow2 (&obstack_for_string, "]b4_rhs_location(%d, %d)[",
+ obstack_printf (&obstack_for_string, "]b4_rhs_location(%d, %d)[",
effective_rule_length, n);
break;
}
\n out_lineno++; ECHO;
[^@\n]+ ECHO;
-<<EOF>> {
+<INITIAL><<EOF>> {
if (outname)
{
free (outname);
#define obstack_sgrow(Obs, Str) \
obstack_grow (Obs, Str, strlen (Str))
-#define obstack_fgrow1(Obs, Format, Arg1) \
- do { \
- char buf[4096]; \
- sprintf (buf, Format, Arg1); \
- obstack_grow (Obs, buf, strlen (buf)); \
- } while (0)
-
-#define obstack_fgrow2(Obs, Format, Arg1, Arg2) \
- do { \
- char buf[4096]; \
- sprintf (buf, Format, Arg1, Arg2); \
- obstack_grow (Obs, buf, strlen (buf)); \
- } while (0)
-
-#define obstack_fgrow3(Obs, Format, Arg1, Arg2, Arg3) \
- do { \
- char buf[4096]; \
- sprintf (buf, Format, Arg1, Arg2, Arg3); \
- obstack_grow (Obs, buf, strlen (buf)); \
- } while (0)
-
-#define obstack_fgrow4(Obs, Format, Arg1, Arg2, Arg3, Arg4) \
- do { \
- char buf[4096]; \
- sprintf (buf, Format, Arg1, Arg2, Arg3, Arg4); \
- obstack_grow (Obs, buf, strlen (buf)); \
- } while (0)
-
-
/* Output Str escaped for our postprocessing (i.e., escape M4 special
characters).
%debug
%code requires
{
-# include <stdio.h>
-
typedef struct sem_type
{
int ival;
# define YYSTYPE sem_type
-#ifdef __cplusplus
+]AT_SKEL_CC_IF([[
# include <iostream>
static void
report (std::ostream& yyo, int ival, float fval)
{
yyo << "ival: " << ival << ", fval: " << fval;
}
-#else
+]], [[
+# include <stdio.h>
static void
report (FILE* yyo, int ival, float fval)
{
fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval);
}
-#endif
+]])[
}
%code