Apply --prefix to C++ skeletons too: they change the namespace.

The test suite already exercize these cases.
* data/c++.m4 (b4_namespace): New.
* data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
* data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
* data/yacc.c, data/glr.c: Remove a useless `[]'.
* doc/bison.texinfo: Document it.
(Option Cross Key): Use @multitable in all formats.  It looks
nicer, even in TeX outputs.
(Rules): Use the same code whatever the output type is.
* tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
(_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
* tests/calc.at: Use it, instead of hard coding `yy'.
This commit is contained in:
Akim Demaille
2006-03-12 14:45:27 +00:00
parent 455671735e
commit aa08666d72
11 changed files with 123 additions and 132 deletions

View File

@@ -73,7 +73,7 @@ static int global_count = 0;
static int power (int base, int exponent);
]AT_SKEL_CC_IF(
[#ifndef YYLTYPE
# define YYLTYPE yy::location
[#] define YYLTYPE AT_NAME_PREFIX::location
#endif
#define first_line begin.line
#define first_column begin.column
@@ -152,7 +152,7 @@ static FILE *input;
]AT_SKEL_CC_IF(
[/* A C++ error reporting function. */
void
yy::parser::error (const location& l, const std::string& m)
AT_NAME_PREFIX::parser::error (const location& l, const std::string& m)
{
(void) l;
std::cerr << AT_LOCATION_IF([l << ": " << ])m << std::endl;
@@ -161,7 +161,7 @@ yy::parser::error (const location& l, const std::string& m)
int
yyparse (AT_PARAM_IF([semantic_value *result, int *count]))
{
yy::parser parser[]AT_PARAM_IF([ (result, count)]);
AT_NAME_PREFIX::parser parser[]AT_PARAM_IF([ (result, count)]);
parser.set_debug_level (!!YYDEBUG);
return parser.parse ();
}