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


C++ match_state::bos方法代码示例

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


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

示例1: match

        bool match(match_state<BidiIter> &state, Next const &next) const
        {
            if(state.bos())
            {
                if(!state.flags_.match_bol_)
                {
                    return false;
                }
            }
            else
            {
                char_type ch = *boost::prior(state.cur_);

                // If the previous character is not a newline, we're not at the start of a line
                if(!traits_cast<Traits>(state).isctype(ch, this->newline_))
                {
                    return false;
                }
                // There is no line-break between \r and \n
                else if(ch == this->cr_ && !state.eos() && *state.cur_ == this->nl_)
                {
                    return false;
                }
            }

            return next.match(state);
        }
开发者ID:BioinformaticsArchive,项目名称:MulRFRepo,代码行数:27,代码来源:assert_bol_matcher.hpp

示例2: eval

        static bool eval(bool prevword, bool thisword, match_state<BidiIter> &state)
        {
            if(state.flags_.match_not_bow_ && state.bos())
            {
                return false;
            }

            return !prevword && thisword;
        }
开发者ID:03050903,项目名称:turbulenz_engine,代码行数:9,代码来源:assert_word_matcher.hpp

示例3: match

        bool match(match_state<BidiIter> &state, Next const &next) const
        {
            BidiIter cur = state.cur_;
            bool const thisword = !state.eos() && this->is_word(traits_cast<Traits>(state), *cur);
            bool const prevword = (!state.bos() || state.flags_.match_prev_avail_)
                && this->is_word(traits_cast<Traits>(state), *--cur);

            return Cond::eval(prevword, thisword, state) && next.match(state);
        }
开发者ID:03050903,项目名称:turbulenz_engine,代码行数:9,代码来源:assert_word_matcher.hpp

示例4: operator

    bool operator ()(match_state<BidiIter> &state) const
    {
        if(state.bos() && state.flags_.match_bol_)
        {
            return true;
        }

        BidiIter cur = state.cur_;
        BidiIter const end = state.end_;
        std::advance(cur, static_cast<diff_type>(-!state.bos()));

        for(; cur != end; ++cur)
        {
            if(this->bits_[static_cast<unsigned char>(*cur)])
            {
                state.cur_ = ++cur;
                return true;
            }
        }

        return false;
    }
开发者ID:Axitonium,项目名称:sourcesdkpython,代码行数:22,代码来源:finder.hpp

示例5: is_line_break

            bool is_line_break(match_state<BidiIter> &state) const
        {
            BOOST_ASSERT(!state.bos() || state.flags_.match_prev_avail_);
            BidiIter tmp = state.cur_;
            char_type ch = *--tmp;

            if(traits_cast<Traits>(state).isctype(ch, this->newline_))
            {
                // there is no line-break between \r and \n
                if(this->cr_ != ch || state.eos() || this->nl_ != *state.cur_)
                {
                    return true;
                }
            }

            return false;
        }
开发者ID:GDXN,项目名称:fitsliberator,代码行数:17,代码来源:assert_line_base.hpp


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