- "<nonterminal type=\"%d\" symbol=\"%s\">",
- i, xml_escape (tag));
-
- if (left_count > 0)
- {
- xml_puts (out, level + 3, "<left>");
- for (r = 0; r < nrules; r++)
- {
- if (rules[r].lhs->number == i)
- xml_printf (out, level + 4, "<rule>%d</rule>", r);
- }
- xml_puts (out, level + 3, "</left>");
- }
-
- if (right_count > 0)
- {
- xml_puts (out, level + 3, "<right>");
- for (r = 0; r < nrules; r++)
- {
- item_number *rhsp;
- for (rhsp = rules[r].rhs; *rhsp >= 0; rhsp++)
- if (item_number_as_symbol_number (*rhsp) == i)
- {
- xml_printf (out, level + 4, "<rule>%d</rule>", r);
- break;
- }
- }
- xml_puts (out, level + 3, "</right>");
- }
-
- xml_puts (out, level + 2, "</nonterminal>");
+ "<nonterminal symbol-number=\"%d\" name=\"%s\""
+ " usefulness=\"%s\"/>",
+ i, xml_escape (tag),
+ reduce_nonterminal_useless_in_grammar (i)
+ ? "useless-in-grammar" : "useful");