1 #ifndef VCSN_CORE_RAT_RATEXP_HH
2 # define VCSN_CORE_RAT_RATEXP_HH
7 # include <boost/range.hpp>
24 virtual ~exp() =
default;
81 template <
typename Context>
83 :
public std::enable_shared_from_this<node<Context>>
90 using value_t = std::shared_ptr<const node_t>;
102 template <
typename Context>
104 :
public node<Context>
119 template <exp::type_t Type,
typename Context>
121 :
public inner<Context>
156 auto tail() const -> decltype(boost::make_iterator_range(*this, 1, 0));
177 template <exp::type_t Type,
typename Context>
179 :
public inner<Context>
182 static_assert(
is_unary(Type),
"invalid type");
206 template <exp::type_t Type,
typename Context>
208 :
public inner<Context>
244 template <
typename Context>
246 :
public node<Context>
253 template <exp::type_t Type,
typename Context>
255 :
public leaf<Context>
269 template <
typename Context>
271 :
public leaf<Context>
295 #endif // !VCSN_CORE_RAT_RATEXP_HH
bool is_leaf() const
Whether a leaf of the ratexp tree.
constexpr bool is_variadic(type_t t)
Whether one of the variadic types.
virtual void accept(typename super_t::const_visitor &v) const
An inner node with multiple children.
The abstract parameterized, root for all rational expression types.
virtual type_t type() const
The type of this node.
const_reverse_iterator reverse_iterator
typename super_t::values_t values_t
typename values_t::const_reverse_iterator const_reverse_iterator
const value_t sub() const
atom(const label_t &value)
typename super_t::value_t value_t
const_iterator end() const
void set_weight(const weight_t &w)
constexpr bool is_unary(type_t t)
Whether star, complement.
const_reverse_iterator rbegin() const
typename super_t::value_t value_t
The abstract, non-parameterized, root for all rational expression node types.
weight_t_of< Context > weight_t
typename super_t::value_t value_t
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
type_t
The possible types of ratexps.
const value_t back() const
The last item of this variadic.
typename detail::label_t_of_impl< base_t< ValueSet >>::type label_t_of
values_t subs() const
Return a copy of children.
const value_t operator[](size_t n) const
Access the n-th element.
label_t_of< Context > label_t
const label_t & value() const
typename super_t::value_t value_t
rat::type_t type_t
The possible types of ratexps.
const_reverse_iterator rend() const
virtual void accept(typename super_t::const_visitor &v) const
weight_node(const weight_t &w, value_t exp)
An inner node implementing a weight.
vcsn::rat::const_visitor< context_t > const_visitor
std::vector< value_t > values_t
weight_node(const weight_node &that)
typename detail::weight_t_of_impl< base_t< ValueSet >>::type weight_t_of
virtual type_t type() const =0
The type of this node.
The root from which to derive the final node types.
virtual type_t type() const
The type of this node.
std::shared_ptr< const node_t > value_t
A ratexp usable with value semantics.
const_iterator begin() const
const value_t sub() const
constexpr bool is_constant(type_t t)
Whether is a constant (\z or \e).
bool is_unary() const
Whether star, complement.
virtual void accept(typename super_t::const_visitor &v) const
const value_t head() const
The first item of this variadic.
auto tail() const -> decltype(boost::make_iterator_range(*this, 1, 0))
The non-first items.
typename values_t::const_iterator const_iterator
virtual void accept(const_visitor &v) const =0
virtual type_t type() const
The type of this node.
const weight_t & weight() const
virtual void accept(typename super_t::const_visitor &v) const