source:
trunk/third/perl/perly_c.diff
@
20075
Revision 20075, 13.8 KB checked in by zacheiss, 21 years ago (diff) |
---|
-
perly.c
old new 1 1 #ifndef lint 2 static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91"; 2 /* static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91"; */ 3 3 #endif 4 4 #define YYBYACC 1 5 5 #line 16 "perly.y" … … 9 9 #ifdef EBCDIC 10 10 #undef YYDEBUG 11 11 #endif 12 #define dep() deprecate ("\"do\" to call subroutines")12 #define dep() deprecate_old("\"do\" to call subroutines") 13 13 14 14 /* stuff included here to make perly_c.diff apply better */ 15 15 … … 50 50 #define yylex yylex_r 51 51 #endif 52 52 53 #line 54 "y.tab.c" 54 #define WORD 257 55 #define METHOD 258 56 #define FUNCMETH 259 57 #define THING 260 58 #define PMFUNC 261 59 #define PRIVATEREF 262 60 #define FUNC0SUB 263 61 #define UNIOPSUB 264 62 #define LSTOPSUB 265 63 #define LABEL 266 64 #define FORMAT 267 65 #define SUB 268 66 #define ANONSUB 269 67 #define PACKAGE 270 68 #define USE 271 69 #define WHILE 272 70 #define UNTIL 273 71 #define IF 274 72 #define UNLESS 275 73 #define ELSE 276 74 #define ELSIF 277 75 #define CONTINUE 278 76 #define FOR 279 77 #define LOOPEX 280 78 #define DOTDOT 281 79 #define FUNC0 282 80 #define FUNC1 283 81 #define FUNC 284 82 #define UNIOP 285 83 #define LSTOP 286 84 #define RELOP 287 85 #define EQOP 288 86 #define MULOP 289 87 #define ADDOP 290 88 #define DOLSHARP 291 89 #define DO 292 90 #define HASHBRACK 293 91 #define NOAMP 294 92 #define LOCAL 295 93 #define MY 296 94 #define MYSUB 297 95 #define COLONATTR 298 96 #define PREC_LOW 299 97 #define OROP 300 98 #define ANDOP 301 99 #define NOTOP 302 100 #define ASSIGNOP 303 101 #define OROR 304 102 #define ANDAND 305 103 #define BITOROP 306 104 #define BITANDOP 307 105 #define SHIFTOP 308 106 #define MATCHOP 309 107 #define UMINUS 310 108 #define REFGEN 311 109 #define POWOP 312 110 #define PREINC 313 111 #define PREDEC 314 112 #define POSTINC 315 113 #define POSTDEC 316 114 #define ARROW 317 53 #line 54 "perly.c" 115 54 #define YYERRCODE 256 116 s hort yylhs[] = { -1,55 static short yylhs[] = { -1, 117 56 0, 9, 7, 6, 10, 8, 11, 11, 11, 12, 118 57 12, 12, 12, 25, 25, 25, 25, 25, 25, 25, 119 58 15, 15, 15, 14, 14, 43, 43, 13, 13, 13, … … 135 74 49, 34, 34, 35, 35, 35, 44, 24, 19, 20, 136 75 21, 22, 23, 36, 36, 36, 36, 137 76 }; 138 s hort yylen[] = { 2,77 static short yylen[] = { 2, 139 78 2, 4, 0, 0, 4, 0, 0, 2, 2, 2, 140 79 1, 2, 3, 1, 1, 3, 3, 3, 3, 3, 141 80 0, 2, 6, 7, 7, 0, 2, 8, 8, 10, … … 157 96 1, 0, 1, 0, 1, 2, 1, 2, 2, 2, 158 97 2, 2, 2, 1, 1, 1, 1, 159 98 }; 160 s hort yydefred[] = { 4,99 static short yydefred[] = { 4, 161 100 0, 7, 0, 45, 58, 56, 0, 56, 56, 8, 162 101 46, 9, 11, 48, 0, 47, 49, 50, 0, 0, 163 102 0, 70, 71, 0, 14, 3, 173, 0, 0, 154, … … 199 138 0, 22, 0, 0, 0, 31, 5, 0, 30, 0, 200 139 0, 33, 0, 23, 201 140 }; 202 s hort yydgoto[] = { 1,141 static short yydgoto[] = { 1, 203 142 10, 11, 20, 104, 19, 2, 95, 370, 98, 359, 204 143 3, 12, 13, 70, 375, 285, 72, 73, 74, 75, 205 144 76, 77, 78, 79, 291, 81, 292, 281, 283, 286, … … 207 146 194, 327, 156, 289, 271, 225, 14, 83, 137, 84, 208 147 85, 86, 87, 15, 16, 17, 18, 93, 278, 209 148 }; 210 s hort yysindex[] = { 0,149 static short yysindex[] = { 0, 211 150 0, 0, -132, 0, 0, 0, -51, 0, 0, 0, 212 151 0, 0, 0, 0, 650, 0, 0, 0, -239, -215, 213 152 5, 0, 0, -215, 0, 0, 0, -31, -31, 0, … … 249 188 449, 0, 2181, -150, 340, 0, 0, 355, 0, 216, 250 189 216, 0, -123, 0, 251 190 }; 252 s hort yyrindex[] = { 0,191 static short yyrindex[] = { 0, 253 192 0, 0, 247, 0, 0, 0, 0, 0, 0, 0, 254 193 0, 0, 0, 0, 0, 0, 0, 0, 274, 0, 255 194 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … … 291 230 917, 0, 0, 119, 0, 0, 0, 0, 0, 0, 292 231 0, 0, 179, 0, 293 232 }; 294 s hort yygindex[] = { 0,233 static short yygindex[] = { 0, 295 234 0, 0, 196, 425, 0, 0, -2, 0, 37, 634, 296 235 -94, 0, 0, 0, -323, -15, 2445, 0, 999, 414, 297 236 417, 0, 0, 0, 463, -43, 0, 0, 321, -198, … … 300 239 0, 0, 0, 0, 0, 0, 0, 0, 0, 301 240 }; 302 241 #define YYTABLESIZE 4568 303 s hort yytable[] = { 71,242 static short yytable[] = { 71, 304 243 197, 65, 121, 227, 65, 111, 220, 22, 198, 293, 305 244 139, 296, 315, 275, 305, 102, 273, 88, 113, 228, 306 245 60, 113, 279, 65, 317, 60, 182, 254, 325, 101, … … 759 698 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 760 699 0, 0, 0, 0, 0, 0, 77, 77, 761 700 }; 762 s hort yycheck[] = { 15,701 static short yycheck[] = { 15, 763 702 95, 36, 46, 41, 36, 40, 59, 59, 100, 208, 764 703 54, 41, 59, 199, 41, 40, 196, 257, 41, 93, 765 704 123, 44, 202, 36, 93, 59, 40, 40, 59, 29, … … 1224 1163 #endif 1225 1164 #define YYMAXTOKEN 317 1226 1165 #if YYDEBUG 1227 char *yyname[] = {1166 static char *yyname[] = { 1228 1167 "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, 1229 1168 "'!'",0,0,"'$'","'%'","'&'",0,"'('","')'","'*'","'+'","','","'-'",0,0,0,0,0,0,0, 1230 1169 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, … … 1241 1180 "ANDAND","BITOROP","BITANDOP","SHIFTOP","MATCHOP","UMINUS","REFGEN","POWOP", 1242 1181 "PREINC","PREDEC","POSTINC","POSTDEC","ARROW", 1243 1182 }; 1244 char *yyrule[] = {1183 static char *yyrule[] = { 1245 1184 "$accept : prog", 1246 1185 "prog : progstart lineseq", 1247 1186 "block : '{' remember lineseq '}'", … … 1456 1395 #define YYMAXDEPTH 500 1457 1396 #endif 1458 1397 #endif 1459 int yydebug;1460 int yynerrs;1461 int yyerrflag;1462 int yychar;1463 short *yyssp;1464 YYSTYPE *yyvsp;1465 YYSTYPE yyval;1466 YYSTYPE yylval;1467 short yyss[YYSTACKSIZE];1468 YYSTYPE yyvs[YYSTACKSIZE];1469 #define yystacksize YYSTACKSIZE1470 1398 #line 794 "perly.y" 1471 1399 /* PROGRAM */ 1472 1400 … … 1477 1405 #endif 1478 1406 #define yyparse() Perl_yyparse(pTHX) 1479 1407 1480 #line 14 81 "y.tab.c"1408 #line 1409 "perly.c" 1481 1409 #define YYABORT goto yyabort 1482 1410 #define YYACCEPT goto yyaccept 1483 1411 #define YYERROR goto yyerrlab … … 1485 1413 yyparse() 1486 1414 { 1487 1415 register int yym, yyn, yystate; 1416 register short *yyssp; 1417 register YYSTYPE *yyvsp; 1418 short* yyss; 1419 YYSTYPE* yyvs; 1420 unsigned yystacksize = YYSTACKSIZE; 1421 int retval = 0; 1488 1422 #if YYDEBUG 1489 1423 register char *yys; 1490 extern char *getenv(); 1424 #endif 1425 1426 struct ysv *ysave; 1427 #ifdef USE_ITHREADS 1428 ENTER; /* force yydestruct() before we return */ 1429 #endif 1430 New(73, ysave, 1, struct ysv); 1431 SAVEDESTRUCTOR_X(yydestruct, ysave); 1432 ysave->oldyydebug = yydebug; 1433 ysave->oldyynerrs = yynerrs; 1434 ysave->oldyyerrflag = yyerrflag; 1435 ysave->oldyychar = yychar; 1436 ysave->oldyyval = yyval; 1437 ysave->oldyylval = yylval; 1491 1438 1492 if (yys = getenv("YYDEBUG")) 1439 #if YYDEBUG 1440 if ((yys = getenv("YYDEBUG"))) 1493 1441 { 1494 1442 yyn = *yys; 1495 1443 if (yyn >= '0' && yyn <= '9') … … 1501 1449 yyerrflag = 0; 1502 1450 yychar = (-1); 1503 1451 1452 /* 1453 ** Initialize private stacks (yyparse may be called from an action) 1454 */ 1455 New(73, yyss, yystacksize, short); 1456 New(73, yyvs, yystacksize, YYSTYPE); 1457 ysave->yyss = yyss; 1458 ysave->yyvs = yyvs; 1459 if (!yyvs || !yyss) 1460 goto yyoverflow; 1461 1504 1462 yyssp = yyss; 1505 1463 yyvsp = yyvs; 1506 1464 *yyssp = yystate = 0; 1507 1465 1508 1466 yyloop: 1509 if ( yyn = yydefred[yystate]) goto yyreduce;1467 if ((yyn = yydefred[yystate])) goto yyreduce; 1510 1468 if (yychar < 0) 1511 1469 { 1512 1470 if ((yychar = yylex()) < 0) yychar = 0; … … 1516 1474 yys = 0; 1517 1475 if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; 1518 1476 if (!yys) yys = "illegal-symbol"; 1519 printf("yydebug: state %d, reading %d (%s)\n", yystate,1477 PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n", yystate, 1520 1478 yychar, yys); 1521 1479 } 1522 1480 #endif … … 1526 1484 { 1527 1485 #if YYDEBUG 1528 1486 if (yydebug) 1529 printf("yydebug: state %d, shifting to state %d\n",1487 PerlIO_printf(Perl_debug_log, "yydebug: state %d, shifting to state %d\n", 1530 1488 yystate, yytable[yyn]); 1531 1489 #endif 1532 1490 if (yyssp >= yyss + yystacksize - 1) 1533 1491 { 1492 /* 1493 ** reallocate and recover. Note that pointers 1494 ** have to be reset, or bad things will happen 1495 */ 1496 int yyps_index = (yyssp - yyss); 1497 int yypv_index = (yyvsp - yyvs); 1498 yystacksize += YYSTACKSIZE; 1499 ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE); 1500 ysave->yyss = Renew(yyss, yystacksize, short); 1501 if (!yyvs || !yyss) 1534 1502 goto yyoverflow; 1503 yyssp = yyss + yyps_index; 1504 yyvsp = yyvs + yypv_index; 1535 1505 } 1536 1506 *++yyssp = yystate = yytable[yyn]; 1537 1507 *++yyvsp = yylval; … … 1547 1517 } 1548 1518 if (yyerrflag) goto yyinrecovery; 1549 1519 #ifdef lint 1550 goto yynewerror; 1520 1551 1521 #endif 1552 yynewerror: 1522 1553 1523 yyerror("syntax error"); 1554 1524 #ifdef lint 1555 goto yyerrlab; 1525 1556 1526 #endif 1557 yyerrlab: 1527 1558 1528 ++yynerrs; 1559 1529 yyinrecovery: 1560 1530 if (yyerrflag < 3) … … 1567 1537 { 1568 1538 #if YYDEBUG 1569 1539 if (yydebug) 1570 printf("yydebug: state %d, error recovery shifting\1540 PerlIO_printf(Perl_debug_log, "yydebug: state %d, error recovery shifting\ 1571 1541 to state %d\n", *yyssp, yytable[yyn]); 1572 1542 #endif 1573 1543 if (yyssp >= yyss + yystacksize - 1) 1574 1544 { 1545 /* 1546 ** reallocate and recover. Note that pointers 1547 ** have to be reset, or bad things will happen 1548 */ 1549 int yyps_index = (yyssp - yyss); 1550 int yypv_index = (yyvsp - yyvs); 1551 yystacksize += YYSTACKSIZE; 1552 ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE); 1553 ysave->yyss = Renew(yyss, yystacksize, short); 1554 if (!yyvs || !yyss) 1575 1555 goto yyoverflow; 1556 yyssp = yyss + yyps_index; 1557 yyvsp = yyvs + yypv_index; 1576 1558 } 1577 1559 *++yyssp = yystate = yytable[yyn]; 1578 1560 *++yyvsp = yylval; … … 1582 1564 { 1583 1565 #if YYDEBUG 1584 1566 if (yydebug) 1585 printf("yydebug: error recovery discarding state %d\n",1567 PerlIO_printf(Perl_debug_log, "yydebug: error recovery discarding state %d\n", 1586 1568 *yyssp); 1587 1569 #endif 1588 1570 if (yyssp <= yyss) goto yyabort; … … 1600 1582 yys = 0; 1601 1583 if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; 1602 1584 if (!yys) yys = "illegal-symbol"; 1603 printf("yydebug: state %d, error recovery discards token %d (%s)\n",1585 PerlIO_printf(Perl_debug_log, "yydebug: state %d, error recovery discards token %d (%s)\n", 1604 1586 yystate, yychar, yys); 1605 1587 } 1606 1588 #endif … … 1610 1592 yyreduce: 1611 1593 #if YYDEBUG 1612 1594 if (yydebug) 1613 printf("yydebug: state %d, reducing by rule %d (%s)\n",1595 PerlIO_printf(Perl_debug_log, "yydebug: state %d, reducing by rule %d (%s)\n", 1614 1596 yystate, yyn, yyrule[yyn]); 1615 1597 #endif 1616 1598 yym = yylen[yyn]; … … 2474 2456 #line 791 "perly.y" 2475 2457 { yyval.opval = yyvsp[0].opval; } 2476 2458 break; 2477 #line 24 78 "y.tab.c"2459 #line 2460 "perly.c" 2478 2460 } 2479 2461 yyssp -= yym; 2480 2462 yystate = *yyssp; … … 2484 2466 { 2485 2467 #if YYDEBUG 2486 2468 if (yydebug) 2487 printf("yydebug: after reduction, shifting from state 0 to\2469 PerlIO_printf(Perl_debug_log, "yydebug: after reduction, shifting from state 0 to\ 2488 2470 state %d\n", YYFINAL); 2489 2471 #endif 2490 2472 yystate = YYFINAL; … … 2499 2481 yys = 0; 2500 2482 if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; 2501 2483 if (!yys) yys = "illegal-symbol"; 2502 printf("yydebug: state %d, reading %d (%s)\n",2484 PerlIO_printf(Perl_debug_log, "yydebug: state %d, reading %d (%s)\n", 2503 2485 YYFINAL, yychar, yys); 2504 2486 } 2505 2487 #endif … … 2514 2496 yystate = yydgoto[yym]; 2515 2497 #if YYDEBUG 2516 2498 if (yydebug) 2517 printf("yydebug: after reduction, shifting from state %d \2499 PerlIO_printf(Perl_debug_log, "yydebug: after reduction, shifting from state %d \ 2518 2500 to state %d\n", *yyssp, yystate); 2519 2501 #endif 2520 2502 if (yyssp >= yyss + yystacksize - 1) 2521 2503 { 2504 /* 2505 ** reallocate and recover. Note that pointers 2506 ** have to be reset, or bad things will happen 2507 */ 2508 int yyps_index = (yyssp - yyss); 2509 int yypv_index = (yyvsp - yyvs); 2510 yystacksize += YYSTACKSIZE; 2511 ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE); 2512 ysave->yyss = Renew(yyss, yystacksize, short); 2513 if (!yyvs || !yyss) 2522 2514 goto yyoverflow; 2515 yyssp = yyss + yyps_index; 2516 yyvsp = yyvs + yypv_index; 2523 2517 } 2524 2518 *++yyssp = yystate; 2525 2519 *++yyvsp = yyval; 2526 2520 goto yyloop; 2527 2521 yyoverflow: 2528 yyerror(" yacc stack overflow");2522 yyerror("Out of memory for yacc stack"); 2529 2523 yyabort: 2530 ret urn (1);2524 retval = 1; 2531 2525 yyaccept: 2532 return (0); 2526 #ifdef USE_ITHREADS 2527 LEAVE; /* force yydestruct() before we return */ 2528 #endif 2529 return retval; 2530 } 2531 2532 static void 2533 yydestruct(pTHX_ void *ptr) 2534 { 2535 struct ysv* ysave = (struct ysv*)ptr; 2536 if (ysave->yyss) Safefree(ysave->yyss); 2537 if (ysave->yyvs) Safefree(ysave->yyvs); 2538 yydebug = ysave->oldyydebug; 2539 yynerrs = ysave->oldyynerrs; 2540 yyerrflag = ysave->oldyyerrflag; 2541 yychar = ysave->oldyychar; 2542 yyval = ysave->oldyyval; 2543 yylval = ysave->oldyylval; 2544 Safefree(ysave); 2533 2545 }
Note: See TracBrowser
for help on using the repository browser.