From haberg@matematik.su.se Sun Oct 01 17:46:13 2000
Received: from angel.algonet.se ([194.213.74.112])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13fqw0-00056Q-00
	for <bug-bison@gnu.org>; Sun, 01 Oct 2000 17:46:12 -0400
Received: (qmail 13603 invoked from network); 1 Oct 2000 23:46:07 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by angel.algonet.se with SMTP; 1 Oct 2000 23:46:07 +0200
Received: from  [195.100.226.133] (du133-226.ppp.su-anst.tninet.se [195.100.226.133])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 193374.436765.970delenn-s1 for <bug-bison@gnu.org>
 ; Sun, 01 Oct 2000 23:46:05 +0200
X-Sender: haberg@pop.matematik.su.se (Unverified)
Message-Id: <v03110701b5fad1127899@[195.100.226.131]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Sun, 1 Oct 2000 23:43:06 +0200
To: Bison Bugs <bug-bison@gnu.org>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Bison-1.28: Doc Typo, Misc Bugs
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

I made the Bison-1.28 (together with Flex 2.5.4.1) into a plugin for the
Metrowerks MacOS CW Pro 5 C/C++-compiler. Some comments:

-- Bison-1.28 Doc, Sec 9.1 at prefix -b: Says:
  The names are chosen as if the input file were named `prefix.c'.
Should be:
  The names are chosen as if the input file was named `prefix.y'.

-- Also, the docs seem to not mention the semantic parser (Bison.hairy)
feature.

-- Under MacOS, Metrowerks CW Pro 5, I had to put the following into the
skeleton file bison.simple:
  #if __MWERKS__ && macintosh
  #define YYSTACK_USE_ALLOCA
  #include <alloca.h>
  #include <stdlib.h>
  #endif
as under Standard C, free() is the header <stdlib.h>.

-- I think that the skeleton file bison.simple could have some prototypes like
  int yyerror(char* errstr);
  int yylex();
  typedef struct yyltype yyltype;
so that one can put the definition of those functions at the final segment
of the .y file without having to put the prototypes in the first segment.

-- As a plugin, I had trouble with Bison's style of exit()'ing as a
replacement of a "return", as then the whole CW IDE maintaining the plugin
is picked down. Therefore I had to implement a longjump construction, which
diverts to a regular "return".

  Hans Aberg
                  * Email: Hans Aberg <mailto:haberg@member.ams.org>
                  * Home Page: <http://www.matematik.su.se/~haberg/>
                  * AMS member listing: <http://www.ams.org/cml/>




From akim@epita.fr Mon Oct 02 05:29:11 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13g1uI-0002T8-00
	for <bug-bison@gnu.org>; Mon, 02 Oct 2000 05:29:10 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id LAA00715
	Mon, 2 Oct 2000 11:29:56 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52])
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13g1i8-00019y-00; Mon, 02 Oct 2000 11:16:36 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13g1hw-00005F-00; Mon, 02 Oct 2000 11:16:24 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: Bison Bugs <bug-bison@gnu.org>
Subject: Re: MacOS CW Pro 5 compile of Bison-1.28
References: <v03110700b5f905e81cca@[195.100.226.152]>
From: Akim Demaille <akim@epita.fr>
Date: 02 Oct 2000 11:16:23 +0200
In-Reply-To: Hans Aberg's message of "Thu, 28 Sep 2000 17:18:47 +0200"
Message-ID: <mv44s2vk3h4.fsf@nostromo.lrde.epita.fr>
Lines: 49
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

| -- It seems that file "bison.simple" (or "bison.s1" as it is called in the
| distribution) uses malloc(), free() without including the ISO C header
| <stdlib.h>.

Thanks for reporting this, we will investigate.

| -- Several files had included <config.h> instead of the correct "config.h".
| 
| -- mktemp() is not ISO C, so I substituted tmpnam(). Then one has to open
| each new file before calling tmpnam() again, because ISO C only guarantees
| name conflicts against existing files.
| 
| -- The temporary files were not deleted after the run of Bison -- but
| perhaps this is a feature, not a bug.

Precisely because you no longer mktemp.  The handling of tmp files in
bison is very unsatisfactory and shall be revamped before the next
release (have a look at src/files.c: this is probably the most
horrible C source I ever read).  Thanks.

| -- _nl_explode_name() and perhaps at some other places, had some illegal
| implicit type conversions, like
|   (const char *) -> (const unsigned char *)
| In addition, names starting with underscore or having a double underscore
| are normally reserved for the implementation of the compiler (at least in
| C++).

Related to gettext, not Bison per se.

| -- When editing the config.hin file by hand, it says "define LABEL if ...",
| whereas the use in the code fails to use the label in the form
| "defined(LABEL)", instead only using it directly as "LABEL". (Perhaps you
| use autoconfig which defines them to 1, so this formal error has not been
| noticed because of that.)

Good call!  Related to Autoconf though, but it is well spotted.  Thanks!

| -- The labels GNULOCALEDIR, LOCALE_ALIAS_PATH were not defined (probably
| supplied by the makefile then).

Right.

| -- There were two main(), in main.c and ansi2knr.c. This is not a problem
| when using a makefile, but when using a project file, it becomes confusing.

ansi2knr is used to processed Bison sources, it is not part of bison.

        Akim


From akim@epita.fr Mon Oct 02 05:29:13 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13g1uK-0002TG-00
	for <bug-bison@gnu.org>; Mon, 02 Oct 2000 05:29:13 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id LAA00703
	Mon, 2 Oct 2000 11:29:55 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52])
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13g1pl-0001AD-00; Mon, 02 Oct 2000 11:24:29 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13g1pi-00007r-00; Mon, 02 Oct 2000 11:24:26 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: Bison Bugs <bug-bison@gnu.org>
Subject: Re: Bison-1.28: Doc Typo, Misc Bugs
References: <v03110701b5fad1127899@[195.100.226.131]>
From: Akim Demaille <akim@epita.fr>
Date: 02 Oct 2000 11:24:26 +0200
In-Reply-To: Hans Aberg's message of "Sun, 1 Oct 2000 23:43:06 +0200"
Message-ID: <mv4vgvbioj9.fsf@nostromo.lrde.epita.fr>
Lines: 48
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

>>>>> "Hans" == Hans Aberg <haberg@matematik.su.se> writes:

Hans> -- Bison-1.28 Doc, Sec 9.1 at prefix -b: Says: The names are
Hans> chosen as if the input file were named `prefix.c'.  Should be:
Hans> The names are chosen as if the input file was named `prefix.y'.

Thanks.

Hans> -- Also, the docs seem to not mention the semantic parser
Hans> (Bison.hairy) feature.

I consider it dead.  Nobody seems to be willing to explain it, and the
code is... hairy :)

Hans> -- Under MacOS, Metrowerks CW Pro 5, I had to put the following
Hans> into the skeleton file bison.simple: #if __MWERKS__ && macintosh
Hans> #define YYSTACK_USE_ALLOCA #include <alloca.h> #include
Hans> <stdlib.h> #endif as under Standard C, free() is the header
Hans> <stdlib.h>.

We will probably include this.  But this self configuring soup makes
me mad.

Hans> -- I think that the skeleton file bison.simple could have some
Hans> prototypes like int yyerror(char* errstr); int yylex(); typedef
Hans> struct yyltype yyltype; so that one can put the definition of
Hans> those functions at the final segment of the .y file without
Hans> having to put the prototypes in the first segment.

Nope, there are portability issues (KnR vs ISO for instance), and in
addition nothing forbids your yylex to be static etc.

Hans> -- As a plugin, I had trouble with Bison's style of exit()'ing
Hans> as a replacement of a "return", as then the whole CW IDE
Hans> maintaining the plugin is picked down. Therefore I had to
Hans> implement a longjump construction, which diverts to a regular
Hans> "return".

I don't understand what you mean.  You mean a pluggin shall never
exit?  Well, we are not interested in MacOS, and we will not clutter
the sources to address such limitations.

But you can certainly solve this using some `main' and `exit' of your
own.  Just add `#define main my_main' in config.h (likewise with
exit), and voila, you can have you own main which implement the
longjump stuff.

        Akim


From akim@epita.fr Mon Oct 02 05:30:12 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13g1vI-0002Tm-00
	for <bug-bison@gnu.org>; Mon, 02 Oct 2000 05:30:12 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id LAA00709
	Mon, 2 Oct 2000 11:29:56 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52])
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13g1jf-0001A0-00; Mon, 02 Oct 2000 11:18:11 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13g1jc-00006m-00; Mon, 02 Oct 2000 11:18:08 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: Bison Bugs <bug-bison@gnu.org>
Subject: Re: Bison-1.28 No Error Bug
References: <v03110700b5fab72961ec@[195.100.226.130]>
From: Akim Demaille <akim@epita.fr>
Date: 02 Oct 2000 11:18:08 +0200
In-Reply-To: Hans Aberg's message of "Fri, 29 Sep 2000 23:25:53 +0200"
Message-ID: <mv4zokniotr.fsf@nostromo.lrde.epita.fr>
Lines: 23
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

>>>>> "Hans" == Hans Aberg <haberg@matematik.su.se> writes:

Hans> Using the compile Bison-1.28 for MacOS using the Metrowerks CW
Hans> Pro 5 C-compiler, I have noticed it Bison produces some funny
Hans> error messages. For example, if Bison cannot find the startup
Hans> file "<name>.y", one gets the somewhat confusing error message
Hans> Bison: <name>.y: No Error

Hans> The reason, in this case, is that tryopen() uses perror() in
Hans> connection with a function fprintf() that does not set
Hans> errno. When the program starts, errno is set to 0, meaning "No
Hans> Error", and remains so until a function alters it.

Hi,

It would greatly help us if you could use the current beta of Bison
instead, since a lot of this code has changed since 1.28.  Please, see

        http://subversions.gnu.org/

for how to download it.

        Akim


From akim@epita.fr Mon Oct 02 06:29:23 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13g2qV-00077F-00
	for <bug-bison@gnu.org>; Mon, 02 Oct 2000 06:29:19 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id MAA04834
	Mon, 2 Oct 2000 12:29:50 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13g2wi-0001IG-00; Mon, 02 Oct 2000 12:35:44 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13g2wc-0000wq-00; Mon, 02 Oct 2000 12:35:38 +0200
To: Paul Eggert <eggert@twinsun.com>
Cc: bug-bison@gnu.org, meyering@ascend.com
Subject: Re: bison 1.28 problem with gcc -Wall
References: <199908301951.MAA02330@shade.twinsun.com>
	<uryk8qd9eww.fsf@ixi.eng.ascend.com>
	<199908302116.OAA03963@shade.twinsun.com>
From: Akim Demaille <akim@epita.fr>
Date: 02 Oct 2000 12:35:38 +0200
In-Reply-To: Paul Eggert's message of "Mon, 30 Aug 1999 14:16:12 -0700 (PDT)"
Message-ID: <mv4bsx3jzt1.fsf@nostromo.lrde.epita.fr>
Lines: 45
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

Thanks, applied!

        Akim


|    From: Jim Meyering <meyering@ascend.com>
|    Date: 30 Aug 1999 22:44:47 +0200
| 
|    Your patch breaks bison because its comment violates this rule:
| 
|      /* Note: there must be only one dollar sign in this file.
| 
| Sorry about that; I didn't recall that rule.  Here is a revised patch.
| 
| 1999-08-30  Paul Eggert  <eggert@twinsun.com>
| 
|         * bison.s1 (yyparse): Assign the default value
|         unconditionally, to avoid a GCC warning and make the parser a
|         tad smaller.
| 
| ===================================================================
| RCS file: bison.s1,v
| retrieving revision 1.28.0.1
| retrieving revision 1.28.0.3
| diff -pu -r1.28.0.1 -r1.28.0.3
| --- bison.s1	1999/08/30 19:23:24	1.28.0.1
| +++ bison.s1	1999/08/30 21:15:18	1.28.0.3
| @@ -523,8 +523,14 @@ yydefault:
|  /* Do a reduction.  yyn is the number of a rule to reduce with.  */
|  yyreduce:
|    yylen = yyr2[yyn];
| -  if (yylen > 0)
| -    yyval = yyvsp[1-yylen]; /* implement default value of the action */
| +
| +  /* If yylen is nonzero, implement the default value of the action.
| +     Otherwise, the following line sets yyval to the semantic value of
| +     the lookahead token.  This behavior is undocumented and bison
| +     users should not rely upon it.  Assigning to yyval
| +     unconditionally makes the parser a bit smaller, and it avoids a
| +     GCC warning that yyval may be used uninitialized.  */
| +  yyval = yyvsp[1-yylen];
|  
|  #if YYDEBUG != 0
|    if (yydebug)


From akim@epita.fr Mon Oct 02 10:28:11 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13g6Zf-00015x-00; Mon, 02 Oct 2000 10:28:11 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id QAA22321
	Mon, 2 Oct 2000 16:28:55 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13g6g6-0001ch-00; Mon, 02 Oct 2000 16:34:50 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13g6fu-00040x-00; Mon, 02 Oct 2000 16:34:38 +0200
To: help-bison@gnu.org, bug-bison@gnu.org
Cc: Jim Meyering <meyering@ascend.com>, Paul Eggert <eggert@twinsun.com>
Subject: RFC: Default output destination
From: Akim Demaille <akim@epita.fr>
Date: 02 Oct 2000 16:34:37 +0200
Message-ID: <mv4u2avgvlu.fsf@nostromo.lrde.epita.fr>
Lines: 24
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

Hi People,

I consider this to be a bug in bison:

/tmp % mkdir src                                                 nostromo 16:31
/tmp % cp ~/src/bison/tests/calc.y src                           nostromo 16:31
/tmp % mkdir build && cd build                                   nostromo 16:31
/tmp/build % bison ../src/calc.y                                 nostromo 16:31
/tmp/build % cd ..                                               nostromo 16:31
/tmp % ls -l build src                                           nostromo 16:31
build:
total 0

src:
total 32
-rw-r--r--    1 akim     lrde        27553 oct  2 16:31 calc.tab.c
-rw-r--r--    1 akim     lrde         3335 oct  2 16:31 calc.y


Would it be safe to change this behavior to something more reasonable?
Do you think some people depend upon this?

        Akim


From meyering@ascend.com Mon Oct 02 10:42:43 2000
Received: from drawbridge.ascend.com ([198.4.92.1])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13g6ni-0001Iu-00; Mon, 02 Oct 2000 10:42:42 -0400
Received: from fw-ext.ascend.com (fw-ext [198.4.92.5])
	by drawbridge.ascend.com (8.9.1a/8.9.1) with SMTP id HAA10430;
	Mon, 2 Oct 2000 07:34:55 -0700 (PDT)
Received: from russet.ascend.com by fw-ext.ascend.com
          via smtpd (for drawbridge.ascend.com [198.4.92.1]) with SMTP; 2 Oct 2000 14:42:40 UT
Received: from petie.ascend.com (petie.ascend.com [192.207.23.114])
	by russet.ascend.com (8.9.1a/8.9.1) with ESMTP id HAA05677;
	Mon, 2 Oct 2000 07:42:40 -0700 (PDT)
Received: from ixi.eng.ascend.com (ixi.eng.ascend.com [172.27.61.1])
	by petie.ascend.com (8.8.8+Sun/8.8.8) with ESMTP id HAA16819;
	Mon, 2 Oct 2000 07:42:33 -0700 (PDT)
Received: (from meyering@localhost)
	by ixi.eng.ascend.com (8.9.3/8.9.3) id OAA21643;
	Mon, 2 Oct 2000 14:38:50 +0200
X-Authentication-Warning: ixi.eng.ascend.com: meyering set sender to meyering@ascend.com using -f
To: Akim Demaille <akim@epita.fr>
Cc: help-bison@gnu.org, bug-bison@gnu.org, Paul Eggert <eggert@twinsun.com>
Cc: automake@gnu.org
Subject: Re: RFC: Default output destination
References: <mv4u2avgvlu.fsf@nostromo.lrde.epita.fr>
From: Jim Meyering <meyering@ascend.com>
In-Reply-To: Akim Demaille's message of "02 Oct 2000 16:34:37 +0200"
Date: 02 Oct 2000 14:38:50 +0200
Message-ID: <ury4s2vfmed.fsf@ixi.eng.ascend.com>
Lines: 30
User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

Is it that behavior documented?
If so, then it's probably not reasonable to change it.
I've Cc'd the automake list, because some of automake's
rules use bison through $(YACC) -- though I'll bet they
all use it in yacc-compatible mode.

Akim Demaille <akim@epita.fr> writes:
| Hi People,
|
| I consider this to be a bug in bison:
|
| /tmp % mkdir src                                                 nostromo 16:31
| /tmp % cp ~/src/bison/tests/calc.y src                           nostromo 16:31
| /tmp % mkdir build && cd build                                   nostromo 16:31
| /tmp/build % bison ../src/calc.y                                 nostromo 16:31
| /tmp/build % cd ..                                               nostromo 16:31
| /tmp % ls -l build src                                           nostromo 16:31
| build:
| total 0
|
| src:
| total 32
| -rw-r--r--    1 akim     lrde        27553 oct  2 16:31 calc.tab.c
| -rw-r--r--    1 akim     lrde         3335 oct  2 16:31 calc.y
|
|
| Would it be safe to change this behavior to something more reasonable?
| Do you think some people depend upon this?
|
|         Akim


From proski@gnu.org Mon Oct 02 11:11:40 2000
Received: from rokslava.transcept.com ([208.151.20.130])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13g7Fj-0001j4-00; Mon, 02 Oct 2000 11:11:39 -0400
Received: from sunapee.transcept.com by rokslava.transcept.com
          via smtpd (for fencepost.gnu.org [199.232.76.164]) with SMTP; 2 Oct 2000 14:47:20 UT
Received: from sunapee.transcept.com (sunapee.transcept.com [129.86.50.245])
	by sunapee.transcept.com (8.9.3/8.9.3) with ESMTP id HAA01014;
	Mon, 2 Oct 2000 07:12:12 -0400
Date: Mon, 2 Oct 2000 07:12:12 -0400 (EDT)
From: Pavel Roskin <proski@gnu.org>
X-Sender: proskin@sunapee.transcept.com
To: Jim Meyering <meyering@ascend.com>
cc: Akim Demaille <akim@epita.fr>, help-bison@gnu.org, bug-bison@gnu.org,
        Paul Eggert <eggert@twinsun.com>, automake@gnu.org
Subject: Re: RFC: Default output destination
In-Reply-To: <ury4s2vfmed.fsf@ixi.eng.ascend.com>
Message-ID: <Pine.LNX.4.21.0010020657200.31138-100000@sunapee.transcept.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

Hello, Jim and others!

> Is it that behavior documented?
> If so, then it's probably not reasonable to change it.
> I've Cc'd the automake list, because some of automake's
> rules use bison through $(YACC) -- though I'll bet they
> all use it in yacc-compatible mode.

Yes, Automake currently used bison in Automake-compatible mode, but it
would be fair for Automake to switch to the native mode as long as the
processed files are distributed and "missing" emulates bison.

In any case, the makefiles should specify the output file explicitly
instead of relying on weird defaults.

> | src:
> | total 32
> | -rw-r--r--    1 akim     lrde        27553 oct  2 16:31 calc.tab.c
> | -rw-r--r--    1 akim     lrde         3335 oct  2 16:31 calc.y

This is not _that_ ugly as it seems - with Automake you want to put
sources where they belong - to the source directory.

Regards,
Pavel Roskin



From akim@epita.fr Mon Oct 02 11:41:53 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13g7iy-00022K-00; Mon, 02 Oct 2000 11:41:52 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id RAA01825
	Mon, 2 Oct 2000 17:42:40 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13g7pT-0001i2-00; Mon, 02 Oct 2000 17:48:35 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13g7pK-00047L-00; Mon, 02 Oct 2000 17:48:26 +0200
To: Pavel Roskin <proski@gnu.org>
Cc: Jim Meyering <meyering@ascend.com>, help-bison@gnu.org, bug-bison@gnu.org,
        Paul Eggert <eggert@twinsun.com>, automake@gnu.org
Subject: Re: RFC: Default output destination
References: <Pine.LNX.4.21.0010020657200.31138-100000@sunapee.transcept.com>
From: Akim Demaille <akim@epita.fr>
Date: 02 Oct 2000 17:48:26 +0200
In-Reply-To: Pavel Roskin's message of "Mon, 2 Oct 2000 07:12:12 -0400 (EDT)"
Message-ID: <mv4puljgs6t.fsf@nostromo.lrde.epita.fr>
Lines: 79
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by hermes.epita.fr id RAA01825
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

| Hello, Jim and others!

Hi Pavel!

| > Is it that behavior documented?

The documentation says:

	With all the source in a single file, you use the following
	command to convert it into a parser file:
=09
	@example
	bison @var{file_name}.y
	@end example
=09
	@noindent
	In this example the file was called @file{rpcalc.y} (for
**	``Reverse Polish CALCulator'').  Bison produces a file named
**	@file{@var{file_name}.tab.c}, removing the @samp{.y} from the
**	original file name. The file output by Bison contains the
	source code for @code{yyparse}.  The additional functions in
	the input file (@code{yylex}, @code{yyerror} and @code{main})
	are copied verbatim to the output.

which agrees with this behavior.  The question is then: did the author
think about file_name=3Ddir_part/base_part?  (And BTW, why the heck is
there this `tab' part?)

| > If so, then it's probably not reasonable to change it.
| > I've Cc'd the automake list, because some of automake's
| > rules use bison through $(YACC) -- though I'll bet they
| > all use it in yacc-compatible mode.
|=20
| Yes, Automake currently used bison in Automake-compatible mode, but it
| would be fair for Automake to switch to the native mode as long as the
| processed files are distributed and "missing" emulates bison.

And indeed the behavior is then different:

/tmp % rm calc.* *tab*                                           nostromo=
 17:37
/tmp % bison src/calc.y                                          nostromo=
 17:38
/tmp % ls src calc.c -l                                          nostromo=
 17:38
ls: calc.c: Aucun fichier ou r=E9pertoire de ce type
total 32
-rw-r--r--    1 akim     lrde        27517 oct  2 17:38 calc.tab.c
-rw-r--r--    1 akim     lrde         3335 oct  2 16:31 calc.y


/tmp % rm src/calc.tab.c                                         nostromo=
 Err 1
/tmp % bison src/calc.y -y                                       nostromo=
 17:38
/tmp % ls src *tab* -l                                           nostromo=
 Err 1
-rw-r--r--    1 akim     lrde        27517 oct  2 17:38 y.tab.c

src:
total 4
-rw-r--r--    1 akim     lrde         3335 oct  2 16:31 calc.y


| In any case, the makefiles should specify the output file explicitly
| instead of relying on weird defaults.

This is not possible simply with Yacc/Bison which (can) generates many
files (*.output, *.h...).

| > | src:
| > | total 32
| > | -rw-r--r--    1 akim     lrde        27553 oct  2 16:31 calc.tab.c
| > | -rw-r--r--    1 akim     lrde         3335 oct  2 16:31 calc.y
|=20
| This is not _that_ ugly as it seems - with Automake you want to put
| sources where they belong - to the source directory.

The difference source/build you are referring to is based on Automake
concepts.  They have no sense at all for tools such as bison or gcc
etc.  They have input and output.  I do not want them to try to grasp
source/build.  I want them to behave uniformly: output *here*.

        Akim


From proski@gnu.org Mon Oct 02 12:11:34 2000
Received: from rokslava.transcept.com ([208.151.20.130])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13g8Bi-0002Pd-00; Mon, 02 Oct 2000 12:11:34 -0400
Received: from sunapee.transcept.com by rokslava.transcept.com
          via smtpd (for fencepost.gnu.org [199.232.76.164]) with SMTP; 2 Oct 2000 15:47:14 UT
Received: from sunapee.transcept.com (sunapee.transcept.com [129.86.50.245])
	by sunapee.transcept.com (8.9.3/8.9.3) with ESMTP id IAA18615;
	Mon, 2 Oct 2000 08:12:10 -0400
