mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user