summaryrefslogtreecommitdiff
path: root/main/ast_expr2.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2012-07-11 17:16:50 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2012-07-11 17:16:50 +0000
commit6190ae4430f2bdfb02d2ce8f4941cd9b4e65f5a0 (patch)
tree581ac2624864df26c17d22d85e057b449aacafca /main/ast_expr2.c
parent92a65de048e39a2151f9470edb0968768afb1063 (diff)
Allow the REALTIME() function to report errors back to the caller.
Also, do more error checking on the arguments specified to the REALTIME() function and clarify the documentation. While I was editing the file, a few coding guidelines fixups, as well. Review: https://reviewboard.asterisk.org/r/2031/ ........ Merged revisions 369937 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369938 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/ast_expr2.c')
-rw-r--r--main/ast_expr2.c706
1 files changed, 324 insertions, 382 deletions
diff --git a/main/ast_expr2.c b/main/ast_expr2.c
index 0de96d0d0..798e3d3ce 100644
--- a/main/ast_expr2.c
+++ b/main/ast_expr2.c
@@ -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 1 "ast_expr2.y"
/* Written by Pace Willisson (pace@blitz.com)
@@ -412,8 +414,8 @@ int ast_yyerror(const char *,YYLTYPE *, struct parse_io *);
#define DESTROY(x) {if((x)->type == AST_EXPR_numeric_string || (x)->type == AST_EXPR_string) free((x)->u.s); (x)->u.s = 0; free(x);}
-/* Line 268 of yacc.c */
-#line 417 "ast_expr2.c"
+/* Line 189 of yacc.c */
+#line 419 "ast_expr2.c"
/* Enabling traces. */
#ifndef YYDEBUG
@@ -472,7 +474,7 @@ int ast_yyerror(const char *,YYLTYPE *, struct parse_io *);
typedef union YYSTYPE
{
-/* Line 293 of yacc.c */
+/* Line 214 of yacc.c */
#line 345 "ast_expr2.y"
struct val *val;
@@ -480,8 +482,8 @@ typedef union YYSTYPE
-/* Line 293 of yacc.c */
-#line 485 "ast_expr2.c"
+/* Line 214 of yacc.c */
+#line 487 "ast_expr2.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -504,14 +506,14 @@ typedef struct YYLTYPE
/* Copy the second part of user declarations. */
-/* Line 343 of yacc.c */
+/* Line 264 of yacc.c */
#line 350 "ast_expr2.y"
extern int ast_yylex __P((YYSTYPE *, YYLTYPE *, yyscan_t));
-/* Line 343 of yacc.c */
-#line 515 "ast_expr2.c"
+/* Line 264 of yacc.c */
+#line 517 "ast_expr2.c"
#ifdef short
# undef short
@@ -561,7 +563,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)
@@ -614,11 +616,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
@@ -641,24 +643,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
@@ -689,7 +691,23 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ 2 * 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
@@ -709,26 +727,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 11
/* YYLAST -- Last index in YYTABLE. */
@@ -859,8 +857,8 @@ static const yytype_uint8 yyr2[] =
2, 2, 3, 3, 3, 3, 3, 5, 3
};
-/* 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[] =
{
@@ -899,7 +897,8 @@ static const yytype_int8 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 -1
static const yytype_uint8 yytable[] =
{
@@ -921,12 +920,6 @@ static const yytype_uint8 yytable[] =
26, 27, 28, 23, 24, 25, 0, 26, 27, 28
};
-#define yypact_value_is_default(yystate) \
- ((yystate) == (-18))
-
-#define yytable_value_is_error(yytable_value) \
- YYID (0)
-
static const yytype_int8 yycheck[] =
{
1, 2, 3, 20, 21, 22, 0, 3, 23, 10,
@@ -971,18 +964,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)
@@ -992,6 +976,7 @@ do \
{ \
yychar = (Token); \
yylval = (Value); \
+ yytoken = YYTRANSLATE (yychar); \
YYPOPSTACK (1); \
goto yybackup; \
} \
@@ -1038,7 +1023,7 @@ while (YYID (0))
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+# if YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
@@ -1243,6 +1228,7 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
+
#if YYERROR_VERBOSE
@@ -1345,142 +1331,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.
+/* 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)
+{
+ int yyn = yypact[yystate];
- 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)
-{
- 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)
+ if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+ return 0;
+ else
{
- 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 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;
+ }
- switch (yycount)
- {
-# 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_
- }
+ yyf = YY_(yyformat);
+ yysize1 = yysize + yystrlen (yyf);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
- yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
- return 2;
- yysize = yysize1;
+ if (yysize_overflow)
+ return YYSIZE_MAXIMUM;
- 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 (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;
}
-
- /* 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;
}
#endif /* YYERROR_VERBOSE */
+
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
@@ -1511,210 +1470,210 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp)
{
case 4: /* "TOK_COLONCOLON" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1520 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1479 "ast_expr2.c"
break;
case 5: /* "TOK_COND" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1529 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1488 "ast_expr2.c"
break;
case 6: /* "TOK_OR" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1538 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1497 "ast_expr2.c"
break;
case 7: /* "TOK_AND" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1547 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1506 "ast_expr2.c"
break;
case 8: /* "TOK_NE" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1556 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1515 "ast_expr2.c"
break;
case 9: /* "TOK_LE" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1565 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1524 "ast_expr2.c"
break;
case 10: /* "TOK_GE" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1574 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1533 "ast_expr2.c"
break;
case 11: /* "TOK_LT" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1583 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1542 "ast_expr2.c"
break;
case 12: /* "TOK_GT" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1592 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1551 "ast_expr2.c"
break;
case 13: /* "TOK_EQ" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1601 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1560 "ast_expr2.c"
break;
case 14: /* "TOK_MINUS" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1610 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1569 "ast_expr2.c"
break;
case 15: /* "TOK_PLUS" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1619 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1578 "ast_expr2.c"
break;
case 16: /* "TOK_MOD" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1628 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1587 "ast_expr2.c"
break;
case 17: /* "TOK_DIV" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1637 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1596 "ast_expr2.c"
break;
case 18: /* "TOK_MULT" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1646 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1605 "ast_expr2.c"
break;
case 19: /* "TOK_COMPL" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1655 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1614 "ast_expr2.c"
break;
case 20: /* "TOK_TILDETILDE" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1664 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1623 "ast_expr2.c"
break;
case 21: /* "TOK_EQTILDE" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1673 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1632 "ast_expr2.c"
break;
case 22: /* "TOK_COLON" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1682 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1641 "ast_expr2.c"
break;
case 23: /* "TOK_LP" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1691 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1650 "ast_expr2.c"
break;
case 24: /* "TOK_RP" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1700 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1659 "ast_expr2.c"
break;
case 25: /* "TOKEN" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1709 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1668 "ast_expr2.c"
break;
case 29: /* "expr" */
-/* Line 1391 of yacc.c */
+/* Line 1000 of yacc.c */
#line 368 "ast_expr2.y"
{ free_value((yyvaluep->val)); };
-/* Line 1391 of yacc.c */
-#line 1718 "ast_expr2.c"
+/* Line 1000 of yacc.c */
+#line 1677 "ast_expr2.c"
break;
default:
@@ -1722,7 +1681,6 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp)
}
}
-
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
@@ -1739,9 +1697,12 @@ int yyparse ();
#endif /* ! YYPARSE_PARAM */
-/*----------.
-| yyparse. |
-`----------*/
+
+
+
+/*-------------------------.
+| yyparse or yypush_parse. |
+`-------------------------*/
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1805,7 +1766,7 @@ YYLTYPE yylloc;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
- YYLTYPE yyerror_range[3];
+ YYLTYPE yyerror_range[2];
YYSIZE_T yystacksize;
@@ -1852,7 +1813,7 @@ YYLTYPE yylloc;
yyvsp = yyvs;
yylsp = yyls;
-#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+#if YYLTYPE_IS_TRIVIAL
/* Initialize the default location before parsing starts. */
yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = 1;
@@ -1954,7 +1915,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. */
@@ -1985,8 +1946,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;
}
@@ -2042,7 +2003,7 @@ yyreduce:
{
case 2:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 374 "ast_expr2.y"
{ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
((struct parse_io *)parseio)->val->type = (yyvsp[(1) - (1)].val)->type;
@@ -2051,287 +2012,276 @@ yyreduce:
else
((struct parse_io *)parseio)->val->u.s = (yyvsp[(1) - (1)].val)->u.s;
free((yyvsp[(1) - (1)].val));
- }
+ ;}
break;
case 3:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 382 "ast_expr2.y"
{/* nothing */ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
((struct parse_io *)parseio)->val->type = AST_EXPR_string;
((struct parse_io *)parseio)->val->u.s = strdup("");
- }
+ ;}
break;
case 4:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 389 "ast_expr2.y"
- { (yyval.arglist) = alloc_expr_node(AST_EXPR_NODE_VAL); (yyval.arglist)->val = (yyvsp[(1) - (1)].val);}
+ { (yyval.arglist) = alloc_expr_node(AST_EXPR_NODE_VAL); (yyval.arglist)->val = (yyvsp[(1) - (1)].val);;}
break;
case 5:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 390 "ast_expr2.y"
{struct expr_node *x = alloc_expr_node(AST_EXPR_NODE_VAL);
struct expr_node *t;
DESTROY((yyvsp[(2) - (3)].val));
for (t=(yyvsp[(1) - (3)].arglist);t->right;t=t->right)
;
- (yyval.arglist) = (yyvsp[(1) - (3)].arglist); t->right = x; x->val = (yyvsp[(3) - (3)].val);}
+ (yyval.arglist) = (yyvsp[(1) - (3)].arglist); t->right = x; x->val = (yyvsp[(3) - (3)].val);;}
break;
case 6:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 396 "ast_expr2.y"
{struct expr_node *x = alloc_expr_node(AST_EXPR_NODE_VAL);
struct expr_node *t; /* NULL args should OK */
DESTROY((yyvsp[(2) - (2)].val));
for (t=(yyvsp[(1) - (2)].arglist);t->right;t=t->right)
;
- (yyval.arglist) = (yyvsp[(1) - (2)].arglist); t->right = x; x->val = make_str("");}
+ (yyval.arglist) = (yyvsp[(1) - (2)].arglist); t->right = x; x->val = make_str("");;}
break;
case 7:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 405 "ast_expr2.y"
{ (yyval.val) = op_func((yyvsp[(1) - (4)].val),(yyvsp[(3) - (4)].arglist), ((struct parse_io *)parseio)->chan);
DESTROY((yyvsp[(2) - (4)].val));
DESTROY((yyvsp[(4) - (4)].val));
DESTROY((yyvsp[(1) - (4)].val));
destroy_arglist((yyvsp[(3) - (4)].arglist));
- }
+ ;}
break;
case 8:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 411 "ast_expr2.y"
- {(yyval.val) = (yyvsp[(1) - (1)].val);}
+ {(yyval.val) = (yyvsp[(1) - (1)].val);;}
break;
case 9:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 412 "ast_expr2.y"
{ (yyval.val) = (yyvsp[(2) - (3)].val);
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;
- DESTROY((yyvsp[(1) - (3)].val)); DESTROY((yyvsp[(3) - (3)].val)); }
+ DESTROY((yyvsp[(1) - (3)].val)); DESTROY((yyvsp[(3) - (3)].val)); ;}
break;
case 10:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 416 "ast_expr2.y"
{ (yyval.val) = op_or ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 11:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 420 "ast_expr2.y"
{ (yyval.val) = op_and ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 12:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 424 "ast_expr2.y"
{ (yyval.val) = op_eq ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 13:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 428 "ast_expr2.y"
{ (yyval.val) = op_gt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 14:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 432 "ast_expr2.y"
{ (yyval.val) = op_lt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 15:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 436 "ast_expr2.y"
{ (yyval.val) = op_ge ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 16:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 440 "ast_expr2.y"
{ (yyval.val) = op_le ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 17:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 444 "ast_expr2.y"
{ (yyval.val) = op_ne ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 18:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 448 "ast_expr2.y"
{ (yyval.val) = op_plus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 19:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 452 "ast_expr2.y"
{ (yyval.val) = op_minus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 20:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 456 "ast_expr2.y"
{ (yyval.val) = op_negate ((yyvsp[(2) - (2)].val));
DESTROY((yyvsp[(1) - (2)].val));
(yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 21:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 460 "ast_expr2.y"
{ (yyval.val) = op_compl ((yyvsp[(2) - (2)].val));
DESTROY((yyvsp[(1) - (2)].val));
(yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 22:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 464 "ast_expr2.y"
{ (yyval.val) = op_times ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 23:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 468 "ast_expr2.y"
{ (yyval.val) = op_div ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 24:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 472 "ast_expr2.y"
{ (yyval.val) = op_rem ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 25:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 476 "ast_expr2.y"
{ (yyval.val) = op_colon ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 26:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 480 "ast_expr2.y"
{ (yyval.val) = op_eqtilde ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 27:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 484 "ast_expr2.y"
{ (yyval.val) = op_cond ((yyvsp[(1) - (5)].val), (yyvsp[(3) - (5)].val), (yyvsp[(5) - (5)].val));
DESTROY((yyvsp[(2) - (5)].val));
DESTROY((yyvsp[(4) - (5)].val));
(yyloc).first_column = (yylsp[(1) - (5)]).first_column; (yyloc).last_column = (yylsp[(3) - (5)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 28:
-/* Line 1806 of yacc.c */
+/* Line 1455 of yacc.c */
#line 489 "ast_expr2.y"
{ (yyval.val) = op_tildetilde ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
DESTROY((yyvsp[(2) - (3)].val));
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;}
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
-/* Line 1806 of yacc.c */
-#line 2322 "ast_expr2.c"
+/* Line 1455 of yacc.c */
+#line 2283 "ast_expr2.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);
@@ -2360,10 +2310,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)
{
@@ -2371,40 +2317,41 @@ 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
}
- yyerror_range[1] = yylloc;
+ yyerror_range[0] = yylloc;
if (yyerrstatus == 3)
{
@@ -2441,7 +2388,7 @@ yyerrorlab:
if (/*CONSTCOND*/ 0)
goto yyerrorlab;
- yyerror_range[1] = yylsp[1-yylen];
+ yyerror_range[0] = yylsp[1-yylen];
/* Do not reclaim the symbols of the rule which action triggered
this YYERROR. */
YYPOPSTACK (yylen);
@@ -2460,7 +2407,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)
@@ -2475,7 +2422,7 @@ yyerrlab1:
if (yyssp == yyss)
YYABORT;
- yyerror_range[1] = *yylsp;
+ yyerror_range[0] = *yylsp;
yydestruct ("Error: popping",
yystos[yystate], yyvsp, yylsp);
YYPOPSTACK (1);
@@ -2485,10 +2432,10 @@ yyerrlab1:
*++yyvsp = yylval;
- yyerror_range[2] = yylloc;
+ yyerror_range[1] = yylloc;
/* Using YYLLOC is tempting, but would change the location of
the lookahead. YYLOC is available though. */
- YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
+ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
*++yylsp = yyloc;
/* Shift the error token. */
@@ -2524,13 +2471,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, &yylloc);
- }
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval, &yylloc);
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
@@ -2555,7 +2497,7 @@ yyreturn:
-/* Line 2067 of yacc.c */
+/* Line 1675 of yacc.c */
#line 495 "ast_expr2.y"