-/*---------------------------------------------------------------.
-| Set the PRINTER associated with SYM. Do nothing if passed 0. |
-`---------------------------------------------------------------*/
-
-void
-symbol_printer_set (symbol *sym, const char *printer, location loc)
-{
- if (printer)
- {
- if (sym->printer)
- symbol_redeclaration (sym, "%printer", sym->printer_location, loc);
- sym->printer = printer;
- sym->printer_location = loc;
- }
-}
-
-/*----------------------------------------------------------------.
-| Set the PRINTER associated with TYPE. Do nothing if passed 0. |
-`----------------------------------------------------------------*/
-
-void
-semantic_type_printer_set (semantic_type *type, const char *printer,
- location loc)
-{
- if (printer)
- {
- if (type->printer)
- semantic_type_redeclaration (type, "%printer", type->printer_location,
- loc);
- type->printer = printer;
- type->printer_location = loc;
- }
-}
-
-/*------------------------------------.
-| Get the computed %printer for SYM. |
-`------------------------------------*/
-
-const char *
-symbol_printer_get (symbol *sym)
-{
- /* Per-symbol %printer. */
- if (sym->printer != NULL)
- return sym->printer;
-
- /* Per-type %printer. */
- if (sym->type_name)
- {
- semantic_type *type = semantic_type_get (sym->type_name);
- if (type->printer)
- return type->printer;
- }
-
- /* Apply the default %printer only to user-defined symbols. */
- if (sym->tag[0] == '$' || sym == errtoken)
- return NULL;
- return default_printer;
-}
-
-/*------------------------------------------------------------.
-| Get the grammar location of the %printer computed for SYM. |
-`------------------------------------------------------------*/
-
-location
-symbol_printer_location_get (symbol *sym)
-{
- if (sym->printer != NULL)
- return sym->printer_location;
- if (sym->type_name)
- {
- semantic_type *type = semantic_type_get (sym->type_name);
- if (type->printer)
- return type->printer_location;
- }
- return default_printer_location;
-}
-
-