spot  1.99.4
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
common_finput.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2012, 2013, 2015 Laboratoire de Recherche et
3 // Développement 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 #pragma once
21 
22 #include "common_sys.hh"
23 
24 #include <argp.h>
25 #include <vector>
26 #include "tl/parse.hh"
27 
28 struct job
29 {
30  const char* str;
31  bool file_p; // true if str is a filename, false if it is a formula
32 
33  job(const char* str, bool file_p)
34  : str(str), file_p(file_p)
35  {
36  }
37 };
38 
39 typedef std::vector<job> jobs_t;
40 extern jobs_t jobs;
41 extern bool lbt_input;
42 
43 extern const struct argp finput_argp;
44 
45 int parse_opt_finput(int key, char* arg, struct argp_state* state);
46 
48 parse_formula(const std::string& s, spot::parse_error_list& error_list);
49 
50 
52 {
53 protected:
54  bool abort_run; // Set to true in process_formula() to abort run().
55 public:
56  job_processor();
57 
58  virtual ~job_processor();
59 
60  virtual int
61  process_formula(spot::formula f,
62  const char* filename = nullptr, int linenum = 0) = 0;
63 
64  virtual int
65  process_string(const std::string& str,
66  const char* filename = nullptr, int linenum = 0);
67  virtual int
68  process_stream(std::istream& is, const char* filename);
69 
70  virtual int
71  process_file(const char* filename);
72 
73  virtual int
74  run();
75 
76  char* real_filename;
77  long int col_to_read;
78  char* prefix;
79  char* suffix;
80 };
formula parse_formula(const std::string &ltl_string, environment &env=default_environment::instance())
A simple wrapper to parse_infix_psl() and parse_prefix_ltl().
Definition: common_finput.hh:28
Main class for temporal logic formula.
Definition: formula.hh:574
std::list< one_parse_error > parse_error_list
A list of parser diagnostics, as filled by parse.
Definition: parse.hh:42
Definition: common_finput.hh:51

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Thu Oct 1 2015 05:49:14 for spot by doxygen 1.8.8