]> git.saurik.com Git - bison.git/blobdiff - src/bison.simple
* tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
[bison.git] / src / bison.simple
index 9b627b1c5fe55cf7d2b259ca556d0ea8b46672e3..455c9d87319eb0f4c343d4672ac0b9b9ca0c230d 100644 (file)
 # define YYSTACK_REALLOC(Type, What, Array)                            \
 do {                                                                   \
   Type *old = What;                                                    \
-  What = (Type *) malloc (yystacksize * sizeof (Type));                        \
+  What = (Type *) alloca (yystacksize * sizeof (Type));                        \
   __yy_memcpy ((char *) What, (char *) old,                            \
               (size) * (unsigned int) sizeof (Type));                  \
-  yyfree_stacks = 1;                                                   \
-  if (old != Array)                                                    \
-    free (old);                                                                \
 } while (0)
 #else
 # define YYSTACK_REALLOC(Type, What, Array)                            \
 do {                                                                   \
   Type *old = What;                                                    \
-  What = (Type *) alloca (yystacksize * sizeof (Type));                        \
+  What = (Type *) malloc (yystacksize * sizeof (Type));                        \
   __yy_memcpy ((char *) What, (char *) old,                            \
               (size) * (unsigned int) sizeof (Type));                  \
+  yyfree_stacks = 1;                                                   \
+  if (old != Array)                                                    \
+    free (old);                                                                \
 } while (0)
 #endif
 
@@ -149,13 +149,6 @@ typedef struct yyltype
 # define YYLTYPE %%ltype
 #endif
 
-#ifndef YYERROR_VERBOSE
-# define YYERROR_VERBOSE %%verbose
-#else
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#endif
-
 /* Tokens.  */
 %%tokendef
 
@@ -197,7 +190,7 @@ static const short yyrline[] =
 };
 #endif
 
-#if YYDEBUG || YYERROR_VERBOSE
+#if %%error_verbose
 /* YYTNME[TOKEN_NUM] -- String name of the token TOKEN_NUM.  */
 static const char *const yytname[] =
 {
@@ -826,7 +819,7 @@ yyerrlab:
     {
       ++yynerrs;
 
-#if YYERROR_VERBOSE
+#if %%error_verbose
       yyn = yypact[yystate];
 
       if (yyn > YYFLAG && yyn < YYLAST)
@@ -869,7 +862,7 @@ yyerrlab:
            yyerror ("parse error; also virtual memory exhausted");
         }
       else
-#endif /* YYERROR_VERBOSE */
+#endif /* %%ERROR_VERBOSE */
         yyerror ("parse error");
     }
   goto yyerrlab1;