c++11: replace push(Type(args...)) by emplace(args...)

This of course concerns push_back and push_front as well.

* src/bin/common_finput.cc, src/bin/dstar2tgba.cc, src/bin/ltl2tgba.cc,
src/bin/ltl2tgta.cc, src/bin/ltlcross.cc, src/bin/ltlfilt.cc,
src/dstarparse/dstarparse.yy, src/kripkeparse/kripkeparse.yy,
src/ltlast/formula.cc, src/ltlparse/ltlparse.yy, src/misc/minato.cc,
src/neverparse/neverclaimparse.yy, src/priv/bddalloc.cc, src/ta/ta.cc,
src/taalgos/emptinessta.cc, src/tgba/taatgba.cc,
src/tgbaalgos/gtec/gtec.cc, src/tgbaalgos/gtec/sccstack.cc,
src/tgbaalgos/magic.cc, src/tgbaalgos/ndfs_result.hxx,
src/tgbaalgos/rundotdec.cc, src/tgbaalgos/scc.cc, src/tgbaalgos/se05.cc,
src/tgbaalgos/simulation.cc, src/tgbaalgos/tau03.cc,
src/tgbaalgos/tau03opt.cc, src/tgbaparse/tgbaparse.yy: Use emplace
to make the code less verbose and avoid creating temporaries.
This commit is contained in:
Alexandre Duret-Lutz 2014-01-28 23:33:07 +01:00
parent e0bbc2655d
commit 49c66c6319
27 changed files with 189 additions and 202 deletions

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement // Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -56,10 +56,10 @@ parse_opt_finput(int key, char* arg, struct argp_state*)
switch (key) switch (key)
{ {
case 'f': case 'f':
jobs.push_back(job(arg, false)); jobs.emplace_back(arg, false);
break; break;
case 'F': case 'F':
jobs.push_back(job(arg, true)); jobs.emplace_back(arg, true);
break; break;
case OPT_LBT: case OPT_LBT:
lbt_input = true; lbt_input = true;

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2013 Laboratoire de Recherche et Développement de // Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement de
// l'Epita (LRDE). // l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -140,7 +140,7 @@ parse_opt(int key, char* arg, struct argp_state*)
type = spot::postprocessor::BA; type = spot::postprocessor::BA;
break; break;
case 'F': case 'F':
jobs.push_back(job(arg, true)); jobs.emplace_back(arg, true);
break; break;
case 'M': case 'M':
type = spot::postprocessor::Monitor; type = spot::postprocessor::Monitor;
@ -188,7 +188,7 @@ parse_opt(int key, char* arg, struct argp_state*)
type = spot::postprocessor::TGBA; type = spot::postprocessor::TGBA;
break; break;
case ARGP_KEY_ARG: case ARGP_KEY_ARG:
jobs.push_back(job(arg, true)); jobs.emplace_back(arg, true);
break; break;
default: default:
@ -370,7 +370,7 @@ main(int argc, char** argv)
exit(err); exit(err);
if (jobs.empty()) if (jobs.empty())
jobs.push_back(job("-", true)); jobs.emplace_back("-", true);
spot::postprocessor post(&extra_options); spot::postprocessor post(&extra_options);
post.set_pref(pref | comp); post.set_pref(pref | comp);

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement // Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -186,7 +186,7 @@ parse_opt(int key, char* arg, struct argp_state*)
break; break;
case ARGP_KEY_ARG: case ARGP_KEY_ARG:
// FIXME: use stat() to distinguish filename from string? // FIXME: use stat() to distinguish filename from string?
jobs.push_back(job(arg, false)); jobs.emplace_back(arg, false);
break; break;
default: default:

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement // Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -144,7 +144,7 @@ parse_opt(int key, char* arg, struct argp_state*)
break; break;
case ARGP_KEY_ARG: case ARGP_KEY_ARG:
// FIXME: use stat() to distinguish filename from string? // FIXME: use stat() to distinguish filename from string?
jobs.push_back(job(arg, false)); jobs.emplace_back(arg, false);
break; break;
default: default:

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement // Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -1613,7 +1613,7 @@ main(int argc, char** argv)
exit(err); exit(err);
if (jobs.empty()) if (jobs.empty())
jobs.push_back(job("-", 1)); jobs.emplace_back("-", 1);
if (translators.empty()) if (translators.empty())
error(2, 0, "No translator to run? Run '%s --help' for usage.", error(2, 0, "No translator to run? Run '%s --help' for usage.",

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement de // Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// l'Epita (LRDE). // Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -270,7 +270,7 @@ parse_opt(int key, char* arg, struct argp_state*)
break; break;
case ARGP_KEY_ARG: case ARGP_KEY_ARG:
// FIXME: use stat() to distinguish filename from string? // FIXME: use stat() to distinguish filename from string?
jobs.push_back(job(arg, true)); jobs.emplace_back(arg, true);
break; break;
case OPT_BOOLEAN: case OPT_BOOLEAN:
boolean = true; boolean = true;
@ -598,7 +598,7 @@ main(int argc, char** argv)
exit(err); exit(err);
if (jobs.empty()) if (jobs.empty())
jobs.push_back(job("-", 1)); jobs.emplace_back("-", 1);
// --stutter-insensitive implies --ltl // --stutter-insensitive implies --ltl
ltl |= stutter_insensitive; ltl |= stutter_insensitive;

View file

@ -1,6 +1,6 @@
/* -*- coding: utf-8 -*- /* -*- coding: utf-8 -*-
** Copyright (C) 2013 Laboratoire de Recherche et Développement de ** Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement
** l'Epita (LRDE). ** de l'Epita (LRDE).
** **
** This file is part of Spot, a model checking library. ** This file is part of Spot, a model checking library.
** **
@ -309,7 +309,7 @@ void
dstaryy::parser::error(const location_type& location, dstaryy::parser::error(const location_type& location,
const std::string& message) const std::string& message)
{ {
error_list.push_back(spot::dstar_parse_error(location, message)); error_list.emplace_back(location, message);
} }
namespace spot namespace spot
@ -323,9 +323,8 @@ namespace spot
{ {
if (dstaryyopen(name)) if (dstaryyopen(name))
{ {
error_list.push_back error_list.emplace_back(spot::location(),
(dstar_parse_error(spot::location(), std::string("Cannot open file ") + name);
std::string("Cannot open file ") + name));
return 0; return 0;
} }
result_ r; result_ r;

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2011, 2012, 2013 Laboratoire de Recherche et // Copyright (C) 2011, 2012, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE) // Développement de l'Epita (LRDE)
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -121,8 +121,7 @@ strident "," condition "," follow_list ";"
here.begin.column + i->first.end.column; here.begin.column + i->first.end.column;
here.begin.line += i->first.begin.line - 1; here.begin.line += i->first.begin.line - 1;
here.begin.column += i->first.begin.column; here.begin.column += i->first.begin.column;
error_list.push_back(spot::kripke_parse_error(here, error_list.emplace_back(here, i->second);
i->second));
} }
if (f) if (f)
result->add_condition(f, *$1); result->add_condition(f, *$1);
@ -154,8 +153,7 @@ string: STRING
| UNTERMINATED_STRING | UNTERMINATED_STRING
{ {
$$ = $1; $$ = $1;
error_list.push_back(spot::kripke_parse_error(@1, error_list.emplace_back(@1, "unterminated string");
"unterminated string"));
} }
; ;
@ -192,7 +190,7 @@ void
kripkeyy::parser::error(const location_type& location, kripkeyy::parser::error(const location_type& location,
const std::string& message) const std::string& message)
{ {
error_list.push_back(spot::kripke_parse_error(location, message)); error_list.emplace_back(location, message);
} }
namespace spot namespace spot

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2011, 2012, 2013 Laboratoire de Recherche et // Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de
// Développement de l'Epita (LRDE). // Recherche et Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2003, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
@ -96,7 +96,7 @@ namespace spot
std::list<std::string> res; std::list<std::string> res;
#define proprint(m, a, l) \ #define proprint(m, a, l) \
if (f->m()) \ if (f->m()) \
res.push_back(std::string(l)); res.emplace_back(l);
printprops; printprops;
#undef proprint #undef proprint
return res; return res;

View file

@ -59,8 +59,8 @@
using namespace spot::ltl; using namespace spot::ltl;
#define missing_right_op_msg(op, str) \ #define missing_right_op_msg(op, str) \
error_list.push_back(parse_error(op, \ error_list.emplace_back(op, \
"missing right operand for \"" str "\"")); "missing right operand for \"" str "\"");
#define missing_right_op(res, op, str) \ #define missing_right_op(res, op, str) \
do \ do \
@ -115,8 +115,7 @@ using namespace spot::ltl;
if (str.empty()) if (str.empty())
{ {
error_list.push_back(parse_error(location, error_list.emplace_back(location, "unexpected empty block");
"unexpected empty block"));
return 0; return 0;
} }
@ -149,7 +148,7 @@ using namespace spot::ltl;
s += "' rejected by environment `"; s += "' rejected by environment `";
s += env.name(); s += env.name();
s += "'"; s += "'";
error_list.push_back(parse_error(location, s)); error_list.emplace_back(location, s);
} }
return f; return f;
} }
@ -308,14 +307,13 @@ result: START_LTL subformula END_OF_INPUT
emptyinput: END_OF_INPUT emptyinput: END_OF_INPUT
{ {
error_list.push_back(parse_error(@$, "empty input")); error_list.emplace_back(@$, "empty input");
result = 0; result = 0;
} }
enderror: error END_OF_INPUT enderror: error END_OF_INPUT
{ {
error_list.push_back(parse_error(@1, error_list.emplace_back(@1, "ignoring trailing garbage");
"ignoring trailing garbage"));
} }
@ -349,12 +347,11 @@ gotoargs: OP_GOTO_OPEN OP_SQBKT_NUM OP_SQBKT_SEP OP_SQBKT_NUM OP_SQBKT_CLOSE
| OP_GOTO_OPEN OP_SQBKT_NUM OP_SQBKT_CLOSE | OP_GOTO_OPEN OP_SQBKT_NUM OP_SQBKT_CLOSE
{ $$.min = $$.max = $2; } { $$.min = $$.max = $2; }
| OP_GOTO_OPEN error OP_SQBKT_CLOSE | OP_GOTO_OPEN error OP_SQBKT_CLOSE
{ error_list.push_back(parse_error(@$, { error_list.emplace_back(@$, "treating this goto block as [->]");
"treating this goto block as [->]"));
$$.min = $$.max = 1U; } $$.min = $$.max = 1U; }
| OP_GOTO_OPEN error_opt END_OF_INPUT | OP_GOTO_OPEN error_opt END_OF_INPUT
{ error_list.push_back(parse_error(@$, { error_list.
"missing closing bracket for goto operator")); emplace_back(@$, "missing closing bracket for goto operator");
$$.min = $$.max = 0U; } $$.min = $$.max = 0U; }
kleen_star: OP_STAR | OP_BSTAR kleen_star: OP_STAR | OP_BSTAR
@ -366,23 +363,20 @@ starargs: kleen_star
| OP_STAR_OPEN sqbracketargs | OP_STAR_OPEN sqbracketargs
{ $$ = $2; } { $$ = $2; }
| OP_STAR_OPEN error OP_SQBKT_CLOSE | OP_STAR_OPEN error OP_SQBKT_CLOSE
{ error_list.push_back(parse_error(@$, { error_list.emplace_back(@$, "treating this star block as [*]");
"treating this star block as [*]"));
$$.min = 0U; $$.max = bunop::unbounded; } $$.min = 0U; $$.max = bunop::unbounded; }
| OP_STAR_OPEN error_opt END_OF_INPUT | OP_STAR_OPEN error_opt END_OF_INPUT
{ error_list.push_back(parse_error(@$, { error_list.emplace_back(@$, "missing closing bracket for star");
"missing closing bracket for star"));
$$.min = $$.max = 0U; } $$.min = $$.max = 0U; }
equalargs: OP_EQUAL_OPEN sqbracketargs equalargs: OP_EQUAL_OPEN sqbracketargs
{ $$ = $2; } { $$ = $2; }
| OP_EQUAL_OPEN error OP_SQBKT_CLOSE | OP_EQUAL_OPEN error OP_SQBKT_CLOSE
{ error_list.push_back(parse_error(@$, { error_list.emplace_back(@$, "treating this equal block as [*]");
"treating this equal block as [*]"));
$$.min = 0U; $$.max = bunop::unbounded; } $$.min = 0U; $$.max = bunop::unbounded; }
| OP_EQUAL_OPEN error_opt END_OF_INPUT | OP_EQUAL_OPEN error_opt END_OF_INPUT
{ error_list.push_back(parse_error(@$, { error_list.
"missing closing bracket for equal operator")); emplace_back(@$, "missing closing bracket for equal operator");
$$.min = $$.max = 0U; } $$.min = $$.max = 0U; }
@ -399,7 +393,7 @@ booleanatom: ATOMIC_PROP
s += "' in environment `"; s += "' in environment `";
s += parse_environment.name(); s += parse_environment.name();
s += "'"; s += "'";
error_list.push_back(parse_error(@1, s)); error_list.emplace_back(@1, s);
delete $1; delete $1;
YYERROR; YYERROR;
} }
@ -416,7 +410,7 @@ booleanatom: ATOMIC_PROP
s += "' in environment `"; s += "' in environment `";
s += parse_environment.name(); s += parse_environment.name();
s += "'"; s += "'";
error_list.push_back(parse_error(@1, s)); error_list.emplace_back(@1, s);
delete $1; delete $1;
YYERROR; YYERROR;
} }
@ -433,7 +427,7 @@ booleanatom: ATOMIC_PROP
s += "' in environment `"; s += "' in environment `";
s += parse_environment.name(); s += parse_environment.name();
s += "'"; s += "'";
error_list.push_back(parse_error(@1, s)); error_list.emplace_back(@1, s);
delete $1; delete $1;
YYERROR; YYERROR;
} }
@ -455,11 +449,10 @@ sere: booleanatom
} }
else else
{ {
error_list.push_back(parse_error(@2, error_list.emplace_back(@2,
"not a boolean expression: inside a SERE `!' can only " "not a boolean expression: inside a SERE `!' can only "
"be applied to a Boolean expression")); "be applied to a Boolean expression");
error_list.push_back(parse_error(@$, error_list.emplace_back(@$, "treating this block as false");
"treating this block as false"));
$2->destroy(); $2->destroy();
$$ = constant::false_instance(); $$ = constant::false_instance();
} }
@ -476,19 +469,19 @@ sere: booleanatom
| PAR_OPEN sere PAR_CLOSE | PAR_OPEN sere PAR_CLOSE
{ $$ = $2; } { $$ = $2; }
| PAR_OPEN error PAR_CLOSE | PAR_OPEN error PAR_CLOSE
{ error_list.push_back(parse_error(@$, { error_list.
"treating this parenthetical block as false")); emplace_back(@$,
"treating this parenthetical block as false");
$$ = constant::false_instance(); $$ = constant::false_instance();
} }
| PAR_OPEN sere END_OF_INPUT | PAR_OPEN sere END_OF_INPUT
{ error_list.push_back(parse_error(@1 + @2, { error_list.emplace_back(@1 + @2, "missing closing parenthesis");
"missing closing parenthesis"));
$$ = $2; $$ = $2;
} }
| PAR_OPEN error END_OF_INPUT | PAR_OPEN error END_OF_INPUT
{ error_list.push_back(parse_error(@$, { error_list.emplace_back(@$,
"missing closing parenthesis, " "missing closing parenthesis, "
"treating this parenthetical block as false")); "treating this parenthetical block as false");
$$ = constant::false_instance(); $$ = constant::false_instance();
} }
| sere OP_AND sere | sere OP_AND sere
@ -517,7 +510,7 @@ sere: booleanatom
{ {
if ($2.max < $2.min) if ($2.max < $2.min)
{ {
error_list.push_back(parse_error(@2, "reversed range")); error_list.emplace_back(@2, "reversed range");
std::swap($2.max, $2.min); std::swap($2.max, $2.min);
} }
$$ = bunop::instance(bunop::Star, $1, $2.min, $2.max); $$ = bunop::instance(bunop::Star, $1, $2.min, $2.max);
@ -526,7 +519,7 @@ sere: booleanatom
{ {
if ($1.max < $1.min) if ($1.max < $1.min)
{ {
error_list.push_back(parse_error(@1, "reversed range")); error_list.emplace_back(@1, "reversed range");
std::swap($1.max, $1.min); std::swap($1.max, $1.min);
} }
$$ = bunop::instance(bunop::Star, constant::true_instance(), $$ = bunop::instance(bunop::Star, constant::true_instance(),
@ -536,7 +529,7 @@ sere: booleanatom
{ {
if ($2.max < $2.min) if ($2.max < $2.min)
{ {
error_list.push_back(parse_error(@2, "reversed range")); error_list.emplace_back(@2, "reversed range");
std::swap($2.max, $2.min); std::swap($2.max, $2.min);
} }
if ($1->is_boolean()) if ($1->is_boolean())
@ -545,11 +538,11 @@ sere: booleanatom
} }
else else
{ {
error_list.push_back(parse_error(@1, error_list.emplace_back(@1,
"not a boolean expression: [=...] can only " "not a boolean expression: [=...] can only "
"be applied to a Boolean expression")); "be applied to a Boolean expression");
error_list.push_back(parse_error(@$, error_list.emplace_back(@$,
"treating this block as false")); "treating this block as false");
$1->destroy(); $1->destroy();
$$ = constant::false_instance(); $$ = constant::false_instance();
} }
@ -558,7 +551,7 @@ sere: booleanatom
{ {
if ($2.max < $2.min) if ($2.max < $2.min)
{ {
error_list.push_back(parse_error(@2, "reversed range")); error_list.emplace_back(@2, "reversed range");
std::swap($2.max, $2.min); std::swap($2.max, $2.min);
} }
if ($1->is_boolean()) if ($1->is_boolean())
@ -567,11 +560,11 @@ sere: booleanatom
} }
else else
{ {
error_list.push_back(parse_error(@1, error_list.emplace_back(@1,
"not a boolean expression: [->...] can only " "not a boolean expression: [->...] can only "
"be applied to a Boolean expression")); "be applied to a Boolean expression");
error_list.push_back(parse_error(@$, error_list.emplace_back(@$,
"treating this block as false")); "treating this block as false");
$1->destroy(); $1->destroy();
$$ = constant::false_instance(); $$ = constant::false_instance();
} }
@ -586,18 +579,17 @@ sere: booleanatom
{ {
if (!$1->is_boolean()) if (!$1->is_boolean())
{ {
error_list.push_back(parse_error(@1, error_list.emplace_back(@1,
"not a boolean expression: inside SERE `<->' can only " "not a boolean expression: inside SERE `<->' can only "
"be applied to Boolean expressions")); "be applied to Boolean expressions");
} }
if (!$3->is_boolean()) if (!$3->is_boolean())
{ {
error_list.push_back(parse_error(@3, error_list.emplace_back(@3,
"not a boolean expression: inside SERE `<->' can only " "not a boolean expression: inside SERE `<->' can only "
"be applied to Boolean expressions")); "be applied to Boolean expressions");
} }
error_list.push_back(parse_error(@$, error_list.emplace_back(@$, "treating this block as false");
"treating this block as false"));
$1->destroy(); $1->destroy();
$3->destroy(); $3->destroy();
$$ = constant::false_instance(); $$ = constant::false_instance();
@ -615,12 +607,11 @@ sere: booleanatom
{ {
if (!$1->is_boolean()) if (!$1->is_boolean())
{ {
error_list.push_back(parse_error(@1, error_list.emplace_back(@1,
"not a boolean expression: inside SERE `->' can only " "not a boolean expression: inside SERE `->' can only "
"be applied to a Boolean expression")); "be applied to a Boolean expression");
} }
error_list.push_back(parse_error(@$, error_list.emplace_back(@$, "treating this block as false");
"treating this block as false"));
$1->destroy(); $1->destroy();
$3->destroy(); $3->destroy();
$$ = constant::false_instance(); $$ = constant::false_instance();
@ -638,18 +629,17 @@ sere: booleanatom
{ {
if (!$1->is_boolean()) if (!$1->is_boolean())
{ {
error_list.push_back(parse_error(@1, error_list.emplace_back(@1,
"not a boolean expression: inside SERE `<->' can only " "not a boolean expression: inside SERE `<->' can only "
"be applied to Boolean expressions")); "be applied to Boolean expressions");
} }
if (!$3->is_boolean()) if (!$3->is_boolean())
{ {
error_list.push_back(parse_error(@3, error_list.emplace_back(@3,
"not a boolean expression: inside SERE `<->' can only " "not a boolean expression: inside SERE `<->' can only "
"be applied to Boolean expressions")); "be applied to Boolean expressions");
} }
error_list.push_back(parse_error(@$, error_list.emplace_back(@$, "treating this block as false");
"treating this block as false"));
$1->destroy(); $1->destroy();
$3->destroy(); $3->destroy();
$$ = constant::false_instance(); $$ = constant::false_instance();
@ -661,28 +651,28 @@ sere: booleanatom
bracedsere: BRACE_OPEN sere BRACE_CLOSE bracedsere: BRACE_OPEN sere BRACE_CLOSE
{ $$ = $2; } { $$ = $2; }
| BRACE_OPEN sere error BRACE_CLOSE | BRACE_OPEN sere error BRACE_CLOSE
{ error_list.push_back(parse_error(@3, "ignoring this")); { error_list.emplace_back(@3, "ignoring this");
$$ = $2; $$ = $2;
} }
| BRACE_OPEN error BRACE_CLOSE | BRACE_OPEN error BRACE_CLOSE
{ error_list.push_back(parse_error(@$, { error_list.emplace_back(@$,
"treating this brace block as false")); "treating this brace block as false");
$$ = constant::false_instance(); $$ = constant::false_instance();
} }
| BRACE_OPEN sere END_OF_INPUT | BRACE_OPEN sere END_OF_INPUT
{ error_list.push_back(parse_error(@1 + @2, { error_list.emplace_back(@1 + @2,
"missing closing brace")); "missing closing brace");
$$ = $2; $$ = $2;
} }
| BRACE_OPEN sere error END_OF_INPUT | BRACE_OPEN sere error END_OF_INPUT
{ error_list.push_back(parse_error(@3, { error_list. emplace_back(@3,
"ignoring trailing garbage and missing closing brace")); "ignoring trailing garbage and missing closing brace");
$$ = $2; $$ = $2;
} }
| BRACE_OPEN error END_OF_INPUT | BRACE_OPEN error END_OF_INPUT
{ error_list.push_back(parse_error(@$, { error_list.emplace_back(@$,
"missing closing brace, " "missing closing brace, "
"treating this brace block as false")); "treating this brace block as false");
$$ = constant::false_instance(); $$ = constant::false_instance();
} }
| BRA_BLOCK | BRA_BLOCK
@ -706,28 +696,27 @@ parenthesedsubformula: PAR_BLOCK
| PAR_OPEN subformula PAR_CLOSE | PAR_OPEN subformula PAR_CLOSE
{ $$ = $2; } { $$ = $2; }
| PAR_OPEN subformula error PAR_CLOSE | PAR_OPEN subformula error PAR_CLOSE
{ error_list.push_back(parse_error(@3, "ignoring this")); { error_list.emplace_back(@3, "ignoring this");
$$ = $2; $$ = $2;
} }
| PAR_OPEN error PAR_CLOSE | PAR_OPEN error PAR_CLOSE
{ error_list.push_back(parse_error(@$, { error_list.emplace_back(@$,
"treating this parenthetical block as false")); "treating this parenthetical block as false");
$$ = constant::false_instance(); $$ = constant::false_instance();
} }
| PAR_OPEN subformula END_OF_INPUT | PAR_OPEN subformula END_OF_INPUT
{ error_list.push_back(parse_error(@1 + @2, { error_list.emplace_back(@1 + @2, "missing closing parenthesis");
"missing closing parenthesis"));
$$ = $2; $$ = $2;
} }
| PAR_OPEN subformula error END_OF_INPUT | PAR_OPEN subformula error END_OF_INPUT
{ error_list.push_back(parse_error(@3, { error_list.emplace_back(@3,
"ignoring trailing garbage and missing closing parenthesis")); "ignoring trailing garbage and missing closing parenthesis");
$$ = $2; $$ = $2;
} }
| PAR_OPEN error END_OF_INPUT | PAR_OPEN error END_OF_INPUT
{ error_list.push_back(parse_error(@$, { error_list.emplace_back(@$,
"missing closing parenthesis, " "missing closing parenthesis, "
"treating this parenthetical block as false")); "treating this parenthetical block as false");
$$ = constant::false_instance(); $$ = constant::false_instance();
} }
@ -744,28 +733,28 @@ boolformula: booleanatom
| PAR_OPEN boolformula PAR_CLOSE | PAR_OPEN boolformula PAR_CLOSE
{ $$ = $2; } { $$ = $2; }
| PAR_OPEN boolformula error PAR_CLOSE | PAR_OPEN boolformula error PAR_CLOSE
{ error_list.push_back(parse_error(@3, "ignoring this")); { error_list.emplace_back(@3, "ignoring this");
$$ = $2; $$ = $2;
} }
| PAR_OPEN error PAR_CLOSE | PAR_OPEN error PAR_CLOSE
{ error_list.push_back(parse_error(@$, { error_list.emplace_back(@$,
"treating this parenthetical block as false")); "treating this parenthetical block as false");
$$ = constant::false_instance(); $$ = constant::false_instance();
} }
| PAR_OPEN boolformula END_OF_INPUT | PAR_OPEN boolformula END_OF_INPUT
{ error_list.push_back(parse_error(@1 + @2, { error_list.emplace_back(@1 + @2,
"missing closing parenthesis")); "missing closing parenthesis");
$$ = $2; $$ = $2;
} }
| PAR_OPEN boolformula error END_OF_INPUT | PAR_OPEN boolformula error END_OF_INPUT
{ error_list.push_back(parse_error(@3, { error_list.emplace_back(@3,
"ignoring trailing garbage and missing closing parenthesis")); "ignoring trailing garbage and missing closing parenthesis");
$$ = $2; $$ = $2;
} }
| PAR_OPEN error END_OF_INPUT | PAR_OPEN error END_OF_INPUT
{ error_list.push_back(parse_error(@$, { error_list.emplace_back(@$,
"missing closing parenthesis, " "missing closing parenthesis, "
"treating this parenthetical block as false")); "treating this parenthetical block as false");
$$ = constant::false_instance(); $$ = constant::false_instance();
} }
| boolformula OP_AND boolformula | boolformula OP_AND boolformula
@ -923,7 +912,7 @@ lbtformula: ATOMIC_PROP
s += "' rejected by environment `"; s += "' rejected by environment `";
s += parse_environment.name(); s += parse_environment.name();
s += "'"; s += "'";
error_list.push_back(parse_error(@1, s)); error_list.emplace_back(@1, s);
delete $1; delete $1;
YYERROR; YYERROR;
} }
@ -969,7 +958,7 @@ lbtformula: ATOMIC_PROP
void void
ltlyy::parser::error(const location_type& location, const std::string& message) ltlyy::parser::error(const location_type& location, const std::string& message)
{ {
error_list.push_back(parse_error(location, message)); error_list.emplace_back(location, message);
} }
namespace spot namespace spot

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2009, 2013 Laboratoire de Recherche et Développement // Copyright (C) 2009, 2013, 2014 Laboratoire de Recherche et
// de l'Epita (LRDE). // Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris // Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), // 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie. // Université Pierre et Marie Curie.
@ -39,14 +39,14 @@ namespace spot
// original algorithm, because in many cases we are trying to // original algorithm, because in many cases we are trying to
// build ISOPs out of formulae that are already cubes. // build ISOPs out of formulae that are already cubes.
cube_.push(bdd_satprefix(input)); cube_.push(bdd_satprefix(input));
todo_.push(local_vars(input, input, bdd_support(input))); todo_.emplace(input, input, bdd_support(input));
} }
minato_isop::minato_isop(bdd input, bdd vars) minato_isop::minato_isop(bdd input, bdd vars)
: ret_(bddfalse) : ret_(bddfalse)
{ {
cube_.push(bdd_satprefix(input)); cube_.push(bdd_satprefix(input));
todo_.push(local_vars(input, input, vars)); todo_.emplace(input, input, vars);
} }
bdd bdd
@ -129,7 +129,7 @@ namespace spot
} }
cube_.push(cube_.top() & v0); cube_.push(cube_.top() & v0);
todo_.push(local_vars(l.f0_min - l.f1_max, l.f0_max, l.vars)); todo_.emplace(l.f0_min - l.f1_max, l.f0_max, l.vars);
} }
continue; continue;
@ -138,7 +138,7 @@ namespace spot
l.g0 = ret_; l.g0 = ret_;
cube_.pop(); cube_.pop();
cube_.push(cube_.top() & l.v1); cube_.push(cube_.top() & l.v1);
todo_.push(local_vars(l.f1_min - l.f0_max, l.f1_max, l.vars)); todo_.emplace(l.f1_min - l.f0_max, l.f1_max, l.vars);
continue; continue;
case local_vars::ThirdStep: case local_vars::ThirdStep:
@ -148,7 +148,7 @@ namespace spot
{ {
bdd fs_max = l.f0_max & l.f1_max; bdd fs_max = l.f0_max & l.f1_max;
bdd fs_min = fs_max & ((l.f0_min - l.g0) | (l.f1_min - l.g1)); bdd fs_min = fs_max & ((l.f0_min - l.g0) | (l.f1_min - l.g1));
todo_.push(local_vars(fs_min, fs_max, l.vars)); todo_.emplace(fs_min, fs_max, l.vars);
} }
continue; continue;

View file

@ -1,6 +1,6 @@
/* -*- coding: utf-8 -*- /* -*- coding: utf-8 -*-
** Copyright (C) 2010, 2011, 2012, 2013 Laboratoire de Recherche et ** Copyright (C) 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche
** Développement de l'Epita (LRDE). ** et Développement de l'Epita (LRDE).
** **
** This file is part of Spot, a model checking library. ** This file is part of Spot, a model checking library.
** **
@ -259,7 +259,7 @@ void
neverclaimyy::parser::error(const location_type& location, neverclaimyy::parser::error(const location_type& location,
const std::string& message) const std::string& message)
{ {
error_list.push_back(spot::neverclaim_parse_error(location, message)); error_list.emplace_back(location, message);
} }
namespace spot namespace spot
@ -273,9 +273,8 @@ namespace spot
{ {
if (neverclaimyyopen(name)) if (neverclaimyyopen(name))
{ {
error_list.push_back error_list.emplace_back(spot::location(),
(neverclaim_parse_error(spot::location(), std::string("Cannot open file ") + name);
std::string("Cannot open file ") + name));
return 0; return 0;
} }
tgba_explicit_string* result = new tgba_explicit_string(dict); tgba_explicit_string* result = new tgba_explicit_string(dict);

View file

@ -1,8 +1,9 @@
// Copyright (C) 2007, 2011 Laboratoire de Recherche et Développement // -*- coding: utf-8 -*-
// de l'Epita (LRDE). // Copyright (C) 2007, 2011, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004, 2006, 2007 Laboratoire d'Informatique de // Copyright (C) 2003, 2004, 2006, 2007 Laboratoire d'Informatique de
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), // Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie. // Université Pierre et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -32,7 +33,7 @@ namespace spot
{ {
initialize(); initialize();
lvarnum = bdd_varnum(); lvarnum = bdd_varnum();
fl.push_front(pos_lenght_pair(0, lvarnum)); fl.emplace_front(0, lvarnum);
} }
void void

View file

@ -1,5 +1,6 @@
// Copyright (C) 2010, 2011 Laboratoire de Recherche et Developpement // -*- coding: utf-8 -*-
// de l Epita (LRDE). // Copyright (C) 2010, 2011, 2014 Laboratoire de Recherche et
// Developpement de l Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -52,7 +53,7 @@ namespace spot
void void
scc_stack_ta::push(int index) scc_stack_ta::push(int index)
{ {
s.push_front(connected_component(index)); s.emplace_front(index);
} }
std::list<state*>& std::list<state*>&

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2010, 2011, 2012, 2013 Laboratoire de Recherche et // Copyright (C) 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche
// Développement de l'Epita (LRDE). // et Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -118,7 +118,7 @@ namespace spot
ta_succ_iterator_product* iter = a_->succ_iter(init); ta_succ_iterator_product* iter = a_->succ_iter(init);
iter->first(); iter->first();
todo.push(pair_state_iter(init, iter)); todo.emplace(init, iter);
inc_depth(); inc_depth();
@ -245,7 +245,7 @@ namespace spot
ta_succ_iterator_product* iter = a_->succ_iter(dest); ta_succ_iterator_product* iter = a_->succ_iter(dest);
iter->first(); iter->first();
todo.push(pair_state_iter(dest, iter)); todo.emplace(dest, iter);
//colour[dest] = GREY; //colour[dest] = GREY;
inc_depth(); inc_depth();
@ -467,7 +467,7 @@ namespace spot
sscc.top().is_accepting = t->is_livelock_accepting_state(init); sscc.top().is_accepting = t->is_livelock_accepting_state(init);
ta_succ_iterator_product* iter = t->succ_iter(init); ta_succ_iterator_product* iter = t->succ_iter(init);
iter->first(); iter->first();
todo.push(pair_state_iter(init, iter)); todo.emplace(init, iter);
inc_depth(); inc_depth();
} }
@ -561,7 +561,7 @@ namespace spot
ta_succ_iterator_product* iter = t->succ_iter(dest); ta_succ_iterator_product* iter = t->succ_iter(dest);
iter->first(); iter->first();
todo.push(pair_state_iter(dest, iter)); todo.emplace(dest, iter);
inc_depth(); inc_depth();
continue; continue;
} }

View file

@ -206,9 +206,8 @@ namespace spot
} }
bounds_t bounds; bounds_t bounds;
for (taa_tgba::state_set::const_iterator i = s->begin(); for (auto& i: *s)
i != s->end(); ++i) bounds.emplace_back(i->begin(), i->end());
bounds.push_back(std::make_pair((*i)->begin(), (*i)->end()));
/// Sorting might make the cartesian product faster by not /// Sorting might make the cartesian product faster by not
/// exploring all possibilities. /// exploring all possibilities.
@ -216,8 +215,8 @@ namespace spot
std::vector<iterator> pos; std::vector<iterator> pos;
pos.reserve(bounds.size()); pos.reserve(bounds.size());
for (bounds_t::const_iterator i = bounds.begin(); i != bounds.end(); ++i) for (auto i: bounds)
pos.push_back(i->first); pos.push_back(i.first);
while (pos[0] != bounds[0].second) while (pos[0] != bounds[0].second)
{ {

View file

@ -173,7 +173,7 @@ namespace spot
arc.push(bddfalse); arc.push(bddfalse);
tgba_succ_iterator* iter = ecs_->aut->succ_iter(init); tgba_succ_iterator* iter = ecs_->aut->succ_iter(init);
iter->first(); iter->first();
todo.push(pair_state_iter(init, iter)); todo.emplace(init, iter);
inc_depth(); inc_depth();
} }
@ -242,7 +242,7 @@ namespace spot
arc.push(acc); arc.push(acc);
tgba_succ_iterator* iter = ecs_->aut->succ_iter(dest); tgba_succ_iterator* iter = ecs_->aut->succ_iter(dest);
iter->first(); iter->first();
todo.push(pair_state_iter(dest, iter)); todo.emplace(dest, iter);
inc_depth(); inc_depth();
continue; continue;
} }
@ -329,8 +329,8 @@ namespace spot
{ {
for (auto iter: shy->ecs_->aut->succ(s)) for (auto iter: shy->ecs_->aut->succ(s))
{ {
q.push_back(successor(iter->current_acceptance_conditions(), q.emplace_back(iter->current_acceptance_conditions(),
iter->current_state())); iter->current_state());
shy->inc_depth(); shy->inc_depth();
shy->inc_transitions(); shy->inc_transitions();
} }
@ -351,7 +351,7 @@ namespace spot
const state* i = ecs_->aut->get_init_state(); const state* i = ecs_->aut->get_init_state();
ecs_->h->insert(i, ++num); ecs_->h->insert(i, ++num);
ecs_->root.push(num); ecs_->root.push(num);
todo.push_back(todo_item(i, num, this)); todo.emplace_back(i, num, this);
inc_depth(1); inc_depth(1);
} }
@ -510,7 +510,7 @@ namespace spot
ecs_->h->insert(succ.s, ++num); ecs_->h->insert(succ.s, ++num);
ecs_->root.push(num); ecs_->root.push(num);
arc.push(succ.acc); arc.push(succ.acc);
todo.push_back(todo_item(succ.s, num, this)); todo.emplace_back(succ.s, num, this);
pos = todo.back().q.begin(); pos = todo.back().q.begin();
inc_depth(); inc_depth();
continue; continue;

View file

@ -1,5 +1,8 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2014 Laboratoire de Recherche et Developpement de
// l'Epita (LRDE).
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -49,7 +52,7 @@ namespace spot
void void
scc_stack::push(int index) scc_stack::push(int index)
{ {
s.push_front(connected_component(index)); s.emplace_front(index);
} }
std::list<const state*>& std::list<const state*>&

View file

@ -153,7 +153,7 @@ namespace spot
inc_depth(); inc_depth();
tgba_succ_iterator* i = a_->succ_iter(s); tgba_succ_iterator* i = a_->succ_iter(s);
i->first(); i->first();
st.push_front(stack_item(s, i, label, acc)); st.emplace_front(s, i, label, acc);
} }
void pop(stack_type& st) void pop(stack_type& st)

View file

@ -263,7 +263,7 @@ namespace spot
seen.insert(start); seen.insert(start);
tgba_succ_iterator* i = a_->succ_iter(start); tgba_succ_iterator* i = a_->succ_iter(start);
i->first(); i->first();
st1.push_front(stack_item(start, i, bddfalse, bddfalse)); st1.emplace_front(start, i, bddfalse, bddfalse);
while (!st1.empty()) while (!st1.empty())
{ {
@ -292,7 +292,7 @@ namespace spot
seen.insert(s_prime); seen.insert(s_prime);
tgba_succ_iterator* i = a_->succ_iter(s_prime); tgba_succ_iterator* i = a_->succ_iter(s_prime);
i->first(); i->first();
st1.push_front(stack_item(s_prime, i, label, acc)); st1.emplace_front(s_prime, i, label, acc);
} }
else if ((acc & covered_acc) != acc) else if ((acc & covered_acc) != acc)
{ {

View file

@ -1,5 +1,8 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2014 Laboratoire de Recherche et Developpement
// de l'Epita (LRDE).
// Copyright (C) 2004, 2011 Laboratoire d'Informatique de Paris 6 (LIP6), // Copyright (C) 2004, 2011 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie. // et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -30,10 +33,10 @@ namespace spot
int n = 1; int n = 1;
for (tgba_run::steps::const_iterator i = run->prefix.begin(); for (tgba_run::steps::const_iterator i = run->prefix.begin();
i != run->prefix.end(); ++i, ++n) i != run->prefix.end(); ++i, ++n)
map_[i->s].first.push_back(step_num(i, n)); map_[i->s].first.emplace_back(i, n);
for (tgba_run::steps::const_iterator i = run->cycle.begin(); for (tgba_run::steps::const_iterator i = run->cycle.begin();
i != run->cycle.end(); ++i, ++n) i != run->cycle.end(); ++i, ++n)
map_[i->s].second.push_back(step_num(i, n)); map_[i->s].second.emplace_back(i, n);
} }
tgba_run_dotty_decorator::~tgba_run_dotty_decorator() tgba_run_dotty_decorator::~tgba_run_dotty_decorator()
@ -55,19 +58,17 @@ namespace spot
std::string sep = "("; std::string sep = "(";
bool in_prefix = false; bool in_prefix = false;
bool in_cycle = false; bool in_cycle = false;
for (step_set::const_iterator j = i->second.first.begin(); for (auto j: i->second.first)
j != i->second.first.end(); ++j)
{ {
os << sep << j->second; os << sep << j.second;
sep = ", "; sep = ", ";
in_prefix = true; in_prefix = true;
} }
if (sep == ", ") if (sep == ", ")
sep = "; "; sep = "; ";
for (step_set::const_iterator j = i->second.second.begin(); for (auto j: i->second.second)
j != i->second.second.end(); ++j)
{ {
os << sep << j->second; os << sep << j.second;
sep = ", "; sep = ", ";
in_cycle = true; in_cycle = true;
} }

View file

@ -147,12 +147,12 @@ namespace spot
state* init = aut_->get_init_state(); state* init = aut_->get_init_state();
num_ = -1; num_ = -1;
h_.insert(std::make_pair(init, num_)); h_.insert(std::make_pair(init, num_));
root_.push_front(scc(num_)); root_.emplace_front(num_);
arc_acc_.push(bddfalse); arc_acc_.push(bddfalse);
arc_cond_.push(bddfalse); arc_cond_.push(bddfalse);
tgba_succ_iterator* iter = aut_->succ_iter(init); tgba_succ_iterator* iter = aut_->succ_iter(init);
iter->first(); iter->first();
todo_.push(pair_state_iter(init, iter)); todo_.emplace(init, iter);
} }
while (!todo_.empty()) while (!todo_.empty())
@ -224,12 +224,12 @@ namespace spot
// Yes. Number it, stack it, and register its successors // Yes. Number it, stack it, and register its successors
// for later processing. // for later processing.
h_.insert(std::make_pair(dest, --num_)); h_.insert(std::make_pair(dest, --num_));
root_.push_front(scc(num_)); root_.emplace_front(num_);
arc_acc_.push(acc); arc_acc_.push(acc);
arc_cond_.push(cond); arc_cond_.push(cond);
tgba_succ_iterator* iter = aut_->succ_iter(dest); tgba_succ_iterator* iter = aut_->succ_iter(dest);
iter->first(); iter->first();
todo_.push(pair_state_iter(dest, iter)); todo_.emplace(dest, iter);
continue; continue;
} }

View file

@ -153,7 +153,7 @@ namespace spot
inc_depth(); inc_depth();
tgba_succ_iterator* i = a_->succ_iter(s); tgba_succ_iterator* i = a_->succ_iter(s);
i->first(); i->first();
st.push_front(stack_item(s, i, label, acc)); st.emplace_front(s, i, label, acc);
} }
void pop(stack_type& st) void pop(stack_type& st)

View file

@ -1317,7 +1317,7 @@ namespace spot
bdd sig = dont_care_compute_sig(src); bdd sig = dont_care_compute_sig(src);
dont_care_bdd_lstate[sig].push_back(src); dont_care_bdd_lstate[sig].push_back(src);
dont_care_state2sig[src] = sig; dont_care_state2sig[src] = sig;
dont_care_now_to_now.push_back(std::make_pair(sig, it->second)); dont_care_now_to_now.emplace_back(sig, it->second);
class2state[it->second] = it->first; class2state[it->second] = it->first;
sig = compute_sig(src); sig = compute_sig(src);

View file

@ -127,7 +127,7 @@ namespace spot
inc_depth(); inc_depth();
tgba_succ_iterator* i = a_->succ_iter(s); tgba_succ_iterator* i = a_->succ_iter(s);
i->first(); i->first();
st.push_front(stack_item(s, i, label, acc)); st.emplace_front(s, i, label, acc);
} }
void pop(stack_type& st) void pop(stack_type& st)

View file

@ -152,7 +152,7 @@ namespace spot
inc_depth(); inc_depth();
tgba_succ_iterator* i = a_->succ_iter(s); tgba_succ_iterator* i = a_->succ_iter(s);
i->first(); i->first();
st.push_front(stack_item(s, i, label, acc)); st.emplace_front(s, i, label, acc);
} }
void pop(stack_type& st) void pop(stack_type& st)
@ -321,7 +321,7 @@ namespace spot
typedef std::pair<bdd, unsigned> cond_level; typedef std::pair<bdd, unsigned> cond_level;
std::stack<cond_level> condition_stack; std::stack<cond_level> condition_stack;
unsigned depth = 1; unsigned depth = 1;
condition_stack.push(cond_level(bddfalse, 0)); condition_stack.emplace(bddfalse, 0);
while (!st_red.empty()) while (!st_red.empty())
{ {
@ -376,7 +376,7 @@ namespace spot
{ {
bdd old = acu; bdd old = acu;
acu |= acc; acu |= acc;
condition_stack.push(cond_level(acu - old, depth)); condition_stack.emplace(acu - old, depth);
} }
++depth; ++depth;
} }

View file

@ -1,6 +1,6 @@
/* -*- coding: utf-8 -*- /* -*- coding: utf-8 -*-
** Copyright (C) 2009, 2010, 2012, 2013 Laboratoire de Recherche et ** Copyright (C) 2009, 2010, 2012, 2013, 2014 Laboratoire de Recherche
** Développement de l'Epita (LRDE). ** et Développement de l'Epita (LRDE).
** Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de ** Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de
** Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), ** Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
** Université Pierre et Marie Curie. ** Université Pierre et Marie Curie.
@ -123,8 +123,7 @@ line: strident ',' strident ',' condition ',' acc_list ';'
here.begin.column + i->first.end.column; here.begin.column + i->first.end.column;
here.begin.line += i->first.begin.line - 1; here.begin.line += i->first.begin.line - 1;
here.begin.column += i->first.begin.column; here.begin.column += i->first.begin.column;
error_list.push_back(spot::tgba_parse_error(here, error_list.emplace_back(here, i->second);
i->second));
} }
if (f) if (f)
result->add_condition(t, f); result->add_condition(t, f);
@ -151,8 +150,7 @@ string: STRING
| UNTERMINATED_STRING | UNTERMINATED_STRING
{ {
$$ = $1; $$ = $1;
error_list.push_back(spot::tgba_parse_error(@1, error_list.emplace_back(@1, "unterminated string");
"unterminated string"));
} }
strident: string | IDENT strident: string | IDENT
@ -182,8 +180,8 @@ acc_list:
const formula* f = parse_envacc.require(*$2); const formula* f = parse_envacc.require(*$2);
if (! result->has_acceptance_condition(f)) if (! result->has_acceptance_condition(f))
{ {
error_list.push_back(spot::tgba_parse_error(@2, error_list.emplace_back(@2,
"undeclared acceptance condition `" + *$2 + "'")); "undeclared acceptance condition `" + *$2 + "'");
f->destroy(); f->destroy();
// $2 will be destroyed on error recovery. // $2 will be destroyed on error recovery.
YYERROR; YYERROR;
@ -207,7 +205,7 @@ acc_decl:
s += "' unknown in environment `"; s += "' unknown in environment `";
s += parse_envacc.name(); s += parse_envacc.name();
s += "'"; s += "'";
error_list.push_back(spot::tgba_parse_error(@2, s)); error_list.emplace_back(@2, s);
YYERROR; YYERROR;
} }
result->declare_acceptance_condition(f); result->declare_acceptance_condition(f);
@ -221,7 +219,7 @@ void
tgbayy::parser::error(const location_type& location, tgbayy::parser::error(const location_type& location,
const std::string& message) const std::string& message)
{ {
error_list.push_back(spot::tgba_parse_error(location, message)); error_list.emplace_back(location, message);
} }
namespace spot namespace spot
@ -236,9 +234,8 @@ namespace spot
{ {
if (tgbayyopen(name)) if (tgbayyopen(name))
{ {
error_list.push_back error_list.emplace_back(spot::location(),
(tgba_parse_error(spot::location(), std::string("Cannot open file ") + name);
std::string("Cannot open file ") + name));
return 0; return 0;
} }
formula_cache fcache; formula_cache fcache;