[Top][All Lists]

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

Re: YYEOF shouldn't be defined with bison -y

From: Dimitrios Apostolou
Subject: Re: YYEOF shouldn't be defined with bison -y
Date: Sat, 18 Aug 2018 15:46:52 +0200
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/26 (x86_64-redhat-linux-gnu) MULE/6.0 (HANACHIRUSATO)

On Sat, 18 Aug 2018 06:39:36 +0200,
Akim Demaille wrote:
> Hi!
> I’m coming long after the discussion, sorry.
> > Le 5 déc. 2017 à 02:32, Dimitrios Apostolou <address@hidden> a écrit :
> > 
> > On Mon, 04 Dec 2017 21:24:40 +0100,
> > Kaz Kylheku wrote:
> >> 
> >> On 03.12.2017 18:34, Dimitrios Apostolou wrote:
> >>> Hello list,
> >>> 
> >>> I am configuring the build using AC_PROG_YACC, which invokes bison with 
> >>> "-y"
> >>> option.  But bison-generated parser compiled successfully, and YYEOF
> >>> extension
> >>> in the parser remained undetected.
> >>> 
> >>> Generating the parser with "byacc" on the other hand creates a file that
> >>> does
> >>> not compile because of undefined symbol YYEOF.
> >> 
> >> What is your error report?
> >> 
> >> Are you saying that you cannot boostrap a build of Bison using Byacc?
> > 
> > My error report has nothing to do with bootstrapping Bison, sorry for not
> > being clear.
> > 
> > I am generating a parser as part of a different project, and that project is
> > configured with AC_PROG_YACC. As such, it invokes Bison with "-y" option, 
> > and
> > I would expect that Bison tries hard to fail when the parser uses 
> > non-portable
> > features, such as YYEOF.
> > 
> > This is not the case however, and the project was released, and this was
> > discovered after longtime that somebody built it with byacc instead of
> > Bison. With that version of byacc, the generated parser C code failed to 
> > build
> > with "undefined symbol YYEOF".
> > 
> > I would expect that "bison -y" undefines YYEOF, so that the software that 
> > uses
> > YYEOF fails to build.
> There’s something which is not fully clear here: unless _you_ used YYEOF
> somewhere in your code, there’s no reason for the parser not to be
> compilable with byacc.

Yes, YYEOF was used in the project that I maintained, but I was not the one
that introduced it. After years of patches from various people, it was
incidentally discovered that the parser fails to compile with byacc, because
at some point usage of YYEOF was introduced, and it went undetected, despite
having always generated the parser using "bison -y".

> So I expect that you did use YYEOF.  In which case, the question is rather:
> where was it used, to what purpose, and how would you have expected to
> write it independently of YYEOF?

I'm not sure of the details at the moment, but YYEOF usage got removed
eventually. What I did myself to ensure that this does not happen again, I
changed the Travis build environment to uninstall bison and install byacc. So
now every commit is verified that is yacc-compatible before being
merged. Still I believe that "bison -y" ought to catch such errors.

Thanks for revisiting this.


reply via email to

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