help-bison
[Top][All Lists]
Advanced

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

glr2.cc compile errors under Windows


From: Jot Dot
Subject: glr2.cc compile errors under Windows
Date: Sun, 14 Nov 2021 22:13:20 -0700 (MST)

glr2.cc  does not work for me. I get compile errors with the resultant parser
and scanner files that are generated.

To be honest, I'm not quite sure where to begin in regards to figuring out the 
problem.

>From what I've read:

"It should be upward compatible in terms of interface, feature and
performance to "glr.cc". To try it out, simply use
%skeleton "glr2.cc"

Since I wanted to look at the %merge feature again, I decided to update
everything and give that a try. I am not sure if I am messing something up
or if there is an issue somewhere.

Here is a summary of the situation:

I'm running Windows 10, developing with MSVC 2022 and using cygwin for 
flex/bison.

I used to use win_flex/win_bison on sourceforge but it hasn't been updated
for a year, and I wanted to use the latest versions of flex and bison.

I installed the 64 bit version of cygwin and installed flex/bison thru their
setup interface. The flex/bison versions are:

flex 2.6.4
bison (GNU Bison) 3.8.2

I then added the bin directory to my PATH and copied flexlexer.h into another
directory so I could set my MSVC "Additional include dir" to it.
(I can't set MSVC directly to the /usr/include since MSVC was using additional
files from it which caused multiple errors.

Anyways, that worked fine. After some minor changes for MSVC, I verified 
everything
was working by recompiling my source (using glr.cc) and everything works as 
before.

I then set my parser's skeleton to glr2.cc
Flex and bison do their work, and report the expected amount of s/r r/r 
conflicts.
I then compile the generated code but I get multiple errors compiling both 
files.

1>parser.cpp
1>D:\data\c\gen\runtime\parser.h(480,1): error C2535: 
'gen::Parser::basic_symbol<Base> &gen::Parser::basic_symbol<Base>::operator 
=(const gen::Parser::basic_symbol<Base> &)': member function already defined or 
declared
1>D:\data\c\gen\runtime\parser.h(435): message : see declaration of 
'gen::Parser::basic_symbol<Base>::operator ='
1>D:\data\c\gen\runtime\parser.h(482): message : see reference to class 
template instantiation 'gen::Parser::basic_symbol<Base>' being compiled
1>D:\data\c\gen\runtime\parser.h(480,1): error C2535: 
'gen::Parser::basic_symbol<gen::Parser::by_kind> 
&gen::Parser::basic_symbol<gen::Parser::by_kind>::operator =(const 
gen::Parser::basic_symbol<gen::Parser::by_kind> &)': member function already 
defined or declared
1>D:\data\c\gen\runtime\parser.h(435): message : see declaration of 
'gen::Parser::basic_symbol<gen::Parser::by_kind>::operator ='
1>D:\data\c\gen\runtime\parser.h(529): message : see reference to class 
template instantiation 'gen::Parser::basic_symbol<gen::Parser::by_kind>' being 
compiled
1>D:\data\c\gen\runtime\scanner.h(35,55): error C2039: 'semantic_type': is not 
a member of 'gen::Parser'
1>D:\data\c\gen\runtime\parser.h(122): message : see declaration of 
'gen::Parser'

... etc (the other messages look like msvc is past the point of generating 
meaningful messages).

Does anyone have experience with a similar setup?
I wonder if I messed something up or should I send this to bug-bison?
Any guidance would be appreciated.

Thanks



reply via email to

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