This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pod typos (from Gregor N. Purdy <gregor@focusresearch.com>)
[perl5.git] / perly_c.diff
CommitLineData
09bef843
SB
1*** y.tab.c.orig Thu Aug 26 22:31:26 1999
2--- y.tab.c Thu Aug 26 22:32:22 1999
93a17b20 3***************
09bef843
SB
4*** 1447,1456 ****
5 yyparse()
0da4822f
GS
6 {
7 register int yym, yyn, yystate;
8 #if YYDEBUG
9 register char *yys;
09bef843 10! extern char *getenv();
0da4822f
GS
11
12 if (yys = getenv("YYDEBUG"))
13 {
09bef843
SB
14 yyn = *yys;
15--- 1447,1473 ----
16 yyparse()
93a17b20
LW
17 {
18 register int yym, yyn, yystate;
19+ register short *yyssp;
20+ register YYSTYPE *yyvsp;
21+ short* yyss;
22+ YYSTYPE* yyvs;
23+ unsigned yystacksize = YYSTACKSIZE;
93a17b20 24+ int retval = 0;
93a17b20
LW
25 #if YYDEBUG
26 register char *yys;
09bef843
SB
27! #endif
28
8c52afec
IZ
29+ struct ysv *ysave;
30+ New(73, ysave, 1, struct ysv);
e1f15930 31+ SAVEDESTRUCTOR_X(yydestruct, ysave);
a0d0e21e
LW
32+ ysave->oldyydebug = yydebug;
33+ ysave->oldyynerrs = yynerrs;
34+ ysave->oldyyerrflag = yyerrflag;
35+ ysave->oldyychar = yychar;
36+ ysave->oldyyval = yyval;
37+ ysave->oldyylval = yylval;
09bef843 38+
a0d0e21e
LW
39+ #if YYDEBUG
40 if (yys = getenv("YYDEBUG"))
41 {
09bef843 42 yyn = *yys;
93a17b20 43***************
09bef843
SB
44*** 1463,1468 ****
45--- 1480,1495 ----
46 yyerrflag = 0;
93a17b20
LW
47 yychar = (-1);
48
49+ /*
50+ ** Initialize private stacks (yyparse may be called from an action)
51+ */
8c52afec
IZ
52+ New(73, yyss, yystacksize, short);
53+ New(73, yyvs, yystacksize, YYSTYPE);
54+ ysave->yyss = yyss;
55+ ysave->yyvs = yyvs;
93a17b20
LW
56+ if (!yyvs || !yyss)
57+ goto yyoverflow;
58+
59 yyssp = yyss;
60 yyvsp = yyvs;
09bef843 61 *yyssp = yystate = 0;
93a17b20 62***************
09bef843 63*** 1493,1499 ****
93a17b20 64 #endif
9d116dd7
JH
65 if (yyssp >= yyss + yystacksize - 1)
66 {
67! goto yyoverflow;
68 }
69 *++yyssp = yystate = yytable[yyn];
09bef843
SB
70 *++yyvsp = yylval;
71--- 1520,1538 ----
d3b6f988 72 #endif
93a17b20
LW
73 if (yyssp >= yyss + yystacksize - 1)
74 {
75! /*
76! ** reallocate and recover. Note that pointers
77! ** have to be reset, or bad things will happen
78! */
79! int yyps_index = (yyssp - yyss);
80! int yypv_index = (yyvsp - yyvs);
81! yystacksize += YYSTACKSIZE;
09bef843
SB
82! ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
83! ysave->yyss = Renew(yyss, yystacksize, short);
93a17b20
LW
84! if (!yyvs || !yyss)
85! goto yyoverflow;
86! yyssp = yyss + yyps_index;
87! yyvsp = yyvs + yypv_index;
88 }
89 *++yyssp = yystate = yytable[yyn];
09bef843 90 *++yyvsp = yylval;
93a17b20 91***************
09bef843 92*** 1534,1540 ****
93a17b20
LW
93 #endif
94 if (yyssp >= yyss + yystacksize - 1)
95 {
96! goto yyoverflow;
97 }
98 *++yyssp = yystate = yytable[yyn];
09bef843
SB
99 *++yyvsp = yylval;
100--- 1573,1591 ----
93a17b20
LW
101 #endif
102 if (yyssp >= yyss + yystacksize - 1)
103 {
104! /*
105! ** reallocate and recover. Note that pointers
106! ** have to be reset, or bad things will happen
107! */
108! int yyps_index = (yyssp - yyss);
109! int yypv_index = (yyvsp - yyvs);
110! yystacksize += YYSTACKSIZE;
09bef843
SB
111! ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
112! ysave->yyss = Renew(yyss, yystacksize, short);
93a17b20
LW
113! if (!yyvs || !yyss)
114! goto yyoverflow;
115! yyssp = yyss + yyps_index;
116! yyvsp = yyvs + yypv_index;
117 }
118 *++yyssp = yystate = yytable[yyn];
09bef843 119 *++yyvsp = yylval;
93a17b20 120***************
09bef843 121*** 2473,2487 ****
93a17b20
LW
122 #endif
123 if (yyssp >= yyss + yystacksize - 1)
124 {
125! goto yyoverflow;
126 }
127 *++yyssp = yystate;
09bef843
SB
128 *++yyvsp = yyval;
129 goto yyloop;
130 yyoverflow:
131! yyerror("yacc stack overflow");
132 yyabort:
133! return (1);
134 yyaccept:
135! return (0);
136 }
d20626d8 137--- 2524,2569 ----
93a17b20
LW
138 #endif
139 if (yyssp >= yyss + yystacksize - 1)
140 {
141! /*
142! ** reallocate and recover. Note that pointers
143! ** have to be reset, or bad things will happen
144! */
145! int yyps_index = (yyssp - yyss);
146! int yypv_index = (yyvsp - yyvs);
147! yystacksize += YYSTACKSIZE;
09bef843
SB
148! ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
149! ysave->yyss = Renew(yyss, yystacksize, short);
93a17b20
LW
150! if (!yyvs || !yyss)
151! goto yyoverflow;
152! yyssp = yyss + yyps_index;
153! yyvsp = yyvs + yypv_index;
154 }
155 *++yyssp = yystate;
09bef843 156 *++yyvsp = yyval;
93a17b20
LW
157 goto yyloop;
158 yyoverflow:
159! yyerror("Out of memory for yacc stack");
160 yyabort:
161! retval = 1;
162 yyaccept:
93a17b20 163! return retval;
e1f15930
GS
164! }
165!
166! #ifdef PERL_OBJECT
e1f15930
GS
167! #include "XSUB.h"
168! #endif
169!
170! static void
171! yydestruct(pTHXo_ void *ptr)
172! {
173! struct ysv* ysave = (struct ysv*)ptr;
174! if (ysave->yyss) Safefree(ysave->yyss);
175! if (ysave->yyvs) Safefree(ysave->yyvs);
176! yydebug = ysave->oldyydebug;
177! yynerrs = ysave->oldyynerrs;
178! yyerrflag = ysave->oldyyerrflag;
179! yychar = ysave->oldyychar;
180! yyval = ysave->oldyyval;
181! yylval = ysave->oldyylval;
182! Safefree(ysave);
93a17b20 183 }