1 /* Symbol table manager for Bison.
3 Copyright (C) 1984, 1989, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008
4 Free Software Foundation, Inc.
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/>. */
31 /*------------------------.
32 | Distinguished symbols. |
33 `------------------------*/
35 symbol
*errtoken
= NULL
;
36 symbol
*undeftoken
= NULL
;
37 symbol
*endtoken
= NULL
;
38 symbol
*accept
= NULL
;
39 symbol
*startsymbol
= NULL
;
40 location startsymbol_location
;
42 /*---------------------------------------.
43 | Default %destructor's and %printer's. |
44 `---------------------------------------*/
46 static code_props default_tagged_destructor
= CODE_PROPS_NONE_INIT
;
47 static code_props default_tagless_destructor
= CODE_PROPS_NONE_INIT
;
48 static code_props default_tagged_printer
= CODE_PROPS_NONE_INIT
;
49 static code_props default_tagless_printer
= CODE_PROPS_NONE_INIT
;
51 /*---------------------------------.
52 | Create a new symbol, named TAG. |
53 `---------------------------------*/
56 symbol_new (uniqstr tag
, location loc
)
58 symbol
*res
= xmalloc (sizeof *res
);
64 res
->type_name
= NULL
;
65 code_props_none_init (&res
->destructor
);
66 code_props_none_init (&res
->printer
);
68 res
->number
= NUMBER_UNDEFINED
;
70 res
->assoc
= undef_assoc
;
71 res
->user_token_number
= USER_NUMBER_UNDEFINED
;
74 res
->class = unknown_sym
;
75 res
->declared
= false;
77 if (nsyms
== SYMBOL_NUMBER_MAXIMUM
)
78 fatal (_("too many symbols in input grammar (limit is %d)"),
79 SYMBOL_NUMBER_MAXIMUM
);
84 /*----------------------------------------.
85 | Create a new semantic type, named TAG. |
86 `----------------------------------------*/
88 static semantic_type
*
89 semantic_type_new (uniqstr tag
)
91 semantic_type
*res
= xmalloc (sizeof *res
);
95 code_props_none_init (&res
->destructor
);
96 code_props_none_init (&res
->printer
);
106 #define SYMBOL_ATTR_PRINT(Attr) \
108 fprintf (f, " %s { %s }", #Attr, s->Attr)
110 #define SYMBOL_CODE_PRINT(Attr) \
112 fprintf (f, " %s { %s }", #Attr, s->Attr.code)
115 symbol_print (symbol
*s
, FILE *f
)
119 fprintf (f
, "\"%s\"", s
->tag
);
120 SYMBOL_ATTR_PRINT (type_name
);
121 SYMBOL_CODE_PRINT (destructor
);
122 SYMBOL_CODE_PRINT (printer
);
125 fprintf (f
, "<NULL>");
128 #undef SYMBOL_ATTR_PRINT
129 #undef SYMBOL_CODE_PRINT
132 /*----------------------------------.
133 | Whether S is a valid identifier. |
134 `----------------------------------*/
137 is_identifier (uniqstr s
)
139 static char const alphanum
[26 + 26 + 1 + 10] =
140 "abcdefghijklmnopqrstuvwxyz"
141 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
144 if (!s
|| ! memchr (alphanum
, *s
, sizeof alphanum
- 10))
147 if (! memchr (alphanum
, *s
, sizeof alphanum
))
153 /*-----------------------------------------------.
154 | Get the identifier associated to this symbol. |
155 `-----------------------------------------------*/
157 symbol_id_get (symbol
const *sym
)
159 aver (sym
->user_token_number
!= USER_NUMBER_ALIAS
);
162 return is_identifier (sym
->tag
) ? sym
->tag
: 0;
166 /*------------------------------------------------------------------.
167 | Complain that S's WHAT is redeclared at SECOND, and was first set |
169 `------------------------------------------------------------------*/
172 symbol_redeclaration (symbol
*s
, const char *what
, location first
,
175 complain_at (second
, _("%s redeclaration for %s"), what
, s
->tag
);
176 complain_at (first
, _("previous declaration"));
180 semantic_type_redeclaration (semantic_type
*s
, const char *what
, location first
,
183 complain_at (second
, _("%s redeclaration for <%s>"), what
, s
->tag
);
184 complain_at (first
, _("previous declaration"));
188 /*-----------------------------------------------------------------.
189 | Set the TYPE_NAME associated with SYM. Does nothing if passed 0 |
191 `-----------------------------------------------------------------*/
194 symbol_type_set (symbol
*sym
, uniqstr type_name
, location loc
)
199 symbol_redeclaration (sym
, "%type", sym
->type_location
, loc
);
200 uniqstr_assert (type_name
);
201 sym
->type_name
= type_name
;
202 sym
->type_location
= loc
;
206 /*-----------------------------------.
207 | Get the CLASS associated with SYM. |
208 `-----------------------------------*/
211 symbol_class_get_string (symbol
*sym
)
215 if (sym
->class == token_sym
)
217 else if (sym
->class == nterm_sym
)
218 return "nonterminal";
224 /*-----------------------------------------.
225 | Set the DESTRUCTOR associated with SYM. |
226 `-----------------------------------------*/
229 symbol_destructor_set (symbol
*sym
, code_props
const *destructor
)
231 if (sym
->destructor
.code
)
232 symbol_redeclaration (sym
, "%destructor", sym
->destructor
.location
,
233 destructor
->location
);
234 sym
->destructor
= *destructor
;
237 /*------------------------------------------.
238 | Set the DESTRUCTOR associated with TYPE. |
239 `------------------------------------------*/
242 semantic_type_destructor_set (semantic_type
*type
,
243 code_props
const *destructor
)
245 if (type
->destructor
.code
)
246 semantic_type_redeclaration (type
, "%destructor",
247 type
->destructor
.location
,
248 destructor
->location
);
249 type
->destructor
= *destructor
;
252 /*---------------------------------------.
253 | Get the computed %destructor for SYM. |
254 `---------------------------------------*/
257 symbol_destructor_get (symbol
const *sym
)
259 /* Per-symbol %destructor. */
260 if (sym
->destructor
.code
)
261 return &sym
->destructor
;
263 /* Per-type %destructor. */
266 code_props
const *destructor
=
267 &semantic_type_get (sym
->type_name
)->destructor
;
268 if (destructor
->code
)
272 /* Apply default %destructor's only to user-defined symbols. */
273 if (sym
->tag
[0] == '$' || sym
== errtoken
)
274 return &code_props_none
;
277 return &default_tagged_destructor
;
278 return &default_tagless_destructor
;
281 /*--------------------------------------.
282 | Set the PRINTER associated with SYM. |
283 `--------------------------------------*/
286 symbol_printer_set (symbol
*sym
, code_props
const *printer
)
288 if (sym
->printer
.code
)
289 symbol_redeclaration (sym
, "%printer",
290 sym
->printer
.location
, printer
->location
);
291 sym
->printer
= *printer
;
294 /*---------------------------------------.
295 | Set the PRINTER associated with TYPE. |
296 `---------------------------------------*/
299 semantic_type_printer_set (semantic_type
*type
, code_props
const *printer
)
301 if (type
->printer
.code
)
302 semantic_type_redeclaration (type
, "%printer",
303 type
->printer
.location
, printer
->location
);
304 type
->printer
= *printer
;
307 /*------------------------------------.
308 | Get the computed %printer for SYM. |
309 `------------------------------------*/
312 symbol_printer_get (symbol
const *sym
)
314 /* Per-symbol %printer. */
315 if (sym
->printer
.code
)
316 return &sym
->printer
;
318 /* Per-type %printer. */
321 code_props
const *printer
= &semantic_type_get (sym
->type_name
)->printer
;
326 /* Apply the default %printer only to user-defined symbols. */
327 if (sym
->tag
[0] == '$' || sym
== errtoken
)
328 return &code_props_none
;
331 return &default_tagged_printer
;
332 return &default_tagless_printer
;
335 /*-----------------------------------------------------------------.
336 | Set the PRECEDENCE associated with SYM. Does nothing if invoked |
337 | with UNDEF_ASSOC as ASSOC. |
338 `-----------------------------------------------------------------*/
341 symbol_precedence_set (symbol
*sym
, int prec
, assoc a
, location loc
)
343 if (a
!= undef_assoc
)
346 symbol_redeclaration (sym
, assoc_to_string (a
), sym
->prec_location
,
350 sym
->prec_location
= loc
;
353 /* Only terminals have a precedence. */
354 symbol_class_set (sym
, token_sym
, loc
, false);
358 /*------------------------------------.
359 | Set the CLASS associated with SYM. |
360 `------------------------------------*/
363 symbol_class_set (symbol
*sym
, symbol_class
class, location loc
, bool declaring
)
365 if (sym
->class != unknown_sym
&& sym
->class != class)
367 complain_at (loc
, _("symbol %s redefined"), sym
->tag
);
368 sym
->declared
= false;
371 if (class == nterm_sym
&& sym
->class != nterm_sym
)
372 sym
->number
= nvars
++;
373 else if (class == token_sym
&& sym
->number
== NUMBER_UNDEFINED
)
374 sym
->number
= ntokens
++;
381 warn_at (loc
, _("symbol %s redeclared"), sym
->tag
);
382 sym
->declared
= true;
387 /*------------------------------------------------.
388 | Set the USER_TOKEN_NUMBER associated with SYM. |
389 `------------------------------------------------*/
392 symbol_user_token_number_set (symbol
*sym
, int user_token_number
, location loc
)
394 int *user_token_numberp
;
396 if (sym
->user_token_number
!= USER_NUMBER_ALIAS
)
397 user_token_numberp
= &sym
->user_token_number
;
399 user_token_numberp
= &sym
->alias
->user_token_number
;
400 if (*user_token_numberp
!= USER_NUMBER_UNDEFINED
401 && *user_token_numberp
!= user_token_number
)
402 complain_at (loc
, _("redefining user token number of %s"), sym
->tag
);
404 *user_token_numberp
= user_token_number
;
405 /* User defined $end token? */
406 if (user_token_number
== 0)
409 endtoken
->number
= 0;
410 /* It is always mapped to 0, so it was already counted in
417 /*----------------------------------------------------------.
418 | If SYM is not defined, report an error, and consider it a |
420 `----------------------------------------------------------*/
423 symbol_check_defined (symbol
*sym
)
425 if (sym
->class == unknown_sym
)
429 _("symbol %s is used, but is not defined as a token and has no rules"),
431 sym
->class = nterm_sym
;
432 sym
->number
= nvars
++;
439 symbol_check_defined_processor (void *sym
, void *null ATTRIBUTE_UNUSED
)
441 return symbol_check_defined (sym
);
445 /*------------------------------------------------------------------.
446 | Declare the new symbol SYM. Make it an alias of SYMVAL, and type |
447 | SYMVAL with SYM's type. |
448 `------------------------------------------------------------------*/
451 symbol_make_alias (symbol
*sym
, symbol
*symval
, location loc
)
454 warn_at (loc
, _("symbol `%s' used more than once as a literal string"),
457 warn_at (loc
, _("symbol `%s' given more than one literal string"),
461 symval
->class = token_sym
;
462 symval
->user_token_number
= sym
->user_token_number
;
463 sym
->user_token_number
= USER_NUMBER_ALIAS
;
466 symval
->number
= sym
->number
;
467 symbol_type_set (symval
, sym
->type_name
, loc
);
472 /*---------------------------------------------------------.
473 | Check that THIS, and its alias, have same precedence and |
475 `---------------------------------------------------------*/
478 symbol_check_alias_consistency (symbol
*this)
480 symbol
*alias
= this;
481 symbol
*orig
= this->alias
;
483 /* Check only those that _are_ the aliases. */
484 if (!(this->alias
&& this->user_token_number
== USER_NUMBER_ALIAS
))
487 if (orig
->type_name
!= alias
->type_name
)
490 symbol_type_set (alias
, orig
->type_name
, orig
->type_location
);
492 symbol_type_set (orig
, alias
->type_name
, alias
->type_location
);
496 if (orig
->destructor
.code
|| alias
->destructor
.code
)
498 if (orig
->destructor
.code
)
499 symbol_destructor_set (alias
, &orig
->destructor
);
501 symbol_destructor_set (orig
, &alias
->destructor
);
504 if (orig
->printer
.code
|| alias
->printer
.code
)
506 if (orig
->printer
.code
)
507 symbol_printer_set (alias
, &orig
->printer
);
509 symbol_printer_set (orig
, &alias
->printer
);
512 if (alias
->prec
|| orig
->prec
)
515 symbol_precedence_set (alias
, orig
->prec
, orig
->assoc
,
516 orig
->prec_location
);
518 symbol_precedence_set (orig
, alias
->prec
, alias
->assoc
,
519 alias
->prec_location
);
524 symbol_check_alias_consistency_processor (void *this,
525 void *null ATTRIBUTE_UNUSED
)
527 symbol_check_alias_consistency (this);
532 /*-------------------------------------------------------------------.
533 | Assign a symbol number, and write the definition of the token name |
534 | into FDEFINES. Put in SYMBOLS. |
535 `-------------------------------------------------------------------*/
538 symbol_pack (symbol
*this)
540 if (this->class == nterm_sym
)
542 this->number
+= ntokens
;
544 else if (this->alias
)
546 /* This symbol and its alias are a single token defn.
547 Allocate a tokno, and assign to both check agreement of
548 prec and assoc fields and make both the same */
549 if (this->number
== NUMBER_UNDEFINED
)
551 if (this == endtoken
|| this->alias
== endtoken
)
552 this->number
= this->alias
->number
= 0;
555 aver (this->alias
->number
!= NUMBER_UNDEFINED
);
556 this->number
= this->alias
->number
;
559 /* Do not do processing below for USER_NUMBER_ALIASes. */
560 if (this->user_token_number
== USER_NUMBER_ALIAS
)
563 else /* this->class == token_sym */
564 aver (this->number
!= NUMBER_UNDEFINED
);
566 symbols
[this->number
] = this;
571 symbol_pack_processor (void *this, void *null ATTRIBUTE_UNUSED
)
573 return symbol_pack (this);
579 /*--------------------------------------------------.
580 | Put THIS in TOKEN_TRANSLATIONS if it is a token. |
581 `--------------------------------------------------*/
584 symbol_translation (symbol
*this)
587 if (this->class == token_sym
588 && this->user_token_number
!= USER_NUMBER_ALIAS
)
590 /* A token which translation has already been set? */
591 if (token_translations
[this->user_token_number
] != undeftoken
->number
)
592 complain_at (this->location
,
593 _("tokens %s and %s both assigned number %d"),
594 symbols
[token_translations
[this->user_token_number
]]->tag
,
595 this->tag
, this->user_token_number
);
597 token_translations
[this->user_token_number
] = this->number
;
604 symbol_translation_processor (void *this, void *null ATTRIBUTE_UNUSED
)
606 return symbol_translation (this);
610 /*---------------------------------------.
611 | Symbol and semantic type hash tables. |
612 `---------------------------------------*/
614 /* Initial capacity of symbol and semantic type hash table. */
615 #define HT_INITIAL_CAPACITY 257
617 static struct hash_table
*symbol_table
= NULL
;
618 static struct hash_table
*semantic_type_table
= NULL
;
621 hash_compare_symbol (const symbol
*m1
, const symbol
*m2
)
623 /* Since tags are unique, we can compare the pointers themselves. */
624 return UNIQSTR_EQ (m1
->tag
, m2
->tag
);
628 hash_compare_semantic_type (const semantic_type
*m1
, const semantic_type
*m2
)
630 /* Since names are unique, we can compare the pointers themselves. */
631 return UNIQSTR_EQ (m1
->tag
, m2
->tag
);
635 hash_symbol_comparator (void const *m1
, void const *m2
)
637 return hash_compare_symbol (m1
, m2
);
641 hash_semantic_type_comparator (void const *m1
, void const *m2
)
643 return hash_compare_semantic_type (m1
, m2
);
647 hash_symbol (const symbol
*m
, size_t tablesize
)
649 /* Since tags are unique, we can hash the pointer itself. */
650 return ((uintptr_t) m
->tag
) % tablesize
;
654 hash_semantic_type (const semantic_type
*m
, size_t tablesize
)
656 /* Since names are unique, we can hash the pointer itself. */
657 return ((uintptr_t) m
->tag
) % tablesize
;
661 hash_symbol_hasher (void const *m
, size_t tablesize
)
663 return hash_symbol (m
, tablesize
);
667 hash_semantic_type_hasher (void const *m
, size_t tablesize
)
669 return hash_semantic_type (m
, tablesize
);
672 /*-------------------------------.
673 | Create the symbol hash table. |
674 `-------------------------------*/
679 symbol_table
= hash_initialize (HT_INITIAL_CAPACITY
,
682 hash_symbol_comparator
,
684 semantic_type_table
= hash_initialize (HT_INITIAL_CAPACITY
,
686 hash_semantic_type_hasher
,
687 hash_semantic_type_comparator
,
692 /*----------------------------------------------------------------.
693 | Find the symbol named KEY, and return it. If it does not exist |
695 `----------------------------------------------------------------*/
698 symbol_from_uniqstr (const uniqstr key
, location loc
)
704 entry
= hash_lookup (symbol_table
, &probe
);
708 /* First insertion in the hash. */
709 entry
= symbol_new (key
, loc
);
710 hash_insert (symbol_table
, entry
);
716 /*-----------------------------------------------------------------------.
717 | Find the semantic type named KEY, and return it. If it does not exist |
719 `-----------------------------------------------------------------------*/
722 semantic_type_from_uniqstr (const uniqstr key
)
725 semantic_type
*entry
;
728 entry
= hash_lookup (semantic_type_table
, &probe
);
732 /* First insertion in the hash. */
733 entry
= semantic_type_new (key
);
734 hash_insert (semantic_type_table
, entry
);
740 /*----------------------------------------------------------------.
741 | Find the symbol named KEY, and return it. If it does not exist |
743 `----------------------------------------------------------------*/
746 symbol_get (const char *key
, location loc
)
748 return symbol_from_uniqstr (uniqstr_new (key
), loc
);
752 /*-----------------------------------------------------------------------.
753 | Find the semantic type named KEY, and return it. If it does not exist |
755 `-----------------------------------------------------------------------*/
758 semantic_type_get (const char *key
)
760 return semantic_type_from_uniqstr (uniqstr_new (key
));
764 /*------------------------------------------------------------------.
765 | Generate a dummy nonterminal, whose name cannot conflict with the |
767 `------------------------------------------------------------------*/
770 dummy_symbol_get (location loc
)
772 /* Incremented for each generated symbol. */
773 static int dummy_count
= 0;
774 static char buf
[256];
778 sprintf (buf
, "$@%d", ++dummy_count
);
779 sym
= symbol_get (buf
, loc
);
780 sym
->class = nterm_sym
;
781 sym
->number
= nvars
++;
786 symbol_is_dummy (const symbol
*sym
)
788 return sym
->tag
[0] == '@' || (sym
->tag
[0] == '$' && sym
->tag
[1] == '@');
791 /*-------------------.
792 | Free the symbols. |
793 `-------------------*/
798 hash_free (symbol_table
);
799 hash_free (semantic_type_table
);
804 /*---------------------------------------------------------------.
805 | Look for undefined symbols, report an error, and consider them |
807 `---------------------------------------------------------------*/
810 symbols_do (Hash_processor processor
, void *processor_data
)
812 hash_do_for_each (symbol_table
, processor
, processor_data
);
816 /*--------------------------------------------------------------.
817 | Check that all the symbols are defined. Report any undefined |
818 | symbols and consider them nonterminals. |
819 `--------------------------------------------------------------*/
822 symbols_check_defined (void)
824 symbols_do (symbol_check_defined_processor
, NULL
);
827 /*------------------------------------------------------------------.
828 | Set TOKEN_TRANSLATIONS. Check that no two symbols share the same |
830 `------------------------------------------------------------------*/
833 symbols_token_translations_init (void)
835 bool num_256_available_p
= true;
838 /* Find the highest user token number, and whether 256, the POSIX
839 preferred user token number for the error token, is used. */
840 max_user_token_number
= 0;
841 for (i
= 0; i
< ntokens
; ++i
)
843 symbol
*this = symbols
[i
];
844 if (this->user_token_number
!= USER_NUMBER_UNDEFINED
)
846 if (this->user_token_number
> max_user_token_number
)
847 max_user_token_number
= this->user_token_number
;
848 if (this->user_token_number
== 256)
849 num_256_available_p
= false;
853 /* If 256 is not used, assign it to error, to follow POSIX. */
854 if (num_256_available_p
855 && errtoken
->user_token_number
== USER_NUMBER_UNDEFINED
)
856 errtoken
->user_token_number
= 256;
858 /* Set the missing user numbers. */
859 if (max_user_token_number
< 256)
860 max_user_token_number
= 256;
862 for (i
= 0; i
< ntokens
; ++i
)
864 symbol
*this = symbols
[i
];
865 if (this->user_token_number
== USER_NUMBER_UNDEFINED
)
866 this->user_token_number
= ++max_user_token_number
;
867 if (this->user_token_number
> max_user_token_number
)
868 max_user_token_number
= this->user_token_number
;
871 token_translations
= xnmalloc (max_user_token_number
+ 1,
872 sizeof *token_translations
);
874 /* Initialize all entries for literal tokens to the internal token
875 number for $undefined, which represents all invalid inputs. */
876 for (i
= 0; i
< max_user_token_number
+ 1; i
++)
877 token_translations
[i
] = undeftoken
->number
;
878 symbols_do (symbol_translation_processor
, NULL
);
882 /*----------------------------------------------------------------.
883 | Assign symbol numbers, and write definition of token names into |
884 | FDEFINES. Set up vectors SYMBOL_TABLE, TAGS of symbols. |
885 `----------------------------------------------------------------*/
890 symbols_do (symbol_check_alias_consistency_processor
, NULL
);
892 symbols
= xcalloc (nsyms
, sizeof *symbols
);
893 symbols_do (symbol_pack_processor
, NULL
);
895 /* Aliases leave empty slots in symbols, so remove them. */
899 int nsyms_old
= nsyms
;
900 for (writei
= 0, readi
= 0; readi
< nsyms_old
; readi
+= 1)
902 if (symbols
[readi
] == NULL
)
909 symbols
[writei
] = symbols
[readi
];
910 symbols
[writei
]->number
= writei
;
911 if (symbols
[writei
]->alias
)
912 symbols
[writei
]->alias
->number
= writei
;
917 symbols
= xnrealloc (symbols
, nsyms
, sizeof *symbols
);
919 symbols_token_translations_init ();
921 if (startsymbol
->class == unknown_sym
)
922 fatal_at (startsymbol_location
,
923 _("the start symbol %s is undefined"),
925 else if (startsymbol
->class == token_sym
)
926 fatal_at (startsymbol_location
,
927 _("the start symbol %s is a token"),
932 /*--------------------------------------------------.
933 | Set default tagged/tagless %destructor/%printer. |
934 `--------------------------------------------------*/
937 default_tagged_destructor_set (code_props
const *destructor
)
939 if (default_tagged_destructor
.code
)
941 complain_at (destructor
->location
,
942 _("redeclaration for default tagged %%destructor"));
943 complain_at (default_tagged_destructor
.location
,
944 _("previous declaration"));
946 default_tagged_destructor
= *destructor
;
950 default_tagless_destructor_set (code_props
const *destructor
)
952 if (default_tagless_destructor
.code
)
954 complain_at (destructor
->location
,
955 _("redeclaration for default tagless %%destructor"));
956 complain_at (default_tagless_destructor
.location
,
957 _("previous declaration"));
959 default_tagless_destructor
= *destructor
;
963 default_tagged_printer_set (code_props
const *printer
)
965 if (default_tagged_printer
.code
)
967 complain_at (printer
->location
,
968 _("redeclaration for default tagged %%printer"));
969 complain_at (default_tagged_printer
.location
,
970 _("previous declaration"));
972 default_tagged_printer
= *printer
;
976 default_tagless_printer_set (code_props
const *printer
)
978 if (default_tagless_printer
.code
)
980 complain_at (printer
->location
,
981 _("redeclaration for default tagless %%printer"));
982 complain_at (default_tagless_printer
.location
,
983 _("previous declaration"));
985 default_tagless_printer
= *printer
;