]> git.saurik.com Git - bison.git/blobdiff - tests/input.at
regen.
[bison.git] / tests / input.at
index 84ae0ffe136d5c63db0291f51db310d2fcb4fc2f..d94b652ec6cb36cf45b1596e3d087bbee66f4adf 100644 (file)
@@ -177,53 +177,53 @@ AT_SETUP([Default %printer and %destructor redeclared])
 
 AT_DATA([[input.y]],
 [[%destructor { destroy ($$); } <*> <*>
-%printer { destroy ($$); } <*> <*>
+%printer { print ($$); } <*> <*>
 
 %destructor { destroy ($$); } <*>
-%printer { destroy ($$); } <*>
+%printer { print ($$); } <*>
 
 %destructor { destroy ($$); } <> <>
-%printer { destroy ($$); } <> <>
+%printer { print ($$); } <> <>
 
 %destructor { destroy ($$); } <>
-%printer { destroy ($$); } <>
+%printer { print ($$); } <>
 
 %%
 
 start: ;
 
 %destructor { destroy ($$); } <*>;
-%printer { destroy ($$); } <*>;
+%printer { print ($$); } <*>;
 
 %destructor { destroy ($$); } <>;
-%printer { destroy ($$); } <>;
+%printer { print ($$); } <>;
 ]])
 
 AT_BISON_CHECK([input.y], [1], [],
 [[input.y:1.13-29: redeclaration for default tagged %destructor
 input.y:1.13-29: previous declaration
-input.y:2.10-26: redeclaration for default tagged %printer
-input.y:2.10-26: previous declaration
+input.y:2.10-24: redeclaration for default tagged %printer
+input.y:2.10-24: previous declaration
 input.y:4.13-29: redeclaration for default tagged %destructor
 input.y:1.13-29: previous declaration
-input.y:5.10-26: redeclaration for default tagged %printer
-input.y:2.10-26: previous declaration
+input.y:5.10-24: redeclaration for default tagged %printer
+input.y:2.10-24: previous declaration
 input.y:7.13-29: redeclaration for default tagless %destructor
 input.y:7.13-29: previous declaration
-input.y:8.10-26: redeclaration for default tagless %printer
-input.y:8.10-26: previous declaration
+input.y:8.10-24: redeclaration for default tagless %printer
+input.y:8.10-24: previous declaration
 input.y:10.13-29: redeclaration for default tagless %destructor
 input.y:7.13-29: previous declaration
-input.y:11.10-26: redeclaration for default tagless %printer
-input.y:8.10-26: previous declaration
+input.y:11.10-24: redeclaration for default tagless %printer
+input.y:8.10-24: previous declaration
 input.y:17.13-29: redeclaration for default tagged %destructor
 input.y:4.13-29: previous declaration
-input.y:18.10-26: redeclaration for default tagged %printer
-input.y:5.10-26: previous declaration
+input.y:18.10-24: redeclaration for default tagged %printer
+input.y:5.10-24: previous declaration
 input.y:20.13-29: redeclaration for default tagless %destructor
 input.y:10.13-29: previous declaration
-input.y:21.10-26: redeclaration for default tagless %printer
-input.y:11.10-26: previous declaration
+input.y:21.10-24: redeclaration for default tagless %printer
+input.y:11.10-24: previous declaration
 ]])
 
 AT_CLEANUP
