* src/reader.h, src/reader.c (symbol_list_new): Export it.

(symbol_list_prepend): New.
* src/parse-gram.y (%union): `list' is a new member.
(symbols.1): New, replaces...
(terms_to_prec.1, nterms_to_type.1): these.
* src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
Take a location as additional argument.
Adjust all callers.
This commit is contained in:
Akim Demaille
2002-06-17 07:04:24 +00:00
parent 74886d31e7
commit 1e0bab9276
8 changed files with 284 additions and 271 deletions

View File

@@ -54,12 +54,13 @@ typedef short symbol_number_t;
typedef struct symbol_s symbol_t;
struct symbol_s
{
/* The key, name of the symbol. */
/* The key, name of the symbol. */
char *tag;
/* Its type. */
/* Its %type. */
char *type_name;
/* The location of its first occurence. */
/* The location of its first occurence. */
location_t location;
symbol_number_t number;
@@ -106,11 +107,12 @@ void symbol_make_alias PARAMS ((symbol_t *symbol, symbol_t *symval));
/* Set the TYPE_NAME associated to SYMBOL. Does nothing if passed 0 as
TYPE_NAME. */
void symbol_type_set PARAMS ((symbol_t *symbol, char *type_name));
void symbol_type_set PARAMS ((symbol_t *symbol, location_t location,
char *type_name));
/* Set the PRECEDENCE associated to SYMBOL. Ensures that SYMBOL is a
terminal. Does nothing if invoked with UNDEF_ASSOC as ASSOC. */
void symbol_precedence_set PARAMS ((symbol_t *symbol,
void symbol_precedence_set PARAMS ((symbol_t *symbol, location_t location,
int prec, associativity assoc));
/* Set the CLASS associated to SYMBOL. */