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>
154 auto tail() const -> decltype(boost::make_iterator_range(*this, 1, 0));
158 template <typename... Vs>
160 :
sub_{std::forward<Vs>(vs)...}
169 values_t
subs()
const;
181 template <
typename Context,
bool Enable>
183 :
public inner<Context>
186 static_assert(Context::is_lat,
187 "tuple: requires a tupleset labelset");
193 template <
unsigned Tape>
195 = std::shared_ptr<const rat::node<detail::project_context<Tape, context_t>>>;
197 template <
typename Sequence>
200 template <
size_t... I>
203 using type = std::tuple<value_t_of<I>...>;
208 template <
typename... Args>
210 :
sub_{std::forward<Args>(args)...}
225 template <
typename Context>
227 :
public inner<Context>
234 template <exp::type_t Type,
typename Context>
236 :
public inner<Context>
239 static_assert(
is_unary(Type),
"invalid type");
263 template <exp::type_t Type,
typename Context>
265 :
public inner<Context>
279 const weight_t&
weight()
const;
280 void set_weight(weight_t w);
285 , weight_(that.weight_)
301 template <
typename Context>
303 :
public node<Context>
310 template <exp::type_t Type,
typename Context>
312 :
public leaf<Context>
326 template <
typename Context>
328 :
public leaf<Context>
341 const label_t& value()
const;
value_impl< detail::weight_tag > weight
typename detail::weight_t_of_impl< base_t< ValueSet >>::type weight_t_of
type_t
The possible types of expressions.
const value_t back() const
The last item of this variadic.
The abstract parameterized, root for all rational expression types.
virtual void accept(const_visitor &v) const =0
constexpr bool is_unary(type_t t)
Whether star, complement.
variadic(const variadic &that)
values_t subs() const
Return a copy of children.
typename super_t::value_t value_t
label_t_of< Context > label_t
typename values_t::const_iterator const_iterator
std::shared_ptr< const node_t > value_t
An expression usable with value semantics.
std::tuple< value_t_of< I >... > type
virtual type_t type() const
The type of this node.
const values_t sub() const
const_iterator begin() const
virtual type_t type() const
The type of this node.
rat::type_t type_t
The possible types of expressions.
typename detail::labelset_t_of_impl< base_t< ValueSet >>::type labelset_t_of
vcsn::rat::const_visitor< context_t > const_visitor
An inner node implementing a weight.
The abstract, non-parameterized, root for all rational expression node types.
constexpr bool is_variadic(type_t t)
Whether one of the variadic types.
weight_node(const weight_node &that)
virtual type_t type() const
The type of this node.
constexpr bool is_constant(type_t t)
Whether is a constant (\z or \e).
weight_t_of< Context > weight_t
const value_t operator[](size_t n) const
Access the n-th element.
typename values_t::const_reverse_iterator const_reverse_iterator
std::vector< value_t > values_t
std::shared_ptr< const rat::node< detail::project_context< Tape, context_t >>> value_t_of
Given a tape, its corresponding expression type.
typename detail::label_t_of_impl< base_t< ValueSet >>::type label_t_of
void visit(const tuple< context_t > &v)
const_reverse_iterator rend() const
typename super_t::value_t value_t
const_iterator end() const
virtual void accept(typename super_t::const_visitor &v) const
The root from which to derive the final node types.
typename super_t::values_t values_t
Implementation of nodes of tuple of rational expressions.
virtual type_t type() const
The type of this node.
bool is_leaf() const
Whether a leaf of the expression tree.
virtual type_t type() const
The type of this node.
auto tail() const -> decltype(boost::make_iterator_range(*this, 1, 0))
The non-first items.
typename labelset_t_of< context_t >::indices_t indices_t
An inner node with multiple children.
virtual type_t type() const =0
The type of this node.
virtual void accept(typename super_t::const_visitor &v) const
const_reverse_iterator reverse_iterator
const_reverse_iterator rbegin() const
const value_t head() const
The first item of this variadic.
virtual type_t type() const
The type of this node.
bool is_unary() const
Whether star, complement.