Adjust all users to use symbols[i]->user_token_number.
+2001-12-29 Akim Demaille <akim@epita.fr>
+
+ * src/reader.c, src/reader.h (user_toknums): Remove.
+ Adjust all users to use symbols[i]->user_token_number.
+
+
2001-12-29 Akim Demaille <akim@epita.fr>
* src/gram.c, src/gram.h (sprec, sassoc): Remove.
2001-12-29 Akim Demaille <akim@epita.fr>
* src/gram.c, src/gram.h (sprec, sassoc): Remove.
muscle_insert ("tname", obstack_finish (&format_obstack));
/* Output YYTOKNUM. */
muscle_insert ("tname", obstack_finish (&format_obstack));
/* Output YYTOKNUM. */
- output_table_data (&format_obstack, user_toknums,
- 0, 1, ntokens + 1);
- muscle_insert ("toknum", obstack_finish (&format_obstack));
+ {
+ 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);
+ }
+
if (semantic_parser)
output_stos ();
output_rule_data ();
if (semantic_parser)
output_stos ();
output_rule_data ();
output_actions ();
prepare ();
output_actions ();
prepare ();
} symbol_list;
int lineno;
} symbol_list;
int lineno;
static symbol_list *grammar;
static int start_flag;
static bucket *startval;
static symbol_list *grammar;
static int start_flag;
static bucket *startval;
int tokno = 1;
int last_user_token_number;
int tokno = 1;
int last_user_token_number;
- user_toknums = XCALLOC (short, nsyms + 1);
symbols = XCALLOC (bucket *, nsyms);
max_user_token_number = 256;
symbols = XCALLOC (bucket *, nsyms);
max_user_token_number = 256;
}
symbols[bp->value] = bp;
}
symbols[bp->value] = bp;
- user_toknums[bp->value] = bp->user_token_number;
}
token_translations_init ();
}
token_translations_init ();
-extern short *user_toknums;