* Makefile.cfg (local-checks-to-skip): Add changelog-check,

since we don't want to insist on a version number at the start
of the changelog every time.
* Makefile.maint: Sync from coreutils a bit better.
(sc_trailing_blank): Renamed from sc_trailing_space.
All uses changed.
(sc_no_if_have_config_h, sc_require_config_h):
(sc_prohibit_assert_without_use): New rules.
(sc_obsolete_symbols): Don't catch Makefile.maint itself.
(sc_dd_max_sym_length): Fix leading spaces in rule.
(sc_system_h_headers): Prefix with @.
(sc_useless_cpp_parens, m4-check): Output line numbers.
(changelog-check): Allow version only in head.
* data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
satisfy new Makefile.maint rule.
* data/glr.c: Likewise.
* data/glr.cc: Likewise.
* data/lalr1.cc: Likewise.
* data/yacc.c: Likewise.
* lib/ebitsetv.c: Likewise.
* lib/lbitset.c: Likewise.
* lib/subpipe.c: Likewise.
* lib/timevar.c: Likewise.
* src/system.h: Likewise.
* data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
* djgpp/Makefile.maint: Add copyright notice.
* djgpp/README.in: Likewise.
* djgpp/config.bat: Likewise.
* djgpp/config.site: Likewise.
* djgpp/config_h.sed: Likewise.
* djgpp/djunpack.bat: Likewise.
* djgpp/config.sed: Fix copyright notice to match standard format.
* djgpp/subpipe.h: Likewise.
* lib/bitsetv-print.c: Likewise.
* lib/bitsetv.c: Likewise.
* lib/subpipe.h: Likewise.
* lib/timevar.c: Likewise.
* lib/timevar.h: Likewise.
* djgpp/subpipe.c: Use standard recipe for config.h.
* lib/abitset.c: Likewise.
* lib/bitset.c: Likewise.
* lib/bitset_stats.c: Likewise.
* lib/bitsetv-print.c: Likewise.
* lib/bitsetv.c: Likewise.
* lib/ebitsetv.c: Likewise.
* lib/get-errno.c: Likewise.
* lib/lbitset.c: Likewise.
* lib/subpipe.c: Likewise.
* lib/timevar.c: Likewise.
* lib/vbitset.c: Likewise.
* tests/local.at: Likewise.
* src/scan-gram.l: Don't include verify.h, since system.h does
that for us.
* .x-sc_require_config_h: New file.
* .x-sc_unmarked_diagnostics: New file.
This commit is contained in:
Paul Eggert
2006-01-22 07:38:49 +00:00
parent 68cae94e0b
commit 02650b7f0e
34 changed files with 736 additions and 584 deletions

View File

