tests: factor.

* tests/glr-regression.at, tests/output.at, tests/push.at,
* tests/regression.at, tests/torture.at, tests/actions.at:
Use AT_YYLEX_* and AT_YYERROR_*.
This commit is contained in:
Akim Demaille
2012-06-21 18:26:44 +02:00
parent 6e2d7b0974
commit 290a8ff2c0
6 changed files with 46 additions and 119 deletions

View File

@@ -462,11 +462,7 @@ AT_DATA_GRAMMAR([input.y],
%%
exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!";
%%
void
yyerror (char const *s)
{
fprintf (stderr, "%s\n", s);
}
]AT_YYERROR_DEFINE[
int
yylex (void)
@@ -901,15 +897,9 @@ member: STRING
| INVALID
;
%%
AT_LALR1_CC_IF(
[/* A C++ error reporting function. */
void
yy::parser::error (const location&, const std::string& m)
{
std::cerr << m << std::endl;
}
int
AT_YYERROR_DEFINE[
]AT_LALR1_CC_IF(
[int
yyparse ()
{
yy::parser parser;
@@ -918,12 +908,7 @@ yyparse ()
#endif
return parser.parse ();
}
],
[static void
yyerror (const char *s)
{
fprintf (stderr, "%s\n", s);
}])
])
static int
yylex (AT_LALR1_CC_IF([int *lval], [void]))