* 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.
This commit is contained in:
Akim Demaille
2002-06-17 07:05:12 +00:00
parent 56c4720342
commit dafdc66ff0
9 changed files with 77 additions and 58 deletions

View File

@@ -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. |