@@ -142,7 +142,7 @@ m4_define([b4_int_type],
m4_eval([0 <= $1]), [1], [unsigned int],
[int])])
[int])])
# b4_int_type_for(NAME)
@@ -228,7 +228,7 @@ m4_define([b4_token_enums],
enum yytokentype {
m4_map_sep([ b4_token_enum], [,
],
[$@])
[$@])
};
#endif
])])
@@ -259,8 +259,8 @@ m4_define([b4_token_enums_defines],
# Consider a C++ compiler to be modern if it defines __cplusplus.
#
m4_define([b4_c_modern],
[[(defined (__STDC__) || defined (__C99__FUNC__) \
|| defined (__cplusplus) || defined (_MSC_VER))]])
[[(defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)]])
# b4_c_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# ----------------------------------------------------------
@@ -290,9 +290,9 @@ $1 (b4_c_ansi_formals(m4_shiftn(2, $@)))[]dnl
# Output the arguments ANSI-C definition.
m4_define([b4_c_ansi_formals],
[m4_case([$@],
[], [void],
[[]], [void],
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
[], [void],
[[]], [void],
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
m4_define([b4_c_ansi_formal],
[$1])
@@ -313,9 +313,9 @@ m4_define([b4_c_knr_formal_name],
# Output the K&R argument declarations.
m4_define([b4_c_knr_formal_decls],
[m4_map_sep([b4_c_knr_formal_decl],
[
[
],
[$@])])
[$@])])
m4_define([b4_c_knr_formal_decl],
[ $1;])
@@ -331,7 +331,7 @@ m4_define([b4_c_knr_formal_decl],
# -----------------------------------------------------------
# Declare the function NAME.
m4_define([b4_c_function_decl],
[#if defined (__STDC__) || defined (__cplusplus)
[#if defined __STDC__ || defined __cplusplus
b4_c_ansi_function_decl($@)
#else
$2 $1 ();
@@ -398,9 +398,9 @@ m4_define([b4_symbol_actions],
m4_pushdef([b4_at_dollar], [(*yylocationp)])dnl
case $4: /* $3 */
b4_syncline([$2], [$1])
$5;
$5;
b4_syncline([@oline@], [@ofile@])
break;
break;
m4_popdef([b4_at_dollar])dnl
m4_popdef([b4_dollar_dollar])dnl
])
@@ -438,7 +438,7 @@ b4_parse_param_use[]dnl
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
default:
break;
break;
}
}]dnl
])
@@ -458,9 +458,9 @@ m4_define_default([b4_yy_symbol_print_generate],
/*ARGSUSED*/
]$1([yy_symbol_value_print],
[static void],
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[const YYSTYPE * const yyvaluep], [yyvaluep]][]dnl
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[const YYSTYPE * const yyvaluep], [yyvaluep]][]dnl
b4_location_if([, [[const YYLTYPE * const yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
@@ -479,7 +479,7 @@ b4_parse_param_use[]dnl
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
[ default:
break;
break;
}
}
@@ -490,9 +490,9 @@ b4_parse_param_use[]dnl
]$1([yy_symbol_print],
[static void],
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[const YYSTYPE * const yyvaluep], [yyvaluep]][]dnl
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[const YYSTYPE * const yyvaluep], [yyvaluep]][]dnl
b4_location_if([, [[const YYLTYPE * const yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{

View File

@@ -171,7 +171,7 @@ m4_define([b4_shared_declarations],
/* Copy the first part of user declarations. */
]b4_pre_prologue[
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
]m4_ifdef([b4_stype],
[typedef union m4_bregexp(b4_stype, [^{], [YYSTYPE ])
b4_stype
@@ -183,7 +183,7 @@ b4_syncline([@oline@], [@ofile@])
# define YYSTYPE_IS_TRIVIAL 1
#endif
#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE
{
]b4_location_if([
@@ -253,7 +253,7 @@ b4_syncline([@oline@], [@ofile@])
#endif
/* Suppress unused-variable warnings by "using" E. */
#if !defined (lint) || defined (__GNUC__)
#if ! defined lint || defined __GNUC__
# define YYUSE(e) ((void) (e))
#else
# define YYUSE(e) /* empty */
@@ -302,7 +302,7 @@ b4_syncline([@oline@], [@ofile@])
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if (!defined (__GNUC__) || __GNUC__ < 2 \
# if (! defined __GNUC__ || __GNUC__ < 2 \
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__)
# define __attribute__(Spec) /* empty */
# endif
@@ -563,9 +563,9 @@ typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG;
#if YYDEBUG
#if ! defined (YYFPRINTF)
# ifndef YYFPRINTF
# define YYFPRINTF fprintf
#endif
# endif
# define YYDPRINTF(Args) \
do { \
@@ -621,9 +621,9 @@ int yydebug;
#define YYHEADROOM 2
#ifndef YYSTACKEXPANDABLE
# if (! defined (__cplusplus) \
|| (]b4_location_if([[defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
&& ]])[defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))
# if (! defined __cplusplus \
|| (]b4_location_if([[defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
&& ]])[defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))
# define YYSTACKEXPANDABLE 1
# else
# define YYSTACKEXPANDABLE 0
@@ -648,7 +648,7 @@ int yydebug;
#if YYERROR_VERBOSE
# ifndef yystpcpy
# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
# define yystpcpy stpcpy
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in

View File

@@ -74,9 +74,9 @@ m4_define([b4_yy_symbol_print_generate],
[[FILE *], []],
[[int yytype], [yytype]],
[[const yy::b4_parser_class_name::semantic_type *yyvaluep],
[yyvaluep]],
[yyvaluep]],
[[const yy::b4_parser_class_name::location_type *yylocationp],
[yylocationp]],
[yylocationp]],
b4_parse_param)[
{
]b4_parse_param_use[]dnl
@@ -143,7 +143,7 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
inline void
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep, const location_type* yylocationp)
const semantic_type* yyvaluep, const location_type* yylocationp)
{
/* Pacify ``unused variable'' warnings. */
YYUSE (yyvaluep);
@@ -152,18 +152,18 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
[ default:
break;
break;
}
}
void
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep, const location_type* yylocationp)
const semantic_type* yyvaluep, const location_type* yylocationp)
{
*yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm")
<< ' ' << yytname[yytype] << " ("
<< *yylocationp << ": ";
<< ' ' << yytname[yytype] << " ("
<< *yylocationp << ": ";
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
*yycdebug_ << ')';
}
@@ -203,10 +203,10 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
# Let glr.c believe that the user arguments include the parser itself.
m4_ifset([b4_parse_param],
[m4_pushdef([b4_parse_param],
m4_dquote([[[yy::b4_parser_class_name& yyparser], [[yyparser]]],]
m4_dquote([[[yy::b4_parser_class_name& yyparser], [[yyparser]]],]
m4_defn([b4_parse_param])))],
[m4_pushdef([b4_parse_param],
[[[[yy::b4_parser_class_name& yyparser], [[yyparser]]]]])
[[[[yy::b4_parser_class_name& yyparser], [[yyparser]]]]])
])
m4_include(b4_pkgdatadir/[glr.c])
m4_popdef([b4_parse_param])
@@ -214,7 +214,7 @@ m4_popdef([b4_parse_param])
@output @output_header_name@
b4_copyright([C++ Skeleton parser for GLALR(1) parsing with Bison],
[2002, 2003, 2004, 2005, 2006])[
[2002, 2003, 2004, 2005, 2006])[
/* C++ GLR parser skeleton written by Akim Demaille. */
@@ -294,7 +294,7 @@ namespace yy
{
public:
/// Symbol semantic values.
#if ! defined (YYSTYPE)
#ifndef YYSTYPE
]m4_ifdef([b4_stype],
[ union semantic_type
b4_stype
@@ -349,15 +349,15 @@ b4_syncline([@oline@], [@ofile@])
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
const semantic_type* yyvaluep,
const location_type* yylocationp);
/// \brief Report a symbol on the debug stream.
/// \param yytype The token type.
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
const semantic_type* yyvaluep,
const location_type* yylocationp);
private:
#endif /* ! YYDEBUG */
@@ -368,9 +368,9 @@ b4_syncline([@oline@], [@ofile@])
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
inline void yydestruct_ (const char* yymsg,
int yytype,
semantic_type* yyvaluep,
location_type* yylocationp);
int yytype,
semantic_type* yyvaluep,
location_type* yylocationp);
/* Debugging. */
std::ostream* yycdebug_;

View File

@@ -30,7 +30,7 @@ m4_divert(0)dnl
m4_if(b4_defines_flag, 0, [],
[@output @output_header_name@
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison],
[2002, 2003, 2004, 2005, 2006])
[2002, 2003, 2004, 2005, 2006])
dnl FIXME: This is wrong, we want computed header guards.
[
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
@@ -102,7 +102,7 @@ namespace yy
{
public:
/// Symbol semantic values.
#if ! defined (YYSTYPE)
#ifndef YYSTYPE
]m4_ifdef([b4_stype],
[ union semantic_type
b4_stype
@@ -159,15 +159,15 @@ b4_error_verbose_if([, int tok])[);
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
const semantic_type* yyvaluep,
const location_type* yylocationp);
/// \brief Report a symbol on the debug stream.
/// \param yytype The token type.
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
const semantic_type* yyvaluep,
const location_type* yylocationp);
#endif /* ! YYDEBUG */
@@ -256,9 +256,9 @@ b4_error_verbose_if([, int tok])[);
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
inline void yydestruct_ (const char* yymsg,
int yytype,
semantic_type* yyvaluep,
location_type* yylocationp);
int yytype,
semantic_type* yyvaluep,
location_type* yylocationp);
/// Pop \a n symbols the three stacks.
inline void yypop_ (unsigned int n = 1);
@@ -296,7 +296,7 @@ b4_error_verbose_if([, int tok])[);
])dnl
@output @output_parser_name@
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison],
[2002, 2003, 2004, 2005, 2006])
[2002, 2003, 2004, 2005, 2006])
m4_if(b4_prefix[], [yy], [],
[
// Take the name prefix into account.
@@ -429,7 +429,7 @@ namespace yy
inline void
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep, const location_type* yylocationp)
const semantic_type* yyvaluep, const location_type* yylocationp)
{
YYUSE (yylocationp);
YYUSE (yyvaluep);
@@ -437,18 +437,18 @@ namespace yy
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
[ default:
break;
break;
}
}
void
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep, const location_type* yylocationp)
const semantic_type* yyvaluep, const location_type* yylocationp)
{
*yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")
<< ' ' << yytname_[yytype] << " ("
<< *yylocationp << ": ";
<< ' ' << yytname_[yytype] << " ("
<< *yylocationp << ": ";
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
*yycdebug_ << ')';
}
@@ -456,7 +456,7 @@ namespace yy
void
]b4_parser_class_name[::yydestruct_ (const char* yymsg,
int yytype, semantic_type* yyvaluep, location_type* yylocationp)
int yytype, semantic_type* yyvaluep, location_type* yylocationp)
{
YYUSE (yylocationp);
YYUSE (yymsg);
@@ -467,8 +467,8 @@ namespace yy
switch (yytype)
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
default:
break;
default:
break;
}
}
@@ -575,9 +575,9 @@ b4_syncline([@oline@], [@ofile@])])dnl
/* Read a look-ahead token. */
if (yychar == yyempty_)
{
YYCDEBUG << "Reading a token: ";
yychar = ]b4_c_function_call([yylex], [int],
[[YYSTYPE*], [&yylval]][]dnl
YYCDEBUG << "Reading a token: ";
yychar = ]b4_c_function_call([yylex], [int],
[[YYSTYPE*], [&yylval]][]dnl
b4_location_if([, [[location*], [&yylloc]]])dnl
m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
}
@@ -586,13 +586,13 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
/* Convert token to internal form. */
if (yychar <= yyeof_)
{
yychar = yytoken = yyeof_;
YYCDEBUG << "Now at end of input." << std::endl;
yychar = yytoken = yyeof_;
YYCDEBUG << "Now at end of input." << std::endl;
}
else
{
yytoken = yytranslate_ (yychar);
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
yytoken = yytranslate_ (yychar);
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
}
/* If the proper action on seeing token YYTOKEN is to reduce or to
@@ -605,10 +605,10 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
yyn = yytable_[yyn];
if (yyn <= 0)
{
if (yyn == 0 || yyn == yytable_ninf_)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
if (yyn == 0 || yyn == yytable_ninf_)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
/* Accept? */
@@ -665,10 +665,10 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
]b4_actions
]b4_actions
/* Line __line__ of lalr1.cc. */
b4_syncline([@oline@], [@ofile@])[
default: break;
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
@@ -683,7 +683,7 @@ b4_syncline([@oline@], [@ofile@])[
yyn = yyr1_[yyn];
yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
if (0 <= yystate && yystate <= yylast_
&& yycheck_[yystate] == yystate_stack_[0])
&& yycheck_[yystate] == yystate_stack_[0])
yystate = yytable_[yystate];
else
yystate = yydefgoto_[yyn - yyntokens_];
@@ -696,28 +696,28 @@ b4_syncline([@oline@], [@ofile@])[
/* If not already recovering from an error, report this error. */
if (!yyerrstatus_)
{
++yynerrs_;
error (yylloc, yysyntax_error_ (yystate]dnl
++yynerrs_;
error (yylloc, yysyntax_error_ (yystate]dnl
b4_error_verbose_if([, yytoken])[));
}
yyerror_range[0] = yylloc;
if (yyerrstatus_ == 3)
{
/* If just tried and failed to reuse look-ahead token after an
error, discard it. */
/* If just tried and failed to reuse look-ahead token after an
error, discard it. */
if (yychar <= yyeof_)
{
/* Return failure if at end of input. */
if (yychar == yyeof_)
YYABORT;
}
else
{
yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
yychar = yyempty_;
}
if (yychar <= yyeof_)
{
/* Return failure if at end of input. */
if (yychar == yyeof_)
YYABORT;
}
else
{
yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
yychar = yyempty_;
}
}
/* Else will try to reuse look-ahead token after shifting the error
@@ -752,29 +752,29 @@ b4_error_verbose_if([, yytoken])[));
for (;;)
{
yyn = yypact_[yystate];
if (yyn != yypact_ninf_)
{
yyn += yyterror_;
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
{
yyn = yytable_[yyn];
if (0 < yyn)
break;
}
}
yyn = yypact_[yystate];
if (yyn != yypact_ninf_)
{
yyn += yyterror_;
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
{
yyn = yytable_[yyn];
if (0 < yyn)
break;
}
}
/* Pop the current state because it cannot handle the error token. */
if (yystate_stack_.height () == 1)
YYABORT;
/* Pop the current state because it cannot handle the error token. */
if (yystate_stack_.height () == 1)
YYABORT;
yyerror_range[0] = yylocation_stack_[0];
yydestruct_ ("Error: popping",
yystos_[yystate],
&yysemantic_stack_[0], &yylocation_stack_[0]);
yypop_ ();
yystate = yystate_stack_[0];
YY_STACK_PRINT ();
yyerror_range[0] = yylocation_stack_[0];
yydestruct_ ("Error: popping",
yystos_[yystate],
&yysemantic_stack_[0], &yylocation_stack_[0]);
yypop_ ();
yystate = yystate_stack_[0];
YY_STACK_PRINT ();
}
if (yyn == yyfinal_)
@@ -789,7 +789,7 @@ b4_error_verbose_if([, yytoken])[));
/* Shift the error token. */
YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
&yysemantic_stack_[0], &yylocation_stack_[0]);
&yysemantic_stack_[0], &yylocation_stack_[0]);
yystate = yyn;
goto yynewstate;
@@ -813,11 +813,11 @@ b4_error_verbose_if([, yytoken])[));
yypop_ (yylen);
while (yystate_stack_.height () != 1)
{
yydestruct_ ("Cleanup: popping",
yystos_[yystate_stack_[0]],
&yysemantic_stack_[0],
&yylocation_stack_[0]);
yypop_ ();
yydestruct_ ("Cleanup: popping",
yystos_[yystate_stack_[0]],
&yysemantic_stack_[0],
&yylocation_stack_[0]);
yypop_ ();
}
return yyresult;
@@ -834,38 +834,38 @@ b4_error_verbose_if([, int tok])[)
int yyn = yypact_[yystate];
if (yypact_ninf_ < yyn && yyn < yylast_)
{
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
int yyxbegin = yyn < 0 ? -yyn : 0;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */
int yychecklim = yylast_ - yyn;
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
int count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_)
++count;
/* Stay within bounds of both yycheck and yytname. */
int yychecklim = yylast_ - yyn;
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
int count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_)
++count;
// FIXME: This method of building the message is not compatible
// with internationalization. It should work like yacc.c does it.
// That is, first build a string that looks like this:
// "syntax error, unexpected %s or %s or %s"
// Then, invoke YY_ on this string.
// Finally, use the string as a format to output
// yytname_[tok], etc.
// Until this gets fixed, this message appears in English only.
res = "syntax error, unexpected ";
res += yytnamerr_ (yytname_[tok]);
if (count < 5)
{
count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_)
{
res += (!count++) ? ", expecting " : " or ";
res += yytnamerr_ (yytname_[x]);
}
}
// FIXME: This method of building the message is not compatible
// with internationalization. It should work like yacc.c does it.
// That is, first build a string that looks like this:
// "syntax error, unexpected %s or %s or %s"
// Then, invoke YY_ on this string.
// Finally, use the string as a format to output
// yytname_[tok], etc.
// Until this gets fixed, this message appears in English only.
res = "syntax error, unexpected ";
res += yytnamerr_ (yytname_[tok]);
if (count < 5)
{
count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_)
{
res += (!count++) ? ", expecting " : " or ";
res += yytnamerr_ (yytname_[x]);
}
}
}
else
#endif
@@ -994,7 +994,7 @@ b4_error_verbose_if([, int tok])[)
{
*yycdebug_ << "Stack now";
for (state_stack_type::const_iterator i = yystate_stack_.begin ();
i != yystate_stack_.end (); ++i)
i != yystate_stack_.end (); ++i)
*yycdebug_ << ' ' << *i;
*yycdebug_ << std::endl;
}
@@ -1007,13 +1007,13 @@ b4_error_verbose_if([, int tok])[)
int yynrhs = yyr2_[yyrule];
/* Print the symbols being reduced, and their result. */
*yycdebug_ << "Reducing stack by rule " << yyrule - 1
<< " (line " << yylno << "), ";
<< " (line " << yylno << "), ";
/* The symbols being reduced. */
for (int yyi = 0; yyi < yynrhs; yyi++)
YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
yyrhs_[yyprhs_[yyrule] + yyi],
&]b4_rhs_value(yynrhs, yyi + 1)[,
&]b4_rhs_location(yynrhs, yyi + 1)[);
yyrhs_[yyprhs_[yyrule] + yyi],
&]b4_rhs_value(yynrhs, yyi + 1)[,
&]b4_rhs_location(yynrhs, yyi + 1)[);
}
#endif // YYDEBUG

