1 /* Symbol table manager for Bison.
3 Copyright (C) 1984, 1989, 2000, 2001, 2002, 2004, 2005, 2006 Free
4 Software Foundation, Inc.
6 This file is part of Bison, the GNU Compiler Compiler.
8 Bison 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 2, or (at your option)
13 Bison 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 Bison; see the file COPYING. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
33 /*------------------------.
34 | Distinguished symbols. |
35 `------------------------*/
37 symbol
*errtoken
= NULL
;
38 symbol
*undeftoken
= NULL
;
39 symbol
*endtoken
= NULL
;
40 symbol
*accept
= NULL
;
41 symbol
*startsymbol
= NULL
;
42 location startsymbol_location
;
44 /*---------------------------------------.
45 | Default %destructor's and %printer's. |
46 `---------------------------------------*/
48 static const char *default_tagged_destructor
= NULL
;
49 static location default_tagged_destructor_location
;
50 static const char *default_tagless_destructor
= NULL
;
51 static location default_tagless_destructor_location
;
53 static const char *default_tagged_printer
= NULL
;
54 static location default_tagged_printer_location
;
55 static const char *default_tagless_printer
= NULL
;
56 static location default_tagless_printer_location
;
58 /*---------------------------------.
59 | Create a new symbol, named TAG. |
60 `---------------------------------*/
63 symbol_new (uniqstr tag
, location loc
)
65 symbol
*res
= xmalloc (sizeof *res
);
71 res
->type_name
= NULL
;
72 res
->destructor
= NULL
;
75 res
->number
= NUMBER_UNDEFINED
;
77 res
->assoc
= undef_assoc
;
78 res
->user_token_number
= USER_NUMBER_UNDEFINED
;
81 res
->class = unknown_sym
;
82 res
->declared
= false;
84 if (nsyms
== SYMBOL_NUMBER_MAXIMUM
)
85 fatal (_("too many symbols in input grammar (limit is %d)"),
86 SYMBOL_NUMBER_MAXIMUM
);
91 /*----------------------------------------.
92 | Create a new semantic type, named TAG. |
93 `----------------------------------------*/
95 static semantic_type
*
96 semantic_type_new (uniqstr tag
)
98 semantic_type
*res
= xmalloc (sizeof *res
);
100 uniqstr_assert (tag
);
102 res
->destructor
= NULL
;
113 #define SYMBOL_ATTR_PRINT(Attr) \
115 fprintf (f, " %s { %s }", #Attr, s->Attr)
118 symbol_print (symbol
*s
, FILE *f
)
122 fprintf (f
, "\"%s\"", s
->tag
);
123 SYMBOL_ATTR_PRINT (type_name
);
124 SYMBOL_ATTR_PRINT (destructor
);
125 SYMBOL_ATTR_PRINT (printer
);
128 fprintf (f
, "<NULL>");
131 #undef SYMBOL_ATTR_PRINT
133 /*------------------------------------------------------------------.
134 | Complain that S's WHAT is redeclared at SECOND, and was first set |
136 `------------------------------------------------------------------*/
139 symbol_redeclaration (symbol
*s
, const char *what
, location first
,
142 complain_at (second
, _("%s redeclaration for %s"), what
, s
->tag
);
143 complain_at (first
, _("previous declaration"));
147 semantic_type_redeclaration (semantic_type
*s
, const char *what
, location first
,
150 complain_at (second
, _("%s redeclaration for <%s>"), what
, s
->tag
);
151 complain_at (first
, _("previous declaration"));
155 /*-----------------------------------------------------------------.
156 | Set the TYPE_NAME associated with SYM. Does nothing if passed 0 |
158 `-----------------------------------------------------------------*/
161 symbol_type_set (symbol
*sym
, uniqstr type_name
, location loc
)
166 symbol_redeclaration (sym
, "%type", sym
->type_location
, loc
);
167 uniqstr_assert (type_name
);
168 sym
->type_name
= type_name
;
169 sym
->type_location
= loc
;
174 /*------------------------------------------------------------------.
175 | Set the DESTRUCTOR associated with SYM. Do nothing if passed 0. |
176 `------------------------------------------------------------------*/
179 symbol_destructor_set (symbol
*sym
, const char *destructor
, location loc
)
184 symbol_redeclaration (sym
, "%destructor", sym
->destructor_location
,
186 sym
->destructor
= destructor
;
187 sym
->destructor_location
= loc
;
191 /*-------------------------------------------------------------------.
192 | Set the DESTRUCTOR associated with TYPE. Do nothing if passed 0. |
193 `-------------------------------------------------------------------*/
196 semantic_type_destructor_set (semantic_type
*type
, const char *destructor
,
201 if (type
->destructor
)
202 semantic_type_redeclaration (type
, "%destructor",
203 type
->destructor_location
, loc
);
204 type
->destructor
= destructor
;
205 type
->destructor_location
= loc
;
209 /*---------------------------------------.
210 | Get the computed %destructor for SYM. |
211 `---------------------------------------*/
214 symbol_destructor_get (symbol
*sym
)
216 /* Per-symbol %destructor. */
217 if (sym
->destructor
!= NULL
)
218 return sym
->destructor
;
220 /* Per-type %destructor. */
223 semantic_type
*type
= semantic_type_get (sym
->type_name
);
224 if (type
->destructor
)
225 return type
->destructor
;
228 /* Apply default %destructor's only to user-defined symbols. */
229 if (sym
->tag
[0] == '$' || sym
== errtoken
)
233 return default_tagged_destructor
;
234 return default_tagless_destructor
;
237 /*---------------------------------------------------------------.
238 | Get the grammar location of the %destructor computed for SYM. |
239 `---------------------------------------------------------------*/
242 symbol_destructor_location_get (symbol
*sym
)
244 if (sym
->destructor
!= NULL
)
245 return sym
->destructor_location
;
248 semantic_type
*type
= semantic_type_get (sym
->type_name
);
249 if (type
->destructor
)
250 return type
->destructor_location
;
251 return default_tagged_destructor_location
;
253 return default_tagless_destructor_location
;
256 /*---------------------------------------------------------------.
257 | Set the PRINTER associated with SYM. Do nothing if passed 0. |
258 `---------------------------------------------------------------*/
261 symbol_printer_set (symbol
*sym
, const char *printer
, location loc
)
266 symbol_redeclaration (sym
, "%printer", sym
->printer_location
, loc
);
267 sym
->printer
= printer
;
268 sym
->printer_location
= loc
;
272 /*----------------------------------------------------------------.
273 | Set the PRINTER associated with TYPE. Do nothing if passed 0. |
274 `----------------------------------------------------------------*/
277 semantic_type_printer_set (semantic_type
*type
, const char *printer
,
283 semantic_type_redeclaration (type
, "%printer", type
->printer_location
,
285 type
->printer
= printer
;
286 type
->printer_location
= loc
;
290 /*------------------------------------.
291 | Get the computed %printer for SYM. |
292 `------------------------------------*/
295 symbol_printer_get (symbol
*sym
)
297 /* Per-symbol %printer. */
298 if (sym
->printer
!= NULL
)
301 /* Per-type %printer. */
304 semantic_type
*type
= semantic_type_get (sym
->type_name
);
306 return type
->printer
;
309 /* Apply the default %printer only to user-defined symbols. */
310 if (sym
->tag
[0] == '$' || sym
== errtoken
)
314 return default_tagged_printer
;
315 return default_tagless_printer
;
318 /*------------------------------------------------------------.
319 | Get the grammar location of the %printer computed for SYM. |
320 `------------------------------------------------------------*/
323 symbol_printer_location_get (symbol
*sym
)
325 if (sym
->printer
!= NULL
)
326 return sym
->printer_location
;
329 semantic_type
*type
= semantic_type_get (sym
->type_name
);
331 return type
->printer_location
;
332 return default_tagged_printer_location
;
334 return default_tagless_printer_location
;
338 /*-----------------------------------------------------------------.
339 | Set the PRECEDENCE associated with SYM. Does nothing if invoked |
340 | with UNDEF_ASSOC as ASSOC. |
341 `-----------------------------------------------------------------*/
344 symbol_precedence_set (symbol
*sym
, int prec
, assoc a
, location loc
)
346 if (a
!= undef_assoc
)
349 symbol_redeclaration (sym
, assoc_to_string (a
), sym
->prec_location
,
353 sym
->prec_location
= loc
;
356 /* Only terminals have a precedence. */
357 symbol_class_set (sym
, token_sym
, loc
, false);
361 /*------------------------------------.
362 | Set the CLASS associated with SYM. |
363 `------------------------------------*/
366 symbol_class_set (symbol
*sym
, symbol_class
class, location loc
, bool declaring
)
368 if (sym
->class != unknown_sym
&& sym
->class != class)
370 complain_at (loc
, _("symbol %s redefined"), sym
->tag
);
371 sym
->declared
= false;
374 if (class == nterm_sym
&& sym
->class != nterm_sym
)
375 sym
->number
= nvars
++;
376 else if (class == token_sym
&& sym
->number
== NUMBER_UNDEFINED
)
377 sym
->number
= ntokens
++;
384 warn_at (loc
, _("symbol %s redeclared"), sym
->tag
);
385 sym
->declared
= true;
390 /*------------------------------------------------.
391 | Set the USER_TOKEN_NUMBER associated with SYM. |
392 `------------------------------------------------*/
395 symbol_user_token_number_set (symbol
*sym
, int user_token_number
, location loc
)
397 int *user_token_numberp
;
399 aver (sym
->class == token_sym
);
401 if (sym
->user_token_number
!= USER_NUMBER_ALIAS
)
402 user_token_numberp
= &sym
->user_token_number
;
404 user_token_numberp
= &sym
->alias
->user_token_number
;
405 if (*user_token_numberp
!= USER_NUMBER_UNDEFINED
406 && *user_token_numberp
!= user_token_number
)
407 complain_at (loc
, _("redefining user token number of %s"), sym
->tag
);
409 *user_token_numberp
= user_token_number
;
410 /* User defined $end token? */
411 if (user_token_number
== 0)
414 endtoken
->number
= 0;
415 /* It is always mapped to 0, so it was already counted in
422 /*----------------------------------------------------------.
423 | If SYM is not defined, report an error, and consider it a |
425 `----------------------------------------------------------*/
428 symbol_check_defined (symbol
*sym
)
430 if (sym
->class == unknown_sym
)
434 _("symbol %s is used, but is not defined as a token and has no rules"),
436 sym
->class = nterm_sym
;
437 sym
->number
= nvars
++;
444 symbol_check_defined_processor (void *sym
, void *null ATTRIBUTE_UNUSED
)
446 return symbol_check_defined (sym
);
450 /*------------------------------------------------------------------.
451 | Declare the new symbol SYM. Make it an alias of SYMVAL, and type |
452 | SYMVAL with SYM's type. |
453 `------------------------------------------------------------------*/
456 symbol_make_alias (symbol
*sym
, symbol
*symval
, location loc
)
459 warn_at (loc
, _("symbol `%s' used more than once as a literal string"),
462 warn_at (loc
, _("symbol `%s' given more than one literal string"),
466 symval
->class = token_sym
;
467 symval
->user_token_number
= sym
->user_token_number
;
468 sym
->user_token_number
= USER_NUMBER_ALIAS
;
471 symval
->number
= sym
->number
;
472 symbol_type_set (symval
, sym
->type_name
, loc
);
477 /*---------------------------------------------------------.
478 | Check that THIS, and its alias, have same precedence and |
480 `---------------------------------------------------------*/
483 symbol_check_alias_consistency (symbol
*this)
485 symbol
*alias
= this;
486 symbol
*orig
= this->alias
;
488 /* Check only those that _are_ the aliases. */
489 if (!(this->alias
&& this->user_token_number
== USER_NUMBER_ALIAS
))
492 if (orig
->type_name
!= alias
->type_name
)
495 symbol_type_set (alias
, orig
->type_name
, orig
->type_location
);
497 symbol_type_set (orig
, alias
->type_name
, alias
->type_location
);
501 if (orig
->destructor
|| alias
->destructor
)
503 if (orig
->destructor
)
504 symbol_destructor_set (alias
, orig
->destructor
,
505 orig
->destructor_location
);
507 symbol_destructor_set (orig
, alias
->destructor
,
508 alias
->destructor_location
);
511 if (orig
->printer
|| alias
->printer
)
514 symbol_printer_set (alias
, orig
->printer
, orig
->printer_location
);
516 symbol_printer_set (orig
, alias
->printer
, alias
->printer_location
);
519 if (alias
->prec
|| orig
->prec
)
522 symbol_precedence_set (alias
, orig
->prec
, orig
->assoc
,
523 orig
->prec_location
);
525 symbol_precedence_set (orig
, alias
->prec
, alias
->assoc
,
526 alias
->prec_location
);
531 symbol_check_alias_consistency_processor (void *this,
532 void *null ATTRIBUTE_UNUSED
)
534 symbol_check_alias_consistency (this);
539 /*-------------------------------------------------------------------.
540 | Assign a symbol number, and write the definition of the token name |
541 | into FDEFINES. Put in SYMBOLS. |
542 `-------------------------------------------------------------------*/
545 symbol_pack (symbol
*this)
547 if (this->class == nterm_sym
)
549 this->number
+= ntokens
;
551 else if (this->alias
)
553 /* This symbol and its alias are a single token defn.
554 Allocate a tokno, and assign to both check agreement of
555 prec and assoc fields and make both the same */
556 if (this->number
== NUMBER_UNDEFINED
)
558 if (this == endtoken
|| this->alias
== endtoken
)
559 this->number
= this->alias
->number
= 0;
562 aver (this->alias
->number
!= NUMBER_UNDEFINED
);
563 this->number
= this->alias
->number
;
566 /* Do not do processing below for USER_NUMBER_ALIASes. */
567 if (this->user_token_number
== USER_NUMBER_ALIAS
)
570 else /* this->class == token_sym */
571 aver (this->number
!= NUMBER_UNDEFINED
);
573 symbols
[this->number
] = this;
578 symbol_pack_processor (void *this, void *null ATTRIBUTE_UNUSED
)
580 return symbol_pack (this);
586 /*--------------------------------------------------.
587 | Put THIS in TOKEN_TRANSLATIONS if it is a token. |
588 `--------------------------------------------------*/
591 symbol_translation (symbol
*this)
594 if (this->class == token_sym
595 && this->user_token_number
!= USER_NUMBER_ALIAS
)
597 /* A token which translation has already been set? */
598 if (token_translations
[this->user_token_number
] != undeftoken
->number
)
599 complain_at (this->location
,
600 _("tokens %s and %s both assigned number %d"),
601 symbols
[token_translations
[this->user_token_number
]]->tag
,
602 this->tag
, this->user_token_number
);
604 token_translations
[this->user_token_number
] = this->number
;
611 symbol_translation_processor (void *this, void *null ATTRIBUTE_UNUSED
)
613 return symbol_translation (this);
617 /*---------------------------------------.
618 | Symbol and semantic type hash tables. |
619 `---------------------------------------*/
621 /* Initial capacity of symbol and semantic type hash table. */
622 #define HT_INITIAL_CAPACITY 257
624 static struct hash_table
*symbol_table
= NULL
;
625 static struct hash_table
*semantic_type_table
= NULL
;
628 hash_compare_symbol (const symbol
*m1
, const symbol
*m2
)
630 /* Since tags are unique, we can compare the pointers themselves. */
631 return UNIQSTR_EQ (m1
->tag
, m2
->tag
);
635 hash_compare_semantic_type (const semantic_type
*m1
, const semantic_type
*m2
)
637 /* Since names are unique, we can compare the pointers themselves. */
638 return UNIQSTR_EQ (m1
->tag
, m2
->tag
);
642 hash_symbol_comparator (void const *m1
, void const *m2
)
644 return hash_compare_symbol (m1
, m2
);
648 hash_semantic_type_comparator (void const *m1
, void const *m2
)
650 return hash_compare_semantic_type (m1
, m2
);
654 hash_symbol (const symbol
*m
, size_t tablesize
)
656 /* Since tags are unique, we can hash the pointer itself. */
657 return ((uintptr_t) m
->tag
) % tablesize
;
661 hash_semantic_type (const semantic_type
*m
, size_t tablesize
)
663 /* Since names are unique, we can hash the pointer itself. */
664 return ((uintptr_t) m
->tag
) % tablesize
;
668 hash_symbol_hasher (void const *m
, size_t tablesize
)
670 return hash_symbol (m
, tablesize
);
674 hash_semantic_type_hasher (void const *m
, size_t tablesize
)
676 return hash_semantic_type (m
, tablesize
);
679 /*-------------------------------.
680 | Create the symbol hash table. |
681 `-------------------------------*/
686 symbol_table
= hash_initialize (HT_INITIAL_CAPACITY
,
689 hash_symbol_comparator
,
691 semantic_type_table
= hash_initialize (HT_INITIAL_CAPACITY
,
693 hash_semantic_type_hasher
,
694 hash_semantic_type_comparator
,
699 /*----------------------------------------------------------------.
700 | Find the symbol named KEY, and return it. If it does not exist |
702 `----------------------------------------------------------------*/
705 symbol_from_uniqstr (const uniqstr key
, location loc
)
711 entry
= hash_lookup (symbol_table
, &probe
);
715 /* First insertion in the hash. */
716 entry
= symbol_new (key
, loc
);
717 hash_insert (symbol_table
, entry
);
723 /*-----------------------------------------------------------------------.
724 | Find the semantic type named KEY, and return it. If it does not exist |
726 `-----------------------------------------------------------------------*/
729 semantic_type_from_uniqstr (const uniqstr key
)
732 semantic_type
*entry
;
735 entry
= hash_lookup (semantic_type_table
, &probe
);
739 /* First insertion in the hash. */
740 entry
= semantic_type_new (key
);
741 hash_insert (semantic_type_table
, entry
);
747 /*----------------------------------------------------------------.
748 | Find the symbol named KEY, and return it. If it does not exist |
750 `----------------------------------------------------------------*/
753 symbol_get (const char *key
, location loc
)
755 return symbol_from_uniqstr (uniqstr_new (key
), loc
);
759 /*-----------------------------------------------------------------------.
760 | Find the semantic type named KEY, and return it. If it does not exist |
762 `-----------------------------------------------------------------------*/
765 semantic_type_get (const char *key
)
767 return semantic_type_from_uniqstr (uniqstr_new (key
));
771 /*------------------------------------------------------------------.
772 | Generate a dummy nonterminal, whose name cannot conflict with the |
774 `------------------------------------------------------------------*/
777 dummy_symbol_get (location loc
)
779 /* Incremented for each generated symbol. */
780 static int dummy_count
= 0;
781 static char buf
[256];
785 sprintf (buf
, "$@%d", ++dummy_count
);
786 sym
= symbol_get (buf
, loc
);
787 sym
->class = nterm_sym
;
788 sym
->number
= nvars
++;
793 symbol_is_dummy (const symbol
*sym
)
795 return sym
->tag
[0] == '@' || (sym
->tag
[0] == '$' && sym
->tag
[1] == '@');
798 /*-------------------.
799 | Free the symbols. |
800 `-------------------*/
805 hash_free (symbol_table
);
806 hash_free (semantic_type_table
);
811 /*---------------------------------------------------------------.
812 | Look for undefined symbols, report an error, and consider them |
814 `---------------------------------------------------------------*/
817 symbols_do (Hash_processor processor
, void *processor_data
)
819 hash_do_for_each (symbol_table
, processor
, processor_data
);
823 /*--------------------------------------------------------------.
824 | Check that all the symbols are defined. Report any undefined |
825 | symbols and consider them nonterminals. |
826 `--------------------------------------------------------------*/
829 symbols_check_defined (void)
831 symbols_do (symbol_check_defined_processor
, NULL
);
834 /*------------------------------------------------------------------.
835 | Set TOKEN_TRANSLATIONS. Check that no two symbols share the same |
837 `------------------------------------------------------------------*/
840 symbols_token_translations_init (void)
842 bool num_256_available_p
= true;
845 /* Find the highest user token number, and whether 256, the POSIX
846 preferred user token number for the error token, is used. */
847 max_user_token_number
= 0;
848 for (i
= 0; i
< ntokens
; ++i
)
850 symbol
*this = symbols
[i
];
851 if (this->user_token_number
!= USER_NUMBER_UNDEFINED
)
853 if (this->user_token_number
> max_user_token_number
)
854 max_user_token_number
= this->user_token_number
;
855 if (this->user_token_number
== 256)
856 num_256_available_p
= false;
860 /* If 256 is not used, assign it to error, to follow POSIX. */
861 if (num_256_available_p
862 && errtoken
->user_token_number
== USER_NUMBER_UNDEFINED
)
863 errtoken
->user_token_number
= 256;
865 /* Set the missing user numbers. */
866 if (max_user_token_number
< 256)
867 max_user_token_number
= 256;
869 for (i
= 0; i
< ntokens
; ++i
)
871 symbol
*this = symbols
[i
];
872 if (this->user_token_number
== USER_NUMBER_UNDEFINED
)
873 this->user_token_number
= ++max_user_token_number
;
874 if (this->user_token_number
> max_user_token_number
)
875 max_user_token_number
= this->user_token_number
;
878 token_translations
= xnmalloc (max_user_token_number
+ 1,
879 sizeof *token_translations
);
881 /* Initialize all entries for literal tokens to 2, the internal
882 token 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 (const char *destructor
, location loc
)
947 if (default_tagged_destructor
!= NULL
)
949 complain_at (loc
, _("redeclaration for default tagged %%destructor"));
950 complain_at (default_tagged_destructor_location
,
951 _("previous declaration"));
953 default_tagged_destructor
= destructor
;
954 default_tagged_destructor_location
= loc
;
958 default_tagless_destructor_set (const char *destructor
, location loc
)
960 if (default_tagless_destructor
!= NULL
)
962 complain_at (loc
, _("redeclaration for default tagless %%destructor"));
963 complain_at (default_tagless_destructor_location
,
964 _("previous declaration"));
966 default_tagless_destructor
= destructor
;
967 default_tagless_destructor_location
= loc
;
971 default_tagged_printer_set (const char *printer
, location loc
)
973 if (default_tagged_printer
!= NULL
)
975 complain_at (loc
, _("redeclaration for default tagged %%printer"));
976 complain_at (default_tagged_printer_location
,
977 _("previous declaration"));
979 default_tagged_printer
= printer
;
980 default_tagged_printer_location
= loc
;
984 default_tagless_printer_set (const char *printer
, location loc
)
986 if (default_tagless_printer
!= NULL
)
988 complain_at (loc
, _("redeclaration for default tagless %%printer"));
989 complain_at (default_tagless_printer_location
,
990 _("previous declaration"));
992 default_tagless_printer
= printer
;
993 default_tagless_printer_location
= loc
;