// Puts the given token at the end of the stream. inline void Token_stream::put(Token tok) { buf_.push_back(tok); // Make sure that the pos_ isn't pointing past // then end after insertion into an empty list. if (pos_ == buf_.end()) pos_ = buf_.begin(); }
// Initialize a token stream with an empty // buffer. inline Token_stream::Token_stream() : buf_(), pos_(buf_.begin()) { }