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

9
NEWS
View File

@@ -24,6 +24,15 @@ Bison News
Also, it is possible to add code to the parser's constructors using
"%code init" and "%define init_throws".
** C++ skeleton improvements
The C++ parser features a syntax_error exception, which can be
thrown from the scanner or from user rules to raise syntax errors.
This facilitates reporting errors caught in sub-functions (e.g.,
rejecting too large integral literals from a conversion function
used by the scanner, or rejecting invalid combinations from a
factory invoked by the user actions).
** Variable api.tokens.prefix
The variable api.tokens.prefix changes the way tokens are identified in