skel: better aliasing of identifiers

* data/glr.c, data/yacc.c: Avoid emitting useless defines.
* data/glr.cc: Restore prefixes for epilogue.
This commit is contained in:
Theophile Ranquet
2013-01-04 12:30:01 +01:00
parent 0707d0c7fa
commit 99d795e8f2
5 changed files with 98 additions and 6 deletions

View File

@@ -752,3 +752,46 @@ AT_PARSER_CHECK([[./input aaaaR]], [[0]])
AT_BISON_OPTION_POPDEFS
AT_CLEANUP
## ------------------------------------ ##
## C++ GLR parser identifier shadowing ##
## ------------------------------------ ##
AT_SETUP([[C++ GLR parser identifier shadowing]])
AT_DATA_GRAMMAR([input.yy], [
%skeleton "glr.cc"
%union
{
int ival;
}
%token <ival> ZERO;
%code
{
int yylex (yy::parser::semantic_type *yylval);
}
%%
exp: ZERO
%%
int yylex (yy::parser::semantic_type *yylval)
{
return yy::parser::token::ZERO;
}
void yy::parser::error (std::string const& msg)
{}
int main()
{}
])
AT_BISON_CHECK([[-o input.cc input.yy]])
AT_COMPILE_CXX([[input]])
AT_CLEANUP