当前位置: 首页>>代码示例>>C++>>正文


C++ Next::match方法代码示例

本文整理汇总了C++中Next::match方法的典型用法代码示例。如果您正苦于以下问题:C++ Next::match方法的具体用法?C++ Next::match怎么用?C++ Next::match使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Next的用法示例。


在下文中一共展示了Next::match方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: match

        bool match(match_state<BidiIter> &state, Next const &next) const
        {
            if(state.eos() || Not::value ==
                (detail::translate(*state.cur_, traits_cast<Traits>(state), icase_type()) == this->ch_))
            {
                return false;
            }

            ++state.cur_;
            if(next.match(state))
            {
                return true;
            }

            --state.cur_;
            return false;
        }
开发者ID:AsherBond,项目名称:PDAL,代码行数:17,代码来源:literal_matcher.hpp

示例2: match

        bool match(state_type<BidiIter> &state, Next const &next) const
        {
            if(state.eos() || this->not_ == traits_cast<Traits>(state).isctype(
                *state.cur_, this->mask_))
            {
                return false;
            }

            ++state.cur_;
            if(next.match(state))
            {
                return true;
            }

            --state.cur_;
            return false;
        }
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:17,代码来源:posix_charset_matcher.hpp

示例3: match

        bool match(match_state<BidiIter> &state, Next const &next) const
        {
            if(state.eos() || this->not_ ==
                this->in_range(traits_cast<Traits>(state), *state.cur_, icase_type()))
            {
                return false;
            }

            ++state.cur_;
            if(next.match(state))
            {
                return true;
            }

            --state.cur_;
            return false;
        }
开发者ID:rogerclark,项目名称:grumble,代码行数:17,代码来源:range_matcher.hpp

示例4: match

 bool match(match_state<BidiIter> &state, Next const &next) const
 {
     BidiIter tmp = state.cur_;
     char_translate<Traits, ICase::value> trans(traits_cast<Traits>(state));
     result_type const &result = this->sym_(state.cur_, state.end_, trans);
     if(result)
     {
         void const *old_slot = state.attr_context_.attr_slots_[this->slot_];
         state.attr_context_.attr_slots_[this->slot_] = &*result;
         if(next.match(state))
         {
             return true;
         }
         state.attr_context_.attr_slots_[this->slot_] = old_slot;
     }
     state.cur_ = tmp;
     return false;
 }
开发者ID:BioinformaticsArchive,项目名称:MulRFRepo,代码行数:18,代码来源:attr_matcher.hpp

示例5: match_

        bool match_(match_state<BidiIter> &state, Next const &next, greedy_slow_tag) const
        {
            int const diff = -static_cast<int>(Xpr::width == unknown_width::value ? this->width_ : Xpr::width);
            unsigned int matches = 0;
            BidiIter const tmp = state.cur_;

            // greedily match as much as we can
            while(matches < this->max_ && this->xpr_.match(state))
            {
                ++matches;
            }

            // If this repeater is at the front of the pattern, note
            // how much of the input we consumed so that a repeated search
            // doesn't have to cover the same ground again.
            if(this->leading_)
            {
                state.next_search_ = (matches && matches < this->max_)
                                   ? state.cur_
                                   : (tmp == state.end_) ? tmp : boost::next(tmp);
            }

            if(this->min_ > matches)
            {
                state.cur_ = tmp;
                return false;
            }

            // try matching the rest of the pattern, and back off if necessary
            for(; ; --matches, std::advance(state.cur_, diff))
            {
                if(next.match(state))
                {
                    return true;
                }
                else if(this->min_ == matches)
                {
                    state.cur_ = tmp;
                    return false;
                }
            }
        }
开发者ID:03050903,项目名称:turbulenz_engine,代码行数:42,代码来源:simple_repeat_matcher.hpp

示例6: match

        bool match(match_state<BidiIter> &state, Next const &next) const
        {
            BidiIter const tmp = state.cur_;
            char_type const *begin = detail::data_begin(this->str_);
            for(; begin != this->end_; ++begin, ++state.cur_)
            {
                if(state.eos() ||
                    (detail::translate(*state.cur_, traits_cast<Traits>(state), icase_type()) != *begin))
                {
                    state.cur_ = tmp;
                    return false;
                }
            }

            if(next.match(state))
            {
                return true;
            }

            state.cur_ = tmp;
            return false;
        }
开发者ID:AsherBond,项目名称:PDAL,代码行数:22,代码来源:string_matcher.hpp

示例7: match

        bool match(state_type<BidiIter> &state, Next const &next) const
        {
            sub_match_impl<BidiIter> &br = state.sub_match(this->mark_number_);

            BidiIter old_first = br.first;
            BidiIter old_second = br.second;
            bool old_matched = br.matched;

            br.first = br.begin_;
            br.second = state.cur_;
            br.matched = true;

            if(next.match(state))
            {
                return true;
            }

            br.first = old_first;
            br.second = old_second;
            br.matched = old_matched;

            return false;
        }
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:23,代码来源:mark_end_matcher.hpp

示例8: match_

 bool match_(match_state<BidiIter> &state, Next const &next, mpl::false_) const // Non-greedy
 {
     return next.match(state)
         || this->xpr_.BOOST_NESTED_TEMPLATE push_match<Next>(state);
 }
开发者ID:GDXN,项目名称:fitsliberator,代码行数:5,代码来源:optional_matcher.hpp

示例9: match

 static bool match(state_type<BidiIter> &state, Next const &next)
 {
     return state.eos() && next.match(state);
 }
开发者ID:AlexS2172,项目名称:IVRM,代码行数:4,代码来源:assert_eos_matcher.hpp


注:本文中的Next::match方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。