1 // Copyright (c) 2014-2020 Dr. Colin Hirsch and Daniel Frey
2 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
3 
4 #ifndef TAO_PEGTL_UTF32_HPP
5 #define TAO_PEGTL_UTF32_HPP
6 
7 #include "config.hpp"
8 
9 #include "internal/peek_utf32.hpp"
10 #include "internal/result_on_found.hpp"
11 #include "internal/rules.hpp"
12 
13 namespace tao
14 {
15    namespace TAO_PEGTL_NAMESPACE
16    {
17       namespace utf32_be
18       {
19          // clang-format off
20          struct any : internal::any< internal::peek_utf32_be > {};
21          struct bom : internal::one< internal::result_on_found::success, internal::peek_utf32_be, 0xfeff > {};
22          template< char32_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_utf32_be, Cs... > {};
23          template< char32_t Lo, char32_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_utf32_be, Lo, Hi > {};
24          template< char32_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_utf32_be, Cs... > {};
25          template< char32_t Lo, char32_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_utf32_be, Lo, Hi > {};
26          template< char32_t... Cs > struct ranges : internal::ranges< internal::peek_utf32_be, Cs... > {};
27          template< char32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_utf32_be, Cs >... > {};
28          // clang-format on
29 
30       }  // namespace utf32_be
31 
32       namespace utf32_le
33       {
34          // clang-format off
35          struct any : internal::any< internal::peek_utf32_le > {};
36          struct bom : internal::one< internal::result_on_found::success, internal::peek_utf32_le, 0xfeff > {};
37          template< char32_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_utf32_le, Cs... > {};
38          template< char32_t Lo, char32_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_utf32_le, Lo, Hi > {};
39          template< char32_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_utf32_le, Cs... > {};
40          template< char32_t Lo, char32_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_utf32_le, Lo, Hi > {};
41          template< char32_t... Cs > struct ranges : internal::ranges< internal::peek_utf32_le, Cs... > {};
42          template< char32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_utf32_le, Cs >... > {};
43          // clang-format on
44 
45       }  // namespace utf32_le
46 
47       namespace utf32 = TAO_PEGTL_NATIVE_UTF32;
48 
49    }  // namespace TAO_PEGTL_NAMESPACE
50 
51 }  // namespace tao
52 
53 #endif
54