#endif
// error reporting from the re2c generated lexer
- static int report_error(Scanner const* s, int code, char const *, ...);
+ static int report_error(Scanner<IteratorT> const* s, int code, char const *, ...);
private:
static char const *tok_names[];
- Scanner scanner;
+ Scanner<IteratorT> scanner;
string_type filename;
string_type value;
bool at_eof;
lexer<IteratorT, PositionT, TokenT>::lexer(IteratorT const &first,
IteratorT const &last, PositionT const &pos,
boost::wave::language_support language_)
- : filename(pos.get_file()), at_eof(false), language(language_)
+ : scanner(first, last),
+ filename(pos.get_file()), at_eof(false), language(language_)
#if BOOST_WAVE_SUPPORT_THREADING != 0
, cache()
#endif
{
using namespace std; // some systems have memset in std
- memset(&scanner, '\0', sizeof(Scanner));
- scanner.eol_offsets = aq_create();
- if (first != last) {
- scanner.first = scanner.act = (uchar *)&(*first);
- scanner.last = scanner.first + std::distance(first, last);
- }
scanner.line = pos.get_line();
scanner.column = scanner.curr_column = pos.get_column();
scanner.error_proc = report_error;
lexer<IteratorT, PositionT, TokenT>::~lexer()
{
using namespace std; // some systems have free in std
- aq_terminate(scanner.eol_offsets);
free(scanner.bot);
}
template <typename IteratorT, typename PositionT, typename TokenT>
inline int
-lexer<IteratorT, PositionT, TokenT>::report_error(Scanner const *s, int errcode,
+lexer<IteratorT, PositionT, TokenT>::report_error(Scanner<IteratorT> const *s, int errcode,
char const *msg, ...)
{
BOOST_ASSERT(0 != s);