View File

@@ -41,8 +41,8 @@ m4_define_default([b4_stack_depth_init], [200])
# Expand IF-TRUE, if %pure-parser and %parse-param, IF-FALSE otherwise.
m4_define([b4_yacc_pure_if],
[b4_pure_if([m4_ifset([b4_parse_param],
[$1], [$2])],
[$2])])
[$1], [$2])],
[$2])])
# b4_yyerror_args
@@ -82,7 +82,7 @@ m4_define([b4_int_type],
m4_eval([0 <= $1]), [1], [unsigned int],
[int])])
[int])])
## ----------------- ##
@@ -187,9 +187,9 @@ b4_location_if([#define yylloc b4_prefix[]lloc])])[
# define YYTOKEN_TABLE ]b4_token_table[
#endif
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
]m4_ifdef([b4_stype],
[typedef union m4_bregexp(b4_stype, [^{], [YYSTYPE ])
[typedef union[]m4_bregexp(b4_stype, [^{], [ YYSTYPE])
b4_stype
/* Line __line__ of yacc.c. */
b4_syncline([@oline@], [@ofile@])
@@ -200,7 +200,7 @@ b4_syncline([@oline@], [@ofile@])
# define YYSTYPE_IS_TRIVIAL 1
#endif
]b4_location_if([#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
]b4_location_if([#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE
{
int first_line;
@@ -221,11 +221,11 @@ typedef struct YYLTYPE
b4_syncline([@oline@], [@ofile@])[
#ifndef YYSIZE_T
# if defined (__SIZE_TYPE__)
# ifdef __SIZE_TYPE__
# define YYSIZE_T __SIZE_TYPE__
# elif defined (size_t)
# elif defined size_t
# define YYSIZE_T size_t
# elif ! defined (YYSIZE_T) && ]b4_c_modern[
# elif ! defined YYSIZE_T && ]b4_c_modern[
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
@@ -248,7 +248,7 @@ b4_syncline([@oline@], [@ofile@])[
#endif
/* Suppress unused-variable warnings by "using" E. */
#if !defined (lint) || defined (__GNUC__)
#if ! defined lint || defined __GNUC__
# define YYUSE(e) ((void) (e))
#else
# define YYUSE(e) /* empty */
@@ -264,7 +264,7 @@ b4_syncline([@oline@], [@ofile@])[
}
#endif
#if ! defined (yyoverflow) || YYERROR_VERBOSE
#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -272,16 +272,16 @@ b4_syncline([@oline@], [@ofile@])[
# if YYSTACK_USE_ALLOCA
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
# elif defined (__BUILTIN_VA_ARG_INCR)
# elif defined __BUILTIN_VA_ARG_INCR
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
# elif defined (_AIX)
# elif defined _AIX
# define YYSTACK_ALLOC __alloca
# elif defined (_MSC_VER)
# elif defined _MSC_VER
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
# if ! defined (_ALLOCA_H) && ! defined (_STDLIB_H) && ]b4_c_modern[
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && ]b4_c_modern[
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef _STDLIB_H
# define _STDLIB_H 1
@@ -312,13 +312,13 @@ extern "C" {
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
# if ! defined (malloc) && ! defined (_STDLIB_H) && ]b4_c_modern[
# if ! defined malloc && ! defined _STDLIB_H && ]b4_c_modern[
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
# if ! defined (free) && ! defined (_STDLIB_H) && ]b4_c_modern[
# if ! defined free && ! defined _STDLIB_H && ]b4_c_modern[
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
@@ -326,13 +326,13 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
}
# endif
# endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
#if (! defined (yyoverflow) \
&& (! defined (__cplusplus) \
|| (]b4_location_if([[defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
&& ]])[defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
#if (! defined yyoverflow \
&& (! defined __cplusplus \
|| (]b4_location_if([[defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
&& ]])[defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
@@ -359,7 +359,7 @@ union yyalloc
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
# if defined (__GNUC__) && 1 < __GNUC__
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
@@ -600,8 +600,8 @@ while (YYID (0))
# if YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
(Loc).last_line, (Loc).last_column)
(Loc).first_line, (Loc).first_column, \
(Loc).last_line, (Loc).last_column)
# else
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
@@ -636,7 +636,7 @@ do { \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
Type, Value]b4_location_if([, Location])[]b4_user_args[); \
Type, Value]b4_location_if([, Location])[]b4_user_args[); \
YYFPRINTF (stderr, "\n"); \
} \
} while (YYID (0))
@@ -649,8 +649,8 @@ do { \
`------------------------------------------------------------------*/
]b4_c_function_def([yy_stack_print], [static void],
[[short int *bottom], [bottom]],
[[short int *top], [top]])[
[[short int *bottom], [bottom]],
[[short int *top], [top]])[
{
YYFPRINTF (stderr, "Stack now");
for (; bottom <= top; ++bottom)
@@ -670,24 +670,24 @@ do { \
`------------------------------------------------*/
]b4_c_function_def([yy_reduce_print], [static void],
[[YYSTYPE *yyvsp], [yyvsp]],
[[YYSTYPE *yyvsp], [yyvsp]],
b4_location_if([[[YYLTYPE *yylsp], [yylsp]],])
[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [,])
b4_parse_param)[
b4_parse_param)[
{
int yynrhs = yyr2[yyrule];
int yyi;
unsigned long int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
yyrule - 1, yylno);
yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
fprintf (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&]b4_rhs_value(yynrhs, yyi + 1)[
]b4_location_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
b4_user_args[);
&]b4_rhs_value(yynrhs, yyi + 1)[
]b4_location_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
b4_user_args[);
fprintf (stderr, "\n");
}
}
@@ -730,7 +730,7 @@ int yydebug;
#if YYERROR_VERBOSE
# ifndef yystrlen
# if defined (__GLIBC__) && defined (_STRING_H)
# if defined __GLIBC__ && defined _STRING_H
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
@@ -746,7 +746,7 @@ int yydebug;
# endif
# ifndef yystpcpy
# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
# define yystpcpy stpcpy
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
@@ -840,7 +840,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
# if 0
/* This is so xgettext sees the translatable formats that are
constructed on the fly. */
constructed on the fly. */
YY_("syntax error, unexpected %s");
YY_("syntax error, unexpected %s, expecting %s");
YY_("syntax error, unexpected %s, expecting %s or %s");
@@ -853,13 +853,13 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
static char const yyexpecting[] = ", expecting %s";
static char const yyor[] = " or %s";
char yyformat[sizeof yyunexpected
+ sizeof yyexpecting - 1
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
* (sizeof yyor - 1))];
+ sizeof yyexpecting - 1
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
* (sizeof yyor - 1))];
char const *yyprefix = yyexpecting;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
YYCHECK. */
int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */
@@ -871,22 +871,22 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
yyfmt = yystpcpy (yyformat, yyunexpected);
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{
yycount = 1;
yysize = yysize0;
yyformat[sizeof yyunexpected - 1] = '\0';
break;
}
yyarg[yycount++] = yytname[yyx];
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
yysize_overflow |= (yysize1 < yysize);
yysize = yysize1;
yyfmt = yystpcpy (yyfmt, yyprefix);
yyprefix = yyor;
}
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{
yycount = 1;
yysize = yysize0;
yyformat[sizeof yyunexpected - 1] = '\0';
break;
}
yyarg[yycount++] = yytname[yyx];
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
yysize_overflow |= (yysize1 < yysize);
yysize = yysize1;
yyfmt = yystpcpy (yyfmt, yyprefix);
yyprefix = yyor;
}
yyf = YY_(yyformat);
yysize1 = yysize + yystrlen (yyf);
@@ -898,25 +898,25 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
if (yyresult)
{
/* Avoid sprintf, as that infringes on the user's name space.
Don't have undefined behavior even if the translation
produced a string with the wrong number of "%s"s. */
char *yyp = yyresult;
int yyi = 0;
while ((*yyp = *yyf) != '\0')
{
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
{
yyp += yytnamerr (yyp, yyarg[yyi++]);
yyf += 2;
}
else
{
yyp++;
yyf++;
}
}
}
/* Avoid sprintf, as that infringes on the user's name space.
Don't have undefined behavior even if the translation
produced a string with the wrong number of "%s"s. */
char *yyp = yyresult;
int yyi = 0;
while ((*yyp = *yyf) != '\0')
{
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
{
yyp += yytnamerr (yyp, yyarg[yyi++]);
yyf += 2;
}
else
{
yyp++;
yyf++;
}
}
}
return yysize;
}
}
@@ -956,7 +956,7 @@ YYLTYPE yylloc;])
m4_divert_pop([KILL])dnl# ====================== End of M4 code.
b4_pure_if([],
[b4_declare_parser_variables])
[b4_declare_parser_variables])
/*----------.
@@ -1323,15 +1323,15 @@ yyerrlab:
error, discard it. */
if (yychar <= YYEOF)
{
{
/* Return failure if at end of input. */
if (yychar == YYEOF)
YYABORT;
}
}
else
{
yydestruct ("Error: discarding",
yytoken, &yylval]b4_location_if([, &yylloc])[]b4_user_args[);
yytoken, &yylval]b4_location_if([, &yylloc])[]b4_user_args[);
yychar = YYEMPTY;
}
}
@@ -1388,7 +1388,7 @@ yyerrlab1:
]b4_location_if([[ yyerror_range[0] = *yylsp;]])[
yydestruct ("Error: popping",
yystos[yystate], yyvsp]b4_location_if([, yylsp])[]b4_user_args[);
yystos[yystate], yyvsp]b4_location_if([, yylsp])[]b4_user_args[);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
@@ -1475,9 +1475,9 @@ b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
b4_token_enums_defines(b4_tokens)
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
m4_ifdef([b4_stype],
[typedef union m4_bregexp(b4_stype, [^{], [YYSTYPE ])
[typedef union[]m4_bregexp(b4_stype, [^{], [ YYSTYPE])
b4_stype
/* Line __line__ of yacc.c. */
b4_syncline([@oline@], [@ofile@])
@@ -1492,7 +1492,7 @@ b4_pure_if([],
[extern YYSTYPE b4_prefix[]lval;])
b4_location_if(
[#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
[#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE
{
int first_line;