1 --- perly.c.orig Sun Jun 10 21:13:50 2001
2 +++ perly.c Sun Jun 10 21:13:51 2001
13 -#define PRIVATEREF 262
44 -#define HASHBRACK 293
49 -#define COLONATTR 298
71 -short yylhs[] = { -1,
72 +static short yylhs[] = { -1,
73 54, 0, 8, 6, 9, 7, 10, 10, 10, 11,
74 11, 11, 11, 24, 24, 24, 24, 24, 24, 24,
75 14, 14, 14, 13, 13, 42, 42, 12, 12, 12,
77 48, 33, 33, 34, 34, 34, 43, 23, 18, 19,
78 20, 21, 22, 35, 35, 35, 35,
81 +static short yylen[] = { 2,
82 0, 2, 4, 0, 4, 0, 0, 2, 2, 2,
83 1, 2, 3, 1, 1, 3, 3, 3, 3, 3,
84 0, 2, 6, 7, 7, 0, 2, 8, 8, 10,
86 1, 0, 1, 0, 1, 2, 1, 2, 2, 2,
89 -short yydefred[] = { 1,
90 +static short yydefred[] = { 1,
91 0, 7, 0, 45, 58, 56, 0, 56, 56, 8,
92 46, 9, 11, 48, 0, 47, 49, 50, 0, 0,
93 0, 70, 71, 0, 14, 4, 173, 0, 0, 154,
95 0, 22, 0, 0, 0, 31, 5, 0, 30, 0,
98 -short yydgoto[] = { 1,
99 +static short yydgoto[] = { 1,
100 10, 11, 20, 104, 19, 95, 370, 98, 359, 3,
101 12, 13, 70, 375, 285, 72, 73, 74, 75, 76,
102 77, 78, 79, 291, 81, 292, 281, 283, 286, 294,
104 327, 156, 289, 271, 225, 14, 83, 137, 84, 85,
105 86, 87, 15, 2, 16, 17, 18, 93, 278,
107 -short yysindex[] = { 0,
108 +static short yysindex[] = { 0,
109 0, 0, -132, 0, 0, 0, -51, 0, 0, 0,
110 0, 0, 0, 0, 650, 0, 0, 0, -239, -215,
111 5, 0, 0, -215, 0, 0, 0, -31, -31, 0,
113 449, 0, 2181, -150, 340, 0, 0, 355, 0, 216,
116 -short yyrindex[] = { 0,
117 +static short yyrindex[] = { 0,
118 0, 0, 247, 0, 0, 0, 0, 0, 0, 0,
119 0, 0, 0, 0, 0, 0, 0, 0, 274, 0,
120 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
122 917, 0, 0, 119, 0, 0, 0, 0, 0, 0,
125 -short yygindex[] = { 0,
126 +static short yygindex[] = { 0,
127 0, 0, 196, 425, 0, -2, 0, 37, 634, -94,
128 0, 0, 0, -323, -15, 2445, 0, 999, 414, 417,
129 0, 0, 0, 463, -43, 0, 0, 321, -198, 103,
131 0, 0, 0, 0, 0, 0, 0, 0, 0,
133 #define YYTABLESIZE 4568
134 -short yytable[] = { 71,
135 +static short yytable[] = { 71,
136 197, 65, 121, 227, 65, 111, 220, 22, 198, 293,
137 139, 296, 315, 275, 305, 102, 273, 88, 113, 228,
138 60, 113, 279, 65, 317, 60, 182, 254, 325, 101,
140 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
141 0, 0, 0, 0, 0, 0, 77, 77,
143 -short yycheck[] = { 15,
144 +static short yycheck[] = { 15,
145 95, 36, 46, 41, 36, 40, 59, 59, 100, 208,
146 54, 41, 59, 199, 41, 40, 196, 257, 41, 93,
147 123, 44, 202, 36, 93, 59, 40, 40, 59, 29,
148 @@ -1224,7 +1163,7 @@
150 #define YYMAXTOKEN 317
153 +static char *yyname[] = {
154 "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,
155 "'!'",0,0,"'$'","'%'","'&'",0,"'('","')'","'*'","'+'","','","'-'",0,0,0,0,0,0,0,
156 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,
157 @@ -1241,7 +1180,7 @@
158 "ANDAND","BITOROP","BITANDOP","SHIFTOP","MATCHOP","UMINUS","REFGEN","POWOP",
159 "PREINC","PREDEC","POSTINC","POSTDEC","ARROW",
162 +static char *yyrule[] = {
165 "prog : $$1 lineseq",
166 @@ -1456,17 +1395,6 @@
167 #define YYMAXDEPTH 500
178 -short yyss[YYSTACKSIZE];
179 -YYSTYPE yyvs[YYSTACKSIZE];
180 -#define yystacksize YYSTACKSIZE
184 @@ -1477,7 +1405,7 @@
186 #define yyparse() Perl_yyparse(pTHX)
188 -#line 1481 "y.tab.c"
189 +#line 1481 "perly.c"
190 #define YYABORT goto yyabort
191 #define YYACCEPT goto yyaccept
192 #define YYERROR goto yyerrlab
193 @@ -1485,10 +1413,30 @@
196 register int yym, yyn, yystate;
197 + register short *yyssp;
198 + register YYSTYPE *yyvsp;
201 + unsigned yystacksize = YYSTACKSIZE;
205 - extern char *getenv();
210 + ENTER; /* force yydestruct() before we return */
212 + New(73, ysave, 1, struct ysv);
213 + SAVEDESTRUCTOR_X(yydestruct, ysave);
214 + ysave->oldyydebug = yydebug;
215 + ysave->oldyynerrs = yynerrs;
216 + ysave->oldyyerrflag = yyerrflag;
217 + ysave->oldyychar = yychar;
218 + ysave->oldyyval = yyval;
219 + ysave->oldyylval = yylval;
222 if (yys = getenv("YYDEBUG"))
225 @@ -1501,6 +1449,16 @@
230 + ** Initialize private stacks (yyparse may be called from an action)
232 + New(73, yyss, yystacksize, short);
233 + New(73, yyvs, yystacksize, YYSTYPE);
234 + ysave->yyss = yyss;
235 + ysave->yyvs = yyvs;
236 + if (!yyvs || !yyss)
241 *yyssp = yystate = 0;
242 @@ -1516,7 +1474,7 @@
244 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
245 if (!yys) yys = "illegal-symbol";
246 - printf("yydebug: state %d, reading %d (%s)\n", yystate,
247 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n", yystate,
251 @@ -1526,12 +1484,24 @@
255 - printf("yydebug: state %d, shifting to state %d\n",
256 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, shifting to state %d\n",
257 yystate, yytable[yyn]);
259 if (yyssp >= yyss + yystacksize - 1)
263 + ** reallocate and recover. Note that pointers
264 + ** have to be reset, or bad things will happen
266 + int yyps_index = (yyssp - yyss);
267 + int yypv_index = (yyvsp - yyvs);
268 + yystacksize += YYSTACKSIZE;
269 + ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
270 + ysave->yyss = Renew(yyss, yystacksize, short);
271 + if (!yyvs || !yyss)
273 + yyssp = yyss + yyps_index;
274 + yyvsp = yyvs + yypv_index;
276 *++yyssp = yystate = yytable[yyn];
278 @@ -1549,12 +1519,12 @@
284 yyerror("syntax error");
293 @@ -1567,12 +1537,24 @@
297 - printf("yydebug: state %d, error recovery shifting\
298 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, error recovery shifting\
299 to state %d\n", *yyssp, yytable[yyn]);
301 if (yyssp >= yyss + yystacksize - 1)
305 + ** reallocate and recover. Note that pointers
306 + ** have to be reset, or bad things will happen
308 + int yyps_index = (yyssp - yyss);
309 + int yypv_index = (yyvsp - yyvs);
310 + yystacksize += YYSTACKSIZE;
311 + ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
312 + ysave->yyss = Renew(yyss, yystacksize, short);
313 + if (!yyvs || !yyss)
315 + yyssp = yyss + yyps_index;
316 + yyvsp = yyvs + yypv_index;
318 *++yyssp = yystate = yytable[yyn];
320 @@ -1582,7 +1564,7 @@
324 - printf("yydebug: error recovery discarding state %d\n",
325 + PerlIO_printf(Perl_debug_log, "yydebug: error recovery discarding state %d\n",
328 if (yyssp <= yyss) goto yyabort;
329 @@ -1600,7 +1582,7 @@
331 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
332 if (!yys) yys = "illegal-symbol";
333 - printf("yydebug: state %d, error recovery discards token %d (%s)\n",
334 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, error recovery discards token %d (%s)\n",
335 yystate, yychar, yys);
338 @@ -1610,7 +1592,7 @@
342 - printf("yydebug: state %d, reducing by rule %d (%s)\n",
343 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, reducing by rule %d (%s)\n",
344 yystate, yyn, yyrule[yyn]);
347 @@ -2473,7 +2455,7 @@
349 { yyval.opval = yyvsp[0].opval; }
351 -#line 2477 "y.tab.c"
352 +#line 2477 "perly.c"
356 @@ -2483,7 +2465,7 @@
360 - printf("yydebug: after reduction, shifting from state 0 to\
361 + PerlIO_printf(Perl_debug_log, "yydebug: after reduction, shifting from state 0 to\
362 state %d\n", YYFINAL);
365 @@ -2498,7 +2480,7 @@
367 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
368 if (!yys) yys = "illegal-symbol";
369 - printf("yydebug: state %d, reading %d (%s)\n",
370 + PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n",
371 YYFINAL, yychar, yys);
374 @@ -2513,20 +2495,54 @@
375 yystate = yydgoto[yym];
378 - printf("yydebug: after reduction, shifting from state %d \
379 + PerlIO_printf(Perl_debug_log, "yydebug: after reduction, shifting from state %d \
380 to state %d\n", *yyssp, yystate);
382 if (yyssp >= yyss + yystacksize - 1)
386 + ** reallocate and recover. Note that pointers
387 + ** have to be reset, or bad things will happen
389 + int yyps_index = (yyssp - yyss);
390 + int yypv_index = (yyvsp - yyvs);
391 + yystacksize += YYSTACKSIZE;
392 + ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
393 + ysave->yyss = Renew(yyss, yystacksize, short);
394 + if (!yyvs || !yyss)
396 + yyssp = yyss + yyps_index;
397 + yyvsp = yyvs + yypv_index;
403 - yyerror("yacc stack overflow");
404 + yyerror("Out of memory for yacc stack");
411 + LEAVE; /* force yydestruct() before we return */
421 +yydestruct(pTHXo_ void *ptr)
423 + struct ysv* ysave = (struct ysv*)ptr;
424 + if (ysave->yyss) Safefree(ysave->yyss);
425 + if (ysave->yyvs) Safefree(ysave->yyvs);
426 + yydebug = ysave->oldyydebug;
427 + yynerrs = ysave->oldyynerrs;
428 + yyerrflag = ysave->oldyyerrflag;
429 + yychar = ysave->oldyychar;
430 + yyval = ysave->oldyyval;
431 + yylval = ysave->oldyylval;