* src/symtab.c (symbol_check_alias_consistency): Also check

type names, destructors, and printers.
Reported by Alexandre Duret-Lutz.
Recode the handling of associativity and precedence in terms
of symbol_precedence_set.
Accept no redeclaration at all, not even equal to the previous
value.
(redeclaration): New.
Use it to factor redeclaration complaints.
(symbol_make_alias): Don't set the type of the alias, let
symbol_check_alias_consistency do it as for other features.
* src/symtab.h (symbol): Add new member prec_location, and
type_location.
* src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
* tests/input.at (Incompatible Aliases): New.
This commit is contained in:
Akim Demaille
2004-10-11 09:03:55 +00:00
parent 2ed24dd8c7
commit df09ef2e8f
4 changed files with 128 additions and 39 deletions

View File

@@ -46,6 +46,9 @@ typedef short int symbol_number;
typedef struct symbol symbol;
/* When extending this structure, be sure to complete
symbol_check_alias_consistency. */
struct symbol
{
/* The key, name of the symbol. */
@@ -55,12 +58,16 @@ struct symbol
/* Its %type and associated printer and destructor. */
uniqstr type_name;
location type_location;
char *destructor;
location destructor_location;
char *printer;
location printer_location;
symbol_number number;
location prec_location;
short int prec;
assoc assoc;
int user_token_number;