1 --- perly.c.orig Wed May 10 18:57:57 2006
2 +++ perly.c Wed May 10 18:57:57 2006
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
66 -#define COLONATTR 299
88 -short yylhs[] = { -1,
89 +static short yylhs[] = { -1,
90 0, 10, 8, 7, 11, 9, 12, 12, 12, 13,
91 13, 13, 13, 26, 26, 26, 26, 26, 26, 26,
92 16, 16, 16, 15, 15, 43, 43, 14, 14, 14,
94 49, 49, 49, 34, 34, 35, 35, 35, 44, 25,
95 20, 21, 22, 23, 24, 36, 36, 36, 36,
98 +static short yylen[] = { 2,
99 2, 4, 0, 0, 4, 0, 0, 2, 2, 2,
100 1, 2, 3, 1, 1, 3, 3, 3, 3, 3,
101 0, 2, 6, 7, 7, 0, 2, 9, 9, 10,
103 1, 1, 1, 0, 1, 0, 1, 2, 1, 2,
104 2, 2, 2, 2, 2, 1, 1, 1, 1,
106 -short yydefred[] = { 4,
107 +static short yydefred[] = { 4,
108 0, 7, 0, 45, 58, 56, 0, 56, 56, 8,
109 46, 9, 11, 48, 0, 47, 49, 50, 0, 0,
110 0, 70, 71, 0, 14, 3, 175, 0, 0, 154,
112 0, 28, 29, 0, 22, 0, 0, 0, 31, 5,
113 0, 30, 0, 0, 0, 0, 33, 23,
115 -short yydgoto[] = { 1,
116 +static short yydgoto[] = { 1,
117 10, 11, 20, 105, 19, 359, 2, 96, 373, 99,
118 362, 3, 12, 13, 71, 376, 285, 73, 74, 75,
119 76, 77, 78, 79, 80, 292, 82, 293, 283, 234,
121 196, 328, 158, 290, 273, 227, 14, 84, 138, 85,
122 86, 87, 88, 15, 16, 17, 18, 94, 280,
124 -short yysindex[] = { 0,
125 +static short yysindex[] = { 0,
126 0, 0, -112, 0, 0, 0, -47, 0, 0, 0,
127 0, 0, 0, 0, 651, 0, 0, 0, -214, -201,
128 44, 0, 0, -201, 0, 0, 0, -13, -13, 0,
130 -149, 0, 0, 591, 0, 2210, -149, 1761, 0, 0,
131 385, 0, 388, 290, 290, -124, 0, 0,
133 -short yyrindex[] = { 0,
134 +static short yyrindex[] = { 0,
135 0, 0, 466, 0, 0, 0, 0, 0, 0, 0,
136 0, 0, 0, 0, 0, 0, 0, 0, 302, 0,
137 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
139 71, 0, 0, 827, 0, 0, 71, 427, 0, 0,
140 0, 0, 0, 0, 0, 179, 0, 0,
142 -short yygindex[] = { 0,
143 +static short yygindex[] = { 0,
144 0, 0, 180, 444, 0, -308, 0, -34, 0, -6,
145 1062, -94, 0, 0, 0, -343, -15, 2478, 0, 2171,
146 428, 429, 0, 0, 0, 468, 423, 0, 148, -110,
148 0, 0, 0, 0, 0, 0, 0, 0, 0,
150 #define YYTABLESIZE 4871
151 -short yytable[] = { 72,
152 +static short yytable[] = { 72,
153 56, 199, 222, 66, 68, 54, 60, 61, 70, 69,
154 65, 22, 64, 66, 316, 60, 229, 112, 200, 377,
155 326, 62, 66, 277, 297, 230, 306, 360, 64, 15,
157 0, 0, 0, 0, 0, 112, 112, 0, 112, 112,
160 -short yycheck[] = { 15,
161 +static short yycheck[] = { 15,
162 33, 96, 59, 36, 37, 38, 123, 40, 15, 42,
163 43, 59, 45, 36, 59, 59, 41, 40, 101, 363,
164 59, 59, 36, 201, 41, 93, 41, 336, 59, 41,
165 @@ -1287,7 +1225,7 @@
167 #define YYMAXTOKEN 318
170 +static char *yyname[] = {
171 "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,
172 "'!'",0,0,"'$'","'%'","'&'",0,"'('","')'","'*'","'+'","','","'-'",0,0,0,0,0,0,0,
173 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,
174 @@ -1304,7 +1242,7 @@
175 "OROR","ANDAND","BITOROP","BITANDOP","SHIFTOP","MATCHOP","UMINUS","REFGEN",
176 "POWOP","PREINC","PREDEC","POSTINC","POSTDEC","ARROW",
179 +static char *yyrule[] = {
181 "prog : progstart lineseq",
182 "block : '{' remember lineseq '}'",
183 @@ -1521,17 +1459,6 @@
184 #define YYMAXDEPTH 500
195 -short yyss[YYSTACKSIZE];
196 -YYSTYPE yyvs[YYSTACKSIZE];
197 -#define yystacksize YYSTACKSIZE
201 @@ -1542,7 +1469,7 @@
203 #define yyparse() Perl_yyparse(pTHX)
205 -#line 1546 "y.tab.c"
206 +#line 1473 "perly.c"
207 #define YYABORT goto yyabort
208 #define YYACCEPT goto yyaccept
209 #define YYERROR goto yyerrlab
210 @@ -1550,11 +1477,31 @@
213 register int yym, yyn, yystate;
214 + register short *yyssp;
215 + register YYSTYPE *yyvsp;
218 + unsigned yystacksize = YYSTACKSIZE;
222 - extern char *getenv();
227 + ENTER; /* force yydestruct() before we return */
229 + New(73, ysave, 1, struct ysv);
230 + SAVEDESTRUCTOR_X(yydestruct, ysave);
231 + ysave->oldyydebug = yydebug;
232 + ysave->oldyynerrs = yynerrs;
233 + ysave->oldyyerrflag = yyerrflag;
234 + ysave->oldyychar = yychar;
235 + ysave->oldyyval = yyval;
236 + ysave->oldyylval = yylval;
238 - if (yys = getenv("YYDEBUG"))
240 + if ((yys = getenv("YYDEBUG")))
243 if (yyn >= '0' && yyn <= '9')
244 @@ -1566,12 +1513,22 @@
249 + ** Initialize private stacks (yyparse may be called from an action)
251 + New(73, yyss, yystacksize, short);
252 + New(73, yyvs, yystacksize, YYSTYPE);
253 + ysave->yyss = yyss;
254 + ysave->yyvs = yyvs;
255 + if (!yyvs || !yyss)
260 *yyssp = yystate = 0;
263 - if (yyn = yydefred[yystate]) goto yyreduce;
264 + if ((yyn = yydefred[yystate])) goto yyreduce;
267 if ((yychar = yylex()) < 0) yychar = 0;
268 @@ -1581,7 +1538,7 @@
270 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
271 if (!yys) yys = "illegal-symbol";
272 - printf("yydebug: state %d, reading %d (%s)\n", yystate,
273 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n", yystate,
277 @@ -1591,12 +1548,24 @@
281 - printf("yydebug: state %d, shifting to state %d\n",
282 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, shifting to state %d\n",
283 yystate, yytable[yyn]);
285 if (yyssp >= yyss + yystacksize - 1)
288 + ** reallocate and recover. Note that pointers
289 + ** have to be reset, or bad things will happen
291 + int yyps_index = (yyssp - yyss);
292 + int yypv_index = (yyvsp - yyvs);
293 + yystacksize += YYSTACKSIZE;
294 + ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
295 + ysave->yyss = Renew(yyss, yystacksize, short);
296 + if (!yyvs || !yyss)
298 + yyssp = yyss + yyps_index;
299 + yyvsp = yyvs + yypv_index;
301 *++yyssp = yystate = yytable[yyn];
303 @@ -1612,14 +1581,14 @@
305 if (yyerrflag) goto yyinrecovery;
312 yyerror("syntax error");
322 @@ -1632,12 +1601,24 @@
326 - printf("yydebug: state %d, error recovery shifting\
327 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, error recovery shifting\
328 to state %d\n", *yyssp, yytable[yyn]);
330 if (yyssp >= yyss + yystacksize - 1)
333 + ** reallocate and recover. Note that pointers
334 + ** have to be reset, or bad things will happen
336 + int yyps_index = (yyssp - yyss);
337 + int yypv_index = (yyvsp - yyvs);
338 + yystacksize += YYSTACKSIZE;
339 + ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
340 + ysave->yyss = Renew(yyss, yystacksize, short);
341 + if (!yyvs || !yyss)
343 + yyssp = yyss + yyps_index;
344 + yyvsp = yyvs + yypv_index;
346 *++yyssp = yystate = yytable[yyn];
348 @@ -1647,7 +1628,7 @@
352 - printf("yydebug: error recovery discarding state %d\n",
353 + PerlIO_printf(Perl_debug_log, "yydebug: error recovery discarding state %d\n",
356 if (yyssp <= yyss) goto yyabort;
357 @@ -1665,7 +1646,7 @@
359 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
360 if (!yys) yys = "illegal-symbol";
361 - printf("yydebug: state %d, error recovery discards token %d (%s)\n",
362 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, error recovery discards token %d (%s)\n",
363 yystate, yychar, yys);
366 @@ -1675,7 +1656,7 @@
370 - printf("yydebug: state %d, reducing by rule %d (%s)\n",
371 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, reducing by rule %d (%s)\n",
372 yystate, yyn, yyrule[yyn]);
375 @@ -2550,7 +2531,7 @@
377 { yyval.opval = yyvsp[0].opval; }
379 -#line 2554 "y.tab.c"
380 +#line 2535 "perly.c"
384 @@ -2560,7 +2541,7 @@
388 - printf("yydebug: after reduction, shifting from state 0 to\
389 + PerlIO_printf(Perl_debug_log, "yydebug: after reduction, shifting from state 0 to\
390 state %d\n", YYFINAL);
393 @@ -2575,7 +2556,7 @@
395 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
396 if (!yys) yys = "illegal-symbol";
397 - printf("yydebug: state %d, reading %d (%s)\n",
398 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n",
399 YYFINAL, yychar, yys);
402 @@ -2590,20 +2571,50 @@
403 yystate = yydgoto[yym];
406 - printf("yydebug: after reduction, shifting from state %d \
407 + PerlIO_printf(Perl_debug_log, "yydebug: after reduction, shifting from state %d \
408 to state %d\n", *yyssp, yystate);
410 if (yyssp >= yyss + yystacksize - 1)
413 + ** reallocate and recover. Note that pointers
414 + ** have to be reset, or bad things will happen
416 + int yyps_index = (yyssp - yyss);
417 + int yypv_index = (yyvsp - yyvs);
418 + yystacksize += YYSTACKSIZE;
419 + ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
420 + ysave->yyss = Renew(yyss, yystacksize, short);
421 + if (!yyvs || !yyss)
423 + yyssp = yyss + yyps_index;
424 + yyvsp = yyvs + yypv_index;
430 - yyerror("yacc stack overflow");
431 + yyerror("Out of memory for yacc stack");
438 + LEAVE; /* force yydestruct() before we return */
444 +yydestruct(pTHX_ void *ptr)
446 + struct ysv* ysave = (struct ysv*)ptr;
447 + if (ysave->yyss) Safefree(ysave->yyss);
448 + if (ysave->yyvs) Safefree(ysave->yyvs);
449 + yydebug = ysave->oldyydebug;
450 + yynerrs = ysave->oldyynerrs;
451 + yyerrflag = ysave->oldyyerrflag;
452 + yychar = ysave->oldyychar;
453 + yyval = ysave->oldyyval;
454 + yylval = ysave->oldyylval;