X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/b9278c7d174c1be5d7482343c5e433f428657ed0..3ef9fa8f83316f7955babee666546feb5d9bdefc:/tests/glr-regression.at diff --git a/tests/glr-regression.at b/tests/glr-regression.at index 41fc7bc7..e5e758cd 100644 --- a/tests/glr-regression.at +++ b/tests/glr-regression.at @@ -1,6 +1,6 @@ # Checking GLR Parsing: Regression Tests -*- Autotest -*- -# Copyright (C) 2002-2003, 2005-2007, 2009-2012 Free Software +# Copyright (C) 2002-2003, 2005-2007, 2009-2013 Free Software # Foundation, Inc. # This program is free software: you can redistribute it and/or modify @@ -326,7 +326,7 @@ int yylex (void) } int -main(int argc, char* argv[]) +main (int argc, char* argv[]) { int res; input = stdin; @@ -488,11 +488,7 @@ start: %% ]AT_YYLEX_DEFINE(["a"])[ ]AT_YYERROR_DEFINE[ -int -main (void) -{ - return yyparse () != 1; -} +]AT_MAIN_DEFINE[ ]]) AT_BISON_OPTION_POPDEFS @@ -501,7 +497,7 @@ AT_BISON_CHECK([[-o glr-regr5.c glr-regr5.y]], 0, [], ]]) AT_COMPILE([glr-regr5]) -AT_PARSER_CHECK([[./glr-regr5]], 0, [], +AT_PARSER_CHECK([[./glr-regr5]], 1, [], [syntax is ambiguous ]) @@ -540,11 +536,7 @@ start: 'a' | 'a' ; %% ]AT_YYERROR_DEFINE[ ]AT_YYLEX_DEFINE(["a"])[ -int -main (void) -{ - return yyparse () != 1; -} +]AT_MAIN_DEFINE[ ]]) AT_BISON_OPTION_POPDEFS @@ -553,7 +545,7 @@ AT_BISON_CHECK([[-o glr-regr6.c glr-regr6.y]], 0, [], ]]) AT_COMPILE([glr-regr6]) -AT_PARSER_CHECK([[./glr-regr6]], 0, +AT_PARSER_CHECK([[./glr-regr6]], 1, [Destructor called. ], [syntax is ambiguous @@ -651,7 +643,7 @@ AT_CLEANUP ## ------------------------------------------------------------------------- ## ## Incorrect default location for empty right-hand sides. Adapted from bug ## -## report by Claudia Hermann. ## +## report by Claudia Hermann. ## ## See http://lists.gnu.org/archive/html/bug-bison/2005-10/msg00069.html and ## ## http://lists.gnu.org/archive/html/bug-bison/2005-10/msg00072.html ## ## ------------------------------------------------------------------------- ## @@ -677,25 +669,25 @@ AT_DATA_GRAMMAR([glr-regr8.y], %% -PortClause : T_PORT InterfaceDeclaration T_PORT - { printf("%d/%d - %d/%d - %d/%d\n", - @1.first_column, @1.last_column, - @2.first_column, @2.last_column, - @3.first_column, @3.last_column); } - ; +PortClause : T_PORT InterfaceDeclaration T_PORT + { printf("%d/%d - %d/%d - %d/%d\n", + @1.first_column, @1.last_column, + @2.first_column, @2.last_column, + @3.first_column, @3.last_column); } + ; -InterfaceDeclaration : OptConstantWord %dprec 1 - | OptSignalWord %dprec 2 - ; +InterfaceDeclaration : OptConstantWord %dprec 1 + | OptSignalWord %dprec 2 + ; -OptConstantWord : /* empty */ - | T_CONSTANT - ; +OptConstantWord : /* empty */ + | T_CONSTANT + ; -OptSignalWord : /* empty */ - { printf("empty: %d/%d\n", @$.first_column, @$.last_column); } - | T_SIGNAL - ; +OptSignalWord : /* empty */ + { printf("empty: %d/%d\n", @$.first_column, @$.last_column); } + | T_SIGNAL + ; %% @@ -722,12 +714,7 @@ int yylex (void) } } -int -main (void) -{ - yyparse(); - return 0; -} +]AT_MAIN_DEFINE[ ]]) AT_BISON_OPTION_POPDEFS @@ -1058,7 +1045,7 @@ AT_CLEANUP ## ------------------------------------------------------------------------- ## -## Incorrect lookahead during deterministic GLR. See ## +## Incorrect lookahead during deterministic GLR. See ## ## and ## ## . ## ## ------------------------------------------------------------------------- ## @@ -1146,10 +1133,10 @@ print_lookahead (char const *reduction) { printf ("'%c', yylval='", yychar); if (yylval.value > ' ') - printf ("%c", yylval.value); + printf ("%c", yylval.value); printf ("', yylloc=(%d,%d),(%d,%d)", - yylloc.first_line, yylloc.first_column, - yylloc.last_line, yylloc.last_column); + yylloc.first_line, yylloc.first_column, + yylloc.last_line, yylloc.last_column); } printf ("\n"); } @@ -1246,7 +1233,7 @@ merge: | conflict defstate_look 'a' nonconflict2 'b' defstate_shift %dprec 2 { USE ($3); USE ($5); print_lookahead ("merge <- conflict defstate_look 'a' nonconflict2 'b'" - " defstate_shift"); + " defstate_shift"); } ; @@ -1293,7 +1280,7 @@ alt1: USE ($1); if (yychar != 'd' && yychar != YYEOF) { - fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); + fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); } } ; @@ -1302,7 +1289,7 @@ alt2: USE ($1); if (yychar != 'd' && yychar != YYEOF) { - fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); + fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); } } ; @@ -1311,7 +1298,7 @@ alt3: USE ($1); if (yychar != 'd' && yychar != YYEOF) { - fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); + fprintf (stderr, "Incorrect lookahead during stack explosion.\n"); } } ; @@ -1319,8 +1306,8 @@ no_look: { if (yychar != YYEMPTY) { - fprintf (stderr, - "Found lookahead where shouldn't during stack explosion.\n"); + fprintf (stderr, + "Found lookahead where shouldn't during stack explosion.\n"); } } ; @@ -1352,10 +1339,10 @@ print_lookahead (char const *reduction) { printf ("'%c', yylval='", yychar); if (yylval.value > ' ') - printf ("%c", yylval.value); + printf ("%c", yylval.value); printf ("', yylloc=(%d,%d),(%d,%d)", - yylloc.first_line, yylloc.first_column, - yylloc.last_line, yylloc.last_column); + yylloc.first_line, yylloc.first_column, + yylloc.last_line, yylloc.last_column); } printf ("\n"); } @@ -1600,11 +1587,7 @@ yylex (YYSTYPE *lvalp, YYLTYPE *llocp) return input[toknum++]; } -int -main (void) -{ - return yyparse () != 1; -} +]AT_MAIN_DEFINE[ ]]) AT_BISON_OPTION_POPDEFS @@ -1613,7 +1596,7 @@ AT_BISON_CHECK([[-o glr-regr17.c glr-regr17.y]], 0, [], ]]) AT_COMPILE([glr-regr17]) -AT_PARSER_CHECK([[./glr-regr17]], 0, [], +AT_PARSER_CHECK([[./glr-regr17]], 1, [], [1.1-2.2: syntax is ambiguous ]) @@ -1655,11 +1638,7 @@ sym3: %merge { $$ = 0; } ; %% ]AT_YYERROR_DEFINE[ ]AT_YYLEX_DEFINE[ -int -main (void) -{ - return yyparse (); -} +]AT_MAIN_DEFINE[ ]]) AT_BISON_OPTION_POPDEFS