3 #include <boost/algorithm/string/predicate.hpp> 34 "#define BUILD_LIBVCSN 1\n" 35 "#define VCSN_INSTANTIATION 1\n" 36 "#define MAYBE_EXTERN\n" 39 o <<
"#include <" << h <<
">\n";
42 o <<
"#include <" << h <<
">\n";
48 #define DEFINE(Type) \ 49 void context_printer::visit(const Type& t) 57 {
"compose_automaton" ,
"vcsn/algos/compose.hh"},
58 {
"delay_automaton" ,
"vcsn/algos/is-synchronized.hh"},
59 {
"derived_term_automaton" ,
"vcsn/algos/derived-term.hh"},
60 {
"determinized_automaton" ,
"vcsn/algos/determinize.hh"},
61 {
"expression_automaton" ,
"vcsn/core/expression-automaton.hh"},
62 {
"filter_automaton" ,
"vcsn/algos/filter.hh"},
63 {
"focus_automaton" ,
"vcsn/algos/focus.hh"},
64 {
"insplit_automaton" ,
"vcsn/algos/insplit.hh"},
65 {
"lazy_proper_automaton" ,
"vcsn/algos/epsilon-remover-lazy.hh"},
66 {
"mutable_automaton" ,
"vcsn/core/mutable-automaton.hh"},
67 {
"name_automaton" ,
"vcsn/core/name-automaton.hh"},
68 {
"pair_automaton" ,
"vcsn/algos/synchronizing-word.hh"},
69 {
"partition_automaton" ,
"vcsn/core/partition-automaton.hh"},
70 {
"permutation_automaton" ,
"vcsn/core/permutation-automaton.hh"},
71 {
"product_automaton" ,
"vcsn/algos/conjunction.hh"},
72 {
"scc_automaton" ,
"vcsn/algos/scc.hh"},
73 {
"synchronized_automaton" ,
"vcsn/algos/synchronize.hh"},
74 {
"transpose_automaton" ,
"vcsn/algos/transpose.hh"},
75 {
"tuple_automaton" ,
"vcsn/core/tuple-automaton.hh"},
78 auto type = t.get_type();
82 for (
auto c: t.get_content())
89 os_ << decendl << '>
'; 94 header("vcsn/ctx/context.hh"); 95 os_ << "vcsn::context<" << incendl; 96 t.get_labelset()->accept(*this); 98 t.get_weightset()->accept(*this); 99 os_ << decendl << '>
'; 105 os_ << "std::tuple<" << incendl; 107 for (auto v: t.get_sets()) 114 os_ << decendl << '>
'; 119 headers_late_.insert("vcsn/labelset/tupleset.hh"); 120 os_ << "vcsn::tupleset<" << incendl; 122 for (auto v: t.get_sets()) 129 os_ << decendl << '>
'; 134 header("vcsn/labelset/nullableset.hh"); 135 os_ << "vcsn::nullableset<" << incendl; 136 t.get_labelset()->accept(*this); 137 os_ << decendl << ">"; 143 header("vcsn/labelset/oneset.hh"); 144 os_ << "vcsn::oneset"; 149 header("vcsn/alphabets/setalpha.hh"); // set_alphabet 150 if (t.letter_type() == "char_letters") 151 header("vcsn/alphabets/char.hh"); 152 else if (t.letter_type() == "string_letters") 153 header("vcsn/alphabets/string.hh"); 154 os_ << "vcsn::set_alphabet<vcsn::" << t.letter_type() << '>
'; 159 header("vcsn/labelset/letterset.hh"); 160 os_ << "vcsn::letterset<"; 161 t.genset()->accept(*this); 165 DEFINE(expressionset) 167 header("vcsn/core/rat/expressionset.hh"); 168 os_ << "vcsn::expressionset<" << incendl; 169 t.get_context()->accept(*this); 170 os_ << decendl << '>
'; 175 header("vcsn/core/rat/expansionset.hh"); 176 os_ << "vcsn::rat::expansionset<" << incendl; 177 t.get_expressionset()->accept(*this); 178 os_ << decendl << '>
'; 183 header("vcsn/weightset/" + t.get_type() + ".hh"); 184 if (t.get_type() == "qmp") 185 linkflags("-lgmp -lgmpxx"); 186 os_ << "vcsn::" << t.get_type(); 191 header("vcsn/labelset/wordset.hh"); 192 os_ << "vcsn::wordset<"; 193 t.genset()->accept(*this); 199 if (boost::ends_with(t.get_type(), "_tag")) 204 DEFINE(polynomialset) 206 header("vcsn/weightset/polynomialset.hh"); 207 os_ << "vcsn::polynomialset<" << incendl; 208 t.get_content()->accept(*this); 209 os_ << decendl << '>
'; std::ostream & iendl(std::ostream &o)
Print an end of line, then set the indentation.
std::set< std::string > headers_
Headers to include.
const std::string & linkflags() const
Get the link flags.
std::ostream & incendl(std::ostream &o)
Increment the indentation, print an end of line, and set the indentation.
std::string linkflags_
Flags to pass to the linker.
void header(const std::string &h)
Record that we need an include for this header.
A mapping from strings to Values.
std::ostream & print(std::ostream &o)
Generate the code to compile on o.
Indentation relative functions.
std::set< std::string > headers_late_