33 namespace std _GLIBCXX_VISIBILITY(default)
37 _GLIBCXX_BEGIN_NAMESPACE_VERSION
50 template<
typename _BiIter,
typename _Alloc,
typename _TraitsT,
54 using __search_mode = integral_constant<bool, __dfs_mode>;
58 enum class _Match_mode : unsigned char { _Exact, _Prefix };
61 typedef typename iterator_traits<_BiIter>::value_type _CharT;
62 typedef basic_regex<_CharT, _TraitsT> _RegexT;
65 typedef typename _TraitsT::char_class_type _ClassT;
66 typedef _NFA<_TraitsT> _NFAT;
69 _Executor(_BiIter __begin,
71 _ResultsVec& __results,
77 _M_nfa(*__re._M_automaton),
78 _M_results(__results),
79 _M_rep_count(_M_nfa.size()),
80 _M_states(_M_nfa._M_start(), _M_nfa.size()),
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);
109 _M_rep_once_more(_Match_mode __match_mode, _StateIdT);
112 _M_dfs(_Match_mode __match_mode, _StateIdT __start);
115 _M_main(_Match_mode __match_mode)
116 {
return _M_main_dispatch(__match_mode, __search_mode{}); }
119 _M_main_dispatch(_Match_mode __match_mode, __dfs);
122 _M_main_dispatch(_Match_mode __match_mode, __bfs);
125 _M_is_word(_CharT __ch)
const 127 static const _CharT __s[2] = {
'w' };
128 return _M_re._M_automaton->_M_traits.isctype
129 (__ch, _M_re._M_automaton->_M_traits.lookup_classname(__s, __s+1));
135 return _M_current == _M_begin
143 return _M_current == _M_end
148 _M_word_boundary()
const;
151 _M_lookahead(_State<_TraitsT> __state);
154 template<
typename _SearchMode,
typename _ResultsVec>
157 template<
typename _ResultsVec>
158 struct _State_info<__bfs, _ResultsVec>
161 _State_info(_StateIdT __start,
size_t __n)
162 : _M_visited_states(new bool[__n]()), _M_start(__start)
165 bool _M_visited(_StateIdT __i)
167 if (_M_visited_states[__i])
169 _M_visited_states[__i] =
true;
173 void _M_queue(_StateIdT __i,
const _ResultsVec& __res)
174 { _M_match_queue.emplace_back(__i, __res); }
177 _BiIter* _M_get_sol_pos() {
return nullptr; }
180 vector<pair<_StateIdT, _ResultsVec>> _M_match_queue;
182 unique_ptr<bool[]> _M_visited_states;
187 template<
typename _ResultsVec>
188 struct _State_info<__dfs, _ResultsVec>
191 _State_info(_StateIdT __start,
size_t) : _M_start(__start)
195 bool _M_visited(_StateIdT)
const {
return false; }
196 void _M_queue(_StateIdT,
const _ResultsVec&) { }
198 _BiIter* _M_get_sol_pos() {
return &_M_sol_pos; }
206 _ResultsVec _M_cur_results;
209 const _BiIter _M_end;
210 const _RegexT& _M_re;
212 _ResultsVec& _M_results;
213 vector<pair<_BiIter, int>> _M_rep_count;
214 _State_info<__search_mode, _ResultsVec> _M_states;
221 _GLIBCXX_END_NAMESPACE_VERSION
constexpr match_flag_type match_prev_avail
constexpr match_flag_type match_not_eol
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
constexpr match_flag_type match_not_bow
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
A standard container which offers fixed time access to individual elements in any order...
match_flag_type
This is a bitmask type indicating regex matching rules.
ISO C++ entities toplevel namespace is std.
constexpr match_flag_type match_not_bol