/[bison]/bison/src/output.c
ViewVC logotype

Diff of /bison/src/output.c

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

revision 1.141 by akim, Sun Apr 7 17:43:41 2002 UTC revision 1.142 by akim, Sun Apr 7 17:44:59 2002 UTC
# Line 147  get_lines_number (const char *s) Line 147  get_lines_number (const char *s)
147  }  }
148    
149    
150  /* FIXME. */  /*----------------------------------------------------------------.
151    | Format the FIRST and then TABLE_DATA[BEGIN..END[ into OOUT, and |
152    | return the number of bits needed for its longuest value.        |
153    `----------------------------------------------------------------*/
154    
155  static inline void  static inline long int
156  output_table_data (struct obstack *oout,  output_table_data (struct obstack *oout,
157                     short *table_data,                     short *table_data,
158                     short first,                     short first,
159                     int begin,                     int begin,
160                     int end)                     int end)
161  {  {
162      long int max = first;
163    int i;    int i;
164    int j = 1;    int j = 1;
165    
# Line 171  output_table_data (struct obstack *oout, Line 175  output_table_data (struct obstack *oout,
175        else        else
176          ++j;          ++j;
177        obstack_fgrow1 (oout, "%6d", table_data[i]);        obstack_fgrow1 (oout, "%6d", table_data[i]);
178          if (table_data[i] > max)
179            max = table_data[i];
180      }      }
181    obstack_1grow (oout, 0);    obstack_1grow (oout, 0);
182    
183      return max;
184  }  }
185    
186    
# Line 184  output_table_data (struct obstack *oout, Line 192  output_table_data (struct obstack *oout,
192  static void  static void
193  prepare_tokens (void)  prepare_tokens (void)
194  {  {
195    output_table_data (&format_obstack, token_translations,    long int max = output_table_data (&format_obstack, token_translations,
196                       0, 1, max_user_token_number + 1);                                      0, 1, max_user_token_number + 1);
197    muscle_insert ("translate", obstack_finish (&format_obstack));    muscle_insert ("translate", obstack_finish (&format_obstack));
198      MUSCLE_INSERT_LONG_INT ("token_number_max", max);
199    XFREE (token_translations);    XFREE (token_translations);
200    
201    {    {

Legend:
Removed from v.1.141  
changed lines
  Added in v.1.142

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