| 1 | Index: perly.c |
| 2 | *** perly.c.old Wed Jun 10 03:48:43 1998 |
| 3 | --- perly.c Wed Jun 10 03:55:10 1998 |
| 4 | *************** |
| 5 | *** 7,10 **** |
| 6 | --- 7,18 ---- |
| 7 | #include "perl.h" |
| 8 | |
| 9 | + #ifdef PERL_OBJECT |
| 10 | + static void |
| 11 | + Dep(CPerlObj *pPerl) |
| 12 | + { |
| 13 | + pPerl->deprecate("\"do\" to call subroutines"); |
| 14 | + } |
| 15 | + #define dep() Dep(this) |
| 16 | + #else |
| 17 | static void |
| 18 | dep(void) |
| 19 | *************** |
| 20 | *** 12,82 **** |
| 21 | deprecate("\"do\" to call subroutines"); |
| 22 | } |
| 23 | |
| 24 | ! #line 29 "perly.y" |
| 25 | ! typedef union { |
| 26 | ! I32 ival; |
| 27 | ! char *pval; |
| 28 | ! OP *opval; |
| 29 | ! GV *gvval; |
| 30 | ! } YYSTYPE; |
| 31 | ! #line 23 "y.tab.c" |
| 32 | ! #define WORD 257 |
| 33 | ! #define METHOD 258 |
| 34 | ! #define FUNCMETH 259 |
| 35 | ! #define THING 260 |
| 36 | ! #define PMFUNC 261 |
| 37 | ! #define PRIVATEREF 262 |
| 38 | ! #define FUNC0SUB 263 |
| 39 | ! #define UNIOPSUB 264 |
| 40 | ! #define LSTOPSUB 265 |
| 41 | ! #define LABEL 266 |
| 42 | ! #define FORMAT 267 |
| 43 | ! #define SUB 268 |
| 44 | ! #define ANONSUB 269 |
| 45 | ! #define PACKAGE 270 |
| 46 | ! #define USE 271 |
| 47 | ! #define WHILE 272 |
| 48 | ! #define UNTIL 273 |
| 49 | ! #define IF 274 |
| 50 | ! #define UNLESS 275 |
| 51 | ! #define ELSE 276 |
| 52 | ! #define ELSIF 277 |
| 53 | ! #define CONTINUE 278 |
| 54 | ! #define FOR 279 |
| 55 | ! #define LOOPEX 280 |
| 56 | ! #define DOTDOT 281 |
| 57 | ! #define FUNC0 282 |
| 58 | ! #define FUNC1 283 |
| 59 | ! #define FUNC 284 |
| 60 | ! #define UNIOP 285 |
| 61 | ! #define LSTOP 286 |
| 62 | ! #define RELOP 287 |
| 63 | ! #define EQOP 288 |
| 64 | ! #define MULOP 289 |
| 65 | ! #define ADDOP 290 |
| 66 | ! #define DOLSHARP 291 |
| 67 | ! #define DO 292 |
| 68 | ! #define HASHBRACK 293 |
| 69 | ! #define NOAMP 294 |
| 70 | ! #define LOCAL 295 |
| 71 | ! #define MY 296 |
| 72 | ! #define OROP 297 |
| 73 | ! #define ANDOP 298 |
| 74 | ! #define NOTOP 299 |
| 75 | ! #define ASSIGNOP 300 |
| 76 | ! #define OROR 301 |
| 77 | ! #define ANDAND 302 |
| 78 | ! #define BITOROP 303 |
| 79 | ! #define BITANDOP 304 |
| 80 | ! #define SHIFTOP 305 |
| 81 | ! #define MATCHOP 306 |
| 82 | ! #define UMINUS 307 |
| 83 | ! #define REFGEN 308 |
| 84 | ! #define POWOP 309 |
| 85 | ! #define PREINC 310 |
| 86 | ! #define PREDEC 311 |
| 87 | ! #define POSTINC 312 |
| 88 | ! #define POSTDEC 313 |
| 89 | ! #define ARROW 314 |
| 90 | #define YYERRCODE 256 |
| 91 | short yylhs[] = { -1, |
| 92 | --- 20,26 ---- |
| 93 | deprecate("\"do\" to call subroutines"); |
| 94 | } |
| 95 | + #endif |
| 96 | |
| 97 | ! #line 16 "perly.c" |
| 98 | #define YYERRCODE 256 |
| 99 | short yylhs[] = { -1, |
| 100 | *************** |
| 101 | *** 1337,1361 **** |
| 102 | int yyerrflag; |
| 103 | int yychar; |
| 104 | - short *yyssp; |
| 105 | - YYSTYPE *yyvsp; |
| 106 | YYSTYPE yyval; |
| 107 | YYSTYPE yylval; |
| 108 | - short yyss[YYSTACKSIZE]; |
| 109 | - YYSTYPE yyvs[YYSTACKSIZE]; |
| 110 | - #define yystacksize YYSTACKSIZE |
| 111 | #line 635 "perly.y" |
| 112 | /* PROGRAM */ |
| 113 | ! #line 1349 "y.tab.c" |
| 114 | #define YYABORT goto yyabort |
| 115 | #define YYACCEPT goto yyaccept |
| 116 | #define YYERROR goto yyerrlab |
| 117 | int |
| 118 | ! yyparse() |
| 119 | { |
| 120 | register int yym, yyn, yystate; |
| 121 | #if YYDEBUG |
| 122 | register char *yys; |
| 123 | extern char *getenv(); |
| 124 | |
| 125 | if (yys = getenv("YYDEBUG")) |
| 126 | { |
| 127 | --- 1281,1347 ---- |
| 128 | int yyerrflag; |
| 129 | int yychar; |
| 130 | YYSTYPE yyval; |
| 131 | YYSTYPE yylval; |
| 132 | #line 635 "perly.y" |
| 133 | /* PROGRAM */ |
| 134 | ! #line 1349 "perly.c" |
| 135 | #define YYABORT goto yyabort |
| 136 | #define YYACCEPT goto yyaccept |
| 137 | #define YYERROR goto yyerrlab |
| 138 | + |
| 139 | + struct ysv { |
| 140 | + short* yyss; |
| 141 | + YYSTYPE* yyvs; |
| 142 | + int oldyydebug; |
| 143 | + int oldyynerrs; |
| 144 | + int oldyyerrflag; |
| 145 | + int oldyychar; |
| 146 | + YYSTYPE oldyyval; |
| 147 | + YYSTYPE oldyylval; |
| 148 | + }; |
| 149 | + |
| 150 | + void |
| 151 | + yydestruct(void *ptr) |
| 152 | + { |
| 153 | + struct ysv* ysave = (struct ysv*)ptr; |
| 154 | + if (ysave->yyss) Safefree(ysave->yyss); |
| 155 | + if (ysave->yyvs) Safefree(ysave->yyvs); |
| 156 | + yydebug = ysave->oldyydebug; |
| 157 | + yynerrs = ysave->oldyynerrs; |
| 158 | + yyerrflag = ysave->oldyyerrflag; |
| 159 | + yychar = ysave->oldyychar; |
| 160 | + yyval = ysave->oldyyval; |
| 161 | + yylval = ysave->oldyylval; |
| 162 | + Safefree(ysave); |
| 163 | + } |
| 164 | + |
| 165 | int |
| 166 | ! yyparse(void) |
| 167 | { |
| 168 | register int yym, yyn, yystate; |
| 169 | + register short *yyssp; |
| 170 | + register YYSTYPE *yyvsp; |
| 171 | + short* yyss; |
| 172 | + YYSTYPE* yyvs; |
| 173 | + unsigned yystacksize = YYSTACKSIZE; |
| 174 | + int retval = 0; |
| 175 | #if YYDEBUG |
| 176 | register char *yys; |
| 177 | + #ifndef __cplusplus |
| 178 | extern char *getenv(); |
| 179 | + #endif |
| 180 | + #endif |
| 181 | + |
| 182 | + struct ysv *ysave; |
| 183 | + New(73, ysave, 1, struct ysv); |
| 184 | + SAVEDESTRUCTOR(yydestruct, ysave); |
| 185 | + ysave->oldyydebug = yydebug; |
| 186 | + ysave->oldyynerrs = yynerrs; |
| 187 | + ysave->oldyyerrflag = yyerrflag; |
| 188 | + ysave->oldyychar = yychar; |
| 189 | + ysave->oldyyval = yyval; |
| 190 | + ysave->oldyylval = yylval; |
| 191 | |
| 192 | + #if YYDEBUG |
| 193 | if (yys = getenv("YYDEBUG")) |
| 194 | { |
| 195 | *************** |
| 196 | *** 1370,1373 **** |
| 197 | --- 1356,1369 ---- |
| 198 | yychar = (-1); |
| 199 | |
| 200 | + /* |
| 201 | + ** Initialize private stacks (yyparse may be called from an action) |
| 202 | + */ |
| 203 | + New(73, yyss, yystacksize, short); |
| 204 | + New(73, yyvs, yystacksize, YYSTYPE); |
| 205 | + ysave->yyss = yyss; |
| 206 | + ysave->yyvs = yyvs; |
| 207 | + if (!yyvs || !yyss) |
| 208 | + goto yyoverflow; |
| 209 | + |
| 210 | yyssp = yyss; |
| 211 | yyvsp = yyvs; |
| 212 | *************** |
| 213 | *** 1385,1389 **** |
| 214 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
| 215 | if (!yys) yys = "illegal-symbol"; |
| 216 | ! printf("yydebug: state %d, reading %d (%s)\n", yystate, |
| 217 | yychar, yys); |
| 218 | } |
| 219 | --- 1381,1385 ---- |
| 220 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
| 221 | if (!yys) yys = "illegal-symbol"; |
| 222 | ! PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n", yystate, |
| 223 | yychar, yys); |
| 224 | } |
| 225 | *************** |
| 226 | *** 1395,1404 **** |
| 227 | #if YYDEBUG |
| 228 | if (yydebug) |
| 229 | ! printf("yydebug: state %d, shifting to state %d\n", |
| 230 | yystate, yytable[yyn]); |
| 231 | #endif |
| 232 | if (yyssp >= yyss + yystacksize - 1) |
| 233 | { |
| 234 | ! goto yyoverflow; |
| 235 | } |
| 236 | *++yyssp = yystate = yytable[yyn]; |
| 237 | --- 1391,1414 ---- |
| 238 | #if YYDEBUG |
| 239 | if (yydebug) |
| 240 | ! PerlIO_printf(Perl_debug_log, "yydebug: state %d, shifting to state %d\n", |
| 241 | yystate, yytable[yyn]); |
| 242 | #endif |
| 243 | if (yyssp >= yyss + yystacksize - 1) |
| 244 | { |
| 245 | ! /* |
| 246 | ! ** reallocate and recover. Note that pointers |
| 247 | ! ** have to be reset, or bad things will happen |
| 248 | ! */ |
| 249 | ! int yyps_index = (yyssp - yyss); |
| 250 | ! int yypv_index = (yyvsp - yyvs); |
| 251 | ! yystacksize += YYSTACKSIZE; |
| 252 | ! ysave->yyvs = yyvs = |
| 253 | ! (YYSTYPE*)realloc((char*)yyvs,yystacksize * sizeof(YYSTYPE)); |
| 254 | ! ysave->yyss = yyss = |
| 255 | ! (short*)realloc((char*)yyss,yystacksize * sizeof(short)); |
| 256 | ! if (!yyvs || !yyss) |
| 257 | ! goto yyoverflow; |
| 258 | ! yyssp = yyss + yyps_index; |
| 259 | ! yyvsp = yyvs + yypv_index; |
| 260 | } |
| 261 | *++yyssp = yystate = yytable[yyn]; |
| 262 | *************** |
| 263 | *** 1436,1445 **** |
| 264 | #if YYDEBUG |
| 265 | if (yydebug) |
| 266 | ! printf("yydebug: state %d, error recovery shifting\ |
| 267 | ! to state %d\n", *yyssp, yytable[yyn]); |
| 268 | #endif |
| 269 | if (yyssp >= yyss + yystacksize - 1) |
| 270 | { |
| 271 | ! goto yyoverflow; |
| 272 | } |
| 273 | *++yyssp = yystate = yytable[yyn]; |
| 274 | --- 1446,1470 ---- |
| 275 | #if YYDEBUG |
| 276 | if (yydebug) |
| 277 | ! PerlIO_printf(Perl_debug_log, |
| 278 | ! "yydebug: state %d, error recovery shifting to state %d\n", |
| 279 | ! *yyssp, yytable[yyn]); |
| 280 | #endif |
| 281 | if (yyssp >= yyss + yystacksize - 1) |
| 282 | { |
| 283 | ! /* |
| 284 | ! ** reallocate and recover. Note that pointers |
| 285 | ! ** have to be reset, or bad things will happen |
| 286 | ! */ |
| 287 | ! int yyps_index = (yyssp - yyss); |
| 288 | ! int yypv_index = (yyvsp - yyvs); |
| 289 | ! yystacksize += YYSTACKSIZE; |
| 290 | ! ysave->yyvs = yyvs = (YYSTYPE*)realloc((char*)yyvs, |
| 291 | ! yystacksize * sizeof(YYSTYPE)); |
| 292 | ! ysave->yyss = yyss = (short*)realloc((char*)yyss, |
| 293 | ! yystacksize * sizeof(short)); |
| 294 | ! if (!yyvs || !yyss) |
| 295 | ! goto yyoverflow; |
| 296 | ! yyssp = yyss + yyps_index; |
| 297 | ! yyvsp = yyvs + yypv_index; |
| 298 | } |
| 299 | *++yyssp = yystate = yytable[yyn]; |
| 300 | *************** |
| 301 | *** 1451,1456 **** |
| 302 | #if YYDEBUG |
| 303 | if (yydebug) |
| 304 | ! printf("yydebug: error recovery discarding state %d\n", |
| 305 | ! *yyssp); |
| 306 | #endif |
| 307 | if (yyssp <= yyss) goto yyabort; |
| 308 | --- 1476,1482 ---- |
| 309 | #if YYDEBUG |
| 310 | if (yydebug) |
| 311 | ! PerlIO_printf(Perl_debug_log, |
| 312 | ! "yydebug: error recovery discarding state %d\n", |
| 313 | ! *yyssp); |
| 314 | #endif |
| 315 | if (yyssp <= yyss) goto yyabort; |
| 316 | *************** |
| 317 | *** 1469,1474 **** |
| 318 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
| 319 | if (!yys) yys = "illegal-symbol"; |
| 320 | ! printf("yydebug: state %d, error recovery discards token %d (%s)\n", |
| 321 | ! yystate, yychar, yys); |
| 322 | } |
| 323 | #endif |
| 324 | --- 1495,1501 ---- |
| 325 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
| 326 | if (!yys) yys = "illegal-symbol"; |
| 327 | ! PerlIO_printf(Perl_debug_log, |
| 328 | ! "yydebug: state %d, error recovery discards token %d (%s)\n", |
| 329 | ! yystate, yychar, yys); |
| 330 | } |
| 331 | #endif |
| 332 | *************** |
| 333 | *** 1479,1483 **** |
| 334 | #if YYDEBUG |
| 335 | if (yydebug) |
| 336 | ! printf("yydebug: state %d, reducing by rule %d (%s)\n", |
| 337 | yystate, yyn, yyrule[yyn]); |
| 338 | #endif |
| 339 | --- 1506,1510 ---- |
| 340 | #if YYDEBUG |
| 341 | if (yydebug) |
| 342 | ! PerlIO_printf(Perl_debug_log, "yydebug: state %d, reducing by rule %d (%s)\n", |
| 343 | yystate, yyn, yyrule[yyn]); |
| 344 | #endif |
| 345 | *************** |
| 346 | *** 2263,2267 **** |
| 347 | { yyval.opval = yyvsp[0].opval; } |
| 348 | break; |
| 349 | ! #line 2266 "y.tab.c" |
| 350 | } |
| 351 | yyssp -= yym; |
| 352 | --- 2290,2294 ---- |
| 353 | { yyval.opval = yyvsp[0].opval; } |
| 354 | break; |
| 355 | ! #line 2266 "perly.c" |
| 356 | } |
| 357 | yyssp -= yym; |
| 358 | *************** |
| 359 | *** 2273,2278 **** |
| 360 | #if YYDEBUG |
| 361 | if (yydebug) |
| 362 | ! printf("yydebug: after reduction, shifting from state 0 to\ |
| 363 | ! state %d\n", YYFINAL); |
| 364 | #endif |
| 365 | yystate = YYFINAL; |
| 366 | --- 2300,2306 ---- |
| 367 | #if YYDEBUG |
| 368 | if (yydebug) |
| 369 | ! PerlIO_printf(Perl_debug_log, |
| 370 | ! "yydebug: after reduction, shifting from state 0 to state %d\n", |
| 371 | ! YYFINAL); |
| 372 | #endif |
| 373 | yystate = YYFINAL; |
| 374 | *************** |
| 375 | *** 2288,2292 **** |
| 376 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
| 377 | if (!yys) yys = "illegal-symbol"; |
| 378 | ! printf("yydebug: state %d, reading %d (%s)\n", |
| 379 | YYFINAL, yychar, yys); |
| 380 | } |
| 381 | --- 2316,2320 ---- |
| 382 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
| 383 | if (!yys) yys = "illegal-symbol"; |
| 384 | ! PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n", |
| 385 | YYFINAL, yychar, yys); |
| 386 | } |
| 387 | *************** |
| 388 | *** 2303,2312 **** |
| 389 | #if YYDEBUG |
| 390 | if (yydebug) |
| 391 | ! printf("yydebug: after reduction, shifting from state %d \ |
| 392 | ! to state %d\n", *yyssp, yystate); |
| 393 | #endif |
| 394 | if (yyssp >= yyss + yystacksize - 1) |
| 395 | { |
| 396 | ! goto yyoverflow; |
| 397 | } |
| 398 | *++yyssp = yystate; |
| 399 | --- 2331,2355 ---- |
| 400 | #if YYDEBUG |
| 401 | if (yydebug) |
| 402 | ! PerlIO_printf(Perl_debug_log, |
| 403 | ! "yydebug: after reduction, shifting from state %d to state %d\n", |
| 404 | ! *yyssp, yystate); |
| 405 | #endif |
| 406 | if (yyssp >= yyss + yystacksize - 1) |
| 407 | { |
| 408 | ! /* |
| 409 | ! ** reallocate and recover. Note that pointers |
| 410 | ! ** have to be reset, or bad things will happen |
| 411 | ! */ |
| 412 | ! int yyps_index = (yyssp - yyss); |
| 413 | ! int yypv_index = (yyvsp - yyvs); |
| 414 | ! yystacksize += YYSTACKSIZE; |
| 415 | ! ysave->yyvs = yyvs = |
| 416 | ! (YYSTYPE*)realloc((char*)yyvs,yystacksize * sizeof(YYSTYPE)); |
| 417 | ! ysave->yyss = yyss = |
| 418 | ! (short*)realloc((char*)yyss,yystacksize * sizeof(short)); |
| 419 | ! if (!yyvs || !yyss) |
| 420 | ! goto yyoverflow; |
| 421 | ! yyssp = yyss + yyps_index; |
| 422 | ! yyvsp = yyvs + yypv_index; |
| 423 | } |
| 424 | *++yyssp = yystate; |
| 425 | *************** |
| 426 | *** 2314,2321 **** |
| 427 | goto yyloop; |
| 428 | yyoverflow: |
| 429 | ! yyerror("yacc stack overflow"); |
| 430 | yyabort: |
| 431 | ! return (1); |
| 432 | yyaccept: |
| 433 | ! return (0); |
| 434 | } |
| 435 | --- 2357,2364 ---- |
| 436 | goto yyloop; |
| 437 | yyoverflow: |
| 438 | ! yyerror("Out of memory for yacc stack"); |
| 439 | yyabort: |
| 440 | ! retval = 1; |
| 441 | yyaccept: |
| 442 | ! return retval; |
| 443 | } |