From 4e26809ab9eaf18beb15f5af3331f42c782f9572 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 4 Apr 2020 19:28:30 +0200 Subject: [PATCH] style: rename yysyntax_error_arguments as yy_syntax_error_arguments It's a private implementation detail. * NEWS, data/skeletons/glr.c, data/skeletons/lalr1.cc, * data/skeletons/yacc.c, doc/bison.texi: here. --- NEWS | 2 +- data/skeletons/glr.c | 6 +++--- data/skeletons/lalr1.cc | 10 +++++----- data/skeletons/yacc.c | 6 +++--- doc/bison.texi | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/NEWS b/NEWS index 8c146fe9..de8cfd0a 100644 --- a/NEWS +++ b/NEWS @@ -41,7 +41,7 @@ GNU Bison NEWS { enum { ARGMAX = 10 }; int arg[ARGMAX]; - int n = yysyntax_error_arguments (ctx, arg, ARGMAX); + int n = yy_syntax_error_arguments (ctx, arg, ARGMAX); if (n == -2) return 2; // Memory exhausted. YY_LOCATION_PRINT (stderr, *yypcontext_location (ctx)); diff --git a/data/skeletons/glr.c b/data/skeletons/glr.c index 9307b04e..9a2c0910 100644 --- a/data/skeletons/glr.c +++ b/data/skeletons/glr.c @@ -2151,8 +2151,8 @@ yypcontext_location (const yyGLRStack *yystackp) }]])], [detailed\|verbose], [[static int -yysyntax_error_arguments (const yyGLRStack* yystackp, - yysymbol_type_t yyarg[], int yyargn) +yy_syntax_error_arguments (const yyGLRStack* yystackp, + yysymbol_type_t yyarg[], int yyargn) { yysymbol_type_t yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* Actual size of YYARG. */ @@ -2225,7 +2225,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) /* Actual size of YYARG. */ int yycount - = yysyntax_error_arguments (yystackp, yyarg, YYARGS_MAX); + = yy_syntax_error_arguments (yystackp, yyarg, YYARGS_MAX); if (yycount == YYNOMEM) yyMemoryExhausted (yystackp); diff --git a/data/skeletons/lalr1.cc b/data/skeletons/lalr1.cc index 169df09b..ca4ac9cb 100644 --- a/data/skeletons/lalr1.cc +++ b/data/skeletons/lalr1.cc @@ -279,8 +279,8 @@ m4_define([b4_shared_declarations], void yyreport_syntax_error (const context& yyctx) const;]], [detailed\|verbose], [[ /// The arguments of the error message. - int yysyntax_error_arguments_ (const context& yyctx, - symbol_type_type yyarg[], int yyargn) const; + int yy_syntax_error_arguments_ (const context& yyctx, + symbol_type_type yyarg[], int yyargn) const; /// Generate an error message. /// \param yyctx the context in which the error occurred. @@ -1422,8 +1422,8 @@ b4_dollar_popdef])[]dnl }]])b4_parse_error_bmatch([detailed\|verbose], [[ int - ]b4_parser_class[::yysyntax_error_arguments_ (const context& yyctx, - symbol_type_type yyarg[], int yyargn) const + ]b4_parser_class[::yy_syntax_error_arguments_ (const context& yyctx, + symbol_type_type yyarg[], int yyargn) const { /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then @@ -1473,7 +1473,7 @@ b4_dollar_popdef])[]dnl enum { YYARGS_MAX = 5 }; // Arguments of yyformat. symbol_type_type yyarg[YYARGS_MAX]; - int yycount = yysyntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); + int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); char const* yyformat = YY_NULLPTR; switch (yycount) diff --git a/data/skeletons/yacc.c b/data/skeletons/yacc.c index e4cd872b..d593467b 100644 --- a/data/skeletons/yacc.c +++ b/data/skeletons/yacc.c @@ -1323,8 +1323,8 @@ yytnamerr (char *yyres, const char *yystr) ]])[ static int -yysyntax_error_arguments (const yypcontext_t *yyctx, - yysymbol_type_t yyarg[], int yyargn) +yy_syntax_error_arguments (const yypcontext_t *yyctx, + yysymbol_type_t yyarg[], int yyargn) { /* Actual size of YYARG. */ int yycount = 0; @@ -1396,7 +1396,7 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, YYPTRDIFF_T yysize = 0; /* Actual size of YYARG. */ - int yycount = yysyntax_error_arguments (yyctx, yyarg, YYARGS_MAX); + int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); if (yycount == YYNOMEM) return YYNOMEM; diff --git a/doc/bison.texi b/doc/bison.texi index 1e205a48..13c7548a 100644 --- a/doc/bison.texi +++ b/doc/bison.texi @@ -7408,7 +7408,7 @@ The location of the syntax error. @end deftypefun -@deftypefun int yysyntax_error_arguments (@code{const yypcontext_t *}ctx, @code{int} @var{argv}@code{[]}, @code{int} @var{argc}) +@deftypefun int yy_syntax_error_arguments (@code{const yypcontext_t *}ctx, @code{int} @var{argv}@code{[]}, @code{int} @var{argc}) Fill @var{argv} with first the internal number of the token that caused the error, then the internal numbers of the expected tokens. Never put more than @var{argc} elements into @var{argv}, and on success return the @@ -7432,7 +7432,7 @@ yyreport_syntax_error (const yypcontext_t *ctx) @{ enum @{ ARGMAX = 10 @}; int arg[ARGMAX]; - int n = yysyntax_error_arguments (ctx, arg, ARGMAX); + int n = yy_syntax_error_arguments (ctx, arg, ARGMAX); if (n == -2) return 2; fprintf (stderr, "syntax error");