bug-bison
[Top][All Lists]
Advanced

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

[bison 2.5 on cygwin] : bug with GLR parser generation


From: Didier GARCIN
Subject: [bison 2.5 on cygwin] : bug with GLR parser generation
Date: Mon, 3 Oct 2011 01:45:28 +0200

Hi,


I've compiled from source on cygwin, bison 2.5.

I'm using %glr-parser directive.

The following .ypp statement :

%union
{
unsigned long long natural;
double fp;
char* string;
bool boolean;}

is generated in corresponding .cpp like this :

ifndef YYSTYPE
typedef union YYSTYPE
{

/* Line 2638 of glr.c  */
#line 15 "parser.ypp"

unsigned long long natural;
double fp;
char* string;
bool boolean;


/* Line 2638 of glr.c  */
#line 179 "parser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
#endif


This code causes multiple declarations of YYSTYPE while generating a LALR 
parser  (ie. deleting %glr-parser) outputs this, correctly :

#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{

/* Line 2068 of yacc.c  */
#line 12 
"C:\\Users\\didier.PC-de-didier2\\Documents\\Projets\\C++translator\\src\\C++parser.ypp"

unsigned long long natural;
double fp;
char* string;
bool boolean;
void* pointer;



/* Line 2068 of yacc.c  */
#line 180 
"C:\\Users\\didier.PC-de-didier2\\Documents\\Projets\\C++translator\\src/C++parser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif



Because of the following added by bison:

# define YYSTYPE_IS_DECLARED 1
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED


Do you agree this is a bug ?
I've experienced this bug with bison 2.4.2.

Thanks a lot to pay attention to my message.
Have a nice day and fun.
Didier.




reply via email to

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