@@ -237,17 +237,17 @@ AT_SETUP([Per-type %printer and %destructor redeclared])
 
 AT_DATA([[input.y]],
 [[%destructor { destroy ($$); } <field1> <field2>
-%printer { destroy ($$); } <field1> <field2>
+%printer { print ($$); } <field1> <field2>
 
 %destructor { destroy ($$); } <field1> <field1>
-%printer { destroy ($$); } <field2> <field2>
+%printer { print ($$); } <field2> <field2>
 
 %%
 
 start: ;
 
 %destructor { destroy ($$); } <field2> <field1>;
-%printer { destroy ($$); } <field2> <field1>;
+%printer { print ($$); } <field2> <field1>;
 ]])
 
 AT_BISON_CHECK([input.y], [1], [],
@@ -255,18 +255,18 @@ AT_BISON_CHECK([input.y], [1], [],
 input.y:1.13-29: previous declaration
 input.y:4.13-29: %destructor redeclaration for <field1>
 input.y:4.13-29: previous declaration
-input.y:5.10-26: %printer redeclaration for <field2>
-input.y:2.10-26: previous declaration
-input.y:5.10-26: %printer redeclaration for <field2>
-input.y:5.10-26: previous declaration
+input.y:5.10-24: %printer redeclaration for <field2>
+input.y:2.10-24: previous declaration
+input.y:5.10-24: %printer redeclaration for <field2>
+input.y:5.10-24: previous declaration
 input.y:11.13-29: %destructor redeclaration for <field1>
 input.y:4.13-29: previous declaration
 input.y:11.13-29: %destructor redeclaration for <field2>
 input.y:1.13-29: previous declaration
-input.y:12.10-26: %printer redeclaration for <field1>
-input.y:2.10-26: previous declaration
-input.y:12.10-26: %printer redeclaration for <field2>
-input.y:5.10-26: previous declaration
+input.y:12.10-24: %printer redeclaration for <field1>
+input.y:2.10-24: previous declaration
+input.y:12.10-24: %printer redeclaration for <field2>
+input.y:5.10-24: previous declaration
 ]])
 
 AT_CLEANUP
@@ -386,7 +386,7 @@ AT_CLEANUP
 
 AT_SETUP([Torturing the Scanner])
 
-
+AT_BISON_OPTION_PUSHDEFS
 AT_DATA([input.y], [])
 AT_BISON_CHECK([input.y], [1], [],
 [[input.y:1.1: syntax error, unexpected end of file
@@ -463,8 +463,8 @@ char quote[] = "@:>@@:>@,";
 %}
 
 %{
-static void yyerror (const char *s);
-static int yylex (void);
+]AT_YYERROR_DECLARE[
+]AT_YYLEX_DECLARE[
 %}
 
 %type <ival> '@<:@'
@@ -496,7 +496,7 @@ value_as_yystype (value val)
   res.ival = val;
   return res;
 }
-
+]AT_YYERROR_DEFINE[
 static int
 yylex (void)
 {
@@ -509,12 +509,6 @@ yylex (void)
   yylval = value_as_yystype (input[toknum]);
   return input[toknum++];
 }
-
-static void
-yyerror (const char *msg)
-{
-  fprintf (stderr, "%s\n", msg);
-}
 ]])
 
 # Pacify Emacs'font-lock-mode: "
@@ -531,6 +525,7 @@ main (void)
   return yyparse ();
 }
 ]])
+AT_BISON_OPTION_POPDEFS
 
 AT_BISON_CHECK([-d -v -o input.c input.y])
 AT_COMPILE([input.o], [-c input.c])
@@ -616,14 +611,15 @@ AT_CLEANUP
 
 AT_SETUP([Symbols])
 
+AT_BISON_OPTION_PUSHDEFS
 AT_DATA_GRAMMAR([input.y],
 [[%token WITH-DASH
 %token WITHOUT_DASH "WITHOUT-DASH"
 %token WITH.PERIOD
 %token WITHOUT_PERIOD "WITHOUT.PERIOD"
 %code {
-  void yyerror (char const *);
-  int yylex (void);
+  ]AT_YYERROR_DECLARE[
+  ]AT_YYLEX_DECLARE[
 }
 %%
 start: with-dash without_dash with.period without_period;
@@ -632,7 +628,10 @@ without_dash: "WITHOUT-DASH";
 with.period: WITH.PERIOD;
 without_period: "WITHOUT.PERIOD";
 %%
+]AT_YYERROR_DEFINE[
+]AT_YYLEX_DEFINE[
 ]])
+AT_BISON_OPTION_POPDEFS
 
 # POSIX Yacc accept periods, but not dashes.
 AT_BISON_CHECK([--yacc input.y], [1], [],