00890 {
00891
00892
int yychar;
00893
00894
00895
YYSTYPE yylval;
00896
00897
00898
int yynerrs;
00899
00900
YYLTYPE yylloc;
00901
00902
register int yystate;
00903
register int yyn;
00904
int yyresult;
00905
00906
int yyerrstatus;
00907
00908
int yytoken = 0;
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
short yyssa[
YYINITDEPTH];
00920
short *yyss = yyssa;
00921
register short *yyssp;
00922
00923
00924
YYSTYPE yyvsa[
YYINITDEPTH];
00925
YYSTYPE *yyvs = yyvsa;
00926
register YYSTYPE *yyvsp;
00927
00928
00929
YYLTYPE yylsa[
YYINITDEPTH];
00930
YYLTYPE *yyls = yylsa;
00931
YYLTYPE *yylsp;
00932
YYLTYPE *yylerrsp;
00933
00934
#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
00935
00936
YYSIZE_T yystacksize =
YYINITDEPTH;
00937
00938
00939
00940
YYSTYPE yyval;
00941
YYLTYPE yyloc;
00942
00943
00944
00945
int yylen;
00946
00947
YYDPRINTF ((stderr,
"Starting parse\n"));
00948
00949 yystate = 0;
00950 yyerrstatus = 0;
00951
yynerrs = 0;
00952
yychar =
YYEMPTY;
00953
00954
00955
00956
00957
00958
00959 yyssp = yyss;
00960 yyvsp = yyvs;
00961 yylsp = yyls;
00962
goto yysetstate;
00963
00964
00965
00966
00967 yynewstate:
00968
00969
00970
00971 yyssp++;
00972
00973 yysetstate:
00974 *yyssp = yystate;
00975
00976
if (yyss + yystacksize - 1 <= yyssp)
00977 {
00978
00979
YYSIZE_T yysize = yyssp - yyss + 1;
00980
00981
#ifdef yyoverflow
00982
{
00983
00984
00985
00986
YYSTYPE *yyvs1 = yyvs;
00987
short *yyss1 = yyss;
00988
YYLTYPE *yyls1 = yyls;
00989
00990
00991
00992
00993
00994 yyoverflow (
"parser stack overflow",
00995 &yyss1, yysize *
sizeof (*yyssp),
00996 &yyvs1, yysize *
sizeof (*yyvsp),
00997 &yyls1, yysize *
sizeof (*yylsp),
00998 &yystacksize);
00999 yyls = yyls1;
01000 yyss = yyss1;
01001 yyvs = yyvs1;
01002 }
01003
#else
01004
# ifndef YYSTACK_RELOCATE
01005
goto yyoverflowlab;
01006
# else
01007
01008
if (
YYMAXDEPTH <= yystacksize)
01009
goto yyoverflowlab;
01010 yystacksize *= 2;
01011
if (
YYMAXDEPTH < yystacksize)
01012 yystacksize =
YYMAXDEPTH;
01013
01014 {
01015
short *yyss1 = yyss;
01016
union yyalloc *yyptr =
01017 (
union yyalloc *)
YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01018
if (! yyptr)
01019
goto yyoverflowlab;
01020
YYSTACK_RELOCATE (yyss);
01021
YYSTACK_RELOCATE (yyvs);
01022
YYSTACK_RELOCATE (yyls);
01023
# undef YYSTACK_RELOCATE
01024
if (yyss1 != yyssa)
01025
YYSTACK_FREE (yyss1);
01026 }
01027
# endif
01028
#endif
01029
01030 yyssp = yyss + yysize - 1;
01031 yyvsp = yyvs + yysize - 1;
01032 yylsp = yyls + yysize - 1;
01033
01034
YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
01035 (
unsigned long int) yystacksize));
01036
01037
if (yyss + yystacksize - 1 <= yyssp)
01038
YYABORT;
01039 }
01040
01041
YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
01042
01043
goto yybackup;
01044
01045
01046
01047
01048 yybackup:
01049
01050
01051
01052
01053
01054
01055
01056 yyn = yypact[yystate];
01057
if (yyn ==
YYPACT_NINF)
01058
goto yydefault;
01059
01060
01061
01062
01063
if (
yychar ==
YYEMPTY)
01064 {
01065
YYDPRINTF ((stderr,
"Reading a token: "));
01066
yychar =
YYLEX;
01067 }
01068
01069
if (
yychar <=
YYEOF)
01070 {
01071
yychar = yytoken =
YYEOF;
01072
YYDPRINTF ((stderr,
"Now at end of input.\n"));
01073 }
01074
else
01075 {
01076 yytoken =
YYTRANSLATE (yychar);
01077
YYDSYMPRINTF (
"Next token is", yytoken, &yylval, &yylloc);
01078 }
01079
01080
01081
01082 yyn += yytoken;
01083
if (yyn < 0 ||
YYLAST < yyn || yycheck[yyn] != yytoken)
01084
goto yydefault;
01085 yyn = yytable[yyn];
01086
if (yyn <= 0)
01087 {
01088
if (yyn == 0 || yyn ==
YYTABLE_NINF)
01089
goto yyerrlab;
01090 yyn = -yyn;
01091
goto yyreduce;
01092 }
01093
01094
if (yyn ==
YYFINAL)
01095
YYACCEPT;
01096
01097
01098
YYDPRINTF ((stderr,
"Shifting token %s, ", yytname[yytoken]));
01099
01100
01101
if (
yychar !=
YYEOF)
01102
yychar =
YYEMPTY;
01103
01104 *++yyvsp =
yylval;
01105 *++yylsp =
yylloc;
01106
01107
01108
01109
if (yyerrstatus)
01110 yyerrstatus--;
01111
01112 yystate = yyn;
01113
goto yynewstate;
01114
01115
01116
01117
01118
01119 yydefault:
01120 yyn = yydefact[yystate];
01121
if (yyn == 0)
01122
goto yyerrlab;
01123
goto yyreduce;
01124
01125
01126
01127
01128
01129 yyreduce:
01130
01131 yylen = yyr2[yyn];
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141 yyval = yyvsp[1-yylen];
01142
01143
01144
YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
01145
YY_REDUCE_PRINT (yyn);
01146
switch (yyn)
01147 {
01148
case 2:
01149
#line 137 "ast_expr.y"
01150
{ ((
struct parser_control *)kota)->result = yyval.
val; ;}
01151
break;
01152
01153
case 4:
01154
#line 141 "ast_expr.y"
01155
{ yyval.
val = yyvsp[-1].val; yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01156
break;
01157
01158
case 5:
01159
#line 142 "ast_expr.y"
01160
{ yyval.
val = op_or (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01161
break;
01162
01163
case 6:
01164
#line 143 "ast_expr.y"
01165
{ yyval.
val = op_and (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01166
break;
01167
01168
case 7:
01169
#line 144 "ast_expr.y"
01170
{ yyval.
val = op_eq (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01171
break;
01172
01173
case 8:
01174
#line 145 "ast_expr.y"
01175
{ yyval.
val = op_gt (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01176
break;
01177
01178
case 9:
01179
#line 146 "ast_expr.y"
01180
{ yyval.
val = op_lt (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01181
break;
01182
01183
case 10:
01184
#line 147 "ast_expr.y"
01185
{ yyval.
val = op_ge (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01186
break;
01187
01188
case 11:
01189
#line 148 "ast_expr.y"
01190
{ yyval.
val = op_le (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01191
break;
01192
01193
case 12:
01194
#line 149 "ast_expr.y"
01195
{ yyval.
val = op_ne (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01196
break;
01197
01198
case 13:
01199
#line 150 "ast_expr.y"
01200
{ yyval.
val = op_plus (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01201
break;
01202
01203
case 14:
01204
#line 151 "ast_expr.y"
01205
{ yyval.
val = op_minus (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01206
break;
01207
01208
case 15:
01209
#line 152 "ast_expr.y"
01210
{ yyval.
val = op_times (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01211
break;
01212
01213
case 16:
01214
#line 153 "ast_expr.y"
01215
{ yyval.
val = op_div (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01216
break;
01217
01218
case 17:
01219
#line 154 "ast_expr.y"
01220
{ yyval.
val = op_rem (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01221
break;
01222
01223
case 18:
01224
#line 155 "ast_expr.y"
01225
{ yyval.
val = op_colon (yyvsp[-2].
val, yyvsp[0].val); yyloc.first_column = yylsp[-2].first_column; yyloc.last_column = yylsp[0].last_column; yyloc.first_line=0; yyloc.last_line=0;;}
01226
break;
01227
01228
01229 }
01230
01231
01232
#line 1233 "ast_expr.c"
01233
01234 yyvsp -= yylen;
01235 yyssp -= yylen;
01236 yylsp -= yylen;
01237
01238
YY_STACK_PRINT (yyss, yyssp);
01239
01240 *++yyvsp = yyval;
01241 *++yylsp = yyloc;
01242
01243
01244
01245
01246
01247 yyn = yyr1[yyn];
01248
01249 yystate = yypgoto[yyn -
YYNTOKENS] + *yyssp;
01250
if (0 <= yystate && yystate <=
YYLAST && yycheck[yystate] == *yyssp)
01251 yystate = yytable[yystate];
01252
else
01253 yystate = yydefgoto[yyn -
YYNTOKENS];
01254
01255
goto yynewstate;
01256
01257
01258
01259
01260
01261 yyerrlab:
01262
01263
if (!yyerrstatus)
01264 {
01265 ++
yynerrs;
01266
#if YYERROR_VERBOSE
01267
yyn = yypact[yystate];
01268
01269
if (
YYPACT_NINF < yyn && yyn <
YYLAST)
01270 {
01271
YYSIZE_T yysize = 0;
01272
int yytype =
YYTRANSLATE (yychar);
01273
char *yymsg;
01274
int yyx, yycount;
01275
01276 yycount = 0;
01277
01278
01279
for (yyx = yyn < 0 ? -yyn : 0;
01280 yyx < (
int) (
sizeof (yytname) /
sizeof (
char *)); yyx++)
01281
if (yycheck[yyx + yyn] == yyx && yyx !=
YYTERROR)
01282 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
01283 yysize += yystrlen (
"syntax error, unexpected ") + 1;
01284 yysize += yystrlen (yytname[yytype]);
01285 yymsg = (
char *)
YYSTACK_ALLOC (yysize);
01286
if (yymsg != 0)
01287 {
01288
char *yyp = yystpcpy (yymsg,
"syntax error, unexpected ");
01289 yyp = yystpcpy (yyp, yytname[yytype]);
01290
01291
if (yycount < 5)
01292 {
01293 yycount = 0;
01294
for (yyx = yyn < 0 ? -yyn : 0;
01295 yyx < (
int) (
sizeof (yytname) /
sizeof (
char *));
01296 yyx++)
01297
if (yycheck[yyx + yyn] == yyx && yyx !=
YYTERROR)
01298 {
01299
const char *yyq = ! yycount ?
", expecting " :
" or ";
01300 yyp = yystpcpy (yyp, yyq);
01301 yyp = yystpcpy (yyp, yytname[yyx]);
01302 yycount++;
01303 }
01304 }
01305
yyerror (yymsg);
01306
YYSTACK_FREE (yymsg);
01307 }
01308
else
01309
yyerror (
"syntax error; also virtual memory exhausted");
01310 }
01311
else
01312
#endif
01313
yyerror (
"syntax error");
01314 }
01315
01316 yylerrsp = yylsp;
01317
01318
if (yyerrstatus == 3)
01319 {
01320
01321
01322
01323
01324
if (
yychar ==
YYEOF)
01325 {
01326
01327
YYPOPSTACK;
01328
01329
while (yyss < yyssp)
01330 {
01331
YYDSYMPRINTF (
"Error: popping", yystos[*yyssp], yyvsp, yylsp);
01332 yydestruct (yystos[*yyssp], yyvsp, yylsp);
01333
YYPOPSTACK;
01334 }
01335
YYABORT;
01336 }
01337
01338
YYDSYMPRINTF (
"Error: discarding", yytoken, &yylval, &yylloc);
01339 yydestruct (yytoken, &yylval, &yylloc);
01340
yychar =
YYEMPTY;
01341 *++yylerrsp =
yylloc;
01342 }
01343
01344
01345
01346
goto yyerrlab1;
01347
01348
01349
01350
01351
01352 yyerrlab1:
01353 yyerrstatus = 3;
01354
01355
for (;;)
01356 {
01357 yyn = yypact[yystate];
01358
if (yyn !=
YYPACT_NINF)
01359 {
01360 yyn +=
YYTERROR;
01361
if (0 <= yyn && yyn <=
YYLAST && yycheck[yyn] ==
YYTERROR)
01362 {
01363 yyn = yytable[yyn];
01364
if (0 < yyn)
01365
break;
01366 }
01367 }
01368
01369
01370
if (yyssp == yyss)
01371
YYABORT;
01372
01373
YYDSYMPRINTF (
"Error: popping", yystos[*yyssp], yyvsp, yylsp);
01374 yydestruct (yystos[yystate], yyvsp, yylsp);
01375 yyvsp--;
01376 yystate = *--yyssp;
01377 yylsp--;
01378
YY_STACK_PRINT (yyss, yyssp);
01379 }
01380
01381
if (yyn ==
YYFINAL)
01382
YYACCEPT;
01383
01384
YYDPRINTF ((stderr,
"Shifting error token, "));
01385
01386 *++yyvsp =
yylval;
01387
YYLLOC_DEFAULT (yyloc, yylsp, (yylerrsp - yylsp));
01388 *++yylsp = yyloc;
01389
01390 yystate = yyn;
01391
goto yynewstate;
01392
01393
01394
01395
01396
01397 yyacceptlab:
01398 yyresult = 0;
01399
goto yyreturn;
01400
01401
01402
01403
01404 yyabortlab:
01405 yyresult = 1;
01406
goto yyreturn;
01407
01408
#ifndef yyoverflow
01409
01410
01411
01412 yyoverflowlab:
01413
yyerror (
"parser stack overflow");
01414 yyresult = 2;
01415
01416
#endif
01417
01418 yyreturn:
01419
#ifndef yyoverflow
01420
if (yyss != yyssa)
01421
YYSTACK_FREE (yyss);
01422
#endif
01423
return yyresult;
01424 }