* iface/gspn/gspn.cc (tgba_gspn::format_state): Call gspn's

print_state.
This commit is contained in:
Alexandre Duret-Lutz 2003-07-30 14:02:57 +00:00
parent 4c40d5920a
commit e78ffdc462
2 changed files with 26 additions and 3 deletions

View file

@ -1,5 +1,8 @@
2003-07-30 Alexandre Duret-Lutz <aduret@src.lip6.fr> 2003-07-30 Alexandre Duret-Lutz <aduret@src.lip6.fr>
* iface/gspn/gspn.cc (tgba_gspn::format_state): Call gspn's
print_state.
* iface/gspn/dcswaveltl.test: Check for a false formula too. * iface/gspn/dcswaveltl.test: Check for a false formula too.
* iface/gspn/dcswaveltl.test, iface/gspn/ltlgspn.cc: New files. * iface/gspn/dcswaveltl.test, iface/gspn/ltlgspn.cc: New files.

View file

@ -387,9 +387,29 @@ namespace spot
{ {
const state_gspn* s = dynamic_cast<const state_gspn*>(state); const state_gspn* s = dynamic_cast<const state_gspn*>(state);
assert(s); assert(s);
// FIXME: We ought to ask GSPN to format the state.
std::ostringstream os; std::ostringstream os;
os << s->get_state(); char* str;
int err = print_state(s->get_state(), &str);
if (err)
throw gspn_exeption("print_state()", err);
// Rewrite all new lines as \\\n.
const char* pos = str;
while (*pos)
{
switch (*pos)
{
// Rewrite all new lines as \\n, and strip the last one.
case '\n':
if (pos[1])
os << "\\n";
break;
default:
os << *pos;
}
++pos;
}
free(str);
return os.str(); return os.str();
} }