diff options
Diffstat (limited to 'MoonParser/pegtl/internal/star.hpp')
-rw-r--r-- | MoonParser/pegtl/internal/star.hpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/MoonParser/pegtl/internal/star.hpp b/MoonParser/pegtl/internal/star.hpp new file mode 100644 index 0000000..854f25f --- /dev/null +++ b/MoonParser/pegtl/internal/star.hpp | |||
@@ -0,0 +1,56 @@ | |||
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_INTERNAL_STAR_HPP | ||
5 | #define TAOCPP_PEGTL_INCLUDE_INTERNAL_STAR_HPP | ||
6 | |||
7 | #include <type_traits> | ||
8 | |||
9 | #include "../config.hpp" | ||
10 | |||
11 | #include "duseltronik.hpp" | ||
12 | #include "seq.hpp" | ||
13 | #include "skip_control.hpp" | ||
14 | |||
15 | #include "../apply_mode.hpp" | ||
16 | #include "../rewind_mode.hpp" | ||
17 | |||
18 | #include "../analysis/generic.hpp" | ||
19 | |||
20 | namespace tao | ||
21 | { | ||
22 | namespace TAOCPP_PEGTL_NAMESPACE | ||
23 | { | ||
24 | namespace internal | ||
25 | { | ||
26 | template< typename Rule, typename... Rules > | ||
27 | struct star | ||
28 | { | ||
29 | using analyze_t = analysis::generic< analysis::rule_type::OPT, Rule, Rules..., star >; | ||
30 | |||
31 | template< apply_mode A, | ||
32 | rewind_mode, | ||
33 | template< typename... > class Action, | ||
34 | template< typename... > class Control, | ||
35 | typename Input, | ||
36 | typename... States > | ||
37 | static bool match( Input& in, States&&... st ) | ||
38 | { | ||
39 | while( duseltronik< seq< Rule, Rules... >, A, rewind_mode::REQUIRED, Action, Control >::match( in, st... ) ) { | ||
40 | } | ||
41 | return true; | ||
42 | } | ||
43 | }; | ||
44 | |||
45 | template< typename Rule, typename... Rules > | ||
46 | struct skip_control< star< Rule, Rules... > > : std::true_type | ||
47 | { | ||
48 | }; | ||
49 | |||
50 | } // namespace internal | ||
51 | |||
52 | } // namespace TAOCPP_PEGTL_NAMESPACE | ||
53 | |||
54 | } // namespace tao | ||
55 | |||
56 | #endif | ||