/src/Fast-DDS/thirdparty/taocpp-pegtl/pegtl/internal/until.hpp
Line | Count | Source (jump to first uncovered line) |
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_INTERNAL_UNTIL_HPP |
5 | | #define TAO_PEGTL_INTERNAL_UNTIL_HPP |
6 | | |
7 | | #include "../config.hpp" |
8 | | |
9 | | #include "bytes.hpp" |
10 | | #include "eof.hpp" |
11 | | #include "not_at.hpp" |
12 | | #include "seq.hpp" |
13 | | #include "skip_control.hpp" |
14 | | #include "star.hpp" |
15 | | |
16 | | #include "../apply_mode.hpp" |
17 | | #include "../rewind_mode.hpp" |
18 | | |
19 | | #include "../analysis/generic.hpp" |
20 | | |
21 | | namespace tao |
22 | | { |
23 | | namespace TAO_PEGTL_NAMESPACE |
24 | | { |
25 | | namespace internal |
26 | | { |
27 | | template< typename Cond, typename... Rules > |
28 | | struct until |
29 | | : until< Cond, seq< Rules... > > |
30 | | { |
31 | | }; |
32 | | |
33 | | template< typename Cond > |
34 | | struct until< Cond > |
35 | | { |
36 | | using analyze_t = analysis::generic< analysis::rule_type::seq, star< not_at< Cond >, not_at< eof >, bytes< 1 > >, Cond >; |
37 | | |
38 | | template< apply_mode A, |
39 | | rewind_mode M, |
40 | | template< typename... > |
41 | | class Action, |
42 | | template< typename... > |
43 | | class Control, |
44 | | typename Input, |
45 | | typename... States > |
46 | | static bool match( Input& in, States&&... st ) |
47 | 0 | { |
48 | 0 | auto m = in.template mark< M >(); |
49 | |
|
50 | 0 | while( !Control< Cond >::template match< A, rewind_mode::required, Action, Control >( in, st... ) ) { |
51 | 0 | if( in.empty() ) { |
52 | 0 | return false; |
53 | 0 | } |
54 | 0 | in.bump(); |
55 | 0 | } |
56 | 0 | return m( true ); |
57 | 0 | } Unexecuted instantiation: _ZN3tao5pegtl8internal5untilINS0_5ascii4eolfEJEE5matchILNS0_10apply_modeE1ELNS0_11rewind_modeE0ETtTpTyEN8eprosima7fastdds3dds9idlparser6actionETtTpTyENS0_6normalENS0_12memory_inputILNS0_13tracking_modeE0ENS3_3eol7lf_crlfENSt3__112basic_stringIcNSJ_11char_traitsIcEENSJ_9allocatorIcEEEEEEJRPNSC_7ContextERNSJ_3mapISP_SP_NSJ_4lessISP_EENSN_INSJ_4pairIKSP_SP_EEEEEERNSJ_6vectorINSJ_10shared_ptrINSB_11DynamicDataEEENSN_IS16_EEEEEEEbRT3_DpOT4_ Unexecuted instantiation: _ZN3tao5pegtl8internal5untilINS0_3seqIJNS0_5ascii3oneIJLc42EEEENS5_IJLc47EEEEEEEJEE5matchILNS0_10apply_modeE1ELNS0_11rewind_modeE0ETtTpTyEN8eprosima7fastdds3dds9idlparser6actionETtTpTyENS0_6normalENS0_12memory_inputILNS0_13tracking_modeE0ENS4_3eol7lf_crlfENSt3__112basic_stringIcNSN_11char_traitsIcEENSN_9allocatorIcEEEEEEJRPNSG_7ContextERNSN_3mapIST_ST_NSN_4lessIST_EENSR_INSN_4pairIKST_ST_EEEEEERNSN_6vectorINSN_10shared_ptrINSF_11DynamicDataEEENSR_IS1A_EEEEEEEbRT3_DpOT4_ Unexecuted instantiation: _ZN3tao5pegtl8internal5untilINS0_5ascii4eolfEJEE5matchILNS0_10apply_modeE0ELNS0_11rewind_modeE0ETtTpTyEN8eprosima7fastdds3dds9idlparser6actionETtTpTyENS0_6normalENS0_12memory_inputILNS0_13tracking_modeE0ENS3_3eol7lf_crlfENSt3__112basic_stringIcNSJ_11char_traitsIcEENSJ_9allocatorIcEEEEEEJRPNSC_7ContextERNSJ_3mapISP_SP_NSJ_4lessISP_EENSN_INSJ_4pairIKSP_SP_EEEEEERNSJ_6vectorINSJ_10shared_ptrINSB_11DynamicDataEEENSN_IS16_EEEEEEEbRT3_DpOT4_ Unexecuted instantiation: _ZN3tao5pegtl8internal5untilINS0_3seqIJNS0_5ascii3oneIJLc42EEEENS5_IJLc47EEEEEEEJEE5matchILNS0_10apply_modeE0ELNS0_11rewind_modeE0ETtTpTyEN8eprosima7fastdds3dds9idlparser6actionETtTpTyENS0_6normalENS0_12memory_inputILNS0_13tracking_modeE0ENS4_3eol7lf_crlfENSt3__112basic_stringIcNSN_11char_traitsIcEENSN_9allocatorIcEEEEEEJRPNSG_7ContextERNSN_3mapIST_ST_NSN_4lessIST_EENSR_INSN_4pairIKST_ST_EEEEEERNSN_6vectorINSN_10shared_ptrINSF_11DynamicDataEEENSR_IS1A_EEEEEEEbRT3_DpOT4_ Unexecuted instantiation: _ZN3tao5pegtl8internal5untilINS1_2atIJNS1_4eolfEEEEJEE5matchILNS0_10apply_modeE0ELNS0_11rewind_modeE2ETtTpTyENS0_7nothingETtTpTyENS0_6normalENS0_12memory_inputILNS0_13tracking_modeE1ENS0_5ascii3eol7lf_crlfEPKcEEJEEEbRT3_DpOT4_ |
58 | | }; |
59 | | |
60 | | template< typename Cond, typename Rule > |
61 | | struct until< Cond, Rule > |
62 | | { |
63 | | using analyze_t = analysis::generic< analysis::rule_type::seq, star< not_at< Cond >, not_at< eof >, Rule >, Cond >; |
64 | | |
65 | | template< apply_mode A, |
66 | | rewind_mode M, |
67 | | template< typename... > |
68 | | class Action, |
69 | | template< typename... > |
70 | | class Control, |
71 | | typename Input, |
72 | | typename... States > |
73 | | static bool match( Input& in, States&&... st ) |
74 | | { |
75 | | auto m = in.template mark< M >(); |
76 | | using m_t = decltype( m ); |
77 | | |
78 | | while( !Control< Cond >::template match< A, rewind_mode::required, Action, Control >( in, st... ) ) { |
79 | | if( !Control< Rule >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) ) { |
80 | | return false; |
81 | | } |
82 | | } |
83 | | return m( true ); |
84 | | } |
85 | | }; |
86 | | |
87 | | template< typename Cond, typename... Rules > |
88 | | struct skip_control< until< Cond, Rules... > > : std::true_type |
89 | | { |
90 | | }; |
91 | | |
92 | | } // namespace internal |
93 | | |
94 | | } // namespace TAO_PEGTL_NAMESPACE |
95 | | |
96 | | } // namespace tao |
97 | | |
98 | | #endif |