/[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.62 by eggert, Fri Jul 25 07:42:25 2003 UTC revision 1.63 by eggert, Sat Jul 26 14:12:28 2003 UTC
# Line 249  b4_syncline([@oline@], [@ofile@]) Line 249  b4_syncline([@oline@], [@ofile@])
249  # endif  # endif
250  #endif  #endif
251    
252    #ifndef YYASSERT
253    # define YYASSERT(condition) ((void) ((condition) || (abort (), 0)))
254    #endif
255    
256  #ifndef ATTRIBUTE_UNUSED  #ifndef ATTRIBUTE_UNUSED
257  # define ATTRIBUTE_UNUSED __attribute__ ((__unused__))  # define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
258  #endif  #endif
# Line 649  yyfillin (yyGLRStackItem *yyvsp, int yyl Line 653  yyfillin (yyGLRStackItem *yyvsp, int yyl
653    s = yyvsp[yylow0].yystate.yypred;    s = yyvsp[yylow0].yystate.yypred;
654    for (i = yylow0-1; i >= yylow1; i -= 1)    for (i = yylow0-1; i >= yylow1; i -= 1)
655      {      {
656        if (! s->yyresolved)        YYASSERT (s->yyresolved);
         abort ();  
657        yyvsp[i].yystate.yyresolved = yytrue;        yyvsp[i].yystate.yyresolved = yytrue;
658        yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval;        yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval;
659        yyvsp[i].yystate.yyloc = s->yyloc;        yyvsp[i].yystate.yyloc = s->yyloc;
# Line 1099  yydoAction (yyGLRStack* yystack, int yyk Line 1102  yydoAction (yyGLRStack* yystack, int yyk
1102      {      {
1103        /* Standard special case: single stack. */        /* Standard special case: single stack. */
1104        yyGLRStackItem* rhs = (yyGLRStackItem*) yystack->yytops.yystates[yyk];        yyGLRStackItem* rhs = (yyGLRStackItem*) yystack->yytops.yystates[yyk];
1105        if (yyk != 0)        YYASSERT (yyk == 0);
         abort ();  
1106        yystack->yynextFree -= yynrhs;        yystack->yynextFree -= yynrhs;
1107        yystack->yyspaceLeft += yynrhs;        yystack->yyspaceLeft += yynrhs;
1108        yystack->yytops.yystates[0] = & yystack->yynextFree[-1].yystate;        yystack->yytops.yystates[0] = & yystack->yynextFree[-1].yystate;
# Line 1117  yydoAction (yyGLRStack* yystack, int yyk Line 1119  yydoAction (yyGLRStack* yystack, int yyk
1119        for (yyi = 0; yyi < yynrhs; yyi += 1)        for (yyi = 0; yyi < yynrhs; yyi += 1)
1120          {          {
1121            yys = yys->yypred;            yys = yys->yypred;
1122            if (yys == NULL)            YYASSERT (yys);
             abort ();  
1123          }          }
1124        yyupdateSplit (yystack, yys);        yyupdateSplit (yystack, yys);
1125        yystack->yytops.yystates[yyk] = yys;        yystack->yytops.yystates[yyk] = yys;
# Line 1194  yyglrReduce (yyGLRStack* yystack, size_t Line 1195  yyglrReduce (yyGLRStack* yystack, size_t
1195             0 < yyn; yyn -= 1)             0 < yyn; yyn -= 1)
1196          {          {
1197            yys = yys->yypred;            yys = yys->yypred;
1198            if (yys == NULL)            YYASSERT (yys);
             abort ();  
1199          }          }
1200        yyupdateSplit (yystack, yys);        yyupdateSplit (yystack, yys);
1201        yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule));        yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule));
# Line 1232  yysplitStack (yyGLRStack* yystack, int y Line 1232  yysplitStack (yyGLRStack* yystack, int y
1232  {  {
1233    if (yystack->yysplitPoint == NULL)    if (yystack->yysplitPoint == NULL)
1234      {      {
1235        if (yyk != 0)        YYASSERT (yyk == 0);
         abort ();  
1236        yystack->yysplitPoint = yystack->yytops.yystates[yyk];        yystack->yysplitPoint = yystack->yytops.yystates[yyk];
1237      }      }
1238    if (yystack->yytops.yysize >= yystack->yytops.yycapacity)    if (yystack->yytops.yysize >= yystack->yytops.yycapacity)
# Line 1331  yyresolveStates (yyGLRState* yys, int yy Line 1330  yyresolveStates (yyGLRState* yys, int yy
1330    YYRESULTTAG yyflag;    YYRESULTTAG yyflag;
1331    if (0 < yyn)    if (0 < yyn)
1332      {      {
1333        if (yys->yypred == NULL)        YYASSERT (yys->yypred);
         abort ();  
1334        yyflag = yyresolveStates (yys->yypred, yyn-1, yystack]b4_user_args[);        yyflag = yyresolveStates (yys->yypred, yyn-1, yystack]b4_user_args[);
1335        if (yyflag != yyok)        if (yyflag != yyok)
1336          return yyflag;          return yyflag;
# Line 1549  yyprocessOneStack (yyGLRStack* yystack, Line 1547  yyprocessOneStack (yyGLRStack* yystack,
1547        yyStateNum yystate = yystack->yytops.yystates[yyk]->yylrState;        yyStateNum yystate = yystack->yytops.yystates[yyk]->yylrState;
1548        YYDPRINTF ((stderr, "Stack %d Entering state %d\n", yyk, yystate));        YYDPRINTF ((stderr, "Stack %d Entering state %d\n", yyk, yystate));
1549    
1550        if (yystate == YYFINAL)        YYASSERT (yystate != YYFINAL);
1551          abort ();  
1552        if (yyisDefaultedState (yystate))        if (yyisDefaultedState (yystate))
1553          {          {
1554            yyrule = yydefaultAction (yystate);            yyrule = yydefaultAction (yystate);

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.63

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