Vcsn  2.2
Be Rational
kind.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <istream>
4 
5 #include <vcsn/misc/stream.hh> // eat
6 #include <vcsn/misc/symbol.hh>
7 #include <vcsn/misc/type_traits.hh> // std::is_same_t
8 
9 namespace vcsn
10 {
11 
25 
26 #define DEFINE(Abbrev, Name) \
27  struct labels_are_ ## Name \
28  { \
29  static symbol sname() \
30  { \
31  static auto res = symbol{#Abbrev}; \
32  return res; \
33  } \
34  \
35  static void make(std::istream& is) \
36  { \
37  eat(is, sname()); \
38  } \
39  \
40  }; \
41  \
42  template <typename Kinded> \
43  struct is_ ## Abbrev \
44  : std::is_same<typename Kinded::kind_t, labels_are_ ## Name> \
45  {}
46 
47  DEFINE(lal, letters);
48  DEFINE(lan, nullable);
49  DEFINE(lao, one);
50  DEFINE(lar, expressions);
51  DEFINE(lat, tuples);
52  DEFINE(law, words);
53 
54 #undef DEFINE
55 }
Definition: a-star.hh:8
#define DEFINE(Abbrev, Name)
Define the kinds, and auxiliary tools.
Definition: kind.hh:26