Date: Mon, 2 Oct 2000 08:12:10 -0400 (EDT)
From: Pavel Roskin <proski@gnu.org>
X-Sender: proskin@sunapee.transcept.com
To: Akim Demaille <akim@epita.fr>
cc: bug-bison@gnu.org, automake@gnu.org
Subject: Re: RFC: Default output destination
In-Reply-To: <mv4puljgs6t.fsf@nostromo.lrde.epita.fr>
Message-ID: <Pine.LNX.4.21.0010020755050.11849-100000@sunapee.transcept.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

Hello, Akim!

> which agrees with this behavior.  The question is then: did the author
> think about file_name=dir_part/base_part?  (And BTW, why the heck is
> there this `tab' part?)

To avoid overriding calc.c if it's a separate source file.

> /tmp % ls src *tab* -l                                           nostromo Err 1
> -rw-r--r--    1 akim     lrde        27517 oct  2 17:38 y.tab.c
> 
> src:
> total 4
> -rw-r--r--    1 akim     lrde         3335 oct  2 16:31 calc.y

I.e., the output goes to the current directory!

> | In any case, the makefiles should specify the output file explicitly
> | instead of relying on weird defaults.
> 
> This is not possible simply with Yacc/Bison which (can) generates many
> files (*.output, *.h...).

But automake doesn't need all those files - it only needs the parcer.

> | This is not _that_ ugly as it seems - with Automake you want to put
> | sources where they belong - to the source directory.
> 
> The difference source/build you are referring to is based on Automake
> concepts.  They have no sense at all for tools such as bison or gcc
> etc.  They have input and output.  I do not want them to try to grasp
> source/build.  I want them to behave uniformly: output *here*.

I realize that.

It's unfortunate that the native mode of Bison behaves in a less uniform
way than the yacc mode. I agree with your point. Bison maintainters may
want to fix it along with the documentation.

Regards,
Pavel Roskin



From akim@epita.fr Mon Oct 02 12:45:15 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13g8iI-0002oF-00; Mon, 02 Oct 2000 12:45:14 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id SAA07060
	Mon, 2 Oct 2000 18:45:46 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13g8ob-0001oJ-00; Mon, 02 Oct 2000 18:51:45 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13g8oT-0004L3-00; Mon, 02 Oct 2000 18:51:37 +0200
To: "Lars J. Aas" <larsa@sim.no>
Cc: Pavel Roskin <proski@gnu.org>, Jim Meyering <meyering@ascend.com>,
        help-bison@gnu.org, bug-bison@gnu.org,
        Paul Eggert <eggert@twinsun.com>, automake@gnu.org
Subject: Re: RFC: Default output destination
References: <Pine.LNX.4.21.0010020657200.31138-100000@sunapee.transcept.com>
	<mv4puljgs6t.fsf@nostromo.lrde.epita.fr>
	<20001002181534.A23053@sim.no>
From: Akim Demaille <akim@epita.fr>
Date: 02 Oct 2000 18:51:37 +0200
In-Reply-To: "Lars J. Aas"'s message of "Mon, 2 Oct 2000 18:15:34 +0200"
Message-ID: <mv4hf6vgp9i.fsf@nostromo.lrde.epita.fr>
Lines: 38
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

| On Mon, Oct 02, 2000 at 05:48:26PM +0200, Akim Demaille wrote:
| : (And BTW, why the heck is there this `tab' part?)
| 
| I believe it is short for "table" - the compiler parser is based on using a
| state transition table or something along those lines.  That's my guess -
| I've never used lex/yacc seriously and am no expert in this field ;)

:)

Actually I was referring to the fact that there this `.tab' part in
the name.  I find it ugly and unneeded, all we need is the
extensions.  It looks like remains of the old Yacc behavior that has
been only partly cleaned up.

If I were to design the interface today, bison FOO.y would create
plenty of FOO.ext files, not a mixture of FOO.tab.ext and FOO.ext:

/tmp/src % ls                                                    nostromo 18:49
calc.y
/tmp/src % bison --defines --verbose calc.y                      nostromo 18:49
/tmp/src % ls -l                                                 nostromo 18:49
total 43
-rw-r--r--    1 akim     lrde         9845 oct  2 18:49 calc.output
-rw-r--r--    1 akim     lrde        27469 oct  2 18:49 calc.tab.c
-rw-r--r--    1 akim     lrde          100 oct  2 18:49 calc.tab.h
-rw-r--r--    1 akim     lrde         3335 oct  2 16:31 calc.y


This is more like what I'm expecting from Bison:

/tmp/src % rm *~*y                                               nostromo 18:50
/tmp/src % bison --defines --verbose calc.y -o my-calc.c         nostromo 18:50
/tmp/src % ls                                                    nostromo 18:50
calc.y  my-calc.c  my-calc.h  my-calc.output


Akim


From akim@epita.fr Tue Oct 03 03:25:10 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13gMRp-0003xJ-00
	for <bug-bison@gnu.org>; Tue, 03 Oct 2000 03:25:09 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id JAA08094
	Tue, 3 Oct 2000 09:25:56 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13gMYZ-0002dz-00; Tue, 03 Oct 2000 09:32:07 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13gMYW-0004s0-00; Tue, 03 Oct 2000 09:32:04 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: bug-bison@gnu.org
Subject: Re: Bison-1.28 No Error Bug
References: <v03110700b5fab72961ec@[195.100.226.130]>
	<v03110702b5fe48863ac4@[195.100.226.131]>
From: Akim Demaille <akim@epita.fr>
Date: 03 Oct 2000 09:32:04 +0200
In-Reply-To: Hans Aberg's message of "Mon, 2 Oct 2000 16:25:45 +0200"
Message-ID: <mv4wvfqfki3.fsf@nostromo.lrde.epita.fr>
Lines: 32
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

Please, don't drop the CC to the lists.

| The port is not very intrusive into the original source code, so it should
| (I hope) not be too difficlut to change that.
| 
| Here is a suggest for the code: Instead of having a lot of
| void warn PARAMS((char *));
| void warni PARAMS((char *, int));
| void warns PARAMS((char *, char *));
| void warnss PARAMS((char *, char *, char *));
| void warnsss PARAMS((char *, char *, char *, char *));
| you could write a single one
| 
| void warn (char *fmt, ...)
| {
|     va_list args;
| 
|     va_start(args, fmt);
|     warn_banner();
|     vfprintf(stderr, fmt, args);  */ Don't forget that little "v"! */
|     fputc('\n', stderr);
|     va_end(args);
| }
| 
| (I took it out of K&R, "CPL", p 174; I don't program C, just hack a little
| bit once in a while. :-) )

That's the approach advocated in the current beta.  It is still
unsatisfying: there are too many such functions (see complain.[ch]).

        Akim


From akim@epita.fr Tue Oct 03 03:32:04 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13gMYW-00040K-00
	for <bug-bison@gnu.org>; Tue, 03 Oct 2000 03:32:04 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id JAA08554
	Tue, 3 Oct 2000 09:32:48 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13gMfD-0002ez-00; Tue, 03 Oct 2000 09:38:59 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13gMfA-0004t2-00; Tue, 03 Oct 2000 09:38:56 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: bug-bison@gnu.org
Subject: Re: Bison-1.28: Doc Typo, Misc Bugs
References: <v03110701b5fad1127899@[195.100.226.131]>
	<v03110701b5fe44a3510f@[195.100.226.131]>
From: Akim Demaille <akim@epita.fr>
Date: 03 Oct 2000 09:38:56 +0200
In-Reply-To: Hans Aberg's message of "Mon, 2 Oct 2000 16:43:32 +0200"
Message-ID: <mv4snqefk6n.fsf@nostromo.lrde.epita.fr>
Lines: 100
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

| >Hans> -- I think that the skeleton file bison.simple could have some
| >Hans> prototypes like int yyerror(char* errstr); int yylex(); typedef
| >Hans> struct yyltype yyltype; so that one can put the definition of
| >Hans> those functions at the final segment of the .y file without
| >Hans> having to put the prototypes in the first segment.
| >
| >Nope, there are portability issues (KnR vs ISO for instance), and in
| >addition nothing forbids your yylex to be static etc.
| 
| I suspected this was the reason. But the documentation is rather poor at
| this point: I can guess what it should by checking what error messages I
| get from the compiler. Especially the hairy & YYLTYPE; I can guess that one
| should have something like
| 
| #ifndef YYLTYPE
| struct mytype {
|         clock_t timestamp;  /* Or whatever time you decide to use. */
|         int first_line, last_line, first_column, last_column;
|         char* text;
| };
| typedef struct mytype mytype;
| #define YYLTYPE mytype
| #endif
| 
| and then there are no C errors, but linker errrors that one should define
| yyrecover
| yymsg
| yyabort
| timeclock

I have no idea whether hairy is still functional.  And indeed there is
a problem in the design on Bison: it is never quite clear whether it
is the executable bison or the skeleton (bison.{simple, hairy}) which
should define things.  Here for instance you demonstrated that hairy
is less complete than simple.  Indeed we should do that.

The test suite should at least try to check that hairy compiles.
Maybe it will help us to use it.

And BTW, how come you used hairy?


| I have not checked the pure_parser yet, but the documentation only mentions
| the first_line, last_line, first_column, last_column fields for YYLTYPE. If
| the pure_parser also requires the timestamp and text fields, this is
| another doc bug.

Yes/no.  Since they are member of a struct, you don't need to know all
the fields.  Only if you define your own YYLTYPE, in which case RTFC :)



| >Hans> -- As a plugin, I had trouble with Bison's style of exit()'ing
| >Hans> as a replacement of a "return", as then the whole CW IDE
| >Hans> maintaining the plugin is picked down. Therefore I had to
| >Hans> implement a longjump construction, which diverts to a regular
| >Hans> "return".
| >
| >I don't understand what you mean.  You mean a pluggin shall never
| >exit?  Well, we are not interested in MacOS, and we will not clutter
| >the sources to address such limitations.
| 
| The CW IDE exits on several platforms, including UNIX, Windows, and MacOS X
| of course has Mach 2.5/4.4BSD. And if Gnu develops a similar IDE
| (Integrated development system), you will have the same problem as I with
| Bison.
| 
| The problem is more general, using Bison as a library: If a library
| exit()'s or abort()'s, one will also exit from the program using the
| library. :-) So, therefore, it seems me, a library should never exit or
| abort, unless it screwed up so badly that no possible recover is possible.
| :-)
| 
| Under C++, one can instead throw an exception, which the calling program
| can pick up. And when using a make, that is calling the system which is
| doing the program cleanup after the finish.

OK, thanks for the explanations!


| >But you can certainly solve this using some `main' and `exit' of your
| >own.  Just add `#define main my_main' in config.h (likewise with
| >exit), and voila, you can have you own main which implement the
| >longjump stuff.
| 
| This was how I solved it. :-)
| 
| I made a macro #define exit Exit, and Exit longjumps to the actual main(),
| where I can do some extra cleanup if necessary. For example, a library not
| closing files is nasty, as the files then remains locked for the next run.

IIRC `done ()' is the function you need to call.

| -- While I am it, I can mention that the CW IDE can, for the error/warning
| message display, take not only the file and file number, but also the token
| offset, token offset, selection offset and selection length. If one
| provides those, one can by a click get much closer to the error.

That's interesting: what the layout for such error messages?


From haberg@matematik.su.se Tue Oct 03 14:04:16 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13gWQK-0007ip-00
	for <bug-bison@gnu.org>; Tue, 03 Oct 2000 14:04:16 -0400
Received: (qmail 15936 invoked from network); 3 Oct 2000 20:03:17 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by knatte.tninet.se with SMTP; 3 Oct 2000 20:03:17 +0200
Received: from  [195.100.226.133] (du133-226.ppp.su-anst.tninet.se [195.100.226.133])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 739219.596193.970delenn-s0
 ; Tue, 03 Oct 2000 20:03:13 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110705b5ffcfba940b@[195.100.226.133]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Tue, 3 Oct 2000 20:03:04 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison-1.28: Doc Typo, Misc Bugs
Cc: bug-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 09.38 +0200 0-10-03, Akim Demaille wrote:
>I have no idea whether hairy is still functional.  And indeed there is
>a problem in the design on Bison: it is never quite clear whether it
>is the executable bison or the skeleton (bison.{simple, hairy}) which
>should define things.  Here for instance you demonstrated that hairy
>is less complete than simple.  Indeed we should do that.

Unless you can get hairy documented and working, I think you should take it
out of the main distribution.

BTW, at the subversions.gnu.org CVS, what's the difference between "MAIN"
and "HEAD"? Is "HEAD" the latest beta distribution & and "MAIN" the latest
regular distribution?

>The test suite should at least try to check that hairy compiles.
>Maybe it will help us to use it.
>
>And BTW, how come you used hairy?

It came in the distribution, and I wanted my plugin be as complete as
possible. I think that hairy might be of interest to that are interested in
writing compiler-compilers, or parsers with special features (I do not know
what a "semantic parser" is, which makes me curious.)

-- About the simple parser, I noticed it was not overly difficult to
compile it as C++ code.

>| I have not checked the pure_parser yet, but the documentation only mentions
>| the first_line, last_line, first_column, last_column fields for YYLTYPE. If
>| the pure_parser also requires the timestamp and text fields, this is
>| another doc bug.
>
>Yes/no.  Since they are member of a struct, you don't need to know all
>the fields.  Only if you define your own YYLTYPE, in which case RTFC :)

In hairy, the parser that Bison writes calls those fields, so one gets a C
compiler error unless those fields are added to the YYLTYPE struct.

