/[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.13 by akim, Sun Oct 13 18:50:40 2002 UTC revision 1.14 by akim, Sun Oct 13 19:40:30 2002 UTC
# Line 757  yyhasResolvedValue (yyGLRState* yystate) Line 757  yyhasResolvedValue (yyGLRState* yystate)
757    
758  static void  static void
759  yyaddDeferredAction (yyGLRStack* yystack, yyGLRState* yystate,  yyaddDeferredAction (yyGLRStack* yystack, yyGLRState* yystate,
760                       yyGLRState* yyrhs, yyRuleNum yyrule)                       yyGLRState* rhs, yyRuleNum yyrule)
761  {  {
762    yySemanticOption* yynewItem;    yySemanticOption* yynewItem;
763    yynewItem = &yystack->yynextFree->yyoption;    yynewItem = &yystack->yynextFree->yyoption;
764    yystack->yyspaceLeft -= 1;    yystack->yyspaceLeft -= 1;
765    yystack->yynextFree += 1;    yystack->yynextFree += 1;
766    yynewItem->yyisState = yyfalse;    yynewItem->yyisState = yyfalse;
767    yynewItem->yystate = yyrhs;    yynewItem->yystate = rhs;
768    yynewItem->yyrule = yyrule;    yynewItem->yyrule = yyrule;
769    yynewItem->yynext = yystate->yysemantics.yyfirstVal;    yynewItem->yynext = yystate->yysemantics.yyfirstVal;
770    yystate->yysemantics.yyfirstVal = yynewItem;    yystate->yysemantics.yyfirstVal = yynewItem;
# Line 967  yyglrShift (yyGLRStack* yystack, int yyk Line 967  yyglrShift (yyGLRStack* yystack, int yyk
967   * the (unresolved) semantic value of RHS under the action for RULE. */   * the (unresolved) semantic value of RHS under the action for RULE. */
968  static inline void  static inline void
969  yyglrShiftDefer (yyGLRStack* yystack, int yyk, yyStateNum yylrState,  yyglrShiftDefer (yyGLRStack* yystack, int yyk, yyStateNum yylrState,
970                   size_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule)                   size_t yyposn, yyGLRState* rhs, yyRuleNum yyrule)
971  {  {
972    yyGLRStackItem* yynewItem;    yyGLRStackItem* yynewItem;
973    
# Line 981  yyglrShiftDefer (yyGLRStack* yystack, in Line 981  yyglrShiftDefer (yyGLRStack* yystack, in
981    yystack->yytops.yystates[yyk] = &yynewItem->yystate;    yystack->yytops.yystates[yyk] = &yynewItem->yystate;
982    yystack->yynextFree += 1;    yystack->yynextFree += 1;
983    yystack->yyspaceLeft -= 1;    yystack->yyspaceLeft -= 1;
984    yyaddDeferredAction (yystack, &yynewItem->yystate, yyrhs, yyrule);    yyaddDeferredAction (yystack, &yynewItem->yystate, rhs, yyrule);
985  }  }
986    
987  /** Pop the symbols consumed by reduction #RULE from the top of stack  /** Pop the symbols consumed by reduction #RULE from the top of stack
# Line 999  yydoAction (yyGLRStack* yystack, int yyk Line 999  yydoAction (yyGLRStack* yystack, int yyk
999    if (yystack->yysplitPoint == NULL)    if (yystack->yysplitPoint == NULL)
1000      {      {
1001        /* Standard special case: single stack. */        /* Standard special case: single stack. */
1002        yyGLRStackItem* yyrhs = (yyGLRStackItem*) yystack->yytops.yystates[yyk];        yyGLRStackItem* rhs = (yyGLRStackItem*) yystack->yytops.yystates[yyk];
1003        assert (yyk == 0);        assert (yyk == 0);
1004        yystack->yynextFree -= yynrhs;        yystack->yynextFree -= yynrhs;
1005        yystack->yyspaceLeft += yynrhs;        yystack->yyspaceLeft += yynrhs;
# Line 1011  yydoAction (yyGLRStack* yystack, int yyk Line 1011  yydoAction (yyGLRStack* yystack, int yyk
1011          }          }
1012        else        else
1013          {          {
1014            *yyvalp = yyrhs[1-yynrhs].yystate.yysemantics.yysval;            *yyvalp = rhs[1-yynrhs].yystate.yysemantics.yysval;
1015            *yylocp = yyrhs[1-yynrhs].yystate.yyloc;            *yylocp = rhs[1-yynrhs].yystate.yyloc;
1016          }          }
1017        return yyuserAction (yyrule, yynrhs, yyrhs, yyvalp, yylocp, yystack);        return yyuserAction (yyrule, yynrhs, rhs, yyvalp, yylocp, yystack);
1018      }      }
1019    else    else
1020      {      {
# Line 1273  yyresolveAction (yySemanticOption* yyopt Line 1273  yyresolveAction (yySemanticOption* yyopt
1273  }  }
1274    
1275  #if YYDEBUG  #if YYDEBUG
1276    /* FIXME: How can we initialize the lloc bit?  */
1277  static yyGLRState YYLEFTMOST_STATE = { 0, 0, -1, NULL, 0, { NULL } };  static yyGLRState YYLEFTMOST_STATE = { 0, 0, -1, NULL, 0, { NULL } };
1278    
1279  static void yyreportTree (yySemanticOption* yyx, int yyindent)  static void yyreportTree (yySemanticOption* yyx, int yyindent)

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

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