[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/3] {master} convert the conflict messages to a more bison-l

From: Akim Demaille
Subject: Re: [PATCH 0/3] {master} convert the conflict messages to a more bison-like form
Date: Sun, 23 Sep 2012 15:33:15 +0200

Le 21 sept. 2012 à 18:34, Paul Eggert a écrit :

> On 09/21/2012 09:00 AM, Akim Demaille wrote:
>> Yet I tolerated them since they are "mandated by POSIX".
> I don't recall that discussion.

I don't either :)  I was referring to comments in the code.
Actually, they trace back to (Gosh, David MacKenzie was really

commit 08089d5d35ece0c7d41659cc1bc09638e2abb151
Author: David MacKenzie <address@hidden>
Date:   Tue Apr 20 05:42:52 1993 +0000

    Initial revision

diff --git a/src/conflicts.c b/src/conflicts.c
new file mode 100644
index 0000000..4ed9dea
--- /dev/null
+++ b/src/conflicts.c
+  extern int fixed_outfiles;
+  if (src_total == expected_conflicts && rrc_total == 0)
+    return;
+  if (fixed_outfiles)
+    {
+      /* If invoked under the name `yacc', use the output format
+        specified by POSIX.  */
+      fprintf(stderr, "conflicts: ");
+      if (src_total > 0)
+       fprintf(stderr, " %d shift/reduce", src_total);
+      if (src_total > 0 && rrc_total > 0)
+       fprintf(stderr, ",");
+      if (rrc_total > 0)
+       fprintf(stderr, " %d reduce/reduce", rrc_total);
+      putc('\n', stderr);
+    }
+  else

> What was the problem back
> then?  I just now checked POSIX 1003.2-1992, and the wording
> it uses for diagnostics is the same as the POSIX 2008 wording
> you quoted.  So I don't think the wording is mandated by POSIX.

Good then.

> If I had to guess, I suspect the problem was related to
> existing build procedures that expect a particular wording.
> That exact same wording has been used since Yacc in 7th
> Edition Unix (1978), and it probably goes back even further
> than that.
> Still, it would be helpful to double-check this, if you
> can recall the discussion in question.

I really don't remember anything about this.  I only remember
that you had once a POSIX-conformance hacking session, where
you fixed several non-conformance issues in Bison.

Your wording for the commit I referred to 

> In my 2002-12-26 change to conflicts.c I noticed that the code
> generated conflict reports in a hard-to-translate manner, e.g., it
> assumed that "," has the same meaning in all languages.  It's better
> to translate the whole diagnostic at once, rather than translate each
> piece separately; that lets the entire translation be more idiomatic.
> While fixing this I ended up dedicing that it's better to revert to
> the Yacc style of conflict reports: this is easily translated, and it
> has the virtue of familiarity, at any rate.  So I installed this:

so it seems to me now that the constraint we lived with
("If invoked under the name `yacc', use the output format
specified by POSIX.") is not justified.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]