variables: prefer error-verbose to error_verbose.

* data/bison.m4 (b4_error_verbose_if): Based on error-verbose
	instead of error_verbose.
	* src/scan-gram.l (%error-verbose): Map the error-verbose
	variable.
	* doc/bison.texinfo: Promote %define error-verbose instead of
	%error-verbose.
	* tests/actions.at: Prefer %define error-verbose to %error-verbose.
This commit is contained in:
Akim Demaille
2009-04-20 12:25:47 +02:00
parent 1c72905811
commit 71b00ed874
5 changed files with 53 additions and 23 deletions

View File

@@ -1,5 +1,16 @@
2009-04-20 Akim Demaille <demaille@gostai.com> 2009-04-20 Akim Demaille <demaille@gostai.com>
variables: prefer error-verbose to error_verbose.
* data/bison.m4 (b4_error_verbose_if): Based on error-verbose
instead of error_verbose.
* src/scan-gram.l (%error-verbose): Map to the error-verbose
variable.
* doc/bison.texinfo: Promote %define error-verbose instead of
%error-verbose.
* tests/actions.at: Prefer %define error-verbose to %error-verbose.
2009-04-15 Akim Demaille <demaille@gostai.com>
variables: accept dashes. variables: accept dashes.
* data/bison.m4 (b4_percent_define_if_define_): Also map dashes to * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
underscores. underscores.

View File

@@ -684,7 +684,7 @@ b4_percent_define_if_define_([$1], $[1], $[2])])
# b4_lex_symbol_if([IF-YYLEX-RETURNS-A-COMPLETE-SYMBOL], [IF-NOT]) # b4_lex_symbol_if([IF-YYLEX-RETURNS-A-COMPLETE-SYMBOL], [IF-NOT])
# b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT]) # b4_variant_if([IF-VARIANT-ARE-USED], [IF-NOT])
# ---------------------------------------------- # ----------------------------------------------
b4_percent_define_if_define([error_verbose]) b4_percent_define_if_define([error-verbose])
b4_percent_define_if_define([lex_symbol]) b4_percent_define_if_define([lex_symbol])
b4_percent_define_if_define([locations]) # Whether locations are tracked. b4_percent_define_if_define([locations]) # Whether locations are tracked.
b4_percent_define_if_define([parse.assert]) b4_percent_define_if_define([parse.assert])

View File