>| >Hans> -- As a plugin, I had trouble with Bison's style of exit()'ing
>| >Hans> as a replacement of a "return",
...
>| I made a macro #define exit Exit, and Exit longjumps to the actual main(),
>| where I can do some extra cleanup if necessary. For example, a library not
>| closing files is nasty, as the files then remains locked for the next run.
>
>IIRC `done ()' is the function you need to call.

The exit() function is actually called at a couple of more places; there
was also an abort(), which I changed to exit(-1) (or Exit(-1) when the
macro has been expanded).

Under C++ (which is the lowlevel PL I otherwise use), one might write
something like
namespace Bison {
class Exit {
    int code;
    string message;
public:
    Exit(int s, const string& m) : status(s), message() { }
    int status() { return code; }
        string what() { return message; }
};

    // At exit point
    ... throw Exit(12, "core screwed up");

    // Main code: creates a Bison::main()
int main(...) {
    try {
    ...  // main program code
    } catch (Exit& ex) {
        if (ex.status())  cerr << ex.what() << endl;
        return ex.status();
}   }

}  // Namespace Bison

Just making something up. But as Bison is in its own namespace, it is
already ready to be used as a library.

>| -- While I am it, I can mention that the CW IDE can, for the error/warning
>| message display, take not only the file and file number, but also the token
>| offset, token offset, selection offset and selection length. If one
>| provides those, one can by a click get much closer to the error.
>
>That's interesting: what the layout for such error messages?

typedef struct CWMessageRef
{
  CWFileSpec sourcefile;      /* file containing error                    */
  long       linenumber;      /* error linenumber in file                 */
  short      tokenoffset;     /* offset into errorline of token underline */
  short      tokenlength;     /* length of error token to be underlined   */
  long       selectionoffset; /* start of error for text selection        */
  long       selectionlength; /* length of error for text selection       */
} CWMessageRef;

The CWFileSpec is the file spec struct used on the specific platform
(MacOS, Windows or UNIX). The IDE will underline the token indicated by
(tokenoffset, tokenlength) str2 of the in the messagewindow. In the file in
question, on the line linenumber, it will highlight the area indicated by
(selectionoffset, selectionlength.

When sending a message one also has an enum of the form
    enum {
        Info,
        Warning,
        Error
    };
and two strings str1, str2, the first and second line of the message. If
one does not want some or any of the CWMessageRef data, a field or the
whole of it, or any of the two strings, one sets whatever excluded to 0 (or
NULL). A typical message will look like
    <>|<Warning:>|<Error:> str1
    <filename> <linenumber>: str2
If one clicks on the entry, the file with its underline/selection will pop
open.

For example:

Warning : Bison Compiler-Compiler
rpcalc.y line 43   symbol lines is used, but is not defined as a token and...
                                   ----
                                   ^
Underlining displayed by the IDE --|

The idea is that the first line str1 should be a description of the
problem, and the second str2 a segment of the failing code, where the
failing token is pinpointed. Here is a C-error:

Error   : undefined identifier 'foo'
Bison Plugin.c line 244   cwMessageRef.tokenoffset = foo;
                                                     ---

And the part from the file "Bison Plugin.c" window will look like:
        ....
        cwMessageRef.linenumber = lineno;
=>      cwMessageRef.tokenoffset = |foo|;
        cwMessageRef.tokenlength = 0;
        ...
where I have simulated the displayed selection using |...|.
 

-- BTW, if one should check progress on Gnu implementations on MacOS X, the
one with Mach2.5/4.4BSD, whom should one contact? There is a Tenon
Mach2.5/4.4BSD, which I used to run on my Mac, which one adds on top of the
pre-X MacOS, and it has all the Gnu/BSD stuff, GCC, Bison, Flex, Emacs,
X-windows, etc. So this stuff has been implemented before on Mac's. But
Tenon say they will no longer do that stuff as they expects others to
implement it.

  Hans Aberg




From haberg@matematik.su.se Tue Oct 03 14:15:38 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13gWbJ-0007uo-00
	for <bug-bison@gnu.org>; Tue, 03 Oct 2000 14:15:37 -0400
Received: (qmail 25625 invoked from network); 3 Oct 2000 20:15:35 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by knatte.tninet.se with SMTP; 3 Oct 2000 20:15:35 +0200
Received: from  [195.100.226.133] (du133-226.ppp.su-anst.tninet.se [195.100.226.133])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 476641.596933.970delenn-s2
 ; Tue, 03 Oct 2000 20:15:33 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110706b5ffd2001ccd@[195.100.226.133]>
In-Reply-To: <mv4wvfqfki3.fsf@nostromo.lrde.epita.fr>
References: Hans Aberg's message of "Mon, 2 Oct 2000 16:25:45 +0200"
 <v03110700b5fab72961ec@[195.100.226.130]>
 <v03110702b5fe48863ac4@[195.100.226.131]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Tue, 3 Oct 2000 20:15:13 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison-1.28 No Error Bug
Cc: bug-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 09.32 +0200 0-10-03, Akim Demaille wrote:
>Please, don't drop the CC to the lists.

OK. I'm not on this list, so I forgot about it.
>| you could write a single one
>|
>| void warn (char *fmt, ...)
>| {
>|     va_list args;
>|
>|     va_start(args, fmt);
>|     warn_banner();
>|     vfprintf(stderr, fmt, args);  */ Don't forget that little "v"! */
>|     fputc('\n', stderr);
>|     va_end(args);
>| }
>|
>| (I took it out of K&R, "CPL", p 174; I don't program C, just hack a little
>| bit once in a while. :-) )
>
>That's the approach advocated in the current beta.  It is still
>unsatisfying: there are too many such functions (see complain.[ch]).

For the port, I want as few as possible, because it's easier to feed them
into the IDE message display. In order to prevent mistakes with f(...)
arguments, one can first define the single warn() above, and then all the
other warnx wrapping around it.

  Hans Aberg




From haberg@matematik.su.se Tue Oct 03 14:57:42 2000
Received: from hromeo.algonet.se ([194.213.74.51])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13gXG1-0008WP-00
	for <bug-bison@gnu.org>; Tue, 03 Oct 2000 14:57:42 -0400
Received: (qmail 19872 invoked from network); 3 Oct 2000 20:57:35 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by hromeo.algonet.se with SMTP; 3 Oct 2000 20:57:35 +0200
Received: from  [195.100.226.133] (du162-226.ppp.su-anst.tninet.se [195.100.226.162])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 426731.599451.970delenn-s0
 ; Tue, 03 Oct 2000 20:57:31 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110707b5ffd3d68b64@[195.100.226.133]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Tue, 3 Oct 2000 20:56:04 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Bison-1.28: Port IDE error messages; startup arguments
Cc: bug-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

I can add that in order to make sure that every info/warning/error message
is properly in the IDE message window I deflected stderr into a buffer,
which when the program terminates is fed into the IDE message window.

The difference between this approach and going into the code and feeding
each separate message into the IDE is that the latter approach gives a row
of entries in the IDE message window which each can be identified in the
original file by a click in the window. Thus the latter approach is to be
preferred. But by combining them, I can make sure no message is lost, and
one can dress up the port up as one has time. It is also desirable to have
as few originating info/warning/error functions as possible in the source
code, because then one can just go into just them, replacing those by the
IDE interfacing stuff.

As for this type of IDE, one does not have a Make program really, so the
startup arguments has to be provided by other means. For the global
settings, one can develop a target settings panel, but this does not work
for local, file specific arguments. In the port of the Haskell interpreter
Hugs http:haskell.org/hugs, it uses Bison for Haskell, and I use it for
implementing AppleEvent's, which are binary information packets programs
can pass to each other in communications. Then the problem arouse with
Bison name output conflicts, which can be fixed by "--name-prefix=", but
not via a global GUI control panel.

So all such arguments that are file specific, one should be able to control
by pragmas (or %-commands in Bison).

In the port I made, I fixed this problem by allowing one to add a <name>.ym
("m" for "make") which must reside in the same directory as the
corresponding .y file, and which contains the startup arguments. (And
similarly, with Flex, one can have a .lm file).

Thus the port has full functionality in this respect. (Created files are
flipped into the project, and autmoatically compiled, so a "Make" program
is not need for this part.)

-- As for the problem with not closing files and deleting them, under C++
one can wrap the creation/opening, closing/removing of temporary files in a
class, and then use that as an automatic variable. If one then terminates
the program by throwing an exception, those resources will automatically be
reclaimed, and thus it works as a library as well.

Specifically, it would look something like this:
class TempFile {
    Data: Filepointer, name.
public:
    TempFile(...); // Constructor, creates & opens temp file.
    ~TempFile();   // Destructor, closes & removes file.
    // Other interface stuff.
};

Use:
    ...
    TempFile tmp(...);   // Create & open file. Will automatically
                         // be reclaimed when out of scope.

-- Or whatever variation is good for you. :-)

  Hans Aberg




From akim@epita.fr Wed Oct 04 04:04:02 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13gjWz-00006r-00
	for <bug-bison@gnu.org>; Wed, 04 Oct 2000 04:04:01 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id KAA16775
	Wed, 4 Oct 2000 10:04:47 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13gje3-0004OC-00; Wed, 04 Oct 2000 10:11:19 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13gje0-0003pB-00; Wed, 04 Oct 2000 10:11:16 +0200
To: bug-bison@gnu.org
Cc: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison-1.28: Doc Typo, Misc Bugs
References: <v03110701b5fad1127899@[195.100.226.131]>
	<v03110701b5fe44a3510f@[195.100.226.131]>
	<v03110702b5ffb9db702b@[195.100.226.152]>
From: Akim Demaille <akim@epita.fr>
Date: 04 Oct 2000 10:11:16 +0200
In-Reply-To: Hans Aberg's message of "Tue, 3 Oct 2000 19:50:42 +0200"
Message-ID: <mv4snqd9gbf.fsf@nostromo.lrde.epita.fr>
Lines: 201
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

Please, keep the CC to the list!

| >I have no idea whether hairy is still functional.  And indeed there is
| >a problem in the design on Bison: it is never quite clear whether it
| >is the executable bison or the skeleton (bison.{simple, hairy}) which
| >should define things.  Here for instance you demonstrated that hairy
| >is less complete than simple.  Indeed we should do that.
| 
| Unless you can get hairy documented and working, I think you should take it
| out of the main distribution.

OK, go and discuss about this with RMS :)

I actually already sent him some messages about this issue, I'm
waiting for his input.  After that, I'll try to contact the original
author of Bison.

| BTW, at the subversions.gnu.org CVS, what's the difference between "MAIN"
| and "HEAD"? Is "HEAD" the latest beta distribution & and "MAIN" the latest
| regular distribution?

No idea.

| >The test suite should at least try to check that hairy compiles.
| >Maybe it will help us to use it.
| >
| >And BTW, how come you used hairy?
| 
| It came in the distribution, and I wanted my plugin be as complete as
| possible. I think that hairy might be of interest to that are interested in
| writing compiler-compilers, or parsers with special features (I do not know
| what a "semantic parser" is, which makes me curious.)

Nothing on the web about this (but numerous references to natural
language processing).

| -- About the simple parser, I noticed it was not overly difficult to
| compile it as C++ code.

Nope, indeed.  I do that myself.  See also a project named CMix where
they have a Bison parser used in a C++ project.

        C-Mix

        C-Mix is an automatic partial evaluator for the ISO/ANSI C
        language. It transforms generic programs into more efficient,
        specialized versions. For an introduction, read the short
        paper C-Mix: Making Easily Maintainable C-Programs run Fast.

        http://www.diku.dk/research-groups/topps/activities/cmix/



| >| I have not checked the pure_parser yet, but the documentation only mentions
| >| the first_line, last_line, first_column, last_column fields for YYLTYPE. If
| >| the pure_parser also requires the timestamp and text fields, this is
| >| another doc bug.
| >
| >Yes/no.  Since they are member of a struct, you don't need to know all
| >the fields.  Only if you define your own YYLTYPE, in which case RTFC :)
| 
| In hairy, the parser that Bison writes calls those fields, so one gets a C
| compiler error unless those fields are added to the YYLTYPE struct.

Hm, OK, I had not realized YYLTYPE was not defaulted in hairy as it is
in simple.  Another rather surprising thing about hairy is that
yyerror is a variable there!



| >| >Hans> -- As a plugin, I had trouble with Bison's style of exit()'ing
| >| >Hans> as a replacement of a "return",
| ...
| >| I made a macro #define exit Exit, and Exit longjumps to the actual main(),
| >| where I can do some extra cleanup if necessary. For example, a library not
| >| closing files is nasty, as the files then remains locked for the next run.
| >
| >IIRC `done ()' is the function you need to call.
| 
| The exit() function is actually called at a couple of more places; there
| was also an abort(), which I changed to exit(-1) (or Exit(-1) when the
| macro has been expanded).
| 
| Under C++ (which is the lowlevel PL I otherwise use), one might write
| something like
| namespace Bison {
| class Exit {
|     int code;
|     string message;
| public:
|     Exit(int s, const string& m) : status(s), message() { }

Throwing `m' away here.

|     int status() { return code; }
|         string what() { return message; }
| };
| 
|     // At exit point
|     ... throw Exit(12, "core screwed up");
| 
|     // Main code: creates a Bison::main()
| int main(...) {
|     try {
|     ...  // main program code
|     } catch (Exit& ex) {
|         if (ex.status())  cerr << ex.what() << endl;
|         return ex.status();
| }   }
| 
| }  // Namespace Bison
| 
| Just making something up. But as Bison is in its own namespace, it is
| already ready to be used as a library.

That's interesting, thanks!



| >| -- While I am it, I can mention that the CW IDE can, for the error/warning
| >| message display, take not only the file and file number, but also the token
| >| offset, token offset, selection offset and selection length. If one
| >| provides those, one can by a click get much closer to the error.
| >
| >That's interesting: what the layout for such error messages?
| 
| typedef struct CWMessageRef
| {
|   CWFileSpec sourcefile;      /* file containing error                    */
|   long       linenumber;      /* error linenumber in file                 */
|   short      tokenoffset;     /* offset into errorline of token underline */
|   short      tokenlength;     /* length of error token to be underlined   */
|   long       selectionoffset; /* start of error for text selection        */
|   long       selectionlength; /* length of error for text selection       */
| } CWMessageRef;
| 
| The CWFileSpec is the file spec struct used on the specific platform
| (MacOS, Windows or UNIX). The IDE will underline the token indicated by
| (tokenoffset, tokenlength) str2 of the in the messagewindow. In the file in
| question, on the line linenumber, it will highlight the area indicated by
| (selectionoffset, selectionlength.

How does it work for multiline symbols?

| When sending a message one also has an enum of the form
|     enum {
|         Info,
|         Warning,
|         Error
|     };
| and two strings str1, str2, the first and second line of the message. If
| one does not want some or any of the CWMessageRef data, a field or the
| whole of it, or any of the two strings, one sets whatever excluded to 0 (or
| NULL). A typical message will look like
|     <>|<Warning:>|<Error:> str1
|     <filename> <linenumber>: str2
| If one clicks on the entry, the file with its underline/selection will pop
| open.
| 
| For example:
| 
| Warning : Bison Compiler-Compiler
| rpcalc.y line 43   symbol lines is used, but is not defined as a token and...
|                                    ----
|                                    ^
| Underlining displayed by the IDE --|
| 
| The idea is that the first line str1 should be a description of the
| problem, and the second str2 a segment of the failing code, where the
| failing token is pinpointed. Here is a C-error:
| 
| Error   : undefined identifier 'foo'
| Bison Plugin.c line 244   cwMessageRef.tokenoffset = foo;
|                                                      ---
| 
| And the part from the file "Bison Plugin.c" window will look like:
|         ....
|         cwMessageRef.linenumber = lineno;
| =>      cwMessageRef.tokenoffset = |foo|;
|         cwMessageRef.tokenlength = 0;
|         ...
| where I have simulated the displayed selection using |...|.

Actually my question was more `how should a tool display the location
of symbols to be understood by your IDE'.  IIUC, it is not a matter of
printing an error msg this or that way, but it's actually by filling a
CWMessageRef.


| -- BTW, if one should check progress on Gnu implementations on MacOS X, the
| one with Mach2.5/4.4BSD, whom should one contact? There is a Tenon
| Mach2.5/4.4BSD, which I used to run on my Mac, which one adds on top of the
| pre-X MacOS, and it has all the Gnu/BSD stuff, GCC, Bison, Flex, Emacs,
| X-windows, etc. So this stuff has been implemented before on Mac's. But
| Tenon say they will no longer do that stuff as they expects others to
| implement it.

I have no idea.

        Akim


From akim@epita.fr Wed Oct 04 04:31:27 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13gjxX-0000Mk-00
	for <bug-bison@gnu.org>; Wed, 04 Oct 2000 04:31:27 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id KAA18604
	Wed, 4 Oct 2000 10:32:17 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13gk4f-0004RO-00; Wed, 04 Oct 2000 10:38:49 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13gk4c-0003uh-00; Wed, 04 Oct 2000 10:38:46 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: bug-bison@gnu.org
Subject: Re: Bison-1.28 No Error Bug
References: <v03110700b5fab72961ec@[195.100.226.130]>
	<v03110702b5fe48863ac4@[195.100.226.131]>
	<v03110706b5ffd2001ccd@[195.100.226.133]>
From: Akim Demaille <akim@epita.fr>
Date: 04 Oct 2000 10:38:46 +0200
In-Reply-To: Hans Aberg's message of "Tue, 3 Oct 2000 20:15:13 +0200"
Message-ID: <mv4hf6t80h5.fsf@nostromo.lrde.epita.fr>
Lines: 41
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

>>>>> "Hans" == Hans Aberg <haberg@matematik.su.se> writes:

>> That's the approach advocated in the current beta.  It is still
>> unsatisfying: there are too many such functions (see
>> complain.[ch]).

Hans> For the port, I want as few as possible, because it's easier to
Hans> feed them into the IDE message display. In order to prevent
Hans> mistakes with f(...)  arguments, one can first define the single
Hans> warn() above, and then all the other warnx wrapping around it.

We must have misunderstood each other.  Warn, warni, warns etc. are
dead, but now there is

/* Informative messages, but we proceed. */

extern void warn (const char *format, ...)
     __attribute__ ((__format__ (__printf__, 1, 2)));

/* Something bad happen, but let's continue and die later. */

extern void complain (const char *format, ...)
     __attribute__ ((__format__ (__printf__, 1, 2)));

/* Something bad happen and we die now. */

extern void fatal (const char *format, ...)
     __attribute__ ((__format__ (__printf__, 1, 2)));

/* Print a message with `fprintf (stderr, FORMAT, ...)';
   if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
   If STATUS is nonzero, terminate the program with `exit (STATUS)'.  */

extern void error (int status, int errnum,
                   const char *format, ...)
     __attribute__ ((__format__ (__printf__, 3, 4)));


If you find a means to factor this without cluttering bison's sources,
then fine, but clarity, simplicity and maintainability of the sources
of Bison are more important for us than interfacing with IDEs :(


From akim@epita.fr Wed Oct 04 07:31:29 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13gmlk-0005qX-00
	for <bug-bison@gnu.org>; Wed, 04 Oct 2000 07:31:28 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id NAA03305
	Wed, 4 Oct 2000 13:31:35 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13gmsF-0004bG-00; Wed, 04 Oct 2000 13:38:11 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13gmsD-0004Pu-00; Wed, 04 Oct 2000 13:38:09 +0200
To: Neil Booth <NeilB@earthling.net>
Cc: bug-bison@gnu.org
Subject: Re: Bison buffer overflow fix (v1.28 and earlier)
References: <19991003151006.A17337@monkey.rosenet.ne.jp>
From: Akim Demaille <akim@epita.fr>
Date: 04 Oct 2000 13:38:09 +0200
In-Reply-To: Neil Booth's message of "Sun, 3 Oct 1999 15:10:06 +0900"
Message-ID: <mv4ya047s66.fsf@nostromo.lrde.epita.fr>
Lines: 20
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

Thanks, applied.

| A trivial patch to fix a buffer overflow in Bison, covering at least
| versions 1.25 - 1.28.
| 
| Neil.
| 
| diff -urN bison-1.28.GNU/src/reader.c bison-1.28/src/reader.c
| --- bison-1.28.GNU/src/reader.c	Tue Jun 15 07:19:05 1999
| +++ bison-1.28/src/reader.c	Sun Oct  3 15:03:26 1999
| @@ -924,7 +924,7 @@
|    count = 0;
|    while (c >= '0' && c <= '9')
|      {
| -      if (count < 20)
| +      if (count < sizeof(buffer) - 1)
|         buffer[count++] = c;
|        c = getc(finput);
|      }


From akim@epita.fr Wed Oct 04 07:55:52 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13gn9L-000657-00
	for <bug-bison@gnu.org>; Wed, 04 Oct 2000 07:55:52 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id NAA04219
	Wed, 4 Oct 2000 13:55:13 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13gnF7-0004bV-00; Wed, 04 Oct 2000 14:01:49 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13gnF4-0005Uj-00; Wed, 04 Oct 2000 14:01:46 +0200
To: Piotr Gackiewicz <gacek@intertel.com.pl>,
        Piotr Gackiewicz <gacek@intertel.com.pl>
Cc: bug-bison@gnu.org
Subject: Re: segfault with '-v' option
References: <Pine.LNX.4.10.9910071241200.11131-201000@enigma.intertel.com.pl>
From: Akim Demaille <akim@epita.fr>
Date: 04 Oct 2000 14:01:46 +0200
In-Reply-To: Piotr Gackiewicz's message of "Thu, 7 Oct 1999 12:57:29 +0200 (CEST)"
Message-ID: <mv4u2as7r2t.fsf@nostromo.lrde.epita.fr>
Lines: 25
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

>>>>> "Piotr" == Piotr Gackiewicz <gacek@intertel.com.pl> writes:

Piotr> Bug: When parsing attached input file with '-v' options, bison
Piotr> gets signal no 11 - Segmentation fault.  I know, this input
Piotr> file is bad, ugly and without any sense ;-) - I'm not skilled
Piotr> with gramatics yet. But it shouldn't crash bison anyway. It
Piotr> doesn't do that without beeing verbose - without '-v' option.

Thanks for the sample, it's now part of the test suite.

Neil> Hi Piotr,

Neil> I suggest this patch as a (temporary) fix for this problem - it
Neil> now emits an appropriate warning, and continues without
Neil> segfaulting.  

Thanks for the patch, it's now part of bison :)

Neil> The parse_token_decl() routine in reader.c really needs to be
Neil> rewritten - it is far too permissive of bad input.  This also
Neil> goes for other routines in reader.c.

I very much agree.  I think we're on the right tracks now.

        Akim


From akim@epita.fr Wed Oct 04 07:56:56 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13gnAO-00065p-00
	for <bug-bison@gnu.org>; Wed, 04 Oct 2000 07:56:56 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id NAA04328
	Wed, 4 Oct 2000 13:57:36 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13gnHQ-0004cD-00; Wed, 04 Oct 2000 14:04:12 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13gnHO-0005VH-00; Wed, 04 Oct 2000 14:04:10 +0200
To: mcuddy@fensende.com
Cc: bug-bison@gnu.org
Subject: Re: Bison coredump..
References: <200002022320.PAA22167@fensende.com>
From: Akim Demaille <akim@epita.fr>
Date: 04 Oct 2000 14:04:10 +0200
In-Reply-To: Mike Cuddy's message of "Wed, 02 Feb 2000 15:20:38 +0000"
Message-ID: <mv4pulg7qyt.fsf@nostromo.lrde.epita.fr>
Lines: 52
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

(Better some day than never ;)

Thanks, it's fixed in the current beta.

        Akim

| When using --verbose and you have a duplicate token "string-name"
| > % bison --verbose test.y
| > Segmentation fault (core dumped)
| > gdb ./bison bison.core
| > GNU gdb 4.17
| > Copyright 1998 Free Software Foundation, Inc.
| > GDB is free software, covered by the GNU General Public License, and you are
| > welcome to change it and/or distribute copies of it under certain conditions.
| > Type "show copying" to see the conditions.
| > There is absolutely no warranty for GDB.  Type "show warranty" for details.
| > This GDB was configured as "i386--netbsd"...
| > Core was generated by `bison'.
| > Program terminated with signal 11, Segmentation fault.
| > Reading symbols from /usr/libexec/ld.so...done.
| > Reading symbols from /usr/lib/libc.so.12.40...done.
| > #0  0xb1fb in print_grammar () at print.c:277
| > 277                 column = strlen (tags[token_translations[i]]);
| > (gdb) where
| > #0  0xb1fb in print_grammar () at print.c:277
| > #1  0xa73b in verbose () at print.c:73
| > #2  0x744a in main (argc=3, argv=0xefbfda78) at main.c:107
| > (gdb) print i
| > $1 = 257
| > (gdb) print token_translations[i]
| > $2 = 4
| > (gdb) print tags[token_translations[i]]
| > $3 = 0x0
| > (gdb) quit
| > % cat test.y
| > 
| > %token FOO "!!"
| > %token BAR "!!"
| > 
| > %token OP_RARROW                "->"
| > %%
| > 
| > main
| >         : FOO
| >         | BAR
| >         ;
| > 
| > %%
| 
| If the test.y file has only the two tokens with the duplicate "string name"s,
| then it doesn't dump core.  


From akim@epita.fr Wed Oct 04 08:00:19 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13gnDe-00067H-00
	for <bug-bison@gnu.org>; Wed, 04 Oct 2000 08:00:18 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id OAA04497
	Wed, 4 Oct 2000 14:01:01 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13gnKk-0004cL-00; Wed, 04 Oct 2000 14:07:38 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13gnKh-0005W2-00; Wed, 04 Oct 2000 14:07:35 +0200
To: ebuddington@wesleyan.edu
Cc: bug-bison@gnu.org
Subject: Re: [Bug-bison] [patch] stdio.h not always needed in output
References: <20000916103617.A21381@ma-northadams1-415.nad.adelphia.net>
From: Akim Demaille <akim@epita.fr>
Date: 04 Oct 2000 14:07:35 +0200
In-Reply-To: Eric Buddington's message of "Sat, 16 Sep 2000 10:36:17 -0400"
Message-ID: <mv4lmw47qt4.fsf@nostromo.lrde.epita.fr>
Lines: 42
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

| I'm writing code for a bare-bones (no libc) environment, and bison's
| #inclusion of <stdio.h> is messing up my namespace. This header is
| only needed for debugging messages, as far as I can tell, so it should
| be #ifdef'd like this:
| 
| 
| diff -ur bison-1.28/src/output.c bison-1.28-erb1/src/output.c
| --- bison-1.28/src/output.c	Wed Jan 20 17:55:06 1999
| +++ bison-1.28-erb1/src/output.c	Sat Sep 16 10:22:42 2000
| @@ -267,7 +267,7 @@
|      fprintf(ftable, "#include \"%s\"\n", attrsfile);
|  
|    if (! noparserflag)
| -    fprintf(ftable, "#include <stdio.h>\n\n");
| +    fprintf(ftable, "#if YYDEBUG != 0\n#include <stdio.h>\n#endif\n\n");
|  
|    /* Make "const" do nothing if not in ANSI C.  */
|    fprintf (ftable, "#ifndef __cplusplus\n#ifndef __STDC__\n#define const\n#endif\n#endif\n\n");
| 

Hi!

I don't know too well about this patch, while I definitely understand
your concerns.

First of all, it is not clear to me why this inclusion is performed by
output.c instead of just being part of bison.simple.  If it were part
of bison.simple it would be much easier for you to tune the
bison.simple you need.

But anyway something I don't like too much with your proposal (but I
really have nothing better to propose!) is that if your code already
needs stdio.h, then depending whether YYDEBUG or not, you have to not
include or to include stdio.h.  This is gross.

Well, my concerns are related to the assumption you cannot include
stdio.h twice portably, but maybe I'm wrong, I don't know.

What do you think?

        Akim


From haberg@matematik.su.se Wed Oct 04 09:55:47 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13gp1O-0007En-00
	for <bug-bison@gnu.org>; Wed, 04 Oct 2000 09:55:46 -0400
Received: (qmail 4652 invoked from network); 4 Oct 2000 15:55:42 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by knatte.tninet.se with SMTP; 4 Oct 2000 15:55:42 +0200
Received: from  [195.100.226.133] (du133-226.ppp.su-anst.tninet.se [195.100.226.133])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 62671.667739.970delenn-s2
 ; Wed, 04 Oct 2000 15:55:39 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110700b600d50e3782@[195.100.226.142]>
In-Reply-To: <mv4snqd9gbf.fsf@nostromo.lrde.epita.fr>
References: Hans Aberg's message of "Tue, 3 Oct 2000 19:50:42 +0200"
 <v03110701b5fad1127899@[195.100.226.131]>
 <v03110701b5fe44a3510f@[195.100.226.131]>
 <v03110702b5ffb9db702b@[195.100.226.152]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Wed, 4 Oct 2000 15:16:24 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison-1.28: Doc Typo, Misc Bugs
Cc: bug-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 10.11 +0200 0-10-04, Akim Demaille wrote:
>| -- About the simple parser, I noticed it was not overly difficult to
>| compile it as C++ code.
>
>Nope, indeed.  I do that myself.  See also a project named CMix where
>they have a Bison parser used in a C++ project.
>
>        C-Mix
>
>        C-Mix is an automatic partial evaluator for the ISO/ANSI C
>        language. It transforms generic programs into more efficient,
>        specialized versions. For an introduction, read the short
>        paper C-Mix: Making Easily Maintainable C-Programs run Fast.
>
>        http://www.diku.dk/research-groups/topps/activities/cmix/

Thank you for the tip.

>Hm, OK, I had not realized YYLTYPE was not defaulted in hairy as it is
>in simple.

Right.

> Another rather surprising thing about hairy is that
>yyerror is a variable there!

Well, that's hairy. :-) -- I noticed it too.

>| >That's interesting: what the layout for such error messages?
>|
>| typedef struct CWMessageRef
>| {
>|   CWFileSpec sourcefile;      /* file containing error                    */
>|   long       linenumber;      /* error linenumber in file                 */
>|   short      tokenoffset;     /* offset into errorline of token underline */
>|   short      tokenlength;     /* length of error token to be underlined   */
>|   long       selectionoffset; /* start of error for text selection        */
>|   long       selectionlength; /* length of error for text selection       */
>| } CWMessageRef;
>|
>| The CWFileSpec is the file spec struct used on the specific platform
>| (MacOS, Windows or UNIX). The IDE will underline the token indicated by
>| (tokenoffset, tokenlength) str2 of the in the messagewindow. In the file in
>| question, on the line linenumber, it will highlight the area indicated by
>| (selectionoffset, selectionlength.
>
>How does it work for multiline symbols?

There is no problem in displaying several lines in each of the two strings
(by the use of '\n' in the strings): Then str1, str2 are displayed as two
segments or paragraphs on top of each other. Actually, this is how it works
if one say use the --help option in my port. For some type of information,
it can be suitable to use multilines, if they belong to the one and same
topic.

If type of information specific to a location in a file (usually the file
being compiled containing a failing token) should have its own IDE message,
as then the user can click on the window and get the location displayed.

>| When sending a message one also has an enum of the form
>|     enum {
>|         Info,
>|         Warning,
>|         Error
>|     };
>| and two strings str1, str2, the first and second line of the message. If
>| one does not want some or any of the CWMessageRef data, a field or the
>| whole of it, or any of the two strings, one sets whatever excluded to 0 (or
>| NULL). A typical message will look like
>|     <>|<Warning:>|<Error:> str1
>|     <filename> <linenumber>: str2
>| If one clicks on the entry, the file with its underline/selection will pop
>| open.
>|
>| For example:
>|
>| Warning : Bison Compiler-Compiler
>| rpcalc.y line 43   symbol lines is used, but is not defined as a token
>and...
>|                                    ----
>|                                    ^
>| Underlining displayed by the IDE --|
>|
>| The idea is that the first line str1 should be a description of the
>| problem, and the second str2 a segment of the failing code, where the
>| failing token is pinpointed. Here is a C-error:
>|
>| Error   : undefined identifier 'foo'
>| Bison Plugin.c line 244   cwMessageRef.tokenoffset = foo;
>|                                                      ---
>|
>| And the part from the file "Bison Plugin.c" window will look like:
>|         ....
>|         cwMessageRef.linenumber = lineno;
>| =>      cwMessageRef.tokenoffset = |foo|;
>|         cwMessageRef.tokenlength = 0;
>|         ...
>| where I have simulated the displayed selection using |...|.
>
>Actually my question was more `how should a tool display the location
>of symbols to be understood by your IDE'.  IIUC, it is not a matter of
>printing an error msg this or that way, but it's actually by filling a
>CWMessageRef.

The idea is that compiler picks out a segment of what it just have read and
puts that into str2, giving the numbers (tokenoffset, tokenlength) to
identify the failing token (or whatever) in that string str2.

The numbers (linenumber, selectionoffset, selectionlength) refer to the
file in question, but should normally identify the same token as in str2.
So I figure that normally tokenlength = selectionlength, whereas
tokenoffset will be diminished with what one stripped out of the line with
line number "linenumber" in order to get str2.

The source file pointer cannot be given by the compiler in a platform
independent manner; it is gotten from the IDE by a special call. The
compiler can though provide the information whether this pointer should be
NULL or not, meaning that the information is not file specific or not.

Then normally str1 will be the actual message, describing in words what the
problem is.

A summary of the data needed would be (in pseudo C++):

enum { Info, Warning, Error }   -- Type of message.
enum { General, Filespecific }  -- Filespecific message or not
string message                  -- Message in words; may be multiline.
class Excerpt {
  string excerpt;               -- Excerpt of where the problem is.
  int position, length;         -- Identifying the token position and its
};                              -- length in this string for underlining.
class ErrorLocation {
  int linenumber, lineposition, length; -- identifying the position in the
file.
};

The above does not include the file, as that was wellknown, but in order to
handle the case where several files are opened, I would add:
class WhichFile {
  string filename;     -- Name of file
  ...    filepointer;  -- Pointer to stream or file struct.
};

It is important to include the filename, because the IDE may use non-C/C++
platform specific file descriptors, and then one can use the name of the
file to do a search in via the IDE in order to get that platform specific
file descriptor.

  Hans Aberg




From haberg@matematik.su.se Wed Oct 04 09:55:51 2000
Received: from angel.algonet.se ([194.213.74.112])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13gp1T-0007Eq-00
	for <bug-bison@gnu.org>; Wed, 04 Oct 2000 09:55:51 -0400
Received: (qmail 21944 invoked from network); 4 Oct 2000 15:55:45 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by angel.algonet.se with SMTP; 4 Oct 2000 15:55:45 +0200
Received: from  [195.100.226.133] (du133-226.ppp.su-anst.tninet.se [195.100.226.133])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 842579.667743.970delenn-s2
 ; Wed, 04 Oct 2000 15:55:43 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110701b600de60681b@[195.100.226.142]>
In-Reply-To: <mv4hf6t80h5.fsf@nostromo.lrde.epita.fr>
References: Hans Aberg's message of "Tue, 3 Oct 2000 20:15:13 +0200"
 <v03110700b5fab72961ec@[195.100.226.130]>
 <v03110702b5fe48863ac4@[195.100.226.131]>
 <v03110706b5ffd2001ccd@[195.100.226.133]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Wed, 4 Oct 2000 15:36:12 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison-1.28 No Error Bug
Cc: bug-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 10.38 +0200 0-10-04, Akim Demaille wrote:
>Hans> For the port, I want as few as possible, because it's easier to
>Hans> ... In order to prevent
>Hans> mistakes with f(...)  arguments, one can first define the single
>Hans> warn() above, and then all the other warnx wrapping around it.
>
>We must have misunderstood each other.  Warn, warni, warns etc. are
>dead,

No I think understood; but some do not like the (...) constructs, as there
is not compile or runtime check for type correctness. One idea of C++ name
overloading was to get rid of the need for that (...). -- But that is
another discussion :-); I don't really care myself.

>but now there is
>
>/* Informative messages, but we proceed. */
>
>extern void warn (const char *format, ...)
>     __attribute__ ((__format__ (__printf__, 1, 2)));
...

(Note that names starting with _ are in ISO C/C++ reserved for the
implementation of the C/C++ compiler, and in C++ that is also true for
names containing __. -- Speaking about about ISO C/C++, I hope you know
that these can now be bought for "just" $18 each online from ANSI; the
identical ISO, non-ANSI C++ standard costs $245.)

>If you find a means to factor this without cluttering bison's sources,
>then fine, but clarity, simplicity and maintainability of the sources
>of Bison are more important for us than interfacing with IDEs :(

I would need to pick down the latest sources and check how well it works
when integrating that with my stuff. -- Right now, what holds me back, is
that I have not been able to figure out a convenient way of taking the
sources down from your CVS. -- If you have some recent sources and can send
them to me as .tgz mail attachment, I can try (but send as little as
possible though, just what's in "src", because I pick it down using a slow
56 kbaud modem).

  Hans Aberg




From akim@epita.fr Wed Oct 04 10:05:05 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13gpAO-0007L8-00
	for <bug-bison@gnu.org>; Wed, 04 Oct 2000 10:05:05 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id QAA09232
	Wed, 4 Oct 2000 16:05:49 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13gpHY-0004rm-00; Wed, 04 Oct 2000 16:12:28 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13gpHV-0002f3-00; Wed, 04 Oct 2000 16:12:25 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: bug-bison@gnu.org
Subject: Re: Bison-1.28 No Error Bug
References: <v03110700b5fab72961ec@[195.100.226.130]>
	<v03110702b5fe48863ac4@[195.100.226.131]>
	<v03110706b5ffd2001ccd@[195.100.226.133]>
	<v03110701b600de60681b@[195.100.226.142]>
From: Akim Demaille <akim@epita.fr>
Date: 04 Oct 2000 16:12:24 +0200
In-Reply-To: Hans Aberg's message of "Wed, 4 Oct 2000 15:36:12 +0200"
Message-ID: <mv4wvfo4rw7.fsf@nostromo.lrde.epita.fr>
Lines: 28
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

>>>>> "Hans" == Hans Aberg <haberg@matematik.su.se> writes:

Hans> (Note that names starting with _ are in ISO C/C++ reserved for
Hans> the implementation of the C/C++ compiler, and in C++ that is
Hans> also true for names containing __. -- Speaking about about ISO
Hans> C/C++, I hope you know that these can now be bought for "just"
Hans> $18 each online from ANSI; the identical ISO, non-ANSI C++
Hans> standard costs $245.)

These symbols are a means to tell gcc to type check a printf like
function.  The portability stuff is included in system.h, nothing to
be worried about.


Hans> I would need to pick down the latest sources and check how well
Hans> it works when integrating that with my stuff. -- Right now, what
Hans> holds me back, is that I have not been able to figure out a
Hans> convenient way of taking the sources down from your CVS. -- If
Hans> you have some recent sources and can send them to me as .tgz
Hans> mail attachment, I can try (but send as little as possible
Hans> though, just what's in "src", because I pick it down using a
Hans> slow 56 kbaud modem).

Try this one.

        http://www.lrde.epita.fr/people/akim/download/bison-1.28a.tar.gz

Akim


From akim@epita.fr Wed Oct 04 10:49:59 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13gprH-0007sX-00; Wed, 04 Oct 2000 10:49:34 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id QAA12998
	Wed, 4 Oct 2000 16:46:29 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13gpuu-0004xg-00; Wed, 04 Oct 2000 16:53:08 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13gpun-0002vl-00; Wed, 04 Oct 2000 16:53:01 +0200
To: bug-bison@gnu.org, help-bison@gnu.org, Hans Aberg <haberg@matematik.su.se>
Subject: [Richard Stallman <rms@gnu.org>] Re: Bison's semantic parsers
From: Akim Demaille <akim@epita.fr>
Date: 04 Oct 2000 16:53:01 +0200
Message-ID: <mv4r95w4q0i.fsf@nostromo.lrde.epita.fr>
Lines: 55
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

--=-=-=


FYI.

        Akim


--=-=-=
Content-Type: message/rfc822
Content-Disposition: inline

X-From-Line: rms@gnu.org  Wed Oct 4 08:09:04 2000
Return-path: <rms@santafe.edu>
Envelope-to: akim@lrde.epita.fr
Delivery-date: Wed, 04 Oct 2000 16:24:58 +0200
Received: from hermes.epita.fr ([10.42.1.60])
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13gpTd-0004tO-00
	for <akim@lrde.epita.fr>; Wed, 04 Oct 2000 16:24:57 +0200
Received: from bambi.iway.fr (bambi.iway.fr [194.98.65.10])
	by hermes.epita.fr id QAA10370 for <akim@epita.fr> 
	EPITA Paris France Wed, 4 Oct 2000 16:18:18 GMT
Received: from pele.santafe.edu (pele.santafe.edu [192.12.12.119])
	by bambi.iway.fr (8.9.1/8.9.1) with ESMTP id QAA13817
	for <akim@epita.fr>; Wed, 4 Oct 2000 16:18:35 +0200 (MET DST)
Received: from taos.santafe.edu (taos [192.12.12.10])
	by pele.santafe.edu (8.9.1/8.9.1) with ESMTP id IAA04787
	for <akim@epita.fr>; Wed, 4 Oct 2000 08:09:04 -0600 (MDT)
Received: (from rms@localhost)
	by taos.santafe.edu (8.9.3+Sun/8.9.1) id IAA12166;
	Wed, 4 Oct 2000 08:09:04 -0600 (MDT)
Date: Wed, 4 Oct 2000 08:09:04 -0600 (MDT)
Message-Id: <200010041409.IAA12166@taos.santafe.edu>
X-Authentication-Warning: taos.santafe.edu: rms set sender to rms@taos.santafe.edu using -f
From: Richard Stallman <rms@gnu.org>
To: akim@epita.fr
In-reply-to: <mv41yxydr2s.fsf@nostromo.lrde.epita.fr> (message from Akim
	Demaille on 03 Oct 2000 14:52:59 +0200)
Subject: Re: Bison's semantic parsers
Reply-to: rms@gnu.org
References:  <mv41yxydr2s.fsf@nostromo.lrde.epita.fr>
X-UIDL: 3c9803839ddb5c35d4018fd07ecf5998
X-Content-Length: 478
Lines: 13
Xref: nostromo.lrde.epita.fr mail.misc:15054
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

    Many people, including me, are extremely curious and would like to
    understand what is this feature from Bison, where we can find some
    documentation, sample code etc.

I never understood how to use that feature, and I don't know if it
still works.  That parser existed when I first got my hands on Bison
and I did not want to delete it, but that is all I had to do with it.

My advice is don't bother worrying about it, not for the test suite
or for anything else.




--=-=-=--


From haberg@matematik.su.se Wed Oct 04 13:07:05 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13gs0X-0000yV-00
	for <bug-bison@gnu.org>; Wed, 04 Oct 2000 13:07:05 -0400
Received: (qmail 15250 invoked from network); 4 Oct 2000 19:06:59 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by knatte.tninet.se with SMTP; 4 Oct 2000 19:06:59 +0200
Received: from  [195.100.226.132] (du132-226.ppp.su-anst.tninet.se [195.100.226.132])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 870539.679216.970garibaldi-s1
 ; Wed, 04 Oct 2000 19:06:56 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110700b6011120544f@[195.100.226.133]>
In-Reply-To: <mv4r95w4q0i.fsf@nostromo.lrde.epita.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Wed, 4 Oct 2000 18:57:43 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison's semantic parsers
Cc: bug-bison@gnu.org, help-bison@gnu.org, Richard Stallman <rms@gnu.org>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 16.53 +0200 0-10-04, Akim Demaille wrote:
>    Many people, including me, are extremely curious and would like to
>    understand what is this feature from Bison, where we can find some
>    documentation, sample code etc.
>
>I never understood how to use that feature, and I don't know if it
>still works.  That parser existed when I first got my hands on Bison
>and I did not want to delete it, but that is all I had to do with it.
>
>My advice is don't bother worrying about it, not for the test suite
>or for anything else.

Does this mean that one should delete the code involving the semantic
parser feature altogether? -- If nobody seems to know how to use it, and
it's not needed for backwards compatibility, that seems to be the best
thing.

  Hans Aberg




From akim@epita.fr Wed Oct 04 13:24:03 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13gsGw-0001Kn-00; Wed, 04 Oct 2000 13:24:02 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id TAA27098
	Wed, 4 Oct 2000 19:24:50 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13gsOB-0005DC-00; Wed, 04 Oct 2000 19:31:31 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13gsO6-00042L-00; Wed, 04 Oct 2000 19:31:26 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: bug-bison@gnu.org, help-bison@gnu.org, Richard Stallman <rms@gnu.org>
Subject: Re: Bison's semantic parsers
References: <v03110700b6011120544f@[195.100.226.133]>
From: Akim Demaille <akim@epita.fr>
Date: 04 Oct 2000 19:31:26 +0200
In-Reply-To: Hans Aberg's message of "Wed, 4 Oct 2000 18:57:43 +0200"
Message-ID: <mv4d7hg4ioh.fsf@nostromo.lrde.epita.fr>
Lines: 11
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

>>>>> "Hans" == Hans Aberg <haberg@matematik.su.se> writes:

Hans> Does this mean that one should delete the code involving the
Hans> semantic parser feature altogether? -- If nobody seems to know
Hans> how to use it, and it's not needed for backwards compatibility,
Hans> that seems to be the best thing.

Maybe some day, but it seems too early to me to do that.  Much code
remains functional and maybe only little work is needed to have it
work properly.  And after all, it should not be extremely hard to
understand how to use it, RTFS :)


From haberg@matematik.su.se Wed Oct 04 18:40:25 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13gxD7-0005lA-00
	for <bug-bison@gnu.org>; Wed, 04 Oct 2000 18:40:25 -0400
Received: (qmail 3451 invoked from network); 5 Oct 2000 00:40:22 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by knatte.tninet.se with SMTP; 5 Oct 2000 00:40:22 +0200
Received: from  [195.100.226.132] (du132-226.ppp.su-anst.tninet.se [195.100.226.132])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 86254.699221.970delenn-s0
 ; Thu, 05 Oct 2000 00:40:21 +0200
X-Sender: haberg@pop.matematik.su.se (Unverified)
Message-Id: <v03110701b601188b12bb@[195.100.226.132]>
In-Reply-To: <mv4zokniotr.fsf@nostromo.lrde.epita.fr>
References: Hans Aberg's message of "Fri, 29 Sep 2000 23:25:53 +0200"
 <v03110700b5fab72961ec@[195.100.226.130]>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Date: Thu, 5 Oct 2000 00:39:50 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Bison-1.28a Bugs
Cc: Bison Bugs <bug-bison@gnu.org>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

About files in the "src" directory:

-- Change all #include <config.h> to #include "config.h".

-- On config.h (which I must edit by hand):
  -- I had to put in
#ifndef CONFIG_H
#define CONFIG_H
=2E..
#endif  /* CONFIG_H */

  -- I am worrying about constructs such as
/* Define to `unsigned' if <sys/types.h> doesn't define.  */
#undef size_t
  because, if not edited, it means the name is undefined. Those I changed to
/* Define to `unsigned' if <sys/types.h> doesn't define.  */
#if 0
#undef size_t
#endif

  -- I could not find any instance of the HAVE_DONE_WORKING_REALLOC_CHECK
name in the sources.

  -- Same problem as before: If one merely writes #define FOO_BAR, there
are later illegal used of type #if FOO_BAR. Therefore either the text of
this file should be changed to "Define to 1 if ..." or all uses should be
of the form
#if ... defined(FOO_BAR) ...

  -- Some missing macros in the new config.hin (shown with my values)
#define LOCALEDIR ":"   -- Important as MacOS use ":" here.

/* The location of the simple parser (bison.simple).  */
#define XPFILE "bison.simple"

/* The location of the semantic parser (bison.hairy).  */
#define XPFILE1 "bison.hairy"

  -- It says that VERSION isn't used in Bison, but it is used by version()
in getargs.c. So
#define VERSION "1.28a"

-----------------------

=46ile complain.h: Add #include "system.h" (because of the macro __attribute=
__).

