aboutsummaryrefslogtreecommitdiff
path: root/MoonParser/pegtl/internal/at.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'MoonParser/pegtl/internal/at.hpp')
-rw-r--r--MoonParser/pegtl/internal/at.hpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/MoonParser/pegtl/internal/at.hpp b/MoonParser/pegtl/internal/at.hpp
new file mode 100644
index 0000000..d5bb455
--- /dev/null
+++ b/MoonParser/pegtl/internal/at.hpp
@@ -0,0 +1,62 @@
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_AT_HPP
5#define TAOCPP_PEGTL_INCLUDE_INTERNAL_AT_HPP
6
7#include "../config.hpp"
8
9#include "rule_conjunction.hpp"
10#include "skip_control.hpp"
11#include "trivial.hpp"
12
13#include "../apply_mode.hpp"
14#include "../rewind_mode.hpp"
15
16#include "../analysis/generic.hpp"
17
18namespace tao
19{
20 namespace TAOCPP_PEGTL_NAMESPACE
21 {
22 namespace internal
23 {
24 template< typename... Rules >
25 struct at;
26
27 template<>
28 struct at<>
29 : trivial< true >
30 {
31 };
32
33 template< typename... Rules >
34 struct at
35 {
36 using analyze_t = analysis::generic< analysis::rule_type::OPT, Rules... >;
37
38 template< apply_mode,
39 rewind_mode,
40 template< typename... > class Action,
41 template< typename... > class Control,
42 typename Input,
43 typename... States >
44 static bool match( Input& in, States&&... st )
45 {
46 const auto m = in.template mark< rewind_mode::REQUIRED >();
47 return rule_conjunction< Rules... >::template match< apply_mode::NOTHING, rewind_mode::ACTIVE, Action, Control >( in, st... );
48 }
49 };
50
51 template< typename... Rules >
52 struct skip_control< at< Rules... > > : std::true_type
53 {
54 };
55
56 } // namespace internal
57
58 } // namespace TAOCPP_PEGTL_NAMESPACE
59
60} // namespace tao
61
62#endif