@@ -4894,6 +4894,7 @@ Some of the accepted @var{variable}s are:
@item Default Value: @code{"false"} @item Default Value: @code{"false"}
@end itemize @end itemize
@c api.pure
@item api.push_pull @item api.push_pull
@findex %define api.push_pull @findex %define api.push_pull
@@ -4910,6 +4911,24 @@ More user feedback will help to stabilize it.)
@item Default Value: @code{"pull"} @item Default Value: @code{"pull"}
@end itemize @end itemize
@c api.push_pull
@item error-verbose
@findex %define error-verbose
@itemize
@item Languages(s):
all.
@item Purpose:
Enable the generation of more verbose error messages than a instead of
just plain @w{@code{"syntax error"}}. @xref{Error Reporting, ,The Error
Reporting Function @code{yyerror}}.
@item Accepted Values:
Boolean
@item Default Value:
@code{false}
@end itemize
@c error-verbose
@item lr.keep_unreachable_states @item lr.keep_unreachable_states
@findex %define lr.keep_unreachable_states @findex %define lr.keep_unreachable_states
@@ -4953,6 +4972,7 @@ states.
However, Bison does not compute which goto actions are useless. However, Bison does not compute which goto actions are useless.
@end itemize @end itemize
@end itemize @end itemize
@c lr.keep_unreachable_states
@item namespace @item namespace
@findex %define namespace @findex %define namespace
@@ -5693,8 +5713,8 @@ called by @code{yyparse} whenever a syntax error is found, and it
receives one argument. For a syntax error, the string is normally receives one argument. For a syntax error, the string is normally
@w{@code{"syntax error"}}. @w{@code{"syntax error"}}.
@findex %error-verbose @findex %define error-verbose
If you invoke the directive @code{%error-verbose} in the Bison If you invoke the directive @code{%define error-verbose} in the Bison
declarations section (@pxref{Bison Declarations, ,The Bison Declarations declarations section (@pxref{Bison Declarations, ,The Bison Declarations
Section}), then Bison provides a more verbose and specific error message Section}), then Bison provides a more verbose and specific error message
string instead of just plain @w{@code{"syntax error"}}. string instead of just plain @w{@code{"syntax error"}}.
@@ -8584,7 +8604,7 @@ error messages.
@comment file: calc++-parser.yy @comment file: calc++-parser.yy
@example @example
%define parse.trace %define parse.trace
%error-verbose %define error-verbose
@end example @end example
@noindent @noindent
@@ -9065,7 +9085,7 @@ Run the syntactic analysis, and return @code{true} on success,
@deftypemethod {YYParser} {boolean} getErrorVerbose () @deftypemethod {YYParser} {boolean} getErrorVerbose ()
@deftypemethodx {YYParser} {void} setErrorVerbose (boolean @var{verbose}) @deftypemethodx {YYParser} {void} setErrorVerbose (boolean @var{verbose})
Get or set the option to produce verbose error messages. These are only Get or set the option to produce verbose error messages. These are only
available with the @code{%error-verbose} directive, which also turn on available with the @code{%define error-verbose} directive, which also turn on
verbose error messages. verbose error messages.
@end deftypemethod @end deftypemethod
@@ -9994,8 +10014,7 @@ token is reset to the token that originally caused the violation.
@end deffn @end deffn
@deffn {Directive} %error-verbose @deffn {Directive} %error-verbose
Bison declaration to request verbose, specific error message strings An obsolete directive standing for @samp{%define error-verbose}.
when @code{yyerror} is called.
@end deffn @end deffn
@deffn {Directive} %file-prefix "@var{prefix}" @deffn {Directive} %file-prefix "@var{prefix}"
@@ -10193,16 +10212,16 @@ instead.
@deffn {Function} yyerror @deffn {Function} yyerror
User-supplied function to be called by @code{yyparse} on error. User-supplied function to be called by @code{yyparse} on error.
@xref{Error Reporting, ,The Error @xref{Error Reporting, ,The Error Reporting Function @code{yyerror}}.
Reporting Function @code{yyerror}}.
@end deffn @end deffn
@deffn {Macro} YYERROR_VERBOSE @deffn {Macro} YYERROR_VERBOSE
An obsolete macro that you define with @code{#define} in the prologue An obsolete macro used in the @file{yacc.c} skeleton, that you define
to request verbose, specific error message strings with @code{#define} in the prologue to request verbose, specific error
when @code{yyerror} is called. It doesn't matter what definition you message strings when @code{yyerror} is called. It doesn't matter what
use for @code{YYERROR_VERBOSE}, just whether you define it. Using definition you use for @code{YYERROR_VERBOSE}, just whether you define
@code{%error-verbose} is preferred. it. Using @code{%define error-verbose} is preferred (@pxref{Error
Reporting, ,The Error Reporting Function @code{yyerror}}).
@end deffn @end deffn
@deffn {Macro} YYINITDEPTH @deffn {Macro} YYINITDEPTH

View File

@@ -181,7 +181,7 @@ splice (\\[ \f\t\v]*\n)*
"%defines" return PERCENT_DEFINES; "%defines" return PERCENT_DEFINES;
"%destructor" return PERCENT_DESTRUCTOR; "%destructor" return PERCENT_DESTRUCTOR;
"%dprec" return PERCENT_DPREC; "%dprec" return PERCENT_DPREC;
"%error"[-_]"verbose" RETURN_PERCENT_FLAG("error_verbose"); "%error"[-_]"verbose" RETURN_PERCENT_FLAG("error-verbose");
"%expect" return PERCENT_EXPECT; "%expect" return PERCENT_EXPECT;
"%expect"[-_]"rr" return PERCENT_EXPECT_RR; "%expect"[-_]"rr" return PERCENT_EXPECT_RR;
"%file-prefix" return PERCENT_FILE_PREFIX; "%file-prefix" return PERCENT_FILE_PREFIX;

View File

@@ -1,6 +1,6 @@
# Executing Actions. -*- Autotest -*- # Executing Actions. -*- Autotest -*-
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
# Foundation, Inc. # Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@ AT_SETUP([Mid-rule actions])
# action. # action.
AT_DATA_GRAMMAR([[input.y]], AT_DATA_GRAMMAR([[input.y]],
[[%error-verbose [[%define error-verbose
%debug %debug
%{ %{
# include <stdio.h> # include <stdio.h>
@@ -93,7 +93,7 @@ AT_CLEANUP
AT_SETUP([Exotic Dollars]) AT_SETUP([Exotic Dollars])
AT_DATA_GRAMMAR([[input.y]], AT_DATA_GRAMMAR([[input.y]],
[[%error-verbose [[%define error-verbose
%debug %debug
%{ %{
# include <stdio.h> # include <stdio.h>
@@ -557,7 +557,7 @@ m4_define([AT_CHECK_PRINTER_AND_DESTRUCTOR],
$3 $3
_AT_CHECK_PRINTER_AND_DESTRUCTOR($[1], $[2], $[3], $[4], _AT_CHECK_PRINTER_AND_DESTRUCTOR($[1], $[2], $[3], $[4],
[%error-verbose [%define error-verbose
%debug %debug
%verbose %verbose
%locations %locations
@@ -588,7 +588,7 @@ AT_CHECK_PRINTER_AND_DESTRUCTOR([%glr-parser], [with union])
AT_SETUP([Default tagless %printer and %destructor]) AT_SETUP([Default tagless %printer and %destructor])
AT_DATA_GRAMMAR([[input.y]], AT_DATA_GRAMMAR([[input.y]],
[[%error-verbose [[%define error-verbose
%debug %debug
%locations %locations
%initial-action { %initial-action {
@@ -706,7 +706,7 @@ AT_CLEANUP
AT_SETUP([Default tagged and per-type %printer and %destructor]) AT_SETUP([Default tagged and per-type %printer and %destructor])
AT_DATA_GRAMMAR([[input.y]], AT_DATA_GRAMMAR([[input.y]],
[[%error-verbose [[%define error-verbose
%debug %debug
%{ %{
@@ -850,7 +850,7 @@ m4_define([_AT_CHECK_DEFAULT_PRINTER_AND_DESTRUCTOR_FOR_END_TOKEN],
[m4_pushdef([kind], [*]) m4_pushdef([not_kind], [])]) [m4_pushdef([kind], [*]) m4_pushdef([not_kind], [])])
AT_DATA_GRAMMAR([[input]]$1[[.y]], AT_DATA_GRAMMAR([[input]]$1[[.y]],
[[%error-verbose [[%define error-verbose
%debug %debug
%locations %locations
%initial-action { %initial-action {