58 enum class _Match_mode :
unsigned char { _Exact, _Prefix };
65 typedef typename _TraitsT::char_class_type _ClassT;
77 _M_nfa(*
__re._M_automaton),
79 _M_rep_count(_M_nfa.size()),
80 _M_states(_M_nfa._M_start(), _M_nfa.size()),
83 using namespace regex_constants;
84 if (__flags & match_prev_avail)
85 _M_flags &= ~(match_not_bol | match_not_bow);
92 _M_current = _M_begin;
93 return _M_main(_Match_mode::_Exact);
98 _M_search_from_first()
100 _M_current = _M_begin;
101 return _M_main(_Match_mode::_Prefix);
112 _M_handle_repeat(_Match_mode, _StateIdT);
115 _M_handle_subexpr_begin(_Match_mode, _StateIdT);
118 _M_handle_subexpr_end(_Match_mode, _StateIdT);
121 _M_handle_line_begin_assertion(_Match_mode, _StateIdT);
124 _M_handle_line_end_assertion(_Match_mode, _StateIdT);
127 _M_handle_word_boundary(_Match_mode, _StateIdT);
130 _M_handle_subexpr_lookahead(_Match_mode, _StateIdT);
133 _M_handle_match(_Match_mode, _StateIdT);
136 _M_handle_backref(_Match_mode, _StateIdT);
139 _M_handle_accept(_Match_mode, _StateIdT);
142 _M_handle_alternative(_Match_mode, _StateIdT);
158 _M_is_word(_CharT
__ch)
const
160 static const _CharT
__s[2] = {
'w' };
161 return _M_re._M_automaton->_M_traits.isctype
162 (
__ch, _M_re._M_automaton->_M_traits.lookup_classname(
__s,
__s+1));
168 if (_M_current == _M_begin)
178 if (_M_match_multiline())
179 return _M_is_line_terminator(*std::prev(_M_current));
186 else if (_M_match_multiline())
187 return _M_is_line_terminator(*std::prev(_M_current));
195 if (_M_current == _M_end)
197 else if (_M_match_multiline())
198 return _M_is_line_terminator(*_M_current);
204 _M_word_boundary()
const;
207 _M_lookahead(_StateIdT __next);
210 _M_is_line_terminator(_CharT __c)
const
212 const auto& __traits = _M_re._M_automaton->_M_traits;
214 const char __n{
__ct.narrow(__c,
' ') };
227 _M_match_multiline()
const noexcept
231 return (_M_re._M_automaton->_M_options() &
__m) ==
__m;
235 template<
typename _SearchMode,
typename _ResultsVec>
238 template<
typename _ResultsVec>
242 _State_info(_StateIdT
__start,
size_t __n)
243 : _M_visited_states(
new bool[__n]()), _M_start(
__start)
246 bool _M_visited(_StateIdT __i)
248 if (_M_visited_states[__i])
250 _M_visited_states[__i] =
true;
255 { _M_match_queue.emplace_back(__i,
__res); }
258 _BiIter* _M_get_sol_pos() {
return nullptr; }
268 template<
typename _ResultsVec>
276 bool _M_visited(_StateIdT)
const {
return false; }
279 _BiIter* _M_get_sol_pos() {
return &_M_sol_pos; }
290 const _BiIter _M_end;