symbol_print (symbol const *s, FILE *f)
{
  if (s)
    {
      symbol_class c = s->content->class;
      fprintf (f, "%s: %s",
               c == unknown_sym    ? "unknown"
               : c == pct_type_sym ? "%type"
               : c == token_sym    ? "token"
               : c == nterm_sym    ? "nterm"
               : NULL, /* abort.  */
               s->tag);
      putc (' ', f);
      location_print (s->location, f);
      SYMBOL_INT_ATTR_PRINT (code);
      SYMBOL_INT_ATTR_PRINT (number);
      SYMBOL_STR_ATTR_PRINT (type_name);
      SYMBOL_CODE_PRINT (destructor);
      SYMBOL_CODE_PRINT (printer);
    }
  else
    fputs ("<NULL>", f);
}
symbol_print (symbol const *s, FILE *f)
{
  if (s)
    {
      symbol_class c = s->content->class;
      fprintf (f, "%s: %s",
               c == unknown_sym    ? "unknown"
               : c == pct_type_sym ? "%type"
               : c == token_sym    ? "token"
               : c == nterm_sym    ? "nterm"
               : NULL,  
               s->tag);
      putc (' ', f);
      location_print (s->location, f);
      SYMBOL_INT_ATTR_PRINT (code);
      SYMBOL_INT_ATTR_PRINT (number);
      SYMBOL_STR_ATTR_PRINT (type_name);
      SYMBOL_CODE_PRINT (destructor);
      SYMBOL_CODE_PRINT (printer);
    }
  else
    fputs ("<NULL>", f);
}