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 | Symbols sorted by tag. Allocated by the first invocation of |
34 | symbols_do, after which no more symbols should be created. |
35 `-------------------------------------------------------------------*/
37 static symbol
**symbols_sorted
= NULL
;
39 /*------------------------.
40 | Distinguished symbols. |
41 `------------------------*/
43 symbol
*errtoken
= NULL
;
44 symbol
*undeftoken
= NULL
;
45 symbol
*endtoken
= NULL
;
46 symbol
*accept
= NULL
;
47 symbol
*startsymbol
= NULL
;
48 location startsymbol_location
;
50 /*---------------------------------------.
51 | Default %destructor's and %printer's. |
52 `---------------------------------------*/
54 static code_props default_tagged_destructor
= CODE_PROPS_NONE_INIT
;
55 static code_props default_tagless_destructor
= CODE_PROPS_NONE_INIT
;
56 static code_props default_tagged_printer
= CODE_PROPS_NONE_INIT
;
57 static code_props default_tagless_printer
= CODE_PROPS_NONE_INIT
;
59 /*---------------------------------.
60 | Create a new symbol, named TAG. |
61 `---------------------------------*/
64 symbol_new (uniqstr tag
, location loc
)
66 symbol
*res
= xmalloc (sizeof *res
);
70 /* If the tag is not a string (starts with a double quote), check
71 that it is valid for Yacc. */
72 if (tag
[0] != '\"' && tag
[0] != '\'' && strchr (tag
, '-'))
73 yacc_at (loc
, _("POSIX Yacc forbids dashes in symbol names: %s"),
79 res
->type_name
= NULL
;
80 code_props_none_init (&res
->destructor
);
81 code_props_none_init (&res
->printer
);
83 res
->number
= NUMBER_UNDEFINED
;
85 res
->assoc
= undef_assoc
;
86 res
->user_token_number
= USER_NUMBER_UNDEFINED
;
89 res
->class = unknown_sym
;
90 res
->declared
= false;
92 if (nsyms
== SYMBOL_NUMBER_MAXIMUM
)
93 fatal (_("too many symbols in input grammar (limit is %d)"),
94 SYMBOL_NUMBER_MAXIMUM
);
99 /*----------------------------------------.
100 | Create a new semantic type, named TAG. |
101 `----------------------------------------*/
103 static semantic_type
*
104 semantic_type_new (uniqstr tag
)
106 semantic_type
*res
= xmalloc (sizeof *res
);
108 uniqstr_assert (tag
);
110 code_props_none_init (&res
->destructor
);
111 code_props_none_init (&res
->printer
);
121 #define SYMBOL_ATTR_PRINT(Attr) \
123 fprintf (f, " %s { %s }", #Attr, s->Attr)
125 #define SYMBOL_CODE_PRINT(Attr) \
127 fprintf (f, " %s { %s }", #Attr, s->Attr.code)
130 symbol_print (symbol
*s
, FILE *f
)
134 fprintf (f
, "\"%s\"", s
->tag
);
135 SYMBOL_ATTR_PRINT (type_name
);
136 SYMBOL_CODE_PRINT (destructor
);
137 SYMBOL_CODE_PRINT (printer
);
140 fprintf (f
, "<NULL>");
143 #undef SYMBOL_ATTR_PRINT
144 #undef SYMBOL_CODE_PRINT
146 /*------------------------------------------------------------------.
147 | Complain that S's WHAT is redeclared at SECOND, and was first set |
149 `------------------------------------------------------------------*/
152 symbol_redeclaration (symbol
*s
, const char *what
, location first
,
155 complain_at (second
, _("%s redeclaration for %s"), what
, s
->tag
);
156 complain_at (first
, _("previous declaration"));
160 semantic_type_redeclaration (semantic_type
*s
, const char *what
, location first
,
163 complain_at (second
, _("%s redeclaration for <%s>"), what
, s
->tag
);
164 complain_at (first
, _("previous declaration"));
169 /*-----------------------------------------------------------------.
170 | Set the TYPE_NAME associated with SYM. Does nothing if passed 0 |
172 `-----------------------------------------------------------------*/
175 symbol_type_set (symbol
*sym
, uniqstr type_name
, location loc
)
180 symbol_redeclaration (sym
, "%type", sym
->type_location
, loc
);
181 uniqstr_assert (type_name
);
182 sym
->type_name
= type_name
;
183 sym
->type_location
= loc
;
187 /*-----------------------------------.
188 | Get the CLASS associated with SYM. |
189 `-----------------------------------*/
192 symbol_class_get_string (symbol
*sym
)
196 if (sym
->class == token_sym
)
198 else if (sym
->class == nterm_sym
)
199 return "nonterminal";
205 /*-----------------------------------------.
206 | Set the DESTRUCTOR associated with SYM. |
207 `-----------------------------------------*/
210 symbol_destructor_set (symbol
*sym
, code_props
const *destructor
)
212 if (sym
->destructor
.code
)
213 symbol_redeclaration (sym
, "%destructor", sym
->destructor
.location
,
214 destructor
->location
);
215 sym
->destructor
= *destructor
;
218 /*------------------------------------------.
219 | Set the DESTRUCTOR associated with TYPE. |
220 `------------------------------------------*/
223 semantic_type_destructor_set (semantic_type
*type
,
224 code_props
const *destructor
)
226 if (type
->destructor
.code
)
227 semantic_type_redeclaration (type
, "%destructor",
228 type
->destructor
.location
,
229 destructor
->location
);
230 type
->destructor
= *destructor
;
233 /*---------------------------------------.
234 | Get the computed %destructor for SYM. |
235 `---------------------------------------*/
238 symbol_destructor_get (symbol
const *sym
)
240 /* Per-symbol %destructor. */
241 if (sym
->destructor
.code
)
242 return &sym
->destructor
;
244 /* Per-type %destructor. */
247 code_props
const *destructor
=
248 &semantic_type_get (sym
->type_name
)->destructor
;
249 if (destructor
->code
)
253 /* Apply default %destructor's only to user-defined symbols. */
254 if (sym
->tag
[0] == '$' || sym
== errtoken
)
255 return &code_props_none
;
258 return &default_tagged_destructor
;
259 return &default_tagless_destructor
;
262 /*--------------------------------------.
263 | Set the PRINTER associated with SYM. |
264 `--------------------------------------*/
267 symbol_printer_set (symbol
*sym
, code_props
const *printer
)
269 if (sym
->printer
.code
)
270 symbol_redeclaration (sym
, "%printer",
271 sym
->printer
.location
, printer
->location
);
272 sym
->printer
= *printer
;
275 /*---------------------------------------.
276 | Set the PRINTER associated with TYPE. |
277 `---------------------------------------*/
280 semantic_type_printer_set (semantic_type
*type
, code_props
const *printer
)
282 if (type
->printer
.code
)
283 semantic_type_redeclaration (type
, "%printer",
284 type
->printer
.location
, printer
->location
);
285 type
->printer
= *printer
;
288 /*------------------------------------.
289 | Get the computed %printer for SYM. |
290 `------------------------------------*/
293 symbol_printer_get (symbol
const *sym
)
295 /* Per-symbol %printer. */
296 if (sym
->printer
.code
)
297 return &sym
->printer
;
299 /* Per-type %printer. */
302 code_props
const *printer
= &semantic_type_get (sym
->type_name
)->printer
;
307 /* Apply the default %printer only to user-defined symbols. */
308 if (sym
->tag
[0] == '$' || sym
== errtoken
)
309 return &code_props_none
;
312 return &default_tagged_printer
;
313 return &default_tagless_printer
;
316 /*-----------------------------------------------------------------.
317 | Set the PRECEDENCE associated with SYM. Does nothing if invoked |
318 | with UNDEF_ASSOC as ASSOC. |
319 `-----------------------------------------------------------------*/
322 symbol_precedence_set (symbol
*sym
, int prec
, assoc a
, location loc
)
324 if (a
!= undef_assoc
)
327 symbol_redeclaration (sym
, assoc_to_string (a
), sym
->prec_location
,
331 sym
->prec_location
= loc
;
334 /* Only terminals have a precedence. */
335 symbol_class_set (sym
, token_sym
, loc
, false);
339 /*------------------------------------.
340 | Set the CLASS associated with SYM. |
341 `------------------------------------*/
344 symbol_class_set (symbol
*sym
, symbol_class
class, location loc
, bool declaring
)
346 if (sym
->class != unknown_sym
&& sym
->class != class)
348 complain_at (loc
, _("symbol %s redefined"), sym
->tag
);
349 sym
->declared
= false;
352 if (class == nterm_sym
&& sym
->class != nterm_sym
)
353 sym
->number
= nvars
++;
354 else if (class == token_sym
&& sym
->number
== NUMBER_UNDEFINED
)
355 sym
->number
= ntokens
++;
362 warn_at (loc
, _("symbol %s redeclared"), sym
->tag
);
363 sym
->declared
= true;
368 /*------------------------------------------------.
369 | Set the USER_TOKEN_NUMBER associated with SYM. |
370 `------------------------------------------------*/
373 symbol_user_token_number_set (symbol
*sym
, int user_token_number
, location loc
)
375 int *user_token_numberp
;
377 if (sym
->user_token_number
!= USER_NUMBER_HAS_STRING_ALIAS
)
378 user_token_numberp
= &sym
->user_token_number
;
380 user_token_numberp
= &sym
->alias
->user_token_number
;
381 if (*user_token_numberp
!= USER_NUMBER_UNDEFINED
382 && *user_token_numberp
!= user_token_number
)
383 complain_at (loc
, _("redefining user token number of %s"), sym
->tag
);
385 *user_token_numberp
= user_token_number
;
386 /* User defined $end token? */
387 if (user_token_number
== 0)
390 endtoken
->number
= 0;
391 /* It is always mapped to 0, so it was already counted in
398 /*----------------------------------------------------------.
399 | If SYM is not defined, report an error, and consider it a |
401 `----------------------------------------------------------*/
404 symbol_check_defined (symbol
*sym
)
406 if (sym
->class == unknown_sym
)
410 _("symbol %s is used, but is not defined as a token and has no rules"),
412 sym
->class = nterm_sym
;
413 sym
->number
= nvars
++;
420 symbol_check_defined_processor (void *sym
, void *null ATTRIBUTE_UNUSED
)
422 return symbol_check_defined (sym
);
427 symbol_make_alias (symbol
*sym
, symbol
*str
, location loc
)
430 warn_at (loc
, _("symbol `%s' used more than once as a literal string"),
433 warn_at (loc
, _("symbol `%s' given more than one literal string"),
437 str
->class = token_sym
;
438 str
->user_token_number
= sym
->user_token_number
;
439 sym
->user_token_number
= USER_NUMBER_HAS_STRING_ALIAS
;
442 str
->number
= sym
->number
;
443 symbol_type_set (str
, sym
->type_name
, loc
);
448 /*---------------------------------------------------------.
449 | Check that THIS, and its alias, have same precedence and |
451 `---------------------------------------------------------*/
454 symbol_check_alias_consistency (symbol
*this)
457 symbol
*str
= this->alias
;
459 /* Check only the symbol in the symbol-string pair. */
461 && this->user_token_number
== USER_NUMBER_HAS_STRING_ALIAS
))
464 if (str
->type_name
!= sym
->type_name
)
467 symbol_type_set (sym
, str
->type_name
, str
->type_location
);
469 symbol_type_set (str
, sym
->type_name
, sym
->type_location
);
473 if (str
->destructor
.code
|| sym
->destructor
.code
)
475 if (str
->destructor
.code
)
476 symbol_destructor_set (sym
, &str
->destructor
);
478 symbol_destructor_set (str
, &sym
->destructor
);
481 if (str
->printer
.code
|| sym
->printer
.code
)
483 if (str
->printer
.code
)
484 symbol_printer_set (sym
, &str
->printer
);
486 symbol_printer_set (str
, &sym
->printer
);
489 if (sym
->prec
|| str
->prec
)
492 symbol_precedence_set (sym
, str
->prec
, str
->assoc
,
495 symbol_precedence_set (str
, sym
->prec
, sym
->assoc
,
501 symbol_check_alias_consistency_processor (void *this,
502 void *null ATTRIBUTE_UNUSED
)
504 symbol_check_alias_consistency (this);
509 /*-------------------------------------------------------------------.
510 | Assign a symbol number, and write the definition of the token name |
511 | into FDEFINES. Put in SYMBOLS. |
512 `-------------------------------------------------------------------*/
515 symbol_pack (symbol
*this)
517 aver (this->number
!= NUMBER_UNDEFINED
);
518 if (this->class == nterm_sym
)
519 this->number
+= ntokens
;
520 else if (this->user_token_number
== USER_NUMBER_HAS_STRING_ALIAS
)
523 symbols
[this->number
] = this;
528 symbol_pack_processor (void *this, void *null ATTRIBUTE_UNUSED
)
530 return symbol_pack (this);
535 user_token_number_redeclaration (int num
, symbol
*first
, symbol
*second
)
537 /* User token numbers are not assigned during the parsing, but in a
538 second step, via a traversal of the symbol table sorted on tag.
540 However, error messages make more sense if we keep the first
541 declaration first. */
542 if (location_cmp (first
->location
, second
->location
) > 0)
548 complain_at (second
->location
,
549 _("user token number %d redeclaration for %s"),
551 complain_at (first
->location
, _("previous declaration for %s"),
555 /*--------------------------------------------------.
556 | Put THIS in TOKEN_TRANSLATIONS if it is a token. |
557 `--------------------------------------------------*/
560 symbol_translation (symbol
*this)
563 if (this->class == token_sym
564 && this->user_token_number
!= USER_NUMBER_HAS_STRING_ALIAS
)
566 /* A token which translation has already been set? */
567 if (token_translations
[this->user_token_number
] != undeftoken
->number
)
568 user_token_number_redeclaration
569 (this->user_token_number
,
570 symbols
[token_translations
[this->user_token_number
]],
573 token_translations
[this->user_token_number
] = this->number
;
580 symbol_translation_processor (void *this, void *null ATTRIBUTE_UNUSED
)
582 return symbol_translation (this);
586 /*---------------------------------------.
587 | Symbol and semantic type hash tables. |
588 `---------------------------------------*/
590 /* Initial capacity of symbol and semantic type hash table. */
591 #define HT_INITIAL_CAPACITY 257
593 static struct hash_table
*symbol_table
= NULL
;
594 static struct hash_table
*semantic_type_table
= NULL
;
597 hash_compare_symbol (const symbol
*m1
, const symbol
*m2
)
599 /* Since tags are unique, we can compare the pointers themselves. */
600 return UNIQSTR_EQ (m1
->tag
, m2
->tag
);
604 hash_compare_semantic_type (const semantic_type
*m1
, const semantic_type
*m2
)
606 /* Since names are unique, we can compare the pointers themselves. */
607 return UNIQSTR_EQ (m1
->tag
, m2
->tag
);
611 hash_symbol_comparator (void const *m1
, void const *m2
)
613 return hash_compare_symbol (m1
, m2
);
617 hash_semantic_type_comparator (void const *m1
, void const *m2
)
619 return hash_compare_semantic_type (m1
, m2
);
623 hash_symbol (const symbol
*m
, size_t tablesize
)
625 /* Since tags are unique, we can hash the pointer itself. */
626 return ((uintptr_t) m
->tag
) % tablesize
;
630 hash_semantic_type (const semantic_type
*m
, size_t tablesize
)
632 /* Since names are unique, we can hash the pointer itself. */
633 return ((uintptr_t) m
->tag
) % tablesize
;
637 hash_symbol_hasher (void const *m
, size_t tablesize
)
639 return hash_symbol (m
, tablesize
);
643 hash_semantic_type_hasher (void const *m
, size_t tablesize
)
645 return hash_semantic_type (m
, tablesize
);
648 /*-------------------------------.
649 | Create the symbol hash table. |
650 `-------------------------------*/
655 symbol_table
= hash_initialize (HT_INITIAL_CAPACITY
,
658 hash_symbol_comparator
,
660 semantic_type_table
= hash_initialize (HT_INITIAL_CAPACITY
,
662 hash_semantic_type_hasher
,
663 hash_semantic_type_comparator
,
668 /*----------------------------------------------------------------.
669 | Find the symbol named KEY, and return it. If it does not exist |
671 `----------------------------------------------------------------*/
674 symbol_from_uniqstr (const uniqstr key
, location loc
)
680 entry
= hash_lookup (symbol_table
, &probe
);
684 /* First insertion in the hash. */
685 aver (!symbols_sorted
);
686 entry
= symbol_new (key
, loc
);
687 if (!hash_insert (symbol_table
, entry
))
694 /*-----------------------------------------------------------------------.
695 | Find the semantic type named KEY, and return it. If it does not exist |
697 `-----------------------------------------------------------------------*/
700 semantic_type_from_uniqstr (const uniqstr key
)
703 semantic_type
*entry
;
706 entry
= hash_lookup (semantic_type_table
, &probe
);
710 /* First insertion in the hash. */
711 entry
= semantic_type_new (key
);
712 if (!hash_insert (semantic_type_table
, entry
))
719 /*----------------------------------------------------------------.
720 | Find the symbol named KEY, and return it. If it does not exist |
722 `----------------------------------------------------------------*/
725 symbol_get (const char *key
, location loc
)
727 return symbol_from_uniqstr (uniqstr_new (key
), loc
);
731 /*-----------------------------------------------------------------------.
732 | Find the semantic type named KEY, and return it. If it does not exist |
734 `-----------------------------------------------------------------------*/
737 semantic_type_get (const char *key
)
739 return semantic_type_from_uniqstr (uniqstr_new (key
));
743 /*------------------------------------------------------------------.
744 | Generate a dummy nonterminal, whose name cannot conflict with the |
746 `------------------------------------------------------------------*/
749 dummy_symbol_get (location loc
)
751 /* Incremented for each generated symbol. */
752 static int dummy_count
= 0;
753 static char buf
[256];
757 sprintf (buf
, "$@%d", ++dummy_count
);
758 sym
= symbol_get (buf
, loc
);
759 sym
->class = nterm_sym
;
760 sym
->number
= nvars
++;
765 symbol_is_dummy (const symbol
*sym
)
767 return sym
->tag
[0] == '@' || (sym
->tag
[0] == '$' && sym
->tag
[1] == '@');
770 /*-------------------.
771 | Free the symbols. |
772 `-------------------*/
777 hash_free (symbol_table
);
778 hash_free (semantic_type_table
);
780 free (symbols_sorted
);
784 /*---------------------------------------------------------------.
785 | Look for undefined symbols, report an error, and consider them |
787 `---------------------------------------------------------------*/
790 symbols_cmp (symbol
const *a
, symbol
const *b
)
792 return strcmp (a
->tag
, b
->tag
);
796 symbols_cmp_qsort (void const *a
, void const *b
)
798 return symbols_cmp (*(symbol
* const *)a
, *(symbol
* const *)b
);
802 symbols_do (Hash_processor processor
, void *processor_data
)
804 size_t count
= hash_get_n_entries (symbol_table
);
807 symbols_sorted
= xnmalloc (count
, sizeof *symbols_sorted
);
808 hash_get_entries (symbol_table
, (void**)symbols_sorted
, count
);
809 qsort (symbols_sorted
, count
, sizeof *symbols_sorted
,
814 for (i
= 0; i
< count
; ++i
)
815 processor (symbols_sorted
[i
], processor_data
);
819 /*--------------------------------------------------------------.
820 | Check that all the symbols are defined. Report any undefined |
821 | symbols and consider them nonterminals. |
822 `--------------------------------------------------------------*/
825 symbols_check_defined (void)
827 symbols_do (symbol_check_defined_processor
, NULL
);
830 /*------------------------------------------------------------------.
831 | Set TOKEN_TRANSLATIONS. Check that no two symbols share the same |
833 `------------------------------------------------------------------*/
836 symbols_token_translations_init (void)
838 bool num_256_available_p
= true;
841 /* Find the highest user token number, and whether 256, the POSIX
842 preferred user token number for the error token, is used. */
843 max_user_token_number
= 0;
844 for (i
= 0; i
< ntokens
; ++i
)
846 symbol
*this = symbols
[i
];
847 if (this->user_token_number
!= USER_NUMBER_UNDEFINED
)
849 if (this->user_token_number
> max_user_token_number
)
850 max_user_token_number
= this->user_token_number
;
851 if (this->user_token_number
== 256)
852 num_256_available_p
= false;
856 /* If 256 is not used, assign it to error, to follow POSIX. */
857 if (num_256_available_p
858 && errtoken
->user_token_number
== USER_NUMBER_UNDEFINED
)
859 errtoken
->user_token_number
= 256;
861 /* Set the missing user numbers. */
862 if (max_user_token_number
< 256)
863 max_user_token_number
= 256;
865 for (i
= 0; i
< ntokens
; ++i
)
867 symbol
*this = symbols
[i
];
868 if (this->user_token_number
== USER_NUMBER_UNDEFINED
)
869 this->user_token_number
= ++max_user_token_number
;
870 if (this->user_token_number
> max_user_token_number
)
871 max_user_token_number
= this->user_token_number
;
874 token_translations
= xnmalloc (max_user_token_number
+ 1,
875 sizeof *token_translations
);
877 /* Initialize all entries for literal tokens to 2, the internal
878 token number for $undefined, which represents all invalid inputs.
880 for (i
= 0; i
< max_user_token_number
+ 1; i
++)
881 token_translations
[i
] = undeftoken
->number
;
882 symbols_do (symbol_translation_processor
, NULL
);
886 /*----------------------------------------------------------------.
887 | Assign symbol numbers, and write definition of token names into |
888 | FDEFINES. Set up vectors SYMBOL_TABLE, TAGS of symbols. |
889 `----------------------------------------------------------------*/
894 symbols_do (symbol_check_alias_consistency_processor
, NULL
);
896 symbols
= xcalloc (nsyms
, sizeof *symbols
);
897 symbols_do (symbol_pack_processor
, NULL
);
899 /* Aliases leave empty slots in symbols, so remove them. */
903 int nsyms_old
= nsyms
;
904 for (writei
= 0, readi
= 0; readi
< nsyms_old
; readi
+= 1)
906 if (symbols
[readi
] == NULL
)
913 symbols
[writei
] = symbols
[readi
];
914 symbols
[writei
]->number
= writei
;
915 if (symbols
[writei
]->alias
)
916 symbols
[writei
]->alias
->number
= writei
;
921 symbols
= xnrealloc (symbols
, nsyms
, sizeof *symbols
);
923 symbols_token_translations_init ();
925 if (startsymbol
->class == unknown_sym
)
926 fatal_at (startsymbol_location
,
927 _("the start symbol %s is undefined"),
929 else if (startsymbol
->class == token_sym
)
930 fatal_at (startsymbol_location
,
931 _("the start symbol %s is a token"),
936 /*--------------------------------------------------.
937 | Set default tagged/tagless %destructor/%printer. |
938 `--------------------------------------------------*/
941 default_tagged_destructor_set (code_props
const *destructor
)
943 if (default_tagged_destructor
.code
)
945 complain_at (destructor
->location
,
946 _("redeclaration for default tagged %%destructor"));
947 complain_at (default_tagged_destructor
.location
,
948 _("previous declaration"));
950 default_tagged_destructor
= *destructor
;
954 default_tagless_destructor_set (code_props
const *destructor
)
956 if (default_tagless_destructor
.code
)
958 complain_at (destructor
->location
,
959 _("redeclaration for default tagless %%destructor"));
960 complain_at (default_tagless_destructor
.location
,
961 _("previous declaration"));
963 default_tagless_destructor
= *destructor
;
967 default_tagged_printer_set (code_props
const *printer
)
969 if (default_tagged_printer
.code
)
971 complain_at (printer
->location
,
972 _("redeclaration for default tagged %%printer"));
973 complain_at (default_tagged_printer
.location
,
974 _("previous declaration"));
976 default_tagged_printer
= *printer
;
980 default_tagless_printer_set (code_props
const *printer
)
982 if (default_tagless_printer
.code
)
984 complain_at (printer
->location
,
985 _("redeclaration for default tagless %%printer"));
986 complain_at (default_tagless_printer
.location
,
987 _("previous declaration"));
989 default_tagless_printer
= *printer
;