/[bison]/bison/data/glr.c
ViewVC logotype

Diff of /bison/data/glr.c

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

revision 1.35 by eggert, Wed Nov 13 07:46:19 2002 UTC revision 1.36 by akim, Wed Nov 13 09:49:49 2002 UTC
# Line 463  do {                                           \ Line 463  do {                                           \
463      yysymprint Args;                            \      yysymprint Args;                            \
464  } while (0)  } while (0)
465    
466    # define YYDSYMPRINTF(Title, Token, Value, Location)            \
467    do {                                                            \
468      if (yydebug)                                                  \
469        {                                                           \
470          YYFPRINTF (stderr, "%s ", Title);                         \
471          yysymprint (stderr,                                       \
472                      Token, Value]b4_location_if([, Location])[);  \
473          YYFPRINTF (stderr, "\n");                                 \
474        }                                                           \
475    } while (0)
476    
477  /* Nonzero means print parse trace.  It is left uninitialized so that  /* Nonzero means print parse trace.  It is left uninitialized so that
478     multiple parsers can coexist.  */     multiple parsers can coexist.  */
479  int yydebug;  int yydebug;
# Line 472  int yydebug; Line 483  int yydebug;
483    /* Avoid empty `if' bodies.  */    /* Avoid empty `if' bodies.  */
484  # define YYDPRINTF(Args)   {}  # define YYDPRINTF(Args)   {}
485  # define YYDSYMPRINT(Args) {}  # define YYDSYMPRINT(Args) {}
486    # define YYDSYMPRINTF(Title, Token, Value, Location) {}
487    
488  #endif /* !YYDEBUG */  #endif /* !YYDEBUG */
489    
# Line 1096  static inline void Line 1108  static inline void
1108  yy_reduce_print (size_t yyk, yyRuleNum yyrule)  yy_reduce_print (size_t yyk, yyRuleNum yyrule)
1109  {  {
1110    int yyi;    int yyi;
1111    YYDPRINTF ((stderr, "Reducing stack %d by rule %d (line %d),",    YYDPRINTF ((stderr, "Reducing stack %d by rule %d (line %d), ",
1112                yyk, yyrule - 1, yyrline[yyrule]));                yyk, yyrule - 1, yyrline[yyrule]));
1113    /* Print the symbols being reduced, and their result.  */    /* Print the symbols being reduced, and their result.  */
1114    for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)    for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1115      YYFPRINTF (stderr, "%s ", yytokenName (yyrhs[yyi]));      YYFPRINTF (stderr, "%s ", yytokenName (yyrhs[yyi]));
1116    YYFPRINTF (stderr, " -> %s\n", yytokenName (yyr1[yyrule]));    YYFPRINTF (stderr, "-> %s\n", yytokenName (yyr1[yyrule]));
1117  }  }
1118  #endif  #endif
1119    
# Line 1522  yyprocessOneStack (yyGLRStack* yystack, Line 1534  yyprocessOneStack (yyGLRStack* yystack,
1534                YYDPRINTF ((stderr, "Reading a token: "));                YYDPRINTF ((stderr, "Reading a token: "));
1535                yychar = YYLEX;                yychar = YYLEX;
1536                *yytokenp = YYTRANSLATE (yychar);                *yytokenp = YYTRANSLATE (yychar);
1537                YYDPRINTF ((stderr, "Next token is %s\n",                YYDSYMPRINTF ("Next token is", *yytokenp, yylvalp, yyllocp);
                           yytokenName (*yytokenp)));  
