1 *** perly.c.orig Mon Feb 14 14:24:43 1994
2 --- perly.c Mon Feb 14 14:24:44 1994
12 - short yyss[YYSTACKSIZE];
13 - YYSTYPE yyvs[YYSTACKSIZE];
14 - #define yystacksize YYSTACKSIZE
24 register int yym, yyn, yystate;
25 + register short *yyssp;
26 + register YYSTYPE *yyvsp;
29 + unsigned yystacksize = YYSTACKSIZE;
30 + int oldyydebug = yydebug;
31 + int oldyynerrs = yynerrs;
32 + int oldyyerrflag = yyerrflag;
33 + int oldyychar = yychar;
34 + YYSTYPE oldyyval = yyval;
35 + YYSTYPE oldyylval = yylval;
40 extern char *getenv();
48 + ** Initialize private stacks (yyparse may be called from an action)
50 + yyss = (short*)malloc(yystacksize*sizeof(short));
51 + yyvs = (YYSTYPE*)malloc(yystacksize*sizeof(YYSTYPE));
61 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
62 if (!yys) yys = "illegal-symbol";
63 ! printf("yydebug: state %d, reading %d (%s)\n", yystate,
69 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
70 if (!yys) yys = "illegal-symbol";
71 ! fprintf(stderr, "yydebug: state %d, reading %d (%s)\n", yystate,
80 ! printf("yydebug: state %d, shifting to state %d\n",
81 yystate, yytable[yyn]);
83 if (yyssp >= yyss + yystacksize - 1)
87 *++yyssp = yystate = yytable[yyn];
93 ! fprintf(stderr, "yydebug: state %d, shifting to state %d\n",
94 yystate, yytable[yyn]);
96 if (yyssp >= yyss + yystacksize - 1)
99 ! ** reallocate and recover. Note that pointers
100 ! ** have to be reset, or bad things will happen
102 ! int yyps_index = (yyssp - yyss);
103 ! int yypv_index = (yyvsp - yyvs);
104 ! yystacksize += YYSTACKSIZE;
105 ! yyvs = (YYSTYPE*)realloc((char*)yyvs,yystacksize * sizeof(YYSTYPE));
106 ! yyss = (short*)realloc((char*)yyss,yystacksize * sizeof(short));
107 ! if (!yyvs || !yyss)
109 ! yyssp = yyss + yyps_index;
110 ! yyvsp = yyvs + yypv_index;
112 *++yyssp = yystate = yytable[yyn];
119 ! printf("yydebug: state %d, error recovery shifting\
120 ! to state %d\n", *yyssp, yytable[yyn]);
122 if (yyssp >= yyss + yystacksize - 1)
126 *++yyssp = yystate = yytable[yyn];
133 ! "yydebug: state %d, error recovery shifting to state %d\n",
134 ! *yyssp, yytable[yyn]);
136 if (yyssp >= yyss + yystacksize - 1)
139 ! ** reallocate and recover. Note that pointers
140 ! ** have to be reset, or bad things will happen
142 ! int yyps_index = (yyssp - yyss);
143 ! int yypv_index = (yyvsp - yyvs);
144 ! yystacksize += YYSTACKSIZE;
145 ! yyvs = (YYSTYPE*)realloc((char*)yyvs,
146 ! yystacksize * sizeof(YYSTYPE));
147 ! yyss = (short*)realloc((char*)yyss,
148 ! yystacksize * sizeof(short));
149 ! if (!yyvs || !yyss)
151 ! yyssp = yyss + yyps_index;
152 ! yyvsp = yyvs + yypv_index;
154 *++yyssp = yystate = yytable[yyn];
161 ! printf("yydebug: error recovery discarding state %d\n",
164 if (yyssp <= yyss) goto yyabort;
171 ! "yydebug: error recovery discarding state %d\n",
174 if (yyssp <= yyss) goto yyabort;
179 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
180 if (!yys) yys = "illegal-symbol";
181 ! printf("yydebug: state %d, error recovery discards token %d (%s)\n",
182 ! yystate, yychar, yys);
188 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
189 if (!yys) yys = "illegal-symbol";
191 ! "yydebug: state %d, error recovery discards token %d (%s)\n",
192 ! yystate, yychar, yys);
201 ! printf("yydebug: state %d, reducing by rule %d (%s)\n",
202 yystate, yyn, yyrule[yyn]);
209 ! fprintf(stderr, "yydebug: state %d, reducing by rule %d (%s)\n",
210 yystate, yyn, yyrule[yyn]);
218 ! printf("yydebug: after reduction, shifting from state 0 to\
219 ! state %d\n", YYFINAL);
228 ! "yydebug: after reduction, shifting from state 0 to state %d\n",
236 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
237 if (!yys) yys = "illegal-symbol";
238 ! printf("yydebug: state %d, reading %d (%s)\n",
239 YYFINAL, yychar, yys);
244 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
245 if (!yys) yys = "illegal-symbol";
246 ! fprintf(stderr, "yydebug: state %d, reading %d (%s)\n",
247 YYFINAL, yychar, yys);
252 yystate = yydgoto[yym];
255 ! printf("yydebug: after reduction, shifting from state %d \
256 ! to state %d\n", *yyssp, yystate);
258 if (yyssp >= yyss + yystacksize - 1)
266 ! yyerror("yacc stack overflow");
273 yystate = yydgoto[yym];
277 ! "yydebug: after reduction, shifting from state %d to state %d\n",
280 if (yyssp >= yyss + yystacksize - 1)
283 ! ** reallocate and recover. Note that pointers
284 ! ** have to be reset, or bad things will happen
286 ! int yyps_index = (yyssp - yyss);
287 ! int yypv_index = (yyvsp - yyvs);
288 ! yystacksize += YYSTACKSIZE;
289 ! yyvs = (YYSTYPE*)realloc((char*)yyvs,yystacksize * sizeof(YYSTYPE));
290 ! yyss = (short*)realloc((char*)yyss,yystacksize * sizeof(short));
291 ! if (!yyvs || !yyss)
293 ! yyssp = yyss + yyps_index;
294 ! yyvsp = yyvs + yypv_index;
300 ! yyerror("Out of memory for yacc stack");
304 ! if (yyss) free(yyss);
305 ! if (yyvs) free(yyvs);
306 ! yydebug = oldyydebug;
307 ! yynerrs = oldyynerrs;
308 ! yyerrflag = oldyyerrflag;
309 ! yychar = oldyychar;
311 ! yylval = oldyylval;