5 #include <boost/range.hpp>
23 virtual ~exp() =
default;
79 template <
typename Context>
81 :
public std::enable_shared_from_this<node<Context>>
88 using value_t = std::shared_ptr<const node_t>;
100 template <
typename Context>
102 :
public node<Context>
117 template <exp::type_t Type,
typename Context>
119 :
public inner<Context>
150 auto tail() const -> decltype(
boost::make_iterator_range(*this, 1, 0));
154 template <typename... Vs>
156 :
sub_{std::forward<Vs>(vs)...}
160 values_t
subs()
const;
172 template <
typename Context,
bool Enable>
174 :
public inner<Context>
177 static_assert(Context::is_lat,
178 "tuple: requires a tupleset labelset");
184 template <
unsigned Tape>
186 = std::shared_ptr<const rat::node<detail::project_context<Tape, context_t>>>;
188 template <
typename Sequence>
191 template <
size_t... I>
194 using type = std::tuple<value_t_of<I>...>;
199 template <
typename... Args>
201 :
sub_{std::forward<Args>(args)...}
216 template <
typename Context>
218 :
public inner<Context>
225 template <exp::type_t Type,
typename Context>
227 :
public inner<Context>
230 static_assert(
is_unary(Type),
"invalid type");
254 template <exp::type_t Type,
typename Context>
256 :
public inner<Context>
270 const weight_t&
weight()
const;
271 void set_weight(weight_t w);
288 template <
typename Context>
290 :
public node<Context>
297 template <exp::type_t Type,
typename Context>
299 :
public leaf<Context>
313 template <
typename Context>
315 :
public leaf<Context>
328 const label_t& value()
const;
bool is_unary() const
Whether star, complement.
bool is_leaf() const
Whether a leaf of the expression tree.
const value_t operator[](size_t n) const
Access the n-th element.
Implementation of nodes of tuple of rational expressions.
std::shared_ptr< const node_t > value_t
An expression usable with value semantics.
std::vector< value_t > values_t
label_t_of< Context > label_t
value_impl< detail::weight_tag > weight
const_iterator begin() const
An inner node implementing a weight.
virtual type_t type() const
The type of this node.
virtual type_t type() const
The type of this node.
virtual type_t type() const
The type of this node.
virtual void accept(typename super_t::const_visitor &v) const
virtual void accept(typename super_t::const_visitor &v) const
rat::type_t type_t
The possible types of expressions.
typename labelset_t_of< context_t >::indices_t indices_t
type_t
The possible types of expressions.
virtual type_t type() const
The type of this node.
std::tuple< value_t_of< I >... > type
typename detail::label_t_of_impl< base_t< ValueSet >>::type label_t_of
vcsn::rat::const_visitor< context_t > const_visitor
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
typename super_t::value_t value_t
virtual type_t type() const
The type of this node.
const value_t back() const
The last item of this variadic.
std::shared_ptr< const rat::node< detail::project_context< Tape, context_t >>> value_t_of
Given a tape, its corresponding expression type.
virtual void accept(const_visitor &v) const =0
const value_t head() const
The first item of this variadic.
typename detail::weight_t_of_impl< base_t< ValueSet >>::type weight_t_of
void visit(const tuple< context_t > &v)
virtual type_t type() const =0
The type of this node.
An inner node with multiple children.
constexpr bool is_unary(type_t t)
Whether star, complement.
typename super_t::values_t values_t
The root from which to derive the final node types.
values_t subs() const
Return a copy of children.
const values_t sub() const
auto tail() const -> decltype(boost::make_iterator_range(*this, 1, 0))
The non-first items.
constexpr bool is_constant(type_t t)
Whether is a constant (\\z or \\e).
typename super_t::value_t value_t
typename values_t::const_iterator const_iterator
weight_t_of< Context > weight_t
The abstract parameterized, root for all rational expression types.
constexpr bool is_variadic(type_t t)
Whether one of the variadic types.
virtual type_t type() const
The type of this node.
const_iterator end() const
The abstract, non-parameterized, root for all rational expression node types.