* 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

@@ -102,12 +102,13 @@ symbol_tag_print (symbol_t *symbol, FILE *out)
`------------------------------------------------------------------*/
void
symbol_type_set (symbol_t *symbol, char *type_name)
symbol_type_set (symbol_t *symbol, location_t location, char *type_name)
{
if (type_name)
{
if (symbol->type_name)
complain (_("type redeclaration for %s"), symbol->tag);
complain_at (location,
_("type redeclaration for %s"), symbol->tag);
symbol->type_name = type_name;
}
}
@@ -119,13 +120,14 @@ symbol_type_set (symbol_t *symbol, char *type_name)
`------------------------------------------------------------------*/
void
symbol_precedence_set (symbol_t *symbol,
symbol_precedence_set (symbol_t *symbol, location_t location,
int prec, associativity assoc)
{
if (assoc != undef_assoc)
{
if (symbol->prec != 0)
complain (_("redefining precedence of %s"), symbol->tag);
complain_at (location,
_("redefining precedence of %s"), symbol->tag);
symbol->prec = prec;
symbol->assoc = assoc;
}