summaryrefslogtreecommitdiff
path: root/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp')
-rw-r--r--boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp b/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp
index c51fe4012b..790c9a8935 100644
--- a/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp
+++ b/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp
@@ -89,12 +89,12 @@ public:
#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;
@@ -117,18 +117,13 @@ inline
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;
@@ -165,7 +160,6 @@ inline
lexer<IteratorT, PositionT, TokenT>::~lexer()
{
using namespace std; // some systems have free in std
- aq_terminate(scanner.eol_offsets);
free(scanner.bot);
}
@@ -307,7 +301,7 @@ lexer<IteratorT, PositionT, TokenT>::get(TokenT& result)
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);