]> git.saurik.com Git - bison.git/blobdiff - src/symlist.c
* src/symtab.h, src/symtab.c (symbol_t): printer and
[bison.git] / src / symlist.c
index 4ae5f0171d489abb275cecfa04cae1dee4ac2a2e..d86207cf7d53ece942ad880df0b40ae76a7816fe 100644 (file)
@@ -19,6 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include "system.h"
+#include "complain.h"
 #include "symlist.h"
 
 
@@ -64,6 +65,20 @@ symbol_list_free (symbol_list_t *list)
 }
 
 
+/*--------------------.
+| Return its length.  |
+`--------------------*/
+
+unsigned int
+symbol_list_length (symbol_list_t *list)
+{
+  int res = 0;
+  for (/* Nothing. */; list; list = list->next)
+    ++res;
+  return res;
+}
+
+
 /*--------------------------------------------------------------.
 | Get the data type (alternative in the union) of the value for |
 | symbol N in rule RULE.                                        |