]> git.saurik.com Git - bison.git/blobdiff - tests/regression.at
skeletons: b4_args -> b4_join to prepare forthcoming changes
[bison.git] / tests / regression.at
index b23cbcfdffbdaafa24f7eacdc56bf9d9022b2120..58988c81f5876ca8de902ca4444d3a37c2e04d7f 100644 (file)
@@ -209,7 +209,7 @@ exp: '(' exp ')' | NUM ;
 AT_BISON_OPTION_POPDEFS
 
 AT_BISON_CHECK([-v -o input.c input.y], 0, [],
-[[input.y:6.8-14: warning: symbol "<=" used more than once as a literal string
+[[input.y:6.8-14: warning: symbol "<=" used more than once as a literal string [-Wother]
 ]])
 
 AT_CLEANUP
@@ -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)
@@ -486,8 +478,8 @@ AT_BISON_OPTION_POPDEFS
 # C-string literal.  Also notice that unnecessary escaping, such as "\?", from
 # the user specification is eliminated.
 AT_BISON_CHECK([-o input.c input.y], [[0]], [[]],
-[[input.y:22.8-14: warning: symbol SPECIAL redeclared
-input.y:22.8-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string
+[[input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
+input.y:22.8-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string [-Wother]
 ]])
 AT_COMPILE([input])
 
@@ -837,13 +829,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 <cstdlib>],
-[#include <stdlib.h>
-#include <stdio.h>
-]AT_YYERROR_DECLARE[])
-%}
+[[%code provides
+{
+  ]AT_YYERROR_DECLARE[
+  ]AT_YYLEX_DECLARE[
+}
 $1
 %token ARROW INVALID NUMBER STRING DATA
 %defines
@@ -888,7 +878,8 @@ member: STRING
    | INVALID
    ;
 %%
-AT_YYERROR_DEFINE[
+]AT_YYERROR_DEFINE[
+]AT_YYLEX_DEFINE([":"])[
 ]AT_LALR1_CC_IF(
 [int
 yyparse ()
@@ -899,28 +890,14 @@ yyparse ()
 #endif
   return parser.parse ();
 }
-])
-
-#include <assert.h>
-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
 
 
@@ -1062,13 +1039,8 @@ start:
 %printer { fprintf (yyoutput, "PRINTER"); } 'a';
 
 %%
-
 ]AT_YYERROR_DEFINE[
-static int
-yylex (void)
-{
-  return 'a';
-}
+]AT_YYLEX_DEFINE(["a"])[
 
 int
 main (void)
@@ -1201,13 +1173,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)
@@ -1218,8 +1184,8 @@ main (void)
 AT_BISON_OPTION_POPDEFS
 
 AT_BISON_CHECK([[-o input.c input.y]], [[0]],,
-[[input.y:23.5-19: warning: rule useless in parser due to conflicts: start: start
-input.y:27.5-19: warning: rule useless in parser due to conflicts: sr_conflict: TK2 "tok alias"
+[[input.y:23.5-19: warning: rule useless in parser due to conflicts: start: start [-Wother]
+input.y:27.5-19: warning: rule useless in parser due to conflicts: sr_conflict: TK2 "tok alias" [-Wother]
 ]])
 AT_COMPILE([[input]])
 AT_PARSER_CHECK([[./input]])
@@ -1304,7 +1270,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)
 {
@@ -1412,7 +1378,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)
 {
@@ -1562,7 +1528,7 @@ A: /*empty*/ | 'a' ;
 
 %%
 ]AT_YYERROR_DEFINE[
-]AT_YYLEX_DEFINE([$1])[
+]AT_YYLEX_DEFINE(["$1"])[
 int
 main (void)
 {