parseaut: swallow the dstarparser

Note that the parser is still not able to reader multiple dstar
automata.

* src/dstarparse/: Delete.
* configure.ac, src/Makefile.am, README: Adjust.
* src/parseaut/parseaut.yy, src/parseaut/scanaut.ll: Merge in the
dstarparser rules.
* src/bin/common_trans.cc, src/bin/common_trans.hh,
src/bin/dstar2tgba.cc, src/bin/ltlcross.cc, src/bin/ltldo.cc,
src/tests/ikwiad.cc: Adjust usage.
* src/tests/parseaut.test: Adjust expected output.
This commit is contained in:
Alexandre Duret-Lutz 2015-09-07 09:25:44 +02:00
parent e7ecab93ff
commit 209e89a94c
18 changed files with 331 additions and 956 deletions

View file

@ -39,7 +39,6 @@
#include "twaalgos/degen.hh"
#include "twa/twaproduct.hh"
#include "twaalgos/reducerun.hh"
#include "dstarparse/public.hh"
#include "parseaut/public.hh"
#include "twaalgos/dupexp.hh"
#include "twaalgos/minimize.hh"
@ -118,8 +117,7 @@ syntax(char* prog)
<< std::endl
<< " -XD do not compute an automaton, read it from an"
<< " ltl2dstar file" << std::endl
<< " -XDB read the from an ltl2dstar file and convert it to "
<< "TGBA" << std::endl
<< " -XDB like -XD, and convert it to TGBA\n"
<< " -XH do not compute an automaton, read it from a"
<< " HOA file\n"
<< " -XL do not compute an automaton, read it from an"
@ -341,7 +339,6 @@ checked_main(int argc, char** argv)
bool accepting_run = false;
bool accepting_run_replay = false;
bool from_file = false;
enum { ReadDstar, ReadHoa } readformat = ReadHoa;
bool nra2nba = false;
bool scc_filter = false;
bool simpltl = false;
@ -859,28 +856,23 @@ checked_main(int argc, char** argv)
else if (!strcmp(argv[formula_index], "-XD"))
{
from_file = true;
readformat = ReadDstar;
}
else if (!strcmp(argv[formula_index], "-XDB"))
{
from_file = true;
readformat = ReadDstar;
nra2nba = true;
}
else if (!strcmp(argv[formula_index], "-XH"))
{
from_file = true;
readformat = ReadHoa;
}
else if (!strcmp(argv[formula_index], "-XL"))
{
from_file = true;
readformat = ReadHoa;
}
else if (!strcmp(argv[formula_index], "-XN")) // now synonym for -XH
{
from_file = true;
readformat = ReadHoa;
}
else if (!strcmp(argv[formula_index], "-y"))
{
@ -957,45 +949,18 @@ checked_main(int argc, char** argv)
if (from_file)
{
switch (readformat)
{
case ReadDstar:
{
spot::parse_aut_error_list pel;
tm.start("parsing dstar");
auto daut = spot::dstar_parse(input, pel, dict, env, debug_opt);
tm.stop("parsing dstar");
if (spot::format_parse_aut_errors(std::cerr, input, pel))
return 2;
tm.start("dstar2tgba");
if (nra2nba)
{
a = spot::to_generalized_buchi(daut->aut);
assume_sba = a->is_sba();
}
else
{
a = daut->aut;
daut->aut = 0;
assume_sba = false;
}
tm.stop("dstar2tgba");
}
break;
case ReadHoa:
{
spot::parse_aut_error_list pel;
tm.start("parsing hoa");
auto daut = spot::parse_aut(input, pel, dict, env, debug_opt);
tm.stop("parsing hoa");
if (spot::format_parse_aut_errors(std::cerr, input, pel))
return 2;
daut->aut->merge_edges();
a = daut->aut;
assume_sba = a->is_sba();
}
break;
}
spot::parse_aut_error_list pel;
tm.start("parsing hoa");
auto daut = spot::parse_aut(input, pel, dict, env, debug_opt);
tm.stop("parsing hoa");
if (spot::format_parse_aut_errors(std::cerr, input, pel))
return 2;
daut->aut->merge_edges();
a = daut->aut;
if (nra2nba)
a = spot::to_generalized_buchi(daut->aut);
assume_sba = a->is_sba();
}
else
{

View file

@ -965,18 +965,17 @@ and even more garbage
EOF
se='syntax error, unexpected' # this is just to keep lines short
end='end of file or HOA: or never or LBTT header'
expecterr input <<EOF
input:8.11: $se identifier, expecting integer or '}'
input:8.10-12: ignoring this invalid acceptance set
input:11.2: $se identifier
input:11.1-3: ignoring this invalid label
input:21.5-7: $se string, expecting integer
input:25.1: $se \$undefined, expecting $end
input:25.1: $se \$undefined
input:25.1-12: ignoring leading garbage
input:32.1-5: $se header name, expecting --END-- or State:
input:28.1-8: initial state 0 has no definition
input:37.1: $se 't', expecting $end
input:37.1: $se 't'
autfilt: failed to read automaton from input
EOF