Пример #1
0
 void set_position(typename TokenT::position_type const &pos)
 {
     typedef typename TokenT::position_type position_type;
     
     // set the new position in the current token
     position_type currpos = base_type::get_input().get_position();
     currpos.set_file(pos.get_file());
     currpos.set_line(pos.get_line());
     base_type::get_input().set_position(currpos);
     
     // set the new position for future tokens as well
     base_type::get_functor().set_position(pos);
 }
    void set_position(typename TokenT::position_type const &pos)
    {
        typedef typename TokenT::position_type position_type;

    // set the new position in the current token
    token_type const& currtoken = this->base_type::dereference(*this);
    position_type currpos = currtoken.get_position();

        currpos.set_file(pos.get_file());
        currpos.set_line(pos.get_line());
        const_cast<token_type&>(currtoken).set_position(currpos);

    // set the new position for future tokens as well
        if (token_type::string_type::npos != 
            currtoken.get_value().find_first_of('\n'))
        {
            currpos.set_line(pos.get_line() + 1);
        }
        unique_functor_type::set_position(*this, currpos);
    }
Пример #3
0
    void set_position(typename TokenT::position_type const &pos)
    {
        typedef typename TokenT::position_type position_type;
        
    // set the new position in the current token
    token_type& currtoken = base_type::get_input();
    position_type currpos = currtoken.get_position();

        currpos.set_file(pos.get_file());
        currpos.set_line(pos.get_line());
        currtoken.set_position(currpos);
        
    // set the new position for future tokens as well
        if (token_type::string_type::npos != 
            currtoken.get_value().find_first_of('\n'))
        {
            currpos.set_line(pos.get_line() + 1);
        }
        base_type::get_functor().set_position(currpos);
    }