本文整理汇总了C++中match_state::eos方法的典型用法代码示例。如果您正苦于以下问题:C++ match_state::eos方法的具体用法?C++ match_state::eos怎么用?C++ match_state::eos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类match_state
的用法示例。
在下文中一共展示了match_state::eos方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: match
bool match(match_state<BidiIter> &state, Next const &next) const
{
if(state.eos())
{
return false;
}
char_type ch = *state.cur_;
if(traits_cast<Traits>(state).isctype(ch, this->newline_))
{
++state.cur_;
if(this->cr_ == ch && !state.eos() && this->nl_ == *state.cur_)
{
++state.cur_;
if(next.match(state))
{
return true;
}
--state.cur_;
}
else if(next.match(state))
{
return true;
}
--state.cur_;
}
return false;
}
示例2: 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);
}
示例3: match
bool match(match_state<BidiIter> &state, Next const &next) const
{
BOOST_ASSERT(this->mark_number_ < static_cast<int>(state.mark_count_));
sub_match_impl<BidiIter> const &br = state.sub_match(this->mark_number_);
if(!br.matched)
{
return false;
}
BidiIter const tmp = state.cur_;
for(BidiIter begin = br.first, end = br.second; begin != end; ++begin, ++state.cur_)
{
if(state.eos()
|| detail::translate(*state.cur_, traits_cast<Traits>(state), icase_type())
!= detail::translate(*begin, traits_cast<Traits>(state), icase_type()))
{
state.cur_ = tmp;
return false;
}
}
if(next.match(state))
{
return true;
}
state.cur_ = tmp;
return false;
}
示例4: eval
static bool eval(bool prevword, bool thisword, match_state<BidiIter> &state)
{
if(state.flags_.match_not_eow_ && state.eos())
{
return false;
}
return prevword && !thisword;
}
示例5: 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);
}
示例6: match
bool match(match_state<BidiIter> &state, Next const &next) const
{
if(!state.eos() && !this->can_match_(*state.cur_, traits_cast<Traits>(state)))
{
return false;
}
return detail::alt_match(this->alternates_, state, next);
}
示例7: match
bool match(match_state<BidiIter> &state, Next const &next) const
{
if(state.eos() || this->not_ == this->in_set(traits_cast<Traits>(state), *state.cur_))
{
return false;
}
if(++state.cur_, next.match(state))
{
return true;
}
return --state.cur_, false;
}
示例8: match
bool match(match_state<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;
}
示例9: 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;
}
示例10: 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;
}
示例11: 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;
}
示例12: match
static bool match(match_state<BidiIter> &state, Next const &)
{
BidiIter const tmp = state.cur_;
sub_match_impl<BidiIter> &s0 = state.sub_match(0);
BOOST_ASSERT(!s0.matched);
// SPECIAL: if there is a match context on the context stack, then
// this pattern has been nested within another. pop that context and
// continue executing.
if(0 != state.context_.prev_context_)
{
if(!pop_context_match(state))
{
return false;
}
// record the end of sub-match zero
s0.first = s0.begin_;
s0.second = tmp;
s0.matched = true;
return true;
}
else if((state.flags_.match_all_ && !state.eos()) ||
(state.flags_.match_not_null_ && state.cur_ == s0.begin_))
{
return false;
}
// record the end of sub-match zero
s0.first = s0.begin_;
s0.second = tmp;
s0.matched = true;
// Now execute any actions that have been queued
for(actionable const *actor = state.action_list_.next; 0 != actor; actor = actor->next)
{
actor->execute(state.action_args_);
}
return true;
}
示例13: 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;
}