]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / boost / wave / cpplexer / re2clex / cpp_re2c_lexer.hpp
index c51fe4012b7e8a58962707e25ef1321241972469..790c9a893511fcd86678b9197644c6f1edbd37fe 100644 (file)
@@ -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);