/[bison]/bison/src/bison.simple
ViewVC logotype

Diff of /bison/src/bison.simple

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.53.2.15 by akim, Thu Dec 27 18:30:40 2001 UTC revision 1.53.2.16 by akim, Thu Jan 3 09:48:08 2002 UTC
# Line 217  while (0) Line 217  while (0)
217    
218  # ifndef YYFPRINTF  # ifndef YYFPRINTF
219  #  ifdef __cplusplus  #  ifdef __cplusplus
220  #   include <cstdio.h> /* INFRINGES ON USER NAME SPACE */  #   include <cstdio>  /* INFRINGES ON USER NAME SPACE */
221  #  else  #  else
222  #   include <stdio.h> /* INFRINGES ON USER NAME SPACE */  #   include <stdio.h> /* INFRINGES ON USER NAME SPACE */
223  #  endif  #  endif
224  #  define YYFPRINTF YYSTD (fprintf)  #  define YYFPRINTF YYSTD (fprintf)
 #  define YYSTDERR YYSTD (stderr)  
225  # endif  # endif
226    
227  # define YYDPRINTF(Args)                        \  # define YYDPRINTF(Args)                        \
# Line 461  yyparse (YYPARSE_PARAM_ARG) Line 460  yyparse (YYPARSE_PARAM_ARG)
460       rule. */       rule. */
461    int yylen;    int yylen;
462    
463    YYDPRINTF ((YYSTDERR, "Starting parse\n"));    YYDPRINTF ((stderr, "Starting parse\n"));
464    
465    yystate = 0;    yystate = 0;
466    yyerrstatus = 0;    yyerrstatus = 0;
# Line 557  yyparse (YYPARSE_PARAM_ARG) Line 556  yyparse (YYPARSE_PARAM_ARG)
556        yylsp = yyls + yysize - 1;        yylsp = yyls + yysize - 1;
557  #endif  #endif
558    
559        YYDPRINTF ((YYSTDERR, "Stack size increased to %lu\n",        YYDPRINTF ((stderr, "Stack size increased to %lu\n",
560                    (unsigned long int) yystacksize));                    (unsigned long int) yystacksize));
561    
562        if (yyssp >= yyss + yystacksize - 1)        if (yyssp >= yyss + yystacksize - 1)
563          YYABORT;          YYABORT;
564      }      }
565    
566    YYDPRINTF ((YYSTDERR, "Entering state %d\n", yystate));    YYDPRINTF ((stderr, "Entering state %d\n", yystate));
567    
568    goto yybackup;    goto yybackup;
569    
# Line 591  yybackup: Line 590  yybackup:
590    
591    if (yychar == YYEMPTY)    if (yychar == YYEMPTY)
592      {      {
593        YYDPRINTF ((YYSTDERR, "Reading a token: "));        YYDPRINTF ((stderr, "Reading a token: "));
594        yychar = YYLEX;        yychar = YYLEX;
595      }      }
596    
# Line 602  yybackup: Line 601  yybackup:
601        yychar1 = 0;        yychar1 = 0;
602        yychar = YYEOF;           /* Don't call YYLEX any more */        yychar = YYEOF;           /* Don't call YYLEX any more */
603    
604        YYDPRINTF ((YYSTDERR, "Now at end of input.\n"));        YYDPRINTF ((stderr, "Now at end of input.\n"));
605      }      }
606    else    else
607      {      {
# Line 613  yybackup: Line 612  yybackup:
612          which are defined only if `YYDEBUG' is set.  */          which are defined only if `YYDEBUG' is set.  */
613        if (yydebug)        if (yydebug)
614          {          {
615            YYFPRINTF (YYSTDERR, "Next token is %d (%s",            YYFPRINTF (stderr, "Next token is %d (%s",
616                       yychar, yytname[yychar1]);                       yychar, yytname[yychar1]);
617            /* Give the individual parser a way to print the precise            /* Give the individual parser a way to print the precise
618               meaning of a token, for further debugging info.  */               meaning of a token, for further debugging info.  */
619  # ifdef YYPRINT  # ifdef YYPRINT
620            YYPRINT (YYSTDERR, yychar, yylval);            YYPRINT (stderr, yychar, yylval);
621  # endif  # endif
622            YYFPRINTF (YYSTDERR, ")\n");            YYFPRINTF (stderr, ")\n");
623          }          }
624  #endif  #endif
625      }      }
# Line 652  yybackup: Line 651  yybackup:
651      YYACCEPT;      YYACCEPT;
652    
653    /* Shift the lookahead token.  */    /* Shift the lookahead token.  */
654    YYDPRINTF ((YYSTDERR, "Shifting token %d (%s), ",    YYDPRINTF ((stderr, "Shifting token %d (%s), ",
655                yychar, yytname[yychar1]));                yychar, yytname[yychar1]));
656    
657    /* Discard the token being shifted unless it is eof.  */    /* Discard the token being shifted unless it is eof.  */
# Line 714  yyreduce: Line 713  yyreduce:
713      {      {
714        int yyi;        int yyi;
715    
716        YYFPRINTF (YYSTDERR, "Reducing via rule %d (line %d), ",        YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
717                   yyn, yyrline[yyn]);                   yyn, yyrline[yyn]);
718    
719        /* Print the symbols being reduced, and their result.  */        /* Print the symbols being reduced, and their result.  */
720        for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)        for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
721          YYFPRINTF (YYSTDERR, "%s ", yytname[yyrhs[yyi]]);          YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
722        YYFPRINTF (YYSTDERR, " -> %s\n", yytname[yyr1[yyn]]);        YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
723      }      }
724  #endif  #endif
725  %% actions /* The action file replaces this line. */  %% actions /* The action file replaces this line. */
# Line 736  yyreduce: Line 735  yyreduce:
735    if (yydebug)    if (yydebug)
736      {      {
737        short *yyssp1 = yyss - 1;        short *yyssp1 = yyss - 1;
738        YYFPRINTF (YYSTDERR, "state stack now");        YYFPRINTF (stderr, "state stack now");
739        while (yyssp1 != yyssp)        while (yyssp1 != yyssp)
740          YYFPRINTF (YYSTDERR, " %d", *++yyssp1);          YYFPRINTF (stderr, " %d", *++yyssp1);
741        YYFPRINTF (YYSTDERR, "\n");        YYFPRINTF (stderr, "\n");
742      }      }
743  #endif  #endif
744    
# Line 835  yyerrlab1: Line 834  yyerrlab1:
834        /* return failure if at end of input */        /* return failure if at end of input */
835        if (yychar == YYEOF)        if (yychar == YYEOF)
836          YYABORT;          YYABORT;
837        YYDPRINTF ((YYSTDERR, "Discarding token %d (%s).\n",        YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
838                    yychar, yytname[yychar1]));                    yychar, yytname[yychar1]));
839        yychar = YYEMPTY;        yychar = YYEMPTY;
840      }      }
# Line 881  yyerrpop: Line 880  yyerrpop:
880    if (yydebug)    if (yydebug)
881      {      {
882        short *yyssp1 = yyss - 1;        short *yyssp1 = yyss - 1;
883        YYFPRINTF (YYSTDERR, "Error: state stack now");        YYFPRINTF (stderr, "Error: state stack now");
884        while (yyssp1 != yyssp)        while (yyssp1 != yyssp)
885          YYFPRINTF (YYSTDERR, " %d", *++yyssp1);          YYFPRINTF (stderr, " %d", *++yyssp1);
886        YYFPRINTF (YYSTDERR, "\n");        YYFPRINTF (stderr, "\n");
887      }      }
888  #endif  #endif
889    
# Line 914  yyerrhandle: Line 913  yyerrhandle:
913    if (yyn == YYFINAL)    if (yyn == YYFINAL)
914      YYACCEPT;      YYACCEPT;
915    
916    YYDPRINTF ((YYSTDERR, "Shifting error token, "));    YYDPRINTF ((stderr, "Shifting error token, "));
917    
918    *++yyvsp = yylval;    *++yyvsp = yylval;
919  #if YYLSP_NEEDED  #if YYLSP_NEEDED

Legend:
Removed from v.1.53.2.15  
changed lines
  Added in v.1.53.2.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26