Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
context-printer.hh
Go to the documentation of this file.
1 #ifndef VCSN_DYN_CONTEXT_PRINTER_HH
2 # define VCSN_DYN_CONTEXT_PRINTER_HH
3 
4 # include <set>
5 # include <sstream>
6 
8 
9 namespace vcsn
10 {
11  namespace ast
12  {
14  {
15  public:
16  context_printer(std::ostringstream& os)
17  : os_(os)
18  {}
19 
21  void header(const std::string& h);
22 
24  void header_algo(const std::string& algo);
25 
27  void linkflags(const std::string& h);
28 
30  const std::string& linkflags() const;
31 
33  std::ostream& print(std::ostream& o);
34 
35 # define DEFINE(Type) \
36  virtual void visit(const Type& t)
37 
39  DEFINE(context);
40  DEFINE(genset);
41  DEFINE(letterset);
42  DEFINE(nullableset);
43  DEFINE(oneset);
44  DEFINE(other);
45  DEFINE(polynomialset);
47  DEFINE(tupleset);
48  DEFINE(weightset);
49  DEFINE(wordset);
50 # undef DEFINE
51 
52  private:
53 
54  std::ostringstream& os_;
86  std::set<std::string> headers_;
87  std::set<std::string> headers_late_;
88 
90  std::string linkflags_;
91  };
92  }
93 }
94 
95 #endif // !VCSN_DYN_CONTEXT_PRINTER_HH
std::shared_ptr< detail::automaton_base > automaton
Definition: automaton.hh:71
std::ostream & print(std::ostream &o)
Generate the code to compile on o.
std::set< std::string > headers_
Headers to include.
const std::string & linkflags() const
Get the link flags.
std::string linkflags_
Flags to pass to the linker.
std::ostringstream & os_
std::shared_ptr< const detail::context_base > context
Definition: context.hh:71
context_printer(std::ostringstream &os)
std::ostringstream os
The output stream: the corresponding C++ snippet to compile.
Definition: translate.cc:331
void header(const std::string &h)
Record that we need an include for this header.
#define DEFINE(Type)
variadic_mul_mixin< rat::ratexpset_impl< Context >> ratexpset
Definition: fwd.hh:166
void header_algo(const std::string &algo)
Record that we need an include for this algorithm.
std::set< std::string > headers_late_