From MAILER-DAEMON Thu Feb 02 05:49:41 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RsuEX-0003RX-RC
	for mharc-bug-bison@gnu.org; Thu, 02 Feb 2012 05:49:41 -0500
Received: from eggs.gnu.org ([140.186.70.92]:57178)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1RsuEQ-0003QF-Uu
	for bug-bison@gnu.org; Thu, 02 Feb 2012 05:49:40 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1RsuEL-0002ma-51
	for bug-bison@gnu.org; Thu, 02 Feb 2012 05:49:34 -0500
Received: from mail-wi0-f169.google.com ([209.85.212.169]:40097)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1RsuEL-0002mJ-0f
	for bug-bison@gnu.org; Thu, 02 Feb 2012 05:49:29 -0500
Received: by wibhj13 with SMTP id hj13so2317940wib.0
	for <bug-bison@gnu.org>; Thu, 02 Feb 2012 02:49:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=subject:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	bh=iV33Wv+zidzPtWBdRsD2yJcEiwESepEPAepZvVq8MPQ=;
	b=Oks57+lsSd4bnGhIvsTTGAz/UkidwIdhn5F90RdHcK+nUMktRepf0Ol5N9mof9P0Dz
	cm5LHt50FdlMmeBX0LLZMK8FCHtUBGhcfvY/0ty3fa5a+8xXfVI6NhKdLvnwv7rUgeY0
	tJ2gQCvmwPWfNs/90gjK1ApLWbl1f1ypICMDs=
Received: by 10.180.85.105 with SMTP id g9mr17070877wiz.12.1328179767424;
	Thu, 02 Feb 2012 02:49:27 -0800 (PST)
Received: from [192.168.1.116] (knopper.inria.fr. [128.93.60.80])
	by mx.google.com with ESMTPS id t15sm50769268wiv.6.2012.02.02.02.49.24
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 02 Feb 2012 02:49:25 -0800 (PST)
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim.demaille@gmail.com>
In-Reply-To: <E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
Date: Thu, 2 Feb 2012 11:49:23 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<1326882657-20418-11-git-send-email-jim@meyering.net>
	<B3099C04-A210-4220-A589-50F77E007FC3@lrde.epita.fr>
	<87r4yqzdv0.fsf@rho.meyering.net>
	<709EC3D8-A249-4DA2-8C8D-837E48EAFB98@gmail.com>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
To: Akim Demaille <akim.demaille@gmail.com>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.212.169
Cc: Paul Eggert <eggert@cs.ucla.edu>, Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Feb 2012 10:49:40 -0000


Le 30 janv. 2012 =E0 10:43, Akim Demaille a =E9crit :

> Here is a patch that does all this.  candidates/quotes is
> updated.
>=20
> <0001-use-a-more-consistent-quoting-style.patch>

This does not work:

> --- a/bootstrap.conf
> +++ b/bootstrap.conf
> @@ -22,7 +22,7 @@ gnulib_modules=3D'
>   gettext git-version-gen gitlog-to-changelog
>   gpl-3.0 hash inttypes isnan javacomp-script
>   javaexec-script ldexpl maintainer-makefile malloc-gnu mbschr mbsrchr
> -  mbswidth obstack perror pipe-posix quote quotearg realloc-posix
> +  mbswidth obstack perror pipe-posix quotearg realloc-posix
>   spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp

