/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line
/* Skeleton output parser for bison,
- Copyright 1984, 1989, 1990, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
There are some unavoidable exceptions within include files to
- define necessary C library symbols; they are noted "INFRINGES ON
+ define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
+#ifdef __cplusplus
+# define YYSTD(x) std::x
+#else
+# define YYSTD(x) x
+#endif
+
#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
/* The parser invokes alloca or malloc; define the necessary symbols. */
# if YYSTACK_USE_ALLOCA
# define YYSTACK_ALLOC alloca
-# define YYSIZE_T size_t
# else
# ifndef YYSTACK_USE_ALLOCA
# if defined (alloca) || defined (_ALLOCA_H)
# define YYSTACK_ALLOC alloca
-# define YYSIZE_T size_t
# else
-# if defined (__GNUC__) || defined (_AIX) || defined (__hpux)
+# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
# endif
-# ifndef __GNUC__
-# ifdef _AIX
- # pragma alloca
-# endif
-# if defined (__sgi) || defined (__sparc__) || defined (__sparc) || defined (__sun)
-# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSTACK_ALLOC alloca
-# define YYSIZE_T size_t
-# endif
-# endif
# endif
# endif
# endif
/* Pacify GCC's `empty if-body' warning. */
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# else
-# define YYSTACK_ALLOC malloc
-# define YYSTACK_FREE(Ptr) free (Ptr)
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
+# ifdef __cplusplus
+# include <cstdlib> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T std::size_t
+# else
+# ifdef __STDC__
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
# endif
+# define YYSTACK_ALLOC YYSTD (malloc)
+# define YYSTACK_FREE YYSTD (free)
# endif
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- short yys;
- YYSTYPE yyv;
+ short yyss;
+ YYSTYPE yyvs;
# if YYLSP_NEEDED
- YYLTYPE yyl;
+ YYLTYPE yyls;
# endif
};
+ YYSTACK_GAP_MAX)
# endif
-# if defined (__STDC__) || defined (__cplusplus)
-# define YYPOINTER void *
-# else
-# define YYPOINTER char *
-# endif
-
/* Relocate the TYPE STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the
do \
{ \
YYSIZE_T yynewbytes; \
- yymemcpy (yyptr, (char *) (Stack), \
+ yymemcpy ((char *) yyptr, (char *) (Stack), \
yysize * (YYSIZE_T) sizeof (Type)); \
- (Stack) = (Type *) (YYPOINTER) yyptr; \
+ Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX; \
- yynewbytes -= yynewbytes % sizeof (union yyalloc); \
- yyptr += yynewbytes; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)
#if ! defined (YYSIZE_T) && defined (size_t)
# define YYSIZE_T size_t
#endif
-#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
+#if ! defined (YYSIZE_T)
+# ifdef __cplusplus
+# include <cstddef> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T std::size_t
+# else
+# ifdef __STDC__
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+# endif
#endif
#if ! defined (YYSIZE_T)
# define YYSIZE_T unsigned int
/* Enable debugging if requested. */
#if YYDEBUG
-# include <stdio.h>
+
+# ifndef YYFPRINTF
+# ifdef __cplusplus
+# include <cstdio> /* INFRINGES ON USER NAME SPACE */
+# else
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+# endif
+# define YYFPRINTF YYSTD (fprintf)
+# endif
+
# define YYDPRINTF(Args) \
do { \
if (yydebug) \
- fprintf Args; \
+ YYFPRINTF Args; \
} while (0)
/* Nonzero means print parse trace. [The following comment makes no
sense to me. Could someone clarify it? --akim] Since this is
{
short *yyss1 = yyss;
- char *yyptr = (char *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyoverflowlab;
YYSTACK_RELOCATE (short, yyss);
which are defined only if `YYDEBUG' is set. */
if (yydebug)
{
- fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+ YYFPRINTF (stderr, "Next token is %d (%s",
+ yychar, yytname[yychar1]);
/* Give the individual parser a way to print the precise
meaning of a token, for further debugging info. */
# ifdef YYPRINT
YYPRINT (stderr, yychar, yylval);
# endif
- fprintf (stderr, ")\n");
+ YYFPRINTF (stderr, ")\n");
}
#endif
}
YYACCEPT;
/* Shift the lookahead token. */
- YYDPRINTF ((stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]));
+ YYDPRINTF ((stderr, "Shifting token %d (%s), ",
+ yychar, yytname[yychar1]));
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
{
int yyi;
- fprintf (stderr, "Reducing via rule %d (line %d), ",
- yyn, yyrline[yyn]);
+ YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
/* Print the symbols being reduced, and their result. */
for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
- fprintf (stderr, "%s ", yytname[yyrhs[yyi]]);
- fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
+ YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
%% actions /* The action file replaces this line. */
if (yydebug)
{
short *yyssp1 = yyss - 1;
- fprintf (stderr, "state stack now");
+ YYFPRINTF (stderr, "state stack now");
while (yyssp1 != yyssp)
- fprintf (stderr, " %d", *++yyssp1);
- fprintf (stderr, "\n");
+ YYFPRINTF (stderr, " %d", *++yyssp1);
+ YYFPRINTF (stderr, "\n");
}
#endif
if (yydebug)
{
short *yyssp1 = yyss - 1;
- fprintf (stderr, "Error: state stack now");
+ YYFPRINTF (stderr, "Error: state stack now");
while (yyssp1 != yyssp)
- fprintf (stderr, " %d", *++yyssp1);
- fprintf (stderr, "\n");
+ YYFPRINTF (stderr, " %d", *++yyssp1);
+ YYFPRINTF (stderr, "\n");
}
#endif