mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
lalr1.cc: document exception safety
* NEWS: here. * doc/bison.texi (Destructor Decl, C++ Parser Interface): and there.
This commit is contained in:
9
NEWS
9
NEWS
@@ -39,6 +39,15 @@ GNU Bison NEWS
|
||||
|
||||
will use YY_CALC_LIB_PARSE_H_INCLUDED as guard.
|
||||
|
||||
** Exception safety (lalr1.cc)
|
||||
|
||||
The parse function now catches exceptions, uses the %destructors to
|
||||
release memory (the lookahead symbol and the symbols pushed on the stack)
|
||||
before rethrowing the exception.
|
||||
|
||||
This feature is somewhat experimental. User feedback would be
|
||||
appreciated.
|
||||
|
||||
* Noteworthy changes in release 2.6.2 (2012-08-03) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
@@ -4701,6 +4701,10 @@ incoming terminals during the second phase of error recovery,
|
||||
the current lookahead and the entire stack (except the current
|
||||
right-hand side symbols) when the parser returns immediately, and
|
||||
@item
|
||||
the current lookahead and the entire stack (including the current right-hand
|
||||
side symbols) when the C++ parser (@file{lalr1.cc}) catches an exception in
|
||||
@code{parse},
|
||||
@item
|
||||
the start symbol, when the parser succeeds.
|
||||
@end itemize
|
||||
|
||||
@@ -9415,6 +9419,11 @@ Build a new parser object. There are no arguments by default, unless
|
||||
|
||||
@deftypemethod {parser} {int} parse ()
|
||||
Run the syntactic analysis, and return 0 on success, 1 otherwise.
|
||||
|
||||
@cindex exceptions
|
||||
The whole function is wrapped in a @code{try}/@code{catch} block, so that
|
||||
when an exception is thrown, the @code{%destructor}s are called to release
|
||||
the lookahead symbol, and the symbols pushed on the stack.
|
||||
@end deftypemethod
|
||||
|
||||
@deftypemethod {parser} {std::ostream&} debug_stream ()
|
||||
|
||||
Reference in New Issue
Block a user