[Top][All Lists]

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

Re: bison.simple and C++ conflict

From: Akim Demaille
Subject: Re: bison.simple and C++ conflict
Date: 12 Jan 2001 14:00:18 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Crater Lake)

| Bison 1.28 uses a file 'bison.simple' that has:
|  iwsl010:304> sed -n 237,244p /usr/lib/bison.simple 
|  /* Prevent warning if -Wstrict-prototypes.  */
|  #ifdef __GNUC__
|  int yyparse (void *);
|  #else
|  int yyparse (void);
|  #endif
|  #endif
| Now, if yyparse is #define to be a _method_ of a C++ class 
| then this declaration fails C++ compilation.

Well, if you're doing this, you're actually hacking, and Bison is not
made for this.

| Thus the above warning prevention creates a problem.
| I suggest to have something like:
|     ... // the above
|    #endif
| So applications can avoid the above yyparse declaration.

And this is needed for your hack.  So I don't think it is right to
include this in Bison.  Rather, some release should address once for
all the problem of C++ parsers.

Till that day, I'd suggest that you use your own bison.c++ and use the
envvars to tell bison(1) to use it.

reply via email to

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