ngraph: support aliasing states

* src/graph/ngraph.hh (alias_state): New method.
* src/graphtest/ngraph.cc: Use it.
This commit is contained in:
Alexandre Duret-Lutz 2014-05-22 10:46:25 +02:00
parent 424de90385
commit 31bf8c2c1e
2 changed files with 11 additions and 2 deletions

View file

@ -77,6 +77,13 @@ namespace spot
return p.first->second;
}
/// \brief Give an alternate name to a state.
/// \return true iff the newname was already used.
bool alias_state(state s, name newname)
{
return !name_to_state.insert(std::make_pair(newname, s)).second;
}
state get_state(name n) const
{
return name_to_state.at(n);