diff --git a/ChangeLog b/ChangeLog index a9dad55..29879d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -101,7 +101,7 @@ CHANGELOG - Fixed a problem in the SLex C++ lexer (cpp_tokens example). - Fixed a runtime problem in the Re2C generated lexers when feeded with empty input files (thanks to Leo Davis for reporting and providing a patch). -- Added the is_empty() function to token classes, returning true if the token +- Added the is_eoi() function to token classes, returning true if the token has been initialized to be the end of input token (T_EOI) (thanks to Ovanes Markarian for suggesting this). diff --git a/include/boost/wave/cpplexer/cpp_lex_token.hpp b/include/boost/wave/cpplexer/cpp_lex_token.hpp index 33d62a5..2e38a60 100644 --- a/include/boost/wave/cpplexer/cpp_lex_token.hpp +++ b/include/boost/wave/cpplexer/cpp_lex_token.hpp @@ -205,7 +205,7 @@ public: operator token_id() const { return token_id(*data); } string_type const &get_value() const { return data->get_value(); } position_type const &get_position() const { return data->get_position(); } - bool is_empty() const { token_id(*data) == T_EOI; } + bool is_eoi() const { token_id(*data) == T_EOI; } void set_token_id (token_id id_) { make_unique(); data->set_token_id(id_); } void set_value (string_type const &value_) { make_unique(); data->set_value(value_); } diff --git a/samples/cpp_tokens/slex_token.hpp b/samples/cpp_tokens/slex_token.hpp index f0a0fa2..981bca4 100644 --- a/samples/cpp_tokens/slex_token.hpp +++ b/samples/cpp_tokens/slex_token.hpp @@ -55,7 +55,7 @@ public: operator token_id() const { return id; } string_type const &get_value() const { return value; } position_type const &get_position() const { return pos; } - bool is_empty() const { id == T_EOI; } + bool is_eoi() const { id == T_EOI; } void set_token_id (token_id id_) { id = id_; } void set_value (string_type const &newval) { value = newval; } diff --git a/samples/real_positions/real_position_token.hpp b/samples/real_positions/real_position_token.hpp index 584af12..aa0ceb1 100644 --- a/samples/real_positions/real_position_token.hpp +++ b/samples/real_positions/real_position_token.hpp @@ -55,7 +55,7 @@ public: position_type const &get_position() const { return pos; } position_type const &get_corrected_position() const { return corrected_pos; } - bool is_empty() const { id == T_EOI; } + bool is_eoi() const { id == T_EOI; } void set_token_id (boost::wave::token_id id_) { id = id_; } void set_value (string_type const &value_) { value = value_; }