Vaucanson  1.4.1
dump_visitor.hh
1 // dump_visitor.hh: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 The Vaucanson Group.
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11 //
12 // The complete GNU General Public Licence Notice can be found as the
13 // `COPYING' file in the root directory.
14 //
15 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
16 //
17 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_DUMP_VISITOR_HH
18 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_DUMP_VISITOR_HH
19 
20 # include <iostream>
21 # include <string>
22 # include <set>
23 # include <boost/shared_ptr.hpp>
24 
25 # include <vaucanson/algebra/implementation/series/rat/exp.hh>
26 # include <vaucanson/algebra/implementation/monoid/monoid_rep.hh>
27 # include <vaucanson/algebra/implementation/series/series_rep.hh>
28 # include <vaucanson/misc/iomanip.hh>
29 # include <vaucanson/misc/usual_macros.hh>
30 
31 namespace vcsn
32 {
33 
34  namespace rat
35  {
36 
38  enum print_mode_t
39  {
40  MODE_NONE = 0x0,
41  MODE_ADD = 0x1,
42  MODE_MUL = 0x2,
43  MODE_STAR = 0x4,
44  MODE_RWEIGHT = 0x8,
45  MODE_LWEIGHT = 0x10,
46  MODE_WEIGHT = 0x18,
47  MODE_ALL = 0x1F
48  };
49 
51 // template <class Word, class Weight>
52 // std::ostream&
53 // operator << (std::ostream& ostr, const exp<Word, Weight>& e);
54 
56  struct setpm : public misc::iomanip<setpm>
57  {
58  setpm (print_mode_t mode);
59  std::ostream& operator () (std::ostream& ostr) const;
60  protected:
61  print_mode_t mode_;
62  };
63 
65  print_mode_t getpm(const std::ostream& ostr);
66 
68  struct setzero : public misc::iomanip<setzero>
69  {
70  setzero(const std::string& zero);
71  std::ostream& operator () (std::ostream& ostr) const;
72  protected:
73  const std::string& z_;
74  };
75 
77  struct setid : public misc::iomanip<setid>
78  {
79  setid(const std::string& id);
80  std::ostream& operator () (std::ostream& ostr) const;
81  protected:
82  const std::string& i_;
83  };
84 
85  } // End of namespace rat.
86 
87 } // End of namespace vcsn.
88 
89 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
90 # include <vaucanson/algebra/implementation/series/rat/dump_visitor.hxx>
91 # endif // VCSN_USE_INTERFACE_ONLY
92 
93 #endif // ! VCSN_ALGEBRA_IMPLEMENTATION_SERIES_RAT_DUMP_VISITOR_HH