]> git.saurik.com Git - bison.git/commit
c++: provide a means to clear symbols
authorAkim Demaille <akim@lrde.epita.fr>
Thu, 8 Jan 2015 09:19:10 +0000 (10:19 +0100)
committerAkim Demaille <akim@lrde.epita.fr>
Thu, 8 Jan 2015 15:07:59 +0000 (16:07 +0100)
commitee2f433512c2bfc1f8fe0f518f0e80e5e540bf26
tree5a5ffcbed716a24c92b3ccdfa963c319642ccd92
parent5422471cbb68d8b5775046702cc92209b0718f58
c++: provide a means to clear symbols

The symbol destructor is currently the only means to clear a symbol.
Unfortunately during error recovery we might have to clear the
lookahead, which is a local variable (yyla) that has not yet reached
its end of scope.

Rather that duplicating the code to destroy a symbol, or rather than
destroying and recreating yyla, let's provide a means to clear a
symbol.

Reported by Antonio Silva Correia, with an analysis from Michel d'Hooge.
<http://savannah.gnu.org/support/?108481>

* data/c++.m4, data/lalr1.cc (basis_symbol::clear, by_state::clear)
(by_type::clear): New.
(basic_symbol::~basic_symbol): Use clear.
THANKS
data/c++.m4
data/lalr1.cc