help-bison
[Top][All Lists]
Advanced

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

Re: Growing stacks in C++


From: Hans Aberg
Subject: Re: Growing stacks in C++
Date: Thu, 22 Jul 2010 23:10:46 +0200

On 21 Jul 2010, at 00:03, Paul Hilfinger wrote:

The Bison documentation says that due to technical differences between C and C++, a C++ compiler wouldn't be able to compile or properly execute
(not clear which) a Bison C program that tried to grow the parser
stack.  What exactly is this technical difference?  Producing a C++
program using the C skeleton (not lalr1.cc), tweaking the generated code to expand the parser stack regardless of __cplusplus, and compiling with
C++ works in at least simple cases.  What's the problem?

One problem is that the C stack does not call C++ copy constructors when reallocating. So one can only use a POD semantic value.

But you have phrased is as an all through C program compiled as C++. That must work if the C parser and the program is written in the subset common to C++.

  Hans





reply via email to

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