LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(REAL_POSITION_TOKEN_HPP_HK_061109_INCLUDED)
-#define REAL_POSITION_TOKEN_HPP_HK_061109_INCLUDED
+#if !defined(BOOST_REAL_POSITION_TOKEN_HPP_HK_061109_INCLUDED)
+#define BOOST_REAL_POSITION_TOKEN_HPP_HK_061109_INCLUDED
#include <boost/wave/wave_config.hpp>
#include <boost/wave/util/file_position.hpp>
#include <boost/wave/token_ids.hpp>
#include <boost/wave/language_support.hpp>
#include <boost/detail/atomic_count.hpp>
+#include <boost/optional.hpp>
///////////////////////////////////////////////////////////////////////////////
namespace impl {
position_type const &get_position() const { return pos; }
position_type const &get_corrected_position() const
{ return corrected_pos; }
+ position_type const &get_expand_position() const
+ {
+ if (expand_pos)
+ return *expand_pos;
+ else
+ return pos;
+ }
bool is_eoi() const
{
return id == boost::wave::T_EOI;
void set_position (position_type const &pos_) { pos = pos_; }
void set_corrected_position (position_type const &pos_)
{ corrected_pos = pos_; }
+ void set_expand_position (position_type const & pos_)
+ { expand_pos = pos_; }
friend bool operator== (token_data const& lhs, token_data const& rhs)
{
string_type value; // the text, which was parsed into this token
position_type pos; // the original file position
position_type corrected_pos; // the original file position
+ boost::optional<position_type> expand_pos; // where this token was expanded
boost::detail::atomic_count refcnt;
};
{ return data->get_position(); }
position_type const &get_corrected_position() const
{ return data->get_corrected_position(); }
+ position_type const &get_expand_position() const
+ { return data->get_expand_position(); }
bool is_valid() const
{
using namespace boost::wave;
{ make_unique(); data->set_position(pos_); }
void set_corrected_position (position_type const &pos_)
{ make_unique(); data->set_corrected_position(pos_); }
+ void set_expand_position (position_type const &pos_)
+ { make_unique(); data->set_expand_position(pos_); }
friend bool operator== (lex_token const& lhs, lex_token const& rhs)
{
return t.is_valid();
}
-#endif // !defined(REAL_POSITION_TOKEN_HPP_HK_061109_INCLUDED)
+#endif // !defined(BOOST_REAL_POSITION_TOKEN_HPP_HK_061109_INCLUDED)