[BACK]Return to mkpar.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / yacc

Diff for /src/usr.bin/yacc/mkpar.c between version 1.18 and 1.19

version 1.18, 2014/03/13 00:59:34 version 1.19, 2017/05/25 20:11:03
Line 49 
Line 49 
 static int SRcount;  static int SRcount;
 static int RRcount;  static int RRcount;
   
 extern action *parse_actions();  extern action *parse_actions(int);
 extern action *get_shifts();  extern action *get_shifts(int);
 extern action *add_reductions();  extern action *add_reductions(int, action *);
 extern action *add_reduce();  extern action *add_reduce(action *, int, int);
   
 short sole_reduction(int);  short sole_reduction(int);
 void free_action_row(action *);  void free_action_row(action *);
Line 98 
Line 98 
 {  {
         action *actions, *temp;          action *actions, *temp;
         shifts *sp;          shifts *sp;
         short *to_state;          short *tto_state;
         int i, k;          int i, k;
         int symbol;          int symbol;
   
         actions = 0;          actions = 0;
         sp = shift_table[stateno];          sp = shift_table[stateno];
         if (sp) {          if (sp) {
                 to_state = sp->shift;                  tto_state = sp->shift;
                 for (i = sp->nshifts - 1; i >= 0; i--) {                  for (i = sp->nshifts - 1; i >= 0; i--) {
                         k = to_state[i];                          k = tto_state[i];
                         symbol = accessing_symbol[k];                          symbol = accessing_symbol[k];
                         if (ISTOKEN(symbol)) {                          if (ISTOKEN(symbol)) {
                                 temp = NEW(action);                                  temp = NEW(action);
Line 187 
Line 187 
 find_final_state(void)  find_final_state(void)
 {  {
         int goal, i;          int goal, i;
         short *to_state;          short *tto_state;
         shifts *p;          shifts *p;
   
         p = shift_table[0];          p = shift_table[0];
         to_state = p->shift;          tto_state = p->shift;
         goal = ritem[1];          goal = ritem[1];
         for (i = p->nshifts - 1; i >= 0; --i) {          for (i = p->nshifts - 1; i >= 0; --i) {
                 final_state = to_state[i];                  final_state = tto_state[i];
                 if (accessing_symbol[final_state] == goal)                  if (accessing_symbol[final_state] == goal)
                         break;                          break;
         }          }

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19