+void
+symbol_code_props_set (symbol *sym, code_props_type kind,
+ code_props const *code)
+{
+ if (sym->props[kind].code)
+ symbol_redeclaration (sym, code_props_type_string (kind),
+ sym->props[kind].location,
+ code->location);
+ sym->props[kind] = *code;
+}
+
+/*-----------------------------------------------------.
+| Set the DESTRUCTOR or PRINTER associated with TYPE. |
+`-----------------------------------------------------*/
+
+void
+semantic_type_code_props_set (semantic_type *type,
+ code_props_type kind,
+ code_props const *code)
+{
+ if (type->props[kind].code)
+ semantic_type_redeclaration (type, code_props_type_string (kind),
+ type->props[kind].location,
+ code->location);
+ type->props[kind] = *code;
+}
+
+/*---------------------------------------------------.
+| Get the computed %destructor or %printer for SYM. |
+`---------------------------------------------------*/
+
+code_props *
+symbol_code_props_get (symbol *sym, code_props_type kind)
+{
+ /* Per-symbol code props. */
+ if (sym->props[kind].code)
+ return &sym->props[kind];
+
+ /* Per-type code props. */
+ if (sym->type_name)
+ {
+ code_props *code =
+ &semantic_type_get (sym->type_name, NULL)->props[kind];
+ if (code->code)
+ return code;
+ }
+
+ /* Apply default code props's only to user-defined symbols. */
+ if (sym->tag[0] != '$' && sym != errtoken)
+ {
+ code_props *code =
+ &semantic_type_get (sym->type_name ? "*" : "", NULL)->props[kind];
+ if (code->code)
+ return code;
+ }
+ return &code_props_none;
+}
+
+/*-----------------------------------------------------------------.
+| Set the PRECEDENCE associated with SYM. Does nothing if invoked |
+| with UNDEF_ASSOC as ASSOC. |
+`-----------------------------------------------------------------*/