[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.6 and 1.7

version 1.6, 2001/07/16 06:29:44 version 1.7, 2001/11/19 19:02:18
Line 80 
Line 80 
 void  void
 make_parser()  make_parser()
 {  {
     register int i;      int i;
   
     parser = NEW2(nstates, action *);      parser = NEW2(nstates, action *);
     for (i = 0; i < nstates; i++)      for (i = 0; i < nstates; i++)
Line 96 
Line 96 
   
 action *  action *
 parse_actions(stateno)  parse_actions(stateno)
 register int stateno;  int stateno;
 {  {
     register action *actions;      action *actions;
   
     actions = get_shifts(stateno);      actions = get_shifts(stateno);
     actions = add_reductions(stateno, actions);      actions = add_reductions(stateno, actions);
Line 110 
Line 110 
 get_shifts(stateno)  get_shifts(stateno)
 int stateno;  int stateno;
 {  {
     register action *actions, *temp;      action *actions, *temp;
     register shifts *sp;      shifts *sp;
     register short *to_state;      short *to_state;
     register int i, k;      int i, k;
     register int symbol;      int symbol;
   
     actions = 0;      actions = 0;
     sp = shift_table[stateno];      sp = shift_table[stateno];
Line 144 
Line 144 
 action *  action *
 add_reductions(stateno, actions)  add_reductions(stateno, actions)
 int stateno;  int stateno;
 register action *actions;  action *actions;
 {  {
     register int i, j, m, n;      int i, j, m, n;
     register int ruleno, tokensetsize;      int ruleno, tokensetsize;
     register unsigned *rowp;      unsigned *rowp;
   
     tokensetsize = WORDSIZE(ntokens);      tokensetsize = WORDSIZE(ntokens);
     m = lookaheads[stateno];      m = lookaheads[stateno];
Line 169 
Line 169 
   
 action *  action *
 add_reduce(actions, ruleno, symbol)  add_reduce(actions, ruleno, symbol)
 register action *actions;  action *actions;
 register int ruleno, symbol;  int ruleno, symbol;
 {  {
     register action *temp, *prev, *next;      action *temp, *prev, *next;
   
     prev = 0;      prev = 0;
     for (next = actions; next && next->symbol < symbol; next = next->next)      for (next = actions; next && next->symbol < symbol; next = next->next)
Line 211 
Line 211 
 void  void
 find_final_state()  find_final_state()
 {  {
     register int goal, i;      int goal, i;
     register short *to_state;      short *to_state;
     register shifts *p;      shifts *p;
   
     p = shift_table[0];      p = shift_table[0];
     to_state = p->shift;      to_state = p->shift;
Line 229 
Line 229 
 void  void
 unused_rules()  unused_rules()
 {  {
     register int i;      int i;
     register action *p;      action *p;
   
     rules_used = (short *) MALLOC(nrules*sizeof(short));      rules_used = (short *) MALLOC(nrules*sizeof(short));
     if (rules_used == 0) no_space();      if (rules_used == 0) no_space();
Line 264 
Line 264 
 void  void
 remove_conflicts()  remove_conflicts()
 {  {
     register int i;      int i;
     register int symbol;      int symbol;
     register action *p, *pref;      action *p, *pref;
   
     SRtotal = 0;      SRtotal = 0;
     RRtotal = 0;      RRtotal = 0;
Line 362 
Line 362 
 sole_reduction(stateno)  sole_reduction(stateno)
 int stateno;  int stateno;
 {  {
     register int count, ruleno;      int count, ruleno;
     register action *p;      action *p;
   
     count = 0;      count = 0;
     ruleno = 0;      ruleno = 0;
Line 390 
Line 390 
 void  void
 defreds()  defreds()
 {  {
     register int i;      int i;
   
     defred = NEW2(nstates, short);      defred = NEW2(nstates, short);
     for (i = 0; i < nstates; i++)      for (i = 0; i < nstates; i++)
Line 399 
Line 399 
   
 void  void
 free_action_row(p)  free_action_row(p)
 register action *p;  action *p;
 {  {
   register action *q;    action *q;
   
   while (p)    while (p)
     {      {
Line 414 
Line 414 
 void  void
 free_parser()  free_parser()
 {  {
   register int i;    int i;
   
   for (i = 0; i < nstates; i++)    for (i = 0; i < nstates; i++)
     free_action_row(parser[i]);      free_action_row(parser[i]);

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7