1 /*============================================================================= 2 Boost.Wave: A Standard compliant C++ preprocessor library 3 4 http://www.boost.org/ 5 6 Copyright (c) 2001 Daniel C. Nuffer. 7 Copyright (c) 2001-2012 Hartmut Kaiser. 8 Distributed under the Boost Software License, Version 1.0. (See accompanying 9 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 10 =============================================================================*/ 11 12 #if !defined(BOOST_SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED) 13 #define BOOST_SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED 14 15 #include <boost/wave/wave_config.hpp> 16 #include <boost/wave/cpplexer/re2clex/aq.hpp> 17 18 // this must occur after all of the includes and before any code appears 19 #ifdef BOOST_HAS_ABI_HEADERS 20 #include BOOST_ABI_PREFIX 21 #endif 22 23 /////////////////////////////////////////////////////////////////////////////// 24 namespace boost { 25 namespace wave { 26 namespace cpplexer { 27 namespace re2clex { 28 29 template<typename Iterator> 30 struct Scanner; 31 typedef unsigned char uchar; 32 33 template<typename Iterator> 34 struct Scanner { 35 typedef int (* ReportErrorProc)(struct Scanner const *, int errorcode, 36 char const *, ...); 37 38 Scannerboost::wave::cpplexer::re2clex::Scanner39 Scanner(Iterator const & f, Iterator const & l) 40 : first(f), act(f), last(l), 41 bot(0), top(0), eof(0), tok(0), ptr(0), cur(0), lim(0), 42 eol_offsets(aq_create()) 43 // remaining data members externally initialized 44 {} 45 ~Scannerboost::wave::cpplexer::re2clex::Scanner46 ~Scanner() 47 { 48 aq_terminate(eol_offsets); 49 } 50 51 Iterator first; /* start of input buffer */ 52 Iterator act; /* act position of input buffer */ 53 Iterator last; /* end (one past last char) of input buffer */ 54 uchar* bot; /* beginning of the current buffer */ 55 uchar* top; /* top of the current buffer */ 56 uchar* eof; /* when we read in the last buffer, will point 1 past the 57 end of the file, otherwise 0 */ 58 uchar* tok; /* points to the beginning of the current token */ 59 uchar* ptr; /* used for YYMARKER - saves backtracking info */ 60 uchar* cur; /* saves the cursor (maybe is redundant with tok?) */ 61 uchar* lim; /* used for YYLIMIT - points to the end of the buffer */ 62 /* (lim == top) except for the last buffer, it points to 63 the end of the input (lim == eof - 1) */ 64 std::size_t line; /* current line being lex'ed */ 65 std::size_t column; /* current token start column position */ 66 std::size_t curr_column; /* current column position */ 67 ReportErrorProc error_proc; /* must be != 0, this function is called to 68 report an error */ 69 char const *file_name; /* name of the lex'ed file */ 70 aq_queue eol_offsets; 71 bool enable_ms_extensions; /* enable MS extensions */ 72 bool act_in_c99_mode; /* lexer works in C99 mode */ 73 bool detect_pp_numbers; /* lexer should prefer to detect pp-numbers */ 74 bool enable_import_keyword; /* recognize import as a keyword */ 75 bool single_line_only; /* don't report missing eol's in C++ comments */ 76 bool act_in_cpp0x_mode; /* lexer works in C++11 mode */ 77 }; 78 79 /////////////////////////////////////////////////////////////////////////////// 80 } // namespace re2clex 81 } // namespace cpplexer 82 } // namespace wave 83 } // namespace boost 84 85 // the suffix header occurs after all of the code 86 #ifdef BOOST_HAS_ABI_HEADERS 87 #include BOOST_ABI_SUFFIX 88 #endif 89 90 #endif // !defined(BOOST_SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED) 91