lalr1.cc: also handle syntax_error when calling yylex.

* data/lalr1.cc (parse): Catch syntax_error around yylex and
	forward them to errlab1.
	* tests/c++.at (Syntax error as exception): Check support for
	syntax exceptions raised by the scanner.
	* NEWS, doc/bison.texinfo: Document it.
This commit is contained in:
Akim Demaille
2011-06-30 14:10:21 +02:00
parent 199a2d6d72
commit a6552c5d2a
4 changed files with 39 additions and 7 deletions

View File

@@ -9270,7 +9270,8 @@ scanner should use @code{yy::parser::token::FOO}. The scanner can use
@defcv {Type} {parser} {syntax_error}
This class derives from @code{std::runtime_error}. Throw instances of it
from user actions to raise parse errors. This is equivalent with first
from the scanner or from the user actions to raise parse errors. This is
equivalent with first
invoking @code{error} to report the location and message of the syntax
error, and then to invoke @code{YYERROR} to enter the error-recovery mode.
But contrary to @code{YYERROR} which can only be invoked from user actions