hoa: add support for --ABORT--

* src/hoaparse/parsedecl.hh (hoa_abort): New structure.
* src/hoaparse/hoascan.ll: Throw hoa_abort on --ABORT--.
* src/hoaparse/hoaparse.yy: Deal with this exception.
* src/hoaparse/public.hh: Add a boolean flag to mark aborted automata.
* src/bin/autfilt.cc: Report aborted automata.
* src/tgbatest/hoaparse.test: Add test case.
This commit is contained in:
Alexandre Duret-Lutz 2014-11-21 15:03:11 +01:00
parent 8c8c2f0b7c
commit c12b2d63b3
6 changed files with 64 additions and 11 deletions

View file

@ -331,6 +331,12 @@ namespace
return 0;
}
int
aborted(const spot::const_hoa_aut_ptr& h, const char* filename)
{
std::cerr << filename << ':' << h->loc << ": aborted input automaton\n";
return 2;
}
int
process_file(const char* filename)
@ -351,6 +357,8 @@ namespace
err = 2;
if (!haut)
error(2, 0, "failed to read automaton from %s", filename);
else if (haut->aborted)
err = std::max(err, aborted(haut, filename));
else
process_automaton(haut, filename);
}