X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/56c47203421107ee019a20f3b56cfb967ad75bd2..500bbfcd816776d0ddbf3555fedd41b529c405b3:/src/symlist.c diff --git a/src/symlist.c b/src/symlist.c index 4ae5f017..92d8513d 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,12 +67,26 @@ 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. | `--------------------------------------------------------------*/ -char * +struniq_t symbol_list_n_type_name_get (symbol_list_t *rule, location_t location, int n) { int i;