automerge commit

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@8767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Automerge script
2006-01-27 01:01:17 +00:00
parent 6a02d8a8d9
commit 8ff712f50f
3 changed files with 907 additions and 498 deletions

View File

@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 1.875d. */ /* A Bison parser, made by GNU Bison 2.0. */
/* Skeleton parser for Yacc-like parsing with Bison, /* 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 Free Software Foundation, Inc.
@@ -45,8 +45,7 @@
/* Using locations. */ /* Using locations. */
#define YYLSP_NEEDED 1 #define YYLSP_NEEDED 1
/* If NAME_PREFIX is specified substitute the variables and functions /* Substitute the variable and function names. */
names. */
#define yyparse ast_yyparse #define yyparse ast_yyparse
#define yylex ast_yylex #define yylex ast_yylex
#define yyerror ast_yyerror #define yyerror ast_yyerror
@@ -238,7 +237,12 @@ int ast_yyerror(const char *,YYLTYPE *, struct parse_io *);
some useful info about the error. Not as easy as it looks, but it some useful info about the error. Not as easy as it looks, but it
is possible. */ is possible. */
#define ast_yyerror(x) ast_yyerror(x,&yyloc,parseio) #define ast_yyerror(x) ast_yyerror(x,&yyloc,parseio)
#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); \
}
/* Enabling traces. */ /* Enabling traces. */
@@ -255,12 +259,12 @@ int ast_yyerror(const char *,YYLTYPE *, struct parse_io *);
#endif #endif
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 137 "ast_expr2.y" #line 142 "ast_expr2.y"
typedef union YYSTYPE { typedef union YYSTYPE {
struct val *val; struct val *val;
} YYSTYPE; } YYSTYPE;
/* Line 191 of yacc.c. */ /* Line 190 of yacc.c. */
#line 264 "ast_expr2.c" #line 268 "ast_expr2.c"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1
@@ -281,13 +285,13 @@ typedef struct YYLTYPE
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
#line 141 "ast_expr2.y" #line 146 "ast_expr2.y"
extern int ast_yylex __P((YYSTYPE *, YYLTYPE *, yyscan_t)); extern int ast_yylex __P((YYSTYPE *, YYLTYPE *, yyscan_t));
/* Line 214 of yacc.c. */ /* Line 213 of yacc.c. */
#line 291 "ast_expr2.c" #line 295 "ast_expr2.c"
#if ! defined (yyoverflow) || YYERROR_VERBOSE #if ! defined (yyoverflow) || YYERROR_VERBOSE
@@ -302,14 +306,10 @@ extern int ast_yylex __P((YYSTYPE *, YYLTYPE *, yyscan_t));
# ifdef YYSTACK_USE_ALLOCA # ifdef YYSTACK_USE_ALLOCA
# if 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__ # ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca # define YYSTACK_ALLOC __builtin_alloca
# else
# define YYSTACK_ALLOC alloca
# endif # endif
# endif # endif
# endif # endif
@@ -473,9 +473,9 @@ static const yysigned_char yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const unsigned char yyrline[] = static const unsigned char yyrline[] =
{ {
0, 160, 160, 168, 169, 172, 175, 178, 181, 184, 0, 165, 165, 175, 176, 180, 184, 188, 192, 196,
187, 190, 193, 196, 199, 202, 205, 208, 211, 214, 200, 204, 208, 212, 216, 220, 224, 228, 232, 236,
217, 220, 223 240, 244, 248
}; };
#endif #endif
@@ -660,20 +660,53 @@ do \
} \ } \
while (0) while (0)
#define YYTERROR 1 #define YYTERROR 1
#define YYERRCODE 256 #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 #ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \ # define YYLLOC_DEFAULT(Current, Rhs, N) \
((Current).first_line = (Rhs)[1].first_line, \ do \
(Current).first_column = (Rhs)[1].first_column, \ if (N) \
(Current).last_line = (Rhs)[N].last_line, \ { \
(Current).last_column = (Rhs)[N].last_column) (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 #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. */ /* YYLEX -- calling `yylex' with the right arguments. */
#ifdef YYLEX_PARAM #ifdef YYLEX_PARAM
@@ -696,19 +729,13 @@ do { \
YYFPRINTF Args; \ YYFPRINTF Args; \
} while (0) } while (0)
# define YYDSYMPRINT(Args) \ # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
do { \
if (yydebug) \
yysymprint Args; \
} while (0)
# define YYDSYMPRINTF(Title, Token, Value, Location) \
do { \ do { \
if (yydebug) \ if (yydebug) \
{ \ { \
YYFPRINTF (stderr, "%s ", Title); \ YYFPRINTF (stderr, "%s ", Title); \
yysymprint (stderr, \ yysymprint (stderr, \
Token, Value, Location); \ Type, Value, Location); \
YYFPRINTF (stderr, "\n"); \ YYFPRINTF (stderr, "\n"); \
} \ } \
} while (0) } while (0)
@@ -775,8 +802,7 @@ do { \
int yydebug; int yydebug;
#else /* !YYDEBUG */ #else /* !YYDEBUG */
# define YYDPRINTF(Args) # define YYDPRINTF(Args)
# define YYDSYMPRINT(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YYDSYMPRINTF(Title, Token, Value, Location)
# define YY_STACK_PRINT(Bottom, Top) # define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule) # define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */ #endif /* !YYDEBUG */
@@ -794,10 +820,6 @@ int yydebug;
SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */ evaluated with infinite-precision integer arithmetic. */
#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
# undef YYMAXDEPTH
#endif
#ifndef YYMAXDEPTH #ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000 # define YYMAXDEPTH 10000
#endif #endif
@@ -881,15 +903,17 @@ yysymprint (yyoutput, yytype, yyvaluep, yylocationp)
(void) yylocationp; (void) yylocationp;
if (yytype < YYNTOKENS) if (yytype < YYNTOKENS)
{
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
# ifdef YYPRINT
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# endif
}
else else
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
YY_LOCATION_PRINT (yyoutput, *yylocationp);
fprintf (yyoutput, ": ");
# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# endif
switch (yytype) switch (yytype)
{ {
default: default:
@@ -905,10 +929,11 @@ yysymprint (yyoutput, yytype, yyvaluep, yylocationp)
#if defined (__STDC__) || defined (__cplusplus) #if defined (__STDC__) || defined (__cplusplus)
static void static void
yydestruct (int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
#else #else
static void static void
yydestruct (yytype, yyvaluep, yylocationp) yydestruct (yymsg, yytype, yyvaluep, yylocationp)
const char *yymsg;
int yytype; int yytype;
YYSTYPE *yyvaluep; YYSTYPE *yyvaluep;
YYLTYPE *yylocationp; YYLTYPE *yylocationp;
@@ -918,6 +943,10 @@ yydestruct (yytype, yyvaluep, yylocationp)
(void) yyvaluep; (void) yyvaluep;
(void) yylocationp; (void) yylocationp;
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
switch (yytype) switch (yytype)
{ {
@@ -970,15 +999,15 @@ yyparse ()
#endif #endif
#endif #endif
{ {
/* The lookahead symbol. */ /* The look-ahead symbol. */
int yychar; int yychar;
/* The semantic value of the lookahead symbol. */ /* The semantic value of the look-ahead symbol. */
YYSTYPE yylval; YYSTYPE yylval;
/* Number of syntax errors so far. */ /* Number of syntax errors so far. */
int yynerrs; int yynerrs;
/* Location data for the lookahead symbol. */ /* Location data for the look-ahead symbol. */
YYLTYPE yylloc; YYLTYPE yylloc;
register int yystate; register int yystate;
@@ -986,7 +1015,7 @@ YYLTYPE yylloc;
int yyresult; int yyresult;
/* Number of tokens to shift before error messages enabled. */ /* Number of tokens to shift before error messages enabled. */
int yyerrstatus; int yyerrstatus;
/* Lookahead token as an internal (translated) token number. */ /* Look-ahead token as an internal (translated) token number. */
int yytoken = 0; int yytoken = 0;
/* Three stacks and their tools: /* Three stacks and their tools:
@@ -1011,7 +1040,8 @@ YYLTYPE yylloc;
YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls = yylsa; YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp; YYLTYPE *yylsp;
YYLTYPE *yylerrsp; /* The locations where the error started and ended. */
YYLTYPE yyerror_range[2];
#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
@@ -1041,6 +1071,15 @@ YYLTYPE yylloc;
yyssp = yyss; yyssp = yyss;
yyvsp = yyvs; yyvsp = yyvs;
yylsp = yyls; yylsp = yyls;
#if YYLTYPE_IS_TRIVIAL
/* Initialize the default location before parsing starts. */
yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = 0;
#endif
yyvsp[0] = yylval;
yylsp[0] = yylloc;
goto yysetstate; goto yysetstate;
@@ -1131,18 +1170,18 @@ YYLTYPE yylloc;
yybackup: yybackup:
/* Do appropriate processing given the current state. */ /* 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: */ /* 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]; yyn = yypact[yystate];
if (yyn == YYPACT_NINF) if (yyn == YYPACT_NINF)
goto yydefault; 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) if (yychar == YYEMPTY)
{ {
YYDPRINTF ((stderr, "Reading a token: ")); YYDPRINTF ((stderr, "Reading a token: "));
@@ -1157,7 +1196,7 @@ yybackup:
else else
{ {
yytoken = YYTRANSLATE (yychar); 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 /* If the proper action on seeing token YYTOKEN is to reduce or to
@@ -1177,8 +1216,8 @@ yybackup:
if (yyn == YYFINAL) if (yyn == YYFINAL)
YYACCEPT; YYACCEPT;
/* Shift the lookahead token. */ /* Shift the look-ahead token. */
YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
/* Discard the token being shifted unless it is eof. */ /* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF) if (yychar != YYEOF)
@@ -1229,158 +1268,180 @@ yyreduce:
switch (yyn) switch (yyn)
{ {
case 2: case 2:
#line 160 "ast_expr2.y" #line 165 "ast_expr2.y"
{ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1); { ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
((struct parse_io *)parseio)->val->type = yyval.val->type; ((struct parse_io *)parseio)->val->type = (yyvsp[0].val)->type;
if( yyval.val->type == AST_EXPR_integer ) if( (yyvsp[0].val)->type == AST_EXPR_integer )
((struct parse_io *)parseio)->val->u.i = yyval.val->u.i; ((struct parse_io *)parseio)->val->u.i = (yyvsp[0].val)->u.i;
else else
((struct parse_io *)parseio)->val->u.s = yyval.val->u.s; ;} ((struct parse_io *)parseio)->val->u.s = (yyvsp[0].val)->u.s;
free((yyvsp[0].val));
;}
break; break;
case 3: case 3:
#line 168 "ast_expr2.y" #line 175 "ast_expr2.y"
{ yyval.val= yyvsp[0].val;;} { (yyval.val)= (yyvsp[0].val);;}
break; break;
case 4: case 4:
#line 169 "ast_expr2.y" #line 176 "ast_expr2.y"
{ yyval.val = yyvsp[-1].val; { (yyval.val) = (yyvsp[-1].val);
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_line=0; (yyloc).last_line=0;
DESTROY((yyvsp[-2].val)); DESTROY((yyvsp[0].val)); ;}
break; break;
case 5: case 5:
#line 172 "ast_expr2.y" #line 180 "ast_expr2.y"
{ yyval.val = op_or (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_or ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 6: case 6:
#line 175 "ast_expr2.y" #line 184 "ast_expr2.y"
{ yyval.val = op_and (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_and ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 7: case 7:
#line 178 "ast_expr2.y" #line 188 "ast_expr2.y"
{ yyval.val = op_eq (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_eq ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 8: case 8:
#line 181 "ast_expr2.y" #line 192 "ast_expr2.y"
{ yyval.val = op_gt (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_gt ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 9: case 9:
#line 184 "ast_expr2.y" #line 196 "ast_expr2.y"
{ yyval.val = op_lt (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_lt ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 10: case 10:
#line 187 "ast_expr2.y" #line 200 "ast_expr2.y"
{ yyval.val = op_ge (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_ge ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 11: case 11:
#line 190 "ast_expr2.y" #line 204 "ast_expr2.y"
{ yyval.val = op_le (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_le ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 12: case 12:
#line 193 "ast_expr2.y" #line 208 "ast_expr2.y"
{ yyval.val = op_ne (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_ne ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 13: case 13:
#line 196 "ast_expr2.y" #line 212 "ast_expr2.y"
{ yyval.val = op_plus (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_plus ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 14: case 14:
#line 199 "ast_expr2.y" #line 216 "ast_expr2.y"
{ yyval.val = op_minus (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_minus ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 15: case 15:
#line 202 "ast_expr2.y" #line 220 "ast_expr2.y"
{ yyval.val = op_negate (yyvsp[0].val); { (yyval.val) = op_negate ((yyvsp[0].val));
yyloc.first_column = yylsp[-1].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-1]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 16: case 16:
#line 205 "ast_expr2.y" #line 224 "ast_expr2.y"
{ yyval.val = op_compl (yyvsp[0].val); { (yyval.val) = op_compl ((yyvsp[0].val));
yyloc.first_column = yylsp[-1].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-1]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 17: case 17:
#line 208 "ast_expr2.y" #line 228 "ast_expr2.y"
{ yyval.val = op_times (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_times ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 18: case 18:
#line 211 "ast_expr2.y" #line 232 "ast_expr2.y"
{ yyval.val = op_div (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_div ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 19: case 19:
#line 214 "ast_expr2.y" #line 236 "ast_expr2.y"
{ yyval.val = op_rem (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_rem ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 20: case 20:
#line 217 "ast_expr2.y" #line 240 "ast_expr2.y"
{ yyval.val = op_colon (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_colon ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 21: case 21:
#line 220 "ast_expr2.y" #line 244 "ast_expr2.y"
{ yyval.val = op_eqtilde (yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_eqtilde ((yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; DESTROY((yyvsp[-1].val));
yyloc.first_line=0; yyloc.last_line=0;;} (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
case 22: case 22:
#line 223 "ast_expr2.y" #line 248 "ast_expr2.y"
{ yyval.val = op_cond (yyvsp[-4].val, yyvsp[-2].val, yyvsp[0].val); { (yyval.val) = op_cond ((yyvsp[-4].val), (yyvsp[-2].val), (yyvsp[0].val));
yyloc.first_column = yylsp[-4].first_column; yyloc.last_column = yylsp[-2].last_column; DESTROY((yyvsp[-3].val));
yyloc.first_line=0; yyloc.last_line=0;;} DESTROY((yyvsp[-1].val));
(yyloc).first_column = (yylsp[-4]).first_column; (yyloc).last_column = (yylsp[-2]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break; break;
} }
/* Line 1010 of yacc.c. */ /* Line 1037 of yacc.c. */
#line 1384 "ast_expr2.c" #line 1445 "ast_expr2.c"
yyvsp -= yylen; yyvsp -= yylen;
yyssp -= yylen; yyssp -= yylen;
@@ -1476,11 +1537,11 @@ yyerrlab:
yyerror ("syntax error"); yyerror ("syntax error");
} }
yylerrsp = yylsp; yyerror_range[0] = yylloc;
if (yyerrstatus == 3) 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. */ error, discard it. */
if (yychar <= YYEOF) if (yychar <= YYEOF)
@@ -1490,23 +1551,22 @@ yyerrlab:
if (yychar == YYEOF) if (yychar == YYEOF)
for (;;) for (;;)
{ {
yyerror_range[0] = *yylsp;
YYPOPSTACK; YYPOPSTACK;
if (yyssp == yyss) if (yyssp == yyss)
YYABORT; YYABORT;
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct ("Error: popping",
yydestruct (yystos[*yyssp], yyvsp, yylsp); yystos[*yyssp], yyvsp, yylsp);
} }
} }
else else
{ {
YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); yydestruct ("Error: discarding", yytoken, &yylval, &yylloc);
yydestruct (yytoken, &yylval, &yylloc);
yychar = YYEMPTY; yychar = YYEMPTY;
*++yylerrsp = yylloc;
} }
} }
/* Else will try to reuse lookahead token after shifting the error /* Else will try to reuse look-ahead token after shifting the error
token. */ token. */
goto yyerrlab1; goto yyerrlab1;
@@ -1523,12 +1583,11 @@ yyerrorlab:
goto yyerrorlab; goto yyerrorlab;
#endif #endif
yyerror_range[0] = yylsp[1-yylen];
yylsp -= yylen;
yyvsp -= yylen; yyvsp -= yylen;
yyssp -= yylen; yyssp -= yylen;
yystate = *yyssp; yystate = *yyssp;
yylerrsp = yylsp;
*++yylerrsp = yyloc;
yylsp -= yylen;
goto yyerrlab1; goto yyerrlab1;
@@ -1556,8 +1615,8 @@ yyerrlab1:
if (yyssp == yyss) if (yyssp == yyss)
YYABORT; YYABORT;
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yyerror_range[0] = *yylsp;
yydestruct (yystos[yystate], yyvsp, yylsp); yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp);
YYPOPSTACK; YYPOPSTACK;
yystate = *yyssp; yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
@@ -1566,12 +1625,17 @@ yyerrlab1:
if (yyn == YYFINAL) if (yyn == YYFINAL)
YYACCEPT; YYACCEPT;
YYDPRINTF ((stderr, "Shifting error token, "));
*++yyvsp = yylval; *++yyvsp = yylval;
YYLLOC_DEFAULT (yyloc, yylsp, yylerrsp - yylsp);
yyerror_range[1] = yylloc;
/* Using YYLLOC is tempting, but would change the location of
the look-ahead. YYLOC is available though. */
YYLLOC_DEFAULT (yyloc, yyerror_range - 1, 2);
*++yylsp = yyloc; *++yylsp = yyloc;
/* Shift the error token. */
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
yystate = yyn; yystate = yyn;
goto yynewstate; goto yynewstate;
@@ -1587,6 +1651,9 @@ yyacceptlab:
| yyabortlab -- YYABORT comes here. | | yyabortlab -- YYABORT comes here. |
`-----------------------------------*/ `-----------------------------------*/
yyabortlab: yyabortlab:
yydestruct ("Error: discarding lookahead",
yytoken, &yylval, &yylloc);
yychar = YYEMPTY;
yyresult = 1; yyresult = 1;
goto yyreturn; goto yyreturn;
@@ -1609,7 +1676,7 @@ yyreturn:
} }
#line 228 "ast_expr2.y" #line 255 "ast_expr2.y"
static struct val * static struct val *
@@ -1666,6 +1733,7 @@ free_value (struct val *vp)
} }
if (vp->type == AST_EXPR_string || vp->type == AST_EXPR_numeric_string) if (vp->type == AST_EXPR_string || vp->type == AST_EXPR_numeric_string)
free (vp->u.s); free (vp->u.s);
free(vp);
} }

View File

@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 1.875d. */ /* A Bison parser, made by GNU Bison 2.0. */
/* Skeleton parser for Yacc-like parsing with Bison, /* 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 Free Software Foundation, Inc.
@@ -78,11 +78,11 @@
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 137 "ast_expr2.y" #line 142 "ast_expr2.y"
typedef union YYSTYPE { typedef union YYSTYPE {
struct val *val; struct val *val;
} YYSTYPE; } YYSTYPE;
/* Line 1285 of yacc.c. */ /* Line 1318 of yacc.c. */
#line 87 "ast_expr2.h" #line 87 "ast_expr2.h"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1

File diff suppressed because it is too large Load Diff