spot  1.99.4
 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 "tl/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  spot::formula f, const char* filename, int linenum);
47 
48 void output_formula_checked(spot::formula f,
49  const char* filename = nullptr, int linenum = 0,
50  const char* prefix = nullptr,
51  const char* suffix = nullptr);
52 
53 
55  public spot::printable_value<spot::formula>
56 {
57 public:
59  operator=(spot::formula new_val)
60  {
61  val_ = new_val;
62  return *this;
63  }
64 
65  virtual void
66  print(std::ostream& os, const char*) const;
67 };
68 
70 {
71 public:
72  aut_stat_printer(std::ostream& os, const char* format)
73  : spot::stat_printer(os, format)
74  {
75  declare('f', &formula_); // Override the formula printer.
76  }
77 
79 
80  std::ostream&
81  print(const spot::const_twa_graph_ptr& aut,
82  spot::formula f = nullptr,
83  double run_time = -1.)
84  {
85  formula_ = f;
86  return this->spot::stat_printer::print(aut, f, run_time);
87  }
88 
89  printable_formula formula_;
90 };
void set_output(std::ostream &output)
Remember where to output any string.
Definition: formater.hh:163
Definition: formater.hh:42
LTL/PSL formula interface.
Main class for temporal logic formula.
Definition: formula.hh:574
void declare(char c, const printable *f)
Declare a callback function for c.
Definition: formater.hh:156
std::ostream & print(const const_twa_graph_ptr &aut, formula f=nullptr, double run_time=-1.)
print the configured statistics.
Definition: common_output.hh:54
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
Definition: common_output.hh:69

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