1 /* Symbol table manager for Bison.
3 Copyright (C) 1984, 1989, 2000, 2001, 2002, 2004, 2005, 2006, 2007,
5 Free Software Foundation, Inc.
7 This file is part of Bison, the GNU Compiler Compiler.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
32 /*------------------------.
33 | Distinguished symbols. |
34 `------------------------*/
36 symbol
*errtoken
= NULL
;
37 symbol
*undeftoken
= NULL
;
38 symbol
*endtoken
= NULL
;
39 symbol
*accept
= NULL
;
40 symbol
*startsymbol
= NULL
;
41 location startsymbol_location
;
43 /*---------------------------------------.
44 | Default %destructor's and %printer's. |
45 `---------------------------------------*/
47 static code_props default_tagged_destructor
= CODE_PROPS_NONE_INIT
;
48 static code_props default_tagless_destructor
= CODE_PROPS_NONE_INIT
;
49 static code_props default_tagged_printer
= CODE_PROPS_NONE_INIT
;
50 static code_props default_tagless_printer
= CODE_PROPS_NONE_INIT
;
52 /*---------------------------------.
53 | Create a new symbol, named TAG. |
54 `---------------------------------*/
57 symbol_new (uniqstr tag
, location loc
)
59 symbol
*res
= xmalloc (sizeof *res
);
63 /* If the tag is not a string (starts with a double quote), check
64 that it is valid for Yacc. */
65 if (tag
[0] != '\"' && tag
[0] != '\'' && strchr (tag
, '-'))
66 yacc_at (loc
, _("POSIX Yacc forbids dashes in symbol names: %s"),
72 res
->type_name
= NULL
;
73 code_props_none_init (&res
->destructor
);
74 code_props_none_init (&res
->printer
);
76 res
->number
= NUMBER_UNDEFINED
;
78 res
->assoc
= undef_assoc
;
79 res
->user_token_number
= USER_NUMBER_UNDEFINED
;
82 res
->class = unknown_sym
;
83 res
->declared
= false;
85 if (nsyms
== SYMBOL_NUMBER_MAXIMUM
)
86 fatal (_("too many symbols in input grammar (limit is %d)"),
87 SYMBOL_NUMBER_MAXIMUM
);
92 /*----------------------------------------.
93 | Create a new semantic type, named TAG. |
94 `----------------------------------------*/
96 static semantic_type
*
97 semantic_type_new (uniqstr tag
)
99 semantic_type
*res
= xmalloc (sizeof *res
);
101 uniqstr_assert (tag
);
103 code_props_none_init (&res
->destructor
);
104 code_props_none_init (&res
->printer
);
114 #define SYMBOL_ATTR_PRINT(Attr) \
116 fprintf (f, " %s { %s }", #Attr, s->Attr)
118 #define SYMBOL_CODE_PRINT(Attr) \
120 fprintf (f, " %s { %s }", #Attr, s->Attr.code)
123 symbol_print (symbol
*s
, FILE *f
)
127 fprintf (f
, "\"%s\"", s
->tag
);
128 SYMBOL_ATTR_PRINT (type_name
);
129 SYMBOL_CODE_PRINT (destructor
);
130 SYMBOL_CODE_PRINT (printer
);
133 fprintf (f
, "<NULL>");
136 #undef SYMBOL_ATTR_PRINT
137 #undef SYMBOL_CODE_PRINT
140 /*----------------------------------.
141 | Whether S is a valid identifier. |
142 `----------------------------------*/
145 is_identifier (uniqstr s
)
147 static char const alphanum
[26 + 26 + 1 + 10] =
148 "abcdefghijklmnopqrstuvwxyz"
149 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
152 if (!s
|| ! memchr (alphanum
, *s
, sizeof alphanum
- 10))
155 if (! memchr (alphanum
, *s
, sizeof alphanum
))
161 /*-----------------------------------------------.
162 | Get the identifier associated to this symbol. |
163 `-----------------------------------------------*/
165 symbol_id_get (symbol
const *sym
)
167 aver (sym
->user_token_number
!= USER_NUMBER_ALIAS
);
170 return is_identifier (sym
->tag
) ? sym
->tag
: 0;
174 /*------------------------------------------------------------------.
175 | Complain that S's WHAT is redeclared at SECOND, and was first set |
177 `------------------------------------------------------------------*/
180 symbol_redeclaration (symbol
*s
, const char *what
, location first
,
183 complain_at (second
, _("%s redeclaration for %s"), what
, s
->tag
);
184 complain_at (first
, _("previous declaration"));
188 semantic_type_redeclaration (semantic_type
*s
, const char *what
, location first
,
191 complain_at (second
, _("%s redeclaration for <%s>"), what
, s
->tag
);
192 complain_at (first
, _("previous declaration"));
196 /*-----------------------------------------------------------------.
197 | Set the TYPE_NAME associated with SYM. Does nothing if passed 0 |
199 `-----------------------------------------------------------------*/
202 symbol_type_set (symbol
*sym
, uniqstr type_name
, location loc
)
207 symbol_redeclaration (sym
, "%type", sym
->type_location
, loc
);
208 uniqstr_assert (type_name
);
209 sym
->type_name
= type_name
;
210 sym
->type_location
= loc
;
214 /*-----------------------------------.
215 | Get the CLASS associated with SYM. |
216 `-----------------------------------*/
219 symbol_class_get_string (symbol
*sym
)
223 if (sym
->class == token_sym
)
225 else if (sym
->class == nterm_sym
)
226 return "nonterminal";
232 /*-----------------------------------------.
233 | Set the DESTRUCTOR associated with SYM. |
234 `-----------------------------------------*/
237 symbol_destructor_set (symbol
*sym
, code_props
const *destructor
)
239 if (sym
->destructor
.code
)
240 symbol_redeclaration (sym
, "%destructor", sym
->destructor
.location
,
241 destructor
->location
);
242 sym
->destructor
= *destructor
;
245 /*------------------------------------------.
246 | Set the DESTRUCTOR associated with TYPE. |
247 `------------------------------------------*/
250 semantic_type_destructor_set (semantic_type
*type
,
251 code_props
const *destructor
)
253 if (type
->destructor
.code
)
254 semantic_type_redeclaration (type
, "%destructor",
255 type
->destructor
.location
,
256 destructor
->location
);
257 type
->destructor
= *destructor
;
260 /*---------------------------------------.
261 | Get the computed %destructor for SYM. |
262 `---------------------------------------*/
265 symbol_destructor_get (symbol
const *sym
)
267 /* Per-symbol %destructor. */
268 if (sym
->destructor
.code
)
269 return &sym
->destructor
;
271 /* Per-type %destructor. */
274 code_props
const *destructor
=
275 &semantic_type_get (sym
->type_name
)->destructor
;
276 if (destructor
->code
)
280 /* Apply default %destructor's only to user-defined symbols. */
281 if (sym
->tag
[0] == '$' || sym
== errtoken
)
282 return &code_props_none
;
285 return &default_tagged_destructor
;
286 return &default_tagless_destructor
;
289 /*--------------------------------------.
290 | Set the PRINTER associated with SYM. |
291 `--------------------------------------*/
294 symbol_printer_set (symbol
*sym
, code_props
const *printer
)
296 if (sym
->printer
.code
)
297 symbol_redeclaration (sym
, "%printer",
298 sym
->printer
.location
, printer
->location
);
299 sym
->printer
= *printer
;
302 /*---------------------------------------.
303 | Set the PRINTER associated with TYPE. |
304 `---------------------------------------*/
307 semantic_type_printer_set (semantic_type
*type
, code_props
const *printer
)
309 if (type
->printer
.code
)
310 semantic_type_redeclaration (type
, "%printer",
311 type
->printer
.location
, printer
->location
);
312 type
->printer
= *printer
;
315 /*------------------------------------.
316 | Get the computed %printer for SYM. |
317 `------------------------------------*/
320 symbol_printer_get (symbol
const *sym
)
322 /* Per-symbol %printer. */
323 if (sym
->printer
.code
)
324 return &sym
->printer
;
326 /* Per-type %printer. */
329 code_props
const *printer
= &semantic_type_get (sym
->type_name
)->printer
;
334 /* Apply the default %printer only to user-defined symbols. */
335 if (sym
->tag
[0] == '$' || sym
== errtoken
)
336 return &code_props_none
;
339 return &default_tagged_printer
;
340 return &default_tagless_printer
;
343 /*-----------------------------------------------------------------.
344 | Set the PRECEDENCE associated with SYM. Does nothing if invoked |
345 | with UNDEF_ASSOC as ASSOC. |
346 `-----------------------------------------------------------------*/
349 symbol_precedence_set (symbol
*sym
, int prec
, assoc a
, location loc
)
351 if (a
!= undef_assoc
)
354 symbol_redeclaration (sym
, assoc_to_string (a
), sym
->prec_location
,
358 sym
->prec_location
= loc
;
361 /* Only terminals have a precedence. */
362 symbol_class_set (sym
, token_sym
, loc
, false);
366 /*------------------------------------.
367 | Set the CLASS associated with SYM. |
368 `------------------------------------*/
371 symbol_class_set (symbol
*sym
, symbol_class
class, location loc
, bool declaring
)
373 if (sym
->class != unknown_sym
&& sym
->class != class)
375 complain_at (loc
, _("symbol %s redefined"), sym
->tag
);
376 sym
->declared
= false;
379 if (class == nterm_sym
&& sym
->class != nterm_sym
)
380 sym
->number
= nvars
++;
381 else if (class == token_sym
&& sym
->number
== NUMBER_UNDEFINED
)
382 sym
->number
= ntokens
++;
389 warn_at (loc
, _("symbol %s redeclared"), sym
->tag
);
390 sym
->declared
= true;
395 /*------------------------------------------------.
396 | Set the USER_TOKEN_NUMBER associated with SYM. |
397 `------------------------------------------------*/
400 symbol_user_token_number_set (symbol
*sym
, int user_token_number
, location loc
)
402 int *user_token_numberp
;
404 if (sym
->user_token_number
!= USER_NUMBER_ALIAS
)
405 user_token_numberp
= &sym
->user_token_number
;
407 user_token_numberp
= &sym
->alias
->user_token_number
;
408 if (*user_token_numberp
!= USER_NUMBER_UNDEFINED
409 && *user_token_numberp
!= user_token_number
)
410 complain_at (loc
, _("redefining user token number of %s"), sym
->tag
);
412 *user_token_numberp
= user_token_number
;
413 /* User defined $end token? */
414 if (user_token_number
== 0)
417 endtoken
->number
= 0;
418 /* It is always mapped to 0, so it was already counted in
425 /*----------------------------------------------------------.
426 | If SYM is not defined, report an error, and consider it a |
428 `----------------------------------------------------------*/
431 symbol_check_defined (symbol
*sym
)
433 if (sym
->class == unknown_sym
)
437 _("symbol %s is used, but is not defined as a token and has no rules"),
439 sym
->class = nterm_sym
;
440 sym
->number
= nvars
++;
447 symbol_check_defined_processor (void *sym
, void *null ATTRIBUTE_UNUSED
)
449 return symbol_check_defined (sym
);
453 /*------------------------------------------------------------------.
454 | Declare the new symbol SYM. Make it an alias of SYMVAL, and type |
455 | SYMVAL with SYM's type. |
456 `------------------------------------------------------------------*/
459 symbol_make_alias (symbol
*sym
, symbol
*symval
, location loc
)
462 warn_at (loc
, _("symbol `%s' used more than once as a literal string"),
465 warn_at (loc
, _("symbol `%s' given more than one literal string"),
469 symval
->class = token_sym
;
470 symval
->user_token_number
= sym
->user_token_number
;
471 sym
->user_token_number
= USER_NUMBER_ALIAS
;
474 symval
->number
= sym
->number
;
475 symbol_type_set (symval
, sym
->type_name
, loc
);
480 /*---------------------------------------------------------.
481 | Check that THIS, and its alias, have same precedence and |
483 `---------------------------------------------------------*/
486 symbol_check_alias_consistency (symbol
*this)
488 symbol
*alias
= this;
489 symbol
*orig
= this->alias
;
491 /* Check only those that _are_ the aliases. */
492 if (!(this->alias
&& this->user_token_number
== USER_NUMBER_ALIAS
))
495 if (orig
->type_name
!= alias
->type_name
)
498 symbol_type_set (alias
, orig
->type_name
, orig
->type_location
);
500 symbol_type_set (orig
, alias
->type_name
, alias
->type_location
);
504 if (orig
->destructor
.code
|| alias
->destructor
.code
)
506 if (orig
->destructor
.code
)
507 symbol_destructor_set (alias
, &orig
->destructor
);
509 symbol_destructor_set (orig
, &alias
->destructor
);
512 if (orig
->printer
.code
|| alias
->printer
.code
)
514 if (orig
->printer
.code
)
515 symbol_printer_set (alias
, &orig
->printer
);
517 symbol_printer_set (orig
, &alias
->printer
);
520 if (alias
->prec
|| orig
->prec
)
523 symbol_precedence_set (alias
, orig
->prec
, orig
->assoc
,
524 orig
->prec_location
);
526 symbol_precedence_set (orig
, alias
->prec
, alias
->assoc
,
527 alias
->prec_location
);
532 symbol_check_alias_consistency_processor (void *this,
533 void *null ATTRIBUTE_UNUSED
)
535 symbol_check_alias_consistency (this);
540 /*-------------------------------------------------------------------.
541 | Assign a symbol number, and write the definition of the token name |
542 | into FDEFINES. Put in SYMBOLS. |
543 `-------------------------------------------------------------------*/
546 symbol_pack (symbol
*this)
548 if (this->class == nterm_sym
)
550 this->number
+= ntokens
;
552 else if (this->alias
)
554 /* This symbol and its alias are a single token defn.
555 Allocate a tokno, and assign to both check agreement of
556 prec and assoc fields and make both the same */
557 if (this->number
== NUMBER_UNDEFINED
)
559 if (this == endtoken
|| this->alias
== endtoken
)
560 this->number
= this->alias
->number
= 0;
563 aver (this->alias
->number
!= NUMBER_UNDEFINED
);
564 this->number
= this->alias
->number
;
567 /* Do not do processing below for USER_NUMBER_ALIASes. */
568 if (this->user_token_number
== USER_NUMBER_ALIAS
)
571 else /* this->class == token_sym */
572 aver (this->number
!= NUMBER_UNDEFINED
);
574 symbols
[this->number
] = this;
579 symbol_pack_processor (void *this, void *null ATTRIBUTE_UNUSED
)
581 return symbol_pack (this);
587 /*--------------------------------------------------.
588 | Put THIS in TOKEN_TRANSLATIONS if it is a token. |
589 `--------------------------------------------------*/
592 symbol_translation (symbol
*this)
595 if (this->class == token_sym
596 && this->user_token_number
!= USER_NUMBER_ALIAS
)
598 /* A token which translation has already been set? */
599 if (token_translations
[this->user_token_number
] != undeftoken
->number
)
600 complain_at (this->location
,
601 _("tokens %s and %s both assigned number %d"),
602 symbols
[token_translations
[this->user_token_number
]]->tag
,
603 this->tag
, this->user_token_number
);
605 token_translations
[this->user_token_number
] = this->number
;
612 symbol_translation_processor (void *this, void *null ATTRIBUTE_UNUSED
)
614 return symbol_translation (this);
618 /*---------------------------------------.
619 | Symbol and semantic type hash tables. |
620 `---------------------------------------*/
622 /* Initial capacity of symbol and semantic type hash table. */
623 #define HT_INITIAL_CAPACITY 257
625 static struct hash_table
*symbol_table
= NULL
;
626 static struct hash_table
*semantic_type_table
= NULL
;
629 hash_compare_symbol (const symbol
*m1
, const symbol
*m2
)
631 /* Since tags are unique, we can compare the pointers themselves. */
632 return UNIQSTR_EQ (m1
->tag
, m2
->tag
);
636 hash_compare_semantic_type (const semantic_type
*m1
, const semantic_type
*m2
)
638 /* Since names are unique, we can compare the pointers themselves. */
639 return UNIQSTR_EQ (m1
->tag
, m2
->tag
);
643 hash_symbol_comparator (void const *m1
, void const *m2
)
645 return hash_compare_symbol (m1
, m2
);
649 hash_semantic_type_comparator (void const *m1
, void const *m2
)
651 return hash_compare_semantic_type (m1
, m2
);
655 hash_symbol (const symbol
*m
, size_t tablesize
)
657 /* Since tags are unique, we can hash the pointer itself. */
658 return ((uintptr_t) m
->tag
) % tablesize
;
662 hash_semantic_type (const semantic_type
*m
, size_t tablesize
)
664 /* Since names are unique, we can hash the pointer itself. */
665 return ((uintptr_t) m
->tag
) % tablesize
;
669 hash_symbol_hasher (void const *m
, size_t tablesize
)
671 return hash_symbol (m
, tablesize
);
675 hash_semantic_type_hasher (void const *m
, size_t tablesize
)
677 return hash_semantic_type (m
, tablesize
);
680 /*-------------------------------.
681 | Create the symbol hash table. |
682 `-------------------------------*/
687 symbol_table
= hash_initialize (HT_INITIAL_CAPACITY
,
690 hash_symbol_comparator
,
692 semantic_type_table
= hash_initialize (HT_INITIAL_CAPACITY
,
694 hash_semantic_type_hasher
,
695 hash_semantic_type_comparator
,
700 /*----------------------------------------------------------------.
701 | Find the symbol named KEY, and return it. If it does not exist |
703 `----------------------------------------------------------------*/
706 symbol_from_uniqstr (const uniqstr key
, location loc
)
712 entry
= hash_lookup (symbol_table
, &probe
);
716 /* First insertion in the hash. */
717 entry
= symbol_new (key
, loc
);
718 hash_insert (symbol_table
, entry
);
724 /*-----------------------------------------------------------------------.
725 | Find the semantic type named KEY, and return it. If it does not exist |
727 `-----------------------------------------------------------------------*/
730 semantic_type_from_uniqstr (const uniqstr key
)
733 semantic_type
*entry
;
736 entry
= hash_lookup (semantic_type_table
, &probe
);
740 /* First insertion in the hash. */
741 entry
= semantic_type_new (key
);
742 hash_insert (semantic_type_table
, entry
);
748 /*----------------------------------------------------------------.
749 | Find the symbol named KEY, and return it. If it does not exist |
751 `----------------------------------------------------------------*/
754 symbol_get (const char *key
, location loc
)
756 return symbol_from_uniqstr (uniqstr_new (key
), loc
);
760 /*-----------------------------------------------------------------------.
761 | Find the semantic type named KEY, and return it. If it does not exist |
763 `-----------------------------------------------------------------------*/
766 semantic_type_get (const char *key
)
768 return semantic_type_from_uniqstr (uniqstr_new (key
));
772 /*------------------------------------------------------------------.
773 | Generate a dummy nonterminal, whose name cannot conflict with the |
775 `------------------------------------------------------------------*/
778 dummy_symbol_get (location loc
)
780 /* Incremented for each generated symbol. */
781 static int dummy_count
= 0;
782 static char buf
[256];
786 sprintf (buf
, "$@%d", ++dummy_count
);
787 sym
= symbol_get (buf
, loc
);
788 sym
->class = nterm_sym
;
789 sym
->number
= nvars
++;
794 symbol_is_dummy (const symbol
*sym
)
796 return sym
->tag
[0] == '@' || (sym
->tag
[0] == '$' && sym
->tag
[1] == '@');
799 /*-------------------.
800 | Free the symbols. |
801 `-------------------*/
806 hash_free (symbol_table
);
807 hash_free (semantic_type_table
);
812 /*---------------------------------------------------------------.
813 | Look for undefined symbols, report an error, and consider them |
815 `---------------------------------------------------------------*/
818 symbols_do (Hash_processor processor
, void *processor_data
)
820 hash_do_for_each (symbol_table
, processor
, processor_data
);
824 /*--------------------------------------------------------------.
825 | Check that all the symbols are defined. Report any undefined |
826 | symbols and consider them nonterminals. |
827 `--------------------------------------------------------------*/
830 symbols_check_defined (void)
832 symbols_do (symbol_check_defined_processor
, NULL
);
835 /*------------------------------------------------------------------.
836 | Set TOKEN_TRANSLATIONS. Check that no two symbols share the same |
838 `------------------------------------------------------------------*/
841 symbols_token_translations_init (void)
843 bool num_256_available_p
= true;
846 /* Find the highest user token number, and whether 256, the POSIX
847 preferred user token number for the error token, is used. */
848 max_user_token_number
= 0;
849 for (i
= 0; i
< ntokens
; ++i
)
851 symbol
*this = symbols
[i
];
852 if (this->user_token_number
!= USER_NUMBER_UNDEFINED
)
854 if (this->user_token_number
> max_user_token_number
)
855 max_user_token_number
= this->user_token_number
;
856 if (this->user_token_number
== 256)
857 num_256_available_p
= false;
861 /* If 256 is not used, assign it to error, to follow POSIX. */
862 if (num_256_available_p
863 && errtoken
->user_token_number
== USER_NUMBER_UNDEFINED
)
864 errtoken
->user_token_number
= 256;
866 /* Set the missing user numbers. */
867 if (max_user_token_number
< 256)
868 max_user_token_number
= 256;
870 for (i
= 0; i
< ntokens
; ++i
)
872 symbol
*this = symbols
[i
];
873 if (this->user_token_number
== USER_NUMBER_UNDEFINED
)
874 this->user_token_number
= ++max_user_token_number
;
875 if (this->user_token_number
> max_user_token_number
)
876 max_user_token_number
= this->user_token_number
;
879 token_translations
= xnmalloc (max_user_token_number
+ 1,
880 sizeof *token_translations
);
882 /* Initialize all entries for literal tokens to the internal token
883 number for $undefined, which represents all invalid inputs. */
884 for (i
= 0; i
< max_user_token_number
+ 1; i
++)
885 token_translations
[i
] = undeftoken
->number
;
886 symbols_do (symbol_translation_processor
, NULL
);
890 /*----------------------------------------------------------------.
891 | Assign symbol numbers, and write definition of token names into |
892 | FDEFINES. Set up vectors SYMBOL_TABLE, TAGS of symbols. |
893 `----------------------------------------------------------------*/
898 symbols_do (symbol_check_alias_consistency_processor
, NULL
);
900 symbols
= xcalloc (nsyms
, sizeof *symbols
);
901 symbols_do (symbol_pack_processor
, NULL
);
903 /* Aliases leave empty slots in symbols, so remove them. */
907 int nsyms_old
= nsyms
;
908 for (writei
= 0, readi
= 0; readi
< nsyms_old
; readi
+= 1)
910 if (symbols
[readi
] == NULL
)
917 symbols
[writei
] = symbols
[readi
];
918 symbols
[writei
]->number
= writei
;
919 if (symbols
[writei
]->alias
)
920 symbols
[writei
]->alias
->number
= writei
;
925 symbols
= xnrealloc (symbols
, nsyms
, sizeof *symbols
);
927 symbols_token_translations_init ();
929 if (startsymbol
->class == unknown_sym
)
930 fatal_at (startsymbol_location
,
931 _("the start symbol %s is undefined"),
933 else if (startsymbol
->class == token_sym
)
934 fatal_at (startsymbol_location
,
935 _("the start symbol %s is a token"),
940 /*--------------------------------------------------.
941 | Set default tagged/tagless %destructor/%printer. |
942 `--------------------------------------------------*/
945 default_tagged_destructor_set (code_props
const *destructor
)
947 if (default_tagged_destructor
.code
)
949 complain_at (destructor
->location
,
950 _("redeclaration for default tagged %%destructor"));
951 complain_at (default_tagged_destructor
.location
,
952 _("previous declaration"));
954 default_tagged_destructor
= *destructor
;
958 default_tagless_destructor_set (code_props
const *destructor
)
960 if (default_tagless_destructor
.code
)
962 complain_at (destructor
->location
,
963 _("redeclaration for default tagless %%destructor"));
964 complain_at (default_tagless_destructor
.location
,
965 _("previous declaration"));
967 default_tagless_destructor
= *destructor
;
971 default_tagged_printer_set (code_props
const *printer
)
973 if (default_tagged_printer
.code
)
975 complain_at (printer
->location
,
976 _("redeclaration for default tagged %%printer"));
977 complain_at (default_tagged_printer
.location
,
978 _("previous declaration"));
980 default_tagged_printer
= *printer
;
984 default_tagless_printer_set (code_props
const *printer
)
986 if (default_tagless_printer
.code
)
988 complain_at (printer
->location
,
989 _("redeclaration for default tagless %%printer"));
990 complain_at (default_tagless_printer
.location
,
991 _("previous declaration"));
993 default_tagless_printer
= *printer
;