diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2011-12-08 21:20:11 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2011-12-08 21:20:11 +0200 |
commit | c5da922b0486462028584e4568d6e00d1a4f2783 (patch) | |
tree | de1d17b273449e5aa03dcbf79d53edbc0bc3b157 /command.c | |
parent | 69239a8fd65ad7f55cc2d567c933a800d5d10fac (diff) | |
parent | d586094c7c4a9a412a7633a32d2b92a8e1cfea1c (diff) | |
download | egawk-c5da922b0486462028584e4568d6e00d1a4f2783.tar.gz egawk-c5da922b0486462028584e4568d6e00d1a4f2783.tar.bz2 egawk-c5da922b0486462028584e4568d6e00d1a4f2783.zip |
Merge branch 'gawk-4.0-stable'
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 595 |
1 files changed, 273 insertions, 322 deletions
@@ -1,8 +1,10 @@ -/* A Bison parser, made by GNU Bison 2.5. */ -/* Bison implementation for Yacc-like parsers in C +/* A Bison parser, made by GNU Bison 2.4.1. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 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 @@ -44,7 +46,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.5" +#define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -73,7 +75,7 @@ /* Copy the first part of user declarations. */ -/* Line 268 of yacc.c */ +/* Line 189 of yacc.c */ #line 26 "command.y" #include "awk.h" @@ -142,8 +144,8 @@ static int find_argument(CMDARG *arg); #define YYSTYPE CMDARG * -/* Line 268 of yacc.c */ -#line 147 "command.c" +/* Line 189 of yacc.c */ +#line 149 "command.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -280,8 +282,8 @@ typedef int YYSTYPE; /* Copy the second part of user declarations. */ -/* Line 343 of yacc.c */ -#line 285 "command.c" +/* Line 264 of yacc.c */ +#line 287 "command.c" #ifdef short # undef short @@ -331,7 +333,7 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS +# if YYENABLE_NLS # if ENABLE_NLS # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -383,11 +385,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # endif @@ -410,24 +412,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ +# if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 +# ifndef _STDLIB_H +# define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -454,7 +456,23 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -# define YYCOPY_NEEDED 1 +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -474,26 +492,6 @@ union yyalloc #endif -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ @@ -724,8 +722,8 @@ static const yytype_uint8 yyr2[] = 1, 1, 2, 1, 2, 2, 1 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { @@ -804,7 +802,8 @@ static const yytype_int16 yypgoto[] = /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -148 static const yytype_int16 yytable[] = { @@ -831,12 +830,6 @@ static const yytype_int16 yytable[] = 0, 0, 0, 45 }; -#define yypact_value_is_default(yystate) \ - ((yystate) == (-151)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - static const yytype_int16 yycheck[] = { 3, 6, 17, 17, 81, 1, 83, 1, 85, 86, @@ -901,18 +894,9 @@ static const yytype_uint8 yystos[] = /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ + Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) @@ -922,6 +906,7 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -963,10 +948,19 @@ while (YYID (0)) #endif -/* This macro is provided for backward compatibility. */ +/* 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 -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# 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 @@ -1154,6 +1148,7 @@ int yydebug; # define YYMAXDEPTH 10000 #endif + #if YYERROR_VERBOSE @@ -1254,142 +1249,115 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = 0; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } + int yyn = yypact[yystate]; - switch (yycount) + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { 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; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + 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; + } - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } + if (yysize_overflow) + return YYSIZE_MAXIMUM; - /* 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 = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; + if (yyresult) + { + /* 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 = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } } #endif /* YYERROR_VERBOSE */ + /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1421,7 +1389,6 @@ yydestruct (yymsg, yytype, yyvaluep) } } - /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus @@ -1448,9 +1415,10 @@ YYSTYPE yylval; int yynerrs; -/*----------. -| yyparse. | -`----------*/ + +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) @@ -1472,6 +1440,8 @@ yyparse () #endif #endif { + + int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; @@ -1626,7 +1596,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) + if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -1657,8 +1627,8 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yytable_value_is_error (yyn)) - goto yyerrlab; + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -1713,7 +1683,7 @@ yyreduce: { case 3: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 109 "command.y" { cmd_idx = -1; @@ -1733,7 +1703,7 @@ yyreduce: case 5: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 128 "command.y" { if (errcount == 0 && cmd_idx >= 0) { @@ -1788,7 +1758,7 @@ yyreduce: case 6: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 178 "command.y" { yyerrok; @@ -1797,14 +1767,14 @@ yyreduce: case 22: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 212 "command.y" { want_nodeval = TRUE; } break; case 23: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 217 "command.y" { if (errcount == 0) { @@ -1824,7 +1794,7 @@ yyreduce: case 24: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 235 "command.y" { (yyval) = append_statement(arg_list, (char *) start_EVAL); @@ -1837,14 +1807,14 @@ yyreduce: case 25: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 242 "command.y" { (yyval) = append_statement((yyvsp[(1) - (2)]), lexptr_begin); } break; case 26: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 243 "command.y" { (yyval) = (yyvsp[(3) - (4)]); @@ -1853,7 +1823,7 @@ yyreduce: case 27: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 250 "command.y" { arg_list = append_statement((yyvsp[(2) - (3)]), (char *) end_EVAL); @@ -1874,7 +1844,7 @@ yyreduce: case 28: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 266 "command.y" { NODE *n; @@ -1890,7 +1860,7 @@ yyreduce: case 34: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 285 "command.y" { if (cmdtab[cmd_idx].class == D_FRAME @@ -1901,7 +1871,7 @@ yyreduce: case 35: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 291 "command.y" { int idx = find_argument((yyvsp[(2) - (2)])); @@ -1918,49 +1888,49 @@ yyreduce: case 38: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 304 "command.y" { want_nodeval = TRUE; } break; case 40: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 305 "command.y" { want_nodeval = TRUE; } break; case 46: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 310 "command.y" { want_nodeval = TRUE; } break; case 49: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 312 "command.y" { want_nodeval = TRUE; } break; case 51: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 313 "command.y" { want_nodeval = TRUE; } break; case 53: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 314 "command.y" { want_nodeval = TRUE; } break; case 57: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 318 "command.y" { if (in_cmd_src((yyvsp[(2) - (2)])->a_string)) @@ -1970,7 +1940,7 @@ yyreduce: case 58: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 323 "command.y" { if (! input_from_tty) @@ -1980,7 +1950,7 @@ yyreduce: case 59: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 328 "command.y" { int type = 0; @@ -2011,7 +1981,7 @@ yyreduce: case 60: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 354 "command.y" { if (! in_commands) @@ -2026,7 +1996,7 @@ yyreduce: case 61: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 364 "command.y" { if (! in_commands) @@ -2036,7 +2006,7 @@ yyreduce: case 62: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 369 "command.y" { int idx = find_argument((yyvsp[(2) - (2)])); @@ -2053,14 +2023,14 @@ yyreduce: case 63: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 380 "command.y" { want_nodeval = TRUE; } break; case 64: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 381 "command.y" { int type; @@ -2073,7 +2043,7 @@ yyreduce: case 65: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 389 "command.y" { if (in_commands) { @@ -2089,7 +2059,7 @@ yyreduce: case 66: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 403 "command.y" { if ((yyvsp[(1) - (1)]) != NULL) { @@ -2104,42 +2074,42 @@ yyreduce: case 68: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 417 "command.y" { (yyval) = NULL; } break; case 69: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 422 "command.y" { (yyval) = NULL; } break; case 74: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 431 "command.y" { (yyval) = NULL; } break; case 75: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 436 "command.y" { (yyval) = NULL; } break; case 77: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 439 "command.y" { (yyval) = NULL; } break; case 78: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 444 "command.y" { NODE *n; @@ -2151,14 +2121,14 @@ yyreduce: case 79: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 454 "command.y" { (yyval) = NULL; } break; case 80: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 456 "command.y" { if (find_option((yyvsp[(1) - (1)])->a_string) < 0) @@ -2168,7 +2138,7 @@ yyreduce: case 81: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 461 "command.y" { if (find_option((yyvsp[(1) - (3)])->a_string) < 0) @@ -2178,7 +2148,7 @@ yyreduce: case 82: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 469 "command.y" { NODE *n; @@ -2196,56 +2166,56 @@ yyreduce: case 83: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 485 "command.y" { (yyval) = NULL; } break; case 88: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 494 "command.y" { (yyval) = NULL; } break; case 89: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 495 "command.y" { want_nodeval = TRUE; } break; case 92: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 497 "command.y" { want_nodeval = TRUE; } break; case 95: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 503 "command.y" { (yyval) = NULL; } break; case 97: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 509 "command.y" { (yyval) = NULL; } break; case 99: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 515 "command.y" { (yyval) = NULL; } break; case 104: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 527 "command.y" { int idx = find_argument((yyvsp[(1) - (2)])); @@ -2262,7 +2232,7 @@ yyreduce: case 106: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 543 "command.y" { (yyvsp[(2) - (2)])->type = D_array; /* dump all items */ @@ -2272,7 +2242,7 @@ yyreduce: case 107: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 548 "command.y" { (yyvsp[(2) - (3)])->type = D_array; @@ -2282,21 +2252,21 @@ yyreduce: case 117: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 574 "command.y" { (yyval) = NULL; } break; case 118: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 576 "command.y" { (yyval) = NULL; } break; case 119: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 578 "command.y" { CMDARG *a; @@ -2308,7 +2278,7 @@ yyreduce: case 126: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 594 "command.y" { if ((yyvsp[(1) - (3)])->a_int > (yyvsp[(3) - (3)])->a_int) @@ -2322,28 +2292,28 @@ yyreduce: case 127: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 606 "command.y" { (yyval) = NULL; } break; case 134: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 620 "command.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 135: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 622 "command.y" { (yyval) = (yyvsp[(1) - (3)]); } break; case 137: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 628 "command.y" { CMDARG *a; @@ -2363,21 +2333,21 @@ yyreduce: case 139: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 647 "command.y" { (yyval) = (yyvsp[(1) - (1)]); num_dim = 1; } break; case 140: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 649 "command.y" { (yyval) = (yyvsp[(1) - (2)]); num_dim++; } break; case 142: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 655 "command.y" { NODE *n = (yyvsp[(2) - (2)])->a_node; @@ -2391,7 +2361,7 @@ yyreduce: case 143: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 664 "command.y" { /* a_string is array name, a_count is dimension count */ @@ -2403,14 +2373,14 @@ yyreduce: case 144: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 674 "command.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 145: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 676 "command.y" { NODE *n = (yyvsp[(2) - (2)])->a_node; @@ -2422,7 +2392,7 @@ yyreduce: case 146: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 683 "command.y" { NODE *n = (yyvsp[(2) - (2)])->a_node; @@ -2436,35 +2406,35 @@ yyreduce: case 147: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 695 "command.y" { (yyval) = NULL; } break; case 148: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 697 "command.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 149: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 702 "command.y" { (yyval) = NULL; } break; case 150: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 704 "command.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 151: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 709 "command.y" { if ((yyvsp[(1) - (1)])->a_int == 0) @@ -2475,7 +2445,7 @@ yyreduce: case 152: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 715 "command.y" { if ((yyvsp[(2) - (2)])->a_int == 0) @@ -2486,21 +2456,21 @@ yyreduce: case 153: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 724 "command.y" { (yyval) = (yyvsp[(1) - (1)]); } break; case 154: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 726 "command.y" { (yyval) = (yyvsp[(2) - (2)]); } break; case 155: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 728 "command.y" { (yyvsp[(2) - (2)])->a_int = - (yyvsp[(2) - (2)])->a_int; @@ -2510,7 +2480,7 @@ yyreduce: case 156: -/* Line 1821 of yacc.c */ +/* Line 1455 of yacc.c */ #line 736 "command.y" { if (lexptr_begin != NULL) { @@ -2524,21 +2494,10 @@ yyreduce: -/* Line 1821 of yacc.c */ -#line 2541 "command.c" +/* Line 1455 of yacc.c */ +#line 2511 "command.c" default: break; } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -2566,10 +2525,6 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -2577,36 +2532,37 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } } -# undef YYSYNTAX_ERROR #endif } @@ -2665,7 +2621,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) + if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -2724,13 +2680,8 @@ yyexhaustedlab: yyreturn: if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -2755,7 +2706,7 @@ yyreturn: -/* Line 2067 of yacc.c */ +/* Line 1675 of yacc.c */ #line 746 "command.y" |