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

Diff of /bison/data/bison.simple

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

revision 1.41 by akim, Wed Jun 19 12:03:22 2002 UTC revision 1.42 by akim, Thu Jun 20 09:08:36 2002 UTC
# Line 671  int yyparse (void); Line 671  int yyparse (void);
671  #if defined (__STDC__) || defined (__cplusplus)  #if defined (__STDC__) || defined (__cplusplus)
672  static void yydestructor (int yytype,  static void yydestructor (int yytype,
673                            YYSTYPE yyvalue[]b4_location_if([, YYLTYPE yylocation]));                            YYSTYPE yyvalue[]b4_location_if([, YYLTYPE yylocation]));
674    # if YYDEBUG
675    static void yysymprint (FILE* out, int yytype,
676                            YYSTYPE yyvalue[]b4_location_if([, YYLTYPE yylocation]));
677    # endif
678  #endif  #endif
679    
680  m4_divert_push([KILL])# ======================== M4 code.  m4_divert_push([KILL])# ======================== M4 code.
# Line 887  yybackup: Line 891  yybackup:
891          which are defined only if `YYDEBUG' is set.  */          which are defined only if `YYDEBUG' is set.  */
892        if (yydebug)        if (yydebug)
893          {          {
894            YYFPRINTF (stderr, "Next token is %d (%s",            YYFPRINTF (stderr, "Next token is ");
895                       yychar, yytname[yychar1]);            yysymprint (stderr, yychar1, yylval]b4_location_if([, yyloc])[);
896            /* Give the individual parser a way to print the precise            YYFPRINTF (stderr, "\n");
              meaning of a token, for further debugging info.  */  
 # ifdef YYPRINT  
           YYPRINT (stderr, yychar, yylval);  
 # endif  
           YYFPRINTF (stderr, ")\n");  
897          }          }
898  #endif  #endif
899      }      }
# Line 1113  yyerrlab1: Line 1112  yyerrlab1:
1112  #if YYDEBUG  #if YYDEBUG
1113                if (yydebug)                if (yydebug)
1114                  {                  {
1115                    if (yystos[*yyssp] < YYNTOKENS)                    YYFPRINTF (stderr, "Error: popping ");
1116                      {                    yysymprint (stderr,
1117                        YYFPRINTF (stderr, "Error: popping token %d (%s",                                yystos[*yyssp],
1118                                   yytoknum[yystos[*yyssp]],                                *yyvsp]b4_location_if([, *yylsp])[);
1119                                   yytname[yystos[*yyssp]]);                    YYFPRINTF (stderr, "\n");
 # ifdef YYPRINT  
                       YYPRINT (stderr, yytoknum[yystos[*yyssp]], *yyvsp);  
 # endif  
                       YYFPRINTF (stderr, ")\n");  
                     }  
                   else  
                     {  
                       YYFPRINTF (stderr, "Error: popping nonterminal (%s)\n",  
                                  yytname[yystos[*yyssp]]);  
                     }  
1120                  }                  }
1121  #endif  #endif
1122                yydestructor (yystos[*yyssp], *yyvsp]b4_location_if([, *yylsp])[);                yydestructor (yystos[*yyssp], *yyvsp]b4_location_if([, *yylsp])[);
# Line 1168  yyerrlab1: Line 1157  yyerrlab1:
1157  #if YYDEBUG  #if YYDEBUG
1158        if (yydebug)        if (yydebug)
1159          {          {
1160            if (yystos[yystate] < YYNTOKENS)            YYFPRINTF (stderr, "Error: popping ");
1161              {            yysymprint (stderr,
1162                YYFPRINTF (stderr, "Error: popping token %d (%s",                        yystos[*yyssp],
1163                           yytoknum[yystos[yystate]], yytname[yystos[yystate]]);                        *yyvsp]b4_location_if([, *yylsp])[);
1164  # ifdef YYPRINT            YYFPRINTF (stderr, "\n");
               YYPRINT (stderr, yytoknum[yystos[yystate]], *yyvsp);  
 # endif  
               YYFPRINTF (stderr, ")\n");  
             }  
           else  
             {  
               YYFPRINTF (stderr, "Error: popping nonterminal (%s)\n",  
                          yytname[yystos[yystate]]);  
             }  
1165          }          }
1166  #endif  #endif
1167    
# Line 1247  yyreturn: Line 1227  yyreturn:
1227  ]}  ]}
1228    
1229    
1230  /*-------------------------------------------------.  /*-----------------------------------------------.
1231  | Release the memory associated to SYMBOL-NUMBER.  |  | Release the memory associated to this symbol.  |
1232  `-------------------------------------------------*/  `-----------------------------------------------*/
1233    
1234  m4_divert_push([KILL])# M4 code.  m4_divert_push([KILL])# M4 code.
1235  # b4_symbol_destructor(SYMBOL-NUMBER, DESTRUCTOR, TYPE-NAME)  # b4_symbol_destructor(SYMBOL-NUMBER, DESTRUCTOR, TYPE-NAME)
# Line 1274  yydestructor (int yytype, Line 1254  yydestructor (int yytype,
1254      {      {
1255  m4_map([b4_symbol_destructor], m4_defn([b4_symbol_destructors]))dnl  m4_map([b4_symbol_destructor], m4_defn([b4_symbol_destructors]))dnl
1256        default:        default:
         YYDPRINTF ((stderr, "yydestructor: unknown symbol type: %d (%s)\n",  
                     yytype, yytname[[yytype]]));  
1257          break;          break;
1258      }      }
1259  }  }
1260    
1261    
1262    #if YYDEBUG
1263    /*---------------------------.
1264    | Print this symbol on OUT.  |
1265    `---------------------------*/
1266    
1267    m4_divert_push([KILL])# M4 code.
1268    # b4_symbol_printer(SYMBOL-NUMBER, PRINTER, TYPE-NAME)
1269    # ----------------------------------------------------------
1270    m4_define([b4_symbol_printer],
1271    [m4_pushdef([b4_dollar_dollar], [yyvalue.$6])dnl
1272    m4_pushdef([b4_at_dollar], [yylocation])dnl
1273          case $4: /* $3 */
1274    #line $2 "$1"
1275            $5;
1276    #line __oline__ "__ofile__"
1277            break;
1278    m4_popdef([b4_at_dollar])dnl
1279    m4_popdef([b4_dollar_dollar])])
1280    
1281    m4_divert_pop([KILL])dnl# End of M4 code.
1282    static void
1283    yysymprint (FILE* out, int yytype,
1284                YYSTYPE yyvalue[]b4_location_if([, YYLTYPE yylocation]))
1285    {
1286      if (yytype < YYNTOKENS)
1287        YYFPRINTF (out, "token %d (%s ", yytoknum[[yytype]], yytname[[yytype]]);
1288      else
1289        YYFPRINTF (out, "nterm %s (", yytname[[yytype]]);
1290    # ifdef YYPRINT
1291      YYPRINT (out, yytype, yyvalue);
1292    # else
1293      switch (yytype)
1294        {
1295    m4_map([b4_symbol_printer], m4_defn([b4_symbol_printers]))dnl
1296          default:
1297            break;
1298        }
1299    # endif /* !defined YYPRINT. */
1300      YYFPRINTF (out, ")");
1301    }
1302    #endif /* YYDEBUG. */
1303    
1304  b4_epilogue  b4_epilogue
1305  m4_if(b4_defines_flag, 0, [],  m4_if(b4_defines_flag, 0, [],
1306  [#output "b4_output_header_name"  [#output "b4_output_header_name"

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.42

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