1 --- y.tab.c Mon Sep 30 04:20:57 2002
2 +++ perly.c Mon Sep 30 04:18:04 2002
5 -static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91";
6 +/* static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91"; */
14 -#define dep() deprecate("\"do\" to call subroutines")
15 +#define dep() deprecate_old("\"do\" to call subroutines")
17 /* stuff included here to make perly_c.diff apply better */
29 -#define PRIVATEREF 262
60 -#define HASHBRACK 293
65 -#define COLONATTR 298
89 -short yylhs[] = { -1,
90 +static short yylhs[] = { -1,
91 0, 9, 7, 6, 10, 8, 11, 11, 11, 12,
92 12, 12, 12, 25, 25, 25, 25, 25, 25, 25,
93 15, 15, 15, 14, 14, 43, 43, 13, 13, 13,
95 49, 49, 34, 34, 35, 35, 35, 44, 24, 19,
96 20, 21, 22, 23, 36, 36, 36, 36,
99 +static short yylen[] = { 2,
100 2, 4, 0, 0, 4, 0, 0, 2, 2, 2,
101 1, 2, 3, 1, 1, 3, 3, 3, 3, 3,
102 0, 2, 6, 7, 7, 0, 2, 8, 8, 10,
104 1, 1, 0, 1, 0, 1, 2, 1, 2, 2,
105 2, 2, 2, 2, 1, 1, 1, 1,
107 -short yydefred[] = { 4,
108 +static short yydefred[] = { 4,
109 0, 7, 0, 45, 58, 56, 0, 56, 56, 8,
110 46, 9, 11, 48, 0, 47, 49, 50, 0, 0,
111 0, 70, 0, 14, 3, 174, 0, 0, 155, 0,
113 32, 0, 0, 0, 22, 0, 0, 0, 31, 5,
114 0, 30, 0, 0, 33, 0, 23,
116 -short yydgoto[] = { 1,
117 +static short yydgoto[] = { 1,
118 10, 11, 20, 103, 19, 2, 94, 373, 97, 362,
119 3, 12, 13, 69, 378, 288, 71, 72, 73, 74,
120 75, 76, 77, 78, 294, 80, 295, 284, 286, 289,
122 195, 330, 155, 292, 274, 226, 14, 82, 136, 83,
123 84, 85, 86, 15, 16, 17, 18, 92, 281,
125 -short yysindex[] = { 0,
126 +static short yysindex[] = { 0,
127 0, 0, -236, 0, 0, 0, -231, 0, 0, 0,
128 0, 0, 0, 0, 819, 0, 0, 0, -211, -209,
129 3, 0, -209, 0, 0, 0, -32, -32, 0, 23,
131 0, 1859, -173, 350, 0, 2213, -173, 360, 0, 0,
132 361, 0, 221, 221, 0, -240, 0,
134 -short yyrindex[] = { 0,
135 +static short yyrindex[] = { 0,
136 0, 0, 371, 0, 0, 0, 0, 0, 0, 0,
137 0, 0, 0, 0, 0, 0, 0, 0, 289, 0,
138 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
140 0, 435, 90, 880, 0, 0, 90, 0, 0, 0,
141 0, 0, 0, 0, 0, 186, 0,
143 -short yygindex[] = { 0,
144 +static short yygindex[] = { 0,
145 0, 0, 50, 453, 0, 0, -22, 0, 63, 153,
146 -93, 0, 0, 0, -346, -15, 2480, 0, 1744, 437,
147 439, 0, 0, 0, 481, 755, 0, 0, 341, -186,
149 0, 0, 0, 0, 0, 0, 0, 0, 0,
151 #define YYTABLESIZE 5051
152 -short yytable[] = { 70,
153 +static short yytable[] = { 70,
154 198, 300, 75, 64, 60, 280, 228, 60, 279, 64,
155 199, 328, 183, 257, 219, 62, 278, 64, 379, 186,
156 75, 110, 296, 188, 15, 21, 197, 170, 64, 4,
158 0, 0, 0, 0, 114, 114, 114, 0, 114, 114,
161 -short yycheck[] = { 15,
162 +static short yycheck[] = { 15,
163 94, 44, 41, 36, 59, 41, 41, 123, 44, 36,
164 99, 59, 40, 40, 40, 59, 200, 36, 365, 91,
165 59, 40, 209, 91, 41, 257, 93, 63, 59, 266,
166 @@ -1324,7 +1261,7 @@
168 #define YYMAXTOKEN 319
171 +static char *yyname[] = {
172 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
173 "'!'",0,0,"'$'","'%'","'&'",0,"'('","')'","'*'","'+'","','","'-'",0,0,0,0,0,0,0,
174 0,0,0,0,0,"':'","';'",0,0,0,"'?'","'@'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
175 @@ -1341,7 +1278,7 @@
176 "DORDOR","ANDAND","BITOROP","BITANDOP","SHIFTOP","MATCHOP","UMINUS","REFGEN",
177 "POWOP","PREINC","PREDEC","POSTINC","POSTDEC","ARROW",
180 +static char *yyrule[] = {
182 "prog : progstart lineseq",
183 "block : '{' remember lineseq '}'",
184 @@ -1557,17 +1494,6 @@
185 #define YYMAXDEPTH 500
196 -short yyss[YYSTACKSIZE];
197 -YYSTYPE yyvs[YYSTACKSIZE];
198 -#define yystacksize YYSTACKSIZE
202 @@ -1578,7 +1504,7 @@
204 #define yyparse() Perl_yyparse(pTHX)
206 -#line 1582 "y.tab.c"
207 +#line 1582 "perly.c"
208 #define YYABORT goto yyabort
209 #define YYACCEPT goto yyaccept
210 #define YYERROR goto yyerrlab
211 @@ -1586,11 +1512,31 @@
214 register int yym, yyn, yystate;
215 + register short *yyssp;
216 + register YYSTYPE *yyvsp;
219 + unsigned yystacksize = YYSTACKSIZE;
223 - extern char *getenv();
228 + ENTER; /* force yydestruct() before we return */
230 + New(73, ysave, 1, struct ysv);
231 + SAVEDESTRUCTOR_X(yydestruct, ysave);
232 + ysave->oldyydebug = yydebug;
233 + ysave->oldyynerrs = yynerrs;
234 + ysave->oldyyerrflag = yyerrflag;
235 + ysave->oldyychar = yychar;
236 + ysave->oldyyval = yyval;
237 + ysave->oldyylval = yylval;
239 - if (yys = getenv("YYDEBUG"))
241 + if ((yys = getenv("YYDEBUG")))
244 if (yyn >= '0' && yyn <= '9')
245 @@ -1602,12 +1548,22 @@
250 + ** Initialize private stacks (yyparse may be called from an action)
252 + New(73, yyss, yystacksize, short);
253 + New(73, yyvs, yystacksize, YYSTYPE);
254 + ysave->yyss = yyss;
255 + ysave->yyvs = yyvs;
256 + if (!yyvs || !yyss)
261 *yyssp = yystate = 0;
264 - if (yyn = yydefred[yystate]) goto yyreduce;
265 + if ((yyn = yydefred[yystate])) goto yyreduce;
268 if ((yychar = yylex()) < 0) yychar = 0;
269 @@ -1617,7 +1573,7 @@
271 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
272 if (!yys) yys = "illegal-symbol";
273 - printf("yydebug: state %d, reading %d (%s)\n", yystate,
274 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n", yystate,
278 @@ -1627,12 +1583,24 @@
282 - printf("yydebug: state %d, shifting to state %d\n",
283 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, shifting to state %d\n",
284 yystate, yytable[yyn]);
286 if (yyssp >= yyss + yystacksize - 1)
289 + ** reallocate and recover. Note that pointers
290 + ** have to be reset, or bad things will happen
292 + int yyps_index = (yyssp - yyss);
293 + int yypv_index = (yyvsp - yyvs);
294 + yystacksize += YYSTACKSIZE;
295 + ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
296 + ysave->yyss = Renew(yyss, yystacksize, short);
297 + if (!yyvs || !yyss)
299 + yyssp = yyss + yyps_index;
300 + yyvsp = yyvs + yypv_index;
302 *++yyssp = yystate = yytable[yyn];
304 @@ -1648,14 +1616,14 @@
306 if (yyerrflag) goto yyinrecovery;
313 yyerror("syntax error");
323 @@ -1668,12 +1636,24 @@
327 - printf("yydebug: state %d, error recovery shifting\
328 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, error recovery shifting\
329 to state %d\n", *yyssp, yytable[yyn]);
331 if (yyssp >= yyss + yystacksize - 1)
334 + ** reallocate and recover. Note that pointers
335 + ** have to be reset, or bad things will happen
337 + int yyps_index = (yyssp - yyss);
338 + int yypv_index = (yyvsp - yyvs);
339 + yystacksize += YYSTACKSIZE;
340 + ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
341 + ysave->yyss = Renew(yyss, yystacksize, short);
342 + if (!yyvs || !yyss)
344 + yyssp = yyss + yyps_index;
345 + yyvsp = yyvs + yypv_index;
347 *++yyssp = yystate = yytable[yyn];
349 @@ -1683,7 +1663,7 @@
353 - printf("yydebug: error recovery discarding state %d\n",
354 + PerlIO_printf(Perl_debug_log, "yydebug: error recovery discarding state %d\n",
357 if (yyssp <= yyss) goto yyabort;
358 @@ -1701,7 +1681,7 @@
360 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
361 if (!yys) yys = "illegal-symbol";
362 - printf("yydebug: state %d, error recovery discards token %d (%s)\n",
363 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, error recovery discards token %d (%s)\n",
364 yystate, yychar, yys);
367 @@ -1711,7 +1691,7 @@
371 - printf("yydebug: state %d, reducing by rule %d (%s)\n",
372 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, reducing by rule %d (%s)\n",
373 yystate, yyn, yyrule[yyn]);
376 @@ -2578,7 +2558,7 @@
378 { yyval.opval = yyvsp[0].opval; }
380 -#line 2582 "y.tab.c"
381 +#line 2582 "perly.c"
385 @@ -2588,7 +2568,7 @@
389 - printf("yydebug: after reduction, shifting from state 0 to\
390 + PerlIO_printf(Perl_debug_log, "yydebug: after reduction, shifting from state 0 to\
391 state %d\n", YYFINAL);
394 @@ -2603,7 +2583,7 @@
396 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
397 if (!yys) yys = "illegal-symbol";
398 - printf("yydebug: state %d, reading %d (%s)\n",
399 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n",
400 YYFINAL, yychar, yys);
403 @@ -2618,20 +2598,50 @@
404 yystate = yydgoto[yym];
407 - printf("yydebug: after reduction, shifting from state %d \
408 + PerlIO_printf(Perl_debug_log, "yydebug: after reduction, shifting from state %d \
409 to state %d\n", *yyssp, yystate);
411 if (yyssp >= yyss + yystacksize - 1)
414 + ** reallocate and recover. Note that pointers
415 + ** have to be reset, or bad things will happen
417 + int yyps_index = (yyssp - yyss);
418 + int yypv_index = (yyvsp - yyvs);
419 + yystacksize += YYSTACKSIZE;
420 + ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
421 + ysave->yyss = Renew(yyss, yystacksize, short);
422 + if (!yyvs || !yyss)
424 + yyssp = yyss + yyps_index;
425 + yyvsp = yyvs + yypv_index;
431 - yyerror("yacc stack overflow");
432 + yyerror("Out of memory for yacc stack");
439 + LEAVE; /* force yydestruct() before we return */
445 +yydestruct(pTHX_ void *ptr)
447 + struct ysv* ysave = (struct ysv*)ptr;
448 + if (ysave->yyss) Safefree(ysave->yyss);
449 + if (ysave->yyvs) Safefree(ysave->yyvs);
450 + yydebug = ysave->oldyydebug;
451 + yynerrs = ysave->oldyynerrs;
452 + yyerrflag = ysave->oldyyerrflag;
453 + yychar = ysave->oldyychar;
454 + yyval = ysave->oldyyval;
455 + yylval = ysave->oldyylval;