X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/77519a7d18266500754693b5e9e4b89608d6ed2c..faff3bef5b72ac85093799f997596631c3202c12:/tests/regression.at diff --git a/tests/regression.at b/tests/regression.at index ac7d55ee..c2795f66 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -463,15 +463,7 @@ AT_DATA_GRAMMAR([input.y], exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"; %% ]AT_YYERROR_DEFINE[ - -int -yylex (void) -{ - static int called; - if (called++) - abort (); - return SPECIAL; -} +]AT_YYLEX_DEFINE([{ SPECIAL }])[ int main (void) @@ -846,13 +838,11 @@ AT_CLEANUP # so that possible bound checking compilers could check all the skeletons. m4_define([_AT_DATA_DANCER_Y], [AT_DATA_GRAMMAR([dancer.y], -[%{ -static int yylex (AT_LALR1_CC_IF([int *], [void])); -AT_LALR1_CC_IF([], -[#include -#include -]AT_YYERROR_DECLARE[]) -%} +[[%code provides +{ + ]AT_YYERROR_DECLARE[ + ]AT_YYLEX_DECLARE[ +} $1 %token ARROW INVALID NUMBER STRING DATA %defines @@ -897,7 +887,8 @@ member: STRING | INVALID ; %% -AT_YYERROR_DEFINE[ +]AT_YYERROR_DEFINE[ +]AT_YYLEX_DEFINE([":"])[ ]AT_LALR1_CC_IF( [int yyparse () @@ -908,28 +899,14 @@ yyparse () #endif return parser.parse (); } -]) - -#include -static int -yylex (AT_LALR1_CC_IF([int *lval], [void])) -[{ - static int const tokens[] = - { - ':', -1 - }; - static size_t toknum; - ]AT_LALR1_CC_IF([*lval = 0; /* Pacify GCC. */])[ - assert (toknum < sizeof tokens / sizeof *tokens); - return tokens[toknum++]; -}] +])[ int main (void) { return yyparse (); } -]) +]]) ])# _AT_DATA_DANCER_Y @@ -1071,13 +1048,8 @@ start: %printer { fprintf (yyoutput, "PRINTER"); } 'a'; %% - ]AT_YYERROR_DEFINE[ -static int -yylex (void) -{ - return 'a'; -} +]AT_YYLEX_DEFINE(["a"])[ int main (void) @@ -1210,13 +1182,7 @@ sr_conflict: %% ]AT_YYERROR_DEFINE[ -int -yylex (void) -{ - static int const input[] = { 1, 2, 3, 0 }; - static int const *inputp = input; - return *inputp++; -} +]AT_YYLEX_DEFINE([{ 1, 2, 3, 0 }])[ int main (void) @@ -1312,7 +1278,7 @@ syntax_error: /* Induce two syntax error messages (which requires full error recovery by shifting 3 tokens) in order to detect any loss of the reallocated buffer. */ -]AT_YYLEX_DEFINE([abc])[ +]AT_YYLEX_DEFINE(["abc"])[ int main (void) { @@ -1419,7 +1385,7 @@ syntax_error2: ]AT_YYERROR_DEFINE[ /* Induce two syntax error messages (which requires full error recovery by shifting 3 tokens). */ -]AT_YYLEX_DEFINE([abc])[ +]AT_YYLEX_DEFINE(["abc"])[ int main (void) { @@ -1569,7 +1535,7 @@ A: /*empty*/ | 'a' ; %% ]AT_YYERROR_DEFINE[ -]AT_YYLEX_DEFINE([$1])[ +]AT_YYLEX_DEFINE(["$1"])[ int main (void) {