spot  1.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
common_output.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_OUTPUT_HH
21 #define SPOT_BIN_COMMON_OUTPUT_HH
22 
23 #include "common_sys.hh"
24 
25 #include <argp.h>
26 #include "ltlast/formula.hh"
27 #include "tgbaalgos/stats.hh"
28 #include "common_output.hh"
29 
30 enum output_format_t { spot_output, spin_output, utf8_output,
31  lbt_output, wring_output, latex_output };
32 extern output_format_t output_format;
33 extern bool full_parenth;
34 extern bool escape_csv;
35 
36 extern const struct argp output_argp;
37 
38 int parse_opt_output(int key, char* arg, struct argp_state* state);
39 
40 void output_formula(std::ostream& os, const spot::ltl::formula* f,
41  const char* filename = 0, int linenum = 0,
42  const char* prefix = 0, const char* suffix = 0);
43 void output_formula_checked(const spot::ltl::formula* f,
44  const char* filename = 0, int linenum = 0,
45  const char* prefix = 0, const char* suffix = 0);
46 
47 
49  public spot::printable_value<const spot::ltl::formula*>
50 {
51 public:
53  operator=(const spot::ltl::formula* new_val)
54  {
55  val_ = new_val;
56  return *this;
57  }
58 
59  virtual void
60  print(std::ostream& os, const char*) const
61  {
62  output_formula(os, val_);
63  }
64 };
65 
67 {
68 public:
69  aut_stat_printer(std::ostream& os, const char* format)
70  : spot::stat_printer(os, format)
71  {
72  declare('f', &formula_); // Override the formula printer.
73  }
74 
75  std::ostream&
76  print(const spot::tgba* aut, const spot::ltl::formula* f = 0,
77  double run_time = -1.)
78  {
79  formula_ = f;
80  return this->spot::stat_printer::print(aut, f, run_time);
81  }
82 
83  printable_formula formula_;
84 };
85 
86 #endif // SPOT_BIN_COMMON_OUTPUT_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