summaryrefslogtreecommitdiff
path: root/boost/wave/cpplexer/re2clex/scanner.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
commitb8cf34c691623e4ec329053cbbf68522a855882d (patch)
tree34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/wave/cpplexer/re2clex/scanner.hpp
parent3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff)
downloadboost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz
boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2
boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/wave/cpplexer/re2clex/scanner.hpp')
-rw-r--r--boost/wave/cpplexer/re2clex/scanner.hpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/boost/wave/cpplexer/re2clex/scanner.hpp b/boost/wave/cpplexer/re2clex/scanner.hpp
index a2c36f99b6..b3b310932a 100644
--- a/boost/wave/cpplexer/re2clex/scanner.hpp
+++ b/boost/wave/cpplexer/re2clex/scanner.hpp
@@ -26,15 +26,31 @@ namespace wave {
namespace cpplexer {
namespace re2clex {
+template<typename Iterator>
struct Scanner;
typedef unsigned char uchar;
-typedef int (* ReportErrorProc)(struct Scanner const *, int errorcode,
- char const *, ...);
-typedef struct Scanner {
- uchar* first; /* start of input buffer */
- uchar* act; /* act position of input buffer */
- uchar* last; /* end (one past last char) of input buffer */
+template<typename Iterator>
+struct Scanner {
+ typedef int (* ReportErrorProc)(struct Scanner const *, int errorcode,
+ char const *, ...);
+
+
+ Scanner(Iterator const & f, Iterator const & l)
+ : first(f), act(f), last(l),
+ bot(0), top(0), eof(0), tok(0), ptr(0), cur(0), lim(0),
+ eol_offsets(aq_create())
+ // remaining data members externally initialized
+ {}
+
+ ~Scanner()
+ {
+ aq_terminate(eol_offsets);
+ }
+
+ Iterator first; /* start of input buffer */
+ Iterator act; /* act position of input buffer */
+ Iterator last; /* end (one past last char) of input buffer */
uchar* bot; /* beginning of the current buffer */
uchar* top; /* top of the current buffer */
uchar* eof; /* when we read in the last buffer, will point 1 past the
@@ -58,7 +74,7 @@ typedef struct Scanner {
bool enable_import_keyword; /* recognize import as a keyword */
bool single_line_only; /* don't report missing eol's in C++ comments */
bool act_in_cpp0x_mode; /* lexer works in C++11 mode */
-} Scanner;
+};
///////////////////////////////////////////////////////////////////////////////
} // namespace re2clex