X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/56c47203421107ee019a20f3b56cfb967ad75bd2..f377f69fec28013c79db4efe12bbb9d48987fb2c:/src/symlist.c?ds=inline diff --git a/src/symlist.c b/src/symlist.c index 4ae5f017..8b61c8dc 100644 --- a/src/symlist.c +++ b/src/symlist.c @@ -19,6 +19,7 @@ Boston, MA 02111-1307, USA. */ #include "system.h" +#include "complain.h" #include "symlist.h" @@ -35,6 +36,8 @@ symbol_list_new (symbol_t *sym, location_t location) res->location = location; res->action = NULL; res->ruleprec = NULL; + res->dprec = 0; + res->merger = 0; return res; } @@ -64,6 +67,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. |