Merge branch 'maint'

* origin/maint:
  NEWS: warnings with clang
  warnings: avoid warnings from clang
  tests: no longer disable -O compiler options
  yacc.c: initialize yylval in pure-parser mode
  skeletons: style changes
  lalr1.cc: document exception safety
  lalr1.cc: check exception safety of error handling
  lalr1.cc: check (and fix) %printer exception safety
  lalr1.cc: check (and fix) %initial-action exception safety
  lalr1.cc: fix exception safety
  lalr1.cc: check exception safety.
  lalr1.cc: indentation fixes.
  lalr1.cc: don't leave macros define to nothing
  tests: minor improvements
  tests: use $PERL instead of perl
  build: look for Perl in configure.
  tests: fix sed portability issues
  tests: diff -u is not portable

Conflicts:
	data/c.m4
	data/glr.c
	data/lalr1.cc
	data/yacc.c
	doc/Makefile.am
	tests/atlocal.in
	tests/calc.at
This commit is contained in:
Akim Demaille
2012-10-10 17:31:25 +02:00
18 changed files with 388 additions and 71 deletions

View File

@@ -683,6 +683,10 @@ m4_if(b4_prefix, [yy], [],
/// The return value of parse ().
int yyresult;
// FIXME: This shoud be completely indented. It is not yet to
// avoid gratuitous conflicts when merging into the master branch.
try
{
YYCDEBUG << "Starting parse" << std::endl;
]m4_ifdef([b4_initial_action], [
@@ -955,7 +959,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
yypop_ (yylen);
while (yystack_.size () != 1)
while (1 < yystack_.size ())
{
yy_destroy_ ("Cleanup: popping", yystack_[0]);
yypop_ ();
@@ -963,6 +967,23 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
return yyresult;
}
catch (...)
{
YYCDEBUG << "Exception caught: cleaning lookahead and stack"
<< std::endl;
// Do not try to display the values of the reclaimed symbols,
// as their printer might throw an exception.
if (!yyempty)
yy_destroy_ (YY_NULL, yyla);
while (1 < yystack_.size ())
{
yy_destroy_ (YY_NULL, yystack_[0]);
yypop_ ();
}
throw;
}
}
void
]b4_parser_class_name[::error (const syntax_error& yyexc)