=46ile files.h: Add #include "system.h" (because of the macro PARAMS).

I get a lot of warnings:
Warning : identifier 'bool' redeclared
system.h line 163   typedef int bool;

-- xstrdup() was not in src, but in lib/xstrdup.c. Then it includes
<sys/types.h> which is not necessary, at least not under ISO C. Also
xstrdup does not have a prototype.

-- xrealloc() was not in src, but in lib/xmalloc.c.  Then it includes
<sys/types.h> which is not necessary, at least not under ISO C.

-- I also had to include from lib the files getopt.c and getopt1.c.

-- Because some C library files show up as though they were project files,
I think you might have used #include "..." instead of the correct #include
<...> at some places in the code.

-- It is not clear to me, what is complain(), a warning, that is, something
that will produce a compiled output, or an error, something that will abort
compilation?

-- I still had to use my stuff around exit():
void Exit(int status);
#define exit Exit
void Exit(int status) {
    done();  /* Was registred by atexit() */
    longjmp(main_env, (status =3D=3D 0)? INT_MAX : status);
}

A more clever way would have been to register another function with
atexit() which is doing a longjump, but that way I cannot pick up the
status that exit() gets as an argument.

-- File bison.s1:
  -- The arguments of the #line directives have been lost. I entered:
line 2:    #line 3 "bison.simple"
line 240:  #line 241 "bison.simple"=A8
line 614:  #line 615 "bison.simple"

  -- As before, I added to bison.simple:
#if __MWERKS__ && macintosh
#define YYSTACK_USE_ALLOCA
#include <alloca.h>
#include <stdlib.h>
#endif
before the first YYSTACK_USE_ALLOCA in that file. (And because of that my
#line numbers become different than if this stuff wasn't put in these
files.)

-- But after doing those changes, the rpcalc example from the bison docs
compiled as before.

-- I will pack down my altered sources and mail them to you so that you can
check the diff's (I do not have access to the program "diff" so this is the
only way).

I will have to fiddle around a bit more with the code in order to see that
it is all right.

  Hans Aberg




From haberg@matematik.su.se Thu Oct 05 04:45:29 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13h6ee-0002z1-00
	for <bug-bison@gnu.org>; Thu, 05 Oct 2000 04:45:28 -0400
Received: (qmail 23824 invoked from network); 5 Oct 2000 10:45:25 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by knatte.tninet.se with SMTP; 5 Oct 2000 10:45:25 +0200
Received: from  [195.100.226.138] (du138-226.ppp.su-anst.tninet.se [195.100.226.138])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 258120.735522.970garibaldi-s2
 ; Thu, 05 Oct 2000 10:45:22 +0200
X-Sender: haberg@pop.matematik.su.se (Unverified)
Message-Id: <v03110700b601ebe6bc78@[195.100.226.132]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Date: Thu, 5 Oct 2000 10:43:15 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Bison-1.28a Remove bug
Cc: Bison Bugs <bug-bison@gnu.org>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

I still have a problem with the temporaries not getting removed; recall I
use the ISO C remove(). The problem is that my implementation of remove()
requires files to be closed before getting removed.

The problem shows up in some types of errors, for example, in the case of
the the error "ill-formed rule: initial symbol not followed by colon" which
can be produced by inserting some garbage at the beginning of a line in the
grammar definition section, in which case the tmptabfile and the
tmpdefsfile are not removed.

Therefore, I inserted this patch in done(), even though a problem with it
is that these files may be closed twice, which I do not know whether it is
OK with ISO C:

#endif /* MSDOS || (_WIN32 && !__CYGWIN32__) */
#if __MWERKS__ && macintosh
  if (actfile && ! no_parser_flag)  remove(actfile);
  if (tmpattrsfile)  remove(tmpattrsfile);
  if (tmptabfile) {
    fclose(ftable);
    remove(tmptabfile);
  }
  if (tmpdefsfile) {
    fclose(fdefines);
    remove(tmpdefsfile);
  }
#endif
/* Don't call exit again, we're in atexit ().
  exit (complain_message_count ? 1 : 0); */
#endif /* not VMS, or __VMS_POSIX */

  Hans Aberg




From haberg@matematik.su.se Thu Oct 05 04:45:32 2000
Received: from musse.tninet.se ([195.100.94.12])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13h6eh-0002z7-00
	for <bug-bison@gnu.org>; Thu, 05 Oct 2000 04:45:31 -0400
Received: (qmail 15615 invoked from network); 5 Oct 2000 10:45:28 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by musse.tninet.se with SMTP; 5 Oct 2000 10:45:28 +0200
Received: from  [195.100.226.138] (du138-226.ppp.su-anst.tninet.se [195.100.226.138])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 702608.735526.970garibaldi-s2
 ; Thu, 05 Oct 2000 10:45:26 +0200
X-Sender: haberg@pop.matematik.su.se (Unverified)
Message-Id: <v03110701b601ecacead0@[195.100.226.132]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Date: Thu, 5 Oct 2000 10:37:20 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Bison-1.28a Skeleton file #line suggest
Cc: Bison Bugs <bug-bison@gnu.org>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

The skeleton file bison.s1 now has lines of the form "#line" only --
perhaps the idea is that the rest of the "#line" directive should be
supplied by "make".

It strikes me though that it would be better to allow one having lines with
%line
in the skeleton file, and Bison then supplies the complete
#line <line-number> "<file-name>"

-- The thing is, that with this construct, it is easier to treat the
skeleton file as just another source file; one can edit it after the Bison
sources have been compiled. (And not so difficult to implement either.)

  Hans Aberg




From akim@epita.fr Thu Oct 05 05:17:34 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13h79i-0003IT-00
	for <bug-bison@gnu.org>; Thu, 05 Oct 2000 05:17:34 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id LAA29407
	Thu, 5 Oct 2000 11:18:22 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13h76Y-000698-00; Thu, 05 Oct 2000 11:14:18 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13h76V-00009S-00; Thu, 05 Oct 2000 11:14:15 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: Bison Bugs <bug-bison@gnu.org>
Subject: Re: Bison-1.28a Remove bug
References: <v03110700b601ebe6bc78@[195.100.226.132]>
From: Akim Demaille <akim@epita.fr>
Date: 05 Oct 2000 11:14:15 +0200
In-Reply-To: Hans Aberg's message of "Thu, 5 Oct 2000 10:43:15 +0200"
Message-ID: <mv4hf6rps48.fsf@nostromo.lrde.epita.fr>
Lines: 15
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

Thanks for the proposal, but in this area bison is way too damaged to
keep on patching small chunks.  We need to completely redesign its
handling of temp files.

That's hot on my list.  Then we will make sure it works properly for
you.

There are several steps to complete.  The first one is to equip bison
with mkstemp and its portability machinery.  Then we must find a means
to isolate the specificities of the various system bison was ported
to.  For instance we should have a function get_tmpdir or something.
Then use only unlink, and install portability machinery for
unlink-less architectures.

In the process, my bet is that your issue will be solved.


From akim@epita.fr Thu Oct 05 05:17:55 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13h7A3-0003Ia-00
	for <bug-bison@gnu.org>; Thu, 05 Oct 2000 05:17:55 -0400
Received: from goa.lrde.epita.fr (goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id LAA29417
	Thu, 5 Oct 2000 11:18:23 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13h73Y-00068u-00; Thu, 05 Oct 2000 11:11:12 +0200
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13h72w-00008r-00; Thu, 05 Oct 2000 11:10:34 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: Bison Bugs <bug-bison@gnu.org>
Subject: Re: Bison-1.28a Skeleton file #line suggest
References: <v03110701b601ecacead0@[195.100.226.132]>
From: Akim Demaille <akim@epita.fr>
Date: 05 Oct 2000 11:10:34 +0200
In-Reply-To: Hans Aberg's message of "Thu, 5 Oct 2000 10:37:20 +0200"
Message-ID: <mv4lmw3psad.fsf@nostromo.lrde.epita.fr>
Lines: 34
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

>>>>> "Hans" == Hans Aberg <haberg@matematik.su.se> writes:

Hans> The skeleton file bison.s1 now has lines of the form "#line"
Hans> only -- perhaps the idea is that the rest of the "#line"
Hans> directive should be supplied by "make".

Right, see the conversion from bison.s1 to bison.simple in
src/Makefile.am:

bison.simple: bison.s1 Makefile
	sed -e "s/@bison_version@/$(VERSION)/" $(srcdir)/bison.s1 | \
	awk '\
	/^#line/ { printf "#line %d \"$(datadir)/bison.simple\"\n", NR+1; next }\
	{ print }' >$@t
	mv $@t $@

Hans> It strikes me though that it would be better to allow one having
Hans> lines with %line in the skeleton file, and Bison then supplies
Hans> the complete #line <line-number> "<file-name>"

Hm.  I don't know.  I mean, it's a good idea and patches are always
welcome.  But I think it is a good thing that the skeleton be signed
with the version of the distribution it's coming from (in order to be
able to check that there is no mismatch between bison(1) and
bison.simple).

But maybe I'm too paranoid.

Hans> -- The thing is, that with this construct, it is easier to treat
Hans> the skeleton file as just another source file; one can edit it
Hans> after the Bison sources have been compiled. (And not so
Hans> difficult to implement either.)

I agree.


From haberg@matematik.su.se Thu Oct 05 06:18:35 2000
Received: from musse.tninet.se ([195.100.94.12])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13h86k-0007ur-00
	for <bug-bison@gnu.org>; Thu, 05 Oct 2000 06:18:34 -0400
Received: (qmail 18741 invoked from network); 5 Oct 2000 12:18:30 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by musse.tninet.se with SMTP; 5 Oct 2000 12:18:30 +0200
Received: from  [195.100.226.140] (du142-226.ppp.su-anst.tninet.se [195.100.226.142])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 608843.741106.970garibaldi-s1
 ; Thu, 05 Oct 2000 12:18:26 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110700b601fe7b8ab2@[195.100.226.140]>
In-Reply-To: <mv4lmw3psad.fsf@nostromo.lrde.epita.fr>
References: Hans Aberg's message of "Thu, 5 Oct 2000 10:37:20 +0200"
 <v03110701b601ecacead0@[195.100.226.132]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Thu, 5 Oct 2000 12:18:15 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison-1.28a Skeleton file #line suggest
Cc: Bison Bugs <bug-bison@gnu.org>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 11.10 +0200 0-10-05, Akim Demaille wrote:
>Hm.  I don't know.  I mean, it's a good idea and patches are always
>welcome.  But I think it is a good thing that the skeleton be signed
>with the version of the distribution it's coming from (in order to be
>able to check that there is no mismatch between bison(1) and
>bison.simple).
>
>But maybe I'm too paranoid.

