4 #include "special_tokens.h"
7 const std::string & str_;
12 size_t first (std::string start,
size_t pos = 0)
13 {
return str_.find_first_of(start, pos); }
14 size_t first_not (std::string start,
size_t pos = 0)
15 {
return str_.find_first_not_of(start, pos); }
20 start_(first_not(
" ")),
26 bool eos () {
return eos_; }
28 std::string pop_word() {
29 if ((end_ >= len_) or ((start_ = first_not(
" ", end_)) >= len_))
30 { eos_ =
true;
return EOS_TOK; }
32 if ((end_ = first(
" ", start_)) >= len_)
33 return str_.substr(start_);
34 return str_.substr(start_, end_ - start_);
38 #endif // WORD_STREAM_H