[Top][All Lists]

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

EOF redefinition (3.5->3.6 error)

From: Egor Pugin
Subject: EOF redefinition (3.5->3.6 error)
Date: Thu, 11 Jun 2020 18:15:05 +0300

The code:

The user macro:

The error:
error: no member named 'yy_range' in 'yy_range::parser::token'; did
you mean simply 'yy_range'?

return MAKE(EOQ);


note: expanded from macro 'MAKE'

#define MAKE(x) {THIS_PARSER2::token::x, {}}


The reason:
At the end of bison generated header there is
#undef EOQ
#define EOQ yy_range::parser::token::EOQ

Possible solutions for me:
1) #undef EOQ in flex file again (after bison undef)
2) Rewrite line from return MAKE(EOQ); to return EOQ;

The problem is that I have bison 3.5 on some systems and 3.6 on others.

Another solution I see is to put solution #2 under condition (#ifdef)
for bison 3.5 and 3.6, but it seems we do not have bison version macro
- this would be really useful.

Example from protobuf:

So, we might have something generated in generated header/source files like
#define BISON_VERSION 30500 // 3.5.0
#define BISON_VERSION 30601 // 3.6.1

Egor Pugin

reply via email to

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