bin: separate process_file() for aut and ltl

* bin/common_finput.cc, bin/common_finput.hh,
bin/common_hoaread.hh (process_file): Split into...
(process_ltl_file, process_aut_filt): ... these, as we will need both
in ltlsynt.
This commit is contained in:
Alexandre Duret-Lutz 2022-06-22 14:33:16 +02:00
parent 8161a8c531
commit df685433f4
3 changed files with 19 additions and 6 deletions

View file

@ -303,7 +303,13 @@ job_processor::process_stream(std::istream& is,
} }
int int
job_processor::process_file(const char* filename) job_processor::process_aut_file(const char*)
{
throw std::runtime_error("process_aut_file not defined for this tool");
}
int
job_processor::process_ltl_file(const char* filename)
{ {
col_to_read = 0; col_to_read = 0;
@ -366,8 +372,10 @@ job_processor::run()
error |= process_string(j.str); error |= process_string(j.str);
break; break;
case job_type::LTL_FILENAME: case job_type::LTL_FILENAME:
error |= process_ltl_file(j.str);
break;
case job_type::AUT_FILENAME: case job_type::AUT_FILENAME:
error |= process_file(j.str); error |= process_aut_file(j.str);
break; break;
default: default:
throw std::runtime_error("unexpected job type"); throw std::runtime_error("unexpected job type");

View file

@ -72,7 +72,10 @@ public:
process_stream(std::istream& is, const char* filename); process_stream(std::istream& is, const char* filename);
virtual int virtual int
process_file(const char* filename); process_ltl_file(const char* filename);
virtual int
process_aut_file(const char* filename);
virtual int virtual int
run(); run();

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2015, 2017, 2018 Laboratoire de Recherche et Développement de // Copyright (C) 2015, 2017, 2018, 2022 Laboratoire de Recherche et
// l'Epita (LRDE). // Développement de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
@ -80,8 +80,10 @@ public:
} }
int int
process_file(const char* filename) override process_aut_file(const char* filename) override
{ {
col_to_read = 0;
// If we have a filename like "foo/NN" such // If we have a filename like "foo/NN" such
// that: // that:
// ① foo/NN is not a file, // ① foo/NN is not a file,