X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/d4a26c4832ca0ae76c99b98144513dced634280b..0f664b89d4aa86146015acd87a770db878d7e5d4:/src/print-xml.c?ds=sidebyside diff --git a/src/print-xml.c b/src/print-xml.c index 9b1891bd..cb6707da 100644 --- a/src/print-xml.c +++ b/src/print-xml.c @@ -392,12 +392,20 @@ print_grammar (FILE *out, int level) if (token_translations[i] != undeftoken->number) { char const *tag = symbols[token_translations[i]]->tag; - xml_printf (out, level + 2, - "", - token_translations[i], i, xml_escape (tag), - reduce_token_unused_in_grammar (token_translations[i]) - ? "unused-in-grammar" : "useful"); + int precedence = symbols[token_translations[i]]->prec; + assoc associativity = symbols[token_translations[i]]->assoc; + xml_indent (out, level + 2); + fprintf (out, + "\n", out); } xml_puts (out, level + 1, ""); @@ -418,11 +426,17 @@ print_grammar (FILE *out, int level) } void -xml_puts (FILE *out, int level, char const *s) +xml_indent (FILE *out, int level) { int i; for (i = 0; i < level; i++) fputs (" ", out); +} + +void +xml_puts (FILE *out, int level, char const *s) +{ + xml_indent (out, level); fputs (s, out); fputc ('\n', out); } @@ -430,11 +444,9 @@ xml_puts (FILE *out, int level, char const *s) void xml_printf (FILE *out, int level, char const *fmt, ...) { - int i; va_list arglist; - for (i = 0; i < level; i++) - fputs (" ", out); + xml_indent (out, level); va_start (arglist, fmt); vfprintf (out, fmt, arglist);