Commit e78ffdc4 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

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

print_state.
parent 4c40d592
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.
......
...@@ -387,9 +387,29 @@ namespace spot ...@@ -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();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment