mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 01:03:04 +00:00
news: condemn YYPARSE_PARAM and YYLEX_PARAM.
* NEWS: here. (Bison 1.875): Add %parse-param and %lex-param. * doc/bison.texinfo: Spello.
This commit is contained in:
33
NEWS
33
NEWS
@@ -5,8 +5,10 @@ GNU Bison NEWS
|
|||||||
** Future changes:
|
** Future changes:
|
||||||
|
|
||||||
The next major release will drop support for generating parsers in K&R C,
|
The next major release will drop support for generating parsers in K&R C,
|
||||||
and remove the definition of yystype (removal announced since Bison
|
and remove the definitions of yystype and yyltype (removal announced since
|
||||||
1.875).
|
Bison 1.875). YYPARSE_PARAM and YYLEX_PARAM, which were deprecated in
|
||||||
|
favor of %parse-param and %lex-param (introduced in Bison 1.875 too), will
|
||||||
|
no longer be supported.
|
||||||
|
|
||||||
** The generated header is included (yacc.c)
|
** The generated header is included (yacc.c)
|
||||||
|
|
||||||
@@ -1202,6 +1204,33 @@ GNU Bison NEWS
|
|||||||
- "parsing stack overflow..." -> "parser stack overflow"
|
- "parsing stack overflow..." -> "parser stack overflow"
|
||||||
GLR parsers now report "parser stack overflow" as per the Bison manual.
|
GLR parsers now report "parser stack overflow" as per the Bison manual.
|
||||||
|
|
||||||
|
** %parse-param and %lex-param
|
||||||
|
The macros YYPARSE_PARAM and YYLEX_PARAM provide a means to pass
|
||||||
|
additional context to yyparse and yylex. They suffer from several
|
||||||
|
shortcomings:
|
||||||
|
|
||||||
|
- a single argument only can be added,
|
||||||
|
- their types are weak (void *),
|
||||||
|
- this context is not passed to anciliary functions such as yyerror,
|
||||||
|
- only yacc.c parsers support them.
|
||||||
|
|
||||||
|
The new %parse-param/%lex-param directives provide a more precise control.
|
||||||
|
For instance:
|
||||||
|
|
||||||
|
%parse-param {int *nastiness}
|
||||||
|
%lex-param {int *nastiness}
|
||||||
|
%parse-param {int *randomness}
|
||||||
|
|
||||||
|
results in the following signatures:
|
||||||
|
|
||||||
|
int yylex (int *nastiness);
|
||||||
|
int yyparse (int *nastiness, int *randomness);
|
||||||
|
|
||||||
|
or, if both %pure-parser and %locations are used:
|
||||||
|
|
||||||
|
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp, int *nastiness);
|
||||||
|
int yyparse (int *nastiness, int *randomness);
|
||||||
|
|
||||||
** Bison now warns if it detects conflicting outputs to the same file,
|
** Bison now warns if it detects conflicting outputs to the same file,
|
||||||
e.g., it generates a warning for "bison -d -o foo.h foo.y" since
|
e.g., it generates a warning for "bison -d -o foo.h foo.y" since
|
||||||
that command outputs both code and header to foo.h.
|
that command outputs both code and header to foo.h.
|
||||||
|
|||||||
@@ -6011,7 +6011,7 @@ For instance:
|
|||||||
@end example
|
@end example
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
results in the following signature:
|
results in the following signatures:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
int yylex (int *nastiness);
|
int yylex (int *nastiness);
|
||||||
|
|||||||
Reference in New Issue
Block a user