char_class.hpp
Go to the documentation of this file.
1 // Copyright (C) 2020-2023 Jonathan Müller and lexy contributors
2 // SPDX-License-Identifier: BSL-1.0
3 
4 #ifndef LEXY_DSL_CHAR_CLASS_HPP_INCLUDED
5 #define LEXY_DSL_CHAR_CLASS_HPP_INCLUDED
6 
8 #include <lexy/_detail/swar.hpp>
9 #include <lexy/dsl/base.hpp>
10 #include <lexy/dsl/token.hpp>
11 
12 namespace lexy::_detail
13 {
14 struct ascii_set
15 {
16  bool contains[128];
17 
18  constexpr ascii_set() : contains{} {}
19 
20  template <typename Fn>
21  constexpr void visit(Fn fn) const
22  {
23  for (auto i = 0; i != 128; ++i)
24  if (contains[i])
25  fn(i);
26  }
27 
28  template <typename Fn>
29  constexpr void visit_range(Fn fn) const
30  {
31  auto range_begin = -1;
32  auto last_char = range_begin;
33  visit([&](int c) {
34  if (range_begin == -1)
35  {
36  range_begin = c;
37  last_char = c;
38  }
39  else if (last_char + 1 == c)
40  {
41  last_char = c;
42  }
43  else
44  {
45  fn(range_begin, last_char);
46  range_begin = c;
47  last_char = c;
48  }
49  });
50  if (range_begin != -1)
51  fn(range_begin, last_char);
52  }
53 
54  constexpr void insert(int c)
55  {
56  contains[c] = true;
57  }
58  constexpr void insert(int lower, int upper)
59  {
60  for (auto i = lower; i <= upper; ++i)
61  contains[i] = true;
62  }
63  constexpr void insert(const ascii_set& other)
64  {
65  other.visit([&](int c) { contains[c] = true; });
66  }
67  constexpr void remove(const ascii_set& other)
68  {
69  other.visit([&](int c) { contains[c] = false; });
70  }
71 };
72 
73 template <std::size_t RangeCount, std::size_t SingleCount>
75 {
76  char range_lower[RangeCount == 0 ? 1 : RangeCount];
77  char range_upper[RangeCount == 0 ? 1 : RangeCount];
78  char singles[SingleCount == 0 ? 1 : SingleCount];
79 
80  static constexpr std::size_t range_count()
81  {
82  return RangeCount;
83  }
84  static constexpr std::size_t single_count()
85  {
86  return SingleCount;
87  }
88 };
89 
90 template <typename T>
91 constexpr auto compress_ascii_set()
92 {
93  constexpr auto set = T::char_class_ascii();
94 
95  constexpr auto count = [&set] {
96  struct result_t
97  {
98  std::size_t range_count;
99  std::size_t single_count;
100  } result{0, 0};
101 
102  set.visit_range([&](int lower, int upper) {
103  if (lower != upper)
104  ++result.range_count;
105  else
106  ++result.single_count;
107  });
108 
109  return result;
110  }();
111 
112  compressed_ascii_set<count.range_count, count.single_count> result{};
113 
114  auto cur_range = 0u;
115  auto cur_single = 0u;
116  set.visit_range([&](int lower, int upper) {
117  if (lower != upper)
118  {
119  result.range_lower[cur_range] = char(lower);
120  result.range_upper[cur_range] = char(upper);
121  ++cur_range;
122  }
123  else
124  {
125  result.singles[cur_single] = char(lower);
126  ++cur_single;
127  }
128  });
129 
130  return result;
131 }
132 } // namespace lexy::_detail
133 
134 namespace lexy::_detail
135 {
136 template <const auto& CompressedAsciiSet,
137  typename = make_index_sequence<CompressedAsciiSet.range_count()>,
138  typename = make_index_sequence<CompressedAsciiSet.single_count()>>
140 template <const auto& CompressedAsciiSet, std::size_t... RangeIdx, std::size_t... SingleIdx>
141 struct ascii_set_matcher<CompressedAsciiSet, index_sequence<RangeIdx...>,
142  index_sequence<SingleIdx...>>
143 {
144  template <typename Encoding>
145  static LEXY_CONSTEVAL auto to_int_type(char c)
146  {
147  return Encoding::to_int_type(static_cast<typename Encoding::char_type>(c));
148  }
149 
150  template <typename Encoding>
151  LEXY_FORCE_INLINE static constexpr bool match([[maybe_unused]] typename Encoding::int_type cur)
152  {
153  return
154  // It must be in one of the ranges...
155  ((to_int_type<Encoding>(CompressedAsciiSet.range_lower[RangeIdx]) <= cur
156  && cur <= to_int_type<Encoding>(CompressedAsciiSet.range_upper[RangeIdx]))
157  || ...)
158  // or one of the single characters.
159  || ((cur == to_int_type<Encoding>(CompressedAsciiSet.singles[SingleIdx])) || ...);
160  }
161 };
162 } // namespace lexy::_detail
163 
164 namespace lexyd
165 {
166 template <typename CharSet>
167 constexpr auto _cas = lexy::_detail::compress_ascii_set<CharSet>();
168 
169 template <typename Derived>
171 {
172  //=== "virtual" functions ===//
173  // static const char* char_class_name();
174  // static ascii_set char_class_ascii();
175 
176  static constexpr bool char_class_unicode()
177  {
178  return true;
179  }
180 
181  static constexpr std::false_type char_class_match_cp(char32_t)
182  {
183  return {};
184  }
185 
186  template <typename Reader, typename Context>
187  static constexpr void char_class_report_error(Context& context,
188  typename Reader::iterator position)
189  {
190  constexpr auto name = Derived::char_class_name();
192  context.on(_ev::error{}, err);
193  }
194 
197  template <typename Encoding>
199  {
200  return std::false_type{};
201  }
202 
203  //=== provided functions ===//
204  template <typename Reader>
205  struct tp
206  {
207  typename Reader::iterator end;
208 
209  constexpr explicit tp(const Reader& reader) : end(reader.position()) {}
210 
211  constexpr bool try_parse(Reader reader)
212  {
214  if (matcher::template match<typename Reader::encoding>(reader.peek()))
215  {
216  reader.bump();
217  end = reader.position();
218  return true;
219  }
220 
221  if constexpr (std::is_same_v<decltype(Derived::char_class_match_cp(char32_t())),
222  std::false_type>)
223  {
224  return false;
225  }
226  else if constexpr (std::is_same_v<typename Reader::encoding, lexy::default_encoding> //
227  || std::is_same_v<typename Reader::encoding, lexy::byte_encoding>)
228  {
229  static_assert(!Derived::char_class_unicode(),
230  "cannot use this character class with default/byte_encoding");
231 
232  if (reader.peek() == Reader::encoding::eof())
233  return false;
234 
235  auto cp = static_cast<char32_t>(reader.peek());
236  reader.bump();
237 
238  if (!Derived::char_class_match_cp(cp))
239  return false;
240 
241  end = reader.position();
242  return true;
243  }
244  else
245  {
246  static_assert(Derived::char_class_unicode(),
247  "cannot use this character class with Unicode encoding");
248 
249  // Parse one code point.
250  auto result = lexy::_detail::parse_code_point(reader);
251  if (result.error != lexy::_detail::cp_error::success)
252  return false;
253 
254  if (!Derived::char_class_match_cp(result.cp))
255  return false;
256 
257  end = result.end;
258  return true;
259  }
260  }
261 
262  template <typename Context>
263  constexpr void report_error(Context& context, const Reader& reader)
264  {
265  Derived::template char_class_report_error<Reader>(context, reader.position());
266  }
267  };
268 };
269 } // namespace lexyd
270 
271 #define LEXY_CHAR_CLASS(Name, Rule) \
272  [] { \
273  static_assert(::lexy::is_char_class_rule<LEXY_DECAY_DECLTYPE(Rule)>); \
274  struct c : ::lexyd::char_class_base<c> \
275  { \
276  static constexpr auto char_class_unicode() \
277  { \
278  return (Rule).char_class_unicode(); \
279  } \
280  static LEXY_CONSTEVAL auto char_class_name() \
281  { \
282  return Name; \
283  } \
284  static LEXY_CONSTEVAL auto char_class_ascii() \
285  { \
286  return (Rule).char_class_ascii(); \
287  } \
288  static constexpr auto char_class_match_cp(char32_t cp) \
289  { \
290  return (Rule).char_class_match_cp(cp); \
291  } \
292  }; \
293  return c{}; \
294  }()
295 
296 namespace lexyd
297 {
298 template <typename CharT, CharT... C>
299 struct _lit;
300 template <char32_t... Cp>
301 struct _lcp;
302 
303 // Implementation helper for the literal overloads.
304 template <char32_t Cp>
305 struct _ccp : char_class_base<_ccp<Cp>>
306 {
308  {
309  return "code-point";
310  }
311 
313  {
315  if constexpr (Cp <= 0x7F)
316  result.insert(Cp);
317  return result;
318  }
319 
320  static constexpr auto char_class_match_cp([[maybe_unused]] char32_t cp)
321  {
322  if constexpr (Cp <= 0x7F)
323  return std::false_type{};
324  else
325  return cp == Cp;
326  }
327 };
328 template <unsigned char Byte>
329 struct _cb : char_class_base<_cb<Byte>>
330 {
331  static constexpr auto char_class_unicode()
332  {
333  return Byte <= 0x7F;
334  }
335 
337  {
338  return "byte";
339  }
340 
342  {
344  if constexpr (Byte <= 0x7F)
345  result.insert(Byte);
346  return result;
347  }
348 
349  static constexpr auto char_class_match_cp([[maybe_unused]] char32_t cp)
350  {
351  if constexpr (Byte <= 0x7F)
352  return std::false_type{};
353  else
354  return cp == Byte;
355  }
356 };
357 
358 template <typename C, typename = std::enable_if_t<lexy::is_char_class_rule<C>>>
359 constexpr auto _make_char_class(C c)
360 {
361  return c;
362 }
363 template <typename CharT, CharT C,
364  typename = std::enable_if_t<
365  C <= 0x7F || std::is_same_v<CharT, char32_t> || std::is_same_v<CharT, unsigned char>>>
366 constexpr auto _make_char_class(_lit<CharT, C>)
367 {
368  if constexpr (std::is_same_v<CharT, unsigned char>)
369  return _cb<C>{};
370  else
371  return _ccp<static_cast<char32_t>(C)>{};
372 }
373 template <char32_t CP>
374 constexpr auto _make_char_class(_lcp<CP>)
375 {
376  return _ccp<CP>{};
377 }
378 } // namespace lexyd
379 
380 namespace lexyd
381 {
382 template <typename... Cs>
383 struct _calt : char_class_base<_calt<Cs...>>
384 {
385  static_assert(sizeof...(Cs) > 1);
386 
387  static constexpr auto char_class_unicode()
388  {
389  constexpr auto non_unicode = (!Cs::char_class_unicode() || ...);
390  static_assert(!non_unicode
391  // If at least one is non-Unicode, either they all must be non-Unicode or
392  // only match ASCII.
393  || ((!Cs::char_class_unicode()
394  || std::is_same_v<decltype(Cs::char_class_match_cp(0)),
395  std::false_type>)&&...),
396  "cannot mix bytes and Unicode char classes");
397  return !non_unicode;
398  }
399 
401  {
402  return "union";
403  }
404 
406  {
408  (result.insert(Cs::char_class_ascii()), ...);
409  return result;
410  }
411 
412  static constexpr auto char_class_match_cp(char32_t cp)
413  {
414  if constexpr ((std::is_same_v<decltype(Cs::char_class_match_cp(cp)),
415  std::false_type> && ...))
416  return std::false_type{};
417  else
418  return (Cs::char_class_match_cp(cp) || ...);
419  }
420 };
421 
422 template <typename R1, typename R2>
423 constexpr auto operator/(R1 r1, R2 r2)
424  -> _calt<decltype(_make_char_class(r1)), decltype(_make_char_class(r2))>
425 {
426  return {};
427 }
428 
429 template <typename... Cs, typename C>
430 constexpr auto operator/(_calt<Cs...>, C c) -> _calt<Cs..., decltype(_make_char_class(c))>
431 {
432  return {};
433 }
434 template <typename C, typename... Cs>
435 constexpr auto operator/(C c, _calt<Cs...>) -> _calt<decltype(_make_char_class(c)), Cs...>
436 {
437  return {};
438 }
439 
440 template <typename... Cs, typename... Ds>
441 constexpr auto operator/(_calt<Cs...>, _calt<Ds...>) -> _calt<Cs..., Ds...>
442 {
443  return {};
444 }
445 } // namespace lexyd
446 
447 namespace lexyd
448 {
449 template <typename C>
450 struct _ccomp : char_class_base<_ccomp<C>>
451 {
452  static constexpr auto char_class_unicode()
453  {
454  return C::char_class_unicode();
455  }
456 
458  {
459  return "complement";
460  }
461 
463  {
465  result.insert(0x00, 0x7F);
466  result.remove(C::char_class_ascii());
467  return result;
468  }
469 
470  static constexpr auto char_class_match_cp(char32_t cp)
471  {
472  if (cp <= 0x7F)
473  // If we haven't matched an ASCII character so far, this was intentional.
474  return false;
475 
476  if constexpr (std::is_same_v<decltype(C::char_class_match_cp(cp)), std::false_type>)
477  return true;
478  else
479  return !C::char_class_match_cp(cp);
480  }
481 };
482 
483 template <typename C>
484 constexpr auto operator-(C c) -> _ccomp<decltype(_make_char_class(c))>
485 {
486  return {};
487 }
488 template <typename C>
489 constexpr auto operator-(_ccomp<C>) -> C
490 {
491  return {};
492 }
493 } // namespace lexyd
494 
495 namespace lexyd
496 {
497 template <typename Set, typename Minus>
498 struct _cminus : char_class_base<_cminus<Set, Minus>>
499 {
500  // calt does the correct logic as well, so re-use it.
501  static constexpr auto char_class_unicode()
502  {
504  }
505 
507  {
508  return "minus";
509  }
510 
512  {
513  auto result = Set::char_class_ascii();
514  result.remove(Minus::char_class_ascii());
515  return result;
516  }
517 
518  static constexpr auto char_class_match_cp(char32_t cp)
519  {
520  if constexpr (std::is_same_v<decltype(Set::char_class_match_cp(cp)), std::false_type>)
521  return std::false_type{};
522  else if constexpr (std::is_same_v<decltype(Minus::char_class_match_cp(cp)),
523  std::false_type>)
524  // We don't match ASCII at this point: they only reach this point if the ASCII table
525  // failed.
526  return cp > 0x7F && Set::char_class_match_cp(cp);
527  else
528  // Same as above, no ASCII.
529  return cp > 0x7F && Set::char_class_match_cp(cp) && !Minus::char_class_match_cp(cp);
530  }
531 };
532 
533 template <typename Set, typename Minus>
534 constexpr auto operator-(Set, Minus minus)
535 {
536  return _cminus<Set, decltype(_make_char_class(minus))>{};
537 }
538 
539 template <typename Set, typename Minus, typename OtherMinus>
540 constexpr auto operator-(_cminus<Set, Minus>, OtherMinus other)
541 {
542  return Set{} - _calt<Minus, decltype(_make_char_class(other))>{};
543 }
544 } // namespace lexyd
545 
546 namespace lexyd
547 {
548 template <typename... Cs>
549 struct _cand : char_class_base<_cand<Cs...>>
550 {
551  static_assert(sizeof...(Cs) > 1);
552 
553  // calt does the correct logic as well, so re-use it.
554  static constexpr auto char_class_unicode()
555  {
557  }
558 
560  {
561  return "intersection";
562  }
563 
565  {
567  for (auto c = 0; c <= 0x7F; ++c)
568  if ((Cs::char_class_ascii().contains[c] && ...))
569  result.insert(c);
570  return result;
571  }
572 
573  static constexpr auto char_class_match_cp(char32_t cp)
574  {
575  if constexpr ((std::is_same_v<decltype(Cs::char_class_match_cp(cp)),
576  std::false_type> && ...))
577  return std::false_type{};
578  else
579  return (Cs::char_class_match_cp(cp) && ...);
580  }
581 };
582 
583 template <typename C1, typename C2>
584 constexpr auto operator&(C1 c1, C2 c2)
585  -> _cand<decltype(_make_char_class(c1)), decltype(_make_char_class(c2))>
586 {
587  return {};
588 }
589 
590 template <typename... Cs, typename C>
591 constexpr auto operator&(_cand<Cs...>, C c) -> _cand<Cs..., decltype(_make_char_class(c))>
592 {
593  return {};
594 }
595 template <typename C, typename... Cs>
596 constexpr auto operator&(C c, _cand<Cs...>) -> _cand<decltype(_make_char_class(c)), Cs...>
597 {
598  return {};
599 }
600 
601 template <typename... Cs, typename... Ds>
602 constexpr auto operator&(_cand<Cs...>, _cand<Ds...>) -> _cand<Cs..., Ds...>
603 {
604  return {};
605 }
606 } // namespace lexyd
607 
608 #endif // LEXY_DSL_CHAR_CLASS_HPP_INCLUDED
609 
lexyd::char_class_base::tp::end
Reader::iterator end
Definition: char_class.hpp:207
lexyd::position
constexpr auto position
Produces an iterator to the current reader position without parsing anything.
Definition: position.hpp:79
code_point.hpp
LEXY_CONSTEVAL
#define LEXY_CONSTEVAL
Definition: config.hpp:90
lexy::_detail::ascii_set_matcher
Definition: char_class.hpp:139
token.hpp
lexy::_detail::ascii_set::visit
constexpr void visit(Fn fn) const
Definition: char_class.hpp:21
magic_enum::char_type
string_view::value_type char_type
Definition: magic_enum.hpp:145
lexy::_detail::parse_code_point
constexpr cp_result< Reader > parse_code_point(Reader reader)
Definition: _detail/code_point.hpp:142
lexy::_detail::compressed_ascii_set::single_count
static constexpr std::size_t single_count()
Definition: char_class.hpp:84
lexyd::_cb::char_class_ascii
static LEXY_CONSTEVAL auto char_class_ascii()
Definition: char_class.hpp:341
lexyd::_ccomp
Definition: char_class.hpp:450
lexyd::_calt::char_class_ascii
static LEXY_CONSTEVAL auto char_class_ascii()
Definition: char_class.hpp:405
lexyd::_ccp::char_class_name
static LEXY_CONSTEVAL auto char_class_name()
Definition: char_class.hpp:307
lexy::_detail::swar_int
std::uintmax_t swar_int
Definition: swar.hpp:20
lexyd::operator/
constexpr auto operator/(R1 r1, R2 r2) -> _calt< decltype(_make_char_class(r1)), decltype(_make_char_class(r2))>
Definition: char_class.hpp:423
lexyd::char_class_base::tp::report_error
constexpr void report_error(Context &context, const Reader &reader)
Definition: char_class.hpp:263
lexyd::_cminus::char_class_name
static LEXY_CONSTEVAL auto char_class_name()
Definition: char_class.hpp:506
lexy::_detail::ascii_set_matcher< CompressedAsciiSet, index_sequence< RangeIdx... >, index_sequence< SingleIdx... > >::match
static constexpr LEXY_FORCE_INLINE bool match([[maybe_unused]] typename Encoding::int_type cur)
Definition: char_class.hpp:151
lexyd::char_class_base::char_class_report_error
static constexpr void char_class_report_error(Context &context, typename Reader::iterator position)
Definition: char_class.hpp:187
lexy::_detail::ascii_set::remove
constexpr void remove(const ascii_set &other)
Definition: char_class.hpp:67
lexy::_detail::ascii_set::insert
constexpr void insert(int c)
Definition: char_class.hpp:54
lexy::_detail::integer_sequence
Definition: integer_sequence.hpp:12
lexyd::_cand::char_class_match_cp
static constexpr auto char_class_match_cp(char32_t cp)
Definition: char_class.hpp:573
lexy::_detail::make_index_sequence
typename _make_index_sequence< Size >::type make_index_sequence
Definition: integer_sequence.hpp:55
lexyd::_cminus::char_class_match_cp
static constexpr auto char_class_match_cp(char32_t cp)
Definition: char_class.hpp:518
lexyd::_cand::char_class_name
static LEXY_CONSTEVAL auto char_class_name()
Definition: char_class.hpp:559
lexy::_detail::ascii_set::contains
bool contains[128]
Definition: char_class.hpp:16
lexy::error
Generic failure.
Definition: error.hpp:14
lexyd::_ccomp::char_class_match_cp
static constexpr auto char_class_match_cp(char32_t cp)
Definition: char_class.hpp:470
lexy::_detail::compressed_ascii_set::range_lower
char range_lower[RangeCount==0 ? 1 :RangeCount]
Definition: char_class.hpp:76
lexyd::_cminus::char_class_ascii
static LEXY_CONSTEVAL auto char_class_ascii()
Definition: char_class.hpp:511
lexy::_detail::compress_ascii_set
constexpr auto compress_ascii_set()
Definition: char_class.hpp:91
lexy::count
constexpr auto count
Sink that counts all arguments.
Definition: fold.hpp:88
lexyd::_cminus
Definition: char_class.hpp:498
lexyd::_cb::char_class_name
static LEXY_CONSTEVAL auto char_class_name()
Definition: char_class.hpp:336
swar.hpp
lexyd::_calt::char_class_name
static LEXY_CONSTEVAL auto char_class_name()
Definition: char_class.hpp:400
lexy::parse_events::error
Definition: dsl/base.hpp:55
lexyd::_cb
Definition: char_class.hpp:329
lexyd::token_base
Definition: dsl/token.hpp:42
lexyd::char_class_base::tp::try_parse
constexpr bool try_parse(Reader reader)
Definition: char_class.hpp:211
lexyd::char_class_base::char_class_unicode
static constexpr bool char_class_unicode()
Definition: char_class.hpp:176
lexyd::_ccomp::char_class_unicode
static constexpr auto char_class_unicode()
Definition: char_class.hpp:452
lexyd::char_class_base::char_class_match_swar
static constexpr auto char_class_match_swar(lexy::_detail::swar_int)
Definition: char_class.hpp:198
lexyd::_char_class_base
Definition: grammar.hpp:28
lexyd::char_class_base::tp::tp
constexpr tp(const Reader &reader)
Definition: char_class.hpp:209
lexyd::_calt
Definition: char_class.hpp:383
lexy::_detail::ascii_set::insert
constexpr void insert(int lower, int upper)
Definition: char_class.hpp:58
lexy::_detail::ascii_set_matcher< CompressedAsciiSet, index_sequence< RangeIdx... >, index_sequence< SingleIdx... > >::to_int_type
static LEXY_CONSTEVAL auto to_int_type(char c)
Definition: char_class.hpp:145
lexy::_detail::ascii_set::ascii_set
constexpr ascii_set()
Definition: char_class.hpp:18
lexyd::_cas
constexpr auto _cas
Definition: char_class.hpp:167
lexy::_detail::compressed_ascii_set::range_upper
char range_upper[RangeCount==0 ? 1 :RangeCount]
Definition: char_class.hpp:77
lexyd::_cminus::char_class_unicode
static constexpr auto char_class_unicode()
Definition: char_class.hpp:501
lexyd::_cb::char_class_unicode
static constexpr auto char_class_unicode()
Definition: char_class.hpp:331
lexyd::ascii::lower
constexpr auto lower
Definition: ascii.hpp:145
lexyd::char_class_base
Definition: char_class.hpp:170
lexyd::_ccp::char_class_ascii
static LEXY_CONSTEVAL auto char_class_ascii()
Definition: char_class.hpp:312
lexyd::char_class_base::tp
Definition: char_class.hpp:205
lexy::_detail::compressed_ascii_set
Definition: char_class.hpp:74
base.hpp
lexyd::_cand::char_class_ascii
static LEXY_CONSTEVAL auto char_class_ascii()
Definition: char_class.hpp:564
lexy::_detail
Definition: any_ref.hpp:12
lexyd::_ccp
Definition: char_class.hpp:305
lexyd::_lit
Definition: char_class.hpp:299
lexyd::operator-
constexpr auto operator-(C c) -> _ccomp< decltype(_make_char_class(c))>
Definition: char_class.hpp:484
LEXY_FORCE_INLINE
#define LEXY_FORCE_INLINE
Definition: config.hpp:148
lexy::_detail::cp_error::success
@ success
lexyd::_ccp::char_class_match_cp
static constexpr auto char_class_match_cp([[maybe_unused]] char32_t cp)
Definition: char_class.hpp:320
lexyd::_make_char_class
constexpr auto _make_char_class(C c)
Definition: char_class.hpp:359
lexyd::_ccomp::char_class_ascii
static LEXY_CONSTEVAL auto char_class_ascii()
Definition: char_class.hpp:462
lexyd::_cand
Definition: char_class.hpp:549
lexyd::_lcp
Definition: char_class.hpp:301
lexy::_detail::ascii_set::insert
constexpr void insert(const ascii_set &other)
Definition: char_class.hpp:63
lexyd::ascii::upper
constexpr auto upper
Definition: ascii.hpp:177
lexyd::_cb::char_class_match_cp
static constexpr auto char_class_match_cp([[maybe_unused]] char32_t cp)
Definition: char_class.hpp:349
lexyd::_calt::char_class_unicode
static constexpr auto char_class_unicode()
Definition: char_class.hpp:387
lexy::_detail::compressed_ascii_set::range_count
static constexpr std::size_t range_count()
Definition: char_class.hpp:80
lexyd
Definition: trace.hpp:22
lexy::_detail::compressed_ascii_set::singles
char singles[SingleCount==0 ? 1 :SingleCount]
Definition: char_class.hpp:78
lexyd::_calt::char_class_match_cp
static constexpr auto char_class_match_cp(char32_t cp)
Definition: char_class.hpp:412
lexyd::char_class_base::char_class_match_cp
static constexpr std::false_type char_class_match_cp(char32_t)
Definition: char_class.hpp:181
lexyd::eof
constexpr auto eof
Matches EOF.
Definition: eof.hpp:72
lexyd::_ccomp::char_class_name
static LEXY_CONSTEVAL auto char_class_name()
Definition: char_class.hpp:457
lexy::_detail::ascii_set::visit_range
constexpr void visit_range(Fn fn) const
Definition: char_class.hpp:29
lexy::_detail::ascii_set
Definition: char_class.hpp:14
detail::enable_if_t
typename std::enable_if< B, T >::type enable_if_t
Definition: json.hpp:3095
lexyd::_cand::char_class_unicode
static constexpr auto char_class_unicode()
Definition: char_class.hpp:554
lexyd::operator&
constexpr auto operator&(C1 c1, C2 c2) -> _cand< decltype(_make_char_class(c1)), decltype(_make_char_class(c2))>
Definition: char_class.hpp:584


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Mon Sep 16 2024 02:19:22