doc: c++: document parser::context

* doc/bison.texi (C++ Parser Context): New.

* data/skeletons/lalr1.cc (parser::yysymbol_name): Rename as...
(parser::symbol_name): this.
(A Complete C++ Example): Promote LAC, now that we have it.
Promote parse.error detailed over verbose.
* examples/c++/calc++/calc++.test, tests/local.at: Adjust.
This commit is contained in:
Akim Demaille
2020-04-13 14:18:51 +02:00
parent dc1035bada
commit 42ab6c1e44
4 changed files with 135 additions and 20 deletions

View File

@@ -308,7 +308,7 @@ m4_define([b4_shared_declarations],
]b4_parse_error_bmatch([custom\|detailed], [[
/// The user-facing name of the symbol whose (internal) number is
/// YYSYMBOL. No bounds checking.
static const char *yysymbol_name (symbol_kind_type yysymbol);
static const char *symbol_name (symbol_kind_type yysymbol);
]])[
// Tables.
@@ -586,7 +586,7 @@ m4_if(b4_prefix, [yy], [],
/* The user-facing name of the symbol whose (internal) number is
YYSYMBOL. No bounds checking. */
const char *
]b4_parser_class[::yysymbol_name (symbol_kind_type yysymbol)
]b4_parser_class[::symbol_name (symbol_kind_type yysymbol)
{
static const char *const yy_sname[] =
{
@@ -1503,7 +1503,7 @@ b4_dollar_popdef])[]dnl
{
yyres += ]b4_parse_error_case([verbose],
[[yytnamerr_ (yytname_[yyarg[yyi++]])]],
[[yysymbol_name (yyarg[yyi++])]])[;
[[symbol_name (yyarg[yyi++])]])[;
++yyp;
}
else