[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: glr2.cc compile errors under Windows
From: |
Jot Dot |
Subject: |
Re: glr2.cc compile errors under Windows |
Date: |
Sat, 20 Nov 2021 07:57:32 -0700 (MST) |
Hi Akim,
> Could you please attach that parser.h file? Or a link to it? Or at least the
> relevant excerpts, so that we can have a look at what confuses it.
>
> Did you make sure it compiled in C++11? Actually I would even make sure to be
> in C++14 mode.
I was using C++17. I did try C++14 just to make sure but the issue is
there with both versions. I've noticed with my new MSVC 2022 that it
only goes down to 14, so I could not test 11.
I've chopped down the grammar file to it's bare minimum.
I have attached the grammar file and the generated files to this email
If the skeleton is glr.cc then the grammar compiles without errors.
With glr2.cc I get the following errors:
1>D:\data\c\runtime\parser.h(246,1): error C2535:
'yy::parser::basic_symbol<Base> &yy::parser::basic_symbol<Base>::operator
=(const yy::parser::basic_symbol<Base> &)': member function already defined or
declared
1>D:\data\c\runtime\parser.h(203): message : see declaration of
'yy::parser::basic_symbol<Base>::operator ='
1>D:\data\c\runtime\parser.h(248): message : see reference to class template
instantiation 'yy::parser::basic_symbol<Base>' being compiled
1>D:\data\c\runtime\parser.h(246,1): error C2535:
'yy::parser::basic_symbol<yy::parser::by_kind>
&yy::parser::basic_symbol<yy::parser::by_kind>::operator =(const
yy::parser::basic_symbol<yy::parser::by_kind> &)': member function already
defined or declared
1>D:\data\c\runtime\parser.h(203): message : see declaration of
'yy::parser::basic_symbol<yy::parser::by_kind>::operator ='
1>D:\data\c\runtime\parser.h(295): message : see reference to class template
instantiation 'yy::parser::basic_symbol<yy::parser::by_kind>' being compiled
1>D:\data\c\runtime\parser.y(7,15): error C2065: 'YYSTYPE': undeclared
identifier
1>D:\data\c\runtime\parser.y(7,24): error C2065: 'pyylval': undeclared
identifier
1>D:\data\c\runtime\parser.y(7,33): error C2143: syntax error: missing ';'
before '{'
1>D:\data\c\runtime\parser.y(7,33): error C2447: '{': missing function header
(old-style formal list?)
1>D:\data\c\runtime\parser.cpp(2215,1): warning C4065: switch statement
contains 'default' but no 'case' labels
1>D:\data\c\runtime\parser.cpp(2458,1): warning C4065: switch statement
contains 'default' but no 'case' labels
1>D:\data\c\runtime\parser.cpp(2599,51): error C2064: term does not evaluate to
a function taking 1 arguments
Source Grammar:
%language "c++"
%glr-parser
%skeleton "glr2.cc"
%code
{
int yylex(YYSTYPE *pyylval) { return 0; }
}
%start program
%%
program:
';'
;
%%
parser.cpp
Description: Text Data
parser.h
Description: Text Data
parser.y
Description: Text Data
- glr2.cc compile errors under Windows, Jot Dot, 2021/11/15
- Re: glr2.cc compile errors under Windows, Akim Demaille, 2021/11/20
- Re: glr2.cc compile errors under Windows,
Jot Dot <=
- Re: glr2.cc compile errors under Windows, Akim Demaille, 2021/11/21
- Re: glr2.cc compile errors under Windows, Jot Dot, 2021/11/21
- Re: glr2.cc compile errors under Windows, Hans Ã…berg, 2021/11/21
- Re: glr2.cc compile errors under Windows, Akim Demaille, 2021/11/21
- Re: glr2.cc compile errors under Windows, Jot Dot, 2021/11/21
- Re: glr2.cc compile errors under Windows, Akim Demaille, 2021/11/21
- Re: glr2.cc compile errors under Windows, Jot Dot, 2021/11/21
- Re: glr2.cc compile errors under Windows, Akim Demaille, 2021/11/21
- Re: glr2.cc compile errors under Windows, Jot Dot, 2021/11/21
- Re: glr2.cc compile errors under Windows, Akim Demaille, 2021/11/22