[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: "parser stack overflow" in bison-1.35, bad "#if" in bison.sim ple
From: |
Miko Nahum |
Subject: |
RE: "parser stack overflow" in bison-1.35, bad "#if" in bison.sim ple |
Date: |
Sun, 25 Aug 2002 15:50:35 +0200 |
I knew that 1.28 is old. However, 1.35 is the last one
from GNU site (http://ftp.gnu.org/) whereas 1.49x is at alpha
stage (not even beta). So what version IS supported ?
OK, C stack enlargement does not invoke the C++ copy constructors as it
should it, but look at the condition in "bison.simple":
#if (! defined (yyoverflow) \
&& (! defined (__cplusplus) \
|| (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
That is, you have either:
NOT C++ or (YYLTYPE and YYSTYPE)
So if someone is using the "%union" and location, it will cause the C stack
enralgement to be used - EVEN WHEN COMPILED WITH C++ compiler, right ?? So
in such case C++ copy constructors does NOT invoked. What than ??
For the meantime, till I shift to 1.49++ I'll have to workaround it as I
did.
Regards,
Miko
-----Original Message-----
From: Hans Aberg [mailto:address@hidden
Sent: Sunday, August 25, 2002 1:38 PM
To: Miko Nahum
Cc: 'address@hidden'
Subject: Re: "parser stack overflow" in bison-1.35, bad "#if" in
bison.simple
At 12:11 +0200 2002/08/25, Miko Nahum wrote:
>Hi All,
Hi yourself, :-)
>Here is a description of a problem: I am using bison to implement an
>interpreter.
>This is a pure_parser combined with flex and I compile everything in C++
>compiler
>as part of a class. This is of course in multi-platform env'. (Win, HP,
>Sun.,,,).
>
>Under Windows currently use bison-1.28
The latest news about this version is probably that some Druids used it at
Stonehenge. :-)
> whereas under all Unix platforms
>using bison-1.35.
And this one is not supported either, I think.
>The result, stack enlargement code does not activated when needed and
>all I have is the YYINITDEPTH which is 200 (which isnot enough).
This is only one problem with older version under C++; another is that the
C stack enlargement does not invoke the C++ copy constructors as it should.
Therefore, the proper thing is to use a C++ container.
There is a Bison beta that does just that:
ftp://alpha.gnu.org/gnu/bison/ (bison-1.49x)
Try this one; compile with option -S c++.bison (or was it bison.c++?) or
something like that (to choose the right skeleton file.
Hans Aberg
- RE: "parser stack overflow" in bison-1.35, bad "#if" in bison.sim ple,
Miko Nahum <=