# define YYLTYPE %%ltype
#endif
-#ifndef YYERROR_VERBOSE
-# define YYERROR_VERBOSE %%verbose
-#endif
-
/* Tokens. */
%%tokendef
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE
+#if %%error_verbose
/* YYTNME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
static const char *const yytname[] =
{
if (yyssp >= yyss + yystacksize - 1)
{
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into memory.
- */
- YYSTYPE *yyvs1 = yyvs;
- short *yyss1 = yyss;
-#if YYLSP_NEEDED
- YYLTYPE *yyls1 = yyls;
-#endif
-
/* Get the current used size of the three stacks, in elements. */
int size = yyssp - yyss + 1;
#ifdef yyoverflow
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. */
+ {
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. */
# if YYLSP_NEEDED
- /* This used to be a conditional around just the two extra args,
- but that might be undefined if yyoverflow is a macro. */
- yyoverflow ("parser stack overflow",
- &yyss1, size * sizeof (*yyssp),
- &yyvs1, size * sizeof (*yyvsp),
- &yyls1, size * sizeof (*yylsp),
- &yystacksize);
+ YYLTYPE *yyls1 = yyls;
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
+ yyoverflow ("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yyls1, size * sizeof (*yylsp),
+ &yystacksize);
+ yyls = yyls1;
# else
- yyoverflow ("parser stack overflow",
- &yyss1, size * sizeof (*yyssp),
- &yyvs1, size * sizeof (*yyvsp),
- &yystacksize);
-# endif
-
- yyss = yyss1; yyvs = yyvs1;
-# if YYLSP_NEEDED
- yyls = yyls1;
+ yyoverflow ("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yystacksize);
# endif
+ yyss = yyss1;
+ yyvs = yyvs1;
+ }
#else /* no yyoverflow */
/* Extend the stack our own way. */
if (yystacksize >= YYMAXDEPTH)
{
++yynerrs;
-#if YYERROR_VERBOSE
+#if %%error_verbose
yyn = yypact[yystate];
if (yyn > YYFLAG && yyn < YYLAST)
int x, count;
count = 0;
- /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
- for (x = (yyn < 0 ? -yyn : 0);
+ /* Start X at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ for (x = yyn < 0 ? -yyn : 0;
x < (int) (sizeof (yytname) / sizeof (char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen (yytname[x]) + 15, count++;
- size += strlen ("parse error, unexpected `") + 1;
+ size += strlen ("parse error, unexpected ") + 1;
size += strlen (yytname[YYTRANSLATE (yychar)]);
msg = (char *) malloc (size);
if (msg != 0)
{
- strcpy (msg, "parse error, unexpected `");
+ strcpy (msg, "parse error, unexpected ");
strcat (msg, yytname[YYTRANSLATE (yychar)]);
- strcat (msg, "'");
if (count < 5)
{
count = 0;
- for (x = (yyn < 0 ? -yyn : 0);
+ for (x = yyn < 0 ? -yyn : 0;
x < (int) (sizeof (yytname) / sizeof (char *)); x++)
if (yycheck[x + yyn] == x)
{
- strcat (msg, count == 0 ? ", expecting `" : " or `");
+ strcat (msg, count == 0 ? ", expecting " : " or ");
strcat (msg, yytname[x]);
- strcat (msg, "'");
count++;
}
}
free (msg);
}
else
- yyerror ("parse error; also virtual memory exceeded");
+ yyerror ("parse error; also virtual memory exhausted");
}
else
-#endif /* YYERROR_VERBOSE */
+#endif /* %%ERROR_VERBOSE */
yyerror ("parse error");
}
goto yyerrlab1;