-static void
-output_rule_data (void)
-{
- int i;
- int j;
- short *short_tab = NULL;
-
- {
- short *values = XCALLOC (short, nrules + 1);
- for (i = 0; i < nrules + 1; ++i)
- values[i] = rules[i].line;
- output_table_data (&format_obstack, values,
- 0, 1, nrules + 1);
- muscle_insert ("rline", obstack_finish (&format_obstack));
- XFREE (values);
- }
-
-
- j = 0;
- for (i = 0; i < nsyms; i++)
- {
- /* Be sure not to use twice the same quotearg slot. */
- const char *cp =
- quotearg_n_style (1, c_quoting_style,
- quotearg_style (escape_quoting_style, symbols[i]->tag));
- /* Width of the next token, including the two quotes, the coma
- and the space. */
- int strsize = strlen (cp) + 2;
-
- if (j + strsize > 75)
- {
- obstack_sgrow (&format_obstack, "\n ");
- j = 2;
- }
-
- obstack_sgrow (&format_obstack, cp);
- obstack_sgrow (&format_obstack, ", ");
- j += strsize;
- }
- /* Add a NULL entry to list of tokens (well, 0, as NULL might not be
- defined). */
- obstack_sgrow (&format_obstack, "0");
-
- /* Finish table and store. */
- obstack_1grow (&format_obstack, 0);
- muscle_insert ("tname", obstack_finish (&format_obstack));
-
- /* Output YYTOKNUM. */
- {
- short *values = XCALLOC (short, ntokens + 1);
- for (i = 0; i < ntokens + 1; ++i)
- values[i] = symbols[i]->user_token_number;
- output_table_data (&format_obstack, values,
- 0, 1, ntokens + 1);
- muscle_insert ("toknum", obstack_finish (&format_obstack));
- XFREE (values);
- }
-
-
- /* Output YYR1. */
- {
- short *values = XCALLOC (short, nrules + 1);
- for (i = 0; i < nrules + 1; ++i)
- values[i] = rules[i].lhs;
- output_table_data (&format_obstack, values,
- 0, 1, nrules + 1);
- muscle_insert ("r1", obstack_finish (&format_obstack));
- XFREE (values);
- }
-
- /* Output YYR2. */
- short_tab = XMALLOC (short, nrules + 1);
- for (i = 1; i < nrules; i++)
- short_tab[i] = rules[i + 1].rhs - rules[i].rhs - 1;
- short_tab[nrules] = nritems - rules[nrules].rhs - 1;
- output_table_data (&format_obstack, short_tab,
- 0, 1, nrules + 1);
- muscle_insert ("r2", obstack_finish (&format_obstack));
- XFREE (short_tab);
-}
-