diff --git a/moo/mooterm/Makefile.incl b/moo/mooterm/Makefile.incl index 57143aca..963f5adc 100644 --- a/moo/mooterm/Makefile.incl +++ b/moo/mooterm/Makefile.incl @@ -65,14 +65,12 @@ mooterm_extra_dist = \ $(mooterm)/termhelper_res.rc.in mooterm_built_sources = \ - $(mooterm)/mootermprefs-glade.h \ - $(mooterm)/mootermparser-yacc.c \ - $(mooterm)/mootermparser-yacc.h + $(mooterm)/mootermprefs-glade.h -# XXX this should be removed too -$(mooterm_srcdir)/mootermparser-yacc.c: $(mooterm)/mootermparser-yacc.y - mkdir -p $(mooterm) +# not using rule for auto-regenerating mootermparser-yacc.[ch] +mootermparser_yacc: $(mooterm)/mootermparser-yacc.y + touch mootermparser_yacc bison -o $(mooterm_srcdir)/mootermparser-yacc.c -d $(mooterm_srcdir)/mootermparser-yacc.y $(mooterm)/mootermprefs-glade.h: $(mooterm)/glade/mootermprefs.glade $(XML2H) diff --git a/moo/mooterm/mootermparser-yacc.c b/moo/mooterm/mootermparser-yacc.c index fb94a0bb..93b49a57 100644 --- a/moo/mooterm/mootermparser-yacc.c +++ b/moo/mooterm/mootermparser-yacc.c @@ -1,7 +1,7 @@ -/* A Bison parser, made by GNU Bison 1.875d. */ +/* A Bison parser, made by GNU Bison 2.1. */ /* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 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 @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. @@ -36,6 +36,9 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.1" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -45,8 +48,7 @@ /* Using locations. */ #define YYLSP_NEEDED 0 -/* If NAME_PREFIX is specified substitute the variables and functions - names. */ +/* Substitute the variable and function names. */ #define yyparse _moo_term_yyparse #define yylex _moo_term_yylex #define yyerror _moo_term_yyerror @@ -59,6 +61,7 @@ + /* Copy the first part of user declarations. */ #line 1 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" @@ -110,6 +113,11 @@ G_STMT_START { \ # define YYERROR_VERBOSE 0 #endif +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -122,30 +130,49 @@ typedef int YYSTYPE; /* Copy the second part of user declarations. */ -/* Line 214 of yacc.c. */ -#line 127 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.c" +/* Line 219 of yacc.c. */ +#line 135 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.c" + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif #if ! defined (yyoverflow) || YYERROR_VERBOSE -# ifndef YYFREE -# define YYFREE free -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# endif - /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# endif -# else -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca +# else +# define YYSTACK_ALLOC alloca +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYINCLUDED_STDLIB_H +# endif # endif # endif # endif @@ -153,13 +180,39 @@ typedef int YYSTYPE; # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ # endif +# else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) +# endif +# ifdef __cplusplus +extern "C" { +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifdef __cplusplus +} +# endif # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ @@ -194,7 +247,7 @@ union yyalloc # define YYCOPY(To, From, Count) \ do \ { \ - register YYSIZE_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ @@ -244,7 +297,7 @@ union yyalloc #define YYUNDEFTOK 2 #define YYMAXUTOK 257 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ @@ -439,8 +492,8 @@ static const unsigned short int yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { @@ -803,22 +856,6 @@ static const unsigned char yystos[] = 189, 23, 41, 23, 52, 83 }; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) @@ -848,26 +885,59 @@ do \ goto yybackup; \ } \ else \ - { \ - yyerror (parser, "syntax error: cannot back up");\ + { \ + yyerror (parser, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) + #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - ((Current).first_line = (Rhs)[1].first_line, \ - (Current).first_column = (Rhs)[1].first_column, \ - (Current).last_line = (Rhs)[N].last_line, \ - (Current).last_column = (Rhs)[N].last_column) +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) #endif + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM @@ -890,19 +960,13 @@ do { \ YYFPRINTF Args; \ } while (0) -# define YYDSYMPRINT(Args) \ -do { \ - if (yydebug) \ - yysymprint Args; \ -} while (0) - -# define YYDSYMPRINTF(Title, Token, Value, Location) \ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ + yysymprint (stderr, \ + Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) @@ -949,13 +1013,13 @@ yy_reduce_print (yyrule) #endif { int yyi; - unsigned int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", yyrule - 1, yylno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ @@ -969,8 +1033,7 @@ do { \ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -# define YYDSYMPRINTF(Title, Token, Value, Location) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -985,13 +1048,9 @@ int yydebug; if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif @@ -1013,7 +1072,7 @@ yystrlen (yystr) const char *yystr; # endif { - register const char *yys = yystr; + const char *yys = yystr; while (*yys++ != '\0') continue; @@ -1038,8 +1097,8 @@ yystpcpy (yydest, yysrc) const char *yysrc; # endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -1049,7 +1108,55 @@ yystpcpy (yydest, yysrc) # endif # endif -#endif /* !YYERROR_VERBOSE */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + size_t yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +#endif /* YYERROR_VERBOSE */ @@ -1073,15 +1180,15 @@ yysymprint (yyoutput, yytype, yyvaluep) (void) yyvaluep; if (yytype < YYNTOKENS) - { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - } + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif switch (yytype) { default: @@ -1097,10 +1204,11 @@ yysymprint (yyoutput, yytype, yyvaluep) #if defined (__STDC__) || defined (__cplusplus) static void -yydestruct (int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void -yydestruct (yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif @@ -1108,6 +1216,10 @@ yydestruct (yytype, yyvaluep) /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + switch (yytype) { @@ -1135,10 +1247,10 @@ int yyparse (); -/* The lookahead symbol. */ +/* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ @@ -1169,12 +1281,12 @@ yyparse (parser) #endif { - register int yystate; - register int yyn; + int yystate; + int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ + /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; /* Three stacks and their tools: @@ -1188,12 +1300,12 @@ yyparse (parser) /* The state stack. */ short int yyssa[YYINITDEPTH]; short int *yyss = yyssa; - register short int *yyssp; + short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; + YYSTYPE *yyvsp; @@ -1225,7 +1337,6 @@ yyparse (parser) yyssp = yyss; yyvsp = yyvs; - goto yysetstate; /*------------------------------------------------------------. @@ -1258,7 +1369,7 @@ yyparse (parser) data in use in that stack, in bytes. 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", + yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), @@ -1269,11 +1380,11 @@ yyparse (parser) } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; @@ -1283,7 +1394,7 @@ yyparse (parser) union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyoverflowlab; + goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); @@ -1315,18 +1426,18 @@ yyparse (parser) yybackup: /* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ +/* Read a look-ahead token if we need one and don't already have one. */ /* yyresume: */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1341,7 +1452,7 @@ yybackup: else { yytoken = YYTRANSLATE (yychar); - YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to @@ -1361,8 +1472,8 @@ yybackup: if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) @@ -1603,7 +1714,7 @@ yyreduce: case 139: #line 203 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_CUU (DEFLT_1(yyvsp[-1])); ;} + { VT_CUU (DEFLT_1((yyvsp[-1]))); ;} break; case 140: @@ -1613,7 +1724,7 @@ yyreduce: case 141: #line 205 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_CUD (DEFLT_1(yyvsp[-1])); ;} + { VT_CUD (DEFLT_1((yyvsp[-1]))); ;} break; case 142: @@ -1623,7 +1734,7 @@ yyreduce: case 143: #line 207 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_CUF (DEFLT_1(yyvsp[-1])); ;} + { VT_CUF (DEFLT_1((yyvsp[-1]))); ;} break; case 144: @@ -1633,7 +1744,7 @@ yyreduce: case 145: #line 209 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_CUB (DEFLT_1(yyvsp[-1])); ;} + { VT_CUB (DEFLT_1((yyvsp[-1]))); ;} break; case 146: @@ -1643,7 +1754,7 @@ yyreduce: case 147: #line 211 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_CBT (DEFLT_1(yyvsp[-1])); ;} + { VT_CBT (DEFLT_1((yyvsp[-1]))); ;} break; case 148: @@ -1653,7 +1764,7 @@ yyreduce: case 149: #line 213 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_CHA (DEFLT_1(yyvsp[-1])); ;} + { VT_CHA (DEFLT_1((yyvsp[-1]))); ;} break; case 150: @@ -1663,7 +1774,7 @@ yyreduce: case 151: #line 215 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_CHT (DEFLT_1(yyvsp[-1])); ;} + { VT_CHT (DEFLT_1((yyvsp[-1]))); ;} break; case 152: @@ -1673,7 +1784,7 @@ yyreduce: case 153: #line 217 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_CNL (DEFLT_1(yyvsp[-1])); ;} + { VT_CNL (DEFLT_1((yyvsp[-1]))); ;} break; case 154: @@ -1683,7 +1794,7 @@ yyreduce: case 155: #line 219 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_CPL (DEFLT_1(yyvsp[-1])); ;} + { VT_CPL (DEFLT_1((yyvsp[-1]))); ;} break; case 156: @@ -1693,7 +1804,7 @@ yyreduce: case 157: #line 221 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_HPA (DEFLT_1(yyvsp[-1])); ;} + { VT_HPA (DEFLT_1((yyvsp[-1]))); ;} break; case 158: @@ -1703,7 +1814,7 @@ yyreduce: case 159: #line 223 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_HPR (DEFLT_1(yyvsp[-1])); ;} + { VT_HPR (DEFLT_1((yyvsp[-1]))); ;} break; case 160: @@ -1713,7 +1824,7 @@ yyreduce: case 161: #line 225 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_VPA (DEFLT_1(yyvsp[-1])); ;} + { VT_VPA (DEFLT_1((yyvsp[-1]))); ;} break; case 162: @@ -1723,7 +1834,7 @@ yyreduce: case 163: #line 227 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_VPR (DEFLT_1(yyvsp[-1])); ;} + { VT_VPR (DEFLT_1((yyvsp[-1]))); ;} break; case 164: @@ -1772,7 +1883,7 @@ yyreduce: case 172: #line 243 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_TBC (yyvsp[-1]); ;} + { VT_TBC ((yyvsp[-1])); ;} break; case 173: @@ -1915,7 +2026,7 @@ yyreduce: case 200: #line 285 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_DCH (DEFLT_1(yyvsp[-1])); ;} + { VT_DCH (DEFLT_1((yyvsp[-1]))); ;} break; case 201: @@ -1925,7 +2036,7 @@ yyreduce: case 202: #line 287 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_DL (DEFLT_1(yyvsp[-1])); ;} + { VT_DL (DEFLT_1((yyvsp[-1]))); ;} break; case 203: @@ -1935,7 +2046,7 @@ yyreduce: case 204: #line 289 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_ECH (DEFLT_1(yyvsp[-1])); ;} + { VT_ECH (DEFLT_1((yyvsp[-1]))); ;} break; case 205: @@ -1945,7 +2056,7 @@ yyreduce: case 206: #line 291 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_ED (yyvsp[-1]); ;} + { VT_ED ((yyvsp[-1])); ;} break; case 207: @@ -1955,7 +2066,7 @@ yyreduce: case 208: #line 293 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_EL (yyvsp[-1]); ;} + { VT_EL ((yyvsp[-1])); ;} break; case 209: @@ -1965,7 +2076,7 @@ yyreduce: case 210: #line 295 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_ICH (DEFLT_1(yyvsp[-1])); ;} + { VT_ICH (DEFLT_1((yyvsp[-1]))); ;} break; case 211: @@ -1975,7 +2086,7 @@ yyreduce: case 212: #line 297 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { VT_IL (DEFLT_1(yyvsp[-1])); ;} + { VT_IL (DEFLT_1((yyvsp[-1]))); ;} break; case 213: @@ -2246,62 +2357,62 @@ yyreduce: case 264: #line 390 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { yyval = yyvsp[0]; ;} + { (yyval) = (yyvsp[0]); ;} break; case 265: #line 391 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { yyval = yyvsp[-1] * 10 + yyvsp[0]; ;} + { (yyval) = (yyvsp[-1]) * 10 + (yyvsp[0]); ;} break; case 266: #line 394 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { yyval = 0; ;} + { (yyval) = 0; ;} break; case 267: #line 395 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { yyval = 1; ;} + { (yyval) = 1; ;} break; case 268: #line 396 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { yyval = 2; ;} + { (yyval) = 2; ;} break; case 269: #line 397 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { yyval = 3; ;} + { (yyval) = 3; ;} break; case 270: #line 398 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { yyval = 4; ;} + { (yyval) = 4; ;} break; case 271: #line 399 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { yyval = 5; ;} + { (yyval) = 5; ;} break; case 272: #line 400 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { yyval = 6; ;} + { (yyval) = 6; ;} break; case 273: #line 401 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { yyval = 7; ;} + { (yyval) = 7; ;} break; case 274: #line 402 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { yyval = 8; ;} + { (yyval) = 8; ;} break; case 275: #line 403 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { yyval = 9; ;} + { (yyval) = 9; ;} break; case 277: @@ -2311,24 +2422,25 @@ yyreduce: case 278: #line 410 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { ADD_NUMBER (yyvsp[0]); ;} + { ADD_NUMBER ((yyvsp[0])); ;} break; case 279: #line 411 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { ADD_NUMBER (-1); ADD_NUMBER (yyvsp[0]); ;} + { ADD_NUMBER (-1); ADD_NUMBER ((yyvsp[0])); ;} break; case 280: #line 412 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.y" - { ADD_NUMBER (yyvsp[0]); ;} + { ADD_NUMBER ((yyvsp[0])); ;} break; + default: break; } -/* Line 1010 of yacc.c. */ -#line 2332 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.c" +/* Line 1126 of yacc.c. */ +#line 2444 "/home/muntyan/projects/moo/moo/mooterm/mootermparser-yacc.c" yyvsp -= yylen; yyssp -= yylen; @@ -2367,12 +2479,36 @@ yyerrlab: if (YYPACT_NINF < yyn && yyn < YYLAST) { - YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); - const char* yyprefix; - char *yymsg; + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + char *yymsg = 0; +# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; +#if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +#endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; @@ -2380,81 +2516,91 @@ yyerrlab: /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 0; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); - yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { - yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); - yycount += 1; - if (yycount == 5) + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { - yysize = 0; + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; break; } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; } - yysize += (sizeof ("syntax error, unexpected ") - + yystrlen (yytname[yytype])); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); - if (yycount < 5) + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + + if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yymsg; + int yyi = 0; + while ((*yyp = *yyf)) { - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yyp = yystpcpy (yyp, yyprefix); - yyp = yystpcpy (yyp, yytname[yyx]); - yyprefix = " or "; - } + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } } yyerror (parser, yymsg); YYSTACK_FREE (yymsg); } else - yyerror (parser, "syntax error; also virtual memory exhausted"); + { + yyerror (parser, YY_("syntax error")); + goto yyexhaustedlab; + } } else #endif /* YYERROR_VERBOSE */ - yyerror (parser, "syntax error"); + yyerror (parser, YY_("syntax error")); } if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) { - /* If at end of input, pop the error token, - then the rest of the stack, then return failure. */ + /* Return failure if at end of input. */ if (yychar == YYEOF) - for (;;) - { - YYPOPSTACK; - if (yyssp == yyss) - YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); - } + YYABORT; } else { - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); + yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; - } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -2464,14 +2610,13 @@ yyerrlab: `---------------------------------------------------*/ yyerrorlab: -#ifdef __GNUC__ - /* Pacify GCC when the user code never invokes YYERROR and the label - yyerrorlab therefore never appears in user code. */ + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ if (0) goto yyerrorlab; -#endif - yyvsp -= yylen; +yyvsp -= yylen; yyssp -= yylen; yystate = *yyssp; goto yyerrlab1; @@ -2501,8 +2646,8 @@ yyerrlab1: if (yyssp == yyss) YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[yystate], yyvsp); + + yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -2511,11 +2656,12 @@ yyerrlab1: if (yyn == YYFINAL) YYACCEPT; - YYDPRINTF ((stderr, "Shifting error token, ")); - *++yyvsp = yylval; + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + yystate = yyn; goto yynewstate; @@ -2535,16 +2681,25 @@ yyabortlab: goto yyreturn; #ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror (parser, "parser stack overflow"); +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (parser, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK; + } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); diff --git a/moo/mooterm/mootermparser-yacc.h b/moo/mooterm/mootermparser-yacc.h index 4173ddf1..52303a57 100644 --- a/moo/mooterm/mootermparser-yacc.h +++ b/moo/mooterm/mootermparser-yacc.h @@ -1,7 +1,7 @@ -/* A Bison parser, made by GNU Bison 1.875d. */ +/* A Bison parser, made by GNU Bison 2.1. */ /* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 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 @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. @@ -26,6 +26,7 @@ + #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */