17 #ifndef AWALI_LABELSET_ONESET_HH
18 # define AWALI_LABELSET_ONESET_HH
25 #include <awali/common/json/node.cc>
26 #include <awali/common/parse_exception.cc>
33 namespace awali {
namespace sttc {
52 static std::string
vname(
bool =
true)
84 template <
typename... Args>
87 return value_t{std::forward<Args>(args)...};
109 constexpr
static bool
115 static constexpr
bool
121 static constexpr
bool
127 static constexpr
bool
165 const std::string& =
"text")
188 if (i.peek() ==
'\\')
193 "invalid label: unexpected \\",
c);
199 static std::set<value_t>
convs(std::istream&)
201 raise(
"oneset: ranges not implemented");
209 else if (
format ==
"text")
212 raise(
"invalid format: ",
format);
217 return std::set<value_t>();
221 template<
unsigned version = version::fsm_json>
237 template<
unsigned version = version::fsm_json>
250 template<
unsigned version = version::fsm_json>
259 require(s.empty(),
"json parser Letterset",
"empty string expected");
265 parse(
const std::string & s,
size_t& p,
bool fixed_alphabet=
true)
const {
266 if ((p>=2) && s[p-2] ==
'\\' && s[p-1] ==
'e')
virtual std::string to_string() const
Coerces this node_t to an std::string.
Definition: node.hh:331
object_t * push_back(std::string key, node_t *node)
The semiring of complex numbers.
Definition: c.hh:44
Implementation of labels are ones: there is a single instance of label.
Definition: oneset.hh:38
constexpr static bool is_special(value_t)
The special label is indistinguishable for the others.
Definition: oneset.hh:110
empty_t value_t
Definition: oneset.hh:41
static constexpr bool has_one()
Definition: oneset.hh:122
static bool is_one(empty_t)
Definition: oneset.hh:138
value_t parse(const std::string &s, size_t &p, bool fixed_alphabet=true) const
Definition: oneset.hh:265
static value_t conv(self_type, value_t v)
Definition: oneset.hh:181
static size_t hash(value_t v)
Definition: oneset.hh:175
static std::set< value_t > convs(std::istream &)
Definition: oneset.hh:199
static bool less_than(const value_t, const value_t)
Whether l < r.
Definition: oneset.hh:98
static value_t conv(std::istream &i)
Definition: oneset.hh:186
value_t value_from_json(json::node_t const *p) const
Definition: oneset.hh:251
static std::string sname()
Definition: oneset.hh:47
static constexpr bool is_letterized()
Definition: oneset.hh:128
static bool equals(const value_t, const value_t)
Whether l == r.
Definition: oneset.hh:92
static bool is_letter(empty_t)
Definition: oneset.hh:148
std::set< value_t > genset() const
Definition: oneset.hh:216
std::ostream & print_set(std::ostream &o, const std::string &format="text") const
Definition: oneset.hh:205
static std::ostream & print(empty_t, std::ostream &o, const std::string &="text")
Definition: oneset.hh:164
static value_t special()
Definition: oneset.hh:103
static constexpr bool is_free()
Definition: oneset.hh:75
static empty_t one()
Definition: oneset.hh:133
static constexpr bool is_ratexpset()
Definition: oneset.hh:116
bool open(bool o) const
Does not make a lot of sense.
Definition: oneset.hh:70
value_t value(Args &&... args) const
Value constructor.
Definition: oneset.hh:85
static empty_t concat(empty_t, empty_t)
Definition: oneset.hh:159
static empty_t transpose(empty_t)
Definition: oneset.hh:143
json::node_t * value_to_json(value_t) const
Definition: oneset.hh:238
static oneset make(std::istream &is)
Build from the description in is.
Definition: oneset.hh:58
static std::string vname(bool=true)
Definition: oneset.hh:52
static bool has(const T &)
Definition: oneset.hh:154
static json::node_t * to_json()
Definition: oneset.hh:223
static size_t size(value_t)
Definition: oneset.hh:170
labelset_description oneset()
std::string to_string(identities i)
auto join(const ratexpset< Ctx1 > &a, const ratexpset< Ctx2 > &b) -> ratexpset< join_t< Ctx1, Ctx2 >>
The union of two ratexpsets.
Definition: ratexpset.hh:445
auto meet(const ratexpset< Ctx1 > &a, const ratexpset< Ctx2 > &b) -> ratexpset< meet_t< Ctx1, Ctx2 >>
The meet of two ratexpsets.
Definition: ratexpset.hh:434
auto format(const ValueSet &vs, const typename ValueSet::value_t &v, Args &&... args) -> std::string
Format v via vs.print.
Definition: stream.hh:109
void require(bool b, Args &&... args)
If b is not verified, raise an error with args as message.
Definition: raise.hh:55
Empty labels, for LAO.
Definition: empty.hh:28
std::size_t hash_value(const T &v)
Definition: hash.hh:76
Main namespace of Awali.
Definition: ato.hh:22
Exceptions thrown during parsing.
Definition: parse_exception.hh:26
marker type for labelsets where labels are one
Definition: kind.hh:80
static void make(std::istream &is)
Definition: kind.hh:80