31 namespace std _GLIBCXX_VISIBILITY(default)
35 _GLIBCXX_BEGIN_NAMESPACE_VERSION
42 template<
typename _TraitsT>
46 template<
typename _FwdIter,
typename _TraitsT>
50 typedef typename _TraitsT::string_type _StringT;
51 typedef _NFA<_TraitsT> _RegexT;
55 const _TraitsT& __traits,
_FlagT __flags);
59 {
return make_shared<_RegexT>(std::move(_M_nfa)); }
63 typedef typename _ScannerT::_TokenT _TokenT;
71 _M_match_token(_TokenT __token);
92 _M_bracket_expression();
110 _M_cur_int_value(
int __radix);
118 auto ret = _M_stack.
top();
124 const _TraitsT& _M_traits;
126 _ScannerT _M_scanner;
132 template<
typename _Tp>
135 template<
typename _Ch,
typename _Tr,
typename _Alloc>
136 struct __has_contiguous_iter<std::
basic_string<_Ch, _Tr, _Alloc>>
140 template<
typename _Tp,
typename _Alloc>
141 struct __has_contiguous_iter<std::vector<_Tp, _Alloc>>
145 template<
typename _Alloc>
146 struct __has_contiguous_iter<std::vector<bool, _Alloc>>
150 template<
typename _Tp>
153 template<
typename _Tp,
typename _Cont>
155 __is_contiguous_normal_iter<__gnu_cxx::__normal_iterator<_Tp, _Cont>>
156 : __has_contiguous_iter<_Cont>::type
159 template<
typename _Iter,
typename _TraitsT>
160 using __enable_if_contiguous_normal_iter
161 =
typename enable_if< __is_contiguous_normal_iter<_Iter>::value,
164 template<
typename _Iter,
typename _TraitsT>
165 using __disable_if_contiguous_normal_iter
166 =
typename enable_if< !__is_contiguous_normal_iter<_Iter>::value,
169 template<
typename _FwdIter,
typename _TraitsT>
170 inline __disable_if_contiguous_normal_iter<_FwdIter, _TraitsT>
171 __compile_nfa(_FwdIter __first, _FwdIter __last,
const _TraitsT& __traits,
174 using _Cmplr = _Compiler<_FwdIter, _TraitsT>;
175 return _Cmplr(__first, __last, __traits, __flags)._M_get_nfa();
178 template<
typename _Iter,
typename _TraitsT>
179 inline __enable_if_contiguous_normal_iter<_Iter, _TraitsT>
180 __compile_nfa(_Iter __first, _Iter __last,
const _TraitsT& __traits,
183 size_t __len = __last - __first;
185 return __compile_nfa(__cfirst, __cfirst + __len, __traits, __flags);
188 template<
typename _TraitsT>
191 typedef typename _TraitsT::char_type _CharT;
194 _AnyMatcher(
const _TraitsT& __traits)
195 : _M_traits(__traits)
199 operator()(_CharT __ch)
const
201 return _M_traits.translate(__ch) !=
'\n'
202 && _M_traits.translate(__ch) !=
'\r'
203 && _M_traits.translate(__ch) != u
'\u2028'
204 && _M_traits.translate(__ch) != u
'\u2029';
207 const _TraitsT& _M_traits;
210 template<
typename _TraitsT>
213 typedef typename _TraitsT::char_type _CharT;
217 _CharMatcher(_CharT __ch,
const _TraitsT& __traits, _FlagT __flags)
218 : _M_traits(__traits), _M_flags(__flags), _M_ch(_M_translate(__ch))
222 operator()(_CharT __ch)
const
223 {
return _M_ch == _M_translate(__ch); }
226 _M_translate(_CharT __ch)
const
229 return _M_traits.translate_nocase(__ch);
231 return _M_traits.translate(__ch);
234 const _TraitsT& _M_traits;
244 template<
typename _TraitsT>
245 struct _BracketMatcher
247 typedef typename _TraitsT::char_type _CharT;
248 typedef typename _TraitsT::char_class_type _CharClassT;
249 typedef typename _TraitsT::string_type _StringT;
253 _BracketMatcher(
bool __is_non_matching,
254 const _TraitsT& __traits,
256 : _M_traits(__traits), _M_class_set(0), _M_flags(__flags),
257 _M_is_non_matching(__is_non_matching)
261 operator()(_CharT)
const;
264 _M_add_char(_CharT __c)
265 { _M_char_set.
insert(_M_translate(__c)); }
268 _M_add_collating_element(
const _StringT& __s)
270 auto __st = _M_traits.lookup_collatename(__s.data(),
271 __s.data() + __s.size());
274 _M_char_set.
insert(_M_translate(__st[0]));
278 _M_add_equivalence_class(
const _StringT& __s)
280 auto __st = _M_traits.lookup_collatename(__s.data(),
281 __s.data() + __s.size());
284 __st = _M_traits.transform_primary(__st.data(),
285 __st.data() + __st.size());
286 _M_equiv_set.
insert(__st);
290 _M_add_character_class(
const _StringT& __s)
292 auto __mask = _M_traits.lookup_classname(__s.data(),
293 __s.data() + __s.size(),
297 _M_class_set |= __mask;
301 _M_make_range(_CharT __l, _CharT __r)
306 _M_get_str(_M_translate(__r))));
308 _M_range_set.insert(
make_pair(_M_get_str(__l), _M_get_str(__r)));
312 _M_translate(_CharT __c)
const
315 return _M_traits.translate_nocase(__c);
317 return _M_traits.translate(__c);
325 _M_get_str(_CharT __c)
const
327 _StringT __s(1, __c);
328 return _M_traits.transform(__s.begin(), __s.end());
334 const _TraitsT& _M_traits;
335 _CharClassT _M_class_set;
337 bool _M_is_non_matching;
341 _GLIBCXX_END_NAMESPACE_VERSION
Primary class template ctype facet.This template class defines classification and conversion function...
struct _Scanner. Scans an input range for regex tokens.
constexpr error_type error_ctype(_S_error_ctype)
constexpr pair< typename __decay_and_strip< _T1 >::__type, typename __decay_and_strip< _T2 >::__type > make_pair(_T1 &&__x, _T2 &&__y)
A convenience wrapper for creating a pair from two objects.
Builds an NFA from an input iterator interval.
void pop()
Removes first element.
std::pair< iterator, bool > insert(const value_type &__x)
Attempts to insert an element into the set.
syntax_option_type
This is a bitmask type indicating how to interpret the regex.
A smart pointer with reference-counted copy semantics.
constexpr error_type error_collate(_S_error_collate)
Matches a character range (bracket expression)
_Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
Managing sequences of characters and character-like objects.
Describes a sequence of one or more _State, its current start and end(s). This structure contains fra...
A standard container giving FILO behavior.