python: add a spot.automata(filename) interface, yielding automata

* src/hoaparse/fmterror.cc, src/hoaparse/public.hh,
src/hoaparse/hoaparse.yy (hoa_stream_parser::parse_strict): New method
that raises an exception whenever a syntax error is encountered.
* src/ltlparse/public.hh (parse_error): Move ...
* src/misc/common.hh: ... here.
* wrap/python/spot_impl.i: Wrap the hoa output.
* wrap/python/spot.py: Implement spot.automata.
* wrap/python/tests/automata-io.ipynb: New test.
* wrap/python/tests/Makefile.am: Add it.
This commit is contained in:
Alexandre Duret-Lutz 2015-03-27 10:04:36 +01:00
parent 8e6b35e5e3
commit 25de479e12
9 changed files with 701 additions and 22 deletions

View file

@ -74,6 +74,7 @@ namespace std {
#include <sstream>
#include <signal.h>
#include "misc/common.hh"
#include "misc/version.hh"
#include "misc/minato.hh"
#include "misc/optionmap.hh"
@ -135,6 +136,7 @@ namespace std {
#include "tgbaalgos/postproc.hh"
#include "tgbaalgos/stutter.hh"
#include "tgbaalgos/translate.hh"
#include "tgbaalgos/hoa.hh"
#include "hoaparse/public.hh"
@ -182,7 +184,7 @@ using namespace spot;
try {
$action
}
catch (const spot::ltl::parse_error& e)
catch (const spot::parse_error& e)
{
std::string er("\n");
er += e.what();
@ -278,6 +280,7 @@ namespace spot {
%include "tgbaalgos/postproc.hh"
%include "tgbaalgos/stutter.hh"
%include "tgbaalgos/translate.hh"
%include "tgbaalgos/hoa.hh"
%include "hoaparse/public.hh"