* iface/gspn/gspn.cc (tgba_gspn::format_state): Call gspn's
print_state.
This commit is contained in:
parent
4c40d5920a
commit
e78ffdc462
2 changed files with 26 additions and 3 deletions
|
|
@ -1,7 +1,10 @@
|
|||
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, iface/gspn/ltlgspn.cc: New files.
|
||||
* iface/gspn/Makefile.am (TESTS): Add dcswaveltl.test.
|
||||
(ltlgspn_rg_LDADD, ltlgspn_srg_LDADD, ltlgspn_rg_SOURCES)
|
||||
|
|
|
|||
|
|
@ -387,9 +387,29 @@ namespace spot
|
|||
{
|
||||
const state_gspn* s = dynamic_cast<const state_gspn*>(state);
|
||||
assert(s);
|
||||
// FIXME: We ought to ask GSPN to format the state.
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue