/* Print an xml on generated parser, for Bison,
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
{
transitions *trans = s->transitions;
reductions *reds = s->reductions;
- rule *default_rule = NULL;
+ rule *default_reduction = NULL;
int report = false;
int i, j;
- if (reds->num == 0) {
- xml_puts (out, level, "<reductions/>");
- return;
- }
+ if (reds->num == 0)
+ {
+ xml_puts (out, level, "<reductions/>");
+ return;
+ }
if (yydefact[s->number] != 0)
- default_rule = &rules[yydefact[s->number] - 1];
+ default_reduction = &rules[yydefact[s->number] - 1];
bitset_zero (no_reduce_set);
FOR_EACH_SHIFT (trans, i)
if (s->errs->symbols[i])
bitset_set (no_reduce_set, s->errs->symbols[i]->number);
- if (default_rule)
+ if (default_reduction)
report = true;
if (reds->lookahead_tokens)
{
if (! count)
{
- if (reds->rules[j] != default_rule)
+ if (reds->rules[j] != default_reduction)
report = true;
count = true;
}
{
if (! count)
{
- if (reds->rules[j] != default_rule)
+ if (reds->rules[j] != default_reduction)
print_reduction (out, level + 1, symbols[i]->tag,
reds->rules[j], true);
else
{
if (defaulted)
print_reduction (out, level + 1, symbols[i]->tag,
- default_rule, true);
+ default_reduction, true);
defaulted = false;
print_reduction (out, level + 1, symbols[i]->tag,
reds->rules[j], false);
}
}
- if (default_rule)
+ if (default_reduction)
print_reduction (out, level + 1,
- "$default", default_rule, true);
+ "$default", default_reduction, true);
xml_puts (out, level, "</reductions>");
}