source: trunk/essentials/dev-lang/perl/perly_c.diff@ 3187

Last change on this file since 3187 was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 13.7 KB
  • perly.c

    old new  
    11#ifndef lint
    2 static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91";
     2/* static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91"; */
    33#endif
    44#define YYBYACC 1
    55#line 25 "perly.y"
     
    99#ifdef EBCDIC
    1010#undef YYDEBUG
    1111#endif
    12 #define dep() deprecate("\"do\" to call subroutines")
     12#define dep() deprecate("\"do\" to call subroutines")
    1313
    1414/* stuff included here to make perly_c.diff apply better */
    1515
     
    5050#define yylex yylex_r
    5151#endif
    5252
    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"
    11554#define YYERRCODE 256
    116 short yylhs[] = {                                        -1,
     55short yylhs[] = {                                        -1,
    11756    0,    9,    7,    6,   10,    8,   11,   11,   11,   12,
    11857   12,   12,   12,   25,   25,   25,   25,   25,   25,   25,
    11958   15,   15,   15,   14,   14,   43,   43,   13,   13,   13,
     
    13574   49,   34,   34,   35,   35,   35,   44,   24,   19,   20,
    13675   21,   22,   23,   36,   36,   36,   36,
    13776};
    138 short yylen[] = {                                         2,
     77short yylen[] = {                                         2,
    13978    2,    4,    0,    0,    4,    0,    0,    2,    2,    2,
    14079    1,    2,    3,    1,    1,    3,    3,    3,    3,    3,
    14180    0,    2,    6,    7,    7,    0,    2,    8,    8,   10,
     
    15796    1,    0,    1,    0,    1,    2,    1,    2,    2,    2,
    15897    2,    2,    2,    1,    1,    1,    1,
    15998};
    160 short yydefred[] = {                                      4,
     99short yydefred[] = {                                      4,
    161100    0,    7,    0,   45,   58,   56,    0,   56,   56,    8,
    162101   46,    9,   11,   48,    0,   47,   49,   50,    0,    0,
    163102    0,   70,   71,    0,   14,    3,  173,    0,    0,  154,
     
    199138    0,   22,    0,    0,    0,   31,    5,    0,   30,    0,
    200139    0,   33,    0,   23,
    201140};
    202 short yydgoto[] = {                                       1,
     141short yydgoto[] = {                                       1,
    203142   10,   11,   20,  104,   19,    2,   95,  370,   98,  359,
    204143    3,   12,   13,   70,  375,  285,   72,   73,   74,   75,
    205144   76,   77,   78,   79,  291,   81,  292,  281,  283,  286,
     
    207146  194,  327,  156,  289,  271,  225,   14,   83,  137,   84,
    208147   85,   86,   87,   15,   16,   17,   18,   93,  278,
    209148};
    210 short yysindex[] = {                                      0,
     149short yysindex[] = {                                      0,
    211150    0,    0, -132,    0,    0,    0,  -51,    0,    0,    0,
    212151    0,    0,    0,    0,  650,    0,    0,    0, -239, -215,
    213152    5,    0,    0, -215,    0,    0,    0,  -31,  -31,    0,
     
    249188  449,    0, 2181, -150,  340,    0,    0,  355,    0,  216,
    250189  216,    0, -123,    0,
    251190};
    252 short yyrindex[] = {                                      0,
     191short yyrindex[] = {                                      0,
    253192    0,    0,  247,    0,    0,    0,    0,    0,    0,    0,
    254193    0,    0,    0,    0,    0,    0,    0,    0,  274,    0,
    255194    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     
    291230  917,    0,    0,  119,    0,    0,    0,    0,    0,    0,
    292231    0,    0,  179,    0,
    293232};
    294 short yygindex[] = {                                      0,
     233short yygindex[] = {                                      0,
    295234    0,    0,  196,  425,    0,    0,   -2,    0,   37,  634,
    296235  -94,    0,    0,    0, -323,  -15, 2445,    0,  999,  414,
    297236  417,    0,    0,    0,  463,  -43,    0,    0,  321, -198,
     
    300239    0,    0,    0,    0,    0,    0,    0,    0,    0,
    301240};
    302241#define YYTABLESIZE 4568
    303 short yytable[] = {                                      71,
     242short yytable[] = {                                      71,
    304243  197,   65,  121,  227,   65,  111,  220,   22,  198,  293,
    305244  139,  296,  315,  275,  305,  102,  273,   88,  113,  228,
    306245   60,  113,  279,   65,  317,   60,  182,  254,  325,  101,
     
    759698    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    760699    0,    0,    0,    0,    0,    0,   77,   77,
    761700};
    762 short yycheck[] = {                                      15,
     701short yycheck[] = {                                      15,
    763702   95,   36,   46,   41,   36,   40,   59,   59,  100,  208,
    764703   54,   41,   59,  199,   41,   40,  196,  257,   41,   93,
    765704  123,   44,  202,   36,   93,   59,   40,   40,   59,   29,
     
    12241163#endif
    12251164#define YYMAXTOKEN 317
    12261165#if YYDEBUG
    1227 char *yyname[] = {
     1166char *yyname[] = {
    12281167"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,
    12291168"'!'",0,0,"'$'","'%'","'&'",0,"'('","')'","'*'","'+'","','","'-'",0,0,0,0,0,0,0,
    123011690,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,
     
    12411180"ANDAND","BITOROP","BITANDOP","SHIFTOP","MATCHOP","UMINUS","REFGEN","POWOP",
    12421181"PREINC","PREDEC","POSTINC","POSTDEC","ARROW",
    12431182};
    1244 char *yyrule[] = {
     1183char *yyrule[] = {
    12451184"$accept : prog",
    12461185"prog : progstart lineseq",
    12471186"block : '{' remember lineseq '}'",
     
    14561395#define YYMAXDEPTH 500
    14571396#endif
    14581397#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 YYSTACKSIZE
    14701398#line 804 "perly.y"
    14711399 /* PROGRAM */
    14721400
     
    14771405#endif
    14781406#define yyparse() Perl_yyparse(pTHX)
    14791407
    1480 #line 1481 "y.tab.c"
     1408#line 14.c"
    14811409#define YYABORT goto yyabort
    14821410#define YYACCEPT goto yyaccept
    14831411#define YYERROR goto yyerrlab
     
    14851413yyparse()
    14861414{
    14871415    register int yym, yyn, yystate;
     1416
     1417
     1418
     1419
     1420
     1421
    14881422#if YYDEBUG
    14891423    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;
    14911438
    1492     if (yys = getenv("YYDEBUG"))
     1439#if YYDEBUG
     1440    if ((yys = getenv("YYDEBUG")))
    14931441    {
    14941442        yyn = *yys;
    14951443        if (yyn >= '0' && yyn <= '9')
     
    15011449    yyerrflag = 0;
    15021450    yychar = (-1);
    15031451
     1452
     1453
     1454
     1455
     1456
     1457
     1458
     1459
     1460
     1461
    15041462    yyssp = yyss;
    15051463    yyvsp = yyvs;
    15061464    *yyssp = yystate = 0;
    15071465
    15081466yyloop:
    1509     if (yyn = yydefred[yystate]) goto yyreduce;
     1467    if () goto yyreduce;
    15101468    if (yychar < 0)
    15111469    {
    15121470        if ((yychar = yylex()) < 0) yychar = 0;
     
    15161474            yys = 0;
    15171475            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
    15181476            if (!yys) yys = "illegal-symbol";
    1519             printf("yydebug: state %d, reading %d (%s)\n", yystate,
     1477            "yydebug: state %d, reading %d (%s)\n", yystate,
    15201478                    yychar, yys);
    15211479        }
    15221480#endif
     
    15261484    {
    15271485#if YYDEBUG
    15281486        if (yydebug)
    1529             printf("yydebug: state %d, shifting to state %d\n",
     1487            "yydebug: state %d, shifting to state %d\n",
    15301488                    yystate, yytable[yyn]);
    15311489#endif
    15321490        if (yyssp >= yyss + yystacksize - 1)
    15331491        {
     1492
     1493
     1494
     1495
     1496
     1497
     1498
     1499
     1500
     1501
    15341502            goto yyoverflow;
     1503
     1504
    15351505        }
    15361506        *++yyssp = yystate = yytable[yyn];
    15371507        *++yyvsp = yylval;
     
    15471517    }
    15481518    if (yyerrflag) goto yyinrecovery;
    15491519#ifdef lint
    1550     goto yynewerror;
     1520
    15511521#endif
    1552 yynewerror:
     1522
    15531523    yyerror("syntax error");
    15541524#ifdef lint
    1555     goto yyerrlab;
     1525
    15561526#endif
    1557 yyerrlab:
     1527
    15581528    ++yynerrs;
    15591529yyinrecovery:
    15601530    if (yyerrflag < 3)
     
    15671537            {
    15681538#if YYDEBUG
    15691539                if (yydebug)
    1570                     printf("yydebug: state %d, error recovery shifting\
     1540                    "yydebug: state %d, error recovery shifting\
    15711541 to state %d\n", *yyssp, yytable[yyn]);
    15721542#endif
    15731543                if (yyssp >= yyss + yystacksize - 1)
    15741544                {
     1545
     1546
     1547
     1548
     1549
     1550
     1551
     1552
     1553
     1554
    15751555                    goto yyoverflow;
     1556
     1557
    15761558                }
    15771559                *++yyssp = yystate = yytable[yyn];
    15781560                *++yyvsp = yylval;
     
    15821564            {
    15831565#if YYDEBUG
    15841566                if (yydebug)
    1585                     printf("yydebug: error recovery discarding state %d\n",
     1567                    "yydebug: error recovery discarding state %d\n",
    15861568                            *yyssp);
    15871569#endif
    15881570                if (yyssp <= yyss) goto yyabort;
     
    16001582            yys = 0;
    16011583            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
    16021584            if (!yys) yys = "illegal-symbol";
    1603             printf("yydebug: state %d, error recovery discards token %d (%s)\n",
     1585            "yydebug: state %d, error recovery discards token %d (%s)\n",
    16041586                    yystate, yychar, yys);
    16051587        }
    16061588#endif
     
    16101592yyreduce:
    16111593#if YYDEBUG
    16121594    if (yydebug)
    1613         printf("yydebug: state %d, reducing by rule %d (%s)\n",
     1595        "yydebug: state %d, reducing by rule %d (%s)\n",
    16141596                yystate, yyn, yyrule[yyn]);
    16151597#endif
    16161598    yym = yylen[yyn];
     
    24852467    {
    24862468#if YYDEBUG
    24872469        if (yydebug)
    2488             printf("yydebug: after reduction, shifting from state 0 to\
     2470            "yydebug: after reduction, shifting from state 0 to\
    24892471 state %d\n", YYFINAL);
    24902472#endif
    24912473        yystate = YYFINAL;
     
    25002482                yys = 0;
    25012483                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
    25022484                if (!yys) yys = "illegal-symbol";
    2503                 printf("yydebug: state %d, reading %d (%s)\n",
     2485                "yydebug: state %d, reading %d (%s)\n",
    25042486                        YYFINAL, yychar, yys);
    25052487            }
    25062488#endif
     
    25152497        yystate = yydgoto[yym];
    25162498#if YYDEBUG
    25172499    if (yydebug)
    2518         printf("yydebug: after reduction, shifting from state %d \
     2500        "yydebug: after reduction, shifting from state %d \
    25192501to state %d\n", *yyssp, yystate);
    25202502#endif
    25212503    if (yyssp >= yyss + yystacksize - 1)
    25222504    {
     2505
     2506
     2507
     2508
     2509
     2510
     2511
     2512
     2513
     2514
    25232515        goto yyoverflow;
     2516
     2517
    25242518    }
    25252519    *++yyssp = yystate;
    25262520    *++yyvsp = yyval;
    25272521    goto yyloop;
    25282522yyoverflow:
    2529     yyerror("yacc stack overflow");
     2523    yyerror("");
    25302524yyabort:
    2531     return (1);
     2525    ret;
    25322526yyaccept:
    2533     return (0);
     2527#ifdef USE_ITHREADS
     2528    LEAVE;                      /* force yydestruct() before we return */
     2529#endif
     2530    return retval;
     2531}
     2532
     2533static void
     2534yydestruct(pTHX_ void *ptr)
     2535{
     2536    struct ysv* ysave = (struct ysv*)ptr;
     2537    if (ysave->yyss) Safefree(ysave->yyss);
     2538    if (ysave->yyvs) Safefree(ysave->yyvs);
     2539    yydebug     = ysave->oldyydebug;
     2540    yynerrs     = ysave->oldyynerrs;
     2541    yyerrflag   = ysave->oldyyerrflag;
     2542    yychar      = ysave->oldyychar;
     2543    yyval       = ysave->oldyyval;
     2544    yylval      = ysave->oldyylval;
     2545    Safefree(ysave);
    25342546}
Note: See TracBrowser for help on using the repository browser.