char_class.hpp
Go to the documentation of this file.
1 // Copyright (C) 2020-2024 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::marker end;
208 
209  constexpr explicit tp(const Reader& reader) : end(reader.current()) {}
210 
211  constexpr bool try_parse(Reader reader)
212  {
213  static_assert(lexy::is_char_encoding<typename Reader::encoding>);
214 
216  if (matcher::template match<typename Reader::encoding>(reader.peek()))
217  {
218  reader.bump();
219  end = reader.current();
220  return true;
221  }
222 
223  if constexpr (std::is_same_v<decltype(Derived::char_class_match_cp(char32_t())),
224  std::false_type>)
225  {
226  return false;
227  }
228  else if constexpr (lexy::is_unicode_encoding<typename Reader::encoding>)
229  {
230  static_assert(Derived::char_class_unicode(),
231  "cannot use this character class with Unicode encoding");
232 
233  // Parse one code point.
234  auto result = lexy::_detail::parse_code_point(reader);
235  if (result.error != lexy::_detail::cp_error::success)
236  return false;
237 
238  if (!Derived::char_class_match_cp(result.cp))
239  return false;
240 
241  end = result.end;
242  return true;
243  }
244  else
245  {
246  static_assert(!Derived::char_class_unicode(),
247  "cannot use this character class with non-Unicode char encodings");
248 
249  if (reader.peek() == Reader::encoding::eof())
250  return false;
251 
252  auto cp = static_cast<char32_t>(reader.peek());
253  reader.bump();
254 
255  if (!Derived::char_class_match_cp(cp))
256  return false;
257 
258  end = reader.current();
259  return true;
260  }
261  }
262 
263  template <typename Context>
264  constexpr void report_error(Context& context, const Reader& reader)
265  {
266  Derived::template char_class_report_error<Reader>(context, reader.position());
267  }
268  };
269 };
270 } // namespace lexyd
271 
272 #define LEXY_CHAR_CLASS(Name, Rule) \
273  [] { \
274  static_assert(::lexy::is_char_class_rule<LEXY_DECAY_DECLTYPE(Rule)>); \
275  struct c : ::lexyd::char_class_base<c> \
276  { \
277  static constexpr auto char_class_unicode() \
278  { \
279  return (Rule).char_class_unicode(); \
280  } \
281  static LEXY_CONSTEVAL auto char_class_name() \
282  { \
283  return Name; \
284  } \
285  static LEXY_CONSTEVAL auto char_class_ascii() \
286  { \
287  return (Rule).char_class_ascii(); \
288  } \
289  static constexpr auto char_class_match_cp(char32_t cp) \
290  { \
291  return (Rule).char_class_match_cp(cp); \
292  } \
293  }; \
294  return c{}; \
295  }()
296 
297 namespace lexyd
298 {
299 template <typename CharT, CharT... C>
300 struct _lit;
301 template <char32_t... Cp>
302 struct _lcp;
303 
304 // Implementation helper for the literal overloads.
305 template <char32_t Cp>
306 struct _ccp : char_class_base<_ccp<Cp>>
307 {
309  {
310  return "code-point";
311  }
312 
314  {
316  if constexpr (Cp <= 0x7F)
317  result.insert(Cp);
318  return result;
319  }
320 
321  static constexpr auto char_class_match_cp([[maybe_unused]] char32_t cp)
322  {
323  if constexpr (Cp <= 0x7F)
324  return std::false_type{};
325  else
326  return cp == Cp;
327  }
328 };
329 template <unsigned char Byte>
330 struct _cb : char_class_base<_cb<Byte>>
331 {
332  static constexpr auto char_class_unicode()
333  {
334  return Byte <= 0x7F;
335  }
336 
338  {
339  return "byte";
340  }
341 
343  {
345  if constexpr (Byte <= 0x7F)
346  result.insert(Byte);
347  return result;
348  }
349 
350  static constexpr auto char_class_match_cp([[maybe_unused]] char32_t cp)
351  {
352  if constexpr (Byte <= 0x7F)
353  return std::false_type{};
354  else
355  return cp == Byte;
356  }
357 };
358 
359 template <typename C, typename = std::enable_if_t<lexy::is_char_class_rule<C>>>
360 constexpr auto _make_char_class(C c)
361 {
362  return c;
363 }
364 template <typename CharT, CharT C,
365  typename = std::enable_if_t<C <= 0x7F || std::is_same_v<CharT, char32_t>
366  || std::is_same_v<CharT, unsigned char>>>
367 constexpr auto _make_char_class(_lit<CharT, C>)
368 {
369  if constexpr (std::is_same_v<CharT, unsigned char>)
370  return _cb<C>{};
371  else
372  return _ccp<static_cast<char32_t>(C)>{};
373 }
374 template <char32_t CP>
375 constexpr auto _make_char_class(_lcp<CP>)
376 {
377  return _ccp<CP>{};
378 }
379 } // namespace lexyd
380 
381 namespace lexyd
382 {
383 template <typename... Cs>
384 struct _calt : char_class_base<_calt<Cs...>>
385 {
386  static_assert(sizeof...(Cs) > 1);
387 
388  static constexpr auto char_class_unicode()
389  {
390  constexpr auto non_unicode = (!Cs::char_class_unicode() || ...);
391  static_assert(!non_unicode
392  // If at least one is non-Unicode, either they all must be non-Unicode or
393  // only match ASCII.
394  || ((!Cs::char_class_unicode()
395  || std::is_same_v<decltype(Cs::char_class_match_cp(0)),
396  std::false_type>)&&...),
397  "cannot mix bytes and Unicode char classes");
398  return !non_unicode;
399  }
400 
402  {
403  return "union";
404  }
405 
407  {
409  (result.insert(Cs::char_class_ascii()), ...);
410  return result;
411  }
412 
413  static constexpr auto char_class_match_cp(char32_t cp)
414  {
415  if constexpr ((std::is_same_v<decltype(Cs::char_class_match_cp(cp)), std::false_type>
416  && ...))
417  return std::false_type{};
418  else
419  return (Cs::char_class_match_cp(cp) || ...);
420  }
421 };
422 
423 template <typename R1, typename R2>
424 constexpr auto operator/(R1 r1, R2 r2)
425  -> _calt<decltype(_make_char_class(r1)), decltype(_make_char_class(r2))>
426 {
427  return {};
428 }
429 
430 template <typename... Cs, typename C>
431 constexpr auto operator/(_calt<Cs...>, C c) -> _calt<Cs..., decltype(_make_char_class(c))>
432 {
433  return {};
434 }
435 template <typename C, typename... Cs>
436 constexpr auto operator/(C c, _calt<Cs...>) -> _calt<decltype(_make_char_class(c)), Cs...>
437 {
438  return {};
439 }
440 
441 template <typename... Cs, typename... Ds>
442 constexpr auto operator/(_calt<Cs...>, _calt<Ds...>) -> _calt<Cs..., Ds...>
443 {
444  return {};
445 }
446 } // namespace lexyd
447 
448 namespace lexyd
449 {
450 template <typename C>
451 struct _ccomp : char_class_base<_ccomp<C>>
452 {
453  static constexpr auto char_class_unicode()
454  {
455  return C::char_class_unicode();
456  }
457 
459  {
460  return "complement";
461  }
462 
464  {
466  result.insert(0x00, 0x7F);
467  result.remove(C::char_class_ascii());
468  return result;
469  }
470 
471  static constexpr auto char_class_match_cp(char32_t cp)
472  {
473  if (cp <= 0x7F)
474  // If we haven't matched an ASCII character so far, this was intentional.
475  return false;
476 
477  if constexpr (std::is_same_v<decltype(C::char_class_match_cp(cp)), std::false_type>)
478  return true;
479  else
480  return !C::char_class_match_cp(cp);
481  }
482 };
483 
484 template <typename C>
485 constexpr auto operator-(C c) -> _ccomp<decltype(_make_char_class(c))>
486 {
487  return {};
488 }
489 template <typename C>
490 constexpr auto operator-(_ccomp<C>) -> C
491 {
492  return {};
493 }
494 } // namespace lexyd
495 
496 namespace lexyd
497 {
498 template <typename Set, typename Minus>
499 struct _cminus : char_class_base<_cminus<Set, Minus>>
500 {
501  // calt does the correct logic as well, so re-use it.
502  static constexpr auto char_class_unicode()
503  {
505  }
506 
508  {
509  return "minus";
510  }
511 
513  {
514  auto result = Set::char_class_ascii();
515  result.remove(Minus::char_class_ascii());
516  return result;
517  }
518 
519  static constexpr auto char_class_match_cp(char32_t cp)
520  {
521  if constexpr (std::is_same_v<decltype(Set::char_class_match_cp(cp)), std::false_type>)
522  return std::false_type{};
523  else if constexpr (std::is_same_v<decltype(Minus::char_class_match_cp(cp)),
524  std::false_type>)
525  // We don't match ASCII at this point: they only reach this point if the ASCII table
526  // failed.
527  return cp > 0x7F && Set::char_class_match_cp(cp);
528  else
529  // Same as above, no ASCII.
530  return cp > 0x7F && Set::char_class_match_cp(cp) && !Minus::char_class_match_cp(cp);
531  }
532 };
533 
534 template <typename Set, typename Minus>
535 constexpr auto operator-(Set, Minus minus)
536 {
537  return _cminus<Set, decltype(_make_char_class(minus))>{};
538 }
539 
540 template <typename Set, typename Minus, typename OtherMinus>
541 constexpr auto operator-(_cminus<Set, Minus>, OtherMinus other)
542 {
543  return Set{} - _calt<Minus, decltype(_make_char_class(other))>{};
544 }
545 } // namespace lexyd
546 
547 namespace lexyd
548 {
549 template <typename... Cs>
550 struct _cand : char_class_base<_cand<Cs...>>
551 {
552  static_assert(sizeof...(Cs) > 1);
553 
554  // calt does the correct logic as well, so re-use it.
555  static constexpr auto char_class_unicode()
556  {
558  }
559 
561  {
562  return "intersection";
563  }
564 
566  {
568  for (auto c = 0; c <= 0x7F; ++c)
569  if ((Cs::char_class_ascii().contains[c] && ...))
570  result.insert(c);
571  return result;
572  }
573 
574  static constexpr auto char_class_match_cp(char32_t cp)
575  {
576  if constexpr ((std::is_same_v<decltype(Cs::char_class_match_cp(cp)), std::false_type>
577  && ...))
578  return std::false_type{};
579  else
580  return (Cs::char_class_match_cp(cp) && ...);
581  }
582 };
583 
584 template <typename C1, typename C2>
585 constexpr auto operator&(C1 c1, C2 c2)
586  -> _cand<decltype(_make_char_class(c1)), decltype(_make_char_class(c2))>
587 {
588  return {};
589 }
590 
591 template <typename... Cs, typename C>
592 constexpr auto operator&(_cand<Cs...>, C c) -> _cand<Cs..., decltype(_make_char_class(c))>
593 {
594  return {};
595 }
596 template <typename C, typename... Cs>
597 constexpr auto operator&(C c, _cand<Cs...>) -> _cand<decltype(_make_char_class(c)), Cs...>
598 {
599  return {};
600 }
601 
602 template <typename... Cs, typename... Ds>
603 constexpr auto operator&(_cand<Cs...>, _cand<Ds...>) -> _cand<Cs..., Ds...>
604 {
605  return {};
606 }
607 } // namespace lexyd
608 
609 #endif // LEXY_DSL_CHAR_CLASS_HPP_INCLUDED
610 
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:98
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:342
lexyd::_ccomp
Definition: char_class.hpp:451
lexyd::_calt::char_class_ascii
static LEXY_CONSTEVAL auto char_class_ascii()
Definition: char_class.hpp:406
lexyd::_ccp::char_class_name
static LEXY_CONSTEVAL auto char_class_name()
Definition: char_class.hpp:308
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:424
lexyd::char_class_base::tp::report_error
constexpr void report_error(Context &context, const Reader &reader)
Definition: char_class.hpp:264
lexyd::_cminus::char_class_name
static LEXY_CONSTEVAL auto char_class_name()
Definition: char_class.hpp:507
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:574
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:519
lexyd::_cand::char_class_name
static LEXY_CONSTEVAL auto char_class_name()
Definition: char_class.hpp:560
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:471
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:512
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:499
lexyd::_cb::char_class_name
static LEXY_CONSTEVAL auto char_class_name()
Definition: char_class.hpp:337
swar.hpp
lexyd::_calt::char_class_name
static LEXY_CONSTEVAL auto char_class_name()
Definition: char_class.hpp:401
lexy::parse_events::error
Definition: dsl/base.hpp:68
lexyd::_cb
Definition: char_class.hpp:330
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:453
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:384
lexyd::char_class_base::tp::end
Reader::marker end
Definition: char_class.hpp:207
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:502
lexyd::_cb::char_class_unicode
static constexpr auto char_class_unicode()
Definition: char_class.hpp:332
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:313
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:565
lexy::_detail
Definition: any_ref.hpp:12
lexyd::_ccp
Definition: char_class.hpp:306
lexyd::_lit
Definition: char_class.hpp:300
lexyd::operator-
constexpr auto operator-(C c) -> _ccomp< decltype(_make_char_class(c))>
Definition: char_class.hpp:485
LEXY_FORCE_INLINE
#define LEXY_FORCE_INLINE
Definition: config.hpp:171
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:321
lexyd::_make_char_class
constexpr auto _make_char_class(C c)
Definition: char_class.hpp:360
lexyd::_ccomp::char_class_ascii
static LEXY_CONSTEVAL auto char_class_ascii()
Definition: char_class.hpp:463
lexyd::_cand
Definition: char_class.hpp:550
lexyd::_lcp
Definition: char_class.hpp:302
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:350
lexyd::_calt::char_class_unicode
static constexpr auto char_class_unicode()
Definition: char_class.hpp:388
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:413
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:458
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
lexyd::_cand::char_class_unicode
static constexpr auto char_class_unicode()
Definition: char_class.hpp:555
lexyd::operator&
constexpr auto operator&(C1 c1, C2 c2) -> _cand< decltype(_make_char_class(c1)), decltype(_make_char_class(c2))>
Definition: char_class.hpp:585


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Dec 13 2024 03:19:16