bug-bison
[Top][All Lists]
Advanced

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

Re: api.header.include and backward-compatible .y files


From: Kaz Kylheku
Subject: Re: api.header.include and backward-compatible .y files
Date: Sun, 23 Aug 2020 09:17:19 -0700
User-agent: Roundcube Webmail/0.9.2

On 2020-08-21 17:33, Adam Novak wrote:
Hello,

I'm maintaining a .y file at
https://github.com/vgteam/raptor/blob/master/src/turtle_parser.y that
needs to be backward-compatible with the Bison available in Ubuntu
18.04 (3.0.4), but also work on the latest Bison that our project's
Mac users get supplied from Homebrew (3.7.1).

By the way, you have some issues in your code. The #include <...> notation
is for including system headers, not your own local headers.

I see that you have


%{

/* ... */

#include <turtle_parser.h>

/* ... */

%}

in your grammar file where "turtle_parser.h" is the renamed header that
is originally "turtle_parser.tab.h".

Is that finding the right header?

Consider using #include "turtle_parser.h" in any case.

I would expect that if you include that header in the %{ ... %} section,
then the generated parser's own #include of the same header should then
be suppressed with #ifndef, something like:

#ifndef YY_YY_TURTLE_PARSER_TAB_H_INCLUDED

...

your renamed header should still be putting out the macro.
Isn't there such an #ifndef in the generated parser around the
include of the header?



reply via email to

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