/[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.39 by akim, Sat Nov 16 12:32:27 2002 UTC revision 1.40 by eggert, Mon Nov 18 07:51:47 2002 UTC
# Line 481  int yydebug; Line 481  int yydebug;
481  #else /* !YYDEBUG */  #else /* !YYDEBUG */
482    
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) {}  # define YYDSYMPRINTF(Title, Token, Value, Location)
487    
488  #endif /* !YYDEBUG */  #endif /* !YYDEBUG */
489    
# Line 790  yyisErrorAction (int yyaction) Line 790  yyisErrorAction (int yyaction)
790    
791                                  /* GLRStates */                                  /* GLRStates */
792    
 /** True iff the semantic value of the edge leading to STATE is  
  *  resolved. */  
 static inline bool  
 yyhasResolvedValue (yyGLRState* yystate)  
 {  
   return yystate->yyresolved;  
 }  
   
793  static void  static void
794  yyaddDeferredAction (yyGLRStack* yystack, yyGLRState* yystate,  yyaddDeferredAction (yyGLRStack* yystack, yyGLRState* yystate,
795                       yyGLRState* rhs, yyRuleNum yyrule]b4_pure_formals[)                       yyGLRState* rhs, yyRuleNum yyrule]b4_pure_formals[)
# Line 967  yyremoveDeletes (yyGLRStack* yystack) Line 959  yyremoveDeletes (yyGLRStack* yystack)
959        if (yystack->yytops.yystates[yyi] == NULL)        if (yystack->yytops.yystates[yyi] == NULL)
960          {          {
961            if (yyi == yyj)            if (yyi == yyj)
962              YYDPRINTF ((stderr, "Removing dead stacks.\n"));              {
963                  YYDPRINTF ((stderr, "Removing dead stacks.\n"));
964                }
965            yystack->yytops.yysize -= 1;            yystack->yytops.yysize -= 1;
966          }          }
967        else        else
968          {          {
969            yystack->yytops.yystates[yyj] = yystack->yytops.yystates[yyi];            yystack->yytops.yystates[yyj] = yystack->yytops.yystates[yyi];
970            if (yyj != yyi)            if (yyj != yyi)
971              YYDPRINTF ((stderr, "Rename stack %d -> %d.\n", yyi, yyj));              {
972                  YYDPRINTF ((stderr, "Rename stack %d -> %d.\n", yyi, yyj));
973                }
974            yyj += 1;            yyj += 1;
975          }          }
976        yyi += 1;        yyi += 1;
# Line 1250  yymergeOptionSets (yySemanticOption* yyy Line 1246  yymergeOptionSets (yySemanticOption* yyy
1246          yySemanticOption* yyz;          yySemanticOption* yyz;
1247          for (yyz = yys0->yysemantics.yyfirstVal; yyz->yynext != NULL;          for (yyz = yys0->yysemantics.yyfirstVal; yyz->yynext != NULL;
1248               yyz = yyz->yynext)               yyz = yyz->yynext)
1249            ;            continue;
1250          yyz->yynext = yys1->yysemantics.yyfirstVal;          yyz->yynext = yys1->yysemantics.yyfirstVal;
1251        }        }
1252  }  }
# Line 1460  yyresolveStack (yyGLRStack* yystack]b4_u Line 1456  yyresolveStack (yyGLRStack* yystack]b4_u
1456        for (yyn = 0, yys = yystack->yytops.yystates[0];        for (yyn = 0, yys = yystack->yytops.yystates[0];
1457             yys != yystack->yysplitPoint;             yys != yystack->yysplitPoint;
1458             yys = yys->yypred, yyn += 1)             yys = yys->yypred, yyn += 1)
1459          ;          continue;
1460        YYCHK (yyresolveStates (yystack->yytops.yystates[0], yyn, yystack        YYCHK (yyresolveStates (yystack->yytops.yystates[0], yyn, yystack
1461                               ]b4_user_args[));                               ]b4_user_args[));
1462      }      }
# Line 1571  yyprocessOneStack (yyGLRStack* yystack, Line 1567  yyprocessOneStack (yyGLRStack* yystack,
1567  }  }
1568    
1569  static void  static void
1570  yyreportParseError (yyGLRStack* yystack,  yyreportSyntaxError (yyGLRStack* yystack,
1571                      YYSTYPE* yylvalp, YYLTYPE* yyllocp]b4_user_formals[)                       YYSTYPE* yylvalp, YYLTYPE* yyllocp]b4_user_formals[)
1572  {  {
1573    /* `Unused' warnings. */    /* `Unused' warnings. */
1574    (void) yylvalp;    (void) yylvalp;
# Line 1630  yyreportParseError (yyGLRStack* yystack, Line 1626  yyreportParseError (yyGLRStack* yystack,
1626     YYLVALP, and YYLLOCP point to the syntactic category, semantic     YYLVALP, and YYLLOCP point to the syntactic category, semantic
1627     value, and location of the lookahead.  */     value, and location of the lookahead.  */
1628  static void  static void
1629  yyrecoverParseError (yyGLRStack* yystack,  yyrecoverSyntaxError (yyGLRStack* yystack,
1630                       YYSTYPE* yylvalp, YYLTYPE* yyllocp]b4_user_formals[)                        YYSTYPE* yylvalp, YYLTYPE* yyllocp]b4_user_formals[)
1631  {  {
1632    yySymbol* const yytokenp = yystack->yytokenp;    yySymbol* const yytokenp = yystack->yytokenp;
1633    size_t yyk;    size_t yyk;
# Line 1796  yyrecoverParseError (yyGLRStack* yystack Line 1792  yyrecoverParseError (yyGLRStack* yystack
1792                yyrule = yydefaultAction (yystate);                yyrule = yydefaultAction (yystate);
1793                if (yyrule == 0)                if (yyrule == 0)
1794                  {                  {
1795                    yyreportParseError (&yystack, yylvalp, yyllocp]b4_user_args[);                    yyreportSyntaxError (&yystack, yylvalp, yyllocp]b4_user_args[);
1796                    goto yyuser_error;                    goto yyuser_error;
1797                  }                  }
1798                YYCHK1 (yyglrReduce (&yystack, 0, yyrule, yytrue]b4_lpure_args[));                YYCHK1 (yyglrReduce (&yystack, 0, yyrule, yytrue]b4_lpure_args[));
# Line 1827  yyrecoverParseError (yyGLRStack* yystack Line 1823  yyrecoverParseError (yyGLRStack* yystack
1823                  }                  }
1824                else if (yyisErrorAction (yyaction))                else if (yyisErrorAction (yyaction))
1825                  {                  {
1826                    yyreportParseError (&yystack, yylvalp, yyllocp]b4_user_args[);                    yyreportSyntaxError (&yystack, yylvalp, yyllocp]b4_user_args[);
1827                    goto yyuser_error;                    goto yyuser_error;
1828                  }                  }
1829                else                else
# Line 1852  yyrecoverParseError (yyGLRStack* yystack Line 1848  yyrecoverParseError (yyGLRStack* yystack
1848                  yyFail (&yystack][]b4_lpure_args[, "syntax error");                  yyFail (&yystack][]b4_lpure_args[, "syntax error");
1849                YYCHK1 (yyresolveStack (&yystack]b4_user_args[));                YYCHK1 (yyresolveStack (&yystack]b4_user_args[));
1850                YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));                YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
1851                yyreportParseError (&yystack, yylvalp, yyllocp]b4_user_args[);                yyreportSyntaxError (&yystack, yylvalp, yyllocp]b4_user_args[);
1852                goto yyuser_error;                goto yyuser_error;
1853              }              }
1854            else if (yystack.yytops.yysize == 1)            else if (yystack.yytops.yysize == 1)
# Line 1865  yyrecoverParseError (yyGLRStack* yystack Line 1861  yyrecoverParseError (yyGLRStack* yystack
1861          }          }
1862        continue;        continue;
1863      yyuser_error:      yyuser_error:
1864        yyrecoverParseError (&yystack, yylvalp, yyllocp]b4_user_args[);        yyrecoverSyntaxError (&yystack, yylvalp, yyllocp]b4_user_args[);
1865        yyposn = yystack.yytops.yystates[0]->yyposn;        yyposn = yystack.yytops.yystates[0]->yyposn;
1866      }      }
1867   yyDone:   yyDone:

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40

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