mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 00:03:03 +00:00
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:
@@ -63,7 +63,8 @@ m4_pushdef([AT_PURE_AND_LOC_IF],
|
||||
[$1], [$2])])
|
||||
m4_pushdef([AT_GLR_OR_PARAM_IF],
|
||||
[m4_bmatch([$3], [%glr-parser\|%parse-param], [$1], [$2])])
|
||||
|
||||
m4_pushdef([AT_NAME_PREFIX],
|
||||
[m4_bregexp([$3], [name-prefix="\([^"]*\)"], [\1])])
|
||||
# yyerror receives the location if %location & %pure & (%glr or %parse-param).
|
||||
m4_pushdef([AT_YYERROR_ARG_LOC_IF],
|
||||
[AT_GLR_OR_PARAM_IF([AT_PURE_AND_LOC_IF([$1], [$2])],
|
||||
@@ -80,7 +81,7 @@ m4_pushdef([AT_YYERROR_SEES_LOC_IF],
|
||||
# are using the C++ parsers.
|
||||
m4_pushdef([AT_PURE_LEX_IF],
|
||||
[AT_PURE_IF([$1],
|
||||
[AT_LALR1_CC_IF([$1], [$2])])])
|
||||
[AT_SKEL_CC_IF([$1], [$2])])])
|
||||
|
||||
AT_PURE_LEX_IF(
|
||||
[m4_pushdef([AT_LOC], [(*llocp)])
|
||||
@@ -120,6 +121,7 @@ m4_popdef([AT_LOC])
|
||||
m4_popdef([AT_PURE_LEX_IF])
|
||||
m4_popdef([AT_YYERROR_SEES_LOC_IF])
|
||||
m4_popdef([AT_YYERROR_ARG_LOC_IF])
|
||||
m4_popdef([AT_NAME_PREFIX])
|
||||
m4_popdef([AT_GLR_OR_PARAM_IF])
|
||||
m4_popdef([AT_PURE_AND_LOC_IF])
|
||||
m4_popdef([AT_LOCATION_IF])
|
||||
|
||||
Reference in New Issue
Block a user