X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/6d8e724de2f64116a2d2684fe2f84e4d02b5809b..41d7a5f24d5e69bdf6ce10c012d50b89ce1e3957:/src/symtab.c diff --git a/src/symtab.c b/src/symtab.c index 83851351..e438e4fc 100644 --- a/src/symtab.c +++ b/src/symtab.c @@ -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. |