diff options
author | timshen <timshen@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-05 15:20:39 +0000 |
---|---|---|
committer | timshen <timshen@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-05 15:20:39 +0000 |
commit | d5ac524fc4b39933fd2354ef4fe678b963bb5fc5 (patch) | |
tree | a2f8bf477aa8c0b5345a773df68b768a8f9698ed /libstdc++-v3/include/bits/regex_compiler.h | |
parent | 65d190acd955720b366c41b8d0d3e1b813315402 (diff) | |
download | ppe42-gcc-d5ac524fc4b39933fd2354ef4fe678b963bb5fc5.tar.gz ppe42-gcc-d5ac524fc4b39933fd2354ef4fe678b963bb5fc5.zip |
2013-09-05 Tim Shen <timshen91@gmail.com>
* include/bits/regex_automaton.h: Add dummy node type. Rewrite
_StateSeq.
* include/bits/regex_automaton.tcc: Implement them.
* include/bits/regex_compiler.h: Rewrite _Compiler to use new
_StateSeq interfaces.
* include/bits/regex_compiler.tcc: Implement them.
* include/bits/regex_scanner.h: Add word boundry assertion token.
* include/bits/regex_scanner.tcc (_Scanner<>::_M_eat_escape_ecma):
Support word boundry.
* testsuite/28_regex/algorithms/regex_match/basic/
string_range_02_03.cc: Remove "xfail".
* testsuite/28_regex/algorithms/regex_match/extended/cstring_plus.cc:
Likewise.
* testsuite/28_regex/algorithms/regex_match/extended/
string_range_02_03.cc: Likewise.
* testsuite/28_regex/algorithms/regex_match/extended/
cstring_questionmark.cc: Remove xfail and get correct length of
c-string.
* testsuite/28_regex/algorithms/regex_match/extended/
string_range_00_03.cc: Likewise.
* testsuite/28_regex/algorithms/regex_match/ecma/char/quoted_char.cc:
New.
* testsuite/28_regex/algorithms/regex_match/extended/cstring_range.cc:
New.
* testsuite/28_regex/iterators/regex_iterator/wchar_t/string_02.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/regex_compiler.h')
-rw-r--r-- | libstdc++-v3/include/bits/regex_compiler.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/libstdc++-v3/include/bits/regex_compiler.h b/libstdc++-v3/include/bits/regex_compiler.h index 55ecdb92d41..96a0d294177 100644 --- a/libstdc++-v3/include/bits/regex_compiler.h +++ b/libstdc++-v3/include/bits/regex_compiler.h @@ -56,7 +56,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::shared_ptr<_RegexT> _M_get_nfa() const - { return std::shared_ptr<_RegexT>(new _RegexT(_M_state_store)); } + { return std::shared_ptr<_RegexT>(new _RegexT(_M_nfa)); } private: typedef _Scanner<_FwdIter> _ScannerT; @@ -64,6 +64,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef _StateSeq<_CharT, _TraitsT> _StateSeqT; typedef std::stack<_StateSeqT, std::vector<_StateSeqT>> _StackT; typedef _BracketMatcher<_CharT, _TraitsT> _BMatcherT; + typedef std::ctype<_CharT> _CtypeT; // accepts a specific token or returns false. bool @@ -91,21 +92,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_bracket_expression(); void - _M_bracket_list(_BMatcherT& __matcher); - - bool - _M_follow_list(_BMatcherT& __matcher); - - void _M_expression_term(_BMatcherT& __matcher); bool _M_range_expression(_BMatcherT& __matcher); bool - _M_start_range(_BMatcherT& __matcher); - - bool _M_collating_symbol(_BMatcherT& __matcher); bool @@ -120,12 +112,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool _M_try_char(); - _CharT - _M_get_char(); + _StateSeqT + _M_pop() + { + auto ret = _M_stack.top(); + _M_stack.pop(); + return ret; + } const _TraitsT& _M_traits; + const _CtypeT& _M_ctype; _ScannerT _M_scanner; - _RegexT _M_state_store; + _RegexT _M_nfa; _StringT _M_value; _StackT _M_stack; _FlagT _M_flags; |