* src/graphviz.c (output_red): Fix C90 issues.
Reduce variable scopes.
Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
void
output_red (state const *s, reductions const *reds, FILE *fout)
{
void
output_red (state const *s, reductions const *reds, FILE *fout)
{
- int source = s->number;
- int i, j;
- no_reduce_bitset_init (s, &no_reduce_set);
-
+ int j;
+ int source = s->number;
+
+ no_reduce_bitset_init (s, &no_reduce_set);
obstack_init (&oout);
for (j = 0; j < reds->num; ++j)
{
obstack_init (&oout);
for (j = 0; j < reds->num; ++j)
{
int ruleno = reds->rules[j]->user_number;
rule *default_reduction = NULL;
int ruleno = reds->rules[j]->user_number;
rule *default_reduction = NULL;
if (yydefact[s->number] != 0)
default_reduction = &rules[yydefact[s->number] - 1];
if (yydefact[s->number] != 0)
default_reduction = &rules[yydefact[s->number] - 1];
if (default_reduction && default_reduction == reds->rules[j])
first = print_token (&oout, true, "$default");
else
if (default_reduction && default_reduction == reds->rules[j])
first = print_token (&oout, true, "$default");
else
- for (i = 0; i < ntokens; i++)
+ {
+ int i;
+ for (i = 0; i < ntokens; i++)
if (bitset_test (reds->lookahead_tokens[j], i))
{
first = print_token (&oout, first, symbols[i]->tag);
if (bitset_test (no_reduce_set, i))
disabled = true;
}
if (bitset_test (reds->lookahead_tokens[j], i))
{
first = print_token (&oout, first, symbols[i]->tag);
if (bitset_test (no_reduce_set, i))
disabled = true;
}
obstack_sgrow (&oout, "\" style=solid]\n");
/* Then, print the reduction's representation. This most be done later
obstack_sgrow (&oout, "\" style=solid]\n");
/* Then, print the reduction's representation. This most be done later