diff options
Diffstat (limited to 'MoonParser/pegtl/contrib/abnf.hpp')
-rw-r--r-- | MoonParser/pegtl/contrib/abnf.hpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/MoonParser/pegtl/contrib/abnf.hpp b/MoonParser/pegtl/contrib/abnf.hpp new file mode 100644 index 0000000..15319f5 --- /dev/null +++ b/MoonParser/pegtl/contrib/abnf.hpp | |||
@@ -0,0 +1,43 @@ | |||
1 | // Copyright (c) 2014-2017 Dr. Colin Hirsch and Daniel Frey | ||
2 | // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/ | ||
3 | |||
4 | #ifndef TAOCPP_PEGTL_INCLUDE_CONTRIB_ABNF_HPP | ||
5 | #define TAOCPP_PEGTL_INCLUDE_CONTRIB_ABNF_HPP | ||
6 | |||
7 | #include "../config.hpp" | ||
8 | #include "../internal/rules.hpp" | ||
9 | |||
10 | namespace tao | ||
11 | { | ||
12 | namespace TAOCPP_PEGTL_NAMESPACE | ||
13 | { | ||
14 | namespace abnf | ||
15 | { | ||
16 | // Core ABNF rules according to RFC 5234, Appendix B | ||
17 | |||
18 | // clang-format off | ||
19 | struct ALPHA : internal::ranges< internal::peek_char, 'a', 'z', 'A', 'Z' > {}; | ||
20 | struct BIT : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, '0', '1' > {}; | ||
21 | struct CHAR : internal::range< internal::result_on_found::SUCCESS, internal::peek_char, char( 1 ), char( 127 ) > {}; | ||
22 | struct CR : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, '\r' > {}; | ||
23 | struct CRLF : internal::string< '\r', '\n' > {}; | ||
24 | struct CTL : internal::ranges< internal::peek_char, char( 0 ), char( 31 ), char( 127 ) > {}; | ||
25 | struct DIGIT : internal::range< internal::result_on_found::SUCCESS, internal::peek_char, '0', '9' > {}; | ||
26 | struct DQUOTE : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, '"' > {}; | ||
27 | struct HEXDIG : internal::ranges< internal::peek_char, '0', '9', 'a', 'f', 'A', 'F' > {}; | ||
28 | struct HTAB : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, '\t' > {}; | ||
29 | struct LF : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, '\n' > {}; | ||
30 | struct LWSP : internal::star< internal::sor< internal::string< '\r', '\n' >, internal::one< internal::result_on_found::SUCCESS, internal::peek_char, ' ', '\t' > >, internal::one< internal::result_on_found::SUCCESS, internal::peek_char, ' ', '\t' > > {}; | ||
31 | struct OCTET : internal::any< internal::peek_char > {}; | ||
32 | struct SP : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, ' ' > {}; | ||
33 | struct VCHAR : internal::range< internal::result_on_found::SUCCESS, internal::peek_char, char( 33 ), char( 126 ) > {}; | ||
34 | struct WSP : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, ' ', '\t' > {}; | ||
35 | // clang-format on | ||
36 | |||
37 | } // namespace abnf | ||
38 | |||
39 | } // namespace TAOCPP_PEGTL_NAMESPACE | ||
40 | |||
41 | } // namespace tao | ||
42 | |||
43 | #endif | ||