home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl560.zip / perly_c.diff < prev    next >
Text File  |  1999-11-04  |  5KB  |  184 lines

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