acc_code: parse from the constructor

* spot/twa/acc.hh, spot/twa/acc.cc (parse_acc_code): Rename as...
(acc_cond::acc_code): ... this, making it a lot easier to build
acceptance conditions from strings.
* NEWS: Mention the change.
* spot/twaalgos/dtwasat.cc, spot/bin/randaut.cc, spot/tests/acc.cc:
Adjust.
* wrap/python/tests/acc_cond.ipynb, wrap/python/tests/accparse.ipynb,
wrap/python/tests/accparse2.py: Simplify, but not completely to exercise
all variants.
* wrap/python/spot_impl.i: Make acc_code's constructor implicit.
This commit is contained in:
Alexandre Duret-Lutz 2015-12-18 17:47:16 +01:00
parent d0b29051b2
commit df1ef302e8
10 changed files with 189 additions and 133 deletions

View file

@ -1544,7 +1544,7 @@ namespace spot
}
acc_cond::acc_code parse_acc_code(const char* input)
acc_cond::acc_code::acc_code(const char* input)
{
skip_space(input);
acc_cond::acc_code c;
@ -1630,6 +1630,6 @@ namespace spot
s << "syntax error at '" << input << "', unexpected character.";
throw parse_error(s.str());
}
return c;
std::swap(c, *this);
}
}