X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/aedcb6c095347f71206ed9410ad27907b4be903e..312c0cff71e784e116c0ecac4c33bc94d54f78de:/tests/actions.at diff --git a/tests/actions.at b/tests/actions.at index 75e5d16c..9473f6ef 100644 --- a/tests/actions.at +++ b/tests/actions.at @@ -32,10 +32,10 @@ AT_BISON_OPTION_PUSHDEFS AT_DATA_GRAMMAR([[input.y]], [[%define parse.error verbose %debug -%{ +%code { ]AT_YYERROR_DECLARE[ ]AT_YYLEX_DECLARE[ -%} +} %% exp: { putchar ('0'); } '1' { putchar ('1'); } @@ -77,8 +77,7 @@ m4_pushdef([AT_TEST], AT_BISON_OPTION_PUSHDEFS([%locations %skeleton "$1" $2]) AT_DATA_GRAMMAR([[input.y]], -[[%defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ -%locations +[[%locations %debug %skeleton "$1" ]$2[ @@ -92,7 +91,7 @@ AT_DATA_GRAMMAR([[input.y]], } %% exp: { ]AT_SKEL_CC_IF([[std::cerr << @$ << std::endl]], - [[YY_LOCATION_PRINT(stderr, @$); fputc ('\n', stderr)]])[; } + [[LOCATION_PRINT(stderr, @$); fputc ('\n', stderr)]])[; } %% ]AT_YYERROR_DEFINE[ @@ -146,7 +145,7 @@ AT_TEST([glr.cc]) AT_TEST([yacc.c], [%define api.pure full], [[%{ # define YYLTYPE int -# define YY_LOCATION_PRINT(Stream, Loc) \ +# define LOCATION_PRINT(Stream, Loc) \ (void) (Loc) # define YYLLOC_DEFAULT(Current, Rhs, N) \ (Current) = ((Rhs)[N ? 1 : 0]) @@ -157,7 +156,7 @@ AT_TEST([yacc.c], [%define api.pure full], AT_TEST([yacc.c], [%define api.pure full], [[%{ # define YYLTYPE int -# define YY_LOCATION_PRINT(Stream, Loc) \ +# define LOCATION_PRINT(Stream, Loc) \ fprintf ((Stream), "%d", (Loc)) # define YYLLOC_DEFAULT(Current, Rhs, N) \ (Current) = ((Rhs)[N ? 1 : 0]) @@ -182,16 +181,13 @@ m4_pushdef([AT_TEST], AT_BISON_OPTION_PUSHDEFS([%locations %skeleton "$1" $2]) AT_DATA_GRAMMAR([[input.y]], -[[%defines /* FIXME: Required by lalr1.cc in Bison 2.6. */ -%locations +[[%locations %debug %skeleton "$1" ]$2[ ]$3[ %code { -# include -# include /* getenv */ ]AT_YYERROR_DECLARE[ ]AT_YYLEX_DECLARE[ } @@ -212,7 +208,7 @@ main (void) loc.]AT_LAST_LINE[ = L2; \ loc.]AT_LAST_COLUMN[ = C2; \ ]AT_SKEL_CC_IF([std::cout << loc], - [YY_LOCATION_PRINT(stdout, loc)])[;\ + [LOCATION_PRINT(stdout, loc)])[;\ putchar ('\n'); TEST(1, 1, 1, 1); @@ -259,11 +255,11 @@ AT_BISON_OPTION_PUSHDEFS AT_DATA_GRAMMAR([[input.y]], [[%define parse.error verbose %debug -%{ +%code { ]AT_YYERROR_DECLARE[ ]AT_YYLEX_DECLARE[ # define USE(Var) -%} +} %union { @@ -309,7 +305,6 @@ AT_PARSER_CHECK([./input], 0, AT_DATA_GRAMMAR([[input.y]], [[ %{ -# include ]AT_YYERROR_DECLARE[ ]AT_YYLEX_DECLARE[ typedef struct { int val; } stype; @@ -764,13 +759,11 @@ AT_DATA_GRAMMAR([[input.y]], %debug %locations -%{ -# include -# include +%code { ]AT_YYLEX_DECLARE[ ]AT_YYERROR_DECLARE[ # define USE(SYM) -%} +} %printer { fprintf (yyoutput, "<*> printer should not be called.\n"); @@ -805,8 +798,8 @@ start: 'a' 'b' 'c' 'd' 'e' { $$ = 'S'; USE(($1, $2, $3, $4, $5)); } ; ]]) AT_BISON_CHECK([-o input.c input.y], [], [], -[[input.y:23.3-5: warning: useless %destructor for type <*> [-Wother] -input.y:23.3-5: warning: useless %printer for type <*> [-Wother] +[[input.y:30.3-5: warning: useless %destructor for type <*> [-Wother] +input.y:30.3-5: warning: useless %printer for type <*> [-Wother] ]]) AT_COMPILE([input]) AT_PARSER_CHECK([./input --debug], 1, @@ -859,8 +852,6 @@ AT_DATA_GRAMMAR([[input.y]], %debug %{ -# include -# include ]AT_YYERROR_DECLARE[ ]AT_YYLEX_DECLARE[ # define USE(SYM) @@ -988,13 +979,11 @@ AT_DATA_GRAMMAR([[input]]$1[[.y]], %debug %locations -%{ -# include -# include +%code { ]AT_YYERROR_DECLARE[ ]AT_YYLEX_DECLARE[ # define USE(SYM) -%} +} %destructor { fprintf (yyoutput, "<]]not_kind[[> destructor should not be called.\n"); @@ -1022,7 +1011,7 @@ AT_DATA_GRAMMAR([[input]]$1[[.y]], start: { $$ = 'S'; } ; %% - +#include /* abort */ static int yylex (void) { @@ -1041,11 +1030,11 @@ AT_BISON_OPTION_POPDEFS AT_BISON_CHECK([-o input$1.c input$1.y], [], [], [m4_if([$1], [0], -[[input0.y:23.3-5: warning: useless %destructor for type <*> [-Wother] -input0.y:23.3-5: warning: useless %printer for type <*> [-Wother] +[[input0.y:30.3-5: warning: useless %destructor for type <*> [-Wother] +input0.y:30.3-5: warning: useless %printer for type <*> [-Wother] ]], -[[input1.y:23.3-4: warning: useless %destructor for type <> [-Wother] -input1.y:23.3-4: warning: useless %printer for type <> [-Wother] +[[input1.y:30.3-4: warning: useless %destructor for type <> [-Wother] +input1.y:30.3-4: warning: useless %printer for type <> [-Wother] ]])]) AT_COMPILE([input$1]) @@ -1056,7 +1045,7 @@ AT_PARSER_CHECK([./input$1 --debug], 0, ]], [[Starting parse Entering state 0 -Reducing stack by rule 1 (line 42): +Reducing stack by rule 1 (line 49): -> $$ = nterm start (1.1: <]]kind[[> for 'S' @ 1) Stack now 0 Entering state 1 @@ -1131,8 +1120,8 @@ start: AT_BISON_OPTION_POPDEFS AT_BISON_CHECK([-o input.c input.y], [], [], -[[input.y:21.6-8: warning: useless %destructor for type <*> [-Wother] -input.y:21.6-8: warning: useless %printer for type <*> [-Wother] +[[input.y:23.6-8: warning: useless %destructor for type <*> [-Wother] +input.y:23.6-8: warning: useless %printer for type <*> [-Wother] ]]) AT_COMPILE([input]) AT_PARSER_CHECK([./input --debug], [1], [], @@ -1229,8 +1218,8 @@ start: { USE($$); } ; AT_BISON_OPTION_POPDEFS AT_BISON_CHECK([-o input.c input.y], [], [], -[[input.y:22.3-4: warning: useless %destructor for type <> [-Wother] -input.y:22.3-4: warning: useless %printer for type <> [-Wother] +[[input.y:24.3-4: warning: useless %destructor for type <> [-Wother] +input.y:24.3-4: warning: useless %printer for type <> [-Wother] ]]) AT_COMPILE([input]) @@ -1249,14 +1238,12 @@ AT_DATA_GRAMMAR([[input.y]], [[%debug /* So that %printer is actually compiled. */ %{ -# include -# include ]AT_YYERROR_DECLARE[ ]AT_YYLEX_DECLARE[ # define USE(SYM) # define YYLTYPE int # define YYLLOC_DEFAULT(Current, Rhs, N) (void)(Rhs) -# define YY_LOCATION_PRINT(File, Loc) +# define LOCATION_PRINT(File, Loc) %} %printer { fprintf (yyoutput, "%d", @$); } <>