[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with Bison 1.35
From: |
Michael J. Saletnik |
Subject: |
Re: Problem with Bison 1.35 |
Date: |
Tue, 30 Jul 2002 16:13:05 -0400 |
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.
:-)
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.
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.
Thoughts?
--
{michael}