[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with Bison 1.35
From: |
Akim Demaille |
Subject: |
Re: Problem with Bison 1.35 |
Date: |
31 Jul 2002 11:34:39 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) |
| Vojtech Toman wrote:
| > parser generated by 1.28 was ok, but parser generated by 1.35
| > crashes with stack overflow
|
| I'm very new to the world of Bison and Flex, but I spent the better
| part of today figuring this one out, and just located this mailing
| list to share what I found.
| :-)
Welcome :)
| The problem seems to be this code in bison.simple, which was added in
| 1.34a according to the ChangeLog:
|
| #if (! defined (yyoverflow) \
| && (! defined (__cplusplus) \
| || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
|
| The idea is that if using C++, all the stack-growth code is only valid
| if both YYLTYPE and YYSTYPE are trivial types. Makes sense.
Yep.
| However, I don't use the location stack (that the right terminology?),
| and so reader_output_yylsp() is never called, code to define
| YYLSP_NEEDED and YYLTYPE is not written, and most importantly
| YYLTYPE_IS_TRIVIAL is never defined, and my stacks will never grow.
| I believe the correct solution is to not require YYLTYPE_IS_TRIVIAL in
| this conditional if YYLTYPE (or should it be YYLSP_NEEDED ?) is
| undefined.
Correct. That's what I have in CVS Bison:
#ifndef YYLTYPE
typedef struct yyltype
{
int first_line;
int first_column;
int last_line;
int last_column;
} yyltype;
# define YYLTYPE b4_ltype
# define YYLTYPE_IS_TRIVIAL 1
#endif
Indeed, 1.35 has a problem wrt this :( Would you give a try to 1.49b?
You *might* be able to fetch it from
http://www.lrde.epita.fr/~akim/download/bison-1.49b.tar.gz
or
http://www.lrde.epita.fr:800/~akim/download/bison-1.49b.tar.gz