> --- /dev/null
> +++ b/lib/quote.c
> @@ -0,0 +1,54 @@
> +/* quote.c - quote arguments for output
> +
> +   Copyright (C) 1998-2001, 2003, 2005-2006, 2009-2012 Free Software
> +   Foundation, Inc.

I meant to replace gnulib's quote module by a specific
implementation for Bison.  But some other gnulib module
requires quote, so the next iteration of bootstrap
removes my own quote.[ch] (this is a bug imho, bootstrap
should die refusing to erase files it does not "own") to
install a symlink to gnulib's.

I want to replace gnulib's quote module because it
imposes a quotearg style that I do not want (see all
the previous messages about l10n issues in the test suite
of Bison).  Instead of:

> char const *
> quote_n (int n, char const *name)
> {
>  return quotearg_n_style (n, locale_quoting_style, name);
> }

I want:

> char const *
> quote_n (int n, char const *name)
> {
>  return quotearg_n (n, name);
> }

which uses the default style instead of imposing one.  And
I have:

> void
> quote_init (void)
> {
>  char const *cp =3D getenv ("LC_CTYPE");
>  if (cp && STREQ (cp, "C", 'C', 0,0,0,0,0,0,0,0))
>    set_custom_quoting (0, "'", "'");
>  else
>    set_quoting_style (0, locale_quoting_style);
> }

which defines this default style.

So my options are, in decreasing order of preference:

- submit changes to gnulib's quote so that the choice of the default
 style is left to the actual user of gnulib, and stick to
 gnulib's quote in Bison.

- submit changes to gnulib's in order to allow a project
 dependent override of modules, so that bootstrap knows that
 there is a quote module that will be handled by the host
 project, so it must not deploy its own.  Maybe this already
 exists, I don't know gnulib well enough.

- rename bison's lib/quote.[ch] into something, including
 the functions, and change every single call in bison, and
 also accept that the gnulib modules that use gnulib's
 quote will not conform to our quotearg style.

What course of action would you recommend?



From MAILER-DAEMON Thu Feb 02 10:59:18 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rsz4A-0000Fc-6D
	for mharc-bug-bison@gnu.org; Thu, 02 Feb 2012 10:59:18 -0500
Received: from eggs.gnu.org ([140.186.70.92]:52154)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1Rsz44-0000FV-NP
	for bug-bison@gnu.org; Thu, 02 Feb 2012 10:59:16 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1Rsz3y-0000uU-9y
	for bug-bison@gnu.org; Thu, 02 Feb 2012 10:59:12 -0500
Received: from smtp.cs.ucla.edu ([131.179.128.62]:52116)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1Rsz3y-0000uK-62
	for bug-bison@gnu.org; Thu, 02 Feb 2012 10:59:06 -0500
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 6D6A5A60001;
	Thu,  2 Feb 2012 07:52:06 -0800 (PST)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 9WUub4yh9ZcJ; Thu,  2 Feb 2012 07:52:06 -0800 (PST)
Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 1975439E8007;
	Thu,  2 Feb 2012 07:52:06 -0800 (PST)
Message-ID: <4F2AB125.8090008@cs.ucla.edu>
Date: Thu, 02 Feb 2012 07:52:05 -0800
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:9.0) Gecko/20111222 Thunderbird/9.0
MIME-Version: 1.0
To: Akim Demaille <akim.demaille@gmail.com>
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<1326882657-20418-11-git-send-email-jim@meyering.net>
	<B3099C04-A210-4220-A589-50F77E007FC3@lrde.epita.fr>
	<87r4yqzdv0.fsf@rho.meyering.net>
	<709EC3D8-A249-4DA2-8C8D-837E48EAFB98@gmail.com>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
In-Reply-To: <468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.179.128.62
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Feb 2012 15:59:16 -0000

On 02/02/2012 02:49 AM, Akim Demaille wrote:
> - submit changes to gnulib's quote so that the choice of the default
>  style is left to the actual user of gnulib, and stick to
>  gnulib's quote in Bison.

Sounds good to me; how would that work?


From MAILER-DAEMON Wed Feb 08 05:55:09 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rv5B7-0003Gz-Ke
	for mharc-bug-bison@gnu.org; Wed, 08 Feb 2012 05:55:09 -0500
Received: from eggs.gnu.org ([140.186.70.92]:35646)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1Rv5Az-0003B5-Pq
	for bug-bison@gnu.org; Wed, 08 Feb 2012 05:55:07 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1Rv5Ao-0006Wa-S9
	for bug-bison@gnu.org; Wed, 08 Feb 2012 05:55:01 -0500
Received: from mail-ww0-f49.google.com ([74.125.82.49]:46467)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1Rv5Ao-0006WA-CO
	for bug-bison@gnu.org; Wed, 08 Feb 2012 05:54:50 -0500
Received: by wgbdt13 with SMTP id dt13so270486wgb.30
	for <bug-bison@gnu.org>; Wed, 08 Feb 2012 02:54:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=subject:mime-version:content-type:from:in-reply-to:date:cc
	:message-id:references:to:x-mailer;
	bh=MFw96RZWrCAT9aZ3/i6bRv7aCe4GyOZDIi2CYZ95B+c=;
	b=iE5jzgciJ8R2fZQK8fkyraNwihKtTON9oClP8VSmGSsG1aXFAASc5z9BkZX7TJVrHi
	0icxfNf3DZiQVRMAFSwL16FX1kyoqcDn0ZpVPZ9O+J0ZtnWUc1kXj+qZSTamYSM34Uyc
	KVwXh+QbtrfaE+oRcA3sQmoFCgy27vTykfM4Q=
Received: by 10.216.133.161 with SMTP id q33mr6656312wei.46.1328698489143;
	Wed, 08 Feb 2012 02:54:49 -0800 (PST)
Received: from [192.168.105.53] (sao-paulo.lrde.epita.fr. [163.5.55.1])
	by mx.google.com with ESMTPS id ft8sm7601026wib.11.2012.02.08.02.54.46
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 08 Feb 2012 02:54:47 -0800 (PST)
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: multipart/mixed; boundary=Apple-Mail-7-351450945
From: Akim Demaille <akim.demaille@gmail.com>
In-Reply-To: <4F2AB125.8090008@cs.ucla.edu>
Date: Wed, 8 Feb 2012 11:54:45 +0100
Message-Id: <03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<1326882657-20418-11-git-send-email-jim@meyering.net>
	<B3099C04-A210-4220-A589-50F77E007FC3@lrde.epita.fr>
	<87r4yqzdv0.fsf@rho.meyering.net>
	<709EC3D8-A249-4DA2-8C8D-837E48EAFB98@gmail.com>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
	<4F2AB125.8090008@cs.ucla.edu>
To: Paul Eggert <eggert@CS.UCLA.EDU>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 74.125.82.49
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 08 Feb 2012 10:55:07 -0000


--Apple-Mail-7-351450945
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=iso-8859-1


Le 2 f=E9vr. 2012 =E0 16:52, Paul Eggert a =E9crit :

> On 02/02/2012 02:49 AM, Akim Demaille wrote:
>> - submit changes to gnulib's quote so that the choice of the default
>> style is left to the actual user of gnulib, and stick to
>> gnulib's quote in Bison.
>=20
> Sounds good to me; how would that work?

Hi Paul!

I'm not sure what the best way to do it yet.  But there
are really two different issues covered in my patch,
one being to rely on quote() more extensively to provide
the quotes (rather than leaving them in the format
strings), the other being addressing the test suite
issues on OS X.  I pushed the first part in both master
(see the attached patch) and in branch-2.5.


--Apple-Mail-7-351450945
Content-Disposition: attachment;
	filename=0001-use-a-more-consistent-quoting-style.patch
Content-Type: application/octet-stream;
	name="0001-use-a-more-consistent-quoting-style.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=204a9cd8f24abba232b4a07ccdda4c6f109d27acac=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Akim=20Demaille=20<demaille@gostai.com>=0A=
Date:=20Wed,=208=20Feb=202012=2010:28:58=20+0100=0ASubject:=20[PATCH]=20=
use=20a=20more=20consistent=20quoting=20style.=0A=0ASee=20=
<http://lists.gnu.org/archive/html/bug-bison/2012-01/msg00120.html>.=0A=
Use=20quotearg=20as=20often=20as=20possible=20instead=20of=20leaving=20=
the=20choice=20of=0Athe=20quotes=20to=20the=20translators.=20=20Use=20=
shorter=20messages.=20=20Factor=20similar=0Amessages=20to=20a=20single=20=
format,=20to=20make=20localization=20easier.=0A=0A=09*=20src/files.c,=20=
src/getargs.c,=20src/muscle-tab.c,=20src/reader.c=0A=09*=20=
src/scan-code.l,=20src/scan-gram.l,=20src/symtab.c:=0A=09Use=20quote()=20=
or=20quotearg_colon()=20on=20printf=20arguments=20instead=20of=0A=09=
quotes=20in=20the=20format=20string.=0A=09*=20data/bison.m4:=20Keep=20=
sync=20with=20the=20changes=20in=20muscle-tab.c.=0A=0A=09*=20=
tests/skeletons.at,=20tests/input.at,=20tests/regression.at:=20Adjust=0A=09=
expected=20messages.=0A---=0A=20data/bison.m4=20=20=20=20=20=20=20|=20=20=
=20=208=20++++----=0A=20lib/.gitignore=20=20=20=20=20=20|=20=20=20=202=20=
--=0A=20m4/.gitignore=20=20=20=20=20=20=20|=20=20=2026=20=
++++++++++++--------------=0A=20src/files.c=20=20=20=20=20=20=20=20=20|=20=
=20=20=204=20+++-=0A=20src/getargs.c=20=20=20=20=20=20=20|=20=20=2010=20=
+++++-----=0A=20src/muscle-tab.c=20=20=20=20|=20=20=2035=20=
+++++++++++++++++------------------=0A=20src/muscle-tab.h=20=20=20=20|=20=
=20=20=202=20++=0A=20src/reader.c=20=20=20=20=20=20=20=20|=20=20=20=204=20=
++--=0A=20src/scan-code.l=20=20=20=20=20|=20=20=2012=20++++++------=0A=20=
src/scan-gram.l=20=20=20=20=20|=20=20=20=209=20+++++++--=0A=20=
src/symtab.c=20=20=20=20=20=20=20=20|=20=20=20=205=20+++--=0A=20=
tests/input.at=20=20=20=20=20=20|=20=20=2016=20++++++++--------=0A=20=
tests/regression.at=20|=20=20=20=204=20++--=0A=20tests/skeletons.at=20=20=
|=20=20=20=204=20++--=0A=2014=20files=20changed,=2073=20insertions(+),=20=
68=20deletions(-)=0A=0Adiff=20--git=20a/data/bison.m4=20b/data/bison.m4=0A=
index=207dfb1a7..37bc012=20100644=0A---=20a/data/bison.m4=0A+++=20=
b/data/bison.m4=0A@@=20-598,7=20+598,7=20@@=20=
m4_define([b4_percent_define_get_loc],=0A=20=20=20=20=20=20=20=20=20=20=20=
[m4_pushdef([b4_loc],=20m4_indir([b4_percent_define_loc(]$1[)]))dnl=0A=20=
b4_loc[]dnl=0A=20m4_popdef([b4_loc])],=0A-=20=20=20=20=20=20=20=20=20=20=
[b4_fatal([[undefined=20%%define=20variable=20'%s'=20passed=20to=20=
b4_percent_define_get_loc]],=20[$1])])])=0A+=20=20=20=20=20=20=20=20=20=20=
[b4_fatal([[b4_percent_define_get_loc:=20undefined=20%%define=20variable=20=
'%s']],=20[$1])])])=0A=20=0A=20#=20=
b4_percent_define_get_syncline(VARIABLE)=0A=20#=20=
----------------------------------------=0A@@=20-615,7=20+615,7=20@@=20=
m4_popdef([b4_loc])],=0A=20m4_define([b4_percent_define_get_syncline],=0A=
=20[m4_ifdef([b4_percent_define_syncline(]$1[)],=0A=20=20=20=20=20=20=20=20=
=20=20=20[m4_indir([b4_percent_define_syncline(]$1[)])],=0A-=20=20=20=20=20=
=20=20=20=20=20[b4_fatal([[undefined=20%%define=20variable=20'%s'=20=
passed=20to=20b4_percent_define_get_syncline]],=20[$1])])])=0A+=20=20=20=20=
=20=20=20=20=20=20[b4_fatal([[b4_percent_define_get_syncline:=20=
undefined=20%%define=20variable=20'%s']],=20[$1])])])=0A=20=0A=20#=20=
b4_percent_define_ifdef(VARIABLE,=20IF-TRUE,=20[IF-FALSE])=0A=20#=20=
------------------------------------------------------=0A@@=20-659,7=20=
+659,7=20@@=20m4_define([b4_percent_define_flag_if],=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20[[invalid=20value=20for=20=
%%define=20Boolean=20variable=20'%s']],=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20[$1])],=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
[[b4_percent_define_flag_if($1)]])])],=0A-=20=20[b4_fatal([[undefined=20=
%%define=20variable=20'%s'=20passed=20to=20b4_percent_define_flag_if]],=20=
[$1])])])=0A+=20=20[b4_fatal([[b4_percent_define_flag_if:=20undefined=20=
%%define=20variable=20'%s']],=20[$1])])])=0A=20=0A=20=0A=20#=20=
b4_percent_define_default(VARIABLE,=20DEFAULT)=0A@@=20-731,7=20+731,7=20=
@@=20m4_define([_b4_percent_define_check_values],=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20[[accepted=20value:=20'%s']],=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20m4_dquote(b4_value))])])dnl=0A=20=20=20=20=
m4_popdef([b4_good_value])],=0A-=20=20[b4_fatal([[undefined=20%%define=20=
variable=20'%s'=20passed=20to=20b4_percent_define_check_values]],=20=
[$1])])])=0A+=20=20[b4_fatal([[b4_percent_define_check_values:=20=
undefined=20%%define=20variable=20'%s']],=20[$1])])])=0A=20=0A=20#=20=
b4_percent_code_get([QUALIFIER])=0A=20#=20=
--------------------------------=0Adiff=20--git=20a/lib/.gitignore=20=
b/lib/.gitignore=0Aindex=20365b84d..5b14836=20100644=0A---=20=
a/lib/.gitignore=0A+++=20b/lib/.gitignore=0A@@=20-1,4=20+1,3=20@@=0A-=0A=20=
/*.a=0A=20/*.bak=0A=20/*.o=0A@@=20-242,7=20+241,6=20@@=0A=20/xsize.h=0A=20=
/xstrndup.c=0A=20/xstrndup.h=0A-=0A=20/c-strcaseeq.h=0A=20/fd-hook.c=0A=20=
/fd-hook.h=0Adiff=20--git=20a/m4/.gitignore=20b/m4/.gitignore=0Aindex=20=
901724d..01e5f64=20100644=0A---=20a/m4/.gitignore=0A+++=20=
b/m4/.gitignore=0A@@=20-1,4=20+1,3=20@@=0A-=0A=20/00gnulib.m4=0A=20=
/alloca.m4=0A=20/argmatch.m4=0A@@=20-6,7=20+5,9=20@@=0A=20/assert.m4=0A=20=
/calloc.m4=0A=20/cloexec.m4=0A+/close-stream.m4=0A=20/close.m4=0A=
+/closeout.m4=0A=20/codeset.m4=0A=20/config-h.m4=0A=20/configmake.m4=0A=
@@=20-28,10=20+29,12=20@@=0A=20/fcntl_h.m4=0A=20/float_h.m4=0A=20=
/fopen.m4=0A+/fpending.m4=0A=20/fpieee.m4=0A=20/fprintf-posix.m4=0A=20=
/frexp.m4=0A=20/frexpl.m4=0A+/fstat.m4=0A=20/getdtablesize.m4=0A=20=
/getopt.m4=0A=20/gettext.m4=0A@@=20-57,6=20+60,8=20@@=0A=20/iswblank.m4=0A=
=20/javacomp.m4=0A=20/javaexec.m4=0A+/largefile.m4=0A+/ldexp.m4=0A=20=
/ldexpl.m4=0A=20/lib-ld.m4=0A=20/lib-link.m4=0A@@=20-78,10=20+83,13=20@@=0A=
=20/memchr.m4=0A=20/mmap-anon.m4=0A=20/mode_t.m4=0A+/msvc-inval.m4=0A=
+/msvc-nothrow.m4=0A=20/multiarch.m4=0A=20/nls.m4=0A=20/nocrash.m4=0A=20=
/open.m4=0A+/pathmax.m4=0A=20/perror.m4=0A=20/pipe.m4=0A=20/pipe2.m4=0A=
@@=20-95,6=20+103,7=20@@=0A=20/progtest.m4=0A=20/quote.m4=0A=20=
/quotearg.m4=0A+/raise.m4=0A=20/rawmemchr.m4=0A=20/realloc.m4=0A=20=
/sched_h.m4=0A@@=20-112,6=20+121,7=20@@=0A=20/spawn-pipe.m4=0A=20=
/spawn_h.m4=0A=20/sprintf-posix.m4=0A+/ssize_t.m4=0A=20/stat.m4=0A=20=
/stdbool.m4=0A=20/stddef_h.m4=0A@@=20-124,6=20+134,7=20@@=0A=20=
/strchrnul.m4=0A=20/strdup.m4=0A=20/strerror.m4=0A+/strerror_r.m4=0A=20=
/string_h.m4=0A=20/strndup.m4=0A=20/strnlen.m4=0A@@=20-156,16=20+167,3=20=
@@=0A=20/xalloc.m4=0A=20/xsize.m4=0A=20/xstrndup.m4=0A-=0A-/fstat.m4=0A=
-/largefile.m4=0A-/ldexp.m4=0A-/msvc-inval.m4=0A-/msvc-nothrow.m4=0A=
-/pathmax.m4=0A-/raise.m4=0A-/ssize_t.m4=0A-/strerror_r.m4=0A=
-/close-stream.m4=0A-/closeout.m4=0A-/fpending.m4=0Adiff=20--git=20=
a/src/files.c=20b/src/files.c=0Aindex=2066d9218..d80b718=20100644=0A---=20=
a/src/files.c=0A+++=20b/src/files.c=0A@@=20-25,6=20+25,7=20@@=0A=20=
#include=20<dirname.h>=0A=20#include=20<get-errno.h>=0A=20#include=20=
<quote.h>=0A+#include=20<quotearg.h>=0A=20#include=20<stdio-safer.h>=0A=20=
#include=20<xstrndup.h>=0A=20=0A@@=20-109,7=20+110,8=20@@=20xfopen=20=
(const=20char=20*name,=20const=20char=20*mode)=0A=20=0A=20=20=20ptr=20=3D=20=
fopen_safer=20(name,=20mode);=0A=20=20=20if=20(!ptr)=0A-=20=20=20=20=
error=20(EXIT_FAILURE,=20get_errno=20(),=20_("cannot=20open=20file=20=
'%s'"),=20name);=0A+=20=20=20=20error=20(EXIT_FAILURE,=20get_errno=20(),=0A=
+=20=20=20=20=20=20=20=20=20=20=20_("%s:=20cannot=20open"),=20=
quotearg_colon=20(name));=0A=20=0A=20=20=20return=20ptr;=0A=20}=0Adiff=20=
--git=20a/src/getargs.c=20b/src/getargs.c=0Aindex=205fa3c45..e5d1faa=20=
100644=0A---=20a/src/getargs.c=0A+++=20b/src/getargs.c=0A@@=20-26,7=20=
+26,6=20@@=0A=20#include=20<c-strcase.h>=0A=20#include=20<configmake.h>=0A=
=20#include=20<error.h>=0A-#include=20<quotearg.h>=0A=20=0A=20/*=20Hack=20=
to=20get=20<getopt.h>=20to=20declare=20getopt=20with=20a=20prototype.=20=20=
*/=0A=20#if=20lint=20&&=20!=20defined=20__GNU_LIBRARY__=0A@@=20-45,6=20=
+44,7=20@@=0A=20#include=20"files.h"=0A=20#include=20"getargs.h"=0A=20=
#include=20"muscle-tab.h"=0A+#include=20"quote.h"=0A=20#include=20=
"uniqstr.h"=0A=20=0A=20bool=20defines_flag;=0A@@=20-421,14=20+421,14=20=
@@=20language_argmatch=20(char=20const=20*arg,=20int=20prio,=20location=20=
loc)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20language=20=3D=20=
&valid_languages[i];=0A=20=20=20=20=20=20=20=20=20=20=20=20=20return;=0A=20=
=20=20=20=20=20=20=20=20=20=20}=0A-=20=20=20=20=20=20msg=20=3D=20=
_("invalid=20language=20'%s'");=0A+=20=20=20=20=20=20msg=20=3D=20_("%s:=20=
invalid=20language");=0A=20=20=20=20=20}=0A=20=20=20else=20if=20=
(language_prio=20=3D=3D=20prio)=0A=20=20=20=20=20msg=20=3D=20_("multiple=20=
language=20declarations=20are=20invalid");=0A=20=20=20else=0A=20=20=20=20=
=20return;=0A=20=0A-=20=20complain_at=20(loc,=20msg,=20arg);=0A+=20=20=
complain_at=20(loc,=20msg,=20quotearg_colon=20(arg));=0A=20}=0A=20=0A=20=
/*----------------------.=0A@@=20-679,9=20+679,9=20@@=20getargs=20(int=20=
argc,=20char=20*argv[])=0A=20=20=20if=20(argc=20-=20optind=20!=3D=201)=0A=
=20=20=20=20=20{=0A=20=20=20=20=20=20=20if=20(argc=20-=20optind=20<=201)=0A=
-=20=20=20=20=20=20=20=20error=20(0,=200,=20_("missing=20operand=20after=20=
'%s'"),=20argv[argc=20-=201]);=0A+=20=20=20=20=20=20=20=20error=20(0,=20=
0,=20_("%s:=20missing=20operand"),=20quotearg_colon=20(argv[argc=20-=20=
1]));=0A=20=20=20=20=20=20=20else=0A-=20=20=20=20=20=20=20=20error=20(0,=20=
0,=20_("extra=20operand=20'%s'"),=20argv[optind=20+=201]);=0A+=20=20=20=20=
=20=20=20=20error=20(0,=200,=20_("extra=20operand=20%s"),=20quote=20=
(argv[optind=20+=201]));=0A=20=20=20=20=20=20=20usage=20(EXIT_FAILURE);=0A=
=20=20=20=20=20}=0A=20=0Adiff=20--git=20a/src/muscle-tab.c=20=
b/src/muscle-tab.c=0Aindex=20e366d33..bc1aa1f=20100644=0A---=20=
a/src/muscle-tab.c=0A+++=20b/src/muscle-tab.c=0A@@=20-21,12=20+21,12=20=
@@=0A=20#include=20"system.h"=0A=20=0A=20#include=20<hash.h>=0A-#include=20=
<quotearg.h>=0A=20=0A=20#include=20"complain.h"=0A=20#include=20=
"files.h"=0A-#include=20"muscle-tab.h"=0A=20#include=20"getargs.h"=0A=
+#include=20"muscle-tab.h"=0A+#include=20"quote.h"=0A=20=0A=20/*=20A=20=
key-value=20pair,=20along=20with=20storage=20that=20can=20be=20reclaimed=20=
when=0A=20=20=20=20this=20pair=20is=20no=20longer=20needed.=20=20*/=0A@@=20=
-439,8=20+439,8=20@@=20muscle_percent_define_insert=20(char=20const=20=
*variable,=20location=20variable_loc,=0A=20=20=20=20=20=20=20=20=20atoi=20=
(muscle_find_const=20(how_name));=0A=20=20=20=20=20=20=20if=20(how_old=20=
=3D=3D=20MUSCLE_PERCENT_DEFINE_F)=0A=20=20=20=20=20=20=20=20=20return;=0A=
-=20=20=20=20=20=20complain_at=20(variable_loc,=20_("%%define=20variable=20=
'%s'=20redefined"),=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20variable);=0A+=20=20=20=20=20=20complain_at=20(variable_loc,=20=
_("%%define=20variable=20%s=20redefined"),=0A+=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20quote=20(variable));=0A=20=20=20=20=20=20=20=
complain_at=20(muscle_percent_define_get_loc=20(variable),=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20_("previous=20=
definition"));=0A=20=20=20=20=20}=0A@@=20-503,8=20+503,8=20@@=20=
muscle_percent_define_get_loc=20(char=20const=20*variable)=0A=20=20=20=
char=20const=20*loc_name;=0A=20=20=20loc_name=20=3D=20UNIQSTR_CONCAT=20=
("percent_define_loc(",=20variable,=20")");=0A=20=20=20if=20=
(!muscle_find_const=20(loc_name))=0A-=20=20=20=20fatal(_("undefined=20=
%%define=20variable=20'%s'=20passed=20to"=0A-=20=20=20=20=20=20=20=20=20=20=
=20=20"=20muscle_percent_define_get_loc"),=20variable);=0A+=20=20=20=20=
fatal(_("%s:=20undefined=20%%define=20variable=20%s"),=0A+=20=20=20=20=20=
=20=20=20=20=20"muscle_percent_define_get_loc",=20quote=20(variable));=0A=
=20=20=20return=20muscle_location_decode=20(loc_name);=0A=20}=0A=20=0A@@=20=
-517,8=20+517,8=20@@=20muscle_percent_define_get_syncline=20(char=20=
const=20*variable)=0A=20=20=20=20=20UNIQSTR_CONCAT=20=
("percent_define_syncline(",=20variable,=20")");=0A=20=20=20syncline=20=3D=
=20muscle_find_const=20(syncline_name);=0A=20=20=20if=20(!syncline)=0A-=20=
=20=20=20fatal(_("undefined=20%%define=20variable=20'%s'=20passed=20to"=0A=
-=20=20=20=20=20=20=20=20=20=20=20=20"=20=
muscle_percent_define_get_syncline"),=20variable);=0A+=20=20=20=20=
fatal(_("%s:=20undefined=20%%define=20variable=20%s"),=0A+=20=20=20=20=20=
=20=20=20=20=20"muscle_percent_define_get_syncline",=20quote=20=
(variable));=0A=20=20=20return=20syncline;=0A=20}=0A=20=0A@@=20-563,14=20=
+563,14=20@@=20muscle_percent_define_flag_if=20(char=20const=20=
*variable)=0A=20=20=20=20=20=20=20=20=20{=0A=20=20=20=20=20=20=20=20=20=20=
=20muscle_insert=20(invalid_boolean_name,=20"");=0A=20=20=20=20=20=20=20=20=
=20=20=20complain_at(muscle_percent_define_get_loc=20(variable),=0A-=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20_("invalid=20=
value=20for=20%%define=20Boolean=20variable=20'%s'"),=0A-=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20variable);=0A+=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20_("invalid=20value=20=
for=20%%define=20Boolean=20variable=20%s"),=0A+=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20quote=20(variable));=0A=20=20=20=20=
=20=20=20=20=20}=0A=20=20=20=20=20=20=20free=20(value);=0A=20=20=20=20=20=
}=0A=20=20=20else=0A-=20=20=20=20fatal(_("undefined=20%%define=20=
variable=20'%s'=20passed=20to=20muscle_percent_define_flag_if"),=0A-=20=20=
=20=20=20=20=20=20=20=20variable);=0A+=20=20=20=20fatal(_("%s:=20=
undefined=20%%define=20variable=20%s"),=0A+=20=20=20=20=20=20=20=20=20=20=
"muscle_percent_define_flag",=20quote=20(variable));=0A=20=0A=20=20=20=
return=20result;=0A=20}=0A@@=20-621,10=20+621,10=20@@=20=
muscle_percent_define_check_values=20(char=20const=20*=20const=20=
*values)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20{=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20location=20loc=20=3D=20=
muscle_percent_define_get_loc=20(*variablep);=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20complain_at(loc,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20_("invalid=20value=20for=20=
%%define=20variable=20'%s':=20'%s'"),=0A-=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20*variablep,=20value);=0A+=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
_("invalid=20value=20for=20%%define=20variable=20%s:=20%s"),=0A+=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
quote=20(*variablep),=20quote_n=20(1,=20value));=0A=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20for=20(values=20=3D=20variablep=20+=201;=20*values;=20=
++values)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20complain_at=20=
(loc,=20_("accepted=20value:=20'%s'"),=20*values);=0A+=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20complain_at=20(loc,=20_("accepted=20value:=20=
%s"),=20quote=20(*values));=0A=20=20=20=20=20=20=20=20=20=20=20=20=20}=0A=
=20=20=20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20{=0A@@=20-634,9=20+634,8=20@@=20muscle_percent_define_check_values=20=
(char=20const=20*=20const=20*values)=0A=20=20=20=20=20=20=20=20=20=20=20=
free=20(value);=0A=20=20=20=20=20=20=20=20=20}=0A=20=20=20=20=20=20=20=
else=0A-=20=20=20=20=20=20=20=20fatal(_("undefined=20%%define=20variable=20=
'%s'=20passed=20to"=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"=20=
muscle_percent_define_check_values"),=0A-=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20*variablep);=0A+=20=20=20=20=20=20=20=20fatal=20(_("%s:=20=
undefined=20%%define=20variable=20%s"),=0A+=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20"muscle_percent_define_check_values",=20quote=20=
(*variablep));=0A=20=20=20=20=20}=0A=20}=0A=20=0Adiff=20--git=20=
a/src/muscle-tab.h=20b/src/muscle-tab.h=0Aindex=204bf8d66..5f701ae=20=
100644=0A---=20a/src/muscle-tab.h=0A+++=20b/src/muscle-tab.h=0A@@=20=
-20,6=20+20,8=20@@=0A=20#ifndef=20MUSCLE_TAB_H_=0A=20#=20define=20=
MUSCLE_TAB_H_=0A=20=0A+#=20include=20<quotearg.h>=0A+=0A=20#=20include=20=
"location.h"=0A=20=0A=20void=20muscle_init=20(void);=0Adiff=20--git=20=
a/src/reader.c=20b/src/reader.c=0Aindex=2060fe7bd..107fe90=20100644=0A=
---=20a/src/reader.c=0A+++=20b/src/reader.c=0A@@=20-130,8=20+130,8=20@@=20=
record_merge_function_type=20(int=20merger,=20uniqstr=20type,=20location=20=
declaration_loc)=0A=20=20=20if=20(merge_function->type=20!=3D=20NULL=20=
&&=20!UNIQSTR_EQ=20(merge_function->type,=20type))=0A=20=20=20=20=20{=0A=20=
=20=20=20=20=20=20complain_at=20(declaration_loc,=0A-=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20_("result=20type=20clash=20on=20=
merge=20function=20'%s':=20<%s>=20!=3D=20<%s>"),=0A-=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20merge_function->name,=20type,=20=
merge_function->type);=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20_("result=20type=20clash=20on=20merge=20function=20%s:=20<%s>=20=
!=3D=20<%s>"),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
quote=20(merge_function->name),=20type,=20merge_function->type);=0A=20=20=
=20=20=20=20=20complain_at=20(merge_function->type_declaration_location,=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20_("previous=20=
declaration"));=0A=20=20=20=20=20}=0Adiff=20--git=20a/src/scan-code.l=20=
b/src/scan-code.l=0Aindex=20ba6adb1..b8c0c1b=20100644=0A---=20=
a/src/scan-code.l=0A+++=20b/src/scan-code.l=0A@@=20-755,13=20+755,13=20=
@@=20handle_action_dollar=20(symbol_list=20*rule,=20char=20*text,=20=
location=20dollar_loc)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20{=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20if=20(rule->midrule_parent_rule)=0A=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20complain_at=20=
(dollar_loc,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20_("$$=20for=20the=20midrule=20at=20$%d=20=
of=20'%s'"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20_("$$=20for=20the=20midrule=20at=20$%d=20of=20=
%s"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20"=20has=20no=20declared=20type"),=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20rule->midrule_parent_rhs_index,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
effective_rule->content.sym->tag);=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20quote=20=
(effective_rule->content.sym->tag));=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20else=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
complain_at=20(dollar_loc,=20_("$$=20of=20'%s'=20has=20no=20declared=20=
type"),=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20rule->content.sym->tag);=0A+=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20complain_at=20(dollar_loc,=20_("$$=20of=20%s=20=
has=20no=20declared=20type"),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20quote=20=
(rule->content.sym->tag));=0A=20=20=20=20=20=20=20=20=20=20=20=20=20}=0A=20=
=20=20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20untyped_var_seen=20=3D=20true;=0A@@=20-782,8=20+782,8=20@@=20=
handle_action_dollar=20(symbol_list=20*rule,=20char=20*text,=20location=20=
dollar_loc)=0A=20=20=20=20=20=20=20if=20(!type_name)=0A=20=20=20=20=20=20=
=20=20=20{=0A=20=20=20=20=20=20=20=20=20=20=20if=20(union_seen=20|=20=
tag_seen)=0A-=20=20=20=20=20=20=20=20=20=20=20=20complain_at=20=
(dollar_loc,=20_("$%s=20of=20'%s'=20has=20no=20declared=20type"),=0A-=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20cp,=20=
effective_rule->content.sym->tag);=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
complain_at=20(dollar_loc,=20_("$%s=20of=20%s=20has=20no=20declared=20=
type"),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20cp,=20quote=20(effective_rule->content.sym->tag));=0A=20=20=20=
=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
untyped_var_seen=20=3D=20true;=0A=20=20=20=20=20=20=20=20=20=20=20=
type_name=20=3D=20"";=0Adiff=20--git=20a/src/scan-gram.l=20=
b/src/scan-gram.l=0Aindex=20449fbea..e2e08f9=20100644=0A---=20=
a/src/scan-gram.l=0A+++=20b/src/scan-gram.l=0A@@=20-39,6=20+39,7=20@@=0A=20=
#include=20<ctype.h>=0A=20#include=20<mbswidth.h>=0A=20#include=20=
<quote.h>=0A+#include=20<streq.h>=0A=20=0A=20#include=20=
<src/scan-gram.h>=0A=20=0A@@=20-965,6=20+966,10=20@@=20unexpected_end=20=
(boundary=20start,=20char=20const=20*msgid,=20char=20const=20*token_end)=0A=
=20=20=20location=20loc;=0A=20=20=20loc.start=20=3D=20start;=0A=20=20=20=
loc.end=20=3D=20scanner_cursor;=0A+=20=20token_end=20=3D=20quote=20=
(token_end);=0A+=20=20//=20Instead=20of=20'\'',=20display=20"'".=0A+=20=20=
if=20(STREQ=20(token_end,=20"'\\''",=20'\'',=20'\\',=20'\'',=20'\'',=20=
0,0,0,0,0))=0A+=20=20=20=20token_end=20=3D=20"\"'\"";=0A=20=20=20=
complain_at=20(loc,=20_(msgid),=20token_end);=0A=20}=0A=20=0A@@=20-977,7=20=
+982,7=20@@=20unexpected_end=20(boundary=20start,=20char=20const=20=
*msgid,=20char=20const=20*token_end)=0A=20static=20void=0A=20=
unexpected_eof=20(boundary=20start,=20char=20const=20*token_end)=0A=20{=0A=
-=20=20unexpected_end=20(start,=20N_("missing=20'%s'=20at=20end=20of=20=
file"),=20token_end);=0A+=20=20unexpected_end=20(start,=20N_("missing=20=
%s=20at=20end=20of=20file"),=20token_end);=0A=20}=0A=20=0A=20=0A@@=20=
-988,7=20+993,7=20@@=20unexpected_eof=20(boundary=20start,=20char=20=
const=20*token_end)=0A=20static=20void=0A=20unexpected_newline=20=
(boundary=20start,=20char=20const=20*token_end)=0A=20{=0A-=20=20=
unexpected_end=20(start,=20N_("missing=20'%s'=20at=20end=20of=20line"),=20=
token_end);=0A+=20=20unexpected_end=20(start,=20N_("missing=20%s=20at=20=
end=20of=20line"),=20token_end);=0A=20}=0A=20=0A=20=0Adiff=20--git=20=
a/src/symtab.c=20b/src/symtab.c=0Aindex=2007d5efb..5a59564=20100644=0A=
---=20a/src/symtab.c=0A+++=20b/src/symtab.c=0A@@=20-26,6=20+26,7=20@@=0A=20=
=0A=20#include=20"complain.h"=0A=20#include=20"gram.h"=0A+#include=20=
"quote.h"=0A=20#include=20"symtab.h"=0A=20=0A=20=
/*-------------------------------------------------------------------.=0A=
@@=20-444,10=20+445,10=20@@=20void=0A=20symbol_make_alias=20(symbol=20=
*sym,=20symbol=20*str,=20location=20loc)=0A=20{=0A=20=20=20if=20=
(str->alias)=0A-=20=20=20=20warn_at=20(loc,=20_("symbol=20'%s'=20used=20=
more=20than=20once=20as=20a=20literal=20string"),=0A+=20=20=20=20warn_at=20=
(loc,=20_("symbol=20%s=20used=20more=20than=20once=20as=20a=20literal=20=
string"),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20str->tag);=0A=20=20=
=20else=20if=20(sym->alias)=0A-=20=20=20=20warn_at=20(loc,=20_("symbol=20=
'%s'=20given=20more=20than=20one=20literal=20string"),=0A+=20=20=20=20=
warn_at=20(loc,=20_("symbol=20%s=20given=20more=20than=20one=20literal=20=
string"),=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20sym->tag);=0A=20=20=
=20else=0A=20=20=20=20=20{=0Adiff=20--git=20a/tests/input.at=20=
b/tests/input.at=0Aindex=206a2bcdc..84ae0ff=20100644=0A---=20=
a/tests/input.at=0A+++=20b/tests/input.at=0A@@=20-745,8=20+745,8=20@@=20=
start:=20;=0A=20=0A=20AT_BISON_CHECK([-o=20input.c=20input.y],=201,=20=
[],=0A=20[[input.y:1.10-2.0:=20missing=20'"'=20at=20end=20of=20line=0A=
-input.y:4.10-5.0:=20missing=20'''=20at=20end=20of=20line=0A=
-input.y:14.11-15.0:=20missing=20'''=20at=20end=20of=20line=0A=
+input.y:4.10-5.0:=20missing=20"'"=20at=20end=20of=20line=0A=
+input.y:14.11-15.0:=20missing=20"'"=20at=20end=20of=20line=0A=20=
input.y:16.11-17.0:=20missing=20'"'=20at=20end=20of=20line=0A=20=
input.y:19.13-20.0:=20missing=20'}'=20at=20end=20of=20file=0A=20=
input.y:20.1:=20syntax=20error,=20unexpected=20end=20of=20file=0A@@=20=
-1206,9=20+1206,9=20@@=20AT_CHECK([[perl=20-e=20"print=20'start:=20\'';"=20=
>>=20empty.y=20||=20exit=2077]])=0A=20AT_BISON_CHECK([empty.y],=20[1],=20=
[],=0A=20[[empty.y:2.8-9:=20warning:=20empty=20character=20literal=0A=20=
empty.y:3.8-4.0:=20warning:=20empty=20character=20literal=0A=
-empty.y:3.8-4.0:=20missing=20'''=20at=20end=20of=20line=0A=
+empty.y:3.8-4.0:=20missing=20"'"=20at=20end=20of=20line=0A=20=
empty.y:4.8:=20warning:=20empty=20character=20literal=0A-empty.y:4.8:=20=
missing=20'''=20at=20end=20of=20file=0A+empty.y:4.8:=20missing=20"'"=20=
at=20end=20of=20file=0A=20]])=0A=20=0A=20AT_DATA([two.y],=0A@@=20-1221,9=20=
+1221,9=20@@=20AT_CHECK([[perl=20-e=20"print=20'start:=20\'ab';"=20>>=20=
two.y=20||=20exit=2077]])=0A=20AT_BISON_CHECK([two.y],=20[1],=20[],=0A=20=
[[two.y:2.8-11:=20warning:=20extra=20characters=20in=20character=20=
literal=0A=20two.y:3.8-4.0:=20warning:=20extra=20characters=20in=20=
character=20literal=0A-two.y:3.8-4.0:=20missing=20'''=20at=20end=20of=20=
line=0A+two.y:3.8-4.0:=20missing=20"'"=20at=20end=20of=20line=0A=20=
two.y:4.8-10:=20warning:=20extra=20characters=20in=20character=20literal=0A=
-two.y:4.8-10:=20missing=20'''=20at=20end=20of=20file=0A+two.y:4.8-10:=20=
missing=20"'"=20at=20end=20of=20file=0A=20]])=0A=20=0A=20=
AT_DATA([three.y],=0A@@=20-1236,9=20+1236,9=20@@=20AT_CHECK([[perl=20-e=20=
"print=20'start:=20\'abc';"=20>>=20three.y=20||=20exit=2077]])=0A=20=
AT_BISON_CHECK([three.y],=20[1],=20[],=0A=20[[three.y:2.8-12:=20warning:=20=
extra=20characters=20in=20character=20literal=0A=20three.y:3.8-4.0:=20=
warning:=20extra=20characters=20in=20character=20literal=0A=
-three.y:3.8-4.0:=20missing=20'''=20at=20end=20of=20line=0A=
+three.y:3.8-4.0:=20missing=20"'"=20at=20end=20of=20line=0A=20=
three.y:4.8-11:=20warning:=20extra=20characters=20in=20character=20=
literal=0A-three.y:4.8-11:=20missing=20'''=20at=20end=20of=20file=0A=
+three.y:4.8-11:=20missing=20"'"=20at=20end=20of=20file=0A=20]])=0A=20=0A=
=20AT_CLEANUP=0Adiff=20--git=20a/tests/regression.at=20=
b/tests/regression.at=0Aindex=205affe4d..9aaedde=20100644=0A---=20=
a/tests/regression.at=0A+++=20b/tests/regression.at=0A@@=20-197,7=20=
+197,7=20@@=20exp:=20'('=20exp=20')'=20|=20NUM=20;=0A=20]])=0A=20=0A=20=
AT_BISON_CHECK([-v=20-o=20input.c=20input.y],=200,=20[],=0A=
-[[input.y:6.8-14:=20warning:=20symbol=20'"<=3D"'=20used=20more=20than=20=
once=20as=20a=20literal=20string=0A+[[input.y:6.8-14:=20warning:=20=
symbol=20"<=3D"=20used=20more=20than=20once=20as=20a=20literal=20string=0A=
=20]])=0A=20=0A=20AT_CLEANUP=0A@@=20-475,7=20+475,7=20@@=20main=20(void)=0A=
=20#=20the=20user=20specification=20is=20eliminated.=0A=20=
AT_BISON_CHECK([-o=20input.c=20input.y],=20[[0]],=20[[]],=0A=20=
[[input.y:22.8-14:=20warning:=20symbol=20SPECIAL=20redeclared=0A=
-input.y:22.8-63:=20warning:=20symbol=20=
'"\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!"'=20used=20more=20than=20once=20=
as=20a=20literal=20string=0A+input.y:22.8-63:=20warning:=20symbol=20=
"\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!"=20used=20more=20than=20once=20=
as=20a=20literal=20string=0A=20]])=0A=20AT_COMPILE([input])=0A=20=0Adiff=20=
--git=20a/tests/skeletons.at=20b/tests/skeletons.at=0Aindex=20=
eee57b0..1a9933f=20100644=0A---=20a/tests/skeletons.at=0A+++=20=
b/tests/skeletons.at=0A@@=20-228,7=20+228,7=20@@=20start:=20;=0A=20]])=0A=
=20=0A=20AT_BISON_CHECK([[input3.y]],=20[[1]],=20[[]],=0A-[[input3.y:=20=
fatal=20error:=20undefined=20%define=20variable=20'bogus'=20passed=20to=20=
b4_percent_define_get_loc=0A+[[input3.y:=20fatal=20error:=20=
b4_percent_define_get_loc:=20undefined=20%define=20variable=20'bogus'=0A=20=
]])=0A=20=0A=20AT_DATA([[skel4.c]],=0A@@=20-242,7=20+242,7=20@@=20start:=20=
;=0A=20]])=0A=20=0A=20AT_BISON_CHECK([[input4.y]],=20[[1]],=20[[]],=0A=
-[[input4.y:=20fatal=20error:=20undefined=20%define=20variable=20'bogus'=20=
passed=20to=20b4_percent_define_get_syncline=0A+[[input4.y:=20fatal=20=
error:=20b4_percent_define_get_syncline:=20undefined=20%define=20=
variable=20'bogus'=0A=20]])=0A=20=0A=20AT_CLEANUP=0A--=20=0A1.7.9=0A=0A=

--Apple-Mail-7-351450945--


From MAILER-DAEMON Wed Feb 08 09:03:06 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rv870-000459-UY
	for mharc-bug-bison@gnu.org; Wed, 08 Feb 2012 09:03:06 -0500
Received: from eggs.gnu.org ([140.186.70.92]:48069)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Rv86t-00040p-PA
	for bug-bison@gnu.org; Wed, 08 Feb 2012 09:03:05 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Rv86k-0006bQ-39
	for bug-bison@gnu.org; Wed, 08 Feb 2012 09:02:59 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:59181
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Rv86j-0006ar-Hc
	for bug-bison@gnu.org; Wed, 08 Feb 2012 09:02:49 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1Rv86g-0003ao-06; Wed, 08 Feb 2012 15:02:46 +0100
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: multipart/mixed; boundary=Apple-Mail-14-362731272
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
Date: Wed, 8 Feb 2012 15:02:45 +0100
Message-Id: <5073C1DD-0EA3-457C-A3D1-C897E512B779@lrde.epita.fr>
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<1326882657-20418-11-git-send-email-jim@meyering.net>
	<B3099C04-A210-4220-A589-50F77E007FC3@lrde.epita.fr>
	<87r4yqzdv0.fsf@rho.meyering.net>
	<709EC3D8-A249-4DA2-8C8D-837E48EAFB98@gmail.com>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
	<4F2AB125.8090008@cs.ucla.edu>
	<03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
To: Akim Demaille <akim.demaille@gmail.com>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: Paul Eggert <eggert@CS.UCLA.EDU>, Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 08 Feb 2012 14:03:05 -0000


--Apple-Mail-14-362731272
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=iso-8859-1


Le 8 f=E9vr. 2012 =E0 11:54, Akim Demaille a =E9crit :

> Le 2 f=E9vr. 2012 =E0 16:52, Paul Eggert a =E9crit :
>=20
>> On 02/02/2012 02:49 AM, Akim Demaille wrote:
>>> - submit changes to gnulib's quote so that the choice of the default
>>> style is left to the actual user of gnulib, and stick to
>>> gnulib's quote in Bison.
>>=20
>> Sounds good to me; how would that work?
>=20
> Hi Paul!
>=20
> I'm not sure what the best way to do it yet.

My problem is that there are several default styles used
in quote*.  There is DEFAULT_QUOTING_STYLE which does
not seem to be used (but maybe its purpose is to tell
the users of quotearg.h that 0 corresponds to
literal_quoting_style?).  There is locale_quote_style
which is hard coded in quote, and also there is
the default_quoting_style that can be modified by the
user.

So I don't know if you want quote to use the default
style (0), or to have its own style.  And actually, by
style I mean options.

The proposal below exposes a new quote_quoting_options,
in addition to the default_quoting_options (0), but it
is equal to it by default.  Because quoting_options are
very handy, the exposed API seemed to be too weak, as
there is no nice quotearg_* function that takes a
quoting_option.  So I exposed quotearg_n_options.

I did the patch this way to try to preserve some backward
compatibility with people who want quote to use
locale_quoting_style by default, but at the cost of
changing the default style to using it.  Is this good
enough?

My concern here is that I don't think it is up to
gnulib to decide what style should be used in the program,
and since some gnulib modules use quote, in practice it
means that gnulib does make decisions on behalf of the
host project.

If you have better ideas, I'll take them :)  Otherwise,
the easiest might be to change the bison wrapper in the
tests suite to change the quotes in the output messages :(


--Apple-Mail-14-362731272
Content-Disposition: attachment;
	filename=0001-quote-allow-the-user-to-override-the-style.patch
Content-Type: application/octet-stream;
	name="0001-quote-allow-the-user-to-override-the-style.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=20309ff5255861a18a50784ead7a839c159d47ecf1=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Akim=20Demaille=20<demaille@gostai.com>=0A=
Date:=20Wed,=208=20Feb=202012=2014:40:16=20+0100=0ASubject:=20[PATCH]=20=
quote:=20allow=20the=20user=20to=20override=20the=20style.=0A=0A=09*=20=
lib/quotearg.c=20(quotearg_n_options):=20No=20longer=20static.=0A=09=
Accept=200=20to=20denote=20the=20default=20options.=0A=09Adjust=20=
callers.=0A=09(SIZE_MAX):=20Move=20to...=0A=09*=20lib/quotearg.h:=20=
here.=0A=09(quotearg_n_options):=20Declare=20and=20document.=0A=09*=20=
lib/quote.h,=20lib/quote.c=20(quote_quoting_options,=20quote_init):=20=
New.=0A---=0A=20lib/quote.c=20=20=20=20|=20=20=2023=20=
+++++++++++++++++++++--=0A=20lib/quote.h=20=20=20=20|=20=20=2010=20=
++++++++++=0A=20lib/quotearg.c=20|=20=20=2021=20+++++----------------=0A=20=
lib/quotearg.h=20|=20=20=2017=20+++++++++++++++++=0A=204=20files=20=
changed,=2053=20insertions(+),=2018=20deletions(-)=0A=0Adiff=20--git=20=
a/lib/quote.c=20b/lib/quote.c=0Aindex=20b46fd83..a3906d6=20100644=0A---=20=
a/lib/quote.c=0A+++=20b/lib/quote.c=0A@@=20-20,15=20+20,34=20@@=0A=20=0A=20=
#include=20<config.h>=0A=20=0A-#include=20"quotearg.h"=0A=20#include=20=
"quote.h"=0A=20=0A+#ifndef=20SIZE_MAX=0A+#=20define=20SIZE_MAX=20=
((size_t)=20-1)=0A+#endif=0A+=0A+struct=20quoting_options=20=
*quote_quoting_options=20=3D=200;=0A+=0A+/*=20Whether=20=
quote_quoting_options=20is=20initialized.=20*/=0A+int=20initialized=20=3D=20=
0;=0A+=0A+void=0A+quote_init=20(void)=0A+{=0A+=20=20if=20(!initialized)=0A=
+=20=20=20=20{=0A+=20=20=20=20=20=20set_quoting_style=20=
(quote_quoting_options,=20locale_quoting_style);=0A+=20=20=20=20=20=20=
initialized=20=3D=201;=0A+=20=20=20=20}=0A+}=0A+=0A=20/*=20Return=20an=20=
unambiguous=20printable=20representation=20of=20NAME,=0A=20=20=20=20=
allocated=20in=20slot=20N,=20suitable=20for=20diagnostics.=20=20*/=0A=20=
char=20const=20*=0A=20quote_n=20(int=20n,=20char=20const=20*name)=0A=20{=0A=
-=20=20return=20quotearg_n_style=20(n,=20locale_quoting_style,=20name);=0A=
+=20=20quote_init=20();=0A+=20=20return=20quotearg_n_options=20(n,=20=
name,=20SIZE_MAX,=20quote_quoting_options);=0A=20}=0A=20=0A=20/*=20=
Return=20an=20unambiguous=20printable=20representation=20of=20NAME,=0A=
diff=20--git=20a/lib/quote.h=20b/lib/quote.h=0Aindex=20140908b..f10eb33=20=
100644=0A---=20a/lib/quote.h=0A+++=20b/lib/quote.h=0A@@=20-15,6=20+15,16=20=
@@=0A=20=20=20=20You=20should=20have=20received=20a=20copy=20of=20the=20=
GNU=20General=20Public=20License=0A=20=20=20=20along=20with=20this=20=
program.=20=20If=20not,=20see=20<http://www.gnu.org/licenses/>.=20=20*/=0A=
=20=0A+#include=20"quotearg.h"=0A+=0A+/*=20The=20style=20used=20in=20the=20=
following=20functions.=20=20Defaults=20to=200,=20i.e.,=0A+=20=20=20the=20=
default=20quoting=20style.=20=20*/=0A+extern=20struct=20quoting_options=20=
*quote_quoting_options;=0A+=0A+/*=20Initialize=20quote_quoting_options.=20=
=20Called=20by=20the=20first=20call=20to=0A+=20=20=20either=20quote_n=20=
or=20quote.=20=20To=20override=20QUOTE_QUOTING_OPTIONS,=20first=0A+=20=20=
=20call=20quote_init,=20then=20adjust=20QUOTE_QUOTING_OPTIONS.=20=20*/=0A=
+void=20quote_init=20(void);=0A=20=0A=20char=20const=20*quote_n=20(int=20=
n,=20char=20const=20*name);=0A=20char=20const=20*quote=20(char=20const=20=
*name);=0Adiff=20--git=20a/lib/quotearg.c=20b/lib/quotearg.c=0Aindex=20=
c37aa35..7f0352f=20100644=0A---=20a/lib/quotearg.c=0A+++=20=
b/lib/quotearg.c=0A@@=20-45,10=20+45,6=20@@=0A=20#define=20_(msgid)=20=
gettext=20(msgid)=0A=20#define=20N_(msgid)=20msgid=0A=20=0A-#ifndef=20=
SIZE_MAX=0A-#=20define=20SIZE_MAX=20((size_t)=20-1)=0A-#endif=0A-=0A=20=
#define=20INT_BITS=20(sizeof=20(int)=20*=20CHAR_BIT)=0A=20=0A=20struct=20=
quoting_options=0A@@=20-748,18=20+744,11=20@@=20quotearg_free=20(void)=0A=
=20=20=20nslots=20=3D=201;=0A=20}=0A=20=0A-/*=20Use=20storage=20slot=20N=20=
to=20return=20a=20quoted=20version=20of=20argument=20ARG.=0A-=20=20=20=
ARG=20is=20of=20size=20ARGSIZE,=20but=20if=20that=20is=20SIZE_MAX,=20ARG=20=
is=20a=0A-=20=20=20null-terminated=20string.=0A-=20=20=20OPTIONS=20=
specifies=20the=20quoting=20options.=0A-=20=20=20The=20returned=20value=20=
points=20to=20static=20storage=20that=20can=20be=0A-=20=20=20reused=20by=20=
the=20next=20call=20to=20this=20function=20with=20the=20same=20value=20=
of=20N.=0A-=20=20=20N=20must=20be=20nonnegative.=20=20N=20is=20=
deliberately=20declared=20with=20type=20"int"=0A-=20=20=20to=20allow=20=
for=20future=20extensions=20(using=20negative=20values).=20=20*/=0A=
-static=20char=20*=0A+char=20*=0A=20quotearg_n_options=20(int=20n,=20=
char=20const=20*arg,=20size_t=20argsize,=0A-=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20struct=20quoting_options=20const=20=
*options)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
struct=20quoting_options=20const=20*o)=0A=20{=0A+=20=20struct=20=
quoting_options=20const=20*options=20=3D=20o=20?=20o=20:=20=
&default_quoting_options;=0A=20=20=20int=20e=20=3D=20errno;=0A=20=0A=20=20=
=20unsigned=20int=20n0=20=3D=20n;=0A@@=20-819,13=20+808,13=20@@=20=
quotearg_n_options=20(int=20n,=20char=20const=20*arg,=20size_t=20=
argsize,=0A=20char=20*=0A=20quotearg_n=20(int=20n,=20char=20const=20=
*arg)=0A=20{=0A-=20=20return=20quotearg_n_options=20(n,=20arg,=20=
SIZE_MAX,=20&default_quoting_options);=0A+=20=20return=20=
quotearg_n_options=20(n,=20arg,=20SIZE_MAX,=200);=0A=20}=0A=20=0A=20char=20=
*=0A=20quotearg_n_mem=20(int=20n,=20char=20const=20*arg,=20size_t=20=
argsize)=0A=20{=0A-=20=20return=20quotearg_n_options=20(n,=20arg,=20=
argsize,=20&default_quoting_options);=0A+=20=20return=20=
quotearg_n_options=20(n,=20arg,=20argsize,=200);=0A=20}=0A=20=0A=20char=20=
*=0Adiff=20--git=20a/lib/quotearg.h=20b/lib/quotearg.h=0Aindex=20=
e6b08ab..cd129d3=20100644=0A---=20a/lib/quotearg.h=0A+++=20=
b/lib/quotearg.h=0A@@=20-23,6=20+23,10=20@@=0A=20=0A=20#=20include=20=
<stddef.h>=0A=20=0A+#=20ifndef=20SIZE_MAX=0A+#=20=20define=20SIZE_MAX=20=
((size_t)=20-1)=0A+#=20endif=0A+=0A=20/*=20Basic=20quoting=20styles.=20=20=
For=20each=20style,=20an=20example=20is=20given=20on=20the=0A=20=20=20=20=
input=20strings=20"simple",=20"\0=20\t\n'\"\033?""?/\\",=20and=20"a:b",=20=
using=0A=20=20=20=20quotearg_buffer,=20quotearg_mem,=20and=20=
quotearg_colon_mem=20with=20that=0A@@=20-311,6=20+315,19=20@@=20char=20=
*quotearg_alloc=20(char=20const=20*arg,=20size_t=20argsize,=0A=20char=20=
*quotearg_alloc_mem=20(char=20const=20*arg,=20size_t=20argsize,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
size_t=20*size,=20struct=20quoting_options=20const=20*o);=0A=20=0A+/*=20=
Use=20storage=20slot=20N=20to=20return=20a=20quoted=20version=20of=20=
argument=20ARG.=0A+=20=20=20ARG=20is=20of=20size=20ARGSIZE,=20but=20if=20=
that=20is=20SIZE_MAX,=20ARG=20is=20a=0A+=20=20=20null-terminated=20=
string.=0A+=20=20=20OPTIONS=20specifies=20the=20quoting=20options.=0A+=20=
=20=20The=20returned=20value=20points=20to=20static=20storage=20that=20=
can=20be=0A+=20=20=20reused=20by=20the=20next=20call=20to=20this=20=
function=20with=20the=20same=20value=20of=20N.=0A+=20=20=20N=20must=20be=20=
nonnegative.=20=20N=20is=20deliberately=20declared=20with=20type=20"int"=0A=
+=20=20=20to=20allow=20for=20future=20extensions=20(using=20negative=20=
values).=0A+=20=20=20If=20O=20is=20null,=20use=20the=20default.=20=20*/=0A=
+char=20*=0A+quotearg_n_options=20(int=20n,=20char=20const=20*arg,=20=
size_t=20argsize,=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20struct=20quoting_options=20const=20*o);=0A+=0A=20/*=20Use=20=
storage=20slot=20N=20to=20return=20a=20quoted=20version=20of=20the=20=
string=20ARG.=0A=20=20=20=20Use=20the=20default=20quoting=20options.=0A=20=
=20=20=20The=20returned=20value=20points=20to=20static=20storage=20that=20=
can=20be=0A--=20=0A1.7.9=0A=0A=

--Apple-Mail-14-362731272
Content-Disposition: attachment;
	filename=0001-tests-be-robust-to-quote-style.patch
Content-Type: application/octet-stream;
	name="0001-tests-be-robust-to-quote-style.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=2041187c8e7873e53bca109412e35a7ce172d7676e=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Akim=20Demaille=20<demaille@gostai.com>=0A=
Date:=20Wed,=208=20Feb=202012=2014:44:24=20+0100=0ASubject:=20[PATCH]=20=
tests:=20be=20robust=20to=20quote=20style.=0A=0ASee=20=
<http://lists.gnu.org/archive/html/bug-bison/2012-01/msg00120.html>.=0A=0A=
=09*=20src/main.c=20(main):=20Define=20the=20quoting=20style=20we=20use.=0A=
=09*=20tests/atlocal.in:=20Disable=20it=20during=20the=20tests.=0A---=0A=20=
gnulib=20=20=20=20=20=20=20=20=20=20=20|=20=20=20=202=20+-=0A=20=
src/main.c=20=20=20=20=20=20=20|=20=20=2012=20+++++++++++-=0A=20=
tests/atlocal.in=20|=20=20=20=204=20++++=0A=203=20files=20changed,=2016=20=
insertions(+),=202=20deletions(-)=0A=0Adiff=20--git=20a/gnulib=20=
b/gnulib=0Aindex=2044c4f75..309ff52=20160000=0A---=20a/gnulib=0A+++=20=
b/gnulib=0A@@=20-1=20+1=20@@=0A-Subproject=20commit=20=
44c4f75581a7774594e5a225ab43c9c211e4abb4=0A+Subproject=20commit=20=
309ff5255861a18a50784ead7a839c159d47ecf1=0Adiff=20--git=20a/src/main.c=20=
b/src/main.c=0Aindex=203dbac3a..acf140b=20100644=0A---=20a/src/main.c=0A=
+++=20b/src/main.c=0A@@=20-43,17=20+43,18=20@@=0A=20#include=20"print.h"=0A=
=20#include=20"print_graph.h"=0A=20#include=20"print-xml.h"=0A+#include=20=
<quote.h>=0A=20#include=20"reader.h"=0A=20#include=20"reduce.h"=0A=20=
#include=20"scan-code.h"=0A=20#include=20"scan-gram.h"=0A=20#include=20=
"scan-skel.h"=0A+#include=20<streq.h>=0A=20#include=20"symtab.h"=0A=20=
#include=20"tables.h"=0A=20#include=20"uniqstr.h"=0A=20=0A=20=0A-=0A=20=
int=0A=20main=20(int=20argc,=20char=20*argv[])=0A=20{=0A@@=20-63,6=20=
+64,15=20@@=20main=20(int=20argc,=20char=20*argv[])=0A=20=20=20(void)=20=
bindtextdomain=20("bison-runtime",=20LOCALEDIR);=0A=20=20=20(void)=20=
textdomain=20(PACKAGE);=0A=20=0A+=20=20{=0A+=20=20=20=20quote_init=20();=0A=
+=20=20=20=20char=20const=20*cp=20=3D=20getenv=20("LC_CTYPE");=0A+=20=20=20=
=20if=20(cp=20&&=20STREQ=20(cp,=20"C",=20'C',=200,0,0,0,0,0,0,0))=0A+=20=20=
=20=20=20=20set_custom_quoting=20(quote_quoting_options,=20"'",=20"'");=0A=
+=20=20=20=20else=0A+=20=20=20=20=20=20set_quoting_style=20=
(quote_quoting_options,=20locale_quoting_style);=0A+=20=20}=0A+=0A=20=20=20=
atexit=20(close_stdout);=0A=20=0A=20=20=20uniqstrs_new=20();=0Adiff=20=
--git=20a/tests/atlocal.in=20b/tests/atlocal.in=0Aindex=20=
764540c..d005f85=20100644=0A---=20a/tests/atlocal.in=0A+++=20=
b/tests/atlocal.in=0A@@=20-45,3=20+45,7=20@@=20CONF_JAVA=3D'@CONF_JAVA@'=0A=
=20=0A=20#=20We=20need=20egrep.=0A=20:=20${EGREP=3D'@EGREP@'}=0A+=0A+#=20=
Use=20simple=20quotes=20(lib/quote.c).=0A+LC_CTYPE=3DC=0A+export=20=
LC_CTYPE=0A--=20=0A1.7.9=0A=0A=

--Apple-Mail-14-362731272--


From MAILER-DAEMON Wed Feb 08 11:33:47 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RvASp-0004LJ-66
	for mharc-bug-bison@gnu.org; Wed, 08 Feb 2012 11:33:47 -0500
Received: from eggs.gnu.org ([140.186.70.92]:52892)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RvASh-0004Jc-O5
	for bug-bison@gnu.org; Wed, 08 Feb 2012 11:33:45 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RvASd-0005XM-OJ
	for bug-bison@gnu.org; Wed, 08 Feb 2012 11:33:39 -0500
Received: from smtp.cs.ucla.edu ([131.179.128.62]:53465)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RvASd-0005WO-K8
	for bug-bison@gnu.org; Wed, 08 Feb 2012 11:33:35 -0500
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 104D539E800B;
	Wed,  8 Feb 2012 08:33:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id AuyZt4RJfIYj; Wed,  8 Feb 2012 08:33:26 -0800 (PST)
Received: from [192.168.1.3] (pool-71-189-109-235.lsanca.fios.verizon.net
	[71.189.109.235])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id ED5FA39E8007;
	Wed,  8 Feb 2012 08:33:23 -0800 (PST)
Message-ID: <4F32A3B4.7070807@cs.ucla.edu>
Date: Wed, 08 Feb 2012 08:32:52 -0800
From: Paul Eggert <eggert@cs.ucla.edu>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:9.0) Gecko/20111229 Thunderbird/9.0
MIME-Version: 1.0
To: Akim Demaille <akim.demaille@gmail.com>
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<1326882657-20418-11-git-send-email-jim@meyering.net>
	<B3099C04-A210-4220-A589-50F77E007FC3@lrde.epita.fr>
	<87r4yqzdv0.fsf@rho.meyering.net>
	<709EC3D8-A249-4DA2-8C8D-837E48EAFB98@gmail.com>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
	<4F2AB125.8090008@cs.ucla.edu>
	<03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
In-Reply-To: <03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.179.128.62
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 08 Feb 2012 16:33:45 -0000

On 02/08/2012 02:54 AM, Akim Demaille wrote:
> -        error (0, 0, _("missing operand after '%s'"), argv[argc - 1]);
> +        error (0, 0, _("%s: missing operand"), quotearg_colon (argv[argc - 1]));
>        else
> -        error (0, 0, _("extra operand '%s'"), argv[optind + 1]);
> +        error (0, 0, _("extra operand %s"), quote (argv[optind + 1]));

This doesn't seem consistent: shouldn't both use quotearg_colon,
or neither?

Otherwise I didn't see a problem, in a quick perusal.


From MAILER-DAEMON Wed Feb 08 13:04:05 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RvBsD-000388-0Q
	for mharc-bug-bison@gnu.org; Wed, 08 Feb 2012 13:04:05 -0500
Received: from eggs.gnu.org ([140.186.70.92]:46519)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1RvBs3-00034a-Iy
	for bug-bison@gnu.org; Wed, 08 Feb 2012 13:04:03 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1RvBs2-0005Rt-7z
	for bug-bison@gnu.org; Wed, 08 Feb 2012 13:03:55 -0500
Received: from mail-ww0-f49.google.com ([74.125.82.49]:58277)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1RvBs2-0005Rm-1t
	for bug-bison@gnu.org; Wed, 08 Feb 2012 13:03:54 -0500
Received: by wgbdt13 with SMTP id dt13so624144wgb.30
	for <bug-bison@gnu.org>; Wed, 08 Feb 2012 10:03:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=subject:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	bh=YKgN91pM1Ut9vBPUDWQHOduk7g7xZ//spHlhgWymSTE=;
	b=rl2EkDoKSiokMZy192H1iS7T/Ti9xWGjxJPmxH0x46aEIN6UktTBEsz7oDMNlZ8qyY
	cG9P/CIVu0WnoLKm0SYktaTIsMVBGB8vEDQ0rfNU8wz8e8+MesrqFmaWvqjb2qk2L3uW
	QBodQRbgAi07aqw+w+bI3ZT/TndmYY+xcKTFg=
Received: by 10.180.83.70 with SMTP id o6mr16723601wiy.19.1328724233359;
	Wed, 08 Feb 2012 10:03:53 -0800 (PST)
Received: from tenochtitlan-eth.lrde.epita.fr (sao-paulo.lrde.epita.fr.
	[163.5.55.1])
	by mx.google.com with ESMTPS id ho4sm1483652wib.3.2012.02.08.10.03.51
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 08 Feb 2012 10:03:51 -0800 (PST)
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim.demaille@gmail.com>
In-Reply-To: <4F32A3B4.7070807@cs.ucla.edu>
Date: Wed, 8 Feb 2012 19:03:50 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <BF34A286-C401-4C25-AADF-F90DA71C69A6@gmail.com>
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<1326882657-20418-11-git-send-email-jim@meyering.net>
	<B3099C04-A210-4220-A589-50F77E007FC3@lrde.epita.fr>
	<87r4yqzdv0.fsf@rho.meyering.net>
	<709EC3D8-A249-4DA2-8C8D-837E48EAFB98@gmail.com>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
	<4F2AB125.8090008@cs.ucla.edu>
	<03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
	<4F32A3B4.7070807@cs.ucla.edu>
To: Paul Eggert <eggert@cs.ucla.edu>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 74.125.82.49
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 08 Feb 2012 18:04:03 -0000


Le 8 f=E9vr. 2012 =E0 17:32, Paul Eggert a =E9crit :

> On 02/08/2012 02:54 AM, Akim Demaille wrote:
>> -        error (0, 0, _("missing operand after '%s'"), argv[argc - =
1]);
>> +        error (0, 0, _("%s: missing operand"), quotearg_colon =
(argv[argc - 1]));
>>       else
>> -        error (0, 0, _("extra operand '%s'"), argv[optind + 1]);
>> +        error (0, 0, _("extra operand %s"), quote (argv[optind + =
1]));
>=20
> This doesn't seem consistent: shouldn't both use quotearg_colon,
> or neither?

Hi Paul,

thanks for the review.  Actually, I am bugged by this
one: I can read easily

	--output: missing operand

but I don't read as easily

	output: extra operand

I would go for

	extra operand: output

for instance.  Is this what you mean?

> Otherwise I didn't see a problem, in a quick perusal.

Thanks!=


From MAILER-DAEMON Wed Feb 08 13:16:37 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RvC4L-0005OY-6a
	for mharc-bug-bison@gnu.org; Wed, 08 Feb 2012 13:16:37 -0500
Received: from eggs.gnu.org ([140.186.70.92]:51725)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RvC4D-0005H6-Bd
	for bug-bison@gnu.org; Wed, 08 Feb 2012 13:16:35 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RvC4C-0008Bp-54
	for bug-bison@gnu.org; Wed, 08 Feb 2012 13:16:29 -0500
Received: from smtp.cs.ucla.edu ([131.179.128.62]:53756)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RvC4B-0008Bj-Uk
	for bug-bison@gnu.org; Wed, 08 Feb 2012 13:16:28 -0500
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id D452A39E800B;
	Wed,  8 Feb 2012 10:16:26 -0800 (PST)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id PMnxbj6YgFA3; Wed,  8 Feb 2012 10:16:26 -0800 (PST)
Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 8186A39E8006;
	Wed,  8 Feb 2012 10:16:26 -0800 (PST)
Message-ID: <4F32BBF3.9020107@cs.ucla.edu>
Date: Wed, 08 Feb 2012 10:16:19 -0800
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:9.0) Gecko/20111222 Thunderbird/9.0
MIME-Version: 1.0
To: Akim Demaille <akim.demaille@gmail.com>
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<1326882657-20418-11-git-send-email-jim@meyering.net>
	<B3099C04-A210-4220-A589-50F77E007FC3@lrde.epita.fr>
	<87r4yqzdv0.fsf@rho.meyering.net>
	<709EC3D8-A249-4DA2-8C8D-837E48EAFB98@gmail.com>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
	<4F2AB125.8090008@cs.ucla.edu>
	<03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
	<4F32A3B4.7070807@cs.ucla.edu>
	<BF34A286-C401-4C25-AADF-F90DA71C69A6@gmail.com>
In-Reply-To: <BF34A286-C401-4C25-AADF-F90DA71C69A6@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.179.128.62
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 08 Feb 2012 18:16:35 -0000

On 02/08/2012 10:03 AM, Akim Demaille wrote:
> I would go for
> 
> 	extra operand: output
> 
> for instance.  Is this what you mean?

Sorry, I wasn't paying attention at all to the actual messages:
all I noticed was that quotearg_colon was used with one, and
quote with the other.  Now that you've drawn my attention to
what the messages actually mean, I agree that it's OK that
they're inconsistent (either with or without your latest
suggestion).


From MAILER-DAEMON Fri Feb 10 20:19:14 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rw1cQ-0004Gi-Nj
	for mharc-bug-bison@gnu.org; Fri, 10 Feb 2012 20:19:14 -0500
Received: from eggs.gnu.org ([140.186.70.92]:53544)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1Rw1cO-0004GZ-46
	for bug-bison@gnu.org; Fri, 10 Feb 2012 20:19:12 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1Rw1cN-0002vi-3o
	for bug-bison@gnu.org; Fri, 10 Feb 2012 20:19:12 -0500
Received: from plane.gmane.org ([80.91.229.3]:35700)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1Rw1cM-0002te-V5
	for bug-bison@gnu.org; Fri, 10 Feb 2012 20:19:11 -0500
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1Rw1cI-00071I-0v
	for bug-bison@gnu.org; Sat, 11 Feb 2012 02:19:06 +0100
Received: from d220155.adsl.hansenet.de ([80.171.220.155])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Sat, 11 Feb 2012 02:19:05 +0100
Received: from tim by d220155.adsl.hansenet.de with local (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Sat, 11 Feb 2012 02:19:05 +0100
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: bug-bison@gnu.org
To: bug-bison@gnu.org
From: Tim Landscheidt <tim@tim-landscheidt.de>
Subject: "check" table missing comment in bison.m4
Date: Sat, 11 Feb 2012 01:18:56 +0000
Organization: <URI:http://www.tim-landscheidt.de/>
Lines: 34
Message-ID: <m3mx8qf9q7.fsf@passepartout.tim-landscheidt.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: d220155.adsl.hansenet.de
Mail-Copies-To: never
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock: sha1:bYxEKtFj5/KW7UwcZc7g8oFkFII=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 11 Feb 2012 01:19:13 -0000

Hi,

the "check" table (yycheck_[] in the Java incarnation) has
no comment in bison.m4's b4_integral_parser_tables_map which
leads to a misindentation in the generated Java scanner:

| [...]

| /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
|    positive, shift that token.  If negative, reduce the rule which
|    number is the opposite.  If YYTABLE_NINF, syntax error.  */
|   private static final byte yytable_[] = yytable_init();
|   private static final byte[] yytable_init()
|   {
| [...]
|   }

| private static final byte yycheck_[] = yycheck_init();
|   private static final byte[] yycheck_init()
|   {
| [...]
|   }

| /* STOS_[STATE-NUM] -- The (internal number of the) accessing
|    symbol of state STATE-NUM.  */
|   private static final byte yystos_[] = yystos_init();
|   private static final byte[] yystos_init()
|   {
| [...]

Rather than accounting for tables without a comment, I think
it'd be much easier to just document the table :-).

Tim



From MAILER-DAEMON Sat Feb 11 12:50:59 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RwH6B-0006EO-Ds
	for mharc-bug-bison@gnu.org; Sat, 11 Feb 2012 12:50:59 -0500
Received: from eggs.gnu.org ([140.186.70.92]:40938)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1RwH68-0006Cn-8q
	for bug-bison@gnu.org; Sat, 11 Feb 2012 12:50:57 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1RwH67-0004X7-50
	for bug-bison@gnu.org; Sat, 11 Feb 2012 12:50:56 -0500
Received: from plane.gmane.org ([80.91.229.3]:51262)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1RwH66-0004Wz-Vz
	for bug-bison@gnu.org; Sat, 11 Feb 2012 12:50:55 -0500
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1RwH65-0002Yj-2Y
	for bug-bison@gnu.org; Sat, 11 Feb 2012 18:50:53 +0100
Received: from d222181.adsl.hansenet.de ([80.171.222.181])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Sat, 11 Feb 2012 18:50:53 +0100
Received: from tim by d222181.adsl.hansenet.de with local (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Sat, 11 Feb 2012 18:50:53 +0100
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: bug-bison@gnu.org
To: bug-bison@gnu.org
From: Tim Landscheidt <tim@tim-landscheidt.de>
Subject: master: bootstrap doesn't clean up properly
Date: Sat, 11 Feb 2012 17:50:38 +0000
Organization: <URI:http://www.tim-landscheidt.de/>
Lines: 62
Message-ID: <m3fweh6yz5.fsf@passepartout.tim-landscheidt.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: d222181.adsl.hansenet.de
Mail-Copies-To: never
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock: sha1:9j4w4qAFxzOYgA9IGG6gNbKLvEc=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 11 Feb 2012 17:50:57 -0000

Hi,

on a freshly cloned copy, after "git submodule update --init
&& ./bootstrap && ./configure && make && make check", "git
status" gives:

| # On branch master
| # Untracked files:
| #   (use "git add <file>..." to include in what will be committed)
| #
| #	build-aux/config.rpath~
| #	build-aux/snippet/
| #	lib/glthread/
| #	m4/codeset.m4~
| #	m4/fcntl-o.m4~
| #	m4/gettext.m4~
| #	m4/glibc2.m4
| #	m4/glibc2.m4~
| #	m4/glibc21.m4~
| #	m4/iconv.m4~
| #	m4/intdiv0.m4
| #	m4/intdiv0.m4~
| #	m4/intl.m4
| #	m4/intl.m4~
| #	m4/intldir.m4
| #	m4/intldir.m4~
| #	m4/intlmacosx.m4~
| #	m4/intmax.m4
| #	m4/intmax.m4~
| #	m4/inttypes-pri.m4~
| #	m4/inttypes_h.m4~
| #	m4/lcmessage.m4
| #	m4/lcmessage.m4~
| #	m4/lib-ld.m4~
| #	m4/lib-link.m4~
| #	m4/lib-prefix.m4~
| #	m4/lock.m4
| #	m4/lock.m4~
| #	m4/longlong.m4~
| #	m4/nls.m4~
| #	m4/po.m4~
| #	m4/printf-posix.m4~
| #	m4/progtest.m4~
| #	m4/size_max.m4~
| #	m4/stdint_h.m4~
| #	m4/threadlib.m4~
| #	m4/uintmax_t.m4
| #	m4/uintmax_t.m4~
| #	m4/visibility.m4
| #	m4/visibility.m4~
| #	m4/wchar_t.m4~
| #	m4/wint_t.m4~
| #	m4/xsize.m4~
| nothing added to commit but untracked files present (use "git add" to track)

Most of them would probably be hidden by a common
.git/info/exclude of "*~", but:

a) Bison shouldn't rely on that, and
b) there are several *.m4 and directories in the above list.

Tim



From MAILER-DAEMON Sat Feb 11 20:46:54 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RwOWk-0008G9-Tc
	for mharc-bug-bison@gnu.org; Sat, 11 Feb 2012 20:46:54 -0500
Received: from eggs.gnu.org ([140.186.70.92]:44351)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1RwOWh-0008EW-It
	for bug-bison@gnu.org; Sat, 11 Feb 2012 20:46:52 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1RwOWg-0002cL-7J
	for bug-bison@gnu.org; Sat, 11 Feb 2012 20:46:51 -0500
Received: from plane.gmane.org ([80.91.229.3]:37019)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1RwOWf-0002cG-PC
	for bug-bison@gnu.org; Sat, 11 Feb 2012 20:46:50 -0500
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1RwOWd-0003pp-N1
	for bug-bison@gnu.org; Sun, 12 Feb 2012 02:46:47 +0100
Received: from d222181.adsl.hansenet.de ([80.171.222.181])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Sun, 12 Feb 2012 02:46:47 +0100
Received: from tim by d222181.adsl.hansenet.de with local (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Sun, 12 Feb 2012 02:46:47 +0100
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: bug-bison@gnu.org
To: bug-bison@gnu.org
From: Tim Landscheidt <tim@tim-landscheidt.de>
Subject: Re: Java parser throws ArrayIndexOutOfBoundsException if first token
	leads to syntax error
Date: Sun, 12 Feb 2012 01:46:36 +0000
Organization: <URI:http://www.tim-landscheidt.de/>
Lines: 127
Message-ID: <m3lio86cxv.fsf@passepartout.tim-landscheidt.de>
References: <m3d3ap294c.fsf@passepartout.tim-landscheidt.de>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: d222181.adsl.hansenet.de
Mail-Copies-To: never
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock: sha1:buF7KqQnK5RZ2Wy+1/7AwZGaDJE=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 12 Feb 2012 01:46:52 -0000

--=-=-=

I wrote:

> [...]
>   There is a test for syntax errors on the first token in
> tests/java.at, but apparently only in combination with an
> "error" token.  I hope fixing it is easier than isolating
> it was :-).

Nope.  Anyway, attached is the fix.  The test case is a bit
non-hackily lengthy, but I did not want to interlace it in
the existing suite and subtly break half of them in the
process.

Tim

--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-Java-Fix-syntax-error-handling-without-error-token.patch

>From 415333112ba8224264d75164628ca1a173ffb514 Mon Sep 17 00:00:00 2001
From: Tim Landscheidt <tim@tim-landscheidt.de>
Date: Sun, 12 Feb 2012 01:29:41 +0000
Subject: [PATCH] Java: Fix syntax error handling without error token.

* data/lalr1.java (YYParser::parse): Here.
* tests/java.at: Add test case.
---
 data/lalr1.java |    2 +-
 tests/java.at   |   67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+), 1 deletions(-)

diff --git a/data/lalr1.java b/data/lalr1.java
index 57ff993..a40d6c2 100644
--- a/data/lalr1.java
+++ b/data/lalr1.java
@@ -686,7 +686,7 @@ m4_popdef([b4_at_dollar])])dnl
               }
 
             /* Pop the current state because it cannot handle the error token.  */
-            if (yystack.height == 1)
+            if (yystack.height == 0)
               return false;
 
             ]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
diff --git a/tests/java.at b/tests/java.at
index b3e79e9..b8279d1 100644
--- a/tests/java.at
+++ b/tests/java.at
@@ -781,3 +781,70 @@ AT_CHECK([[$EGREP -v ' */?\*' YYParser.java | grep 'Position']], [1], [ignore])
 AT_CHECK([[$EGREP -v ' */?\*' YYParser.java | grep 'Location']], [1], [ignore])
 
 AT_CLEANUP
+
+
+# ----------------------------------------------- #
+# Java syntax error handling without error token. #
+# ----------------------------------------------- #
+
+AT_SETUP([Java syntax error handling without error token])
+
+AT_DATA([[YYParser.y]], [[%language "Java"
+
+%code imports
+  {
+    import java.io.IOException;
+  }
+
+%code
+  {
+    public static void main (String args []) throws IOException
+      {
+        YYParser p = new YYParser (new YYLexer (args [0]));
+        p.parse ();
+      }
+  }
+
+%%
+input:
+  '-' '-'
+;
+%%
+class YYLexer implements YYParser.Lexer
+  {
+    int pos = 0;
+    String s;
+
+    public YYLexer (String ps)
+      {
+        s = ps;
+      }
+
+    public void yyerror (String s)
+      {
+        System.err.println (s);
+      }
+
+    public Object getLVal ()
+      {
+        return null;
+      }
+
+    public int yylex ()
+      {
+        if (pos >= s.length ())
+          return YYParser.Lexer.EOF;
+        else
+          return s.charAt (pos++);
+      }
+  }
+]])
+AT_BISON_CHECK([[YYParser.y]])
+AT_JAVA_COMPILE([[YYParser.java]])
+AT_JAVA_PARSER_CHECK([[YYParser --]], [[0]], [[]], [[]])
+AT_JAVA_PARSER_CHECK([[YYParser -+]], [[0]], [[]], [[syntax error
+]])
+AT_JAVA_PARSER_CHECK([[YYParser +-]], [[0]], [[]], [[syntax error
+]])
+
+AT_CLEANUP
-- 
1.6.2.5


--=-=-=--



From MAILER-DAEMON Mon Feb 13 09:18:44 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rwwjs-0006Ml-IM
	for mharc-bug-bison@gnu.org; Mon, 13 Feb 2012 09:18:44 -0500
Received: from eggs.gnu.org ([140.186.70.92]:33493)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Rwwjq-0006Mf-Op
	for bug-bison@gnu.org; Mon, 13 Feb 2012 09:18:43 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Rwwjp-0007na-D4
	for bug-bison@gnu.org; Mon, 13 Feb 2012 09:18:42 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:53662
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Rwwjp-0007nQ-1r
	for bug-bison@gnu.org; Mon, 13 Feb 2012 09:18:41 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1Rwwjn-0000Ez-77; Mon, 13 Feb 2012 15:18:39 +0100
Subject: Re: Java parser throws ArrayIndexOutOfBoundsException if first token
	leads to syntax error
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: multipart/mixed; boundary=Apple-Mail-8-795684704
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <m3lio86cxv.fsf@passepartout.tim-landscheidt.de>
Date: Mon, 13 Feb 2012 15:18:39 +0100
Message-Id: <732A5915-1D8E-41D8-90D3-A4494A86BC0A@lrde.epita.fr>
References: <m3d3ap294c.fsf@passepartout.tim-landscheidt.de>
	<m3lio86cxv.fsf@passepartout.tim-landscheidt.de>
To: Tim Landscheidt <tim@tim-landscheidt.de>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: bug-bison@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 13 Feb 2012 14:18:43 -0000


--Apple-Mail-8-795684704
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=iso-8859-1

Le 12 f=E9vr. 2012 =E0 02:46, Tim Landscheidt a =E9crit :

hi Tim,

> I wrote:
>=20
>> [...]
>>  There is a test for syntax errors on the first token in
>> tests/java.at, but apparently only in combination with an
>> "error" token.  I hope fixing it is easier than isolating
>> it was :-).
>=20
> Nope.  Anyway, attached is the fix.  The test case is a bit
> non-hackily lengthy, but I did not want to interlace it in
> the existing suite and subtly break half of them in the
> process.

Thanks for this!

>> =46rom 415333112ba8224264d75164628ca1a173ffb514 Mon Sep 17 00:00:00 =
2001
> From: Tim Landscheidt <tim@tim-landscheidt.de>
> Date: Sun, 12 Feb 2012 01:29:41 +0000
> Subject: [PATCH] Java: Fix syntax error handling without error token.
>=20
> * data/lalr1.java (YYParser::parse): Here.
> * tests/java.at: Add test case.
> ---
> data/lalr1.java |    2 +-
> tests/java.at   |   67 =
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 68 insertions(+), 1 deletions(-)
>=20
> diff --git a/data/lalr1.java b/data/lalr1.java
> index 57ff993..a40d6c2 100644
> --- a/data/lalr1.java
> +++ b/data/lalr1.java
> @@ -686,7 +686,7 @@ m4_popdef([b4_at_dollar])])dnl
>               }
>=20
>             /* Pop the current state because it cannot handle the =
error token.  */
> -            if (yystack.height =3D=3D 1)
> +            if (yystack.height =3D=3D 0)

Is this O(1)?  We keep the height of the stack up to
date ourselves?  I'm surprised we don't rely on some
Java container to do this for us.

>               return false;
>=20
>             ]b4_locations_if([yyerrloc =3D yystack.locationAt (0);])[

The fix is straightforward, but the test suite contribution
does require some paper work.  Could you please follow the
instructions in the attached file?  Thanks in advance!


--Apple-Mail-8-795684704
Content-Disposition: attachment;
	filename=request-assign.future
Content-Type: application/octet-stream;
	name="request-assign.future"
Content-Transfer-Encoding: 7bit

Please email the following information to assign@gnu.org, and we
will send you the assignment form for your past and future changes.

Please use your full legal name (in ASCII characters) as the subject
line of the message.
----------------------------------------------------------------------
REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

[What is the name of the program or package you're contributing to?]


[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]


[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]


[For the copyright registration, what country are you a citizen of?]


[What year were you born?]


[Please write your email address here.]


[Please write your postal address here.]





[Which files have you changed so far, and which new files have you written
so far?]







--Apple-Mail-8-795684704
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii




--Apple-Mail-8-795684704--


From MAILER-DAEMON Mon Feb 13 11:30:19 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RwynD-00054Y-46
	for mharc-bug-bison@gnu.org; Mon, 13 Feb 2012 11:30:19 -0500
Received: from eggs.gnu.org ([140.186.70.92]:45884)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1Rwyn5-00052m-G7
	for bug-bison@gnu.org; Mon, 13 Feb 2012 11:30:17 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1Rwymz-0004az-IS
	for bug-bison@gnu.org; Mon, 13 Feb 2012 11:30:11 -0500
Received: from plane.gmane.org ([80.91.229.3]:48305)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1Rwymz-0004YB-Ck
	for bug-bison@gnu.org; Mon, 13 Feb 2012 11:30:05 -0500
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1Rwymt-0000iB-PN
	for bug-bison@gnu.org; Mon, 13 Feb 2012 17:29:59 +0100
Received: from g231144224.adsl.alicedsl.de ([92.231.144.224])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Mon, 13 Feb 2012 17:29:59 +0100
Received: from tim by g231144224.adsl.alicedsl.de with local (Gmexim 0.1
	(Debian)) id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Mon, 13 Feb 2012 17:29:59 +0100
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: bug-bison@gnu.org
To: bug-bison@gnu.org
From: Tim Landscheidt <tim@tim-landscheidt.de>
Subject: Re: Java parser throws ArrayIndexOutOfBoundsException if first token
	leads to syntax error
Date: Mon, 13 Feb 2012 16:29:02 +0000
Organization: <URI:http://www.tim-landscheidt.de/>
Lines: 35
Message-ID: <m38vk6ito1.fsf@passepartout.tim-landscheidt.de>
References: <m3d3ap294c.fsf@passepartout.tim-landscheidt.de>
	<m3lio86cxv.fsf@passepartout.tim-landscheidt.de>
	<732A5915-1D8E-41D8-90D3-A4494A86BC0A@lrde.epita.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: g231144224.adsl.alicedsl.de
Mail-Copies-To: never
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock: sha1:gNtIY27hHShhvCJ5c+XARpyaFMU=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 13 Feb 2012 16:30:17 -0000

Akim Demaille <akim@lrde.epita.fr> wrote:

> [...]
>> diff --git a/data/lalr1.java b/data/lalr1.java
>> index 57ff993..a40d6c2 100644
>> --- a/data/lalr1.java
>> +++ b/data/lalr1.java
>> @@ -686,7 +686,7 @@ m4_popdef([b4_at_dollar])])dnl
>>               }

>>             /* Pop the current state because it cannot handle the error token.  */
>> -            if (yystack.height == 1)
>> +            if (yystack.height == 0)

> Is this O(1)?  We keep the height of the stack up to
> date ourselves?  I'm surprised we don't rely on some
> Java container to do this for us.

What do you mean by O(1) in this case?  The parser logic
here is shared with the C++ skeleton (and yacc.c looks
similar as well).  The stack implementation doesn't look
very frightening performance-wise.

>>               return false;

>>             ]b4_locations_if([yyerrloc = yystack.locationAt (0);])[

> The fix is straightforward, but the test suite contribution
> does require some paper work.  Could you please follow the
> instructions in the attached file?  Thanks in advance!

I have done so (and mentioned the files touched by the two
trivial fixes before to be on the safe side).

Tim



From MAILER-DAEMON Mon Feb 13 11:43:44 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rwz0C-0001H6-2O
	for mharc-bug-bison@gnu.org; Mon, 13 Feb 2012 11:43:44 -0500
Received: from eggs.gnu.org ([140.186.70.92]:56231)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Rwz05-0001F8-0F
	for bug-bison@gnu.org; Mon, 13 Feb 2012 11:43:42 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Rwyzx-0007Ci-OO
	for bug-bison@gnu.org; Mon, 13 Feb 2012 11:43:36 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:45398
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Rwyzx-0007CP-Jp
	for bug-bison@gnu.org; Mon, 13 Feb 2012 11:43:29 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1Rwyzv-0006Z0-CN; Mon, 13 Feb 2012 17:43:27 +0100
Subject: Re: Java parser throws ArrayIndexOutOfBoundsException if first token
	leads to syntax error
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <m38vk6ito1.fsf@passepartout.tim-landscheidt.de>
Date: Mon, 13 Feb 2012 17:43:27 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <3B6C9931-18A7-4EC4-9E57-AEFB328B53FB@lrde.epita.fr>
References: <m3d3ap294c.fsf@passepartout.tim-landscheidt.de>
	<m3lio86cxv.fsf@passepartout.tim-landscheidt.de>
	<732A5915-1D8E-41D8-90D3-A4494A86BC0A@lrde.epita.fr>
	<m38vk6ito1.fsf@passepartout.tim-landscheidt.de>
To: Tim Landscheidt <tim@tim-landscheidt.de>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: bug-bison@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 13 Feb 2012 16:43:42 -0000


Le 13 f=E9vr. 2012 =E0 17:29, Tim Landscheidt a =E9crit :

>>>            /* Pop the current state because it cannot handle the =
error token.  */
>>> -            if (yystack.height =3D=3D 1)
>>> +            if (yystack.height =3D=3D 0)
>=20
>> Is this O(1)?  We keep the height of the stack up to
>> date ourselves?  I'm surprised we don't rely on some
>> Java container to do this for us.
>=20
> What do you mean by O(1) in this case?

In C++ that's a typical case where list.size() =3D=3D 0 is
a bad idea, since it costs a full traversal of the list
to compute its length, while list.empty() is immediate.

But here it appears that we deal with the length of the
stack by hand, which is OK, but surprised me.

> The parser logic
> here is shared with the C++ skeleton (and yacc.c looks
> similar as well).  The stack implementation doesn't look
> very frightening performance-wise.

That the stacks needs to be implemented by hand in C is
no surprise :).



From MAILER-DAEMON Mon Feb 13 18:20:12 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rx5Bs-0005zE-1K
	for mharc-bug-bison@gnu.org; Mon, 13 Feb 2012 18:20:12 -0500
Received: from eggs.gnu.org ([140.186.70.92]:33034)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1Rx5Bp-0005z5-I1
	for bug-bison@gnu.org; Mon, 13 Feb 2012 18:20:10 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1Rx5Bn-00077U-LN
	for bug-bison@gnu.org; Mon, 13 Feb 2012 18:20:09 -0500
Received: from plane.gmane.org ([80.91.229.3]:35099)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1Rx5Bn-00076x-GG
	for bug-bison@gnu.org; Mon, 13 Feb 2012 18:20:07 -0500
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1Rx5Bh-0001gb-9L
	for bug-bison@gnu.org; Tue, 14 Feb 2012 00:20:01 +0100
Received: from g231144224.adsl.alicedsl.de ([92.231.144.224])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Tue, 14 Feb 2012 00:20:01 +0100
Received: from tim by g231144224.adsl.alicedsl.de with local (Gmexim 0.1
	(Debian)) id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Tue, 14 Feb 2012 00:20:01 +0100
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: bug-bison@gnu.org
To: bug-bison@gnu.org
From: Tim Landscheidt <tim@tim-landscheidt.de>
Subject: Re: Java parser throws ArrayIndexOutOfBoundsException if first token
	leads to syntax error
Date: Mon, 13 Feb 2012 23:19:50 +0000
Organization: <URI:http://www.tim-landscheidt.de/>
Lines: 35
Message-ID: <m3fweefhih.fsf@passepartout.tim-landscheidt.de>
References: <m3d3ap294c.fsf@passepartout.tim-landscheidt.de>
	<m3lio86cxv.fsf@passepartout.tim-landscheidt.de>
	<732A5915-1D8E-41D8-90D3-A4494A86BC0A@lrde.epita.fr>
	<m38vk6ito1.fsf@passepartout.tim-landscheidt.de>
	<3B6C9931-18A7-4EC4-9E57-AEFB328B53FB@lrde.epita.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: g231144224.adsl.alicedsl.de
Mail-Copies-To: never
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock: sha1:JoXf844dCeRW5WIlgDBJ03ZeFQo=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 13 Feb 2012 23:20:10 -0000

Akim Demaille <akim@lrde.epita.fr> wrote:

>>>>            /* Pop the current state because it cannot handle the error token.  */
>>>> -            if (yystack.height == 1)
>>>> +            if (yystack.height == 0)

>>> Is this O(1)?  We keep the height of the stack up to
>>> date ourselves?  I'm surprised we don't rely on some
>>> Java container to do this for us.

>> What do you mean by O(1) in this case?

> In C++ that's a typical case where list.size() == 0 is
> a bad idea, since it costs a full traversal of the list
> to compute its length, while list.empty() is immediate.

Ah, okay.

> But here it appears that we deal with the length of the
> stack by hand, which is OK, but surprised me.

Well, you'd have to ask Paolo for the reasoning behind
that :-).

>> The parser logic
>> here is shared with the C++ skeleton (and yacc.c looks
>> similar as well).  The stack implementation doesn't look
>> very frightening performance-wise.

> That the stacks needs to be implemented by hand in C is
> no surprise :).

I meant the Java one.

Tim



From MAILER-DAEMON Thu Feb 16 05:11:23 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RxyJ9-0007Zm-S6
	for mharc-bug-bison@gnu.org; Thu, 16 Feb 2012 05:11:23 -0500
Received: from eggs.gnu.org ([140.186.70.92]:36587)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RxyJ1-0007Lb-DQ
	for bug-bison@gnu.org; Thu, 16 Feb 2012 05:11:22 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RxyJ0-0002Lb-8C
	for bug-bison@gnu.org; Thu, 16 Feb 2012 05:11:15 -0500
Received: from mx.meyering.net ([88.168.87.75]:34539)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RxyIz-0002LO-Vp
	for bug-bison@gnu.org; Thu, 16 Feb 2012 05:11:14 -0500
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 9900460097
	for <bug-bison@gnu.org>; Thu, 16 Feb 2012 11:11:12 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: Bison Bugs <bug-bison@gnu.org>
Subject: [PATCH] tests: avoid c++ failure due to lack of getenv decl
Date: Thu, 16 Feb 2012 11:11:12 +0100
Message-ID: <87ehtvqe9r.fsf@rho.meyering.net>
Lines: 40
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2012 10:11:22 -0000

I noticed that there was a single test failure when
running "make check" using the latest gcc/g++ from git (4.7.x).

Pushed to master, as obvious:

>From 292402a9b2a9fe3440008e42a41b01185d9a4f9d Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 16 Feb 2012 11:03:31 +0100
Subject: [PATCH] tests: avoid c++ failure due to lack of getenv decl

* tests/c++.at (Syntax error as exception): Avoid spurious failure
at least when compiling with g++-4.7.x due to lack of declaration
of getenv.  Include <stdlib.h>.
---
 tests/c++.at |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/c++.at b/tests/c++.at
index d29b6f6..3510498 100644
--- a/tests/c++.at
+++ b/tests/c++.at
@@ -461,6 +461,7 @@ AT_DATA_GRAMMAR([[input.yy]],

 %code
 {
+  #include <stdlib.h>
   int yylex (yy::parser::semantic_type *);
 }

@@ -510,7 +511,7 @@ yy::parser::error (const std::string &m)
 }

 int
-main ()
+main (void)
 {
   yy::parser parser;
   parser.set_debug_level(!!getenv("YYDEBUG"));
--
1.7.9.1.232.g1a183


From MAILER-DAEMON Thu Feb 16 06:10:33 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RxzEP-0001C4-Vc
	for mharc-bug-bison@gnu.org; Thu, 16 Feb 2012 06:10:33 -0500
Received: from eggs.gnu.org ([140.186.70.92]:59130)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RxzEI-00013b-IR
	for bug-bison@gnu.org; Thu, 16 Feb 2012 06:10:32 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RxzE6-0004Ya-AF
	for bug-bison@gnu.org; Thu, 16 Feb 2012 06:10:26 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:35773
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RxzE6-0004Y7-5h
	for bug-bison@gnu.org; Thu, 16 Feb 2012 06:10:14 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1RxzE2-0000WB-SC; Thu, 16 Feb 2012 12:10:11 +0100
Subject: Re: [PATCH] tests: avoid c++ failure due to lack of getenv decl
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <87ehtvqe9r.fsf@rho.meyering.net>
Date: Thu, 16 Feb 2012 12:10:10 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <2C8FB758-28A2-448D-BE42-1FFA30D29BEB@lrde.epita.fr>
References: <87ehtvqe9r.fsf@rho.meyering.net>
To: Jim Meyering <jim@meyering.net>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2012 11:10:32 -0000


Le 16 f=E9vr. 2012 =E0 11:11, Jim Meyering a =E9crit :

> I noticed that there was a single test failure when
> running "make check" using the latest gcc/g++ from git (4.7.x).
>=20
> Pushed to master, as obvious:

Thanks!

> %code
> {
> +  #include <stdlib.h>

FWIW, the proper way to include standard C headers
in C++ is without .h, and a prepended "c".  So that would be
#include <cstdlib>.

>   int yylex (yy::parser::semantic_type *);
> }
>=20
> @@ -510,7 +511,7 @@ yy::parser::error (const std::string &m)
> }
>=20
> int
> -main ()
> +main (void)

C++ forbids functions which are not prototyped, so
void is useless here, and () cannot mean "I did not
specify the argument types".  So it's rather more
common not to use void for incoming arguments than
specifying it.




From MAILER-DAEMON Thu Feb 16 06:50:21 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rxzqv-0002yb-Rs
	for mharc-bug-bison@gnu.org; Thu, 16 Feb 2012 06:50:21 -0500
Received: from eggs.gnu.org ([140.186.70.92]:45208)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Rxzqp-0002yS-HQ
	for bug-bison@gnu.org; Thu, 16 Feb 2012 06:50:21 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Rxzqj-0003R4-U9
	for bug-bison@gnu.org; Thu, 16 Feb 2012 06:50:15 -0500
Received: from mx.meyering.net ([88.168.87.75]:34795)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Rxzqj-0003Qy-NN
	for bug-bison@gnu.org; Thu, 16 Feb 2012 06:50:09 -0500
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id C6ABF60062;
	Thu, 16 Feb 2012 12:50:08 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: Akim Demaille <akim@lrde.epita.fr>
Subject: Re: [PATCH] tests: avoid c++ failure due to lack of getenv decl
In-Reply-To: <2C8FB758-28A2-448D-BE42-1FFA30D29BEB@lrde.epita.fr> (Akim
	Demaille's message of "Thu, 16 Feb 2012 12:10:10 +0100")
References: <87ehtvqe9r.fsf@rho.meyering.net>
	<2C8FB758-28A2-448D-BE42-1FFA30D29BEB@lrde.epita.fr>
Date: Thu, 16 Feb 2012 12:50:08 +0100
Message-ID: <8739abq9ov.fsf@rho.meyering.net>
Lines: 40
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2012 11:50:21 -0000

Akim Demaille wrote:

> Le 16 f=E9vr. 2012 =E0 11:11, Jim Meyering a =E9crit :
>
>> I noticed that there was a single test failure when
>> running "make check" using the latest gcc/g++ from git (4.7.x).
>>
>> Pushed to master, as obvious:
>
> Thanks!
>
>> %code
>> {
>> +  #include <stdlib.h>
>
> FWIW, the proper way to include standard C headers
> in C++ is without .h, and a prepended "c".  So that would be
> #include <cstdlib>.

Thanks.  I'll adjust.  (not so obvious after all, eh?)

>>   int yylex (yy::parser::semantic_type *);
>> }
>>
>> @@ -510,7 +511,7 @@ yy::parser::error (const std::string &m)
>> }
>>
>> int
>> -main ()
>> +main (void)
>
> C++ forbids functions which are not prototyped, so
> void is useless here, and () cannot mean "I did not
> specify the argument types".  So it's rather more
> common not to use void for incoming arguments than
> specifying it.

Either way is fine.
I was just making it consistent with the "main (void)"
in the preceding test.  Would you prefer to omit both?


From MAILER-DAEMON Thu Feb 16 09:55:36 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Ry2kC-0004bT-Hw
	for mharc-bug-bison@gnu.org; Thu, 16 Feb 2012 09:55:36 -0500
Received: from eggs.gnu.org ([140.186.70.92]:59183)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Ry2k6-0004bG-NP
	for bug-bison@gnu.org; Thu, 16 Feb 2012 09:55:35 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Ry2k0-0004dy-Lj
	for bug-bison@gnu.org; Thu, 16 Feb 2012 09:55:30 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:41169
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Ry2k0-0004db-Gw
	for bug-bison@gnu.org; Thu, 16 Feb 2012 09:55:24 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1Ry2jy-0001Qk-4n; Thu, 16 Feb 2012 15:55:22 +0100
Subject: Re: [PATCH] tests: avoid c++ failure due to lack of getenv decl
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <8739abq9ov.fsf@rho.meyering.net>
Date: Thu, 16 Feb 2012 15:55:22 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <2144E3FB-73D8-42AB-BF7B-F3565F734A84@lrde.epita.fr>
References: <87ehtvqe9r.fsf@rho.meyering.net>
	<2C8FB758-28A2-448D-BE42-1FFA30D29BEB@lrde.epita.fr>
	<8739abq9ov.fsf@rho.meyering.net>
To: Jim Meyering <jim@meyering.net>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2012 14:55:35 -0000


Le 16 f=E9vr. 2012 =E0 12:50, Jim Meyering a =E9crit :

> Thanks.  I'll adjust.  (not so obvious after all, eh?)

Nope, sure :)

> Either way is fine.
> I was just making it consistent with the "main (void)"
> in the preceding test.  Would you prefer to omit both?

Thanks for pointing this out.  Actually, since I was already
wandering in the area and about to push changes, rather than
separating this commit from stylistic changes, I already pushed
the following.

=46rom 0bb5783b3882aa0244d9c628b1fb9766e7e8a7d5 Mon Sep 17 00:00:00 2001
From: Akim Demaille <demaille@gostai.com>
Date: Thu, 16 Feb 2012 15:51:35 +0100
Subject: [PATCH 1/5] tests: c++: stylistic changes.

	* tests/c++.at: Don't use void for incoming arguments.
	Prefer cstdlib to stdlib.h.
---
 tests/c++.at |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/c++.at b/tests/c++.at
index 3510498..2d5a026 100644
--- a/tests/c++.at
+++ b/tests/c++.at
@@ -179,7 +179,7 @@ yy::parser::error(const yy::parser::location_type&,
 }
=20
 int
-main (void)
+main ()
 {
   yy::parser p;
   p.set_debug_level(!!getenv("YYDEBUG"));
@@ -329,7 +329,7 @@ void
 }
=20
 int
-main (void)
+main ()
 {
   ]$1[::parser p;
   return p.parse ();
@@ -432,7 +432,7 @@ yy::parser::error (const std::string &m)
 }
=20
 int
-main (void)
+main ()
 {
   yy::parser parser;
   return parser.parse ();
@@ -461,7 +461,7 @@ AT_DATA_GRAMMAR([[input.yy]],
=20
 %code
 {
-  #include <stdlib.h>
+  #include <cstdlib>
   int yylex (yy::parser::semantic_type *);
 }
=20
@@ -511,7 +511,7 @@ yy::parser::error (const std::string &m)
 }
=20
 int
-main (void)
+main ()
 {
   yy::parser parser;
   parser.set_debug_level(!!getenv("YYDEBUG"));
--=20
1.7.9




From MAILER-DAEMON Thu Feb 16 09:57:20 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Ry2ls-0004wX-T6
	for mharc-bug-bison@gnu.org; Thu, 16 Feb 2012 09:57:20 -0500
Received: from eggs.gnu.org ([140.186.70.92]:59451)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Ry2lo-0004ud-4I
	for bug-bison@gnu.org; Thu, 16 Feb 2012 09:57:20 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Ry2lh-0004oY-7Q
	for bug-bison@gnu.org; Thu, 16 Feb 2012 09:57:16 -0500
Received: from mx.meyering.net ([88.168.87.75]:35321)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Ry2lg-0004oU-VG
	for bug-bison@gnu.org; Thu, 16 Feb 2012 09:57:09 -0500
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id E724260116;
	Thu, 16 Feb 2012 15:57:07 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: Akim Demaille <akim@lrde.epita.fr>
Subject: Re: [PATCH] tests: avoid c++ failure due to lack of getenv decl
In-Reply-To: <2144E3FB-73D8-42AB-BF7B-F3565F734A84@lrde.epita.fr> (Akim
	Demaille's message of "Thu, 16 Feb 2012 15:55:22 +0100")
References: <87ehtvqe9r.fsf@rho.meyering.net>
	<2C8FB758-28A2-448D-BE42-1FFA30D29BEB@lrde.epita.fr>
	<8739abq9ov.fsf@rho.meyering.net>
	<2144E3FB-73D8-42AB-BF7B-F3565F734A84@lrde.epita.fr>
Date: Thu, 16 Feb 2012 15:57:07 +0100
Message-ID: <877gzmq118.fsf@rho.meyering.net>
Lines: 17
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2012 14:57:20 -0000

Akim Demaille wrote:
> Le 16 f=E9vr. 2012 =E0 12:50, Jim Meyering a =E9crit :
>
>> Thanks.  I'll adjust.  (not so obvious after all, eh?)
>
> Nope, sure :)
>
>> Either way is fine.
>> I was just making it consistent with the "main (void)"
>> in the preceding test.  Would you prefer to omit both?
>
> Thanks for pointing this out.  Actually, since I was already
> wandering in the area and about to push changes, rather than
> separating this commit from stylistic changes, I already pushed
> the following.

Good.  Thanks!


From MAILER-DAEMON Thu Feb 16 10:05:07 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Ry2tP-000120-42
	for mharc-bug-bison@gnu.org; Thu, 16 Feb 2012 10:05:07 -0500
Received: from eggs.gnu.org ([140.186.70.92]:56308)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Ry2tC-0000yZ-Mm
	for bug-bison@gnu.org; Thu, 16 Feb 2012 10:05:04 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Ry2t6-0006Yf-7t
	for bug-bison@gnu.org; Thu, 16 Feb 2012 10:04:54 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:36270
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Ry2t6-0006YJ-01
	for bug-bison@gnu.org; Thu, 16 Feb 2012 10:04:48 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1Ry2t3-0001iE-B4; Thu, 16 Feb 2012 16:04:45 +0100
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <5073C1DD-0EA3-457C-A3D1-C897E512B779@lrde.epita.fr>
Date: Thu, 16 Feb 2012 16:04:45 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <9AF32C15-13DE-4061-8272-67C521695787@lrde.epita.fr>
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<1326882657-20418-11-git-send-email-jim@meyering.net>
	<B3099C04-A210-4220-A589-50F77E007FC3@lrde.epita.fr>
	<87r4yqzdv0.fsf@rho.meyering.net>
	<709EC3D8-A249-4DA2-8C8D-837E48EAFB98@gmail.com>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
	<4F2AB125.8090008@cs.ucla.edu>
	<03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
	<5073C1DD-0EA3-457C-A3D1-C897E512B779@lrde.epita.fr>
To: Paul Eggert <eggert@CS.UCLA.EDU>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2012 15:05:04 -0000

Hi all!

I would really like some return on this regard.
The test suite is still failing in this machine.

I'm ready to drop it all and have the bison test
wrapper save stderr, then sed the localized quotes
away, but still, there is a genuine issue here:
gnulib forces the quote style on the program.
If this is expected, then fine, I can live with it;
I just want to make sure this is on purpose.

Le 8 f=E9vr. 2012 =E0 15:02, Akim Demaille a =E9crit :

>=20
> Le 8 f=E9vr. 2012 =E0 11:54, Akim Demaille a =E9crit :
>=20
>> Le 2 f=E9vr. 2012 =E0 16:52, Paul Eggert a =E9crit :
>>=20
>>> On 02/02/2012 02:49 AM, Akim Demaille wrote:
>>>> - submit changes to gnulib's quote so that the choice of the =
default
>>>> style is left to the actual user of gnulib, and stick to
>>>> gnulib's quote in Bison.
>>>=20
>>> Sounds good to me; how would that work?
>>=20
>> Hi Paul!
>>=20
>> I'm not sure what the best way to do it yet.
>=20
> My problem is that there are several default styles used
> in quote*.  There is DEFAULT_QUOTING_STYLE which does
> not seem to be used (but maybe its purpose is to tell
> the users of quotearg.h that 0 corresponds to
> literal_quoting_style?).  There is locale_quote_style
> which is hard coded in quote, and also there is
> the default_quoting_style that can be modified by the
> user.
>=20
> So I don't know if you want quote to use the default
> style (0), or to have its own style.  And actually, by
> style I mean options.
>=20
> The proposal below exposes a new quote_quoting_options,
> in addition to the default_quoting_options (0), but it
> is equal to it by default.  Because quoting_options are
> very handy, the exposed API seemed to be too weak, as
> there is no nice quotearg_* function that takes a
> quoting_option.  So I exposed quotearg_n_options.
>=20
> I did the patch this way to try to preserve some backward
> compatibility with people who want quote to use
> locale_quoting_style by default, but at the cost of
> changing the default style to using it.  Is this good
> enough?
>=20
> My concern here is that I don't think it is up to
> gnulib to decide what style should be used in the program,
> and since some gnulib modules use quote, in practice it
> means that gnulib does make decisions on behalf of the
> host project.
>=20
> If you have better ideas, I'll take them :)  Otherwise,
> the easiest might be to change the bison wrapper in the
> tests suite to change the quotes in the output messages :(
>=20
> =
<0001-quote-allow-the-user-to-override-the-style.patch><0001-tests-be-robu=
st-to-quote-style.patch>



From MAILER-DAEMON Thu Feb 16 10:56:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Ry3hC-0003Kt-Tm
	for mharc-bug-bison@gnu.org; Thu, 16 Feb 2012 10:56:34 -0500
Received: from eggs.gnu.org ([140.186.70.92]:52501)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1Ry3h2-0003Jo-7Z
	for bug-bison@gnu.org; Thu, 16 Feb 2012 10:56:33 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1Ry3gw-0007UW-Fk
	for bug-bison@gnu.org; Thu, 16 Feb 2012 10:56:24 -0500
Received: from smtp.cs.ucla.edu ([131.179.128.62]:47676)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1Ry3gw-0007UK-BZ
	for bug-bison@gnu.org; Thu, 16 Feb 2012 10:56:18 -0500
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id F1222A60001;
	Thu, 16 Feb 2012 07:56:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id GCsPIG9059wH; Thu, 16 Feb 2012 07:56:12 -0800 (PST)
Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 230E039E8006;
	Thu, 16 Feb 2012 07:56:12 -0800 (PST)
Message-ID: <4F3D2716.9080205@cs.ucla.edu>
Date: Thu, 16 Feb 2012 07:56:06 -0800
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:10.0) Gecko/20120131 Thunderbird/10.0
MIME-Version: 1.0
To: Akim Demaille <akim@lrde.epita.fr>
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<B3099C04-A210-4220-A589-50F77E007FC3@lrde.epita.fr>
	<87r4yqzdv0.fsf@rho.meyering.net>
	<709EC3D8-A249-4DA2-8C8D-837E48EAFB98@gmail.com>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
	<4F2AB125.8090008@cs.ucla.edu>
	<03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
	<5073C1DD-0EA3-457C-A3D1-C897E512B779@lrde.epita.fr>
	<9AF32C15-13DE-4061-8272-67C521695787@lrde.epita.fr>
In-Reply-To: <9AF32C15-13DE-4061-8272-67C521695787@lrde.epita.fr>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.179.128.62
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2012 15:56:33 -0000

On 02/16/2012 07:04 AM, Akim Demaille wrote:
> gnulib forces the quote style on the program.

I briefly looked at the patches you proposed in
<http://lists.gnu.org/archive/html/bug-bison/2012-02/msg00003.html>
and something along those lines sounds reasonable,
though I confess that I still don't fully understand the issue.
First question, though, is why the default quoting object
needs to be malloc'ed -- can't it be in static storage?


From MAILER-DAEMON Thu Feb 16 11:20:48 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Ry44e-0002z4-Gk
	for mharc-bug-bison@gnu.org; Thu, 16 Feb 2012 11:20:48 -0500
Received: from eggs.gnu.org ([140.186.70.92]:53677)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Ry44Y-0002yp-AU
	for bug-bison@gnu.org; Thu, 16 Feb 2012 11:20:47 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Ry44O-00047v-N6
	for bug-bison@gnu.org; Thu, 16 Feb 2012 11:20:42 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:33708
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Ry44O-00047W-D5
	for bug-bison@gnu.org; Thu, 16 Feb 2012 11:20:32 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1Ry44M-0005QP-17; Thu, 16 Feb 2012 17:20:30 +0100
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <4F3D2716.9080205@cs.ucla.edu>
Date: Thu, 16 Feb 2012 17:20:29 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <6E06DBF8-BFF0-4B3B-9124-042D16F129F0@lrde.epita.fr>
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<B3099C04-A210-4220-A589-50F77E007FC3@lrde.epita.fr>
	<87r4yqzdv0.fsf@rho.meyering.net>
	<709EC3D8-A249-4DA2-8C8D-837E48EAFB98@gmail.com>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
	<4F2AB125.8090008@cs.ucla.edu>
	<03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
	<5073C1DD-0EA3-457C-A3D1-C897E512B779@lrde.epita.fr>
	<9AF32C15-13DE-4061-8272-67C521695787@lrde.epita.fr>
	<4F3D2716.9080205@cs.ucla.edu>
To: Paul Eggert <eggert@CS.UCLA.EDU>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2012 16:20:47 -0000


Le 16 f=E9vr. 2012 =E0 16:56, Paul Eggert a =E9crit :

> On 02/16/2012 07:04 AM, Akim Demaille wrote:
>> gnulib forces the quote style on the program.
>=20
> I briefly looked at the patches you proposed in
> <http://lists.gnu.org/archive/html/bug-bison/2012-02/msg00003.html>
> and something along those lines sounds reasonable,
> though I confess that I still don't fully understand the issue.
> First question, though, is why the default quoting object
> needs to be malloc'ed -- can't it be in static storage?

Hi Paul,

The struct quoting_option is not exported, it is
internal to quotearg.c.  I would be happy to have
a static version of it, but that's not possible.
And exposing the struct in the .h might be too big
a change.

Really, I would *much* prefer not to introduce yet
another default quoting style and rely on a single
default quoting style: q =3D 0 in quotearg.  But then,
we have an expectation mismatch: quotearg is designed
with literal_quoting_style as default style, but
quote expects locale_quoting_style as default.  Fusing
both defaults might not be a good idea for most of
their users.



From MAILER-DAEMON Fri Feb 17 02:38:02 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RyIOI-0004I9-Bl
	for mharc-bug-bison@gnu.org; Fri, 17 Feb 2012 02:38:02 -0500
Received: from eggs.gnu.org ([140.186.70.92]:34034)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyIOF-0004Er-C0
	for bug-bison@gnu.org; Fri, 17 Feb 2012 02:38:00 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyIOD-0007xr-OW
	for bug-bison@gnu.org; Fri, 17 Feb 2012 02:37:59 -0500
Received: from mx.meyering.net ([88.168.87.75]:38025)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyIOD-0007xl-Im
	for bug-bison@gnu.org; Fri, 17 Feb 2012 02:37:57 -0500
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id B130F60064
	for <bug-bison@gnu.org>; Fri, 17 Feb 2012 08:37:56 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: Bison Bugs <bug-bison@gnu.org>
Subject: [PATCH] examples: link mfcalc with -lm for uses of pow, cos, atan,
	etc.
Date: Fri, 17 Feb 2012 08:37:56 +0100
Message-ID: <8762f5nc4r.fsf@rho.meyering.net>
Lines: 46
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Feb 2012 07:38:00 -0000

Building from cloned sources, I got this:

...
gcc -std=gnu99 -Wall -Wextra -Wno-sign-compare -Wcast-align -Wcast-qual -Wformat
-Wpointer-arith -Wwrite-strings -Wbad-function-cast -Wmissing-declarations -Wmiss
ing-prototypes -Wshadow -Wstrict-prototypes -g -O2   -o examples/mfcalc/mfcalc ex
amples/mfcalc/examples_mfcalc_mfcalc-mfcalc.o lib/libbison.a
examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.o: In function `yyparse':
/h/j/w/co/bison/../../doc/bison.texinfo:2419: undefined reference to `pow'
examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.o:(.rodata+0x88): undefined reference to `atan'
examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.o:(.rodata+0x98): undefined reference to `cos'
examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.o:(.rodata+0xa8): undefined reference to `exp'
examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.o:(.rodata+0xb8): undefined reference to `log'
examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.o:(.rodata+0xc8): undefined reference to `sin'
examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.o:(.rodata+0xd8): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
make[3]: *** [examples/mfcalc/mfcalc] Error 1
make[3]: *** Waiting for unfinished jobs....

Here's one way to fix it:

>From cbef12deb94918d4f24286d498bcedba4938d6fa Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 17 Feb 2012 08:36:57 +0100
Subject: [PATCH] examples: link mfcalc with -lm for uses of pow, cos, atan,
 etc.

* examples/mfcalc/local.mk (examples_mfcalc_mfcalc_LDADD): Define.
---
 examples/mfcalc/local.mk |    1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/mfcalc/local.mk b/examples/mfcalc/local.mk
index aae9e04..e34d8d7 100644
--- a/examples/mfcalc/local.mk
+++ b/examples/mfcalc/local.mk
@@ -49,6 +49,7 @@ mfcalc_sources =				\
   $(mfcalc_extracted)

 check_PROGRAMS += examples/mfcalc/mfcalc
+examples_mfcalc_mfcalc_LDADD = -lm
 examples_mfcalc_mfcalc_SOURCES =		\
   $(mfcalc_sources)

--
1.7.9.1.232.g1a183


From MAILER-DAEMON Fri Feb 17 02:54:03 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RyIdn-0003ql-14
	for mharc-bug-bison@gnu.org; Fri, 17 Feb 2012 02:54:03 -0500
Received: from eggs.gnu.org ([140.186.70.92]:40210)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyIdg-0003qd-Qv
	for bug-bison@gnu.org; Fri, 17 Feb 2012 02:54:00 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyIdX-0002DE-Sl
	for bug-bison@gnu.org; Fri, 17 Feb 2012 02:53:56 -0500
Received: from mx.meyering.net ([88.168.87.75]:38071)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyIdX-0002Cx-GG
	for bug-bison@gnu.org; Fri, 17 Feb 2012 02:53:47 -0500
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 9DA9660220
	for <bug-bison@gnu.org>; Fri, 17 Feb 2012 08:53:45 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: Bison Bugs <bug-bison@gnu.org>
Subject: new test failures
Date: Fri, 17 Feb 2012 08:53:45 +0100
Message-ID: <87zkchlwty.fsf@rho.meyering.net>
Lines: 132
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Feb 2012 07:54:01 -0000

Hi Akim,

It looks like you're adding tests, and once I got past
the link failure (missing -lm) I see they're failing.
Presuming you're still working there, I'll simply
post the test-suite.log file:

====================================================
   GNU Bison 2.4.669-c119-dirty: ./test-suite.log
====================================================

# TOTAL: 2
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  2
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: examples/calc++/test
==========================

--(end of buffer or a NUL)
--accepting rule at line 46 ("1")
--accepting rule at line 39 ("+")
--accepting rule at line 46 ("2")
--accepting rule at line 40 ("*")
--accepting rule at line 46 ("3")
--accepting rule at line 36 ("
")
--accepting rule at line 54 ("=")
2.1: invalid character
--accepting rule at line 35 (" ")
--accepting rule at line 46 ("1")
2.3: syntax error, unexpected number, expecting end of file
test: FAIL:  1 (expected status: 0, effective: 1
1.1: syntax error, unexpected end of file, expecting ( or identifier or number
test: FAIL:  2 (expected status: 0, effective: 1
Starting parse
Entering state 0
Reducing stack by rule 3 (line 9826):
-> $$ = nterm assignments (-:1.1: )
Stack now 0
Entering state 2
Reading a token: Next token is token "(" (1.1: )
Shifting token "(" (1.1: )
Entering state 4
Reading a token: Next token is token "number" (1.2: 1)
Shifting token "number" (1.2: 1)
Entering state 6
Reducing stack by rule 11 (line 9840):
   $1 = token "number" (1.2: 1)
-> $$ = nterm exp (1.2: 1)
Stack now 0 2 4
Entering state 10
Reading a token: Next token is token "+" (1.3: )
Shifting token "+" (1.3: )
Entering state 13
Reading a token: Next token is token "number" (1.4: 2)
Shifting token "number" (1.4: 2)
Entering state 6
Reducing stack by rule 11 (line 9840):
   $1 = token "number" (1.4: 2)
-> $$ = nterm exp (1.4: 2)
Stack now 0 2 4 10 13
Entering state 19
Reading a token: Next token is token ")" (1.5: )
Reducing stack by rule 5 (line 9834):
   $1 = nterm exp (1.2: 1)
   $2 = token "+" (1.3: )
   $3 = nterm exp (1.4: 2)
-> $$ = nterm exp (1.2-4: 3)
Stack now 0 2 4
Entering state 10
Next token is token ")" (1.5: )
Shifting token ")" (1.5: )
Entering state 16
Reducing stack by rule 9 (line 9838):
   $1 = token "(" (1.1: )
   $2 = nterm exp (1.2-4: 3)
   $3 = token ")" (1.5: )
-> $$ = nterm exp (1.1-5: 3)
Stack now 0 2
Entering state 8
Reading a token: Next token is token "*" (1.7: )
Shifting token "*" (1.7: )
Entering state 14
Reading a token: Next token is token "number" (1.9: 3)
Shifting token "number" (1.9: 3)
Entering state 6
Reducing stack by rule 11 (line 9840):
   $1 = token "number" (1.9: 3)
-> $$ = nterm exp (1.9: 3)
Stack now 0 2 8 14
Entering state 20
Reducing stack by rule 7 (line 9836):
   $1 = nterm exp (1.1-5: 3)
   $2 = token "*" (1.7: )
   $3 = nterm exp (1.9: 3)
-> $$ = nterm exp (1.1-9: 9)
Stack now 0 2
Entering state 8
Reading a token: Next token is token "end of file" (2.1: )
Reducing stack by rule 1 (line 9822):
   $1 = nterm assignments (-:1.1: )
   $2 = nterm exp (1.1-9: 9)
-> $$ = nterm unit (-:1.1-9: )
Stack now 0
Entering state 1
Next token is token "end of file" (2.1: )
Shifting token "end of file" (2.1: )
Entering state 3
Cleanup: popping token "end of file" (2.1: )
Cleanup: popping nterm unit (-:1.1-9: )
cat: out_eff: No such file or directory
test: FAIL:  3 (expected output: 7, effective:
test: PASS:  4
3.1: syntax error, unexpected end of file, expecting ( or identifier or number
test: PASS:  5

FAIL: examples/mfcalc/test
==========================

syntax error
test: FAIL:  1 (expected output: 7, effective: 7
0
syntax error
test: FAIL:  2 (expected output: 7, effective: 7
0
test: FAIL:  3 (expected output: 9, effective:


From MAILER-DAEMON Fri Feb 17 03:29:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RyJCL-00079A-2m
	for mharc-bug-bison@gnu.org; Fri, 17 Feb 2012 03:29:45 -0500
Received: from eggs.gnu.org ([140.186.70.92]:44175)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RyJCH-00077W-Tv
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:29:42 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RyJCE-0008LY-0w
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:29:41 -0500
Received: from smtp.cs.ucla.edu ([131.179.128.62]:46989)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RyJCD-0008LT-Su
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:29:37 -0500
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 7697339E800A;
	Fri, 17 Feb 2012 00:29:37 -0800 (PST)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id vHbx3VAxrDF0; Fri, 17 Feb 2012 00:29:37 -0800 (PST)
Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net
	[71.189.109.235])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 1C41739E8007;
	Fri, 17 Feb 2012 00:29:37 -0800 (PST)
Message-ID: <4F3E0FF1.9080809@cs.ucla.edu>
Date: Fri, 17 Feb 2012 00:29:37 -0800
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:9.0) Gecko/20111229 Thunderbird/9.0
MIME-Version: 1.0
To: Akim Demaille <akim@lrde.epita.fr>
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<87r4yqzdv0.fsf@rho.meyering.net>
	<709EC3D8-A249-4DA2-8C8D-837E48EAFB98@gmail.com>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
	<4F2AB125.8090008@cs.ucla.edu>
	<03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
	<5073C1DD-0EA3-457C-A3D1-C897E512B779@lrde.epita.fr>
	<9AF32C15-13DE-4061-8272-67C521695787@lrde.epita.fr>
	<4F3D2716.9080205@cs.ucla.edu>
	<6E06DBF8-BFF0-4B3B-9124-042D16F129F0@lrde.epita.fr>
In-Reply-To: <6E06DBF8-BFF0-4B3B-9124-042D16F129F0@lrde.epita.fr>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.179.128.62
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Feb 2012 08:29:42 -0000

On 02/16/2012 08:20 AM, Akim Demaille wrote:
> we have an expectation mismatch: quotearg is designed
> with literal_quoting_style as default style, but
> quote expects locale_quoting_style as default.

I wouldn't object to merging the quotearg and quote
modules; the fact that there are two modules is more
of a historical accident than anything else.  And this
might remove the need for the malloc and/or the
expectation mismatch.  (Sorry, I still don't understand
the underlying problem well.)


From MAILER-DAEMON Fri Feb 17 03:30:36 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RyJDA-0007Fm-6e
	for mharc-bug-bison@gnu.org; Fri, 17 Feb 2012 03:30:36 -0500
Received: from eggs.gnu.org ([140.186.70.92]:44228)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyJD2-0007E4-Qu
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:30:34 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyJCx-0008T1-12
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:30:28 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:45935
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyJCw-0008MC-Si
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:30:22 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1RyJCQ-0000u4-Ry; Fri, 17 Feb 2012 09:29:50 +0100
Subject: Re: new test failures
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <87zkchlwty.fsf@rho.meyering.net>
Date: Fri, 17 Feb 2012 09:29:50 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <6496DAEA-961E-4874-BB49-251471069491@lrde.epita.fr>
References: <87zkchlwty.fsf@rho.meyering.net>
To: Jim Meyering <jim@meyering.net>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Feb 2012 08:30:34 -0000


Le 17 f=E9vr. 2012 =E0 08:53, Jim Meyering a =E9crit :

> FAIL: examples/calc++/test
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
>=20
> --(end of buffer or a NUL)
> --accepting rule at line 46 ("1")
> --accepting rule at line 39 ("+")
> --accepting rule at line 46 ("2")
> --accepting rule at line 40 ("*")
> --accepting rule at line 46 ("3")
> --accepting rule at line 36 ("
> ")
> --accepting rule at line 54 ("=3D")

Hi Jim,

Thanks for the report.  I don't understand it
at all: it looks like the test suite are
inverted: this looks like the input of the test
for mfcalc!  Not calc++.

Ah, bummer, both are using "input" as input file
name.  I guess you ran it -j.  Will fix this, thanks
a lot!

Do you have some buildbot or something on Bison somewhere?
I'm sorry to have face all these failures, I'd be happy to
monitor such a tool if there is one somewhere available.



From MAILER-DAEMON Fri Feb 17 03:39:30 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RyJLm-0001yJ-Hf
	for mharc-bug-bison@gnu.org; Fri, 17 Feb 2012 03:39:30 -0500
Received: from eggs.gnu.org ([140.186.70.92]:40357)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyJLf-0001v2-JJ
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:39:29 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyJLb-0001Nw-J8
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:39:23 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:45967
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyJLb-0001Nn-5S
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:39:19 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1RyJLY-0001LK-Da; Fri, 17 Feb 2012 09:39:16 +0100
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <4F3E0FF1.9080809@cs.ucla.edu>
Date: Fri, 17 Feb 2012 09:39:16 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <E51CDA0A-2C75-496D-8121-B21D16A42122@lrde.epita.fr>
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<87r4yqzdv0.fsf@rho.meyering.net>
	<709EC3D8-A249-4DA2-8C8D-837E48EAFB98@gmail.com>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
	<4F2AB125.8090008@cs.ucla.edu>
	<03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
	<5073C1DD-0EA3-457C-A3D1-C897E512B779@lrde.epita.fr>
	<9AF32C15-13DE-4061-8272-67C521695787@lrde.epita.fr>
	<4F3D2716.9080205@cs.ucla.edu>
	<6E06DBF8-BFF0-4B3B-9124-042D16F129F0@lrde.epita.fr>
	<4F3E0FF1.9080809@cs.ucla.edu>
To: Paul Eggert <eggert@cs.ucla.edu>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Feb 2012 08:39:29 -0000


Le 17 f=E9vr. 2012 =E0 09:29, Paul Eggert a =E9crit :

> On 02/16/2012 08:20 AM, Akim Demaille wrote:
>> we have an expectation mismatch: quotearg is designed
>> with literal_quoting_style as default style, but
>> quote expects locale_quoting_style as default.
>=20
> I wouldn't object to merging the quotearg and quote
> modules; the fact that there are two modules is more
> of a historical accident than anything else.  And this
> might remove the need for the malloc and/or the
> expectation mismatch.  (Sorry, I still don't understand
> the underlying problem well.)

by default:
quote:    locale_quoting_style
quotearg: literal_quoting_style

So as of today they are independent, and merging them into
a single thing might surprise users of either module.  So
if we keep two different styles, the difficulty comes from the
fact that quoting_option, which is richer than quoting_style,
is well hidden in quotearg.c and harder to use (the API is
poorer than that of quoting_style).  Indeed, merging quote
into quotearg would solve many problems.  Yet there would
remain the question: should quotearg and quote use the same
default style?



From MAILER-DAEMON Fri Feb 17 03:43:15 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RyJPP-0003JG-Qn
	for mharc-bug-bison@gnu.org; Fri, 17 Feb 2012 03:43:15 -0500
Received: from eggs.gnu.org ([140.186.70.92]:40733)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyJPJ-0003JA-Lh
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:43:15 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyJPE-0001jb-5e
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:43:09 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:51308
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyJPE-0001jX-19
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:43:04 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1RyJPD-0001Ya-3q; Fri, 17 Feb 2012 09:43:03 +0100
From: Akim Demaille <akim@lrde.epita.fr>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: Re: [PATCH] examples: link mfcalc with -lm for uses of pow, cos, atan,
	etc.
Date: Fri, 17 Feb 2012 09:43:03 +0100
Message-Id: <FCD2CE0C-C68C-441B-9956-E260888F12B0@lrde.epita.fr>
To: Jim Meyering <jim@meyering.net>
Mime-Version: 1.0 (Apple Message framework v1084)
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Feb 2012 08:43:15 -0000


> Here's one way to fix it:
> 
> From cbef12deb94918d4f24286d498bcedba4938d6fa Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@redhat.com>
> Date: Fri, 17 Feb 2012 08:36:57 +0100
> Subject: [PATCH] examples: link mfcalc with -lm for uses of pow, cos, atan,
> etc.
> 
> * examples/mfcalc/local.mk (examples_mfcalc_mfcalc_LDADD): Define.

Thanks, I installed it!



From MAILER-DAEMON Fri Feb 17 03:47:58 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RyJTy-0005PJ-U6
	for mharc-bug-bison@gnu.org; Fri, 17 Feb 2012 03:47:58 -0500
Received: from eggs.gnu.org ([140.186.70.92]:35879)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RyJTq-0005P9-La
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:47:57 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RyJTj-0002Y6-Ci
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:47:50 -0500
Received: from smtp.cs.ucla.edu ([131.179.128.62]:40779)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RyJTj-0002Y2-52
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:47:43 -0500
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 5C3B539E800A;
	Fri, 17 Feb 2012 00:47:42 -0800 (PST)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id MTL4M4AMHgsE; Fri, 17 Feb 2012 00:47:42 -0800 (PST)
Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net
	[71.189.109.235])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 0563839E8007;
	Fri, 17 Feb 2012 00:47:42 -0800 (PST)
Message-ID: <4F3E142E.9060206@cs.ucla.edu>
Date: Fri, 17 Feb 2012 00:47:42 -0800
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:9.0) Gecko/20111229 Thunderbird/9.0
MIME-Version: 1.0
To: Akim Demaille <akim@lrde.epita.fr>
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
	<4F2AB125.8090008@cs.ucla.edu>
	<03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
	<5073C1DD-0EA3-457C-A3D1-C897E512B779@lrde.epita.fr>
	<9AF32C15-13DE-4061-8272-67C521695787@lrde.epita.fr>
	<4F3D2716.9080205@cs.ucla.edu>
	<6E06DBF8-BFF0-4B3B-9124-042D16F129F0@lrde.epita.fr>
	<4F3E0FF1.908 0809@cs. ucla.edu>
	<E51CDA0A-2C75-496D-8121-B21D16A42122@lrde.epita.fr>
In-Reply-To: <E51CDA0A-2C75-496D-8121-B21D16A42122@lrde.epita.fr>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.179.128.62
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Feb 2012 08:47:57 -0000

On 02/17/2012 12:39 AM, Akim Demaille wrote:
> there would
> remain the question: should quotearg and quote use the same
> default style?

There's probably enough use of both, and assumption that the
styles differ, that we should probably not try to merge the
styles.


From MAILER-DAEMON Fri Feb 17 03:59:50 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RyJfS-0007pc-Iq
	for mharc-bug-bison@gnu.org; Fri, 17 Feb 2012 03:59:50 -0500
Received: from eggs.gnu.org ([140.186.70.92]:53422)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyJfK-0007pM-UB
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:59:48 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyJf9-0004mL-I1
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:59:42 -0500
Received: from mx.meyering.net ([88.168.87.75]:38234)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyJf9-0004kv-6E
	for bug-bison@gnu.org; Fri, 17 Feb 2012 03:59:31 -0500
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 49AEA60064;
	Fri, 17 Feb 2012 09:59:30 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: Akim Demaille <akim@lrde.epita.fr>
Subject: Re: new test failures
In-Reply-To: <6496DAEA-961E-4874-BB49-251471069491@lrde.epita.fr> (Akim
	Demaille's message of "Fri, 17 Feb 2012 09:29:50 +0100")
References: <87zkchlwty.fsf@rho.meyering.net>
	<6496DAEA-961E-4874-BB49-251471069491@lrde.epita.fr>
Date: Fri, 17 Feb 2012 09:59:30 +0100
Message-ID: <87ty2pltsd.fsf@rho.meyering.net>
Lines: 67
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Feb 2012 08:59:48 -0000

Akim Demaille wrote:
> Le 17 f=E9vr. 2012 =E0 08:53, Jim Meyering a =E9crit :
>
>> FAIL: examples/calc++/test
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
>>
>> --(end of buffer or a NUL)
>> --accepting rule at line 46 ("1")
>> --accepting rule at line 39 ("+")
>> --accepting rule at line 46 ("2")
>> --accepting rule at line 40 ("*")
>> --accepting rule at line 46 ("3")
>> --accepting rule at line 36 ("
>> ")
>> --accepting rule at line 54 ("=3D")
>
> Thanks for the report.  I don't understand it
> at all: it looks like the test suite are
> inverted: this looks like the input of the test
> for mfcalc!  Not calc++.
>
> Ah, bummer, both are using "input" as input file

Hi Akim,

Good catch!
This is a good reason to run each test in its own sandbox.
Have you looked at gnulib's init.sh framework?
It creates (and automatically removes upon termination)
a temporary directory for each test.  To use it, you add
a line like this at the top of your script:

    . "${srcdir=3D.}/init.sh"; path_prepend_ ../src

where in the above example, ../src specifies a directory
to prepend to your shell's search path, so you don't have to
use long absolute (risky, hard to reproduce) or often-unreadable
relative file names for programs you test.

> name.  I guess you ran it -j.  Will fix this, thanks
> a lot!

I always run make with -j$N ;-)  (N > 1)

> Do you have some buildbot or something on Bison somewhere?

No, I just happened to update/build the last couple days.

> I'm sorry to have face all these failures, I'd be happy to
> monitor such a tool if there is one somewhere available.

No, but for bison, I'll bet the nice folks tending the nixos/hydra
buildbot wouldn't mind adding an entry to their DB.
They've been autobuilding coreutils for a long time:

    http://hydra.nixos.org/jobset/gnu/coreutils-master

When I break "./configure && make && make check", it sends me mail.

Oh!  I've just looked and see that bison is already there:

    http://hydra.nixos.org/jobset/gnu/bison-master

Now, all you need to do is request that a few names (or mailing list
address) be added to its config so that you are notified of state
changes.  The hydra-users@gnu.org mailing list is probably a good
place to start.


From MAILER-DAEMON Fri Feb 17 04:21:21 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RyK0H-0004EX-4d
	for mharc-bug-bison@gnu.org; Fri, 17 Feb 2012 04:21:21 -0500
Received: from eggs.gnu.org ([140.186.70.92]:59138)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyK0A-0004EP-5B
	for bug-bison@gnu.org; Fri, 17 Feb 2012 04:21:19 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyK00-0008SR-PD
	for bug-bison@gnu.org; Fri, 17 Feb 2012 04:21:14 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:55999
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyK00-0008S7-GD
	for bug-bison@gnu.org; Fri, 17 Feb 2012 04:21:04 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1RyJzv-00032u-Tb; Fri, 17 Feb 2012 10:20:59 +0100
Subject: Re: new test failures
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <6496DAEA-961E-4874-BB49-251471069491@lrde.epita.fr>
Date: Fri, 17 Feb 2012 10:20:59 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <1710E6AE-DD8E-4382-A822-05506AE10276@lrde.epita.fr>
References: <87zkchlwty.fsf@rho.meyering.net>
	<6496DAEA-961E-4874-BB49-251471069491@lrde.epita.fr>
To: Akim Demaille <akim@lrde.epita.fr>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: Jim Meyering <jim@meyering.net>, Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Feb 2012 09:21:20 -0000


Le 17 f=E9vr. 2012 =E0 09:29, Akim Demaille a =E9crit :

> Ah, bummer, both are using "input" as input file
> name.  I guess you ran it -j.  Will fix this, thanks
> a lot!

Fixed and installed in the following patch.  I'm quite
ambivalent here: I want these directories to be novice
readable, they are really meant to demonstrate grammars.
That's why the "test suites" are so simple minded, and
that is also why I do not want to clutter them with too
much clutter such as portability issues and so forth.

Yet, as a result, I have a large part of code duplication
between both versions of "test" :(

I think I won't be able to resist much longer, and will
fuse them.  I just need to have it really simple and
straightforward to understand.

=46rom c3a2e0e6dd060143cbd2854b61e435552883a6b7 Mon Sep 17 00:00:00 2001
From: Akim Demaille <demaille@gostai.com>
Date: Fri, 17 Feb 2012 10:12:06 +0100
Subject: [PATCH] examples: fix the test suites.

	* examples/calc++/test, examples/mfcalc/test (me): Be more
	meaningfull: include the example name.
	(prog): Factor.
	(run): Avoid printf, use echo.
	Add missing parens.
	(cleanup): New.
	Call it on trap.
	Remove the previous "rm" that did the cleanup.
	Move into a private directory to avoid concurrency issues.
	Reported by Jim Meyering.
---
 examples/calc++/test |   34 +++++++++++++++++++++++++---------
 examples/mfcalc/test |   38 +++++++++++++++++++++++++++-----------
 2 files changed, 52 insertions(+), 20 deletions(-)

diff --git a/examples/calc++/test b/examples/calc++/test
index 0dfe368..7930dc2 100755
--- a/examples/calc++/test
+++ b/examples/calc++/test
@@ -15,7 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
=20
-me=3D`basename $0`
+me=3D`dirname $0`
+me=3D`basename $me`
=20
 # Number of the current test.
 number=3D1
@@ -24,31 +25,47 @@ number=3D1
 exit=3Dtrue
=20
 # The exercised program.
-prog=3D./examples/calc++/calc++
+prog=3D../examples/$me/$me
+
+# cleanup
+# -------
+cleanup ()
+{
+  local status=3D$?
+  if test -z "$DEBUG"; then
+     cd ..
+     rm -rf $$.dir
+  fi
+  exit $status
+}
+trap cleanup 0 1 2 13 15
+mkdir $$.dir
+cd $$.dir
=20
 # run EXPECTED-EXIT-STATUS EXPECTED-OUTPUT [PARSER-OPTIONS]
 # ---------------------------------------------------------
 run ()
 {
-  # Effective and expected exit status.
+  # Expected exit status.
   local sta_exp=3D$1
   shift
+  # Expected output.
   local out_exp=3D$1
   shift
   $prog "$@" - <input >out_eff
+  # Effective exit status.
   local sta_eff=3D$?
+  # Effective output.
   local out_eff=3D`cat out_eff`
   if test $sta_eff -eq $sta_exp; then
     if test "$out_eff" =3D "$out_exp"; then
-      printf "$me: PASS: %2d\n" $number
+      echo "$me: PASS: $number"
     else
-      printf "$me: FAIL: %2d (expected output: %s, effective: %s\n" \
-          $number "$out_exp" "$out_eff"
+      echo "$me: FAIL: $number (expected output: $out_exp, effective: =
$out_eff)"
       exit=3Dfalse
     fi
   else
-    printf "$me: FAIL: %2d (expected status: %d, effective: %d\n" \
-        $number $sta_exp $sta_eff
+    echo "$me: FAIL: $number (expected status: $sta_exp, effective: =
$sta_eff)"
     exit=3Dfalse
   fi
   number=3D`expr $number + 1`
@@ -89,5 +106,4 @@ d :=3D a + b * c
 EOF
 run 1 ''
=20
-rm input out_eff
 $exit
diff --git a/examples/mfcalc/test b/examples/mfcalc/test
index edcbc14..f848bbd 100755
--- a/examples/mfcalc/test
+++ b/examples/mfcalc/test
@@ -15,7 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
=20
-me=3D`basename $0`
+me=3D`dirname $0`
+me=3D`basename $me`
=20
 # Number of the current test.
 number=3D1
@@ -24,36 +25,53 @@ number=3D1
 exit=3Dtrue
=20
 # The exercised program.
-prog=3D./examples/mfcalc/mfcalc
+prog=3D../examples/$me/$me
+
+# cleanup
+# -------
+cleanup ()
+{
+  local status=3D$?
+  if test -z "$DEBUG"; then
+     cd ..
+     rm -rf $$.dir
+  fi
+  exit $status
+}
+trap cleanup 0 1 2 13 15
+mkdir $$.dir
+cd $$.dir
=20
 # run EXPECTED-EXIT-STATUS EXPECTED-OUTPUT [PARSER-OPTIONS]
 # ---------------------------------------------------------
 run ()
 {
-  # Effective and expected exit status.
+  # Expected exit status.
   local sta_exp=3D$1
   shift
+  # Expected output.
   local out_exp=3D$1
   shift
-  $prog "$@" - < input >out_eff
+  $prog "$@" - <input >out_eff
+  # Effective exit status.
   local sta_eff=3D$?
+  # Effective output.
   local out_eff=3D`cat out_eff`
   if test $sta_eff -eq $sta_exp; then
     if test "$out_eff" =3D "$out_exp"; then
-      printf "$me: PASS: %2d\n" $number
+      echo "$me: PASS: $number"
     else
-      printf "$me: FAIL: %2d (expected output: %s, effective: %s\n" \
-          $number "$out_exp" "$out_eff"
+      echo "$me: FAIL: $number (expected output: $out_exp, effective: =
$out_eff)"
       exit=3Dfalse
     fi
   else
-    printf "$me: FAIL: %2d (expected status: %d, effective: %d\n" \
-        $number $sta_exp $sta_eff
+    echo "$me: FAIL: $number (expected status: $sta_exp, effective: =
$sta_eff)"
     exit=3Dfalse
   fi
   number=3D`expr $number + 1`
 }
=20
+
 cat >input <<EOF
 1+2*3
 EOF
@@ -65,6 +83,4 @@ cat >input <<EOF
 EOF
 run 0 9
=20
-
-rm input out_eff
 $exit
--=20
1.7.9




From MAILER-DAEMON Fri Feb 17 04:49:49 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RyKRp-00053V-29
	for mharc-bug-bison@gnu.org; Fri, 17 Feb 2012 04:49:49 -0500
Received: from eggs.gnu.org ([140.186.70.92]:47958)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyKRi-00053J-Ec
	for bug-bison@gnu.org; Fri, 17 Feb 2012 04:49:48 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyKRb-00040C-2C
	for bug-bison@gnu.org; Fri, 17 Feb 2012 04:49:42 -0500
Received: from mx.meyering.net ([88.168.87.75]:38376)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyKRa-0003zz-RU
	for bug-bison@gnu.org; Fri, 17 Feb 2012 04:49:35 -0500
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id A76D060062;
	Fri, 17 Feb 2012 10:49:33 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: Akim Demaille <akim@lrde.epita.fr>
Subject: Re: new test failures
In-Reply-To: <1710E6AE-DD8E-4382-A822-05506AE10276@lrde.epita.fr> (Akim
	Demaille's message of "Fri, 17 Feb 2012 10:20:59 +0100")
References: <87zkchlwty.fsf@rho.meyering.net>
	<6496DAEA-961E-4874-BB49-251471069491@lrde.epita.fr>
	<1710E6AE-DD8E-4382-A822-05506AE10276@lrde.epita.fr>
Date: Fri, 17 Feb 2012 10:49:33 +0100
Message-ID: <87fwe9lrgy.fsf@rho.meyering.net>
Lines: 83
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Feb 2012 09:49:48 -0000

Akim Demaille wrote:
> Le 17 f=E9vr. 2012 =E0 09:29, Akim Demaille a =E9crit :
>
>> Ah, bummer, both are using "input" as input file
>> name.  I guess you ran it -j.  Will fix this, thanks
>> a lot!
>
> Fixed and installed in the following patch.  I'm quite
> ambivalent here: I want these directories to be novice
> readable, they are really meant to demonstrate grammars.
> That's why the "test suites" are so simple minded, and
> that is also why I do not want to clutter them with too
> much clutter such as portability issues and so forth.
>
> Yet, as a result, I have a large part of code duplication
> between both versions of "test" :(
>
> I think I won't be able to resist much longer, and will
> fuse them.  I just need to have it really simple and
> straightforward to understand.
>
> From c3a2e0e6dd060143cbd2854b61e435552883a6b7 Mon Sep 17 00:00:00 2001
> From: Akim Demaille <demaille@gostai.com>
> Date: Fri, 17 Feb 2012 10:12:06 +0100
> Subject: [PATCH] examples: fix the test suites.
>
> 	* examples/calc++/test, examples/mfcalc/test (me): Be more
> 	meaningfull: include the example name.
> 	(prog): Factor.
> 	(run): Avoid printf, use echo.
> 	Add missing parens.
> 	(cleanup): New.
> 	Call it on trap.
> 	Remove the previous "rm" that did the cleanup.
> 	Move into a private directory to avoid concurrency issues.
> 	Reported by Jim Meyering.
> ---
>  examples/calc++/test |   34 +++++++++++++++++++++++++---------
>  examples/mfcalc/test |   38 +++++++++++++++++++++++++++-----------
>  2 files changed, 52 insertions(+), 20 deletions(-)
>
> diff --git a/examples/calc++/test b/examples/calc++/test
> index 0dfe368..7930dc2 100755
> --- a/examples/calc++/test
> +++ b/examples/calc++/test
> @@ -15,7 +15,8 @@
>  # You should have received a copy of the GNU General Public License
>  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
>
> -me=3D`basename $0`
> +me=3D`dirname $0`
> +me=3D`basename $me`
>
>  # Number of the current test.
>  number=3D1
> @@ -24,31 +25,47 @@ number=3D1
>  exit=3Dtrue
>
>  # The exercised program.
> -prog=3D./examples/calc++/calc++
> +prog=3D../examples/$me/$me
> +
> +# cleanup
> +# -------
> +cleanup ()
> +{
> +  local status=3D$?
> +  if test -z "$DEBUG"; then
> +     cd ..
> +     rm -rf $$.dir
> +  fi
> +  exit $status
> +}
> +trap cleanup 0 1 2 13 15
> +mkdir $$.dir
> +cd $$.dir

That's better (I confirmed it fixes the failures), but introduces a race.
If it's interrupted or fails between the trap and a successful "cd",
it will fail to clean up, and might try to remove $$.dir from the parent.

How about recording cwd=3D$(pwd) before cleanup definition,
and then using cd "$cwd" instead of "cd .."?


From MAILER-DAEMON Fri Feb 17 07:19:40 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RyMmq-0000rP-Qx
	for mharc-bug-bison@gnu.org; Fri, 17 Feb 2012 07:19:40 -0500
Received: from eggs.gnu.org ([140.186.70.92]:45060)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyMmo-0000qI-4O
	for bug-bison@gnu.org; Fri, 17 Feb 2012 07:19:39 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyMmm-0008H0-RO
	for bug-bison@gnu.org; Fri, 17 Feb 2012 07:19:38 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:39294
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyMmm-0008GC-Mq
	for bug-bison@gnu.org; Fri, 17 Feb 2012 07:19:36 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1RyMmj-0002Yu-Uv; Fri, 17 Feb 2012 13:19:33 +0100
Subject: Re: new test failures
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <87ty2pltsd.fsf@rho.meyering.net>
Date: Fri, 17 Feb 2012 13:19:33 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <C9968146-6959-4B52-BAE7-2AEE2A729CFB@lrde.epita.fr>
References: <87zkchlwty.fsf@rho.meyering.net>
	<6496DAEA-961E-4874-BB49-251471069491@lrde.epita.fr>
	<87ty2pltsd.fsf@rho.meyering.net>
To: Jim Meyering <jim@meyering.net>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Feb 2012 12:19:39 -0000

Hi Jim!

Le 17 f=E9vr. 2012 =E0 09:59, Jim Meyering a =E9crit :

> This is a good reason to run each test in its own sandbox.

Yes, definitely.

> Have you looked at gnulib's init.sh framework?
> It creates (and automatically removes upon termination)
> a temporary directory for each test.  To use it, you add
> a line like this at the top of your script:
>=20
>    . "${srcdir=3D.}/init.sh"; path_prepend_ ../src
>=20
> where in the above example, ../src specifies a directory
> to prepend to your shell's search path, so you don't have to
> use long absolute (risky, hard to reproduce) or often-unreadable
> relative file names for programs you test.

That might be an option, thanks for the pointer!


> Oh!  I've just looked and see that bison is already there:
>=20
>    http://hydra.nixos.org/jobset/gnu/bison-master

Great!!!  Thanks a lot for the pointer.

> Now, all you need to do is request that a few names (or mailing list
> address) be added to its config so that you are notified of state
> changes.  The hydra-users@gnu.org mailing list is probably a good
> place to start.

I'll drop them a note, thanks!  Would bug-bison be appropriate
in your opinion, or that would overflow subscribers?



From MAILER-DAEMON Fri Feb 17 08:17:59 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RyNhG-00007j-WE
	for mharc-bug-bison@gnu.org; Fri, 17 Feb 2012 08:17:58 -0500
Received: from eggs.gnu.org ([140.186.70.92]:56719)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyNh9-00006x-Fv
	for bug-bison@gnu.org; Fri, 17 Feb 2012 08:17:57 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyNh3-00032F-PA
	for bug-bison@gnu.org; Fri, 17 Feb 2012 08:17:51 -0500
Received: from mx.meyering.net ([88.168.87.75]:38907)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1RyNh3-00031s-Cr
	for bug-bison@gnu.org; Fri, 17 Feb 2012 08:17:45 -0500
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 6DCFD6008E;
	Fri, 17 Feb 2012 14:17:44 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: Akim Demaille <akim@lrde.epita.fr>
Subject: Re: new test failures
In-Reply-To: <C9968146-6959-4B52-BAE7-2AEE2A729CFB@lrde.epita.fr> (Akim
	Demaille's message of "Fri, 17 Feb 2012 13:19:33 +0100")
References: <87zkchlwty.fsf@rho.meyering.net>
	<6496DAEA-961E-4874-BB49-251471069491@lrde.epita.fr>
	<87ty2pltsd.fsf@rho.meyering.net>
	<C9968146-6959-4B52-BAE7-2AEE2A729CFB@lrde.epita.fr>
Date: Fri, 17 Feb 2012 14:17:44 +0100
Message-ID: <87haypk39j.fsf@rho.meyering.net>
Lines: 41
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Feb 2012 13:17:57 -0000

Akim Demaille wrote:
> Hi Jim!
>
> Le 17 f=E9vr. 2012 =E0 09:59, Jim Meyering a =E9crit :
>
>> This is a good reason to run each test in its own sandbox.
>
> Yes, definitely.
>
>> Have you looked at gnulib's init.sh framework?
>> It creates (and automatically removes upon termination)
>> a temporary directory for each test.  To use it, you add
>> a line like this at the top of your script:
>>
>>    . "${srcdir=3D.}/init.sh"; path_prepend_ ../src
>>
>> where in the above example, ../src specifies a directory
>> to prepend to your shell's search path, so you don't have to
>> use long absolute (risky, hard to reproduce) or often-unreadable
>> relative file names for programs you test.
>
> That might be an option, thanks for the pointer!
>
>
>> Oh!  I've just looked and see that bison is already there:
>>
>>    http://hydra.nixos.org/jobset/gnu/bison-master
>
> Great!!!  Thanks a lot for the pointer.
>
>> Now, all you need to do is request that a few names (or mailing list
>> address) be added to its config so that you are notified of state
>> changes.  The hydra-users@gnu.org mailing list is probably a good
>> place to start.
>
> I'll drop them a note, thanks!  Would bug-bison be appropriate
> in your opinion, or that would overflow subscribers?

You might want to try it personally for a month or so,
to see how much traffic it generates.  There are occasional
false-positives, e.g., when the builder runs out of resources.


From MAILER-DAEMON Fri Feb 17 09:54:41 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RyPCq-0005tJ-Ve
	for mharc-bug-bison@gnu.org; Fri, 17 Feb 2012 09:54:40 -0500
Received: from eggs.gnu.org ([140.186.70.92]:58904)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyPCm-0005rC-AZ
	for bug-bison@gnu.org; Fri, 17 Feb 2012 09:54:38 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyPCf-0005ft-Qq
	for bug-bison@gnu.org; Fri, 17 Feb 2012 09:54:36 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:46723
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RyPCf-0005d5-D9
	for bug-bison@gnu.org; Fri, 17 Feb 2012 09:54:29 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1RyPCd-0000FF-05; Fri, 17 Feb 2012 15:54:27 +0100
Subject: Re: new test failures
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <87fwe9lrgy.fsf@rho.meyering.net>
Date: Fri, 17 Feb 2012 15:54:26 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <B9ACE9CF-1DB3-4112-B8F2-03FC94342011@lrde.epita.fr>
References: <87zkchlwty.fsf@rho.meyering.net>
	<6496DAEA-961E-4874-BB49-251471069491@lrde.epita.fr>
	<1710E6AE-DD8E-4382-A822-05506AE10276@lrde.epita.fr>
	<87fwe9lrgy.fsf@rho.meyering.net>
To: Jim Meyering <jim@meyering.net>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Feb 2012 14:54:38 -0000


Le 17 f=E9vr. 2012 =E0 10:49, Jim Meyering a =E9crit :

> That's better (I confirmed it fixes the failures), but introduces a =
race.

Well caught, thanks!

> If it's interrupted or fails between the trap and a successful "cd",
> it will fail to clean up, and might try to remove $$.dir from the =
parent.
>=20
> How about recording cwd=3D$(pwd) before cleanup definition,
> and then using cd "$cwd" instead of "cd .."?

I did that.  I also decided to factor the "test suites".

=46rom 5a9c6b89d0cd97f514383bc555a2c14f59bd9c3b Mon Sep 17 00:00:00 2001
From: Akim Demaille <demaille@gostai.com>
Date: Fri, 17 Feb 2012 14:59:23 +0100
Subject: [PATCH] examples: factor the test suite.

	* examples/mfcalc/test, examples/calc++/test: Extract the
	common bits into...
	* examples/test: here.
	(cwd): New.
	Use it to avoid a race on the temporary directory.
	Reported by Jim Meyering.
	* examples/mfcalc/test, examples/calc++/test: Rename into...
	* examples/mfcalc/mfcalc.test, examples/calc++/calc++.test: =
these.
	* examples/calc++/local.mk, examples/mfcalc/local.mk,
	* examples/local.mk: Adjust.
---
 examples/calc++/calc++.test |   50 ++++++++++++++++++++
 examples/calc++/local.mk    |    4 +-
 examples/calc++/test        |  109 =
-------------------------------------------
 examples/local.mk           |    3 +-
 examples/mfcalc/local.mk    |    4 +-
 examples/mfcalc/mfcalc.test |   27 +++++++++++
 examples/mfcalc/test        |   86 ----------------------------------
 examples/test               |   79 +++++++++++++++++++++++++++++++
 8 files changed, 162 insertions(+), 200 deletions(-)
 create mode 100755 examples/calc++/calc++.test
 delete mode 100755 examples/calc++/test
 create mode 100755 examples/mfcalc/mfcalc.test
 delete mode 100755 examples/mfcalc/test
 create mode 100755 examples/test

diff --git a/examples/calc++/calc++.test b/examples/calc++/calc++.test
new file mode 100755
index 0000000..904d05f
--- /dev/null
+++ b/examples/calc++/calc++.test
@@ -0,0 +1,50 @@
+#! /bin/sh
+
+# Copyright (C) 2005-2012 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+cat >input <<EOF
+toto :=3D 1
+toto
+EOF
+run 0 1 -s
+
+
+cat >input <<EOF
+a :=3D 1
+b :=3D 2
+c :=3D 3
+d :=3D a + b * c
+d
+EOF
+run 0 7
+run 0 7 -p
+
+
+cat >input <<EOF
+a :=3D 1
+b :=3D 2
+c :=3D 3
+d :=3D (a + b) * c
+d
+EOF
+run 0 9
+
+
+cat >input <<EOF
+a :=3D 1
+d :=3D a + b * c
+EOF
+run 1 ''
diff --git a/examples/calc++/local.mk b/examples/calc++/local.mk
index 839ef86..5d9dce0 100644
--- a/examples/calc++/local.mk
+++ b/examples/calc++/local.mk
@@ -64,6 +64,6 @@ examples_calc___calc___SOURCES =3D		\
   examples/calc++/calc++-parser.hh
=20
 examples_calc___calc___CPPFLAGS =3D -I$(top_srcdir)/examples/calc++
-TESTS +=3D examples/calc++/test
+TESTS +=3D examples/calc++/calc++.test
 endif
-EXTRA_DIST +=3D examples/calc++/test
+EXTRA_DIST +=3D examples/calc++/calc++.test
diff --git a/examples/calc++/test b/examples/calc++/test
deleted file mode 100755
index 7930dc2..0000000
--- a/examples/calc++/test
+++ /dev/null
@@ -1,109 +0,0 @@
-#! /bin/sh
-
-# Copyright (C) 2005-2012 Free Software Foundation, Inc.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-me=3D`dirname $0`
-me=3D`basename $me`
-
-# Number of the current test.
-number=3D1
-
-# Exit status of this script.
-exit=3Dtrue
-
-# The exercised program.
-prog=3D../examples/$me/$me
-
-# cleanup
-# -------
-cleanup ()
-{
-  local status=3D$?
-  if test -z "$DEBUG"; then
-     cd ..
-     rm -rf $$.dir
-  fi
-  exit $status
-}
-trap cleanup 0 1 2 13 15
-mkdir $$.dir
-cd $$.dir
-
-# run EXPECTED-EXIT-STATUS EXPECTED-OUTPUT [PARSER-OPTIONS]
-# ---------------------------------------------------------
-run ()
-{
-  # Expected exit status.
-  local sta_exp=3D$1
-  shift
-  # Expected output.
-  local out_exp=3D$1
-  shift
-  $prog "$@" - <input >out_eff
-  # Effective exit status.
-  local sta_eff=3D$?
-  # Effective output.
-  local out_eff=3D`cat out_eff`
-  if test $sta_eff -eq $sta_exp; then
-    if test "$out_eff" =3D "$out_exp"; then
-      echo "$me: PASS: $number"
-    else
-      echo "$me: FAIL: $number (expected output: $out_exp, effective: =
$out_eff)"
-      exit=3Dfalse
-    fi
-  else
-    echo "$me: FAIL: $number (expected status: $sta_exp, effective: =
$sta_eff)"
-    exit=3Dfalse
-  fi
-  number=3D`expr $number + 1`
-}
-
-
-cat >input <<EOF
-toto :=3D 1
-toto
-EOF
-run 0 1 -s
-
-
-cat >input <<EOF
-a :=3D 1
-b :=3D 2
-c :=3D 3
-d :=3D a + b * c
-d
-EOF
-run 0 7
-run 0 7 -p
-
-
-cat >input <<EOF
-a :=3D 1
-b :=3D 2
-c :=3D 3
-d :=3D (a + b) * c
-d
-EOF
-run 0 9
-
-
-cat >input <<EOF
-a :=3D 1
-d :=3D a + b * c
-EOF
-run 1 ''
-
-$exit
diff --git a/examples/local.mk b/examples/local.mk
index 02e82bb..de4d38f 100644
--- a/examples/local.mk
+++ b/examples/local.mk
@@ -15,7 +15,8 @@
=20
 doc =3D $(top_srcdir)/doc/bison.texinfo
 extexi =3D $(top_srcdir)/examples/extexi
-dist_noinst_SCRIPTS =3D examples/extexi
+dist_noinst_SCRIPTS =3D examples/extexi examples/test
+TEST_LOG_COMPILER =3D $(top_srcdir)/examples/test
=20
 include examples/calc++/local.mk
 include examples/mfcalc/local.mk
diff --git a/examples/mfcalc/local.mk b/examples/mfcalc/local.mk
index e34d8d7..c6d9470 100644
--- a/examples/mfcalc/local.mk
+++ b/examples/mfcalc/local.mk
@@ -54,5 +54,5 @@ examples_mfcalc_mfcalc_SOURCES =3D		\
   $(mfcalc_sources)
=20
 examples_mfcalc_mfcalc_CPPFLAGS =3D -I$(top_srcdir)/examples/mfcalc
-TESTS +=3D examples/mfcalc/test
-EXTRA_DIST +=3D examples/mfcalc/test
+TESTS +=3D examples/mfcalc/mfcalc.test
+EXTRA_DIST +=3D examples/mfcalc/mfcalc.test
diff --git a/examples/mfcalc/mfcalc.test b/examples/mfcalc/mfcalc.test
new file mode 100755
index 0000000..6f794aa
--- /dev/null
+++ b/examples/mfcalc/mfcalc.test
@@ -0,0 +1,27 @@
+#! /bin/sh
+
+# Copyright (C) 2005-2012 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+cat >input <<EOF
+1+2*3
+EOF
+run 0 7
+run 0 7
+
+cat >input <<EOF
+(1+2) * 3
+EOF
+run 0 9
diff --git a/examples/mfcalc/test b/examples/mfcalc/test
deleted file mode 100755
index f848bbd..0000000
--- a/examples/mfcalc/test
+++ /dev/null
@@ -1,86 +0,0 @@
-#! /bin/sh
-
-# Copyright (C) 2005-2012 Free Software Foundation, Inc.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-me=3D`dirname $0`
-me=3D`basename $me`
-
-# Number of the current test.
-number=3D1
-
-# Exit status of this script.
-exit=3Dtrue
-
-# The exercised program.
-prog=3D../examples/$me/$me
-
-# cleanup
-# -------
-cleanup ()
-{
-  local status=3D$?
-  if test -z "$DEBUG"; then
-     cd ..
-     rm -rf $$.dir
-  fi
-  exit $status
-}
-trap cleanup 0 1 2 13 15
-mkdir $$.dir
-cd $$.dir
-
-# run EXPECTED-EXIT-STATUS EXPECTED-OUTPUT [PARSER-OPTIONS]
-# ---------------------------------------------------------
-run ()
-{
-  # Expected exit status.
-  local sta_exp=3D$1
-  shift
-  # Expected output.
-  local out_exp=3D$1
-  shift
-  $prog "$@" - <input >out_eff
-  # Effective exit status.
-  local sta_eff=3D$?
-  # Effective output.
-  local out_eff=3D`cat out_eff`
-  if test $sta_eff -eq $sta_exp; then
-    if test "$out_eff" =3D "$out_exp"; then
-      echo "$me: PASS: $number"
-    else
-      echo "$me: FAIL: $number (expected output: $out_exp, effective: =
$out_eff)"
-      exit=3Dfalse
-    fi
-  else
-    echo "$me: FAIL: $number (expected status: $sta_exp, effective: =
$sta_eff)"
-    exit=3Dfalse
-  fi
-  number=3D`expr $number + 1`
-}
-
-
-cat >input <<EOF
-1+2*3
-EOF
-run 0 7
-run 0 7
-
-cat >input <<EOF
-(1+2) * 3
-EOF
-run 0 9
-
-$exit
diff --git a/examples/test b/examples/test
new file mode 100755
index 0000000..6da1667
--- /dev/null
+++ b/examples/test
@@ -0,0 +1,79 @@
+#! /bin/sh
+set -x
+# Copyright (C) 2005-2012 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+me=3D`basename $1 .test`
+
+# Number of the current test.
+number=3D1
+
+# Exit status of this script.
+exit=3Dtrue
+
+# top_buiddir.
+cwd=3D`pwd`
+
+# The exercised program.
+prog=3D$cwd/examples/$me/$me
+
+# cleanup
+# -------
+cleanup ()
+{
+  local status=3D$?
+  if test -z "$DEBUG"; then
+     cd $cwd
+     rm -rf $$.dir
+  fi
+  exit $status
+}
+trap cleanup 0 1 2 13 15
+mkdir $$.dir
+cd $$.dir
+
+# run EXPECTED-EXIT-STATUS EXPECTED-OUTPUT [PARSER-OPTIONS]
+# ---------------------------------------------------------
+run ()
+{
+  # Expected exit status.
+  local sta_exp=3D$1
+  shift
+  # Expected output.
+  local out_exp=3D$1
+  shift
+  $prog "$@" - <input >out_eff
+  # Effective exit status.
+  local sta_eff=3D$?
+  # Effective output.
+  local out_eff=3D`cat out_eff`
+  if test $sta_eff -eq $sta_exp; then
+    if test "$out_eff" =3D "$out_exp"; then
+      echo "$me: PASS: $number"
+    else
+      echo "$me: FAIL: $number (expected output: $out_exp, effective: =
$out_eff)"
+      exit=3Dfalse
+    fi
+  else
+    echo "$me: FAIL: $number (expected status: $sta_exp, effective: =
$sta_eff)"
+    exit=3Dfalse
+  fi
+  number=3D`expr $number + 1`
+}
+
+# We have cd'd one level deeper.
+. "../$1"
+
+$exit
--=20
1.7.9




From MAILER-DAEMON Tue Feb 21 06:21:01 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RznmH-0002Gr-0W
	for mharc-bug-bison@gnu.org; Tue, 21 Feb 2012 06:21:01 -0500
Received: from eggs.gnu.org ([140.186.70.92]:40240)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Rznm9-0002Ec-63
	for bug-bison@gnu.org; Tue, 21 Feb 2012 06:20:58 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Rznm4-0004Oc-RS
	for bug-bison@gnu.org; Tue, 21 Feb 2012 06:20:53 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:55137
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Rznm4-0004OT-Hg
	for bug-bison@gnu.org; Tue, 21 Feb 2012 06:20:48 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>) id 1Rznm2-0003xi-5q
	for bug-bison@gnu.org; Tue, 21 Feb 2012 12:20:46 +0100
From: Akim Demaille <akim@lrde.epita.fr>
Content-Type: multipart/mixed; boundary=Apple-Mail-16--671271756
Subject: GLR: ambiguity reports are wrong
Date: Tue, 21 Feb 2012 12:20:46 +0100
Message-Id: <E293CA6E-111B-433B-B240-6EAAD0C66654@lrde.epita.fr>
To: Bison Bugs <bug-bison@gnu.org>
Mime-Version: 1.0 (Apple Message framework v1084)
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 21 Feb 2012 11:20:59 -0000


--Apple-Mail-16--671271756
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii

On this grammar:

> %%
> start:
>   'a' b 'c' d
> | 'a' b 'c' d
> ;
> b: 'b';
> d: /* nada.  */;
> %%

with input a b c d, the current code reports:

> Option 1,
>   start -> <Rule 1, tokens 1 .. 3>
>     $end <tokens 1 .. 1>
>     'a' <tokens 2 .. 2>
>     b <tokens 3 .. 3>
>     'c' <empty>
> 
> Option 2,
>   start -> <Rule 2, tokens 1 .. 3>
>     $end <tokens 1 .. 1>
>     'a' <tokens 2 .. 2>
>     b <tokens 3 .. 3>
>     'c' <empty>

instead of:

> Option 1,
>   start -> <Rule 1, tokens 1 .. 3>
>     'a' <tokens 1 .. 1>
>     b <tokens 2 .. 2>
>     'c' <tokens 3 .. 3>
>     d <empty>
> 
> Option 2,
>   start -> <Rule 2, tokens 1 .. 3>
>     'a' <tokens 1 .. 1>
>     b <tokens 2 .. 2>
>     'c' <tokens 3 .. 3>
>     d <empty>

This is a regression I introduced in master only with
commit 783aa653f4ca70a75919c8516b950494c612cbfe.
http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00291.html


--Apple-Mail-16--671271756
Content-Disposition: attachment;
	filename=0001-glr-fix-ambiguity-reports.patch
Content-Type: application/octet-stream;
	name="0001-glr-fix-ambiguity-reports.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=20b140400f75dfbe6b564c1f70cc30f02d3387ed26=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Akim=20Demaille=20<demaille@gostai.com>=0A=
Date:=20Tue,=2021=20Feb=202012=2011:51:37=20+0100=0ASubject:=20[PATCH]=20=
glr:=20fix=20ambiguity=20reports.=0A=0AFix=20a=20regression=20introduced=20=
in=20commit=0A783aa653f4ca70a75919c8516b950494c612cbfe.=0A=0A=09*=20=
tests/glr-regression.at=20(Ambiguity=20reports):=20New.=0A=09*=20=
data/glr.c=20(yyreportTree):=20Fix=20an=20offset=20error.=0A---=0A=20=
data/glr.c=20=20=20=20=20=20=20=20=20=20=20=20=20=20|=20=20=20=204=20+-=0A=
=20tests/glr-regression.at=20|=20=20117=20=
+++++++++++++++++++++++++++++++++++++++++++++++=0A=202=20files=20=
changed,=20119=20insertions(+),=202=20deletions(-)=0A=0Adiff=20--git=20=
a/data/glr.c=20b/data/glr.c=0Aindex=209b525f4..148af2b=20100644=0A---=20=
a/data/glr.c=0A+++=20b/data/glr.c=0A@@=20-1727,10=20+1727,10=20@@=20=
yyreportTree=20(yySemanticOption*=20yyx,=20int=20yyindent)=0A=20=20=20=20=
=20=20=20=20=20{=0A=20=20=20=20=20=20=20=20=20=20=20if=20=
(yystates[yyi-1]->yyposn+1=20>=20yystates[yyi]->yyposn)=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20YYFPRINTF=20(stderr,=20"%*s%s=20<empty>\n",=20=
yyindent+2,=20"",=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20yytokenName=20(yystos[yystates[yyi-1]->yylrState]));=0A+=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
yytokenName=20(yystos[yystates[yyi]->yylrState]));=0A=20=20=20=20=20=20=20=
=20=20=20=20else=0A=20=20=20=20=20=20=20=20=20=20=20=20=20YYFPRINTF=20=
(stderr,=20"%*s%s=20<tokens=20%lu=20..=20%lu>\n",=20yyindent+2,=20"",=0A=
-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
yytokenName=20(yystos[yystates[yyi-1]->yylrState]),=0A+=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20yytokenName=20=
(yystos[yystates[yyi]->yylrState]),=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20(unsigned=20long=20int)=20=
(yystates[yyi-1]->yyposn=20+=201),=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20(unsigned=20long=20int)=20=
yystates[yyi]->yyposn);=0A=20=20=20=20=20=20=20=20=20}=0Adiff=20--git=20=
a/tests/glr-regression.at=20b/tests/glr-regression.at=0Aindex=20=
a9bff58..bc32c90=20100644=0A---=20a/tests/glr-regression.at=0A+++=20=
b/tests/glr-regression.at=0A@@=20-1788,3=20+1788,120=20@@=20=
glr-regr18.y:26.18-24:=20previous=20declaration=0A=20])=0A=20=0A=20=
AT_CLEANUP=0A+=0A+=0A+##=20-------------------=20##=0A+##=20Ambiguity=20=
reports.=20=20##=0A+##=20-------------------=20##=0A+=0A=
+AT_SETUP([Ambiguity=20reports])=0A+=0A+AT_DATA_GRAMMAR([input.y],=0A+[[=0A=
+%{=0A+=20=20#include=20<stdio.h>=0A+=20=20#include=20<stdlib.h>=0A+=20=20=
static=20void=20yyerror=20(char=20const=20*);=0A+=20=20static=20int=20=
yylex=20(void);=0A+%}=0A+=0A+%debug=0A+%glr-parser=0A+=0A+%%=0A+start:=0A=
+=20=20'a'=20b=20'c'=20d=0A+|=20'a'=20b=20'c'=20d=0A+;=0A+b:=20'b';=0A=
+d:=20/*=20nada.=20=20*/;=0A+%%=0A+=0A+static=20int=0A+yylex=20(void)=0A=
+{=0A+=20=20static=20char=20const=20input[]=20=3D=20"abc";=0A+=20=20=
static=20size_t=20toknum;=0A+=20=20if=20(!=20(toknum=20<=20sizeof=20=
input))=0A+=20=20=20=20abort=20();=0A+=20=20return=20input[toknum++];=0A=
+}=0A+=0A+static=20void=0A+yyerror=20(char=20const=20*msg)=0A+{=0A+=20=20=
fprintf=20(stderr,=20"%s\n",=20msg);=0A+}=0A+=0A+int=0A+main=20(void)=0A=
+{=0A+=20=20yydebug=20=3D=201;=0A+=20=20return=20!!yyparse=20();=0A+}=0A=
+]])=0A+=0A+AT_BISON_CHECK([[-o=20input.c=20input.y]],=200,=20[],=0A=
+[input.y:=20conflicts:=201=20reduce/reduce=0A+])=0A+AT_COMPILE([input])=0A=
+=0A+AT_PARSER_CHECK([[./input]],=201,=20[],=0A+[Starting=20parse=0A=
+Entering=20state=200=0A+Reading=20a=20token:=20Next=20token=20is=20=
token=20'a'=20()=0A+Shifting=20token=20'a'=20()=0A+Entering=20state=201=0A=
+Reading=20a=20token:=20Next=20token=20is=20token=20'b'=20()=0A+Shifting=20=
token=20'b'=20()=0A+Entering=20state=203=0A+Reducing=20stack=200=20by=20=
rule=203=20(line=2025):=0A+=20=20=20$1=20=3D=20token=20'b'=20()=0A+->=20=
$$=20=3D=20nterm=20b=20()=0A+Entering=20state=204=0A+Reading=20a=20=
token:=20Next=20token=20is=20token=20'c'=20()=0A+Shifting=20token=20'c'=20=
()=0A+Entering=20state=206=0A+Reducing=20stack=200=20by=20rule=204=20=
(line=2026):=0A+->=20$$=20=3D=20nterm=20d=20()=0A+Entering=20state=207=0A=
+Reading=20a=20token:=20Now=20at=20end=20of=20input.=0A+Stack=200=20=
Entering=20state=207=0A+Now=20at=20end=20of=20input.=0A+Splitting=20off=20=
stack=201=20from=200.=0A+Reduced=20stack=201=20by=20rule=20#2;=20action=20=
deferred.=20=20Now=20in=20state=202.=0A+Stack=201=20Entering=20state=202=0A=
+Now=20at=20end=20of=20input.=0A+Reduced=20stack=200=20by=20rule=20#1;=20=
action=20deferred.=20=20Now=20in=20state=202.=0A+Merging=20stack=200=20=
into=20stack=201.=0A+Stack=201=20Entering=20state=202=0A+Now=20at=20end=20=
of=20input.=0A+Removing=20dead=20stacks.=0A+Rename=20stack=201=20->=200.=0A=
+On=20stack=200,=20shifting=20token=20$end=20()=0A+Stack=200=20now=20in=20=
state=20#5=0A+Ambiguity=20detected.=0A+Option=201,=0A+=20=20start=20->=20=
<Rule=201,=20tokens=201=20..=203>=0A+=20=20=20=20'a'=20<tokens=201=20..=20=
1>=0A+=20=20=20=20b=20<tokens=202=20..=202>=0A+=20=20=20=20'c'=20<tokens=20=
3=20..=203>=0A+=20=20=20=20d=20<empty>=0A+=0A+Option=202,=0A+=20=20start=20=
->=20<Rule=202,=20tokens=201=20..=203>=0A+=20=20=20=20'a'=20<tokens=201=20=
..=201>=0A+=20=20=20=20b=20<tokens=202=20..=202>=0A+=20=20=20=20'c'=20=
<tokens=203=20..=203>=0A+=20=20=20=20d=20<empty>=0A+=0A+syntax=20is=20=
ambiguous=0A+Cleanup:=20popping=20token=20$end=20()=0A+Cleanup:=20=
popping=20unresolved=20nterm=20start=20()=0A+Cleanup:=20popping=20nterm=20=
d=20()=0A+Cleanup:=20popping=20token=20'c'=20()=0A+Cleanup:=20popping=20=
nterm=20b=20()=0A+Cleanup:=20popping=20token=20'a'=20()=0A+])=0A+=0A=
+AT_CLEANUP=0A--=20=0A1.7.9=0A=0A=

--Apple-Mail-16--671271756
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii




--Apple-Mail-16--671271756--


From MAILER-DAEMON Tue Feb 21 09:35:47 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rzqol-0005UG-P9
	for mharc-bug-bison@gnu.org; Tue, 21 Feb 2012 09:35:47 -0500
Received: from eggs.gnu.org ([140.186.70.92]:49485)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1Rzqof-0005Se-05
	for bug-bison@gnu.org; Tue, 21 Feb 2012 09:35:45 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RzqoY-0003e4-NR
	for bug-bison@gnu.org; Tue, 21 Feb 2012 09:35:40 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:46369
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1RzqoY-0003dv-Cg
	for bug-bison@gnu.org; Tue, 21 Feb 2012 09:35:34 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1RzqoV-0006G5-B7; Tue, 21 Feb 2012 15:35:31 +0100
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <4F3E142E.9060206@cs.ucla.edu>
Date: Tue, 21 Feb 2012 15:35:31 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <7C8150FA-F7D2-4051-B79E-E19771C0BA1C@lrde.epita.fr>
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
	<4F2AB125.8090008@cs.ucla.edu>
	<03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
	<5073C1DD-0EA3-457C-A3D1-C897E512B779@lrde.epita.fr>
	<9AF32C15-13DE-4061-8272-67C521695787@lrde.epita.fr>
	<4F3D2716.9080205@cs.ucla.edu>
	<6E06DBF8-BFF0-4B3B-9124-042D16F129F0@lrde.epita.fr>
	<4F3E0FF1.908 0809@cs. ucla.edu>
	<E51CDA0A-2C75-496D-8121-B21D16A42122@lrde.epita.fr>
	<4F3E142E.9060206@cs.ucla.edu>
To: Paul Eggert <eggert@CS.UCLA.EDU>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 21 Feb 2012 14:35:45 -0000


Le 17 f=E9vr. 2012 =E0 09:47, Paul Eggert a =E9crit :

> On 02/17/2012 12:39 AM, Akim Demaille wrote:
>> there would
>> remain the question: should quotearg and quote use the same
>> default style?
>=20
> There's probably enough use of both, and assumption that the
> styles differ, that we should probably not try to merge the
> styles.

I don't manage to talloc enough time to work on this,
and as a result, it's been way too much time I can't trust
the test suite because of the numerous failures because of
the quotes.

The fast track is to address this in the bison test wrapper,
so I install the following patch on both master and branch-2.5.
Of course it reveals minor regressions introduced recently,
hidden by the differences on the quotes earlier in the test
cases.

=46rom a9621c9961dfdb51c7f29b5c029a2eb357a86909 Mon Sep 17 00:00:00 2001
From: Akim Demaille <demaille@gostai.com>
Date: Tue, 21 Feb 2012 15:28:46 +0100
Subject: [PATCH] tests: post-process stderr to normalize quotes.

	* tests/bison.in: Save bison's stderr, and convert gettextized
	quotes to plain ASCII.
---
 tests/bison.in |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/tests/bison.in b/tests/bison.in
index 5d609bf..744b1df 100644
--- a/tests/bison.in
+++ b/tests/bison.in
@@ -20,17 +20,29 @@
 abs_top_srcdir=3D'@abs_top_srcdir@'
 abs_top_builddir=3D'@abs_top_builddir@'
=20
+: ${PERL=3Dperl}
+
 # Use the shipped files, not those installed.
 BISON_PKGDATADIR=3D$abs_top_srcdir/data
 export BISON_PKGDATADIR
-$PREBISON "$abs_top_builddir/src/bison" ${1+"$@"}
+
+trap 'rm -f /tmp/bison.$$.*; exit $status' 0 1 2 13 15
+$PREBISON "$abs_top_builddir/src/bison" ${1+"$@"} 2>/tmp/bison.$$.err
 status=3D$?
+# Protect from gettextized quotes.  See quotearg.c's gettext_quote for
+# the UTF-8 sequences.  For context, see
+# http://lists.gnu.org/archive/html/bug-bison/2012-01/msg00120.html
+#
+# In UTF-8 the quoting quote are not ', so bison use them to quote the
+# ' character.  When using ASCII quotes, bison issues "'".
+$PERL -p                                                                =
\
+  -e "s{\\xe2\\x80\\x98|\\xe2\\x80\\x99|\\xa1\\ae|\\xa1\\xaf}{'}g;"     =
\
+  -e "s{'''}{\"'\"}g;"                                                  =
\
+  /tmp/bison.$$.err >&2
=20
 # As a special dark magic, if we are actually using this wrapper to
 # compile Bison's src/parse-gram.y, post-process the synclines to
 # avoid dependencies on the user's set up (srcdir vs. builddir).
-PERL=3Dperl
-
 for i
 do
   case $i in
@@ -40,8 +52,8 @@ do
       # post-processes the synclines on y.tab.c itself.  Don't let it
       # do it.  Besides, it leaves "parse-gram.y" as the source,
       # dropping the src/ part.
-      perl -pi -e 's{"y\.tab\.}{"src/parse-gram.}g;'  \
-               -e 's{".*/(parse-gram\.y)"}{"src/$1"}g;'   \
+      perl -pi -e 's{"y\.tab\.}{"src/parse-gram.}g;'    \
+               -e 's{".*/(parse-gram\.y)"}{"src/$1"}g;' \
            y.tab.[ch]
     fi
     ;;
--=20
1.7.9



From MAILER-DAEMON Wed Feb 22 11:05:35 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S0EhD-0006yo-Pd
	for mharc-bug-bison@gnu.org; Wed, 22 Feb 2012 11:05:35 -0500
Received: from eggs.gnu.org ([140.186.70.92]:59004)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1S0Eh0-0006jy-Os
	for bug-bison@gnu.org; Wed, 22 Feb 2012 11:05:34 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1S0Egq-0002lj-Ht
	for bug-bison@gnu.org; Wed, 22 Feb 2012 11:05:22 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:47385
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1S0Egq-0002ZL-0n
	for bug-bison@gnu.org; Wed, 22 Feb 2012 11:05:12 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1S0EgI-0005As-Dq; Wed, 22 Feb 2012 17:04:38 +0100
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new
	quoting from gnulib
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: multipart/mixed; boundary=Apple-Mail-8--567840136
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <4F3E142E.9060206@cs.ucla.edu>
Date: Wed, 22 Feb 2012 17:04:37 +0100
Message-Id: <BEB0EC37-7226-4094-B839-65F463934EA6@lrde.epita.fr>
References: <1326882657-20418-1-git-send-email-jim@meyering.net>
	<5B80446A-5E64-42C2-992E-72C97B02E8E3@lrde.epita.fr>
	<4F20591D.9040505@cs.ucla.edu>
	<A5F3153D-2252-437D-866A-197CB733663F@lrde.epita.fr>
	<75F727C5-BC23-4647-8763-3F97934C3403@lrde.epita.fr>
	<4F21D740.4070509@cs.ucla.edu>
	<4DD763FD-8986-4543-93CD-73D5CFE5C15A@gmail.com>
	<4F22EC32.1080500@cs.ucla.edu>
	<FC94803C-5F41-4502-B425-2080E91626C3@gmail.com>
	<4F246DC0.5070601@cs.ucla.edu>
	<C5533D36-BB76-4BBB-B606-7DC3AA8C907B@gmail.com>
	<4F2620F6.9080101@cs.ucla.edu>
	<E5DB45EF-A650-44C9-BF6D-227F70AB0333@gmail.com>
	<468794A9-653C-4236-905E-B31F06AD9735@gmail.com>
	<4F2AB125.8090008@cs.ucla.edu>
	<03B6CFE1-23D9-4436-B463-68ECE7D283CF@gmail.com>
	<5073C1DD-0EA3-457C-A3D1-C897E512B779@lrde.epita.fr>
	<9AF32C15-13DE-4061-8272-67C521695787@lrde.epita.fr>
	<4F3D2716.9080205@cs.ucla.edu>
	<6E06DBF8-BFF0-4B3B-9124-042D16F129F0@lrde.epita.fr>
	<4F3E0FF1.908 0809@cs. ucla.edu>
	<E51CDA0A-2C75-496D-8121-B21D16A42122@lrde.epita.fr>
	<4F3E142E.9060206@cs.ucla.edu>
To: Paul Eggert <eggert@CS.UCLA.EDU>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: Bison Bugs <bug-bison@gnu.org>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 22 Feb 2012 16:05:34 -0000


--Apple-Mail-8--567840136
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=iso-8859-1


Le 17 f=E9vr. 2012 =E0 09:47, Paul Eggert a =E9crit :

> On 02/17/2012 12:39 AM, Akim Demaille wrote:
>> there would
>> remain the question: should quotearg and quote use the same
>> default style?
>=20
> There's probably enough use of both, and assumption that the
> styles differ, that we should probably not try to merge the
> styles.

Hi Paul,

This is a proposal for quote fusion into quotearg.
In order to make the transition easier, I don't think
we should truly remove the quote module; but as an
implementation detail, its implementation is part
of quotearg.

So I kept quote.h, and avoided including quotearg.h
from there.  But I moved the implementation of quote.c
into quotearg.c so that I can define a static
quote_quoting_option.  Arguably, quotearg_colon should
now be quote_colon IMHO, and live in quote rather than
quotearg, but that's very minor.

What do you think about these patches?


--Apple-Mail-8--567840136
Content-Disposition: attachment;
	filename=0001-quote-fuse-into-quotearg.patch
Content-Type: application/octet-stream;
	name="0001-quote-fuse-into-quotearg.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=2002026583ed4aba1e5866b06e0418aecbb071e426=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Akim=20Demaille=20<demaille@gostai.com>=0A=
Date:=20Wed,=2022=20Feb=202012=2015:26:17=20+0100=0ASubject:=20[PATCH]=20=
quote:=20fuse=20into=20quotearg.=0A=0Aquote=20does=20not=20leave=20the=20=
choice=20of=20the=20quoting=20style=20to=20the=20user.=0Aquoting_style=20=
provides=20poor=20customizability,=20yet=20quoting_options,=0Awhich=20is=20=
very=20rich,=20is=20hidden=20inside=20quotearg.c.=20=20So=20in=20order=20=
to=0Aallow=20quote=20customization,=20move=20its=20implementation=20=
within=20quotearg.c.=0A=0A=09*=20lib/quote.c:=20Remove.=0A=09*=20=
modules/quote:=20Adjust.=0A=09*=20lib/quotearg.c=20=
(quoting_options_from_style):=20Fix=20a=20compiler=0A=09warning:=20=
provide=20all=20the=20members=20of=20literal=20structs.=0A=20=20=20=20=20=
=20=20=20(quote_quoting_options_,=20quote_quoting_options):=20New.=0A=09=
(quote,=20quote_n):=20Import=20implementation=20from=20quote.c.=0A=09*=20=
lib/quote.h:=20Import=20the=20comments=20from=20quote.c.=0A=09=
(quote_quoting_options):=20New.=0A---=0A=20lib/quote.c=20=20=20=20|=20=20=
=2040=20----------------------------------------=0A=20lib/quote.h=20=20=20=
=20|=20=20=2015=20+++++++++++++++=0A=20lib/quotearg.c=20|=20=20=2031=20=
++++++++++++++++++++++++++++++-=0A=20modules/quote=20=20|=20=20=20=204=20=
----=0A=204=20files=20changed,=2045=20insertions(+),=2045=20deletions(-)=0A=
=20delete=20mode=20100644=20lib/quote.c=0A=0Adiff=20--git=20=
a/lib/quote.c=20b/lib/quote.c=0Adeleted=20file=20mode=20100644=0Aindex=20=
b46fd83..0000000=0A---=20a/lib/quote.c=0A+++=20/dev/null=0A@@=20-1,40=20=
+0,0=20@@=0A-/*=20quote.c=20-=20quote=20arguments=20for=20output=0A-=0A-=20=
=20=20Copyright=20(C)=201998-2001,=202003,=202005-2006,=202009-2012=20=
Free=20Software=0A-=20=20=20Foundation,=20Inc.=0A-=0A-=20=20=20This=20=
program=20is=20free=20software:=20you=20can=20redistribute=20it=20and/or=20=
modify=0A-=20=20=20it=20under=20the=20terms=20of=20the=20GNU=20General=20=
Public=20License=20as=20published=20by=0A-=20=20=20the=20Free=20Software=20=
Foundation;=20either=20version=203=20of=20the=20License,=20or=0A-=20=20=20=
(at=20your=20option)=20any=20later=20version.=0A-=0A-=20=20=20This=20=
program=20is=20distributed=20in=20the=20hope=20that=20it=20will=20be=20=
useful,=0A-=20=20=20but=20WITHOUT=20ANY=20WARRANTY;=20without=20even=20=
the=20implied=20warranty=20of=0A-=20=20=20MERCHANTABILITY=20or=20FITNESS=20=
FOR=20A=20PARTICULAR=20PURPOSE.=20=20See=20the=0A-=20=20=20GNU=20General=20=
Public=20License=20for=20more=20details.=0A-=0A-=20=20=20You=20should=20=
have=20received=20a=20copy=20of=20the=20GNU=20General=20Public=20License=0A=
-=20=20=20along=20with=20this=20program.=20=20If=20not,=20see=20=
<http://www.gnu.org/licenses/>.=20=20*/=0A-=0A-/*=20Written=20by=20Paul=20=
Eggert=20<eggert@twinsun.com>=20*/=0A-=0A-#include=20<config.h>=0A-=0A=
-#include=20"quotearg.h"=0A-#include=20"quote.h"=0A-=0A-/*=20Return=20an=20=
unambiguous=20printable=20representation=20of=20NAME,=0A-=20=20=20=
allocated=20in=20slot=20N,=20suitable=20for=20diagnostics.=20=20*/=0A=
-char=20const=20*=0A-quote_n=20(int=20n,=20char=20const=20*name)=0A-{=0A=
-=20=20return=20quotearg_n_style=20(n,=20locale_quoting_style,=20name);=0A=
-}=0A-=0A-/*=20Return=20an=20unambiguous=20printable=20representation=20=
of=20NAME,=0A-=20=20=20suitable=20for=20diagnostics.=20=20*/=0A-char=20=
const=20*=0A-quote=20(char=20const=20*name)=0A-{=0A-=20=20return=20=
quote_n=20(0,=20name);=0A-}=0Adiff=20--git=20a/lib/quote.h=20=
b/lib/quote.h=0Aindex=20140908b..1ca3585=20100644=0A---=20a/lib/quote.h=0A=
+++=20b/lib/quote.h=0A@@=20-15,6=20+15,21=20@@=0A=20=20=20=20You=20=
should=20have=20received=20a=20copy=20of=20the=20GNU=20General=20Public=20=
License=0A=20=20=20=20along=20with=20this=20program.=20=20If=20not,=20=
see=20<http://www.gnu.org/licenses/>.=20=20*/=0A=20=0A+#ifndef=20=
QUOTE_H_=0A+#=20define=20QUOTE_H_=201=0A=20=0A+/*=20=46rom=20quotearg.h.=20=
=20*/=0A+struct=20quoting_options;=0A+=0A+/*=20The=20quoting=20option=20=
used=20by=20quote_n=20and=20quote.=20=20*/=0A+extern=20struct=20=
quoting_options=20*quote_quoting_options;=0A+=0A+/*=20Return=20an=20=
unambiguous=20printable=20representation=20of=20NAME,=0A+=20=20=20=
allocated=20in=20slot=20N,=20suitable=20for=20diagnostics.=20=20*/=0A=20=
char=20const=20*quote_n=20(int=20n,=20char=20const=20*name);=0A+=0A+/*=20=
Return=20an=20unambiguous=20printable=20representation=20of=20NAME,=0A+=20=
=20=20suitable=20for=20diagnostics.=20=20*/=0A=20char=20const=20*quote=20=
(char=20const=20*name);=0A+=0A+#endif=20/*=20!QUOTE_H_=20*/=0Adiff=20=
--git=20a/lib/quotearg.c=20b/lib/quotearg.c=0Aindex=20c37aa35..6c2b06f=20=
100644=0A---=20a/lib/quotearg.c=0A+++=20b/lib/quotearg.c=0A@@=20-27,6=20=
+27,7=20@@=0A=20#include=20<config.h>=0A=20=0A=20#include=20"quotearg.h"=0A=
+#include=20"quote.h"=0A=20=0A=20#include=20"xalloc.h"=0A=20#include=20=
"c-strcaseeq.h"=0A@@=20-177,7=20+178,7=20@@=20set_custom_quoting=20=
(struct=20quoting_options=20*o,=0A=20static=20struct=20quoting_options=20=
/*=20NOT=20PURE!!=20*/=0A=20quoting_options_from_style=20(enum=20=
quoting_style=20style)=0A=20{=0A-=20=20struct=20quoting_options=20o=20=3D=20=
{=200=20};=0A+=20=20struct=20quoting_options=20o=20=3D=20{=200,=200,=20{=20=
0=20},=20NULL,=20NULL=20};=0A=20=20=20if=20(style=20=3D=3D=20=
custom_quoting_style)=0A=20=20=20=20=20abort=20();=0A=20=20=20o.style=20=
=3D=20style;=0A@@=20-926,3=20+927,31=20@@=20quotearg_custom_mem=20(char=20=
const=20*left_quote,=20char=20const=20*right_quote,=0A=20=20=20return=20=
quotearg_n_custom_mem=20(0,=20left_quote,=20right_quote,=20arg,=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20argsize);=0A=20}=0A+=0A+=0A+/*----------------------.=0A=
+|=20Former=20quote=20module.=20=20|=0A+`----------------------*/=0A+=0A=
+/*=20The=20quoting=20option=20used=20by=20quote_n=20and=20quote.=20=20=
*/=0A+static=20struct=20quoting_options=20quote_quoting_options_=20=3D=0A=
+=20=20{=0A+=20=20=20=20locale_quoting_style,=0A+=20=20=20=200,=0A+=20=20=
=20=20{=200=20},=0A+=20=20=20=20NULL,=20NULL=0A+=20=20};=0A+=0A+struct=20=
quoting_options=20*quote_quoting_options=20=3D=20=
&quote_quoting_options_;=0A+=0A+char=20const=20*=0A+quote_n=20(int=20n,=20=
char=20const=20*name)=0A+{=0A+=20=20return=20quotearg_n_options=20(n,=20=
name,=20SIZE_MAX,=20quote_quoting_options);=0A+}=0A+=0A+char=20const=20*=0A=
+quote=20(char=20const=20*name)=0A+{=0A+=20=20return=20quote_n=20(0,=20=
name);=0A+}=0Adiff=20--git=20a/modules/quote=20b/modules/quote=0Aindex=20=
02bfc94..863fc16=20100644=0A---=20a/modules/quote=0A+++=20=
b/modules/quote=0A@@=20-3,7=20+3,6=20@@=20Quote=20arguments=20for=20use=20=
in=20error=20messages.=0A=20=0A=20Files:=0A=20lib/quote.h=0A-lib/quote.c=0A=
=20m4/quote.m4=0A=20=0A=20Depends-on:=0A@@=20-12,9=20+11,6=20@@=20=
quotearg=0A=20configure.ac:=0A=20gl_QUOTE=0A=20=0A-Makefile.am:=0A=
-lib_SOURCES=20+=3D=20quote.c=0A-=0A=20Include:=0A=20"quote.h"=0A=20=0A=
--=20=0A1.7.9=0A=0A=

--Apple-Mail-8--567840136
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii



--Apple-Mail-8--567840136
Content-Disposition: attachment;
	filename=0003-tests-be-robust-to-quote-style.patch
Content-Type: application/octet-stream;
	name="0003-tests-be-robust-to-quote-style.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=206d06930693da13cd5c5a0b31f427ab44ab397eae=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Akim=20Demaille=20<demaille@gostai.com>=0A=
Date:=20Wed,=208=20Feb=202012=2014:44:24=20+0100=0ASubject:=20[PATCH=20=
3/6]=20tests:=20be=20robust=20to=20quote=20style.=0A=0ASee=20=
<http://lists.gnu.org/archive/html/bug-bison/2012-01/msg00120.html>.=0A=0A=
=09*=20src/main.c=20(main):=20Define=20the=20quoting=20style=20we=20use.=0A=
=09*=20tests/atlocal.in:=20Use=20ASCII=20style=20quotes=20during=20the=20=
tests.=0A---=0A=20gnulib=20=20=20=20=20=20=20=20=20=20=20|=20=20=20=202=20=
+-=0A=20src/main.c=20=20=20=20=20=20=20|=20=20=2011=20++++++++++-=0A=20=
tests/atlocal.in=20|=20=20=20=204=20++++=0A=203=20files=20changed,=2015=20=
insertions(+),=202=20deletions(-)=0A=0Adiff=20--git=20a/gnulib=20=
b/gnulib=0Aindex=2050bb21e..0202658=20160000=0A---=20a/gnulib=0A+++=20=
b/gnulib=0A@@=20-1=20+1=20@@=0A-Subproject=20commit=20=
50bb21eab7dfc87bbfcbc75f0232407110cdd296=0A+Subproject=20commit=20=
02026583ed4aba1e5866b06e0418aecbb071e426=0Adiff=20--git=20a/src/main.c=20=
b/src/main.c=0Aindex=20fdb26ac..57fa533=20100644=0A---=20a/src/main.c=0A=
+++=20b/src/main.c=0A@@=20-44,17=20+44,18=20@@=0A=20#include=20"print.h"=0A=
=20#include=20"print_graph.h"=0A=20#include=20"print-xml.h"=0A+#include=20=
<quote.h>=0A=20#include=20"reader.h"=0A=20#include=20"reduce.h"=0A=20=
#include=20"scan-code.h"=0A=20#include=20"scan-gram.h"=0A=20#include=20=
"scan-skel.h"=0A+#include=20<streq.h>=0A=20#include=20"symtab.h"=0A=20=
#include=20"tables.h"=0A=20#include=20"uniqstr.h"=0A=20=0A=20=0A-=0A=20=
int=0A=20main=20(int=20argc,=20char=20*argv[])=0A=20{=0A@@=20-64,6=20=
+65,14=20@@=20main=20(int=20argc,=20char=20*argv[])=0A=20=20=20(void)=20=
bindtextdomain=20("bison-runtime",=20LOCALEDIR);=0A=20=20=20(void)=20=
textdomain=20(PACKAGE);=0A=20=0A+=20=20{=0A+=20=20=20=20char=20const=20=
*cp=20=3D=20getenv=20("LC_CTYPE");=0A+=20=20=20=20if=20(cp=20&&=20STREQ=20=
(cp,=20"C",=20'C',=200,0,0,0,0,0,0,0))=0A+=20=20=20=20=20=20=
set_custom_quoting=20(quote_quoting_options,=20"'",=20"'");=0A+=20=20=20=20=
else=0A+=20=20=20=20=20=20set_quoting_style=20(quote_quoting_options,=20=
locale_quoting_style);=0A+=20=20}=0A+=0A=20=20=20atexit=20=
(close_stdout);=0A=20=0A=20=20=20uniqstrs_new=20();=0Adiff=20--git=20=
a/tests/atlocal.in=20b/tests/atlocal.in=0Aindex=20d34c110..b66e954=20=
100644=0A---=20a/tests/atlocal.in=0A+++=20b/tests/atlocal.in=0A@@=20=
-58,3=20+58,7=20@@=20CONF_JAVA=3D'@CONF_JAVA@'=0A=20=0A=20#=20We=20need=20=
egrep.=0A=20:=20${EGREP=3D'@EGREP@'}=0A+=0A+#=20Use=20simple=20quotes=20=
(lib/quote.c).=0A+LC_CTYPE=3DC=0A+export=20LC_CTYPE=0A--=20=0A1.7.9=0A=0A=

--Apple-Mail-8--567840136--


From MAILER-DAEMON Thu Feb 23 10:18:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S0aRR-0004Pm-6b
	for mharc-bug-bison@gnu.org; Thu, 23 Feb 2012 10:18:45 -0500
Received: from eggs.gnu.org ([140.186.70.92]:39874)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1S0aRK-0004On-RR
	for bug-bison@gnu.org; Thu, 23 Feb 2012 10:18:44 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1S0aRG-0005Fq-Bp
	for bug-bison@gnu.org; Thu, 23 Feb 2012 10:18:38 -0500
Received: from plane.gmane.org ([80.91.229.3]:51491)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1S0aRG-0005Fe-6c
	for bug-bison@gnu.org; Thu, 23 Feb 2012 10:18:34 -0500
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1S0aR9-0004lH-F9
	for bug-bison@gnu.org; Thu, 23 Feb 2012 16:18:27 +0100
Received: from g231145123.adsl.alicedsl.de ([92.231.145.123])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Thu, 23 Feb 2012 16:18:27 +0100
Received: from tim by g231145123.adsl.alicedsl.de with local (Gmexim 0.1
	(Debian)) id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Thu, 23 Feb 2012 16:18:27 +0100
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: bug-bison@gnu.org
To: bug-bison@gnu.org
From: Tim Landscheidt <tim@tim-landscheidt.de>
Subject: master: Dependencies broken
Date: Thu, 23 Feb 2012 15:18:07 +0000
Organization: <URI:http://www.tim-landscheidt.de/>
Lines: 38
Message-ID: <m3ipixtw7k.fsf@passepartout.tim-landscheidt.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: g231145123.adsl.alicedsl.de
Mail-Copies-To: never
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock: sha1:RYMLQQlyY1gORe5NewBYoq9616g=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Feb 2012 15:18:44 -0000

Hi,

on a freshly cloned and bootstrapped copy:

| [tim@passepartout ~/src/bison]$ make
|   GEN    examples/calc++/calc.stamp
| extexi: ignoring rpcalc.y
| extexi: ignoring mfcalc.y
| extexi: ignoring calc.h
| extexi: extracting calc++-driver.hh
| extexi: extracting calc++-driver.cc
| extexi: extracting calc++-parser.yy
| extexi: extracting calc++-scanner.ll
| extexi: extracting calc++.cc
|   GEN    examples/calc++/calc++-scanner.ll
| make: *** Keine Regel vorhanden, um das Target »examples/calc++/stack.hh«,
|   benötigt von »all«, zu erstellen.  Schluss.
| [tim@passepartout ~/src/bison]$

Continuing ignorantly:

| [tim@passepartout ~/src/bison]$ make -k
| make: *** Keine Regel vorhanden, um das Target »examples/calc++/stack.hh«,
|   benötigt von »all«, zu erstellen.
| make: *** Keine Regel vorhanden, um das Target »examples/calc++/position.hh«,
|   benötigt von »all«, zu erstellen.
| make: *** Keine Regel vorhanden, um das Target »examples/calc++/location.hh«,
|   benötigt von »all«, zu erstellen.
|   YACC   examples/calc++/calc++-parser.cc
| /home/tim/src/bison/./tests/bison: line 30: /home/tim/src/bison/src/bison: No such file or directory
| make: *** [examples/calc++/calc++-parser.cc] Fehler 1
|   GEN    examples/mfcalc/mfcalc.stamp
| [...]

So beside the missing rules for examples/calc++/*.hh, there
probably needs to be some dependency on src/bison.

Tim



From MAILER-DAEMON Thu Feb 23 10:21:54 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S0aUU-0004a8-BM
	for mharc-bug-bison@gnu.org; Thu, 23 Feb 2012 10:21:54 -0500
Received: from eggs.gnu.org ([140.186.70.92]:58531)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1S0aUL-0004Zb-2V
	for bug-bison@gnu.org; Thu, 23 Feb 2012 10:21:52 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1S0aUC-0005vN-Iy
	for bug-bison@gnu.org; Thu, 23 Feb 2012 10:21:44 -0500
Received: from mail-ww0-f49.google.com ([74.125.82.49]:57280)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1S0aUC-0005vE-A4
	for bug-bison@gnu.org; Thu, 23 Feb 2012 10:21:36 -0500
Received: by wgbdt13 with SMTP id dt13so908860wgb.30
	for <bug-bison@gnu.org>; Thu, 23 Feb 2012 07:21:35 -0800 (PST)
Received-SPF: pass (google.com: domain of akim.demaille@gmail.com designates
	10.180.92.165 as permitted sender) client-ip=10.180.92.165; 
Authentication-Results: mr.google.com; spf=pass (google.com: domain of
	akim.demaille@gmail.com designates 10.180.92.165 as permitted
	sender) smtp.mail=akim.demaille@gmail.com;
	dkim=pass header.i=akim.demaille@gmail.com
Received: from mr.google.com ([10.180.92.165])
	by 10.180.92.165 with SMTP id cn5mr4247834wib.2.1330010495240 (num_hops
	= 1); Thu, 23 Feb 2012 07:21:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=subject:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	bh=OSDasrK86NhLNelsO48uSxuh6k1gLlTSOeQkDR2hm3I=;
	b=W4BdIxj+bcJyS9LmpXd6VuerCIOsfS4cArYTFXigs+yQiVYfIxLM2+yQLgdRVJ0++p
	7bwc2MeEUEnxKN/Q21W6wW2zgZQvcxLFbHiWEBygcbxZ6eyPXcQOOwoiW2WPEfkg6o0u
	QMbLT7LRE1/YQ1mIF1oXBiDEQHzJsjx8aJw+o=
Received: by 10.180.92.165 with SMTP id cn5mr3471332wib.2.1330010495182;
	Thu, 23 Feb 2012 07:21:35 -0800 (PST)
Received: from [192.168.0.16] (mna75-4-82-225-76-247.fbx.proxad.net.
	[82.225.76.247])
	by mx.google.com with ESMTPS id s8sm4942668wiz.8.2012.02.23.07.21.34
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 23 Feb 2012 07:21:34 -0800 (PST)
Subject: Re: master: Dependencies broken
Mime-Version: 1.0 (Apple Message framework v1257)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim.demaille@gmail.com>
In-Reply-To: <m3ipixtw7k.fsf@passepartout.tim-landscheidt.de>
Date: Thu, 23 Feb 2012 16:21:33 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <EAE37982-AE3F-4EE4-A9D5-1955CCCC6C3D@lrde.epita.fr>
References: <m3ipixtw7k.fsf@passepartout.tim-landscheidt.de>
To: Tim Landscheidt <tim@tim-landscheidt.de>
X-Mailer: Apple Mail (2.1257)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 74.125.82.49
Cc: bug-bison@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Feb 2012 15:21:52 -0000


Le 23 f=E9vr. 2012 =E0 16:18, Tim Landscheidt a =E9crit :

> Hi,
>=20
> on a freshly cloned and bootstrapped copy:
>=20
> | [tim@passepartout ~/src/bison]$ make
> |   GEN    examples/calc++/calc.stamp
> | extexi: ignoring rpcalc.y
> | extexi: ignoring mfcalc.y
> | extexi: ignoring calc.h
> | extexi: extracting calc++-driver.hh
> | extexi: extracting calc++-driver.cc
> | extexi: extracting calc++-parser.yy
> | extexi: extracting calc++-scanner.ll
> | extexi: extracting calc++.cc
> |   GEN    examples/calc++/calc++-scanner.ll
> | make: *** Keine Regel vorhanden, um das Target =
=BBexamples/calc++/stack.hh=AB,
> |   ben=F6tigt von =BBall=AB, zu erstellen.  Schluss.
> | [tim@passepartout ~/src/bison]$
>=20
> Continuing ignorantly:
>=20
> | [tim@passepartout ~/src/bison]$ make -k
> | make: *** Keine Regel vorhanden, um das Target =
=BBexamples/calc++/stack.hh=AB,
> |   ben=F6tigt von =BBall=AB, zu erstellen.
> | make: *** Keine Regel vorhanden, um das Target =
=BBexamples/calc++/position.hh=AB,
> |   ben=F6tigt von =BBall=AB, zu erstellen.
> | make: *** Keine Regel vorhanden, um das Target =
=BBexamples/calc++/location.hh=AB,
> |   ben=F6tigt von =BBall=AB, zu erstellen.
> |   YACC   examples/calc++/calc++-parser.cc
> | /home/tim/src/bison/./tests/bison: line 30: =
/home/tim/src/bison/src/bison: No such file or directory
> | make: *** [examples/calc++/calc++-parser.cc] Fehler 1
> |   GEN    examples/mfcalc/mfcalc.stamp
> | [...]
>=20
> So beside the missing rules for examples/calc++/*.hh, there
> probably needs to be some dependency on src/bison.
>=20
> Tim

Hi Tim,

yes, I know this, but before touching master again, I
would like to know what the Hydra build farm thinks
about my changes.  You can try them in the "next" branch.



From MAILER-DAEMON Thu Feb 23 12:49:23 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S0cnD-00010I-Tj
	for mharc-bug-bison@gnu.org; Thu, 23 Feb 2012 12:49:23 -0500
Received: from eggs.gnu.org ([140.186.70.92]:57360)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1S0cn6-0000yb-GF
	for bug-bison@gnu.org; Thu, 23 Feb 2012 12:49:22 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1S0cn4-0003so-M6
	for bug-bison@gnu.org; Thu, 23 Feb 2012 12:49:16 -0500
Received: from plane.gmane.org ([80.91.229.3]:51987)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1S0cn4-0003sg-AE
	for bug-bison@gnu.org; Thu, 23 Feb 2012 12:49:14 -0500
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1S0cn2-00047E-0E
	for bug-bison@gnu.org; Thu, 23 Feb 2012 18:49:12 +0100
Received: from g231145123.adsl.alicedsl.de ([92.231.145.123])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Thu, 23 Feb 2012 18:49:11 +0100
Received: from tim by g231145123.adsl.alicedsl.de with local (Gmexim 0.1
	(Debian)) id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Thu, 23 Feb 2012 18:49:11 +0100
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: bug-bison@gnu.org
To: bug-bison@gnu.org
From: Tim Landscheidt <tim@tim-landscheidt.de>
Subject: Re: Java parser throws ArrayIndexOutOfBoundsException if first token
	leads to syntax error
Date: Thu, 23 Feb 2012 17:48:54 +0000
Organization: <URI:http://www.tim-landscheidt.de/>
Lines: 133
Message-ID: <m37gzdtp89.fsf@passepartout.tim-landscheidt.de>
References: <m3d3ap294c.fsf@passepartout.tim-landscheidt.de>
	<m3lio86cxv.fsf@passepartout.tim-landscheidt.de>
	<732A5915-1D8E-41D8-90D3-A4494A86BC0A@lrde.epita.fr>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: g231145123.adsl.alicedsl.de
Mail-Copies-To: never
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock: sha1:1dFrBvjiW3kRfkHIHcjGnyYmWmo=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Feb 2012 17:49:22 -0000

--=-=-=

Akim Demaille <akim@lrde.epita.fr> wrote:

>>> [...]
>>>  There is a test for syntax errors on the first token in
>>> tests/java.at, but apparently only in combination with an
>>> "error" token.  I hope fixing it is easier than isolating
>>> it was :-).

>> Nope.  Anyway, attached is the fix.  The test case is a bit
>> non-hackily lengthy, but I did not want to interlace it in
>> the existing suite and subtly break half of them in the
>> process.

> Thanks for this!
> [...]

While the assignment form is somewhere over the ocean, I re-
indented and -wrote the test case a bit to bring it more in
line with the other code and added TABs to the commit mes-
sage.  Is this "ready-to-commit"?

  Also on this topic: Are there useful Emacs tidbits and/or
git hooks to format and check commit messages?

Tim

--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-Java-Fix-syntax-error-handling-without-error-token.patch

>From d710c2ae6cbb100186b179eba67aad003402bb07 Mon Sep 17 00:00:00 2001
From: Tim Landscheidt <tim@tim-landscheidt.de>
Date: Sun, 12 Feb 2012 01:29:41 +0000
Subject: [PATCH] Java: Fix syntax error handling without error token.

	* data/lalr1.java (YYParser::parse): Here.
	* tests/java.at: Add test case.
---
 data/lalr1.java |    2 +-
 tests/java.at   |   62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+), 1 deletions(-)

diff --git a/data/lalr1.java b/data/lalr1.java
index 57ff993..a40d6c2 100644
--- a/data/lalr1.java
+++ b/data/lalr1.java
@@ -686,7 +686,7 @@ m4_popdef([b4_at_dollar])])dnl
               }
 
             /* Pop the current state because it cannot handle the error token.  */
-            if (yystack.height == 1)
+            if (yystack.height == 0)
               return false;
 
             ]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
diff --git a/tests/java.at b/tests/java.at
index b3e79e9..1c38b7b 100644
--- a/tests/java.at
+++ b/tests/java.at
@@ -781,3 +781,65 @@ AT_CHECK([[$EGREP -v ' */?\*' YYParser.java | grep 'Position']], [1], [ignore])
 AT_CHECK([[$EGREP -v ' */?\*' YYParser.java | grep 'Location']], [1], [ignore])
 
 AT_CLEANUP
+
+
+# ----------------------------------------------- #
+# Java syntax error handling without error token. #
+# ----------------------------------------------- #
+
+AT_SETUP([Java syntax error handling without error token])
+
+AT_DATA([[YYParser.y]], [[%language "Java"
+
+%code imports {
+  import java.io.IOException;
+}
+
+%code lexer {
+  public void yyerror (String s)
+  {
+    System.err.println (s);
+  }
+
+  public Object getLVal ()
+  {
+    return null;
+  }
+
+  public int yylex () throws IOException
+  {
+    int b = System.in.read ();
+    if (b == -1)
+      return EOF;
+    else
+      return b;
+  }
+}
+
+%code {
+  public static void main (String args []) throws IOException
+  {
+    YYParser p = new YYParser ();
+    p.parse ();
+  }
+}
+%%
+input:
+  '-' '-' '\n'
+;
+]])
+AT_DATA([[input1.txt]], [[--
+]])
+AT_DATA([[input2.txt]], [[-+
+]])
+AT_DATA([[input3.txt]], [[+-
+]])
+AT_BISON_CHECK([[YYParser.y]])
+AT_JAVA_COMPILE([[YYParser.java]])
+AT_JAVA_PARSER_CHECK([[YYParser < input1.txt]], [[0]], [[]], [[]])
+AT_JAVA_PARSER_CHECK([[YYParser < input2.txt]], [[0]], [[]], [[syntax error
+]])
+AT_JAVA_PARSER_CHECK([[YYParser < input3.txt]], [[0]], [[]], [[syntax error
+]])
+
+AT_CLEANUP
-- 
1.6.2.5


--=-=-=--



From MAILER-DAEMON Thu Feb 23 13:27:16 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S0dNs-0007pE-RH
	for mharc-bug-bison@gnu.org; Thu, 23 Feb 2012 13:27:16 -0500
Received: from eggs.gnu.org ([140.186.70.92]:59295)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1S0dNl-0007oP-BY
	for bug-bison@gnu.org; Thu, 23 Feb 2012 13:27:14 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1S0dNk-0003HA-2g
	for bug-bison@gnu.org; Thu, 23 Feb 2012 13:27:09 -0500
Received: from mail-ww0-f49.google.com ([74.125.82.49]:44804)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim.demaille@gmail.com>) id 1S0dNj-0003Gv-RM
	for bug-bison@gnu.org; Thu, 23 Feb 2012 13:27:08 -0500
Received: by wgbdt13 with SMTP id dt13so1059453wgb.30
	for <bug-bison@gnu.org>; Thu, 23 Feb 2012 10:27:07 -0800 (PST)
Received-SPF: pass (google.com: domain of akim.demaille@gmail.com designates
	10.180.24.166 as permitted sender) client-ip=10.180.24.166; 
Authentication-Results: mr.google.com; spf=pass (google.com: domain of
	akim.demaille@gmail.com designates 10.180.24.166 as permitted
	sender) smtp.mail=akim.demaille@gmail.com;
	dkim=pass header.i=akim.demaille@gmail.com
Received: from mr.google.com ([10.180.24.166])
	by 10.180.24.166 with SMTP id v6mr5581454wif.10.1330021627081 (num_hops
	= 1); Thu, 23 Feb 2012 10:27:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=subject:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	bh=Uv/53AjvoaBcqE+LGcbJ72udUfZkhfF8Yn3O/xhFHRw=;
	b=OxSMIPWgf3U+gbre0agkNkE3BDV7po70JefyG7rNSe2/jRIT928SPvHfsAzLOMCSFG
	51Iy1a33XjuHpBBgQAeAPuBZ73uMQIAsinn9XY8/QMemcbz2qcUz7M6HOGxvjMoFo4M8
	I8cjGF3EJqptloa+ayxgPvbS7lk/YHItk7AJc=
Received: by 10.180.24.166 with SMTP id v6mr4549661wif.10.1330021627022;
	Thu, 23 Feb 2012 10:27:07 -0800 (PST)
Received: from [192.168.0.16] (mna75-4-82-225-76-247.fbx.proxad.net.
	[82.225.76.247]) by mx.google.com with ESMTPS id
	hb10sm10066152wib.10.2012.02.23.10.27.05
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 23 Feb 2012 10:27:06 -0800 (PST)
Subject: Re: Java parser throws ArrayIndexOutOfBoundsException if first token
	leads to syntax error
Mime-Version: 1.0 (Apple Message framework v1257)
Content-Type: text/plain; charset=windows-1252
From: Akim Demaille <akim.demaille@gmail.com>
In-Reply-To: <m37gzdtp89.fsf@passepartout.tim-landscheidt.de>
Date: Thu, 23 Feb 2012 19:27:05 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <43BBBC3A-DC40-456C-9F32-08C72F0A30E2@lrde.epita.fr>
References: <m3d3ap294c.fsf@passepartout.tim-landscheidt.de>
	<m3lio86cxv.fsf@passepartout.tim-landscheidt.de>
	<732A5915-1D8E-41D8-90D3-A4494A86BC0A@lrde.epita.fr>
	<m37gzdtp89.fsf@passepartout.tim-landscheidt.de>
To: Tim Landscheidt <tim@tim-landscheidt.de>
X-Mailer: Apple Mail (2.1257)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 74.125.82.49
Cc: bug-bison@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Feb 2012 18:27:14 -0000


Le 23 f=E9vr. 2012 =E0 18:48, Tim Landscheidt a =E9crit :

> While the assignment form is somewhere over the ocean, I re-
> indented and -wrote the test case a bit to bring it more in
> line with the other code and added TABs to the commit mes-
> sage.  Is this "ready-to-commit"?

Actually not everybody is using that style for the git logs,
and I am the one who should change his habits.

> Also on this topic: Are there useful Emacs tidbits and/or
> git hooks to format and check commit messages?

Have a look at vc-dwim.  I am not using it, yet.

> +AT_DATA([[input1.txt]], [[--
> +]])
> +AT_DATA([[input2.txt]], [[-+
> +]])
> +AT_DATA([[input3.txt]], [[+-
> +]])
> +AT_BISON_CHECK([[YYParser.y]])
> +AT_JAVA_COMPILE([[YYParser.java]])
> +AT_JAVA_PARSER_CHECK([[YYParser < input1.txt]], [[0]], [[]], [[]])
> +AT_JAVA_PARSER_CHECK([[YYParser < input2.txt]], [[0]], [[]], [[syntax =
error
> +]])
> +AT_JAVA_PARSER_CHECK([[YYParser < input3.txt]], [[0]], [[]], [[syntax =
error
> +]])

I would prefer

AT_BISON_CHECK([[YYParser.y]])
AT_JAVA_COMPILE([[YYParser.java]])

AT_DATA(input.txt, =85)
AT_JAVA_PARSER_CHECK(YYParser < input.txt)

AT_DATA(input.txt, =85)
AT_JAVA_PARSER_CHECK(YYParser < input.txt)

AT_DATA(input.txt, =85)
AT_JAVA_PARSER_CHECK(YYParser < input.txt)

Actually, I would even prefer not using stdin, but passing the
string as argv.  And 'a', 'b' are more traditional than - and + :)

See for instance actions.at, snippets such as

AT_PARSER_CHECK([./input '(x)'], 0,

AT_PARSER_CHECK([./input '(xxxxx)(x)(x)y'], 1,

etc.



From MAILER-DAEMON Thu Feb 23 18:52:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S0iSf-0004cK-Vu
	for mharc-bug-bison@gnu.org; Thu, 23 Feb 2012 18:52:33 -0500
Received: from eggs.gnu.org ([140.186.70.92]:60334)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1S0iSd-0004al-5T
	for bug-bison@gnu.org; Thu, 23 Feb 2012 18:52:32 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1S0iSb-0007DL-Qk
	for bug-bison@gnu.org; Thu, 23 Feb 2012 18:52:31 -0500
Received: from plane.gmane.org ([80.91.229.3]:40384)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1S0iSb-0007D7-DH
	for bug-bison@gnu.org; Thu, 23 Feb 2012 18:52:29 -0500
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-bug-bison@m.gmane.org>) id 1S0iSa-0002sY-1l
	for bug-bison@gnu.org; Fri, 24 Feb 2012 00:52:28 +0100
Received: from g231145123.adsl.alicedsl.de ([92.231.145.123])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Fri, 24 Feb 2012 00:52:28 +0100
Received: from tim by g231145123.adsl.alicedsl.de with local (Gmexim 0.1
	(Debian)) id 1AlnuQ-0007hv-00
	for <bug-bison@gnu.org>; Fri, 24 Feb 2012 00:52:28 +0100
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: bug-bison@gnu.org
To: bug-bison@gnu.org
From: Tim Landscheidt <tim@tim-landscheidt.de>
Subject: Re: Java parser throws ArrayIndexOutOfBoundsException if first token
	leads to syntax error
Date: Thu, 23 Feb 2012 23:52:11 +0000
Organization: <URI:http://www.tim-landscheidt.de/>
Lines: 181
Message-ID: <m3k43dkt04.fsf@passepartout.tim-landscheidt.de>
References: <m3d3ap294c.fsf@passepartout.tim-landscheidt.de>
	<m3lio86cxv.fsf@passepartout.tim-landscheidt.de>
	<732A5915-1D8E-41D8-90D3-A4494A86BC0A@lrde.epita.fr>
	<m37gzdtp89.fsf@passepartout.tim-landscheidt.de>
	<43BBBC3A-DC40-456C-9F32-08C72F0A30E2@lrde.epita.fr>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: g231145123.adsl.alicedsl.de
Mail-Copies-To: never
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock: sha1:zEqC6heXkGqZubJtSgIAp8thH4Q=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Feb 2012 23:52:32 -0000

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Akim Demaille <akim.demaille@gmail.com> wrote:

> [...]
>> Also on this topic: Are there useful Emacs tidbits and/or
>> git hooks to format and check commit messages?

> Have a look at vc-dwim.  I am not using it, yet.

That seems interesting.

>> +AT_DATA([[input1.txt]], [[--
>> +]])
>> +AT_DATA([[input2.txt]], [[-+
>> +]])
>> +AT_DATA([[input3.txt]], [[+-
>> +]])
>> +AT_BISON_CHECK([[YYParser.y]])
>> +AT_JAVA_COMPILE([[YYParser.java]])
>> +AT_JAVA_PARSER_CHECK([[YYParser < input1.txt]], [[0]], [[]], [[]])
>> +AT_JAVA_PARSER_CHECK([[YYParser < input2.txt]], [[0]], [[]], [[syntax error
>> +]])
>> +AT_JAVA_PARSER_CHECK([[YYParser < input3.txt]], [[0]], [[]], [[syntax error
>> +]])

> I would prefer

> AT_BISON_CHECK([[YYParser.y]])
> AT_JAVA_COMPILE([[YYParser.java]])

> AT_DATA(input.txt, â€¦)
> AT_JAVA_PARSER_CHECK(YYParser < input.txt)

> AT_DATA(input.txt, â€¦)
> AT_JAVA_PARSER_CHECK(YYParser < input.txt)

> AT_DATA(input.txt, â€¦)
> AT_JAVA_PARSER_CHECK(YYParser < input.txt)

Yeah, that'd look more readable.

> Actually, I would even prefer not using stdin, but passing the
> string as argv.  And 'a', 'b' are more traditional than - and + :)

> See for instance actions.at, snippets such as

> AT_PARSER_CHECK([./input '(x)'], 0,

> AT_PARSER_CHECK([./input '(xxxxx)(x)(x)y'], 1,

> etc.

I chose stdin because:

- the other Java test cases use it,

- it's (very :-)) slightly shorter, and

- I don't have to worry about various powers that be
  (AT_JAVA_PARSER_CHECK, javaexec.sh, etc.) mangling the ar-
  guments and/or guarding against args [] being empty (albe-
  it with arguments "aa" instead of "--" this is probably
  never the case).

but I'm not married to that idea, so attached a patch again
with the args [] method (and no TABs :-)).

Tim

--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-Java-Fix-syntax-error-handling-without-error-token.patch

>From 00169673af95b50c780423054a7718ba6b96472e Mon Sep 17 00:00:00 2001
From: Tim Landscheidt <tim@tim-landscheidt.de>
Date: Sun, 12 Feb 2012 01:29:41 +0000
Subject: [PATCH] Java: Fix syntax error handling without error token.

* data/lalr1.java (YYParser::parse): Here.
* tests/java.at: Add test case.
---
 data/lalr1.java |    2 +-
 tests/java.at   |   66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+), 1 deletions(-)

diff --git a/data/lalr1.java b/data/lalr1.java
index 57ff993..a40d6c2 100644
--- a/data/lalr1.java
+++ b/data/lalr1.java
@@ -686,7 +686,7 @@ m4_popdef([b4_at_dollar])])dnl
               }
 
             /* Pop the current state because it cannot handle the error token.  */
-            if (yystack.height == 1)
+            if (yystack.height == 0)
               return false;
 
             ]b4_locations_if([yyerrloc = yystack.locationAt (0);])[
diff --git a/tests/java.at b/tests/java.at
index b3e79e9..b6ea163 100644
--- a/tests/java.at
+++ b/tests/java.at
@@ -781,3 +781,69 @@ AT_CHECK([[$EGREP -v ' */?\*' YYParser.java | grep 'Position']], [1], [ignore])
 AT_CHECK([[$EGREP -v ' */?\*' YYParser.java | grep 'Location']], [1], [ignore])
 
 AT_CLEANUP
+
+
+# ----------------------------------------------- #
+# Java syntax error handling without error token. #
+# ----------------------------------------------- #
+
+AT_SETUP([Java syntax error handling without error token])
+
+AT_DATA([[YYParser.y]], [[%language "Java"
+
+%lex-param { String s }
+
+%code imports {
+  import java.io.IOException;
+}
+
+%code lexer {
+  String Input;
+  int Position;
+
+  public YYLexer (String s)
+  {
+    Input    = s;
+    Position = 0;
+  }
+
+  public void yyerror (String s)
+  {
+    System.err.println (s);
+  }
+
+  public Object getLVal ()
+  {
+    return null;
+  }
+
+  public int yylex () throws IOException
+  {
+    if (Position >= Input.length ())
+      return EOF;
+    else
+      return Input.charAt (Position++);
+  }
+}
+
+%code {
+  public static void main (String args []) throws IOException
+  {
+    YYParser p = new YYParser (args [0]);
+    p.parse ();
+  }
+}
+%%
+input:
+  'a' 'a'
+;
+]])
+AT_BISON_CHECK([[YYParser.y]])
+AT_JAVA_COMPILE([[YYParser.java]])
+AT_JAVA_PARSER_CHECK([[YYParser aa]], [[0]], [[]], [[]])
+AT_JAVA_PARSER_CHECK([[YYParser ab]], [[0]], [[]], [[syntax error
+]])
+AT_JAVA_PARSER_CHECK([[YYParser ba]], [[0]], [[]], [[syntax error
+]])
+
+AT_CLEANUP
-- 
1.6.2.5


--=-=-=--



From MAILER-DAEMON Fri Feb 24 05:16:14 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S0sCE-0005bS-HK
	for mharc-bug-bison@gnu.org; Fri, 24 Feb 2012 05:16:14 -0500
Received: from eggs.gnu.org ([140.186.70.92]:52881)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1S0sC9-0005ac-Rd
	for bug-bison@gnu.org; Fri, 24 Feb 2012 05:16:11 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1S0sC0-0001AV-UM
	for bug-bison@gnu.org; Fri, 24 Feb 2012 05:16:08 -0500
Received: from sao-paulo.lrde.epita.fr ([163.5.55.1]:52162
	helo=kualalumpur.lrde.epita.fr)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <akim@lrde.epita.fr>) id 1S0sC0-000173-HK
	for bug-bison@gnu.org; Fri, 24 Feb 2012 05:16:00 -0500
Received: from tenochtitlan-eth.lrde.epita.fr ([192.168.101.154])
	by kualalumpur.lrde.epita.fr with esmtpsa
	(TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.63)
	(envelope-from <akim@lrde.epita.fr>)
	id 1S0sBT-00007w-8O; Fri, 24 Feb 2012 11:15:27 +0100
Subject: Re: master: Dependencies broken
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=iso-8859-1
From: Akim Demaille <akim@lrde.epita.fr>
In-Reply-To: <EAE37982-AE3F-4EE4-A9D5-1955CCCC6C3D@lrde.epita.fr>
Date: Fri, 24 Feb 2012 11:15:24 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <7F5034B4-7684-442E-8357-07E5F29F89F2@lrde.epita.fr>
References: <m3ipixtw7k.fsf@passepartout.tim-landscheidt.de>
	<EAE37982-AE3F-4EE4-A9D5-1955CCCC6C3D@lrde.epita.fr>
To: Akim Demaille <akim.demaille@gmail.com>
X-Mailer: Apple Mail (2.1084)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 163.5.55.1
Cc: bug-bison@gnu.org, Tim Landscheidt <tim@tim-landscheidt.de>
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "Bug reports for Bison, the GNU parser generator" <bug-bison.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-bison>
List-Post: <mailto:bug-bison@gnu.org>
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-bison>,
	<mailto:bug-bison-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 24 Feb 2012 10:16:11 -0000


Le 23 f=E9vr. 2012 =E0 16:21, Akim Demaille a =E9crit :

> Le 23 f=E9vr. 2012 =E0 16:18, Tim Landscheidt a =E9crit :
>=20
> Hi Tim,
>=20
> yes, I know this, but before touching master again, I
> would like to know what the Hydra build farm thinks
> about my changes.  You can try them in the "next" branch.

Well, I don't know when I will be able to check with the
build farm, and I will probably by offline the whole next
week, so since it's broken already, I pushed the following
patch.  I hope it will address all your issues.

=46rom 2191bb749b8f63b6037ca7e590ae499d0bb26db9 Mon Sep 17 00:00:00 2001
From: Akim Demaille <demaille@gostai.com>
Date: Wed, 22 Feb 2012 14:42:39 +0100
Subject: [PATCH] maint: fix example extraction issues.

calc++: don't rely on Automake to compile a C++ parser.

Basically, revert commit 609b3d8096fb0cc1fa4d908b6e1a860ced260bda,
Automake 1.11.3 is not safe enough for C++ parser.

	* examples/calc++/calc++-parser.hh: Remove.
	* examples/calc++/local.mk =
(examples/calc++/calc++-parser.stamp):
	New.

examples: factor the extractions into a single step

extexi had to be run in the extraction directory.  Now, it can be
given the files with expected output directory.  This allows to
use $(*_extracted) variables (before we had to list again their
members, but limited to their base names).  In turn, this also
allows fusing the extraction recipes into a single one.

Also, it is currently too hard (or requires too much duplication,
since Make wants all the occurrences of the files to be prefixed with
$(srcdir)/, which is something Automake cannot support for *_SOURCES)
to work in the source tree.  So extract, and compile scanners and =
parsers
in the build tree.

	* examples/extexi (basename): New.
	(BEGIN): Now "file_wanted" maps base name to extracted file =
name.
	* examples/calc++/local.mk, examples/mfcalc/local.mk,
	* examples/rpcalc/local.mk: Fuse extraction rules into...
	* examples/local.mk: Here.
	(extract, extracted): New.
---
 examples/calc++/.gitignore       |    5 +-
 examples/calc++/calc++-parser.hh |    4 --
 examples/calc++/local.mk         |   80 =
+++++++++++++++++++++++---------------
 examples/extexi                  |   16 ++++---
 examples/local.mk                |   21 +++++++++-
 examples/mfcalc/local.mk         |   23 +----------
 examples/rpcalc/local.mk         |   23 +----------
 7 files changed, 83 insertions(+), 89 deletions(-)
 delete mode 100644 examples/calc++/calc++-parser.hh

diff --git a/examples/calc++/.gitignore b/examples/calc++/.gitignore
index 2306d17..50eb5ba 100644
--- a/examples/calc++/.gitignore
+++ b/examples/calc++/.gitignore
@@ -4,10 +4,11 @@
 /calc++
 /calc++-driver.cc
 /calc++-driver.hh
+/calc++-parser.cc
+/calc++-parser.hh
 /calc++-parser.output
+/calc++-parser.stamp
 /calc++-parser.yy
-/calc++-parser.cc
-/calc++-parser.h
 /calc++-scanner.cc
 /calc++-scanner.ll
 /calc++.cc
diff --git a/examples/calc++/calc++-parser.hh =
b/examples/calc++/calc++-parser.hh
deleted file mode 100644
index 6f1e885..0000000
--- a/examples/calc++/calc++-parser.hh
+++ /dev/null
@@ -1,4 +0,0 @@
-// Work around an Automake 1.11.2 bug: it asks for the creation of
-// y.tab.h and then renames it as calc++-parser.h instead of
-// calc++-parser.hh.  We don't want this to show in the documentation.
-#include "calc++-parser.h"
diff --git a/examples/calc++/local.mk b/examples/calc++/local.mk
index 5d9dce0..8a03973 100644
--- a/examples/calc++/local.mk
+++ b/examples/calc++/local.mk
@@ -15,55 +15,71 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
=20
-## ------------ ##
-## Extracting.  ##
-## ------------ ##
+## ------------------- ##
+## Parser generation.  ##
+## ------------------- ##
=20
-# Extract in src.
-$(top_srcdir)/examples/calc++/calc.stamp: $(doc) $(extexi)
-	$(AM_V_GEN)rm -f $@ $@.tmp
+CLEANFILES +=3D $(top_srcdir)/examples/calc++/*.output *.tmp
+MAINTAINERCLEANFILES +=3D examples/calc++/*.stamp $(calc_sources)
+
+# Compile the parser and save cycles.
+# This code comes from "Handling Tools that Produce Many Outputs",
+# from the Automake documentation.
+EXTRA_DIST +=3D                                  \
+  examples/calc++/calc++-parser.stamp          \
+  examples/calc++/calc++-parser.yy             \
+  examples/calc++/calc++.stamp
+# Don't depend on $(BISON) otherwise we would rebuild these files
+# in srcdir, including during distcheck, which is forbidden.
+examples/calc++/calc++-parser.stamp: examples/calc++/calc++-parser.yy =
$(BISON_IN)
+	$(AM_V_YACC)rm -f $@
 	$(AM_V_at)touch $@.tmp
-	$(AM_V_at)cd $(top_srcdir)/examples/calc++ && \
-	   $(AWK) -f ../extexi -v VERSION=3D"$(VERSION)" \
-	     ../../doc/bison.texinfo -- calc++-parser.yy \
-	     calc++-scanner.ll calc++.cc calc++-driver.hh =
calc++-driver.cc
-	$(AM_V_at)mv $@.tmp $@
+	$(AM_V_at)$(YACCCOMPILE) -o examples/calc++/calc++-parser.cc	=
\
+	  examples/calc++/calc++-parser.yy
+	$(AM_V_at)mv -f $@.tmp $@
+
+$(calc_sources_generated): examples/calc++/calc++-parser.stamp
+	@test -f $@ || rm -f examples/calc++/calc++-parser.stamp
+	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) =
examples/calc++/calc++-parser.stamp
=20
-$(calc_extracted): $(top_srcdir)/examples/calc++/calc.stamp
-	$(AM_V_GEN)if test -f $@; then :; else \
-	  rm -f $< && \
-	  $(MAKE) $(AM_MAKEFLAGS) $<; \
-	fi
=20
 ## -------------------- ##
 ## Building & testing.  ##
 ## -------------------- ##
=20
-BUILT_SOURCES +=3D $(calc_sources) examples/calc++/calc++-parser.h
+# Avoid using BUILT_SOURCES which is too global.
+$(examples_calc___calc___OBJECTS): $(calc_sources_generated)
 CLEANFILES +=3D *.tmp
-MAINTAINERCLEANFILES +=3D $(top_srcdir)/examples/calc++/calc.stamp =
$(calc_sources)
-EXTRA_DIST +=3D examples/calc++/calc.stamp
+MAINTAINERCLEANFILES +=3D $(calc_sources)
=20
-calc_extracted =3D				\
-  examples/calc++/calc++-scanner.ll		\
-  examples/calc++/calc++.cc			\
-  examples/calc++/calc++-driver.hh		\
+calc_sources_extracted =3D			\
   examples/calc++/calc++-driver.cc		\
+  examples/calc++/calc++-driver.hh		\
+  examples/calc++/calc++-scanner.ll		\
+  examples/calc++/calc++.cc
+calc_extracted =3D				\
+  $(calc_sources_extracted)			\
   examples/calc++/calc++-parser.yy
-calc_generated =3D				\
-  examples/calc++/stack.hh			\
+extracted +=3D $(calc_extracted)
+calc_sources_generated =3D			\
+  examples/calc++/calc++-parser.cc		\
+  examples/calc++/calc++-parser.hh		\
+  examples/calc++/location.hh			\
   examples/calc++/position.hh			\
-  examples/calc++/location.hh
+  examples/calc++/stack.hh
 calc_sources =3D					\
-  $(calc_extracted) $(calc_generated)
+  $(calc_sources_extracted)			\
+  $(calc_sources_generated)
 if BISON_CXX_WORKS
 check_PROGRAMS +=3D examples/calc++/calc++
 examples_calc___calc___SOURCES =3D		\
-  $(calc_sources)				\
-  examples/calc++/y.tab.h			\
-  examples/calc++/calc++-parser.hh
+  $(calc_sources)
=20
-examples_calc___calc___CPPFLAGS =3D -I$(top_srcdir)/examples/calc++
+examples_calc___calc___CPPFLAGS =3D		\
+  -I$(top_builddir)/examples/calc++		\
+  -I$(top_srcdir)/examples/calc++
 TESTS +=3D examples/calc++/calc++.test
 endif
-EXTRA_DIST +=3D examples/calc++/calc++.test
+EXTRA_DIST +=3D					\
+  examples/calc++/calc++-parser.yy		\
+  examples/calc++/calc++.test
diff --git a/examples/extexi b/examples/extexi
index efce4e5..7ede7c4 100644
--- a/examples/extexi
+++ b/examples/extexi
@@ -29,7 +29,7 @@ BEGIN {
     if (ARGV[argc] =3D=3D "--")
       break;
   for (i =3D argc + 1; i < ARGC; ++i)
-    file_wanted[ARGV[i]] =3D 1;
+    file_wanted[basename(ARGV[i])] =3D ARGV[i];
   ARGC =3D argc;
 }
=20
@@ -43,13 +43,10 @@ BEGIN {
 }
=20
 /^@comment file: / {
-  if (!file_wanted[$3])
-    message("ignoring " $3);
+  if (file =3D file_wanted[$3])
+    message(" GEN " file);
   else
-    {
-      message("extracting " $3);
-      file =3D $3;
-    }
+    message("SKIP " $3);
 }
=20
 /^@(small)?example$/, /^@end (small)?example$/ {
@@ -125,6 +122,11 @@ function normalize(contents,    i, lines, n, line, =
res) {
 }
=20
=20
+function basename(name,     a, n) {
+  n =3D split (name, a, "/");
+  return a[n];
+}
+
 function message(msg) {
   if (! message_printed[msg])
     {
diff --git a/examples/local.mk b/examples/local.mk
index 0d63202..24ad83c 100644
--- a/examples/local.mk
+++ b/examples/local.mk
@@ -13,11 +13,28 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see =
<http://www.gnu.org/licenses/>.
=20
-doc =3D $(top_srcdir)/doc/bison.texinfo
-extexi =3D $(top_srcdir)/examples/extexi
 dist_noinst_SCRIPTS =3D examples/extexi examples/test
 TEST_LOG_COMPILER =3D $(top_srcdir)/examples/test
=20
+## ------------ ##
+## Extracting.  ##
+## ------------ ##
+
+doc =3D $(top_srcdir)/doc/bison.texinfo
+extexi =3D $(top_srcdir)/examples/extexi
+extract =3D $(AWK) -f $(extexi) -v VERSION=3D"$(VERSION)" $(doc) --
+extracted =3D
+MAINTAINERCLEANFILES +=3D $(extracted)
+examples/extracted.stamp: $(doc) $(extexi)
+	$(AM_V_GEN)rm -f $@ $@.tmp
+	$(AM_V_at)touch $@.tmp
+	$(AM_V_at)$(extract) $(extracted)
+	$(AM_V_at)mv $@.tmp $@
+
+$(extracted): examples/extracted.stamp
+	@test -f $@ || rm -f examples/extracted.stamp
+	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/extracted.stamp
+
 include examples/calc++/local.mk
 include examples/mfcalc/local.mk
 include examples/rpcalc/local.mk
diff --git a/examples/mfcalc/local.mk b/examples/mfcalc/local.mk
index c6d9470..8083dea 100644
--- a/examples/mfcalc/local.mk
+++ b/examples/mfcalc/local.mk
@@ -15,38 +15,19 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
=20
-## ------------ ##
-## Extracting.  ##
-## ------------ ##
-
-# Extract in src.
-$(top_srcdir)/examples/mfcalc/mfcalc.stamp: $(doc) $(extexi)
-	$(AM_V_GEN)rm -f $@ $@.tmp
-	$(AM_V_at)touch $@.tmp
-	$(AM_V_at)cd $(top_srcdir)/examples/mfcalc && \
-	   $(AWK) -f ../extexi -v VERSION=3D"$(VERSION)" \
-	     ../../doc/bison.texinfo -- calc.h mfcalc.y
-	$(AM_V_at)mv $@.tmp $@
-
-$(mfcalc_extracted): $(top_srcdir)/examples/mfcalc/mfcalc.stamp
-	$(AM_V_GEN)if test -f $@; then :; else \
-	  rm -f $< && \
-	  $(MAKE) $(AM_MAKEFLAGS) $<; \
-	fi
-
 ## -------------------- ##
 ## Building & testing.  ##
 ## -------------------- ##
=20
 BUILT_SOURCES +=3D $(mfcalc_sources)
-MAINTAINERCLEANFILES +=3D $(top_srcdir)/examples/mfcalc/mfcalc.stamp =
$(mfcalc_sources)
-EXTRA_DIST +=3D examples/mfcalc/mfcalc.stamp
+MAINTAINERCLEANFILES +=3D $(mfcalc_sources)
=20
 mfcalc_extracted =3D				\
   examples/mfcalc/calc.h			\
   examples/mfcalc/mfcalc.y
 mfcalc_sources =3D				\
   $(mfcalc_extracted)
+extracted +=3D $(mfcalc_extracted)
=20
 check_PROGRAMS +=3D examples/mfcalc/mfcalc
 examples_mfcalc_mfcalc_LDADD =3D -lm
diff --git a/examples/rpcalc/local.mk b/examples/rpcalc/local.mk
index c6cd7a3..844ffdf 100644
--- a/examples/rpcalc/local.mk
+++ b/examples/rpcalc/local.mk
@@ -15,37 +15,18 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
=20
-## ------------ ##
-## Extracting.  ##
-## ------------ ##
-
-# Extract in src.
-$(top_srcdir)/examples/rpcalc/rpcalc.stamp: $(doc) $(extexi)
-	$(AM_V_GEN)rm -f $@ $@.tmp
-	$(AM_V_at)touch $@.tmp
-	$(AM_V_at)cd $(top_srcdir)/examples/rpcalc && \
-	   $(AWK) -f ../extexi -v VERSION=3D"$(VERSION)" \
-	     ../../doc/bison.texinfo -- calc.h rpcalc.y
-	$(AM_V_at)mv $@.tmp $@
-
-$(rpcalc_extracted): $(top_srcdir)/examples/rpcalc/rpcalc.stamp
-	$(AM_V_GEN)if test -f $@; then :; else \
-	  rm -f $< && \
-	  $(MAKE) $(AM_MAKEFLAGS) $<; \
-	fi
-
 ## -------------------- ##
 ## Building & testing.  ##
 ## -------------------- ##
=20
 BUILT_SOURCES +=3D $(rpcalc_sources)
-MAINTAINERCLEANFILES +=3D $(top_srcdir)/examples/rpcalc/rpcalc.stamp =
$(rpcalc_sources)
-EXTRA_DIST +=3D examples/rpcalc/rpcalc.stamp
+MAINTAINERCLEANFILES +=3D $(rpcalc_sources)
=20
 rpcalc_extracted =3D				\
   examples/rpcalc/rpcalc.y
 rpcalc_sources =3D				\
   $(rpcalc_extracted)
+extracted +=3D $(rpcalc_extracted)
=20
 check_PROGRAMS +=3D examples/rpcalc/rpcalc
 examples_rpcalc_rpcalc_LDADD =3D -lm
--=20
1.7.9




