mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
yacc: remove support for YYPRINT
Its removal was annonced several times in NEWS (for Bison 3.5, 3.6, 3.7). * data/skeletons/c.m4, data/skeletons/yacc.c: Remove support for YYPRINT. * NEWS: Fix the mess introduced by the merge. Document the removal of YYPRINT. * doc/bison.texi (The YYPRINT Macro): Remove.
This commit is contained in:
49
NEWS
49
NEWS
@@ -1,6 +1,6 @@
|
|||||||
GNU Bison NEWS
|
GNU Bison NEWS
|
||||||
|
|
||||||
* Noteworthy changes in release 3.7.5 (2021-01-24) [stable]
|
* Noteworthy changes in release ?.? (????-??-??) [?]
|
||||||
|
|
||||||
** Deprecated features
|
** Deprecated features
|
||||||
|
|
||||||
@@ -9,26 +9,9 @@ GNU Bison NEWS
|
|||||||
with Yacc, but not in C++. Warnings are now issued if `#define YYSTYPE`
|
with Yacc, but not in C++. Warnings are now issued if `#define YYSTYPE`
|
||||||
is used in C++, and eventually support will be removed.
|
is used in C++, and eventually support will be removed.
|
||||||
|
|
||||||
** Bug fixes
|
Support for the YYPRINT macro is removed. It worked only with yacc.c and
|
||||||
|
only for tokens. It was obsoleted by %printer, introduced in Bison 1.50
|
||||||
*** Counterexample Generation
|
(November 2002).
|
||||||
|
|
||||||
In some cases counterexample generation could crash. This is fixed.
|
|
||||||
|
|
||||||
*** Fix Table Generation
|
|
||||||
|
|
||||||
In some very rare conditions, when there are many useless tokens, it was
|
|
||||||
possible to generate incorrect parsers.
|
|
||||||
|
|
||||||
*** GLR parsers now support %merge together with api.value.type=union.
|
|
||||||
|
|
||||||
*** C++ parsers use noexcept in more places.
|
|
||||||
|
|
||||||
*** Generated parsers avoid some warnings about signedness issues.
|
|
||||||
|
|
||||||
*** C-language parsers now avoid warnings from pedantic clang.
|
|
||||||
|
|
||||||
*** C-language parsers now work around quirks of HP-UX 11.23 (2003).
|
|
||||||
|
|
||||||
** Changes
|
** Changes
|
||||||
|
|
||||||
@@ -98,6 +81,30 @@ GNU Bison NEWS
|
|||||||
memory exhaustion.
|
memory exhaustion.
|
||||||
|
|
||||||
|
|
||||||
|
* Noteworthy changes in release 3.7.5 (2021-01-24) [stable]
|
||||||
|
|
||||||
|
** Bug fixes
|
||||||
|
|
||||||
|
*** Counterexample Generation
|
||||||
|
|
||||||
|
In some cases counterexample generation could crash. This is fixed.
|
||||||
|
|
||||||
|
*** Fix Table Generation
|
||||||
|
|
||||||
|
In some very rare conditions, when there are many useless tokens, it was
|
||||||
|
possible to generate incorrect parsers.
|
||||||
|
|
||||||
|
*** GLR parsers now support %merge together with api.value.type=union.
|
||||||
|
|
||||||
|
*** C++ parsers use noexcept in more places.
|
||||||
|
|
||||||
|
*** Generated parsers avoid some warnings about signedness issues.
|
||||||
|
|
||||||
|
*** C-language parsers now avoid warnings from pedantic clang.
|
||||||
|
|
||||||
|
*** C-language parsers now work around quirks of HP-UX 11.23 (2003).
|
||||||
|
|
||||||
|
|
||||||
* Noteworthy changes in release 3.7.4 (2020-11-14) [stable]
|
* Noteworthy changes in release 3.7.4 (2020-11-14) [stable]
|
||||||
|
|
||||||
** Bug fixes
|
** Bug fixes
|
||||||
|
|||||||
5
TODO
5
TODO
@@ -462,9 +462,6 @@ $ ./tests/testsuite -l | grep errors | sed q
|
|||||||
38: input.at:1730 errors
|
38: input.at:1730 errors
|
||||||
|
|
||||||
* Short term
|
* Short term
|
||||||
** Get rid of YYPRINT and b4_toknum
|
|
||||||
Besides yytoknum is wrong when api.token.raw is defined.
|
|
||||||
|
|
||||||
** Better design for diagnostics
|
** Better design for diagnostics
|
||||||
The current implementation of diagnostics is ad hoc, it grew organically.
|
The current implementation of diagnostics is ad hoc, it grew organically.
|
||||||
It works as a series of calls to several functions, with dependency of the
|
It works as a series of calls to several functions, with dependency of the
|
||||||
@@ -808,7 +805,7 @@ Equip the parser with a means to create the (visual) parse tree.
|
|||||||
# LocalWords: SymbolKind YYEMPTY YYUNDEF YYTNAME NUM yyntokens yytname sed
|
# LocalWords: SymbolKind YYEMPTY YYUNDEF YYTNAME NUM yyntokens yytname sed
|
||||||
# LocalWords: nonterminals yykind yycode YYNAMES yynames init getName conv
|
# LocalWords: nonterminals yykind yycode YYNAMES yynames init getName conv
|
||||||
# LocalWords: TokenKind ival yychar yylval yylexer Tolmer hoc
|
# LocalWords: TokenKind ival yychar yylval yylexer Tolmer hoc
|
||||||
# LocalWords: Sobisch YYPTRDIFF ptrdiff Autotest YYPRINT toknum yytoknum
|
# LocalWords: Sobisch YYPTRDIFF ptrdiff Autotest toknum yytoknum
|
||||||
# LocalWords: sym Wother stderr FP fixits xgettext fdiagnostics Graphviz
|
# LocalWords: sym Wother stderr FP fixits xgettext fdiagnostics Graphviz
|
||||||
# LocalWords: graphviz VCG bitset xml bw maint yytoken YYABORT deps
|
# LocalWords: graphviz VCG bitset xml bw maint yytoken YYABORT deps
|
||||||
# LocalWords: YYACCEPT yytranslate nonnegative destructors yyerrlab repo
|
# LocalWords: YYACCEPT yytranslate nonnegative destructors yyerrlab repo
|
||||||
|
|||||||
@@ -761,13 +761,6 @@ yy_symbol_value_print (FILE *yyo,
|
|||||||
]b4_parse_param_use([yyoutput], [yylocationp])dnl
|
]b4_parse_param_use([yyoutput], [yylocationp])dnl
|
||||||
[ if (!yyvaluep)
|
[ if (!yyvaluep)
|
||||||
return;]
|
return;]
|
||||||
dnl glr.c does not feature yytoknum.
|
|
||||||
m4_if(b4_skeleton, ["yacc.c"],
|
|
||||||
[[# ifdef YYPRINT
|
|
||||||
if (yykind < YYNTOKENS)
|
|
||||||
YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
|
|
||||||
# endif
|
|
||||||
]])dnl
|
|
||||||
b4_percent_code_get([[pre-printer]])dnl
|
b4_percent_code_get([[pre-printer]])dnl
|
||||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||||
b4_symbol_actions([printer])
|
b4_symbol_actions([printer])
|
||||||
|
|||||||
@@ -703,15 +703,6 @@ yysymbol_name (yysymbol_kind_t yysymbol)
|
|||||||
}]])[
|
}]])[
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef YYPRINT
|
|
||||||
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
|
|
||||||
(internal) symbol number NUM (which must be that of a token). */
|
|
||||||
static const ]b4_int_type_for([b4_toknum])[ yytoknum[] =
|
|
||||||
{
|
|
||||||
]b4_toknum[
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define YYPACT_NINF (]b4_pact_ninf[)
|
#define YYPACT_NINF (]b4_pact_ninf[)
|
||||||
|
|
||||||
#define yypact_value_is_default(Yyn) \
|
#define yypact_value_is_default(Yyn) \
|
||||||
|
|||||||
@@ -472,7 +472,6 @@ Tracing Your Parser
|
|||||||
|
|
||||||
* Enabling Traces:: Activating run-time trace support
|
* Enabling Traces:: Activating run-time trace support
|
||||||
* Mfcalc Traces:: Extending @code{mfcalc} to support traces
|
* Mfcalc Traces:: Extending @code{mfcalc} to support traces
|
||||||
* The YYPRINT Macro:: Obsolete interface for semantic value reports
|
|
||||||
|
|
||||||
Invoking Bison
|
Invoking Bison
|
||||||
|
|
||||||
@@ -10892,7 +10891,6 @@ When a Bison grammar compiles properly but parses ``incorrectly'', the
|
|||||||
@menu
|
@menu
|
||||||
* Enabling Traces:: Activating run-time trace support
|
* Enabling Traces:: Activating run-time trace support
|
||||||
* Mfcalc Traces:: Extending @code{mfcalc} to support traces
|
* Mfcalc Traces:: Extending @code{mfcalc} to support traces
|
||||||
* The YYPRINT Macro:: Obsolete interface for semantic value reports
|
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@node Enabling Traces
|
@node Enabling Traces
|
||||||
@@ -11156,49 +11154,6 @@ Cleanup: popping nterm input ()
|
|||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
|
||||||
@node The YYPRINT Macro
|
|
||||||
@subsection The @code{YYPRINT} Macro
|
|
||||||
@findex YYPRINT
|
|
||||||
|
|
||||||
The @code{%printer} directive was introduced in Bison 1.50 (November 2002).
|
|
||||||
Before then, @code{YYPRINT} provided a similar feature, but only for
|
|
||||||
terminal symbols and only with the @file{yacc.c} skeleton.
|
|
||||||
|
|
||||||
@deffn {Macro} YYPRINT (@var{stream}, @var{token}, @var{value});
|
|
||||||
@findex YYPRINT
|
|
||||||
Deprecated, will be removed eventually.
|
|
||||||
|
|
||||||
If you define @code{YYPRINT}, it should take three arguments. The parser
|
|
||||||
will pass a standard I/O stream, the numeric code for the token kind, and
|
|
||||||
the token value (from @code{yylval}).
|
|
||||||
|
|
||||||
For @file{yacc.c} only. Obsoleted by @code{%printer}.
|
|
||||||
@end deffn
|
|
||||||
|
|
||||||
Here is an example of @code{YYPRINT} suitable for the multi-function
|
|
||||||
calculator (@pxref{Mfcalc Declarations}):
|
|
||||||
|
|
||||||
@example
|
|
||||||
%@{
|
|
||||||
static void print_token_value (FILE *file, int type, YYSTYPE value);
|
|
||||||
#define YYPRINT(File, Type, Value) \
|
|
||||||
print_token_value (File, Type, Value)
|
|
||||||
%@}
|
|
||||||
|
|
||||||
@dots{} %% @dots{} %% @dots{}
|
|
||||||
|
|
||||||
static void
|
|
||||||
print_token_value (FILE *file, yytoken_kind_t kind, YYSTYPE value)
|
|
||||||
@{
|
|
||||||
if (kind == VAR)
|
|
||||||
fprintf (file, "%s", value.tptr->name);
|
|
||||||
else if (kind == NUM)
|
|
||||||
fprintf (file, "%d", value.val);
|
|
||||||
@}
|
|
||||||
@end example
|
|
||||||
|
|
||||||
@xref{Mfcalc Traces}, for the proper use of @code{%printer}.
|
|
||||||
|
|
||||||
@c ================================================= Invoking Bison
|
@c ================================================= Invoking Bison
|
||||||
|
|
||||||
@node Invocation
|
@node Invocation
|
||||||
@@ -16018,12 +15973,6 @@ The parser function produced by Bison; call this function to start
|
|||||||
parsing. @xref{Parser Function}.
|
parsing. @xref{Parser Function}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Macro} YYPRINT
|
|
||||||
Macro used to output token semantic values. For @file{yacc.c} only.
|
|
||||||
Deprecated, use @code{%printer} instead (@pxref{Printer Decl}).
|
|
||||||
@xref{The YYPRINT Macro}.
|
|
||||||
@end deffn
|
|
||||||
|
|
||||||
@deffn {Function} yypstate_delete
|
@deffn {Function} yypstate_delete
|
||||||
The function to delete a parser instance, produced by Bison in push mode;
|
The function to delete a parser instance, produced by Bison in push mode;
|
||||||
call this function to delete the memory associated with a parser.
|
call this function to delete the memory associated with a parser.
|
||||||
@@ -16465,7 +16414,7 @@ London, Department of Computer Science, TR-00-12 (December 2000).
|
|||||||
@c LocalWords: symrec val tptr FUN func struct sym enum IEC syntaxes Byacc
|
@c LocalWords: symrec val tptr FUN func struct sym enum IEC syntaxes Byacc
|
||||||
@c LocalWords: fun putsym getsym arith funs atan ptr malloc sizeof Lex pcc
|
@c LocalWords: fun putsym getsym arith funs atan ptr malloc sizeof Lex pcc
|
||||||
@c LocalWords: strlen strcpy fctn strcmp isalpha symbuf realloc isalnum DOTDOT
|
@c LocalWords: strlen strcpy fctn strcmp isalpha symbuf realloc isalnum DOTDOT
|
||||||
@c LocalWords: ptypes itype YYPRINT trigraphs yytname expseq vindex dtype Unary
|
@c LocalWords: ptypes itype trigraphs yytname expseq vindex dtype Unary
|
||||||
@c LocalWords: Rhs YYRHSLOC LE nonassoc op deffn typeless yynerrs nonterminal
|
@c LocalWords: Rhs YYRHSLOC LE nonassoc op deffn typeless yynerrs nonterminal
|
||||||
@c LocalWords: yychar yydebug msg YYNTOKENS YYNNTS YYNRULES YYNSTATES reentrant
|
@c LocalWords: yychar yydebug msg YYNTOKENS YYNNTS YYNRULES YYNSTATES reentrant
|
||||||
@c LocalWords: cparse clex deftypefun NE defmac YYACCEPT YYABORT param yypstate
|
@c LocalWords: cparse clex deftypefun NE defmac YYACCEPT YYABORT param yypstate
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* A Bison parser, made by GNU Bison 3.7.5.284-c9445. */
|
/* A Bison parser, made by GNU Bison 3.7.5.297-b46a. */
|
||||||
|
|
||||||
/* Bison implementation for Yacc-like parsers in C
|
/* Bison implementation for Yacc-like parsers in C
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
#define YYBISON 30705
|
#define YYBISON 30705
|
||||||
|
|
||||||
/* Bison version string. */
|
/* Bison version string. */
|
||||||
#define YYBISON_VERSION "3.7.5.284-c9445"
|
#define YYBISON_VERSION "3.7.5.297-b46a"
|
||||||
|
|
||||||
/* Skeleton name. */
|
/* Skeleton name. */
|
||||||
#define YYSKELETON_NAME "yacc.c"
|
#define YYSKELETON_NAME "yacc.c"
|
||||||
@@ -728,21 +728,6 @@ yysymbol_name (yysymbol_kind_t yysymbol)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef YYPRINT
|
|
||||||
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
|
|
||||||
(internal) symbol number NUM (which must be that of a token). */
|
|
||||||
static const yytype_int16 yytoknum[] =
|
|
||||||
{
|
|
||||||
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
|
|
||||||
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
|
|
||||||
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
|
|
||||||
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
|
|
||||||
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
|
|
||||||
305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
|
|
||||||
315
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define YYPACT_NINF (-148)
|
#define YYPACT_NINF (-148)
|
||||||
|
|
||||||
#define yypact_value_is_default(Yyn) \
|
#define yypact_value_is_default(Yyn) \
|
||||||
@@ -1051,7 +1036,7 @@ yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
|
|||||||
res += YYFPRINTF (yyo, "-%d", end_col);
|
res += YYFPRINTF (yyo, "-%d", end_col);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
# define YY_LOCATION_PRINT(File, Loc) \
|
# define YY_LOCATION_PRINT(File, Loc) \
|
||||||
yy_location_print_ (File, &(Loc))
|
yy_location_print_ (File, &(Loc))
|
||||||
@@ -1087,10 +1072,6 @@ yy_symbol_value_print (FILE *yyo,
|
|||||||
YY_USE (yylocationp);
|
YY_USE (yylocationp);
|
||||||
if (!yyvaluep)
|
if (!yyvaluep)
|
||||||
return;
|
return;
|
||||||
# ifdef YYPRINT
|
|
||||||
if (yykind < YYNTOKENS)
|
|
||||||
YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
|
|
||||||
# endif
|
|
||||||
/* "%code pre-printer" blocks. */
|
/* "%code pre-printer" blocks. */
|
||||||
tron (yyo);
|
tron (yyo);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* A Bison parser, made by GNU Bison 3.7.5.284-c9445. */
|
/* A Bison parser, made by GNU Bison 3.7.5.297-b46a. */
|
||||||
|
|
||||||
/* Bison interface for Yacc-like parsers in C
|
/* Bison interface for Yacc-like parsers in C
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user