1 #ifndef VCSN_ALGOS_MAKE_CONTEXT_HH
2 # define VCSN_ALGOS_MAKE_CONTEXT_HH
20 template <
typename Ctx>
24 std::istringstream
is{name};
25 auto res = Ctx::make(
is);
34 raise(__func__,
": invalid context name: ",
str_escape(name),
44 template <
typename Ctx>
52 (
const std::string& name) ->
context);
66 template <
typename Aut>
70 const auto& a = aut->as<Aut>();
78 template <
typename RatExpSet>
82 const auto& e = exp->as<RatExpSet>().
ratexpset();
102 template <
typename Ctx,
typename Identities>
106 const auto& c = ctx->as<Ctx>();
125 template <
typename Ctx>
129 const auto& c = ctx->as<Ctx>();
140 #endif // !VCSN_ALGOS_MAKE_CONTEXT_HH
context make_context(const std::string &name)
Build a context from its name.
context make_word_context(const context &ctx)
REGISTER_DECLARE(accessible,(const automaton &) -> automaton)
std::shared_ptr< detail::automaton_base > automaton
word_context_t< context< LabelSet, WeightSet > > make_word_context(const context< LabelSet, WeightSet > &ctx)
The wordset context of a context.
context make_context(const std::string &name)
Bridge.
std::ostream & str_escape(std::ostream &os, const std::string &str)
Output a string, escaping special characters.
std::shared_ptr< detail::ratexp_base > ratexp
context context_of(const automaton &aut)
Bridge.
context context_of_ratexp(const ratexp &exp)
Bridge.
std::shared_ptr< const detail::ratexpset_base > ratexpset
std::istringstream is
The input stream: the specification to translate.
Provide a variadic mul on top of a binary mul(), and one().
std::shared_ptr< const detail::context_base > context
ratexpset make_ratexpset(const context &ctx,::vcsn::rat::identities ids)
identities
A ratexpset can implement several different sets of identities on expressions.
Ctx make_context(const std::string &name)