mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 05:43:03 +00:00
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:
@@ -1597,8 +1597,8 @@ typedef struct
|
||||
Return 0 if there are more than YYARGN expected tokens, yet fill
|
||||
YYARG up to YYARGN. */
|
||||
static int
|
||||
yyexpected_tokens (const yypcontext_t *yyctx,
|
||||
yysymbol_kind_t yyarg[], int yyargn)
|
||||
yypcontext_expected_tokens (const yypcontext_t *yyctx,
|
||||
yysymbol_kind_t yyarg[], int yyargn)
|
||||
{
|
||||
/* Actual size of YYARG. */
|
||||
int yycount = 0;
|
||||
@@ -2807,7 +2807,7 @@ yyreport_syntax_error (const yypcontext_t *ctx)
|
||||
{
|
||||
argv[argc++] = yysymbol_name (unexpected);
|
||||
yysymbol_kind_t expected[ARGS_MAX - 1];
|
||||
int nexpected = yyexpected_tokens (ctx, expected, ARGS_MAX - 1);
|
||||
int nexpected = yypcontext_expected_tokens (ctx, expected, ARGS_MAX - 1);
|
||||
if (nexpected < 0)
|
||||
res = nexpected;
|
||||
else
|
||||
|
||||
@@ -811,7 +811,7 @@ yyreport_syntax_error (const yypcontext_t *ctx)
|
||||
{
|
||||
argv[argc++] = yysymbol_name (unexpected);
|
||||
yysymbol_kind_t expected[ARGS_MAX - 1];
|
||||
int nexpected = yyexpected_tokens (ctx, expected, ARGS_MAX - 1);
|
||||
int nexpected = yypcontext_expected_tokens (ctx, expected, ARGS_MAX - 1);
|
||||
if (nexpected < 0)
|
||||
res = nexpected;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user