1 --- perly.c.orig Tue Jun 19 08:39:52 2001
2 +++ perly.c Tue Jun 19 08:39:24 2001
5 -static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91";
6 +/* static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91"; */
20 -#define PRIVATEREF 262
51 -#define HASHBRACK 293
56 -#define COLONATTR 298
78 -short yylhs[] = { -1,
79 +static short yylhs[] = { -1,
80 0, 9, 7, 6, 10, 8, 11, 11, 11, 12,
81 12, 12, 12, 25, 25, 25, 25, 25, 25, 25,
82 15, 15, 15, 14, 14, 43, 43, 13, 13, 13,
84 49, 34, 34, 35, 35, 35, 44, 24, 19, 20,
85 21, 22, 23, 36, 36, 36, 36,
88 +static short yylen[] = { 2,
89 2, 4, 0, 0, 4, 0, 0, 2, 2, 2,
90 1, 2, 3, 1, 1, 3, 3, 3, 3, 3,
91 0, 2, 6, 7, 7, 0, 2, 8, 8, 10,
93 1, 0, 1, 0, 1, 2, 1, 2, 2, 2,
96 -short yydefred[] = { 4,
97 +static short yydefred[] = { 4,
98 0, 7, 0, 45, 58, 56, 0, 56, 56, 8,
99 46, 9, 11, 48, 0, 47, 49, 50, 0, 0,
100 0, 70, 71, 0, 14, 3, 173, 0, 0, 154,
102 0, 22, 0, 0, 0, 31, 5, 0, 30, 0,
105 -short yydgoto[] = { 1,
106 +static short yydgoto[] = { 1,
107 10, 11, 20, 104, 19, 2, 95, 370, 98, 359,
108 3, 12, 13, 70, 375, 285, 72, 73, 74, 75,
109 76, 77, 78, 79, 291, 81, 292, 281, 283, 286,
111 194, 327, 156, 289, 271, 225, 14, 83, 137, 84,
112 85, 86, 87, 15, 16, 17, 18, 93, 278,
114 -short yysindex[] = { 0,
115 +static short yysindex[] = { 0,
116 0, 0, -132, 0, 0, 0, -51, 0, 0, 0,
117 0, 0, 0, 0, 650, 0, 0, 0, -239, -215,
118 5, 0, 0, -215, 0, 0, 0, -31, -31, 0,
120 449, 0, 2181, -150, 340, 0, 0, 355, 0, 216,
123 -short yyrindex[] = { 0,
124 +static short yyrindex[] = { 0,
125 0, 0, 247, 0, 0, 0, 0, 0, 0, 0,
126 0, 0, 0, 0, 0, 0, 0, 0, 274, 0,
127 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
129 917, 0, 0, 119, 0, 0, 0, 0, 0, 0,
132 -short yygindex[] = { 0,
133 +static short yygindex[] = { 0,
134 0, 0, 196, 425, 0, 0, -2, 0, 37, 634,
135 -94, 0, 0, 0, -323, -15, 2445, 0, 999, 414,
136 417, 0, 0, 0, 463, -43, 0, 0, 321, -198,
138 0, 0, 0, 0, 0, 0, 0, 0, 0,
140 #define YYTABLESIZE 4568
141 -short yytable[] = { 71,
142 +static short yytable[] = { 71,
143 197, 65, 121, 227, 65, 111, 220, 22, 198, 293,
144 139, 296, 315, 275, 305, 102, 273, 88, 113, 228,
145 60, 113, 279, 65, 317, 60, 182, 254, 325, 101,
147 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
148 0, 0, 0, 0, 0, 0, 77, 77,
150 -short yycheck[] = { 15,
151 +static short yycheck[] = { 15,
152 95, 36, 46, 41, 36, 40, 59, 59, 100, 208,
153 54, 41, 59, 199, 41, 40, 196, 257, 41, 93,
154 123, 44, 202, 36, 93, 59, 40, 40, 59, 29,
155 @@ -1224,7 +1163,7 @@
157 #define YYMAXTOKEN 317
160 +static char *yyname[] = {
161 "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,
162 "'!'",0,0,"'$'","'%'","'&'",0,"'('","')'","'*'","'+'","','","'-'",0,0,0,0,0,0,0,
163 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,
164 @@ -1241,7 +1180,7 @@
165 "ANDAND","BITOROP","BITANDOP","SHIFTOP","MATCHOP","UMINUS","REFGEN","POWOP",
166 "PREINC","PREDEC","POSTINC","POSTDEC","ARROW",
169 +static char *yyrule[] = {
171 "prog : progstart lineseq",
172 "block : '{' remember lineseq '}'",
173 @@ -1456,17 +1395,6 @@
174 #define YYMAXDEPTH 500
185 -short yyss[YYSTACKSIZE];
186 -YYSTYPE yyvs[YYSTACKSIZE];
187 -#define yystacksize YYSTACKSIZE
191 @@ -1477,7 +1405,7 @@
193 #define yyparse() Perl_yyparse(pTHX)
195 -#line 1481 "y.tab.c"
196 +#line 1409 "perly.c"
197 #define YYABORT goto yyabort
198 #define YYACCEPT goto yyaccept
199 #define YYERROR goto yyerrlab
200 @@ -1485,11 +1413,31 @@
203 register int yym, yyn, yystate;
204 + register short *yyssp;
205 + register YYSTYPE *yyvsp;
208 + unsigned yystacksize = YYSTACKSIZE;
212 - extern char *getenv();
217 + ENTER; /* force yydestruct() before we return */
219 + New(73, ysave, 1, struct ysv);
220 + SAVEDESTRUCTOR_X(yydestruct, ysave);
221 + ysave->oldyydebug = yydebug;
222 + ysave->oldyynerrs = yynerrs;
223 + ysave->oldyyerrflag = yyerrflag;
224 + ysave->oldyychar = yychar;
225 + ysave->oldyyval = yyval;
226 + ysave->oldyylval = yylval;
228 - if (yys = getenv("YYDEBUG"))
230 + if ((yys = getenv("YYDEBUG")))
233 if (yyn >= '0' && yyn <= '9')
234 @@ -1501,12 +1449,22 @@
239 + ** Initialize private stacks (yyparse may be called from an action)
241 + New(73, yyss, yystacksize, short);
242 + New(73, yyvs, yystacksize, YYSTYPE);
243 + ysave->yyss = yyss;
244 + ysave->yyvs = yyvs;
245 + if (!yyvs || !yyss)
250 *yyssp = yystate = 0;
253 - if (yyn = yydefred[yystate]) goto yyreduce;
254 + if ((yyn = yydefred[yystate])) goto yyreduce;
257 if ((yychar = yylex()) < 0) yychar = 0;
258 @@ -1516,7 +1474,7 @@
260 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
261 if (!yys) yys = "illegal-symbol";
262 - printf("yydebug: state %d, reading %d (%s)\n", yystate,
263 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n", yystate,
267 @@ -1526,12 +1484,24 @@
271 - printf("yydebug: state %d, shifting to state %d\n",
272 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, shifting to state %d\n",
273 yystate, yytable[yyn]);
275 if (yyssp >= yyss + yystacksize - 1)
278 + ** reallocate and recover. Note that pointers
279 + ** have to be reset, or bad things will happen
281 + int yyps_index = (yyssp - yyss);
282 + int yypv_index = (yyvsp - yyvs);
283 + yystacksize += YYSTACKSIZE;
284 + ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
285 + ysave->yyss = Renew(yyss, yystacksize, short);
286 + if (!yyvs || !yyss)
288 + yyssp = yyss + yyps_index;
289 + yyvsp = yyvs + yypv_index;
291 *++yyssp = yystate = yytable[yyn];
293 @@ -1547,14 +1517,14 @@
295 if (yyerrflag) goto yyinrecovery;
302 yyerror("syntax error");
312 @@ -1567,12 +1537,24 @@
316 - printf("yydebug: state %d, error recovery shifting\
317 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, error recovery shifting\
318 to state %d\n", *yyssp, yytable[yyn]);
320 if (yyssp >= yyss + yystacksize - 1)
323 + ** reallocate and recover. Note that pointers
324 + ** have to be reset, or bad things will happen
326 + int yyps_index = (yyssp - yyss);
327 + int yypv_index = (yyvsp - yyvs);
328 + yystacksize += YYSTACKSIZE;
329 + ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
330 + ysave->yyss = Renew(yyss, yystacksize, short);
331 + if (!yyvs || !yyss)
333 + yyssp = yyss + yyps_index;
334 + yyvsp = yyvs + yypv_index;
336 *++yyssp = yystate = yytable[yyn];
338 @@ -1582,7 +1564,7 @@
342 - printf("yydebug: error recovery discarding state %d\n",
343 + PerlIO_printf(Perl_debug_log, "yydebug: error recovery discarding state %d\n",
346 if (yyssp <= yyss) goto yyabort;
347 @@ -1600,7 +1582,7 @@
349 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
350 if (!yys) yys = "illegal-symbol";
351 - printf("yydebug: state %d, error recovery discards token %d (%s)\n",
352 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, error recovery discards token %d (%s)\n",
353 yystate, yychar, yys);
356 @@ -1610,7 +1592,7 @@
360 - printf("yydebug: state %d, reducing by rule %d (%s)\n",
361 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, reducing by rule %d (%s)\n",
362 yystate, yyn, yyrule[yyn]);
365 @@ -2473,7 +2455,7 @@
367 { yyval.opval = yyvsp[0].opval; }
369 -#line 2477 "y.tab.c"
370 +#line 2459 "perly.c"
374 @@ -2483,7 +2465,7 @@
378 - printf("yydebug: after reduction, shifting from state 0 to\
379 + PerlIO_printf(Perl_debug_log, "yydebug: after reduction, shifting from state 0 to\
380 state %d\n", YYFINAL);
383 @@ -2498,7 +2480,7 @@
385 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
386 if (!yys) yys = "illegal-symbol";
387 - printf("yydebug: state %d, reading %d (%s)\n",
388 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n",
389 YYFINAL, yychar, yys);
392 @@ -2513,20 +2495,50 @@
393 yystate = yydgoto[yym];
396 - printf("yydebug: after reduction, shifting from state %d \
397 + PerlIO_printf(Perl_debug_log, "yydebug: after reduction, shifting from state %d \
398 to state %d\n", *yyssp, yystate);
400 if (yyssp >= yyss + yystacksize - 1)
403 + ** reallocate and recover. Note that pointers
404 + ** have to be reset, or bad things will happen
406 + int yyps_index = (yyssp - yyss);
407 + int yypv_index = (yyvsp - yyvs);
408 + yystacksize += YYSTACKSIZE;
409 + ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
410 + ysave->yyss = Renew(yyss, yystacksize, short);
411 + if (!yyvs || !yyss)
413 + yyssp = yyss + yyps_index;
414 + yyvsp = yyvs + yypv_index;
420 - yyerror("yacc stack overflow");
421 + yyerror("Out of memory for yacc stack");
428 + LEAVE; /* force yydestruct() before we return */
434 +yydestruct(pTHX_ void *ptr)
436 + struct ysv* ysave = (struct ysv*)ptr;
437 + if (ysave->yyss) Safefree(ysave->yyss);
438 + if (ysave->yyvs) Safefree(ysave->yyvs);
439 + yydebug = ysave->oldyydebug;
440 + yynerrs = ysave->oldyynerrs;
441 + yyerrflag = ysave->oldyyerrflag;
442 + yychar = ysave->oldyychar;
443 + yyval = ysave->oldyyval;
444 + yylval = ysave->oldyylval;