c: rename yyexpected_tokens as yypcontext_expected_tokens

The user should think of yypcontext fields as accessible only via
yypcontext_* functions.  So let's rename yyexpected_tokens to reflect
that.

Let's _not_ rename yyreport_syntax_error, as the user may define this
function, and is not allowed to access directly the fields of
yypcontext_t: she *must* use the "accessors".  This is comparable to
the case of C++/Java where the user defines
parser::report_syntax_error, not parser::context::report_syntax_error.

* data/skeletons/glr.c, data/skeletons/yacc.c (yyexpected_tokens):
Rename as...
(yypcontext_expected_tokens): this.
Adjust dependencies.
This commit is contained in:
Akim Demaille
2020-04-12 16:46:51 +02:00
parent ffa46e6516
commit 5839f4d289
7 changed files with 19 additions and 17 deletions

View File

@@ -2088,8 +2088,8 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
YYARG is null, return the number of expected tokens (guaranteed to
be less than YYNTOKENS). */
static int
yyexpected_tokens (const yyGLRStack* yystackp,
yysymbol_kind_t yyarg[], int yyargn)
yypcontext_expected_tokens (const yyGLRStack* yystackp,
yysymbol_kind_t yyarg[], int yyargn)
{
/* Actual size of YYARG. */
int yycount = 0;
@@ -2190,7 +2190,8 @@ yy_syntax_error_arguments (const yyGLRStack* yystackp,
if (yyarg)
yyarg[yycount] = yytoken;
++yycount;
yyn = yyexpected_tokens (yystackp, yyarg ? yyarg + 1 : yyarg, yyargn - 1);
yyn = yypcontext_expected_tokens (yystackp,
yyarg ? yyarg + 1 : yyarg, yyargn - 1);
if (yyn == YYENOMEM)
return YYENOMEM;
else