1 /* Symbol table manager for Bison.
3 Copyright (C) 1984, 1989, 2000-2002, 2004-2012 Free Software
6 This file is part of Bison, the GNU Compiler Compiler.
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
30 /*-------------------------------------------------------------------.
31 | Symbols sorted by tag. Allocated by the first invocation of |
32 | symbols_do, after which no more symbols should be created. |
33 `-------------------------------------------------------------------*/
35 static symbol
**symbols_sorted
= NULL
;
37 /*------------------------.
38 | Distinguished symbols. |
39 `------------------------*/
41 symbol
*errtoken
= NULL
;
42 symbol
*undeftoken
= NULL
;
43 symbol
*endtoken
= NULL
;
44 symbol
*accept
= NULL
;
45 symbol
*startsymbol
= NULL
;
46 location startsymbol_location
;
48 /*---------------------------------------.
49 | Default %destructor's and %printer's. |
50 `---------------------------------------*/
52 static code_props default_tagged_destructor
= CODE_PROPS_NONE_INIT
;
53 static code_props default_tagless_destructor
= CODE_PROPS_NONE_INIT
;
54 static code_props default_tagged_printer
= CODE_PROPS_NONE_INIT
;
55 static code_props default_tagless_printer
= CODE_PROPS_NONE_INIT
;
57 /*---------------------------------.
58 | Create a new symbol, named TAG. |
59 `---------------------------------*/
62 symbol_new (uniqstr tag
, location loc
)
64 symbol
*res
= xmalloc (sizeof *res
);
68 /* If the tag is not a string (starts with a double quote), check
69 that it is valid for Yacc. */
70 if (tag
[0] != '\"' && tag
[0] != '\'' && mbschr (tag
, '-'))
71 yacc_at (loc
, _("POSIX Yacc forbids dashes in symbol names: %s"),
77 res
->type_name
= NULL
;
78 code_props_none_init (&res
->destructor
);
79 code_props_none_init (&res
->printer
);
81 res
->number
= NUMBER_UNDEFINED
;
83 res
->assoc
= undef_assoc
;
84 res
->user_token_number
= USER_NUMBER_UNDEFINED
;
87 res
->class = unknown_sym
;
88 res
->declared
= false;
90 if (nsyms
== SYMBOL_NUMBER_MAXIMUM
)
91 fatal (_("too many symbols in input grammar (limit is %d)"),
92 SYMBOL_NUMBER_MAXIMUM
);
97 /*----------------------------------------.
98 | Create a new semantic type, named TAG. |
99 `----------------------------------------*/
101 static semantic_type
*
102 semantic_type_new (uniqstr tag
)
104 semantic_type
*res
= xmalloc (sizeof *res
);
106 uniqstr_assert (tag
);
108 code_props_none_init (&res
->destructor
);
109 code_props_none_init (&res
->printer
);
119 #define SYMBOL_ATTR_PRINT(Attr) \
121 fprintf (f, " %s { %s }", #Attr, s->Attr)
123 #define SYMBOL_CODE_PRINT(Attr) \
125 fprintf (f, " %s { %s }", #Attr, s->Attr.code)
128 symbol_print (symbol
*s
, FILE *f
)
132 fprintf (f
, "\"%s\"", s
->tag
);
133 SYMBOL_ATTR_PRINT (type_name
);
134 SYMBOL_CODE_PRINT (destructor
);
135 SYMBOL_CODE_PRINT (printer
);
138 fprintf (f
, "<NULL>");
141 #undef SYMBOL_ATTR_PRINT
142 #undef SYMBOL_CODE_PRINT
144 /*------------------------------------------------------------------.
145 | Complain that S's WHAT is redeclared at SECOND, and was first set |
147 `------------------------------------------------------------------*/
150 symbol_redeclaration (symbol
*s
, const char *what
, location first
,
154 complain_at_indent (second
, &i
, _("%s redeclaration for %s"), what
, s
->tag
);
156 complain_at_indent (first
, &i
, _("previous declaration"));
160 semantic_type_redeclaration (semantic_type
*s
, const char *what
, location first
,
164 complain_at_indent (second
, &i
, _("%s redeclaration for <%s>"), what
, s
->tag
);
166 complain_at_indent (first
, &i
, _("previous declaration"));
171 /*-----------------------------------------------------------------.
172 | Set the TYPE_NAME associated with SYM. Does nothing if passed 0 |
174 `-----------------------------------------------------------------*/
177 symbol_type_set (symbol
*sym
, uniqstr type_name
, location loc
)
182 symbol_redeclaration (sym
, "%type", sym
->type_location
, loc
);
183 uniqstr_assert (type_name
);
184 sym
->type_name
= type_name
;
185 sym
->type_location
= loc
;
189 /*-----------------------------------------.
190 | Set the DESTRUCTOR associated with SYM. |
191 `-----------------------------------------*/
194 symbol_destructor_set (symbol
*sym
, code_props
const *destructor
)
196 if (sym
->destructor
.code
)
197 symbol_redeclaration (sym
, "%destructor", sym
->destructor
.location
,
198 destructor
->location
);
199 sym
->destructor
= *destructor
;
202 /*------------------------------------------.
203 | Set the DESTRUCTOR associated with TYPE. |
204 `------------------------------------------*/
207 semantic_type_destructor_set (semantic_type
*type
,
208 code_props
const *destructor
)
210 if (type
->destructor
.code
)
211 semantic_type_redeclaration (type
, "%destructor",
212 type
->destructor
.location
,
213 destructor
->location
);
214 type
->destructor
= *destructor
;
217 /*---------------------------------------.
218 | Get the computed %destructor for SYM. |
219 `---------------------------------------*/
222 symbol_destructor_get (symbol
const *sym
)
224 /* Per-symbol %destructor. */
225 if (sym
->destructor
.code
)
226 return &sym
->destructor
;
228 /* Per-type %destructor. */
231 code_props
const *destructor
=
232 &semantic_type_get (sym
->type_name
)->destructor
;
233 if (destructor
->code
)
237 /* Apply default %destructor's only to user-defined symbols. */
238 if (sym
->tag
[0] == '$' || sym
== errtoken
)
239 return &code_props_none
;
242 return &default_tagged_destructor
;
243 return &default_tagless_destructor
;
246 /*--------------------------------------.
247 | Set the PRINTER associated with SYM. |
248 `--------------------------------------*/
251 symbol_printer_set (symbol
*sym
, code_props
const *printer
)
253 if (sym
->printer
.code
)
254 symbol_redeclaration (sym
, "%printer",
255 sym
->printer
.location
, printer
->location
);
256 sym
->printer
= *printer
;
259 /*---------------------------------------.
260 | Set the PRINTER associated with TYPE. |
261 `---------------------------------------*/
264 semantic_type_printer_set (semantic_type
*type
, code_props
const *printer
)
266 if (type
->printer
.code
)
267 semantic_type_redeclaration (type
, "%printer",
268 type
->printer
.location
, printer
->location
);
269 type
->printer
= *printer
;
272 /*------------------------------------.
273 | Get the computed %printer for SYM. |
274 `------------------------------------*/
277 symbol_printer_get (symbol
const *sym
)
279 /* Per-symbol %printer. */
280 if (sym
->printer
.code
)
281 return &sym
->printer
;
283 /* Per-type %printer. */
286 code_props
const *printer
= &semantic_type_get (sym
->type_name
)->printer
;
291 /* Apply the default %printer only to user-defined symbols. */
292 if (sym
->tag
[0] == '$' || sym
== errtoken
)
293 return &code_props_none
;
296 return &default_tagged_printer
;
297 return &default_tagless_printer
;
300 /*-----------------------------------------------------------------.
301 | Set the PRECEDENCE associated with SYM. Does nothing if invoked |
302 | with UNDEF_ASSOC as ASSOC. |
303 `-----------------------------------------------------------------*/
306 symbol_precedence_set (symbol
*sym
, int prec
, assoc a
, location loc
)
308 if (a
!= undef_assoc
)
311 symbol_redeclaration (sym
, assoc_to_string (a
), sym
->prec_location
,
315 sym
->prec_location
= loc
;
318 /* Only terminals have a precedence. */
319 symbol_class_set (sym
, token_sym
, loc
, false);
323 /*------------------------------------.
324 | Set the CLASS associated with SYM. |
325 `------------------------------------*/
328 symbol_class_set (symbol
*sym
, symbol_class
class, location loc
, bool declaring
)
330 if (sym
->class != unknown_sym
&& sym
->class != class)
332 complain_at (loc
, _("symbol %s redefined"), sym
->tag
);
333 sym
->declared
= false;
336 if (class == nterm_sym
&& sym
->class != nterm_sym
)
337 sym
->number
= nvars
++;
338 else if (class == token_sym
&& sym
->number
== NUMBER_UNDEFINED
)
339 sym
->number
= ntokens
++;
346 warn_at (loc
, _("symbol %s redeclared"), sym
->tag
);
347 sym
->declared
= true;
352 /*------------------------------------------------.
353 | Set the USER_TOKEN_NUMBER associated with SYM. |
354 `------------------------------------------------*/
357 symbol_user_token_number_set (symbol
*sym
, int user_token_number
, location loc
)
359 int *user_token_numberp
;
361 if (sym
->user_token_number
!= USER_NUMBER_HAS_STRING_ALIAS
)
362 user_token_numberp
= &sym
->user_token_number
;
364 user_token_numberp
= &sym
->alias
->user_token_number
;
365 if (*user_token_numberp
!= USER_NUMBER_UNDEFINED
366 && *user_token_numberp
!= user_token_number
)
367 complain_at (loc
, _("redefining user token number of %s"), sym
->tag
);
369 *user_token_numberp
= user_token_number
;
370 /* User defined $end token? */
371 if (user_token_number
== 0)
374 /* It is always mapped to 0, so it was already counted in
376 if (endtoken
->number
!= NUMBER_UNDEFINED
)
378 endtoken
->number
= 0;
383 /*----------------------------------------------------------.
384 | If SYM is not defined, report an error, and consider it a |
386 `----------------------------------------------------------*/
389 symbol_check_defined (symbol
*sym
)
391 if (sym
->class == unknown_sym
)
395 _("symbol %s is used, but is not defined as a token and has no rules"),
397 sym
->class = nterm_sym
;
398 sym
->number
= nvars
++;
405 symbol_check_defined_processor (void *sym
, void *null ATTRIBUTE_UNUSED
)
407 return symbol_check_defined (sym
);
412 symbol_make_alias (symbol
*sym
, symbol
*str
, location loc
)
415 warn_at (loc
, _("symbol %s used more than once as a literal string"),
418 warn_at (loc
, _("symbol %s given more than one literal string"),
422 str
->class = token_sym
;
423 str
->user_token_number
= sym
->user_token_number
;
424 sym
->user_token_number
= USER_NUMBER_HAS_STRING_ALIAS
;
427 str
->number
= sym
->number
;
428 symbol_type_set (str
, sym
->type_name
, loc
);
433 /*---------------------------------------------------------.
434 | Check that THIS, and its alias, have same precedence and |
436 `---------------------------------------------------------*/
439 symbol_check_alias_consistency (symbol
*this)
442 symbol
*str
= this->alias
;
444 /* Check only the symbol in the symbol-string pair. */
446 && this->user_token_number
== USER_NUMBER_HAS_STRING_ALIAS
))
449 if (str
->type_name
!= sym
->type_name
)
452 symbol_type_set (sym
, str
->type_name
, str
->type_location
);
454 symbol_type_set (str
, sym
->type_name
, sym
->type_location
);
458 if (str
->destructor
.code
|| sym
->destructor
.code
)
460 if (str
->destructor
.code
)
461 symbol_destructor_set (sym
, &str
->destructor
);
463 symbol_destructor_set (str
, &sym
->destructor
);
466 if (str
->printer
.code
|| sym
->printer
.code
)
468 if (str
->printer
.code
)
469 symbol_printer_set (sym
, &str
->printer
);
471 symbol_printer_set (str
, &sym
->printer
);
474 if (sym
->prec
|| str
->prec
)
477 symbol_precedence_set (sym
, str
->prec
, str
->assoc
,
480 symbol_precedence_set (str
, sym
->prec
, sym
->assoc
,
486 symbol_check_alias_consistency_processor (void *this,
487 void *null ATTRIBUTE_UNUSED
)
489 symbol_check_alias_consistency (this);
494 /*-------------------------------------------------------------------.
495 | Assign a symbol number, and write the definition of the token name |
496 | into FDEFINES. Put in SYMBOLS. |
497 `-------------------------------------------------------------------*/
500 symbol_pack (symbol
*this)
502 aver (this->number
!= NUMBER_UNDEFINED
);
503 if (this->class == nterm_sym
)
504 this->number
+= ntokens
;
505 else if (this->user_token_number
== USER_NUMBER_HAS_STRING_ALIAS
)
508 symbols
[this->number
] = this;
513 symbol_pack_processor (void *this, void *null ATTRIBUTE_UNUSED
)
515 return symbol_pack (this);
520 user_token_number_redeclaration (int num
, symbol
*first
, symbol
*second
)
523 /* User token numbers are not assigned during the parsing, but in a
524 second step, via a traversal of the symbol table sorted on tag.
526 However, error messages make more sense if we keep the first
527 declaration first. */
528 if (location_cmp (first
->location
, second
->location
) > 0)
534 complain_at_indent (second
->location
, &i
,
535 _("user token number %d redeclaration for %s"),
538 complain_at_indent (first
->location
, &i
,
539 _("previous declaration for %s"),
543 /*--------------------------------------------------.
544 | Put THIS in TOKEN_TRANSLATIONS if it is a token. |
545 `--------------------------------------------------*/
548 symbol_translation (symbol
*this)
551 if (this->class == token_sym
552 && this->user_token_number
!= USER_NUMBER_HAS_STRING_ALIAS
)
554 /* A token which translation has already been set? */
555 if (token_translations
[this->user_token_number
] != undeftoken
->number
)
556 user_token_number_redeclaration
557 (this->user_token_number
,
558 symbols
[token_translations
[this->user_token_number
]],
561 token_translations
[this->user_token_number
] = this->number
;
568 symbol_translation_processor (void *this, void *null ATTRIBUTE_UNUSED
)
570 return symbol_translation (this);
574 /*---------------------------------------.
575 | Symbol and semantic type hash tables. |
576 `---------------------------------------*/
578 /* Initial capacity of symbol and semantic type hash table. */
579 #define HT_INITIAL_CAPACITY 257
581 static struct hash_table
*symbol_table
= NULL
;
582 static struct hash_table
*semantic_type_table
= NULL
;
585 hash_compare_symbol (const symbol
*m1
, const symbol
*m2
)
587 /* Since tags are unique, we can compare the pointers themselves. */
588 return UNIQSTR_EQ (m1
->tag
, m2
->tag
);
592 hash_compare_semantic_type (const semantic_type
*m1
, const semantic_type
*m2
)
594 /* Since names are unique, we can compare the pointers themselves. */
595 return UNIQSTR_EQ (m1
->tag
, m2
->tag
);
599 hash_symbol_comparator (void const *m1
, void const *m2
)
601 return hash_compare_symbol (m1
, m2
);
605 hash_semantic_type_comparator (void const *m1
, void const *m2
)
607 return hash_compare_semantic_type (m1
, m2
);
611 hash_symbol (const symbol
*m
, size_t tablesize
)
613 /* Since tags are unique, we can hash the pointer itself. */
614 return ((uintptr_t) m
->tag
) % tablesize
;
618 hash_semantic_type (const semantic_type
*m
, size_t tablesize
)
620 /* Since names are unique, we can hash the pointer itself. */
621 return ((uintptr_t) m
->tag
) % tablesize
;
625 hash_symbol_hasher (void const *m
, size_t tablesize
)
627 return hash_symbol (m
, tablesize
);
631 hash_semantic_type_hasher (void const *m
, size_t tablesize
)
633 return hash_semantic_type (m
, tablesize
);
636 /*-------------------------------.
637 | Create the symbol hash table. |
638 `-------------------------------*/
643 symbol_table
= hash_initialize (HT_INITIAL_CAPACITY
,
646 hash_symbol_comparator
,
648 semantic_type_table
= hash_initialize (HT_INITIAL_CAPACITY
,
650 hash_semantic_type_hasher
,
651 hash_semantic_type_comparator
,
656 /*----------------------------------------------------------------.
657 | Find the symbol named KEY, and return it. If it does not exist |
659 `----------------------------------------------------------------*/
662 symbol_from_uniqstr (const uniqstr key
, location loc
)
668 entry
= hash_lookup (symbol_table
, &probe
);
672 /* First insertion in the hash. */
673 aver (!symbols_sorted
);
674 entry
= symbol_new (key
, loc
);
675 if (!hash_insert (symbol_table
, entry
))
682 /*-----------------------------------------------------------------------.
683 | Find the semantic type named KEY, and return it. If it does not exist |
685 `-----------------------------------------------------------------------*/
688 semantic_type_from_uniqstr (const uniqstr key
)
691 semantic_type
*entry
;
694 entry
= hash_lookup (semantic_type_table
, &probe
);
698 /* First insertion in the hash. */
699 entry
= semantic_type_new (key
);
700 if (!hash_insert (semantic_type_table
, entry
))
707 /*----------------------------------------------------------------.
708 | Find the symbol named KEY, and return it. If it does not exist |
710 `----------------------------------------------------------------*/
713 symbol_get (const char *key
, location loc
)
715 return symbol_from_uniqstr (uniqstr_new (key
), loc
);
719 /*-----------------------------------------------------------------------.
720 | Find the semantic type named KEY, and return it. If it does not exist |
722 `-----------------------------------------------------------------------*/
725 semantic_type_get (const char *key
)
727 return semantic_type_from_uniqstr (uniqstr_new (key
));
731 /*------------------------------------------------------------------.
732 | Generate a dummy nonterminal, whose name cannot conflict with the |
734 `------------------------------------------------------------------*/
737 dummy_symbol_get (location loc
)
739 /* Incremented for each generated symbol. */
740 static int dummy_count
= 0;
741 static char buf
[256];
745 sprintf (buf
, "$@%d", ++dummy_count
);
746 sym
= symbol_get (buf
, loc
);
747 sym
->class = nterm_sym
;
748 sym
->number
= nvars
++;
753 symbol_is_dummy (const symbol
*sym
)
755 return sym
->tag
[0] == '@' || (sym
->tag
[0] == '$' && sym
->tag
[1] == '@');
758 /*-------------------.
759 | Free the symbols. |
760 `-------------------*/
765 hash_free (symbol_table
);
766 hash_free (semantic_type_table
);
768 free (symbols_sorted
);
772 /*---------------------------------------------------------------.
773 | Look for undefined symbols, report an error, and consider them |
775 `---------------------------------------------------------------*/
778 symbols_cmp (symbol
const *a
, symbol
const *b
)
780 return strcmp (a
->tag
, b
->tag
);
784 symbols_cmp_qsort (void const *a
, void const *b
)
786 return symbols_cmp (*(symbol
* const *)a
, *(symbol
* const *)b
);
790 symbols_do (Hash_processor processor
, void *processor_data
)
792 size_t count
= hash_get_n_entries (symbol_table
);
795 symbols_sorted
= xnmalloc (count
, sizeof *symbols_sorted
);
796 hash_get_entries (symbol_table
, (void**)symbols_sorted
, count
);
797 qsort (symbols_sorted
, count
, sizeof *symbols_sorted
,
802 for (i
= 0; i
< count
; ++i
)
803 processor (symbols_sorted
[i
], processor_data
);
807 /*--------------------------------------------------------------.
808 | Check that all the symbols are defined. Report any undefined |
809 | symbols and consider them nonterminals. |
810 `--------------------------------------------------------------*/
813 symbols_check_defined (void)
815 symbols_do (symbol_check_defined_processor
, NULL
);
818 /*------------------------------------------------------------------.
819 | Set TOKEN_TRANSLATIONS. Check that no two symbols share the same |
821 `------------------------------------------------------------------*/
824 symbols_token_translations_init (void)
826 bool num_256_available_p
= true;
829 /* Find the highest user token number, and whether 256, the POSIX
830 preferred user token number for the error token, is used. */
831 max_user_token_number
= 0;
832 for (i
= 0; i
< ntokens
; ++i
)
834 symbol
*this = symbols
[i
];
835 if (this->user_token_number
!= USER_NUMBER_UNDEFINED
)
837 if (this->user_token_number
> max_user_token_number
)
838 max_user_token_number
= this->user_token_number
;
839 if (this->user_token_number
== 256)
840 num_256_available_p
= false;
844 /* If 256 is not used, assign it to error, to follow POSIX. */
845 if (num_256_available_p
846 && errtoken
->user_token_number
== USER_NUMBER_UNDEFINED
)
847 errtoken
->user_token_number
= 256;
849 /* Set the missing user numbers. */
850 if (max_user_token_number
< 256)
851 max_user_token_number
= 256;
853 for (i
= 0; i
< ntokens
; ++i
)
855 symbol
*this = symbols
[i
];
856 if (this->user_token_number
== USER_NUMBER_UNDEFINED
)
857 this->user_token_number
= ++max_user_token_number
;
858 if (this->user_token_number
> max_user_token_number
)
859 max_user_token_number
= this->user_token_number
;
862 token_translations
= xnmalloc (max_user_token_number
+ 1,
863 sizeof *token_translations
);
865 /* Initialize all entries for literal tokens to 2, the internal
866 token number for $undefined, which represents all invalid inputs.
868 for (i
= 0; i
< max_user_token_number
+ 1; i
++)
869 token_translations
[i
] = undeftoken
->number
;
870 symbols_do (symbol_translation_processor
, NULL
);
874 /*----------------------------------------------------------------.
875 | Assign symbol numbers, and write definition of token names into |
876 | FDEFINES. Set up vectors SYMBOL_TABLE, TAGS of symbols. |
877 `----------------------------------------------------------------*/
882 symbols_do (symbol_check_alias_consistency_processor
, NULL
);
884 symbols
= xcalloc (nsyms
, sizeof *symbols
);
885 symbols_do (symbol_pack_processor
, NULL
);
887 /* Aliases leave empty slots in symbols, so remove them. */
891 int nsyms_old
= nsyms
;
892 for (writei
= 0, readi
= 0; readi
< nsyms_old
; readi
+= 1)
894 if (symbols
[readi
] == NULL
)
901 symbols
[writei
] = symbols
[readi
];
902 symbols
[writei
]->number
= writei
;
903 if (symbols
[writei
]->alias
)
904 symbols
[writei
]->alias
->number
= writei
;
909 symbols
= xnrealloc (symbols
, nsyms
, sizeof *symbols
);
911 symbols_token_translations_init ();
913 if (startsymbol
->class == unknown_sym
)
914 fatal_at (startsymbol_location
,
915 _("the start symbol %s is undefined"),
917 else if (startsymbol
->class == token_sym
)
918 fatal_at (startsymbol_location
,
919 _("the start symbol %s is a token"),
924 /*--------------------------------------------------.
925 | Set default tagged/tagless %destructor/%printer. |
926 `--------------------------------------------------*/
929 default_tagged_destructor_set (code_props
const *destructor
)
931 if (default_tagged_destructor
.code
)
934 complain_at_indent (destructor
->location
, &i
,
935 _("redeclaration for default tagged %%destructor"));
937 complain_at_indent (default_tagged_destructor
.location
, &i
,
938 _("previous declaration"));
940 default_tagged_destructor
= *destructor
;
944 default_tagless_destructor_set (code_props
const *destructor
)
946 if (default_tagless_destructor
.code
)
949 complain_at_indent (destructor
->location
, &i
,
950 _("redeclaration for default tagless %%destructor"));
952 complain_at_indent (default_tagless_destructor
.location
, &i
,
953 _("previous declaration"));
955 default_tagless_destructor
= *destructor
;
959 default_tagged_printer_set (code_props
const *printer
)
961 if (default_tagged_printer
.code
)
964 complain_at_indent (printer
->location
, &i
,
965 _("redeclaration for default tagged %%printer"));
967 complain_at_indent (default_tagged_printer
.location
, &i
,
968 _("previous declaration"));
970 default_tagged_printer
= *printer
;
974 default_tagless_printer_set (code_props
const *printer
)
976 if (default_tagless_printer
.code
)
979 complain_at_indent (printer
->location
, &i
,
980 _("redeclaration for default tagless %%printer"));
982 complain_at_indent (default_tagless_printer
.location
, &i
,
983 _("previous declaration"));
985 default_tagless_printer
= *printer
;