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

Diff of /bison/data/yacc.c

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

revision 1.16 by eggert, Sat Oct 12 23:20:23 2002 UTC revision 1.17 by akim, Sun Oct 13 14:25:14 2002 UTC
# Line 414  static const b4_int_type_for([b4_pgoto]) Line 414  static const b4_int_type_for([b4_pgoto])
414    
415  /* YYTABLE[[YYPACT[STATE-NUM]]].  What to do in state STATE-NUM.  If  /* YYTABLE[[YYPACT[STATE-NUM]]].  What to do in state STATE-NUM.  If
416     positive, shift that token.  If negative, reduce the rule which     positive, shift that token.  If negative, reduce the rule which
417     number is the opposite.  If zero, do what YYDEFACT says.  */     number is the opposite.  If zero, do what YYDEFACT says.
418       If YYTABLE_NINF, parse error.  */
419  #define YYTABLE_NINF b4_table_ninf  #define YYTABLE_NINF b4_table_ninf
420  static const b4_int_type_for([b4_table]) yytable[[]] =  static const b4_int_type_for([b4_table]) yytable[[]] =
421  {  {
# Line 917  yybackup: Line 918  yybackup:
918        YYDPRINTF ((stderr, "\n"));        YYDPRINTF ((stderr, "\n"));
919      }      }
920    
921      /* Set YYN to the action to take in STATE on seeing token YYCHAR1.
922         Result YYN means
923         - YYN < 0:  Reduce on rule -YYN.
924         - YYN = 0:  Error.
925         - YYN > 0:  Shift to state YYN.  */
926    yyn += yychar1;    yyn += yychar1;
927    if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)    if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
928      goto yydefault;      /* Defaulted action (reduction).  */
929        yyn = -yydefact[yystate];
930    yyn = yytable[yyn];    else if (yytable[yyn] != YYTABLE_NINF)
931        yyn = yytable[yyn];
932    /* yyn is what to do for this token type in this state.    else
933       Negative => reduce, -yyn is rule number.      yyn = 0;
      Positive => shift, yyn is new state.  
        New state is final state => don't bother to shift,  
        just return success.  
      0, or most negative number => error.  */  
934    
935    if (yyn < 0)    if (yyn < 0)
936      {      {
       if (yyn == YYTABLE_NINF)  
         goto yyerrlab;  
937        yyn = -yyn;        yyn = -yyn;
938        goto yyreduce;        goto yyreduce;
939      }      }

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

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