Clean up dotty output of TAs.

* src/taalgos/dotty.cc: Clean up output of TAs.
* src/tgbatest/ltl2tgba.cc: Fix memory management, and use the TA
printer for TGTA.
* wrap/python/spot.i (as_ta): New function to convert a tgta_explicit
into a TA.
* wrap/python/ajax/spot.in: Use this new function to display automata.
This commit is contained in:
Alexandre Duret-Lutz 2012-06-27 17:20:53 +02:00
parent 852cd0d553
commit d4130f15bf
4 changed files with 94 additions and 66 deletions

View file

@ -287,9 +287,11 @@ However you may download the <a href="''' + cgi.escape(autprefix)
def render_automaton(automaton, dont_run_dot, issba, deco = None):
dotsrc = spot.ostringstream()
if isinstance(automaton, spot.ta):
if isinstance(automaton, spot.ta): # TA/GTA
spot.dotty_reachable(dotsrc, automaton)
else:
elif hasattr(automaton, 'as_ta'): # TGTA
spot.dotty_reachable(dotsrc, automaton.as_ta())
else: # TGBA
spot.dotty_reachable(dotsrc, automaton, issba, deco)
render_dot_maybe(dotsrc.str(), dont_run_dot)