It's still easy to keep that check and issue an warning (or error) if the
file is not recognized. If somebody uses a skeleton file of their own,
there should then be the possibility to turn that warning (or error) off by
a special startup option. Or something.

One possibility could be that the skeleton file must have a directive
%version <version>
which tells which version of Bison it is tuned up to; if there is not an
agreement, Bison issues an error and stops. It's easy to edit that line in
the skeleton file if one is using one of one's own.

It depends on people wanting to make their own skeleton files or not, for
experimentation or whatever. Some platform depend stuff though should/must
be put in the skeleton file, though, so it's good having the possibility to
change it.

(Note that for example the Hasskell interpreter Hugs
http://haskell.org/hugs does not have such a version check for its Prelude.)

  Hans Aberg
                  * Email: Hans Aberg <mailto:haberg@member.ams.org>
                  * Home Page: <http://www.matematik.su.se/~haberg/>
                  * AMS member listing: <http://www.ams.org/cml/>




From haberg@matematik.su.se Thu Oct 05 06:18:36 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13h86m-0007uy-00
	for <bug-bison@gnu.org>; Thu, 05 Oct 2000 06:18:36 -0400
Received: (qmail 27770 invoked from network); 5 Oct 2000 12:18:34 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by knatte.tninet.se with SMTP; 5 Oct 2000 12:18:34 +0200
Received: from  [195.100.226.140] (du142-226.ppp.su-anst.tninet.se [195.100.226.142])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 851087.741111.970garibaldi-s1
 ; Thu, 05 Oct 2000 12:18:31 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110701b60200ed1df1@[195.100.226.140]>
In-Reply-To: <mv4hf6rps48.fsf@nostromo.lrde.epita.fr>
References: Hans Aberg's message of "Thu, 5 Oct 2000 10:43:15 +0200"
 <v03110700b601ebe6bc78@[195.100.226.132]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Thu, 5 Oct 2000 12:15:11 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison-1.28a Remove bug
Cc: Bison Bugs <bug-bison@gnu.org>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 11.14 +0200 0-10-05, Akim Demaille wrote:
>Thanks for the proposal, but in this area bison is way too damaged to
>keep on patching small chunks.  We need to completely redesign its
>handling of temp files.

I mentioned my stuff because I used the ISO C variation, and you seemed to
not use it.

>There are several steps to complete.  The first one is to equip bison
>with mkstemp and its portability machinery.  Then we must find a means
>to isolate the specificities of the various system bison was ported
>to.  For instance we should have a function get_tmpdir or something.
>Then use only unlink, and install portability machinery for
>unlink-less architectures.

Unlink is not ISO C, remove is. So it should be the other way around if ISO
C should be the point of departure, use remove() as a basis, and then
figure out which compilers do not have it. :-)

If you use a get_tmpdir, then you get into the stuff of what symbol is used
to separate directories "/", "\", or ":". Isn't people asking for this
directory only because Bison fails to cleanup the files? So perhaps it's
simpler to merely make sure those files are removed.

So why not register another function cleanup() with atexit(). Make sure to
remove the abort() from the code as it does call functions registered by
atexit(). For each file used also introduce a variable is_open telling if
it is open or not. Then simply
void cleanup(void) {
     ...
     if (file_p) {
         if (file_is_open)   fclose(file_p);
         remove(file_name);   -- or unlink.
     }

Then done() could concentrate on writing the tab file and such.

-- This is essentially just a translation of the cleanup done by a C++
automatic class object; cleanup() is the destructor of the program.


  Hans Aberg




From haberg@matematik.su.se Thu Oct 05 08:51:56 2000
Received: from angel.algonet.se ([194.213.74.112])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13hAV5-00016W-00
	for <bug-bison@gnu.org>; Thu, 05 Oct 2000 08:51:52 -0400
Received: (qmail 20144 invoked from network); 5 Oct 2000 14:51:45 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by angel.algonet.se with SMTP; 5 Oct 2000 14:51:45 +0200
Received: from  [195.100.226.141] (du141-226.ppp.su-anst.tninet.se [195.100.226.141])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 13944.750302.970garibaldi-s2
 ; Thu, 05 Oct 2000 14:51:42 +0200
X-Sender: haberg@pop.matematik.su.se (Unverified)
Message-Id: <v03110700b602254f32f5@[195.100.226.140]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Thu, 5 Oct 2000 14:50:26 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Bison as library & exit() 
Cc: Bison Bugs <bug-bison@gnu.org>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

I figured out a way to handle exit() when Bison is used as a library. There
are two problems to get around with as little effort as possible, namely to
pick up the exit status, and to make sure the functions registered by
atexit() are properly executed.

In a prefix file, read by all files, I have put
void Exit(int status);
#define exit Exit

Then, in the file where my real main (and not the bison_main) is, I have
#undef exit  /* Make sure the real exit is called in this file */
#include <stdlib.h>  /* contains real exit() */

int exit_status;
void exit_jump(void);

void Exit(int status) {
    exit_status = status;
    /* Make sure exit() calls exit() and not Exit() here: */
    exit(status);
}

void exit_jump(void) {
    longjmp(main_env, 1);
}

And the code of the real main() will be:

main(...) {
    ...
    atexit(exit_jump);
    if (setjmp(main_env) == 0)  bison_main(argc, argv);

  /* After an exit() one ends up here, with the exit code in exit_status. */
    ...
    return exit_status;
}

This relates somewhat to Bison, because one can have both cleanup() and
done() registered by atexit(), but waiting with registering done() until
one is sure it is really needed. Thus, before done() has been registered,
exit() will behave more like abort(), the latter which preferably should
not be used, as it fails to remove the temporary files.

Then, with my construction, it does not really matter how additional
functions are registered with atexit().

  Hans Aberg




From rms@santafe.edu Fri Oct 06 14:07:09 2000
Received: from pele.santafe.edu ([192.12.12.119])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13hbtk-0001Hx-00; Fri, 06 Oct 2000 14:07:08 -0400
Received: from wijiji.santafe.edu (wijiji [192.12.12.5])
	by pele.santafe.edu (8.9.1/8.9.1) with ESMTP id MAA15318;
	Fri, 6 Oct 2000 12:07:01 -0600 (MDT)
Received: (from rms@localhost)
	by wijiji.santafe.edu (8.9.3+Sun/8.9.1) id MAA02124;
	Fri, 6 Oct 2000 12:07:01 -0600 (MDT)
Date: Fri, 6 Oct 2000 12:07:01 -0600 (MDT)
Message-Id: <200010061807.MAA02124@wijiji.santafe.edu>
X-Authentication-Warning: wijiji.santafe.edu: rms set sender to rms@wijiji.santafe.edu using -f
From: Richard Stallman <rms@gnu.org>
To: haberg@matematik.su.se
CC: akim@epita.fr, bug-bison@gnu.org, help-bison@gnu.org
In-reply-to: <v03110700b6011120544f@[195.100.226.133]> (message from Hans
	Aberg on Wed, 4 Oct 2000 18:57:43 +0200)
Subject: Re: Bison's semantic parsers
Reply-to: rms@gnu.org
References:  <v03110700b6011120544f@[195.100.226.133]>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

    Does this mean that one should delete the code involving the semantic
    parser feature altogether? -- If nobody seems to know how to use it, and
    it's not needed for backwards compatibility, that seems to be the best
    thing.

I always felt it was better not to delete it, in case someone knew
how to use it.  But I don't have strong feelings about this.


From haberg@matematik.su.se Sat Oct 07 08:47:00 2000
Received: from musse.tninet.se ([195.100.94.12])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13htNT-0005jQ-00
	for <bug-bison@gnu.org>; Sat, 07 Oct 2000 08:46:59 -0400
Received: (qmail 13522 invoked from network); 7 Oct 2000 14:46:55 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by musse.tninet.se with SMTP; 7 Oct 2000 14:46:55 +0200
Received: from  [195.100.226.145] (du136-226.ppp.su-anst.tninet.se [195.100.226.136])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 609662.922812.970garibaldi-s2
 ; Sat, 07 Oct 2000 14:46:52 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110705b604ca4131e6@[195.100.226.145]>
In-Reply-To: <200010061807.MAA02124@wijiji.santafe.edu>
References: <v03110700b6011120544f@[195.100.226.133]> (message from Hans
 Aberg on Wed, 4 Oct 2000 18:57:43 +0200)
 <v03110700b6011120544f@[195.100.226.133]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Sat, 7 Oct 2000 14:44:45 +0200
To: rms@gnu.org
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison's semantic parsers
Cc: akim@epita.fr, bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 12.07 -0600 0-10-06, Richard Stallman wrote:
>    Does this mean that one should delete the code involving the semantic
>    parser feature altogether? -- If nobody seems to know how to use it, and
>    it's not needed for backwards compatibility, that seems to be the best
>    thing.
>
>I always felt it was better not to delete it, in case someone knew
>how to use it.  But I don't have strong feelings about this.

My suggestion is that you launch an investigation on how to use it, and
what a "semantic parse" is, and why one would want to use that, and with
that information in hand, make a decision of what to do with it.

  Hans Aberg




From haberg@matematik.su.se Sat Oct 07 09:27:14 2000
Received: from angel.algonet.se ([194.213.74.112])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13hu0P-00062p-00
	for <bug-bison@gnu.org>; Sat, 07 Oct 2000 09:27:13 -0400
Received: (qmail 29062 invoked from network); 7 Oct 2000 15:27:11 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by angel.algonet.se with SMTP; 7 Oct 2000 15:27:11 +0200
Received: from  [195.100.226.145] (du141-226.ppp.su-anst.tninet.se [195.100.226.141])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 585368.925229.970delenn-s0
 ; Sat, 07 Oct 2000 15:27:09 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110706b604d0018bec@[195.100.226.145]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Sat, 7 Oct 2000 15:25:33 +0200
To: rms@gnu.org
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison's semantic parsers
Cc: akim@epita.fr, bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

I made an Internet-search on "semantic parser", and I got the following:

-- Asks in 1992 what the semantic parser & guards feature of Bison is;
apparently no reply: http://compilers.iecc.com/comparch/article/92-09-202

-- A Spoken Natural Language Interface to the Intelligent Wheelchair:
http://www.cs.utexas.edu/users/speech/slides/index.htm
Apparently, semantic parsing here has something to do with extracting
semantic contextual information from the human spoken language.

-- |E| Semantic Parser: http://www.imagination-engines.com/text/semfs.htm
Also tries to extract semantic contextual information from the human spoken
language.

Perhaps the semantic parser in Bison has something to do with changing
parsing based on semantic contextual information. It would then perhaps be
an experiment with implementing attribute grammars, and other such context
dependent grammars. -- Just a wild guess. At least, this would explain why
it is "hairy". :-)

  Hans Aberg




From rms@santafe.edu Sat Oct 07 22:47:50 2000
Received: from pele.santafe.edu ([192.12.12.119])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13i6VC-0003Ut-00; Sat, 07 Oct 2000 22:47:50 -0400
Received: from wijiji.santafe.edu (wijiji [192.12.12.5])
	by pele.santafe.edu (8.9.1/8.9.1) with ESMTP id UAA08896;
	Sat, 7 Oct 2000 20:47:44 -0600 (MDT)
Received: (from rms@localhost)
	by wijiji.santafe.edu (8.9.3+Sun/8.9.1) id UAA03853;
	Sat, 7 Oct 2000 20:47:44 -0600 (MDT)
Date: Sat, 7 Oct 2000 20:47:44 -0600 (MDT)
Message-Id: <200010080247.UAA03853@wijiji.santafe.edu>
X-Authentication-Warning: wijiji.santafe.edu: rms set sender to rms@wijiji.santafe.edu using -f
From: Richard Stallman <rms@gnu.org>
To: haberg@matematik.su.se
CC: akim@epita.fr, bug-bison@gnu.org, help-bison@gnu.org
In-reply-to: <v03110705b604ca4131e6@[195.100.226.145]> (message from Hans
	Aberg on Sat, 7 Oct 2000 14:44:45 +0200)
Subject: Re: Bison's semantic parsers
Reply-to: rms@gnu.org
References: <v03110700b6011120544f@[195.100.226.133]> (message from Hans
 Aberg on Wed, 4 Oct 2000 18:57:43 +0200)
 <v03110700b6011120544f@[195.100.226.133]> <v03110705b604ca4131e6@[195.100.226.145]>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

    My suggestion is that you launch an investigation on how to use it, and
    what a "semantic parse" is, and why one would want to use that, and with
    that information in hand, make a decision of what to do with it.

Sorry, I don't have time to do that.


From haberg@matematik.su.se Sun Oct 08 09:36:57 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13iGdM-0005zx-00
	for <bug-bison@gnu.org>; Sun, 08 Oct 2000 09:36:56 -0400
Received: (qmail 14978 invoked from network); 8 Oct 2000 15:36:54 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by knatte.tninet.se with SMTP; 8 Oct 2000 15:36:54 +0200
Received: from  [195.100.226.128] (du128-226.ppp.su-anst.tninet.se [195.100.226.128])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 577473.12212.971garibaldi-s1
 ; Sun, 08 Oct 2000 15:36:52 +0200
X-Sender: haberg@pop.matematik.su.se (Unverified)
Message-Id: <v03110702b60622849936@[195.100.226.132]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Sun, 8 Oct 2000 15:35:31 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Bison C++ Syntax
Cc: Bison Bugs <bug-bison@gnu.org>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

I have a suggest for future Bison C++ user interface. I once wrote a parser
by hand, and developed the syntax in that context. I also just made a
working example with Bison compiled as C++ and the Flex C++ class it can
generate.

Then the use is like this (skipping namespace for now), when the parser is
a small calculator that reads a single line, and one wants to put it into a
REP (read-evaluate-print) loop:

int main() {
    Parser calculator; // Could have arguments.
    double d;

    while (cin) {
        try {
            std::cin >> calculator >> d; // Parser can be used as manipulator.
            std::cout << d << endl;
        }
        catch (Exit& ex) {   // Parser exits by throwing an Exit exception.
            std::cout << ex.what() << endl;
            return ex.status();
        }
    }

    return EXIT_SUCCESS;
}

The class Parse can also have various functions that allows the user to
manipulate it, for example Parser::reset(), and such functions.

I have found this manipulator syntax very efficient, because it is easy to
use; the user does not need to know much in order to get it up and working:

My example calculator exits by that one types "exit", and it does error
recovery, so it is rather self-contained. It would be easy to flip it into
any other standard program that wants to read a double, if one instead
wants to allow full arithmetical expressions in input. So it is extremely
easy to use this syntax in order to enhance already existing C++ programs
that are in the need of a more advanced parsed input.

  Hans Aberg




From haberg@matematik.su.se Sun Oct 08 10:26:05 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13iHOu-0006PN-00
	for <bug-bison@gnu.org>; Sun, 08 Oct 2000 10:26:05 -0400
Received: (qmail 10556 invoked from network); 8 Oct 2000 16:26:02 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by knatte.tninet.se with SMTP; 8 Oct 2000 16:26:02 +0200
Received: from  [195.100.226.128] (du136-226.ppp.su-anst.tninet.se [195.100.226.136])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 68436.15161.971delenn-s2
 ; Sun, 08 Oct 2000 16:26:01 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110706b6063072df3b@[195.100.226.128]>
In-Reply-To: <200010080247.UAA03853@wijiji.santafe.edu>
References: <v03110705b604ca4131e6@[195.100.226.145]> (message from Hans
 Aberg on Sat, 7 Oct 2000 14:44:45 +0200)
 <v03110700b6011120544f@[195.100.226.133]> (message from Hans Aberg on
 Wed, 4 Oct 2000 18:57:43 +0200) <v03110700b6011120544f@[195.100.226.133]>
 <v03110705b604ca4131e6@[195.100.226.145]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Sun, 8 Oct 2000 16:14:44 +0200
To: rms@gnu.org
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison's semantic parsers
Cc: akim@epita.fr, bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 20.47 -0600 0-10-07, Richard Stallman wrote:
>    My suggestion is that you launch an investigation on how to use it, and
>    what a "semantic parse" is, and why one would want to use that, and with
>    that information in hand, make a decision of what to do with it.
>
>Sorry, I don't have time to do that.

Well, it seems that nobody, for the last decade at least, has known what it
is good for, so perhaps its place is in a museum. :-)

I think though that this code once upon the time was written by a human, so
that person who wrote it, if he still is alive, ought to know what it is
good for.

  Hans Aberg




From haberg@matematik.su.se Sun Oct 08 10:26:07 2000
Received: from angel.algonet.se ([194.213.74.112])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13iHOx-0006Pb-00
	for <bug-bison@gnu.org>; Sun, 08 Oct 2000 10:26:07 -0400
Received: (qmail 27386 invoked from network); 8 Oct 2000 16:26:05 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by angel.algonet.se with SMTP; 8 Oct 2000 16:26:05 +0200
Received: from  [195.100.226.128] (du136-226.ppp.su-anst.tninet.se [195.100.226.136])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 158552.15163.971delenn-s2
 ; Sun, 08 Oct 2000 16:26:03 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110707b606333384b3@[195.100.226.128]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Sun, 8 Oct 2000 16:22:43 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Bison C++ Temporaries
Cc: Bison Bugs <bug-bison@gnu.org>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

About those temporary files which are so difficult to get deleted: They
seem to not occupy much memory by todays standards. Would it not be better
putting what is in them onto the heap?

  Hans Aberg




From rms@santafe.edu Mon Oct 09 11:18:33 2000
Received: from pele.santafe.edu ([192.12.12.119])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13iehE-0001aE-00; Mon, 09 Oct 2000 11:18:32 -0400
Received: from wijiji.santafe.edu (wijiji [192.12.12.5])
	by pele.santafe.edu (8.9.1/8.9.1) with ESMTP id JAA25010;
	Mon, 9 Oct 2000 09:18:15 -0600 (MDT)
Received: (from rms@localhost)
	by wijiji.santafe.edu (8.9.3+Sun/8.9.1) id JAA05689;
	Mon, 9 Oct 2000 09:18:15 -0600 (MDT)
Date: Mon, 9 Oct 2000 09:18:15 -0600 (MDT)
Message-Id: <200010091518.JAA05689@wijiji.santafe.edu>
X-Authentication-Warning: wijiji.santafe.edu: rms set sender to rms@wijiji.santafe.edu using -f
From: Richard Stallman <rms@gnu.org>
To: haberg@matematik.su.se
CC: akim@epita.fr, bug-bison@gnu.org, help-bison@gnu.org
In-reply-to: <v03110706b6063072df3b@[195.100.226.128]> (message from Hans
	Aberg on Sun, 8 Oct 2000 16:14:44 +0200)
Subject: Re: Bison's semantic parsers
Reply-to: rms@gnu.org
References: <v03110705b604ca4131e6@[195.100.226.145]> (message from Hans
 Aberg on Sat, 7 Oct 2000 14:44:45 +0200)
 <v03110700b6011120544f@[195.100.226.133]> (message from Hans Aberg on
 Wed, 4 Oct 2000 18:57:43 +0200) <v03110700b6011120544f@[195.100.226.133]>
 <v03110705b604ca4131e6@[195.100.226.145]> <v03110706b6063072df3b@[195.100.226.128]>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

Bob Corbett's thesis from Berkeley should say something about this.


From akim@epita.fr Tue Oct 10 05:26:05 2000
Received: from hermes.epita.fr ([194.98.116.10])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13ivfg-0001CR-00; Tue, 10 Oct 2000 05:26:04 -0400
Received: from goa.lrde.epita.fr (mail@goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id LAA10034
	Tue, 10 Oct 2000 11:26:46 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13ixgd-00027p-00; Tue, 10 Oct 2000 11:35:11 +0000
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13ivod-0000ej-00; Tue, 10 Oct 2000 11:35:19 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: rms@gnu.org, bug-bison@gnu.org, help-bison@gnu.org
Subject: Re: Bison's semantic parsers
References: <v03110706b604d0018bec@[195.100.226.145]>
From: Akim Demaille <akim@epita.fr>
Date: 10 Oct 2000 11:35:19 +0200
In-Reply-To: Hans Aberg's message of "Sat, 7 Oct 2000 15:25:33 +0200"
Message-ID: <mv41yxpjay0.fsf@nostromo.lrde.epita.fr>
Lines: 39
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

| I made an Internet-search on "semantic parser", and I got the following:
| -- Asks in 1992 what the semantic parser & guards feature of Bison is;
| apparently no reply: http://compilers.iecc.com/comparch/article/92-09-202
| 
| -- A Spoken Natural Language Interface to the Intelligent Wheelchair:
| http://www.cs.utexas.edu/users/speech/slides/index.htm
| Apparently, semantic parsing here has something to do with extracting
| semantic contextual information from the human spoken language.
| 
| -- |E| Semantic Parser: http://www.imagination-engines.com/text/semfs.htm
| Also tries to extract semantic contextual information from the human spoken
| language.

We saw the same URLs :)

| Perhaps the semantic parser in Bison has something to do with changing
| parsing based on semantic contextual information. 

Yep, I think so too.  In addition the name ``guards'' which is used
with the semantic parser seem to be related to the same ideas.

| It would then perhaps be
| an experiment with implementing attribute grammars, and other such context
| dependent grammars. -- Just a wild guess. At least, this would explain why
| it is "hairy". :-)

Actually I never understood what drove to these names: hairy is
definitely simpler to read that simple, and simple is much more hairy
that hairy, imho.

There is a URL you didn't list: the PhD from Corbett.  I have not read
it yet because... it's in bitmap format! (While it clearly was written
in TeX).  Someday I'll download it (you have to do that page per
page!!!) and read it, there is certainly much information in there.

http://sunsite.berkeley.edu/Dienst/UI/2.0/Describe/ncstrl.ucb/CSD-85-251

Akim


From akim@epita.fr Tue Oct 10 05:41:49 2000
Received: from hermes.epita.fr ([194.98.116.10])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13ivuv-0001RW-00
	for <bug-bison@gnu.org>; Tue, 10 Oct 2000 05:41:49 -0400
Received: from goa.lrde.epita.fr (mail@goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id LAA11383
	Tue, 10 Oct 2000 11:42:40 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13ixw1-0002Ae-00; Tue, 10 Oct 2000 11:51:05 +0000
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13iw44-0000hn-00; Tue, 10 Oct 2000 11:51:16 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: Bison Bugs <bug-bison@gnu.org>
Subject: Re: Bison C++ Temporaries
References: <v03110707b606333384b3@[195.100.226.128]>
From: Akim Demaille <akim@epita.fr>
Date: 10 Oct 2000 11:51:15 +0200
In-Reply-To: Hans Aberg's message of "Sun, 8 Oct 2000 16:22:43 +0200"
Message-ID: <mv4snq5hvn0.fsf@nostromo.lrde.epita.fr>
Lines: 12
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

>>>>> "Hans" == Hans Aberg <haberg@matematik.su.se> writes:

Hans> About those temporary files which are so difficult to get
Hans> deleted: They seem to not occupy much memory by todays
Hans> standards. Would it not be better putting what is in them onto
Hans> the heap?

That's a good idea.  I'm going to check how and when these files are
used, and we'll talk about this later.

BTW, Hans, did you sign any paper for contributions for Bison?  I can
feel some day we might need you to.


From haberg@matematik.su.se Tue Oct 10 07:31:45 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13ixdI-0006nV-00
	for <bug-bison@gnu.org>; Tue, 10 Oct 2000 07:31:45 -0400
Received: (qmail 213 invoked from network); 10 Oct 2000 13:31:37 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by knatte.tninet.se with SMTP; 10 Oct 2000 13:31:37 +0200
Received: from  [195.100.226.147] (du130-226.ppp.su-anst.tninet.se [195.100.226.130])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 196170.177493.971garibaldi-s2
 ; Tue, 10 Oct 2000 13:31:33 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110701b608a3798fbe@[195.100.226.147]>
In-Reply-To: <mv4snq5hvn0.fsf@nostromo.lrde.epita.fr>
References: Hans Aberg's message of "Sun, 8 Oct 2000 16:22:43 +0200"
 <v03110707b606333384b3@[195.100.226.128]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Tue, 10 Oct 2000 12:51:25 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison C++ Temporaries
Cc: Bison Bugs <bug-bison@gnu.org>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 11.51 +0200 0-10-10, Akim Demaille wrote:
>BTW, Hans, did you sign any paper for contributions for Bison?  I can
>feel some day we might need you to.

I do not know what this means: If you are free to use code I have written,
or might write, that is not a problem. I really don't know whatever I will
contribute at this point. :-)

