]> git.saurik.com Git - bison.git/blobdiff - tests/calc.at
Stop storing rules from 1 to nrules + 1.
[bison.git] / tests / calc.at
index ec19d90375b930549b75e193a2ef85ffef0b46f5..8a8948c37e9ba2858e71f38c84e3c624f91bee75 100644 (file)
@@ -67,30 +67,17 @@ typedef int value_t;
 
 %}
 
-/* Exercise M4 quoting: '@:>@@:>@', 0.  */
-
-/* Also exercise %union. */
+/* Exercise %union. */
 %union
 {
-  value_t ival; /* A comment to exercise an old bug. */
+  value_t ival;
 };
 
-/* Exercise post-prologue dependency to %union.  */
-%{
-static void id (YYSTYPE *lval);
-
-/* Exercise quotes in declarations.  */
-char quote[] = "@:>@@:>@,";
-%}
-
 /* Bison Declarations */
 %token CALC_EOF 0 "end of file"
 %token <ival> NUM "number"
 %type  <ival> exp
 
-/* Exercise quotes in strings.  */
-%token FAKE "fake @>:@@>:@,"
-
 %nonassoc '=' /* comparison           */
 %left '-' '+'
 %left '*' '/'
@@ -107,15 +94,10 @@ input:
 ;
 
 line:
-  '\n'
-| exp '\n'
-  {
-    /* Exercise quotes in braces.  */
-    char tmp[] = "@>:@@:>@,";
-  }
+  '\n'      {}
+| exp '\n'  {}
 ;
 
-/* Exercise M4 quoting: '@:>@@:>@', 1.  */
 exp:
   NUM                { $$ = $1;             }
 | exp '=' exp
@@ -137,7 +119,6 @@ exp:
 /* The input. */
 FILE *yyin;
 
-/* Exercise M4 quoting: '@:>@@:>@', 2.  */
 static void
 yyerror (const char *s)
 {
@@ -259,11 +240,6 @@ power (int base, int exponent)
   return res;
 }
 
-void
-id (YYSTYPE* lval)
-{
-}
-
 int
 main (int argc, const char **argv)
 {
@@ -314,7 +290,7 @@ m4_define([_AT_CHECK_CALC],
 [AT_DATA([[input]],
 [[$2
 ]])
-AT_CHECK([./calc input], 0, [], [stderr])dnl
+AT_PARSER_CHECK([./calc input], 0, [], [stderr])dnl
 AT_CHECK([wc -l <stderr | sed 's/[[^0-9]]//g'], 0,
          [m4_bmatch([$1], [--debug],
                     [$3], [0])
@@ -341,11 +317,11 @@ AT_CHECK([wc -l <stderr | sed 's/[[^0-9]]//g'], 0,
 # of expected lines on stderr.
 m4_define([_AT_CHECK_CALC_ERROR],
 [m4_bmatch([$2], [^/],
-           [AT_CHECK([./calc $2], 0, [], [stderr])],
+           [AT_PARSER_CHECK([./calc $2], 0, [], [stderr])],
            [AT_DATA([[input]],
 [[$2
 ]])
-AT_CHECK([./calc input], 0, [], [stderr])])
+AT_PARSER_CHECK([./calc input], 0, [], [stderr])])
 
 m4_bmatch([$1], [--debug],
 [AT_CHECK([wc -l <stderr | sed 's/[[^0-9]]//g'], 0, [$3
@@ -396,7 +372,7 @@ AT_DATA_CALC_Y([$1])
 AT_CHECK([bison calc.y -o calc.c m4_bpatsubst([$1], [--yyerror-verbose])],
          [0], [], [])
 
-AT_CHECK([$CC $CFLAGS $CPPFLAGS calc.c -o calc], 0, [], [ignore])
+AT_COMPILE([calc])
 
 # Test the priorities.
 _AT_CHECK_CALC([$1],