1538              }              }
1539            yygetLRActions (yystate, *yytokenp, &yyaction, &yyconflicts);            yygetLRActions (yystate, *yytokenp, &yyaction, &yyconflicts);
1540    
# Line 1642  yyrecoverParseError (yyGLRStack* yystack Line 1653  yyrecoverParseError (yyGLRStack* yystack
1653              while (yystack->yytops.yystates[0] != NULL)              while (yystack->yytops.yystates[0] != NULL)
1654                {                {
1655                  yyGLRState *yys = yystack->yytops.yystates[0];                  yyGLRState *yys = yystack->yytops.yystates[0];
1656                  YYDPRINTF ((stderr, "Error: popping "));                  YYDSYMPRINTF ("Error: popping",
                 YYDSYMPRINT ((stderr,  
1657                                yystos[yys->yylrState],                                yystos[yys->yylrState],
1658                                &yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[));                                &yys->yysemantics.yysval, &yys->yyloc);
                 YYDPRINTF ((stderr, "\n"));  
1659                  yydestruct (yystos[yys->yylrState],                  yydestruct (yystos[yys->yylrState],
1660                              &yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);                              &yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);
1661                  yystack->yytops.yystates[0] = yys->yypred;                  yystack->yytops.yystates[0] = yys->yypred;
# Line 1657  yyrecoverParseError (yyGLRStack* yystack Line 1666  yyrecoverParseError (yyGLRStack* yystack
1666            }            }
1667          if (*yytokenp != YYEMPTY)          if (*yytokenp != YYEMPTY)
1668            {            {
1669              YYDPRINTF ((stderr, "Discarding token %s\n",              YYDSYMPRINTF ("Error: discarding", *yytokenp, yylvalp, yyllocp);
                         yytokenName (*yytokenp)));  
1670              yydestruct (*yytokenp, yylvalp]b4_location_if([, yyllocp])[);              yydestruct (*yytokenp, yylvalp]b4_location_if([, yyllocp])[);
1671            }            }
1672          YYDPRINTF ((stderr, "Reading a token: "));          YYDPRINTF ((stderr, "Reading a token: "));
1673          yychar = YYLEX;          yychar = YYLEX;
1674          *yytokenp = YYTRANSLATE (yychar);          *yytokenp = YYTRANSLATE (yychar);
1675          YYDPRINTF ((stderr, "Next token is %s\n", yytokenName (*yytokenp)));          YYDSYMPRINTF ("Next token is", *yytokenp, yylvalp, yyllocp);
1676          yyj = yypact[yystack->yytops.yystates[0]->yylrState];          yyj = yypact[yystack->yytops.yystates[0]->yylrState];
1677          if (yyis_pact_ninf (yyj))          if (yyis_pact_ninf (yyj))
1678            /* Something's not right; we shouldn't be here.  */            /* Something's not right; we shouldn't be here.  */
# Line 1704  yyrecoverParseError (yyGLRStack* yystack Line 1712  yyrecoverParseError (yyGLRStack* yystack
1712                YYDPRINTF ((stderr, "Shifting error token, "));                YYDPRINTF ((stderr, "Shifting error token, "));
1713                yyglrShift (yystack, 0, yytable[yyj],                yyglrShift (yystack, 0, yytable[yyj],
1714                            yys->yyposn, *yylvalp, yyllocp]b4_user_args[);                            yys->yyposn, *yylvalp, yyllocp]b4_user_args[);
1715                  YYDPRINTF ((stderr, "Entering state %d\n",
1716                              yystack->yytops.yystates[0]->yylrState));
1717                break;                break;
1718              }              }
1719          }          }
1720        YYDPRINTF ((stderr, "Error: popping "));        YYDSYMPRINTF ("Error: popping",
       YYDSYMPRINT ((stderr,  
1721                      yystos[yys->yylrState],                      yystos[yys->yylrState],
1722                      &yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[));                      &yys->yysemantics.yysval, &yys->yyloc);
       YYDPRINTF ((stderr, "\n"));  
1723        yydestruct (yystos[yys->yylrState],        yydestruct (yystos[yys->yylrState],
1724                    &yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);                    &yys->yysemantics.yysval]b4_location_if([, &yys->yyloc])[);
1725        yystack->yytops.yystates[0] = yys->yypred;        yystack->yytops.yystates[0] = yys->yypred;
# Line 1804  yyrecoverParseError (yyGLRStack* yystack Line 1812  yyrecoverParseError (yyGLRStack* yystack
1812                    YYDPRINTF ((stderr, "Reading a token: "));                    YYDPRINTF ((stderr, "Reading a token: "));
1813                    yychar = YYLEX;                    yychar = YYLEX;
1814                    yytoken = YYTRANSLATE (yychar);                    yytoken = YYTRANSLATE (yychar);
1815                    YYDPRINTF ((stderr, "Next token is %s\n",                    YYDSYMPRINTF ("Next token is", yytoken, yylvalp, yyllocp);
                               yytokenName (yytoken)));  
1816                  }                  }
1817                yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);                yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
1818                if (*yyconflicts != 0)                if (*yyconflicts != 0)

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

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