summaryrefslogtreecommitdiff
path: root/src/symlist.c
diff options
context:
space:
mode:
authorAkim Demaille <akim@epita.fr>2002-06-17 07:05:12 +0000
committerAkim Demaille <akim@epita.fr>2002-06-17 07:05:12 +0000
commitdafdc66ff0a0344c390d0f5612e9b469d6855e00 (patch)
tree46e380c01aaef512c439e7bb6c0fd92aaea6cc1d /src/symlist.c
parent56c47203421107ee019a20f3b56cfb967ad75bd2 (diff)
downloadbison-dafdc66ff0a0344c390d0f5612e9b469d6855e00.tar.gz
* src/symlist.h, src/symlist.c (symbol_list_length): New.
* src/scan-gram.l (handle_dollar, handle_at): Compute the rule_length only when needed. * src/output.c (actions_output, token_definitions_output): Output the full M4 block. * src/symtab.c: Don't access directly to the symbol tag, use symbol_tag_get. * src/parse-gram.y: Use symbol_list_free.
Diffstat (limited to 'src/symlist.c')
-rw-r--r--src/symlist.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/symlist.c b/src/symlist.c
index 4ae5f017..bdb965d3 100644
--- a/src/symlist.c
+++ b/src/symlist.c
@@ -64,6 +64,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. |