Hi Akim, Tys, On Mon, 5 Apr 2010, Akim Demaille wrote:
> I installed the following patch in branch-2.5 and master. I hesitated > about putting the name of the file in the comments too, but I'm bothered > by the fact that there is no means to quote strings in comments. So if > someone had a directory * containing foo.y, then we would get something > incorrect. Of course I can keep the basename of the file, but then on > Windows, where the separator is not /, this would not work properly > either. > > I figured that it was safe to use it as the graph name. But I'd be > happy to hear other opinions. Graphviz also supports comments starting with "//", so what do you think of the first patch below? The second patch brings xml2dot.xsl up to date so that maintainer-xml-check passes. Neither are pushed yet. Also, we should probably repeat all of this for the ASCII and XHTML automaton reports, but I haven't yet. >From b7a9225e50489b296391b4be2ef953fb32c599b4 Mon Sep 17 00:00:00 2001 From: Joel E. Denny <[email protected]> Date: Fri, 30 Apr 2010 19:50:34 -0400 Subject: [PATCH] In DOT output, move grammar file name to "//"-style comments. * src/graphviz.c (start_graph): Implement, and thus name the digraph "Automaton" as in previous Bison releases. --- ChangeLog | 6 ++++++ src/graphviz.c | 17 ++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 34c8c36..557a7e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-04-30 Joel E. Denny <[email protected]> + In DOT output, move grammar file name to "//"-style comments. + * src/graphviz.c (start_graph): Implement, and thus name the + digraph "Automaton" as in previous Bison releases. + +2010-04-30 Joel E. Denny <[email protected]> + Document that undefined %prec identifier warnings will remain. * NEWS (2.4.3): Here. (2.4.2): Here. diff --git a/src/graphviz.c b/src/graphviz.c index 13f279f..4ede3d3 100644 --- a/src/graphviz.c +++ b/src/graphviz.c @@ -40,19 +40,18 @@ void start_graph (FILE *fout) { fprintf (fout, - _("/*\n" - " * Generated by %s.\n" - " * Report bugs to <%s>.\n" - " * Home page: <%s>.\n" - " */\n" + _("// Generated by %s.\n" + "// Report bugs to: <%s>\n" + "// Home page: <%s>\n" + "// Grammar file: %s\n" "\n"), PACKAGE_STRING, PACKAGE_BUGREPORT, - PACKAGE_URL); + PACKAGE_URL, + grammar_file); fprintf (fout, - "digraph %s\n" - "{\n", - quote (grammar_file)); + "digraph Automaton\n" + "{\n"); } void -- 1.5.4.3 >From 92a372203fcc5b4e4a6c4b1d0874432a530d1a4b Mon Sep 17 00:00:00 2001 From: Joel E. Denny <[email protected]> Date: Fri, 30 Apr 2010 19:50:52 -0400 Subject: [PATCH] tests: fix maintainer-xml-check. * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"): Update output to include comments now produced by --graph. (xsl:template match="automaton"): Update output formatting to match --graph. * src/print-xml.c (print_xml): Add bug-report attribute to bison-xml-report element. --- ChangeLog | 10 ++++++++++ data/xslt/xml2dot.xsl | 14 +++++++++++++- src/print-xml.c | 6 ++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 557a7e0..df750dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2010-04-30 Joel E. Denny <[email protected]> + tests: fix maintainer-xml-check. + * data/xslt/xml2dot.xsl (xsl:template match="bison-xml-report"): + Update output to include comments now produced by --graph. + (xsl:template match="automaton"): Update output formatting to + match --graph. + * src/print-xml.c (print_xml): Add bug-report attribute to + bison-xml-report element. + +2010-04-30 Joel E. Denny <[email protected]> + In DOT output, move grammar file name to "//"-style comments. * src/graphviz.c (start_graph): Implement, and thus name the digraph "Automaton" as in previous Bison releases. diff --git a/data/xslt/xml2dot.xsl b/data/xslt/xml2dot.xsl index 887a991..76b5753 100644 --- a/data/xslt/xml2dot.xsl +++ b/data/xslt/xml2dot.xsl @@ -35,11 +35,23 @@ </xsl:template> <xsl:template match="bison-xml-report"> + <xsl:text>// Generated by GNU Bison </xsl:text> + <xsl:value-of select="@version"/> + <xsl:text>. </xsl:text> + <xsl:text>// Report bugs to: <</xsl:text> + <xsl:value-of select="@bug-report"/> + <xsl:text>> </xsl:text> + <xsl:text>// Home page: </xsl:text> + <xsl:text><http://www.gnu.org/software/bison/> </xsl:text> + <xsl:text>// Grammar file: </xsl:text> + <xsl:value-of select="filename"/> + <xsl:text> </xsl:text> <xsl:apply-templates select="automaton"/> </xsl:template> <xsl:template match="automaton"> - <xsl:text>digraph Automaton { </xsl:text> + <xsl:text>digraph Automaton </xsl:text> + <xsl:text>{ </xsl:text> <xsl:apply-templates select="state"/> <xsl:text>} </xsl:text> </xsl:template> diff --git a/src/print-xml.c b/src/print-xml.c index 0d68171..7b753e5 100644 --- a/src/print-xml.c +++ b/src/print-xml.c @@ -505,8 +505,10 @@ print_xml (void) FILE *out = xfopen (spec_xml_file, "w"); fputs ("<?xml version=\"1.0\"?>\n\n", out); - xml_printf (out, level, "<bison-xml-report version=\"%s\">", - xml_escape (VERSION)); + xml_printf (out, level, + "<bison-xml-report version=\"%s\" bug-report=\"%s\">", + xml_escape_n (0, VERSION), + xml_escape_n (1, PACKAGE_BUGREPORT)); fputc ('\n', out); xml_printf (out, level + 1, "<filename>%s</filename>", -- 1.5.4.3