I might sign up for the Bison lists though, even though I have not yet
figured out how.

  Hans Aberg




From haberg@matematik.su.se Tue Oct 10 07:31:47 2000
Received: from musse.tninet.se ([195.100.94.12])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13ixdK-0006nW-00
	for <bug-bison@gnu.org>; Tue, 10 Oct 2000 07:31:46 -0400
Received: (qmail 3975 invoked from network); 10 Oct 2000 13:31:43 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by musse.tninet.se with SMTP; 10 Oct 2000 13:31:43 +0200
Received: from  [195.100.226.147] (du130-226.ppp.su-anst.tninet.se [195.100.226.130])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 744914.177497.971garibaldi-s2
 ; Tue, 10 Oct 2000 13:31:37 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110702b608a4ede719@[195.100.226.147]>
In-Reply-To: <mv41yxpjay0.fsf@nostromo.lrde.epita.fr>
References: Hans Aberg's message of "Sat, 7 Oct 2000 15:25:33 +0200"
 <v03110706b604d0018bec@[195.100.226.145]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Tue, 10 Oct 2000 12:59:28 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison's semantic parsers
Cc: rms@gnu.org, bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 11.35 +0200 0-10-10, Akim Demaille wrote:
>Actually I never understood what drove to these names: hairy is
>definitely simpler to read that simple, and simple is much more hairy
>that hairy, imho.

I think that simple perhaps become hairy becuase of that dynamic allocation
stuff and the like. Isn't it time to switch to C++ when writing Bison? What
about GCC, does it still have problems with STL and such?

>There is a URL you didn't list: the PhD from Corbett.  I have not read
>it yet because... it's in bitmap format! (While it clearly was written
>in TeX).  Someday I'll download it (you have to do that page per
>page!!!) and read it, there is certainly much information in there.
>
>http://sunsite.berkeley.edu/Dienst/UI/2.0/Describe/ncstrl.ucb/CSD-85-251

Thank you, I tried to look for it but could not find it. Bit maps and
taking it down in pieces sound strange. Perhaps one take it down via some
script and pack it down as a tgz.

  Hans Aberg




