spot  1.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
common_finput.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement
3 // de l'Epita (LRDE).
4 //
5 // This file is part of Spot, a model checking library.
6 //
7 // Spot is free software; you can redistribute it and/or modify it
8 // under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // Spot is distributed in the hope that it will be useful, but WITHOUT
13 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 
20 #ifndef SPOT_BIN_COMMON_FINPUT_HH
21 #define SPOT_BIN_COMMON_FINPUT_HH
22 
23 #include "common_sys.hh"
24 
25 #include <argp.h>
26 #include <vector>
27 #include "ltlparse/public.hh"
28 
29 struct job
30 {
31  const char* str;
32  bool file_p; // true if str is a filename, false if it is a formula
33 
34  job(const char* str, bool file_p)
35  : str(str), file_p(file_p)
36  {
37  }
38 };
39 
40 typedef std::vector<job> jobs_t;
41 extern jobs_t jobs;
42 extern bool lbt_input;
43 
44 extern const struct argp finput_argp;
45 
46 int parse_opt_finput(int key, char* arg, struct argp_state* state);
47 
48 const spot::ltl::formula*
49 parse_formula(const std::string& s, spot::ltl::parse_error_list& error_list);
50 
51 
53 {
54 protected:
55  bool abort_run; // Set to true in process_formula() to abort run().
56 public:
57  job_processor();
58 
59  virtual ~job_processor();
60 
61  virtual int
62  process_formula(const spot::ltl::formula* f,
63  const char* filename = 0, int linenum = 0) = 0;
64 
65  virtual int
66  process_string(const std::string& str,
67  const char* filename = 0, int linenum = 0);
68  virtual int
69  process_stream(std::istream& is, const char* filename);
70 
71  virtual int
72  process_file(const char* filename);
73 
74  virtual int
75  run();
76 
77  char* real_filename;
78  long int col_to_read;
79  char* prefix;
80  char* suffix;
81 };
82 
83 
84 
85 #endif // SPOT_BIN_COMMON_FINPUT_HH

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Sat Dec 6 2014 12:28:43 for spot by doxygen 1.8.4