]> git.saurik.com Git - bison.git/blobdiff - src/symtab.c
* src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
[bison.git] / src / symtab.c
index 8385135136781b20507d0cc8fd67a9b2870cb0ad..e438e4fc132c0b8598cb3c030982faee0a75a8e9 100644 (file)
@@ -168,6 +168,23 @@ symbol_type_set (symbol *sym, uniqstr type_name, location loc)
     }
 }
 
+/*-----------------------------------.
+| Get the CLASS associated with SYM. |
+`-----------------------------------*/
+
+const char *
+symbol_class_get_string (symbol *sym)
+{
+  if (sym->class)
+    {
+      if (sym->class == token_sym)
+       return "terminal";
+      else if (sym->class == nterm_sym)
+       return "nonterminal";
+    }
+  return "unknown";
+}
+
 
 /*-----------------------------------------.
 | Set the DESTRUCTOR associated with SYM.  |