From akim@epita.fr Tue Oct 10 07:58:02 2000
Received: from hermes.epita.fr ([194.98.116.10])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13iy2j-0007A5-00; Tue, 10 Oct 2000 07:58:02 -0400
Received: from goa.lrde.epita.fr (mail@goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id NAA22010
	Tue, 10 Oct 2000 13:58:47 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13j03k-0002fn-00; Tue, 10 Oct 2000 14:07:12 +0000
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13iyBo-0001AL-00; Tue, 10 Oct 2000 14:07:24 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: rms@gnu.org, bug-bison@gnu.org, help-bison@gnu.org
Subject: Re: Bison's semantic parsers
References: <v03110706b604d0018bec@[195.100.226.145]>
	<v03110702b608a4ede719@[195.100.226.147]>
From: Akim Demaille <akim@epita.fr>
Date: 10 Oct 2000 14:07:24 +0200
In-Reply-To: Hans Aberg's message of "Tue, 10 Oct 2000 12:59:28 +0200"
Message-ID: <mv4lmvwhpc3.fsf@nostromo.lrde.epita.fr>
Lines: 22
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

>>>>> "Hans" == Hans Aberg <haberg@matematik.su.se> writes:

Hans> I think that simple perhaps become hairy becuase of that dynamic
Hans> allocation stuff and the like. Isn't it time to switch to C++
Hans> when writing Bison? 

I think this is incompatible with the policy of the FSF which promotes
C.  Richard, what would you say?

Anyway, Bison is still a small project, I don't think we'd win
anything using C++.


>> http://sunsite.berkeley.edu/Dienst/UI/2.0/Describe/ncstrl.ucb/CSD-85-251

Hans> Thank you, I tried to look for it but could not find it. Bit
Hans> maps and taking it down in pieces sound strange. Perhaps one
Hans> take it down via some script and pack it down as a tgz.

-rw-r--r--    1 akim     lrde      6727320 oct 10 14:05 Corbett.tz2

        http://www.lrde.epita.fr/people/akim/download/Corbett.tz2


From haberg@matematik.su.se Tue Oct 10 13:28:43 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13j3Cl-0002i7-00
	for <bug-bison@gnu.org>; Tue, 10 Oct 2000 13:28:43 -0400
Received: (qmail 7361 invoked from network); 10 Oct 2000 19:28:37 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by knatte.tninet.se with SMTP; 10 Oct 2000 19:28:37 +0200
Received: from  [195.100.226.155] (du167-226.ppp.su-anst.tninet.se [195.100.226.167])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 381448.198897.971garibaldi-s1
 ; Tue, 10 Oct 2000 19:28:17 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110703b608fc827aa9@[195.100.226.155]>
In-Reply-To: <mv4lmvwhpc3.fsf@nostromo.lrde.epita.fr>
References: Hans Aberg's message of "Tue, 10 Oct 2000 12:59:28 +0200"
 <v03110706b604d0018bec@[195.100.226.145]>
 <v03110702b608a4ede719@[195.100.226.147]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Tue, 10 Oct 2000 19:27:49 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison's semantic parsers
Cc: rms@gnu.org, bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 14.07 +0200 0-10-10, Akim Demaille wrote:
>I think this is incompatible with the policy of the FSF which promotes
>C.  Richard, what would you say?

I do not think there is any reason of promoting C over C++ anymore, as C++
compilers have gome a long way, and do not have the problems a few years
ago.

>Anyway, Bison is still a small project, I don't think we'd win
>anything using C++.

>From the general point of view, one can program faster and more secure with
C++ even when dealing with more low level programming or simple
programming, such as in Bison. To mention such a simple feature that ease
up a lot is the C++ string class, in the standard library. In order to
avoid too much overhead when adding new characters one-by-one to a string,
one can say allocate only at sizes 2^n. -- Just as an example of what
features the user need not worry about.

There is one snag though when programming with C++, and that is that C code
can normally not call C++ functions, only vice versa. Thus, if say Bison
uses C++, it can perhaps not be used as a plugin or DLL, if the programming
calling it is written in C.

One other problem with C++, but probably not in the case of Bison, is that
it is extremely difficult to implement a conservative GC -- there is simply
no convenient way of finding the root set with in C++ proper. (The Hans
Boehm GC goes into the layer between C++ and the OS and does a root search
there, but this method is both OS dependent and not very efficient.) And
there is no support for threading and distributed programming, and it
difficult to implement functional programming unboxed elements in
combination with multiple inheritance, and some other such problems.

>        http://www.lrde.epita.fr/people/akim/download/Corbett.tz2

I will try to pick it down. Please note though that it is important to keep
the name extensions right, because those are used for correct file
conversion and action. For example, .tgz will be saved as a tgz, whereas a
tz2 will be open by an editor, which may then bomb...


  Hans Aberg




From akim@epita.fr Tue Oct 10 13:43:55 2000
Received: from hermes.epita.fr ([194.98.116.10])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13j3RS-0002zt-00; Tue, 10 Oct 2000 13:43:54 -0400
Received: from goa.lrde.epita.fr (mail@goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id TAA27427
	Tue, 10 Oct 2000 19:44:43 GMT
Received: from nostromo.lrde.epita.fr ([10.223.13.52] ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13j5SZ-0003n9-00; Tue, 10 Oct 2000 19:53:11 +0000
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13j3ae-0001pn-00; Tue, 10 Oct 2000 19:53:24 +0200
To: Hans Aberg <haberg@matematik.su.se>
Cc: rms@gnu.org, bug-bison@gnu.org, help-bison@gnu.org
Subject: Re: Bison's semantic parsers
References: <v03110706b604d0018bec@[195.100.226.145]>
	<v03110702b608a4ede719@[195.100.226.147]>
	<v03110703b608fc827aa9@[195.100.226.155]>
From: Akim Demaille <akim@epita.fr>
Date: 10 Oct 2000 19:53:23 +0200
In-Reply-To: Hans Aberg's message of "Tue, 10 Oct 2000 19:27:49 +0200"
Message-ID: <mv4em1oeg6k.fsf@nostromo.lrde.epita.fr>
Lines: 53
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

>>>>> "Hans" == Hans Aberg <haberg@matematik.su.se> writes:

Hans> At 14.07 +0200 0-10-10, Akim Demaille wrote:
>> I think this is incompatible with the policy of the FSF which
>> promotes C.  Richard, what would you say?

Hans> I do not think there is any reason of promoting C over C++
Hans> anymore, as C++ compilers have gome a long way, and do not have
Hans> the problems a few years ago.

First, I'd like to fix my sentence, I apologize for its content: what
I really meant is that ``free software people'' in general tend to
stick to C.  I have no knowledge about the FSF promoting or
criticizing C++.  I'm sorry I wrote ``FSF''.


Hans> C++ even when dealing with more low level programming or simple
Hans> programming, such as in Bison. To mention such a simple feature
Hans> that ease up a lot is the C++ string class, in the standard
Hans> library. In order to avoid too much overhead when adding new
Hans> characters one-by-one to a string, one can say allocate only at
Hans> sizes 2^n. -- Just as an example of what features the user need
Hans> not worry about.

I plan to equip Bison with obstacks which are some kind of
equivalent.  Surely string is more pleasant.  But I'm not sure we
should use C++ for Bison.  But why not.  If Richard agrees, we could
do that.  But *not* the next release.


>> http://www.lrde.epita.fr/people/akim/download/Corbett.tz2

Hans> I will try to pick it down. 

I've added two other files:

http://www.lrde.epita.fr/people/akim/download/corbett-phd.ps.bz2 14M

which contains all the tiffs in a single PS file, and the following
one for lucky owners of Duplex printers: send it as is to the printer,
and it will print it as a booklet (i.e., cut in the middle of the
stack, then bind).

http://www.lrde.epita.fr/people/akim/download/ corbett-phd-booklet-duplex.ps.bz2 14M

Hans> Please note though that it is important to keep the name
Hans> extensions right, because those are used for correct file
Hans> conversion and action. For example, .tgz will be saved as a tgz,
Hans> whereas a tz2 will be open by an editor, which may then bomb...

tz2 stands for tar.bz2.  Option `I' in GNU Tar.

        Akim


From haberg@matematik.su.se Tue Oct 10 14:22:14 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13j42Y-0003S9-00
	for <bug-bison@gnu.org>; Tue, 10 Oct 2000 14:22:14 -0400
Received: (qmail 14185 invoked from network); 10 Oct 2000 20:22:11 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by knatte.tninet.se with SMTP; 10 Oct 2000 20:22:11 +0200
Received: from  [195.100.226.155] (du169-226.ppp.su-anst.tninet.se [195.100.226.169])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 502467.202129.971delenn-s2
 ; Tue, 10 Oct 2000 20:22:09 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110705b6090a0aa92d@[195.100.226.155]>
In-Reply-To: <mv4em1oeg6k.fsf@nostromo.lrde.epita.fr>
References: Hans Aberg's message of "Tue, 10 Oct 2000 19:27:49 +0200"
 <v03110706b604d0018bec@[195.100.226.145]>
 <v03110702b608a4ede719@[195.100.226.147]>
 <v03110703b608fc827aa9@[195.100.226.155]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Tue, 10 Oct 2000 20:18:50 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison's semantic parsers
Cc: rms@gnu.org, bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 19.53 +0200 0-10-10, Akim Demaille wrote:
>I really meant is that ``free software people'' in general tend to
>stick to C.  I have no knowledge about the FSF promoting or
>criticizing C++.  I'm sorry I wrote ``FSF''.

One reason to not use C++ is that it might screw up the software for use in
other C-programs.

>I plan to equip Bison with obstacks which are some kind of
>equivalent.  Surely string is more pleasant.  But I'm not sure we
>should use C++ for Bison.  But why not.  If Richard agrees, we could
>do that.  But *not* the next release.

So it gather it requires some thinking, to be put onto the future.

>>> http://www.lrde.epita.fr/people/akim/download/Corbett.tz2
...
>I've added two other files:
>
>http://www.lrde.epita.fr/people/akim/download/corbett-phd.ps.bz2 14M
>
>which contains all the tiffs in a single PS file, and the following
>one for lucky owners of Duplex printers: send it as is to the printer,
>and it will print it as a booklet (i.e., cut in the middle of the
>stack, then bind).
>
>http://www.lrde.epita.fr/people/akim/download/
>corbett-phd-booklet-duplex.ps.bz2 14M
..
>tz2 stands for tar.bz2.  Option `I' in GNU Tar.

Sorry, my MacOS software does not handle bz2, only tar, bar, gz, Z and such
more traditional stuff -- and because of lack of hard disk space, I had to
throw out my Mach2.5/4.4BSD, so I do no have the gnu tar either. And the
other files (14 MB) are getting too big to be picked down with a 56 KB
modem.

-- I wrote the Berkely dept, asking about available in other formats.
Pix-maps is both strange and silly. Let's see what they can come up with.

  Hans Aberg




From rms@santafe.edu Wed Oct 11 04:47:57 2000
Received: from pele.santafe.edu ([192.12.12.119])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13jHYL-00015K-00; Wed, 11 Oct 2000 04:47:57 -0400
Received: from wijiji.santafe.edu (wijiji [192.12.12.5])
	by pele.santafe.edu (8.9.1/8.9.1) with ESMTP id CAA20608;
	Wed, 11 Oct 2000 02:47:53 -0600 (MDT)
Received: (from rms@localhost)
	by wijiji.santafe.edu (8.9.3+Sun/8.9.1) id CAA07802;
	Wed, 11 Oct 2000 02:47:53 -0600 (MDT)
Date: Wed, 11 Oct 2000 02:47:53 -0600 (MDT)
Message-Id: <200010110847.CAA07802@wijiji.santafe.edu>
X-Authentication-Warning: wijiji.santafe.edu: rms set sender to rms@wijiji.santafe.edu using -f
From: Richard Stallman <rms@gnu.org>
To: akim@epita.fr
CC: haberg@matematik.su.se, bug-bison@gnu.org, help-bison@gnu.org
In-reply-to: <mv41yxpjay0.fsf@nostromo.lrde.epita.fr> (message from Akim
	Demaille on 10 Oct 2000 11:35:19 +0200)
Subject: Re: Bison's semantic parsers
Reply-to: rms@gnu.org
References: <v03110706b604d0018bec@[195.100.226.145]> <mv41yxpjay0.fsf@nostromo.lrde.epita.fr>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

The simple parser does a simpler kind of parsing.
The hairy parser has hairier features.



From rms@santafe.edu Wed Oct 11 04:53:14 2000
Received: from pele.santafe.edu ([192.12.12.119])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13jHdR-00019A-00; Wed, 11 Oct 2000 04:53:14 -0400
Received: from wijiji.santafe.edu (wijiji [192.12.12.5])
	by pele.santafe.edu (8.9.1/8.9.1) with ESMTP id CAA20635;
	Wed, 11 Oct 2000 02:48:03 -0600 (MDT)
Received: (from rms@localhost)
	by wijiji.santafe.edu (8.9.3+Sun/8.9.1) id CAA07817;
	Wed, 11 Oct 2000 02:48:03 -0600 (MDT)
Date: Wed, 11 Oct 2000 02:48:03 -0600 (MDT)
Message-Id: <200010110848.CAA07817@wijiji.santafe.edu>
X-Authentication-Warning: wijiji.santafe.edu: rms set sender to rms@wijiji.santafe.edu using -f
From: Richard Stallman <rms@gnu.org>
To: haberg@matematik.su.se
CC: akim@epita.fr, bug-bison@gnu.org, help-bison@gnu.org
In-reply-to: <v03110702b608a4ede719@[195.100.226.147]> (message from Hans
	Aberg on Tue, 10 Oct 2000 12:59:28 +0200)
Subject: Re: Bison's semantic parsers
Reply-to: rms@gnu.org
References: Hans Aberg's message of "Sat, 7 Oct 2000 15:25:33 +0200"
 <v03110706b604d0018bec@[195.100.226.145]> <v03110702b608a4ede719@[195.100.226.147]>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

    Isn't it time to switch to C++ when writing Bison? 

There will never be such a time.  The use of C++ is accepted but
discouraged in the GNU Project.  It is better to use C.


From haberg@matematik.su.se Wed Oct 11 08:36:55 2000
Received: from hromeo.algonet.se ([194.213.74.51])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13jL7v-0007Uf-00
	for <bug-bison@gnu.org>; Wed, 11 Oct 2000 08:36:55 -0400
Received: (qmail 26309 invoked from network); 11 Oct 2000 14:36:39 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by hromeo.algonet.se with SMTP; 11 Oct 2000 14:36:39 +0200
Received: from  [195.100.226.140] (du140-226.ppp.su-anst.tninet.se [195.100.226.140])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 760574.267795.971delenn-s1
 ; Wed, 11 Oct 2000 14:36:35 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110701b60a0d4ee36e@[195.100.226.157]>
In-Reply-To: <200010110848.CAA07817@wijiji.santafe.edu>
References: <v03110702b608a4ede719@[195.100.226.147]> (message from Hans
 Aberg on Tue, 10 Oct 2000 12:59:28 +0200) Hans Aberg's message of "Sat, 7
 Oct 2000 15:25:33 +0200" <v03110706b604d0018bec@[195.100.226.145]>
 <v03110702b608a4ede719@[195.100.226.147]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Wed, 11 Oct 2000 14:34:28 +0200
To: rms@gnu.org
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison's semantic parsers
Cc: akim@epita.fr, bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 02.48 -0600 0-10-11, Richard Stallman wrote:
>    Isn't it time to switch to C++ when writing Bison?
>
>There will never be such a time.  The use of C++ is accepted but
>discouraged in the GNU Project.  It is better to use C.

I think you ought to come up with some kind of motivation here: All
langugaes have their cons and pros. As far as C is concerned, it is too low
level for me to spend much time with it. C++ augments this to some extent,
but have other shortcomings, lacking features available in Objective C,
Java, and portable assembler languages. And there is the question on how to
call a C++ program from a program written in another language.

  Hans Aberg




From P.Buciak@elka.pw.edu.pl Wed Oct 11 12:31:29 2000
Received: from elektron.elka.pw.edu.pl ([194.29.160.2])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13jOmu-0004lE-00
	for <bug-bison@gnu.org>; Wed, 11 Oct 2000 12:31:29 -0400
Received: from elektron.elka.pw.edu.pl ([194.29.160.2]:49329 "EHLO
        elektron.elka.pw.edu.pl") by elektron.elka.pw.edu.pl with ESMTP
	id <S226408AbQJKQ34>; Wed, 11 Oct 2000 18:29:56 +0200
Date:   Wed, 11 Oct 2000 18:29:45 +0200 (MET DST)
From:   Piotr Buciak <P.Buciak@elka.pw.edu.pl>
To:     bug-bison@gnu.org
Subject: bug in raw mode
Message-ID: <Pine.SOL.4.21.0010111820390.16340-100000@elektron.elka.pw.edu.pl>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

Hello

I found a bug, when compiling test project with bison ver. 1.28 under
Linux.
The problem is that when I turned on a raw mode (either by %raw
declaration or by -r command line option) the yytranslate[] table was
generated incorrectly. In fact it was generated in the way if the raw mode
was off. When I altered the table manually it worked OK. In the following
case I changed: yytranslate[3]=3 and yytranslate[257]=2. 

I provide you with following files:
x.y - bison input file
x - a shell script I used to compile
input.txt - input data file

Best regards

Piotr Buciak



From P.Buciak@elka.pw.edu.pl Wed Oct 11 12:35:23 2000
Received: from elektron.elka.pw.edu.pl ([194.29.160.2])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13jOqh-0004o2-00
	for <bug-bison@gnu.org>; Wed, 11 Oct 2000 12:35:23 -0400
Received: from elektron.elka.pw.edu.pl ([194.29.160.2]:49804 "EHLO
        elektron.elka.pw.edu.pl") by elektron.elka.pw.edu.pl with ESMTP
	id <S226209AbQJKQfN>; Wed, 11 Oct 2000 18:35:13 +0200
Date:   Wed, 11 Oct 2000 18:35:03 +0200 (MET DST)
From:   Piotr Buciak <P.Buciak@elka.pw.edu.pl>
To:     bug-bison@gnu.org
Subject: The files for previous message
Message-ID: <Pine.SOL.4.21.0010111831340.16340-400000@elektron.elka.pw.edu.pl>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-851401618-971282103=:16340"
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-851401618-971282103=:16340
Content-Type: TEXT/PLAIN; charset=US-ASCII

Sorry, a minute ago I sent a message and forgot to attch files.
I attach them now.

Regards

Piotr Buciak

---559023410-851401618-971282103=:16340
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=x
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SOL.4.21.0010111835030.16340@elektron.elka.pw.edu.pl>
Content-Description: compile script file
Content-Disposition: attachment; filename=x

Ymlzb24gLWQgLXYgeC55DQpnY2MgeC50YWIuYyAtTzIgLWZjYWxsZXItc2F2
ZXMgLWZvbWl0LWZyYW1lLXBvaW50ZXIgLWZyZWctc3RydWN0LXJldHVybiAt
V2wsLXMgLVdhbGw=
---559023410-851401618-971282103=:16340
Content-Type: TEXT/plain; name="input.txt"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SOL.4.21.0010111835031.16340@elektron.elka.pw.edu.pl>
Content-Description: input data for generated parser file
Content-Disposition: attachment; filename="input.txt"

IzI1ICsgIy05ICsgIzE3ICsgIzE5MCAtICMzMiArICMzNCAtICM4OTIzICsj
NTY5MjM3NiAtICMtMzQ4MjM5
---559023410-851401618-971282103=:16340
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="x.y"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SOL.4.21.0010111835032.16340@elektron.elka.pw.edu.pl>
Content-Description: input bison file
Content-Disposition: attachment; filename="x.y"

JXsNCi8qIEMgREVDTEFSQVRJT05TICovDQojaW5jbHVkZSA8c3RkaW8uaD4N
CiNpbmNsdWRlIDxzdGRsaWIuaD4NCnZvaWQgeXllcnJvciggY2hhciAqcyk7
DQppbnQgeXlsZXgoKTsNCiNkZWZpbmUgWVlERUJVRyAxDQojZGVmaW5lIFlZ
RVJST1JfVkVSQk9TRSAxDQojZGVmaW5lIFlZSU5JVERFUFRIIDIwDQolfQ0K
DQovKiBCSVNPTiBERUNMQVJBVElPTlMgKi8NCiVyYXcNCiV0b2tlbiBOVU0N
Cg0KJSUNCi8qIEdSQU1NQVIgUlVMRVMgKi8NCkE6IAlOVU0JCXsgcHJpbnRm
KCIlZFxuIiwkJCk7IH0NCgl8IEEgJysnIE5VTSB7ICQkID0gJDEgKyAkMzsg
cHJpbnRmKCIlZFxuIiwkJCk7IH0NCgl8IEEgJy0nIE5VTSB7ICQkID0gJDEg
LSAkMzsgcHJpbnRmKCIlZFxuIiwkJCk7IH07DQoNCiUlDQovKiBBRERJVElP
TkFMIEMgQ09ERSAqLw0KRklMRSogaW5wdXRfZmlsZTsNCg0KaW50IHl5bGV4
KCkNCnsJaW50IGM7DQp5eWxleDE6DQogICAgc3dpdGNoKCBjPWdldGMoaW5w
dXRfZmlsZSkpDQogICAgewljYXNlIEVPRjogcHJpbnRmKCJlbmQgb2YgZmls
ZVxuIik7DQoJCSAgICByZXR1cm4gMDsNCgljYXNlICcrJzogcHJpbnRmKCIr
IHJldHVybmVkXG4iKTsNCgkJICAgIHJldHVybiAnKyc7DQoJY2FzZSAnLSc6
IHByaW50ZigiLSByZXR1cm5lZFxuIik7DQoJCSAgICByZXR1cm4gJy0nOw0K
CWNhc2UgJyMnOiAgIHsJZnNjYW5mKGlucHV0X2ZpbGUsIiVkIiwmeXlsdmFs
KTsNCgkJCXByaW50ZigiJWQgcmV0dXJuZWRcbiIseXlsdmFsKTsNCgkJCXJl
dHVybiBOVU07DQoJCSAgICB9DQoJZGVmYXVsdDogYnJlYWs7DQogICAgfQ0K
ICAgIGdvdG8geXlsZXgxOw0KfQ0KDQppbnQgbWFpbigpDQp7DQojaWYgWVlE
RUJVRyAhPSAwDQogICAgeXlkZWJ1ZyA9IC0xOw0KI2VuZGlmDQogICAgaWYo
IChpbnB1dF9maWxlPWZvcGVuKCJpbnB1dC50eHQiLCJyIikpID09IE5VTEwp
DQoJe3ByaW50Zigib3BlbmluZyBmaWxlIGVycm9yXG4iKTsgcmV0dXJuIC0x
O30NCiAgICBpZiggeXlwYXJzZSgpICE9IDAgKSBwcmludGYoInVua25vd24g
ZXJyb3JcbiIpOw0KICAgIGlmKCBmY2xvc2UoIGlucHV0X2ZpbGUpID09IEVP
RikNCgl7cHJpbnRmKCJjbG9zaW5nIGZpbGUgZXJyb3JcbiIpOyByZXR1cm4g
LTE7fQ0KICAgIHJldHVybiAwOw0KfQ0KDQp2b2lkIHl5ZXJyb3IoY2hhciAq
cykNCnsNCiAgICBwcmludGYoInNoaXQgaGFwcGVuczogJXNcbiIscyk7DQog
ICAgcmV0dXJuOw0KfQ0K
---559023410-851401618-971282103=:16340--


From akim@epita.fr Thu Oct 12 04:18:57 2000
Received: from [194.98.116.10] (helo=hermes.epita.fr)
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13jdZp-0000db-00
	for <bug-bison@gnu.org>; Thu, 12 Oct 2000 04:18:57 -0400
Received: from goa.lrde.epita.fr (mail@goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id KAA04815
	Thu, 12 Oct 2000 10:19:21 GMT
Received: from nis.lrde.epita.fr
	([10.223.13.52] helo=nostromo.lrde.epita.fr ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13jfap-0008Aa-00; Thu, 12 Oct 2000 10:28:07 +0000
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13jdic-0000s3-00; Thu, 12 Oct 2000 10:28:02 +0200
To: Piotr Buciak <P.Buciak@elka.pw.edu.pl>
Cc: bug-bison@gnu.org
Subject: Re: bug in raw mode
References: <Pine.SOL.4.21.0010111820390.16340-100000@elektron.elka.pw.edu.pl>
From: Akim Demaille <akim@epita.fr>
Date: 12 Oct 2000 10:28:01 +0200
In-Reply-To: Piotr Buciak's message of "Wed, 11 Oct 2000 18:29:45 +0200 (MET DST)"
Message-ID: <mv4vguyxy3y.fsf@nostromo.lrde.epita.fr>
Lines: 29
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

| Hello
| I found a bug, when compiling test project with bison ver. 1.28 under
| Linux.
| The problem is that when I turned on a raw mode (either by %raw
| declaration or by -r command line option) the yytranslate[] table was
| generated incorrectly. 

Hi,

Thanks for the report.  It's a known bug, and IIRC, someone even said
1.24 has it.  What would really help is a detailed analysis and a fix
:)

I also have a question: what is the interest of %raw?  Why are you
using it?  Am I missing something, or it just makes no difference to
use or not to use it?

| In fact it was generated in the way if the raw mode
| was off. When I altered the table manually it worked OK. In the following
| case I changed: yytranslate[3]=3 and yytranslate[257]=2. 
| 
| I provide you with following files:
| x.y - bison input file
| x - a shell script I used to compile
| input.txt - input data file

There was no such thing in you message, but anyway we do have a test
case for this, thanks.


From haberg@matematik.su.se Thu Oct 12 14:37:36 2000
Received: from musse.tninet.se ([195.100.94.12])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13jnEW-0004At-00
	for <bug-bison@gnu.org>; Thu, 12 Oct 2000 14:37:36 -0400
Received: (qmail 1473 invoked from network); 12 Oct 2000 20:37:34 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by musse.tninet.se with SMTP; 12 Oct 2000 20:37:34 +0200
Received: from  [195.100.226.159] (du142-226.ppp.su-anst.tninet.se [195.100.226.142])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 927999.375851.971delenn-s1
 ; Thu, 12 Oct 2000 20:37:31 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110707b60bae681620@[195.100.226.159]>
In-Reply-To: <200010110848.CAA07817@wijiji.santafe.edu>
References: <v03110702b608a4ede719@[195.100.226.147]> (message from Hans
 Aberg on Tue, 10 Oct 2000 12:59:28 +0200) Hans Aberg's message of "Sat, 7
 Oct 2000 15:25:33 +0200" <v03110706b604d0018bec@[195.100.226.145]>
 <v03110702b608a4ede719@[195.100.226.147]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Thu, 12 Oct 2000 20:37:22 +0200
To: Akim Demaille <akim@epita.fr>, Richard Stallman <rms@gnu.org>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison's semantic parsers
Cc: bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

I looked a little at Corbett's thesis, where he describes the Bison's
semantic parser feature, p 66 ff. The guards stuff is a system for error
recovery. It does not seem overly difficult to use. -- But I do not know
how useful one would view it in todays programming.

The idea is that one has to integer values, yyerror and yycost, which
initially are set to zero. The syntactic rules in the .y input file have
the form
<non-terminal>: <symbol 1> ... <symbol n> [%guard expression] [action]
The idea is that the %guard expression checks for semantic errors:

If one detects a semantic error that might be fixed by a syntactic reset,
the %%guard expression should set yyerror to 1 and yycost to a typical
penalty value based on experience. As example, he gives the following for a
Pascal auditor:
    arrval: name %guard chkarrname($1) { $$ = mkarrname($1, &(@1)); }
were one wants to define a name for an array variable in arrval. Then
chkarrname checks whether the name already is defined (semantic test!), and
if it is , sets yyerror to 1, and yycost to 5 or 20 depending on semantics.

I didn't see exactly how the yycost value should be used, perhaps only when
issuing error messages. I got the impression it is ignored by Bison.

  Hans Aberg




From akim@epita.fr Fri Oct 13 03:54:11 2000
Received: from hermes.epita.fr ([194.98.116.10])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13jzfO-0006nQ-00
	for <bug-bison@gnu.org>; Fri, 13 Oct 2000 03:54:10 -0400
Received: from goa.lrde.epita.fr (mail@goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id JAA17062
	Fri, 13 Oct 2000 09:54:41 GMT
Received: from nis.lrde.epita.fr
	([10.223.13.52] helo=nostromo.lrde.epita.fr ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13k1gg-0002tK-00; Fri, 13 Oct 2000 10:03:38 +0000
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13jznv-0004Tv-00; Fri, 13 Oct 2000 10:02:59 +0200
Cc: "rachna" <rachna@plx.com>, bug-bison@gnu.org
Newsgroups: gnu.utils.bug
Subject: Re: need some help !!!
References: <000f01c0348f$f6c44740$1018150a@plx.com>
Distribution: world
From: Akim Demaille <akim@epita.fr>
Date: 13 Oct 2000 10:02:45 +0200
Message-ID: <mv4itqxrwwq.fsf@nostromo.lrde.epita.fr>
Lines: 23
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
In-Reply-To: "rachna"'s message of "Thu, 12 Oct 2000 14:04:08 -0700"
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Posted-To: gnu.utils.bug
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

The following message is a courtesy copy of an article
that has been posted to gnu.utils.bug as well.


>>>>> "rachna" == rachna  <rachna@plx.com> writes:

Hi there,

Please, send text only messages.

rachna> Hi !!!  I have downloaded the bison parser from the website
rachna> but i'm not able to compile it. It is giving an error like

rachna> getopt.c line216 error ( inconsistent paramer list declaration
rachna> for "getopt"

rachna> Can u help me what should be done to this ????

Bugs about Bison should be sent to bug-bison@gnu.org.

Could you give some additional details on the failure?  What is your
computer, what did `configure' display, are you referring to Bison
1.28, have you looked at the line 216 of getopt.c, doesn't the
compiler report with what this declaration is inconsistent, etc.

        Akim


From haberg@matematik.su.se Sat Oct 14 11:15:28 2000
Received: from hromeo.algonet.se ([194.213.74.51])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13kT20-0006Ux-00
	for <bug-bison@gnu.org>; Sat, 14 Oct 2000 11:15:28 -0400
Received: (qmail 24661 invoked from network); 14 Oct 2000 17:15:23 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by hromeo.algonet.se with SMTP; 14 Oct 2000 17:15:23 +0200
Received: from  [195.100.226.156] (du156-226.ppp.su-anst.tninet.se [195.100.226.156])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 888776.536520.971garibaldi-s2
 ; Sat, 14 Oct 2000 17:15:20 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110701b60df035f07d@[195.100.226.157]>
In-Reply-To: <200010110848.CAA07817@wijiji.santafe.edu>
References: <v03110702b608a4ede719@[195.100.226.147]> (message from Hans
 Aberg on Tue, 10 Oct 2000 12:59:28 +0200) Hans Aberg's message of "Sat, 7
 Oct 2000 15:25:33 +0200" <v03110706b604d0018bec@[195.100.226.145]>
 <v03110702b608a4ede719@[195.100.226.147]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Sat, 14 Oct 2000 13:41:01 +0200
To: Richard Stallman <rms@gnu.org>, Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Bison and C++
Cc: bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

It is fact possible to have the top-node in C even though the rest is
written in C++:

One simply writes in C++:
    extern "C" { int main(...) { /* C++ code */ } }
or
    extern "C" int main(...) { /* C++ code */ }
as the "extern" clause only applies to the type of _linkage_, and not what
is in the definition of it. Instead of "C", one could also have "Pascal",
"Fortran" or whatever, only if the compiler can handle it; but one is
guaranteed that "C" will always work.

Therefore the use of C++ is only restricted to the availability of
compilers. My guess is that as the C++ standard ANSI/ISO/IEC 14882-1998 is
now a few years old and available from ANSI for only $18 (same price as for
the new C standard ANSI/ISO/IEC 9899-1999 formerly called C9X),
availability is rife.

One reasonable approach for a program that might be used as a library from
a program written in C is to supply a C entry-point.

  Hans Aberg




From rms@santafe.edu Sun Oct 15 15:34:00 2000
Received: from pele.santafe.edu ([192.12.12.119])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13ktXj-00074A-00; Sun, 15 Oct 2000 15:34:00 -0400
Received: from wijiji.santafe.edu (wijiji [192.12.12.5])
	by pele.santafe.edu (8.9.1/8.9.1) with ESMTP id NAA11422;
	Sun, 15 Oct 2000 13:33:54 -0600 (MDT)
Received: (from rms@localhost)
	by wijiji.santafe.edu (8.9.3+Sun/8.9.1) id NAA13542;
	Sun, 15 Oct 2000 13:33:54 -0600 (MDT)
Date: Sun, 15 Oct 2000 13:33:54 -0600 (MDT)
Message-Id: <200010151933.NAA13542@wijiji.santafe.edu>
X-Authentication-Warning: wijiji.santafe.edu: rms set sender to rms@wijiji.santafe.edu using -f
From: Richard Stallman <rms@gnu.org>
To: haberg@matematik.su.se
CC: akim@epita.fr, bug-bison@gnu.org, help-bison@gnu.org
In-reply-to: <v03110701b60df035f07d@[195.100.226.157]> (message from Hans
	Aberg on Sat, 14 Oct 2000 13:41:01 +0200)
Subject: Re: Bison and C++
Reply-to: rms@gnu.org
References: <v03110702b608a4ede719@[195.100.226.147]> (message from Hans
 Aberg on Tue, 10 Oct 2000 12:59:28 +0200) Hans Aberg's message of "Sat, 7
 Oct 2000 15:25:33 +0200" <v03110706b604d0018bec@[195.100.226.145]>
 <v03110702b608a4ede719@[195.100.226.147]> <v03110701b60df035f07d@[195.100.226.157]>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

    It is fact possible to have the top-node in C even though the rest is
    written in C++:

That feature is useful for people who want to write in C++, but we are
not going to do that in Bison.  GNU Project policy is that programs
should be written in C rather than C++ whenever possible.  Bison is
going to remain a C program, overall.

The only place in Bison in which it is ok to use C++ would be an
optional parser skeleton in C++, provided for the convenience of C++
users.






From haberg@matematik.su.se Sun Oct 15 16:14:39 2000
Received: from musse.tninet.se ([195.100.94.12])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13kuB4-0007nV-00
	for <bug-bison@gnu.org>; Sun, 15 Oct 2000 16:14:38 -0400
Received: (qmail 10407 invoked from network); 15 Oct 2000 22:14:33 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by musse.tninet.se with SMTP; 15 Oct 2000 22:14:33 +0200
Received: from  [195.100.226.144] (du147-226.ppp.su-anst.tninet.se [195.100.226.147])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 506125.640870.971garibaldi-s2
 ; Sun, 15 Oct 2000 22:14:30 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v0311070db60fb91f6357@[195.100.226.144]>
In-Reply-To: <200010151933.NAA13542@wijiji.santafe.edu>
References: <v03110701b60df035f07d@[195.100.226.157]> (message from Hans
 Aberg on Sat, 14 Oct 2000 13:41:01 +0200)
 <v03110702b608a4ede719@[195.100.226.147]> (message from Hans Aberg on
 Tue, 10 Oct 2000 12:59:28 +0200) Hans Aberg's message of "Sat, 7 Oct 2000
 15:25:33 +0200" <v03110706b604d0018bec@[195.100.226.145]>
 <v03110702b608a4ede719@[195.100.226.147]>
 <v03110701b60df035f07d@[195.100.226.157]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Sun, 15 Oct 2000 22:14:08 +0200
To: rms@gnu.org
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison and C++
Cc: akim@epita.fr, bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 13.33 -0600 0-10-15, Richard Stallman wrote:
>    It is fact possible to have the top-node in C even though the rest is
>    written in C++:
>
>That feature is useful for people who want to write in C++, but we are
>not going to do that in Bison.  GNU Project policy is that programs
>should be written in C rather than C++ whenever possible.  Bison is
>going to remain a C program, overall.

Well, you are free programming Bison and whatever other GNU tools as you
wish. :-)

-- I merely provide the information that allows whoever is at the helms at
GNU to re-evaluate that old C dogma. :-) For the future, GNU will need some
kind of computer programming language strategy, though.

BTW, I just found out that the MacOS X already has GCC; those interested
can see
http://developer.apple.com/techpubs/macosx/DeveloperTools/Compiler/CompilerTOC.h
tml GNU tools usually compile just as under any UNIX, I am told; Bison
included I figure. Bison & Flex seems to work nice in an GUI IDE, but it
strictly speaking, it will not be needed on any platform.

One question I think is interesting though, is if one can put info into the
debug .sym files so that it is possible to GUI debug the original .y and .l
files. -- It would make debugging a lot easier, and also make bottom-up
parsers more interesting as tools.

>The only place in Bison in which it is ok to use C++ would be an
>optional parser skeleton in C++, provided for the convenience of C++
>users.

Well, one might do something with that, but some synchronization with Flex
is needed, I think. As for Bison, it writes a dynamic stack I think, so
there one might use the C++ standard library stack class. Etc.

  Hans Aberg




From rms@santafe.edu Mon Oct 16 11:50:18 2000
Received: from pele.santafe.edu ([192.12.12.119])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13lCWo-0005Mj-00; Mon, 16 Oct 2000 11:50:18 -0400
Received: from wijiji.santafe.edu (wijiji [192.12.12.5])
	by pele.santafe.edu (8.9.1/8.9.1) with ESMTP id JAA05400;
	Mon, 16 Oct 2000 09:50:03 -0600 (MDT)
Received: (from rms@localhost)
	by wijiji.santafe.edu (8.9.3+Sun/8.9.1) id JAA14899;
	Mon, 16 Oct 2000 09:50:03 -0600 (MDT)
Date: Mon, 16 Oct 2000 09:50:03 -0600 (MDT)
Message-Id: <200010161550.JAA14899@wijiji.santafe.edu>
X-Authentication-Warning: wijiji.santafe.edu: rms set sender to rms@wijiji.santafe.edu using -f
From: Richard Stallman <rms@gnu.org>
To: haberg@matematik.su.se
CC: akim@epita.fr, bug-bison@gnu.org, help-bison@gnu.org
In-reply-to: <v0311070db60fb91f6357@[195.100.226.144]> (message from Hans
	Aberg on Sun, 15 Oct 2000 22:14:08 +0200)
Subject: Re: Bison and C++
Reply-to: rms@gnu.org
References: <v03110701b60df035f07d@[195.100.226.157]> (message from Hans
 Aberg on Sat, 14 Oct 2000 13:41:01 +0200)
 <v03110702b608a4ede719@[195.100.226.147]> (message from Hans Aberg on
 Tue, 10 Oct 2000 12:59:28 +0200) Hans Aberg's message of "Sat, 7 Oct 2000
 15:25:33 +0200" <v03110706b604d0018bec@[195.100.226.145]>
 <v03110702b608a4ede719@[195.100.226.147]>
 <v03110701b60df035f07d@[195.100.226.157]> <v0311070db60fb91f6357@[195.100.226.144]>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

    One question I think is interesting though, is if one can put info into the
    debug .sym files so that it is possible to GUI debug the original .y and .l
    files.

I don't know what .sym files are--if they are some Macintosh-specific
thing, then for GNU they are just a side issue of a side issue.
However, GDB understands how to refer to the .y file, because of the
#line directives that Bison outputs.  If that doesn't work on a
Macintosh, that would seem to be a bug in their system.


From haberg@matematik.su.se Mon Oct 16 13:27:26 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13lE2n-0007Az-00
	for <bug-bison@gnu.org>; Mon, 16 Oct 2000 13:27:26 -0400
Received: (qmail 13085 invoked from network); 16 Oct 2000 19:27:22 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by knatte.tninet.se with SMTP; 16 Oct 2000 19:27:22 +0200
Received: from  [195.100.226.134] (du131-226.ppp.su-anst.tninet.se [195.100.226.131])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 102880.717239.971garibaldi-s2
 ; Mon, 16 Oct 2000 19:27:19 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110705b610ddd8661a@[195.100.226.134]>
In-Reply-To: <200010161550.JAA14899@wijiji.santafe.edu>
References: <v0311070db60fb91f6357@[195.100.226.144]> (message from Hans
 Aberg on Sun, 15 Oct 2000 22:14:08 +0200)
 <v03110701b60df035f07d@[195.100.226.157]> (message from Hans Aberg on
 Sat, 14 Oct 2000 13:41:01 +0200)
 <v03110702b608a4ede719@[195.100.226.147]> (message from Hans Aberg on
 Tue, 10 Oct 2000 12:59:28 +0200) Hans Aberg's message of "Sat, 7 Oct 2000
 15:25:33 +0200" <v03110706b604d0018bec@[195.100.226.145]>
 <v03110702b608a4ede719@[195.100.226.147]>
 <v03110701b60df035f07d@[195.100.226.157]>
 <v0311070db60fb91f6357@[195.100.226.144]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Mon, 16 Oct 2000 19:24:59 +0200
To: rms@gnu.org
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison and C++
Cc: akim@epita.fr, bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 09.50 -0600 0-10-16, Richard Stallman wrote:
>    One question I think is interesting though, is if one can put info
>into the
>    debug .sym files so that it is possible to GUI debug the original .y
>and .l
>    files.
>
>I don't know what .sym files are--if they are some Macintosh-specific
>thing, then for GNU they are just a side issue of a side issue.

Worse, I think its an inhouse format of the compiler in question.

But any compiler with the ability to create debug files with symbols in
them would have its own debug symbol files. GCC probably has it too, but I
do not have access to GCC right now, so I can't check it out.

>However, GDB understands how to refer to the .y file, because of the
>#line directives that Bison outputs.  If that doesn't work on a
>Macintosh, that would seem to be a bug in their system.

No this works just fine. It is not so much a MacOS thing as the nice GUI
(graphical user interface) of the IDE (integrated development environment),
as the compiler exists also under Windows and UNIX:

When debugging takes place, one sees the original source code in the debug
window (.c file in C), with an arrow pointing at the line where the PC
(program counter) currently is. I recall there is a GUI GDB, but I think
that the difference is that the CW (Metrowerks CodeWarrior) IDE has gone
much further: It keeps track of _all_ data relevant for debugging for you.
Thus, one never has to write down which variables to debug. For debugging
C++ code, I have found it especially important that one can follow the
dynamic type of a polymorphic pointer -- without that feature, it is rather
hopeless trying to debug massively dynamic data. (There are the usual
limitations, variables put into registers or optimized away cannot be well
debugged, and code optimized away cannot be stepped through.) I looked a
little on what is put into those symbol files, and it is mostly references
to C/C++/Pascal etc data structures. So it wouldn't work for Bison.

Now, what one would want to do is to create such a symbol file, where the
output .c code is treated like the assembler code of the object file.
Somehow one should put information about the syntax variables in the .y
file, and their line numbers, so that debugging can take place graphically.
The debugger should display pertinent data, such as how much has been
parsed, perhaps the parsing stack and such. When debugging, instead of just
jumping around in a large matrix

I do not even know if it is possible to it this way. It depends on how
close the relationship is between the .y files and the code in the .c files.

I think though that if it is possible to do such GUI debugging, then the
users would not care much about the _method_ that the parser is using, but
only if it is efficient and such. It will then be possible to make
compiler-compilers which make use of even more complicated algorithms. This
last aspect, is the reason I started to think in these patterns:

There are even more advanced algorithms, basically dynamic in nature, which
then would be more feasible. For example, for Flex, one could make a
translation on the fly, and cache the so obtained tables. One then gets an
algorithm that do not have the translation problems that static algorithms
have, that is, one can avoid that certain regular expressions get an
exponential size/time translation. (There is a remark on this somewhere in
the book by Aho, Sethi, & Ullman.)


  Hans Aberg




From haberg@matematik.su.se Wed Oct 18 09:11:33 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13lt0G-0006vm-00
	for <bug-bison@gnu.org>; Wed, 18 Oct 2000 09:11:33 -0400
Received: (qmail 25932 invoked from network); 18 Oct 2000 15:11:21 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by knatte.tninet.se with SMTP; 18 Oct 2000 15:11:21 +0200
Received: from  [195.100.226.142] (du142-226.ppp.su-anst.tninet.se [195.100.226.142])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 362844.874679.971delenn-s2
 ; Wed, 18 Oct 2000 15:11:19 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110700b6134c1ab713@[195.100.226.129]>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="============_-1240247816==_============"
Date: Wed, 18 Oct 2000 15:11:09 +0200
To: Akim Demaille <akim@epita.fr>, Richard Stallman <rms@gnu.org>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Bison's semantic parser
Cc: bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

--============_-1240247816==_============
Content-Type: text/plain; charset="us-ascii"

I attach some code using Bison's semantic parser that I was able to get at
least some working output from, even though it is buggy.

It is a variation of the RPN calculator in the Bisosn manual. I can type
   2 2 + <return> ... <return>
with several <return> to finally get 4 as output.

The idea I have in mind is once the bugs have been ironed out, to modify
tit with a hashtable for names, and insert a new command say
    define <name>
in order to create a semantic dependance. The one insert a syntax variable
    expression: NAME '=' expression %guard { check_name_defined(); }
                               { /* Assign variable value to variable */ }
where check_name_defined() should set yyerror to 1 if the name is not
defined and also some yyguard penalty recovering value.

Some observations:

The C-code before the Bsion definitions seems to be put in a header, the
stuff after in the .tab.c file.

yyerror is here an int. Instead it has yyabort, which seems to correspond
to yyerror of the non-semantic parsers. One also has to define the
following:

 yyrecover() -- Don't know what this is for, set to nothing here.
 char* yymsg -- Don't know how this should be used; just a generic default
here.
 int timeclock -- Don't know how this is used.

struct mytype {
	clock_t timestamp;    -- Measuerd in favorite time units.
	int first_line, last_line, first_column, last_column;
	char* text;
};
typedef struct mytype mytype;
#define YYLTYPE mytype

--============_-1240247816==_============
Content-Type: text/plain; name="rpcalc_semantic.y"; charset="us-ascii"
Content-Disposition: attachment; filename="rpcalc_semantic.y"








/* Reverse polish notation calculator using
   Bison's semantic parser option. */

%{
/* Must define the following: */
#if 0
yyrecover
yymsg
yyabort
timeclock
#endif

#include <time.h>

#ifndef YYLTYPE
struct mytype {
	clock_t timestamp;
	int first_line, last_line, first_column, last_column;
	char* text;
};
typedef struct mytype mytype;
#define YYLTYPE mytype
#endif

#define YYSTYPE double
#include <math.h>

int yylex();

#define YYABORT return -1
#define YYACCEPT return 0

%}

%semantic_parser

%token NUM

%%

input: 	/* empty */
	 | input line
;

line: '\n'
	| exp '\n' { printf ("\t%.10g\n", $1); }
;

exp:  NUM { $$ = $1; }
	| exp exp '+' { $$ = $1 + $2; }
	| exp exp '-' { $$ = $1 - $2; }
	| exp exp '*' { $$ = $1 * $2; }
	| exp exp '/' { $$ = $1 / $2; }
	  /* Exponentiation */
	| exp exp '^' { $$ = pow ($1, $2); }
	  /* Unary minus */
	| exp 'n' { $$ = -$1; }
;

%%




/* Lexical analyzer returns a double floating point
   number on the stack and the token NUM, or the
   ASCII character read if not a number. Skips all
   blanks and tabs, returns 0 for EOF. */

#include <ctype.h>
#include <stdlib.h>

int yylex() {
	int c;
	/* skip white space */
	while ((c = getchar ()) == ' ' || c == '\t')
		;
	/* process numbers */
	if (c == '.' || isdigit (c)) {
		ungetc (c, stdin);
		scanf ("%lf", &yylval);
		return NUM;
	}
	/* return end-of-file */ if (c == EOF)
	return 0;
	/* return single chars */
	return c;
}

#if __MWERKS__ && macintosh
#include <SIOUX.h>
#endif

int timeclock;

char * yymsg = "I'm not feeling right.\n";

int main() {
#if __MWERKS__ && macintosh
	SIOUXSettings.asktosaveonclose = 0;
	SIOUXSettings.autocloseonquit = 0;
#endif
	timeclock = clock();
	return yyparse();
}


int yyrecover() { }

int yyabort(char* errstr) {
	printf("Error: %s\n", errstr);
	return EXIT_SUCCESS;
}


#if 0
int yyerror(char* errstr) {
	printf("Error: %s\n", errstr);
	printf("(Exit)\n");
	exit(EXIT_FAILURE);
	return EXIT_SUCCESS;
}
#endif


--============_-1240247816==_============
Content-Type: text/plain; charset="us-ascii"

  Hans Aberg

--============_-1240247816==_============--



From david.durham@wcom.com Wed Oct 18 11:38:45 2000
Received: from dgesmtp02.wcom.com ([199.249.16.17])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13lvIi-0000X8-00; Wed, 18 Oct 2000 11:38:44 -0400
Received: from CONVERSION-DAEMON by firewall.mcit.com (PMDF V5.2-33 #42261)
 id <0G2M00701U4F7O@firewall.mcit.com>; Wed, 18 Oct 2000 15:38:39 +0000 (GMT)
Received: from pmismtp03.wcomnet.com ([166.38.62.38])
 by firewall.mcit.com (PMDF V5.2-33 #42261)
 with ESMTP id <0G2M0071CU4E2K@firewall.mcit.com>; Wed,
 18 Oct 2000 15:38:38 +0000 (GMT)
Received: from CONVERSION-DAEMON by pmismtp03.wcomnet.com (PMDF V5.2-33 #42258)
 id <0G2M00A01TZ55E@pmismtp03.wcomnet.com>; Wed,
 18 Oct 2000 15:35:29 +0000 (GMT)
Received: from pmismtp03.wcomnet.com by pmismtp03.wcomnet.com
 (PMDF V5.2-33 #42258) with SMTP id <0G2M00A01TYU3L@pmismtp03.wcomnet.com>;
 Wed, 18 Oct 2000 15:35:29 +0000 (GMT)
Received: from wcom.com ([159.98.157.25])
 by pmismtp03.wcomnet.com (PMDF V5.2-33 #42258)
 with ESMTP id <0G2M005KQTYSVR@pmismtp03.wcomnet.com>; Wed,
 18 Oct 2000 15:35:16 +0000 (GMT)
Date: Wed, 18 Oct 2000 10:40:17 -0500
From: Davy Durham <david.durham@wcom.com>
Subject: Re: Bison's semantic parser
To: Hans Aberg <haberg@matematik.su.se>
Cc: bug-bison@gnu.org, help-bison@gnu.org
Message-id: <39EDC461.FBAB8B48@wcom.com>
Organization: WorldCom
MIME-version: 1.0
X-Mailer: Mozilla 4.73 [en] (X11; I; Linux 2.2.16-9mdk i686)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
X-Accept-Language: en
References: <v03110700b6134c1ab713@[195.100.226.129]>
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

I don't know if you ever did this.... but I took out %semantic_parser (And
made necessary tiny changes) and it didn't have the problem where you have to
press return several times....   So it seems to be a bug (or intentional
action) when the %sematic_parser option....    Either that, or there's
something that needs to be happening in each action or something to do with
gaurds.....  I'm still playing with it....


Hans Aberg wrote:

> I attach some code using Bison's semantic parser that I was able to get at
> least some working output from, even though it is buggy.
>
> It is a variation of the RPN calculator in the Bisosn manual. I can type
>    2 2 + <return> ... <return>
> with several <return> to finally get 4 as output.
>
> The idea I have in mind is once the bugs have been ironed out, to modify
> tit with a hashtable for names, and insert a new command say
>     define <name>
> in order to create a semantic dependance. The one insert a syntax variable
>     expression: NAME '=' expression %guard { check_name_defined(); }
>                                { /* Assign variable value to variable */ }
> where check_name_defined() should set yyerror to 1 if the name is not
> defined and also some yyguard penalty recovering value.
>
> Some observations:
>
> The C-code before the Bsion definitions seems to be put in a header, the
> stuff after in the .tab.c file.
>
> yyerror is here an int. Instead it has yyabort, which seems to correspond
> to yyerror of the non-semantic parsers. One also has to define the
> following:
>
>  yyrecover() -- Don't know what this is for, set to nothing here.
>  char* yymsg -- Don't know how this should be used; just a generic default
> here.
>  int timeclock -- Don't know how this is used.
>
> struct mytype {
>         clock_t timestamp;    -- Measuerd in favorite time units.
>         int first_line, last_line, first_column, last_column;
>         char* text;
> };
> typedef struct mytype mytype;
> #define YYLTYPE mytype
>
>   ------------------------------------------------------------------------
>
>    rpcalc_semantic.yName: rpcalc_semantic.y
>                     Type: Plain Text (text/plain)
>
>   ------------------------------------------------------------------------
>   Hans Aberg



From haberg@matematik.su.se Wed Oct 18 13:16:18 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13lwp7-0002fm-00
	for <bug-bison@gnu.org>; Wed, 18 Oct 2000 13:16:17 -0400
Received: (qmail 15793 invoked from network); 18 Oct 2000 19:15:46 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by knatte.tninet.se with SMTP; 18 Oct 2000 19:15:46 +0200
Received: from  [195.100.226.142] (du131-226.ppp.su-anst.tninet.se [195.100.226.131])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 156340.889319.971garibaldi-s0
 ; Wed, 18 Oct 2000 19:15:19 +0200
X-Sender: haberg@pop.matematik.su.se
Message-Id: <v03110703b613898e2788@[195.100.226.142]>
In-Reply-To: <39EDC461.FBAB8B48@wcom.com>
References: <v03110700b6134c1ab713@[195.100.226.129]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Wed, 18 Oct 2000 19:13:01 +0200
To: Davy Durham <david.durham@wcom.com>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison's semantic parser
Cc: bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

At 10.40 -0500 0-10-18, Davy Durham wrote:
>I don't know if you ever did this.... but I took out %semantic_parser (And
>made necessary tiny changes) and it didn't have the problem where you have to
>press return several times....

Right, I started off with a version that I knew for sure was correct
without the %semantic_parser option. Then I put it in, and modified it so
it should complie at least.

>So it seems to be a bug (or intentional
>action) when the %sematic_parser option....    Either that, or there's
>something that needs to be happening in each action or something to do with
>gaurds.....

Right, something... :-)

>  I'm still playing with it....

I decided to put it up, so that others can play around with it. -- I think
this is the only way to attack it, playing around a bit with this and that.
It may take a while to figure it out.

I am greatful for any inputs.

  Hans Aberg




From haberg@matematik.su.se Wed Oct 18 16:27:29 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13lzo8-0005p6-00
	for <bug-bison@gnu.org>; Wed, 18 Oct 2000 16:27:29 -0400
Received: (qmail 6255 invoked from network); 18 Oct 2000 22:27:18 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by knatte.tninet.se with SMTP; 18 Oct 2000 22:27:18 +0200
Received: from  [195.100.226.157] (du157-226.ppp.su-anst.tninet.se [195.100.226.157])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 630537.900835.971garibaldi-s1
 ; Wed, 18 Oct 2000 22:27:15 +0200
X-Sender: haberg@pop.matematik.su.se (Unverified)
Message-Id: <v03110701b613b490fdba@[195.100.226.142]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Wed, 18 Oct 2000 22:25:48 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Bison generating C++
Cc: bug-bison@gnu.org, help-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

I have a suggest for Bison generating C++, namely to add an option that
cause it to write a file with a C++ ending, default say ".cc" instead of
".c". For now, it would do nothing else, but later one could first change
to C++ standard headers using namespaces, and even further down the road,
more C++ support.

I tweaked the Bison sources, to get this, as follows:
File getargs.c: Add
  int generate_cplusplus = 0;
and in getargs(), add a "+" here ------>|
  while ((c = getopt_long (argc, argv, "+yvdhrltknVo:b:p:", longopts, (int
*)0))
and to the switch statement, add the case '+', as follows:
      switch (c)
	{
	case 0:
	  /* Certain long options cause getopt_long to return 0.  */
	  break;

	case '+':
	  generate_cplusplus = 1;
	  break;
...

Then in file files.c, add
   extern int generate_cplusplus;
and in open_files() change to:
  /* These are opened by `done' or `open_extra_files', if at all */
  if (spec_outfile)
    tabfile = spec_outfile;
  else if (!generate_cplusplus)
    tabfile = stringappend (name_base, base_length, ".c");
  else
    tabfile = stringappend (name_base, base_length, ".cc");
with a statement appending ".cc" if generate_cplusplus is set.

This does not check all combinations C++/calling for special file names. It
is just a tweak I happened to need.

One can think of a long option --C++, and that these options optionally can
have preferred filename extensions, one might be something like that -+.cpp
would make the files have extensions ".cpp" instead.

  Hans Aberg




From marcof@thyron.com Thu Oct 19 10:28:47 2000
Received: from anchor-post-34.mail.demon.net ([194.217.242.92])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13mGgZ-0008QC-00
	for <bug-bison@gnu.org>; Thu, 19 Oct 2000 10:28:47 -0400
Received: from thyronuk.demon.co.uk ([158.152.94.41] helo=rs6000)
	by anchor-post-34.mail.demon.net with esmtp (Exim 2.12 #1)
	id 13mGgX-0008eS-0Y
	for bug-bison@gnu.org; Thu, 19 Oct 2000 15:28:46 +0100
Received: from 16.1.1.166 by rs6000 ([16.1.1.1] running VPOP3) with ESMTP for <bug-bison@gnu.org>; Thu, 19 Oct 2000 15:29:54 +0100
Received: from localhost (localhost [[UNIX: localhost]])by maidavale.thyron-local (8.9.3/8.9.3) id PAA01661for bug-bison@gnu.org; Thu, 19 Oct 2000 15:22:08 +0100
From: Marco Franzen <marcof@thyron.com>
Reply-To: Marco.Franzen@Thyron.com
Organization: Thyron Limited, UK
To: bug-bison@gnu.org
Subject: endless mutual recursion in done() and tryclose()
Date: Thu, 19 Oct 2000 14:03:31 +0100
X-Mailer: KMail [version 1.0.29.2]
Content-Type: text/plain
MIME-Version: 1.0
Message-Id: <00101915204203.00504@maidavale>
Content-Transfer-Encoding: quoted-printable
X-Server: VPOP3 V1.3.0b - Registered to: Thyron Limited
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

If I run Bison version 1.28 (on HP-UX, compiled with gcc-2.95.2)
where e.g. the output file exists but has no write permission, then bison
eventually dies from a SIGSEGV due to (attempted) endless recursion.

Analysis.

When main is nearly finished, it calls done(0), which calls tryclose()
before it tries to open the output file. If tryopen fails, it recursively
calls done() with the files already closed but the global variables
indicating they are not. Therefore, the first call to tryclose() in done(=
)
fails in the attempt to close an already closed file, leading to further
nested calls to done().

On HP-UX, that looks like this (from the 3rd call to perror)
#0  0x7af6b4c4 in ?? () from /usr/lib/libc.1
#1  0x88f0 in tryclose (ptr=3D0x2060) at files.c:400
#2  0x8968 in done (k=3D2) at files.c:409
#3  0x88f8 in tryclose (ptr=3D0x2060) at files.c:401
#4  0x8968 in done (k=3D2) at files.c:409
#5  0x8868 in tryopen (name=3D0x7b03a02d "parse.c",=20
    mode=3D0x6ad2ba6 <Address 0x6ad2ba6 out of bounds>) at files.c:383
#6  0x89cc in done (k=3D0) at files.c:422
#7  0xc428 in main (argc=3D6, argv=3D0x7b03a3a4) at main.c:113
#8  0x7af2bd0c in ?? () from /usr/lib/libc.1

The problem is the global variables (faction, et. al.). If global variabl=
es
must be used and also recursion must be used, then those variables should
be set to NULL after (successfully or not) closing the FILE stream to
prevent endless recursion.  (Function tryclose() could do that if it were
changed to receive a FILE**.)

Marco
-----------------------------------------------------------------
This email is confidential and intended solely for the use of the
individual to whom it is addressed.
Any views or opinions presented are solely those of the author
and do not necessarily represent those of Thyron Limited.
If you are not the intended recipient then please be advised
that you have received this email in error and that any use,
dissemination, forwarding, printing or copying of this email
is strictly prohibited.
If you have received this email in error, please notify the
Thyron IT Administrator on +44 (0)1923 236 050 or
send an email to mail-admin@thyron.com.
Thank You


From akim@epita.fr Thu Oct 19 11:00:03 2000
Received: from hermes.epita.fr ([194.98.116.10])
	by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
	id 13mHAp-0000aq-00
	for <bug-bison@gnu.org>; Thu, 19 Oct 2000 11:00:03 -0400
Received: from goa.lrde.epita.fr (mail@goa.lrde.epita.fr [10.223.13.2])
	by hermes.epita.fr id QAA09025
	Thu, 19 Oct 2000 16:57:55 GMT
Received: from nis.lrde.epita.fr
	([10.223.13.52] helo=nostromo.lrde.epita.fr ident=mail)
	by goa.lrde.epita.fr with esmtp (Exim 3.12 #1 (Debian))
	id 13mItG-0003ZS-00; Thu, 19 Oct 2000 16:50:02 +0000
Received: from akim by nostromo.lrde.epita.fr with local (Exim 3.16 #1 (Debian))
	id 13mGvv-0005JN-00; Thu, 19 Oct 2000 16:44:39 +0200
To: Marco.Franzen@thyron.com
Cc: bug-bison@gnu.org
Subject: Re: endless mutual recursion in done() and tryclose()
References: <00101915204203.00504@maidavale>
From: Akim Demaille <akim@epita.fr>
Date: 19 Oct 2000 16:44:38 +0200
In-Reply-To: Marco Franzen's message of "Thu, 19 Oct 2000 14:03:31 +0100"
Message-ID: <mv4hf68x549.fsf@nostromo.lrde.epita.fr>
Lines: 4
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

Thanks for the report.  We plan to revamp completely the use of tmp
files, so it should address this problem.

        Akim


From haberg@matematik.su.se Fri Oct 20 13:55:58 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13mgOb-0003su-00
	for <bug-bison@gnu.org>; Fri, 20 Oct 2000 13:55:58 -0400
Received: (qmail 19302 invoked from network); 20 Oct 2000 19:55:49 +0200
Received: from garibaldi.tninet.se (HELO algonet.se) (195.100.94.103)
  by knatte.tninet.se with SMTP; 20 Oct 2000 19:55:49 +0200
Received: from  [195.100.226.155] (du155-226.ppp.su-anst.tninet.se [195.100.226.155])
 by garibaldi.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 225750.64548.972garibaldi-s0
 ; Fri, 20 Oct 2000 19:55:48 +0200
X-Sender: haberg@pop.matematik.su.se (Unverified)
Message-Id: <v03110700b61631c69816@[195.100.226.147]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Fri, 20 Oct 2000 19:33:27 +0200
To: Bison Bugs <bug-bison@gnu.org>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Re: Bison's semantic parsers
Cc: akim@epita.fr
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

I get the following warning:

Warning : function has no prototype
bison.simple line 271   {

and it is the following function:
int
yyparse (YYPARSE_PARAM_ARG)
     YYPARSE_PARAM_DECL
that does not have a prototype.

  Hans Aberg




From haberg@matematik.su.se Sun Oct 22 11:18:35 2000
Received: from angel.algonet.se ([194.213.74.112])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13nMtN-0002Ew-00
	for <bug-bison@gnu.org>; Sun, 22 Oct 2000 11:18:33 -0400
Received: (qmail 20011 invoked from network); 22 Oct 2000 17:18:05 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by angel.algonet.se with SMTP; 22 Oct 2000 17:18:05 +0200
Received: from  [195.100.226.133] (du133-226.ppp.su-anst.tninet.se [195.100.226.133])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 613907.227882.972delenn-s1
 ; Sun, 22 Oct 2000 17:18:02 +0200
X-Sender: haberg@pop.matematik.su.se (Unverified)
Message-Id: <v03110700b618a5298c37@[195.100.226.156]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Sun, 22 Oct 2000 17:16:33 +0200
To: Akim Demaille <akim@epita.fr>
From: Hans Aberg <haberg@matematik.su.se>
Subject: Info/Warning/Error Messages
Cc: bug-bison@gnu.org
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

It would probably not be to difficult to modify Flex/Bison to provide the
kind of information that the CW IDE expects for info/warning/error messages.

I made an implementation in Flex; the information is basically there, but
as Flex isn't designed to supply such information, so it needs to be
modified a little to support it.

I will renew the summary (in pseudo-C++) of what information one expects to
produce, with extra care taken to detail:

enum { Info, Warning, Error }   -- Type of message.
enum { General, Filespecific }  -- File-specific message or not
string message                  -- Message in words; may be multi-line.

For a general message, one just provides the information above. If the
message is file-specific, if one wants to identify place for the error, one
supplies the following:

class WhichFile {
  string filename;     -- Name of file (needed for finding OS file specifier).
  ...    filepointer;  -- Pointer to stream or file struct.
};
class Excerpt {
  string excerpt;       -- Excerpt of where the problem is; may be multiline.
  int position, length; -- Identifies the token character position, first = 0,
};                      -- and its length in this string.
class ErrorLocation {
  int linenumber;       -- Line number in the file; first = 1.
  int position, length; -- Character count in file, first = 0,
};                      -- and the length of the token.

The string "excerpt" could typically be the line where the failing token is
found. The safest way to find ErrorLocation.position would probably be to
use ostream::tellp() or equivalent (see below, though).

An implementation could be something like the following:

There is an extra variable yyline_number which is defined by the user. The
user must supply a notion of a line number count. Using Flex, this can be
done say by

int yyline_number = 1;
%}
line_separator  \n|\r|\r\n
...
%%
{line_separator}   { ++yyline_number; ... }
...

if one reads the files as binary, and wants to give a correct line count
for UNIX/Mac/DOS text files simultaneously.

If one decides that the string "excerpt" above should be the line on which
the error takes place, then one can try using

int yyline_number = 1;
char* yyline_start = 0;
char* yyline_offset = 0;
}%
line_separator  \n|\r|\r\n
...
%%
{line_separator}   { ++yyline_number; line_start = yy_cp; ... }
...
{any_other_rule}   { line_offset = yy_bp; ... }

Flex uses the variable yy_bp to point at the beginning of every lexeme
scan, and yy_cp points at the current character scanned, so when a full
scan has been identified, it sets yyleng = yy_cp - yy_bp, and yytext =
yy_bp.

This implementation is flawed though, because it does not work on the first
line. -- Thus, Flex ought to be modified to support this.
-- Also, for the ErrorLocation.position, one needs to keep track of the
character count from the start of the file. Again, in order to make this
correct, one would need to know something about Flex's internals (Flex may
scan ahead in a file so that ostream::tellp() and such stuff cannot in
general be expected to work), but it should otherwise not be overly
difficult to implement.

  Hans Aberg




From haberg@matematik.su.se Wed Oct 25 13:58:15 2000
Received: from knatte.tninet.se ([195.100.94.10])
	by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
	id 13oUoY-0005Cr-00
	for <bug-bison@gnu.org>; Wed, 25 Oct 2000 13:58:14 -0400
Received: (qmail 24052 invoked from network); 25 Oct 2000 19:58:10 +0200
Received: from delenn.tninet.se (HELO algonet.se) (195.100.94.104)
  by knatte.tninet.se with SMTP; 25 Oct 2000 19:58:10 +0200
Received: from  [195.100.226.129] (du129-226.ppp.su-anst.tninet.se [195.100.226.129])
 by delenn.tninet.se (BLUETAIL Mail Robustifier 2.2.1) with ESMTP
 id 519195.496689.972delenn-s1 for <bug-bison@gnu.org>
 ; Wed, 25 Oct 2000 19:58:09 +0200
X-Sender: haberg@pop.matematik.su.se (Unverified)
Message-Id: <v03110700b61cc969f7ae@[195.100.226.133]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Wed, 25 Oct 2000 19:42:10 +0200
To: Bison Bugs <bug-bison@gnu.org>
From: Hans Aberg <haberg@matematik.su.se>
Subject: YYDEBUG
Sender: bug-bison-admin@gnu.org
Errors-To: bug-bison-admin@gnu.org
X-BeenThere: bug-bison@gnu.org
X-Mailman-Version: 2.0beta6
Precedence: bulk
List-Help: <mailto:bug-bison-request@gnu.org?subject=help>
List-Post: <mailto:bug-bison@gnu.org>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=subscribe>
List-Id: Bug reports for Bison, the GNU parser generator <bug-bison.gnu.org>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/bug-bison>, <mailto:bug-bison-request@gnu.org?subject=unsubscribe>
List-Archive: http://mail.gnu.org/pipermail/bug-bison/

Some minor things for the future:

If one changes "YY" to something else, say
  --name-prefix=my_parser
then perhaps YYDEBUG should also have a macro
  #define YYDEBUG my_parserDEBUG
in case one uses more than one parser (however unlikely it is that the
different YYDEBUG's will be read by the same file).

Also, in the case of such a name-change, the Bison manual, sec. 8, should
say that one needs to set my_parserdebug to 1, not yy debug.

  Hans Aberg




