help-bison
[Top][All Lists]
Advanced

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

Re: Exception safety of generated C++ parser


From: Hans Aberg
Subject: Re: Exception safety of generated C++ parser
Date: Thu, 13 Sep 2012 18:32:32 +0200

On 13 Sep 2012, at 17:54, Oleksii Taran wrote:

> Does Bison guarantees exception safety in C++ parser, i.e. will it make
> any clean-up and free memory if an exception is thrown on rule action?

Yes, the default stack is std::deque.

> I
> know about %destructor directive, but it seems irrelevant, since
> destructor code is called only if parser recovers from _syntax_ error.

This is for the C parser, since C does not provide automatic cleanup. I might 
be possible to compile this parser as C++ (supported at least in the past), in 
which case %destructor would be needed.

Hans





reply via email to

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