File indexing completed on 2025-01-18 09:53:49
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_REPEAT_BEGIN_MATCHER_HPP_EAN_10_04_2005
0009 #define BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_REPEAT_BEGIN_MATCHER_HPP_EAN_10_04_2005
0010
0011
0012 #if defined(_MSC_VER)
0013 # pragma once
0014 #endif
0015
0016 #include <boost/xpressive/detail/detail_fwd.hpp>
0017 #include <boost/xpressive/detail/core/quant_style.hpp>
0018 #include <boost/xpressive/detail/core/state.hpp>
0019
0020 namespace boost { namespace xpressive { namespace detail
0021 {
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 struct repeat_begin_matcher
0033 : quant_style<quant_variable_width, unknown_width::value, false>
0034 {
0035 int mark_number_;
0036
0037 repeat_begin_matcher(int mark_number)
0038 : mark_number_(mark_number)
0039 {
0040 }
0041
0042 template<typename BidiIter, typename Next>
0043 bool match(match_state<BidiIter> &state, Next const &next) const
0044 {
0045 sub_match_impl<BidiIter> &br = state.sub_match(this->mark_number_);
0046
0047 unsigned int old_repeat_count = br.repeat_count_;
0048 bool old_zero_width = br.zero_width_;
0049
0050 br.repeat_count_ = 1;
0051 br.zero_width_ = false;
0052
0053
0054
0055 if(next.BOOST_NESTED_TEMPLATE push_match<Next>(state))
0056 {
0057 return true;
0058 }
0059
0060 br.repeat_count_ = old_repeat_count;
0061 br.zero_width_ = old_zero_width;
0062
0063 return false;
0064 }
0065 };
0066
0067 }}}
0068
0069 #endif