spot  1.99.3
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
common_output.hh
1 // -*- coding: utf-8 -*-
2 // Copyright (C) 2012, 2013, 2014, 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 <map>
26 #include <memory>
27 #include "ltlast/formula.hh"
28 #include "twaalgos/stats.hh"
29 #include "common_output.hh"
30 #include "common_file.hh"
31 
32 enum output_format_t { spot_output, spin_output, utf8_output,
33  lbt_output, wring_output, latex_output,
34  quiet_output, count_output };
35 extern output_format_t output_format;
36 extern bool full_parenth;
37 extern bool escape_csv;
38 
39 extern const struct argp output_argp;
40 
41 int parse_opt_output(int key, char* arg, struct argp_state* state);
42 
43 // Low-level output
44 std::ostream&
45 stream_formula(std::ostream& out,
46  const spot::ltl::formula* f, const char* filename, int linenum);
47 
48 void output_formula_checked(const spot::ltl::formula* f,
49  const char* filename = 0, int linenum = 0,
50  const char* prefix = 0, const char* suffix = 0);
51 
52 
54  public spot::printable_value<const spot::ltl::formula*>
55 {
56 public:
58  operator=(const spot::ltl::formula* new_val)
59  {
60  val_ = new_val;
61  return *this;
62  }
63 
64  virtual void
65  print(std::ostream& os, const char*) const;
66 };
67 
69 {
70 public:
71  aut_stat_printer(std::ostream& os, const char* format)
72  : spot::stat_printer(os, format)
73  {
74  declare('f', &formula_); // Override the formula printer.
75  }
76 
78 
79  std::ostream&
80  print(const spot::const_twa_graph_ptr& aut,
81  const spot::ltl::formula* f = 0,
82  double run_time = -1.)
83  {
84  formula_ = f;
85  return this->spot::stat_printer::print(aut, f, run_time);
86  }
87 
88  printable_formula formula_;
89 };
void set_output(std::ostream &output)
Remember where to output any string.
Definition: formater.hh:163
Definition: formater.hh:42
std::ostream & print(const const_twa_graph_ptr &aut, const ltl::formula *f=0, double run_time=-1.)
print the configured statistics.
LTL formula interface.
void declare(char c, const printable *f)
Declare a callback function for c.
Definition: formater.hh:156
Definition: common_output.hh:53
std::ostream & format(const char *fmt)
Expand the %-sequences in fmt, write the result on output_.
prints various statistics about a TGBA
Definition: stats.hh:77
An LTL formula.
Definition: formula.hh:71
Definition: common_output.hh:68

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Wed Aug 26 2015 08:42:37 for spot by doxygen 1.8.8