]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/wave/cpplexer/re2clex/scanner.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / wave / cpplexer / re2clex / scanner.hpp
CommitLineData
7c673cae
FG
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
20effc67
TL
12#if !defined(BOOST_SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED)
13#define BOOST_SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED
7c673cae
FG
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///////////////////////////////////////////////////////////////////////////////
24namespace boost {
25namespace wave {
26namespace cpplexer {
27namespace re2clex {
28
11fdf7f2 29template<typename Iterator>
7c673cae
FG
30struct Scanner;
31typedef unsigned char uchar;
7c673cae 32
11fdf7f2
TL
33template<typename Iterator>
34struct Scanner {
35 typedef int (* ReportErrorProc)(struct Scanner const *, int errorcode,
36 char const *, ...);
37
38
39 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
46 ~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 */
7c673cae
FG
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 */
20effc67 77 bool act_in_cpp2a_mode; /* lexer works in C++20 mode */
11fdf7f2 78};
7c673cae
FG
79
80///////////////////////////////////////////////////////////////////////////////
81} // namespace re2clex
82} // namespace cpplexer
83} // namespace wave
84} // namespace boost
85
86// the suffix header occurs after all of the code
87#ifdef BOOST_HAS_ABI_HEADERS
88#include BOOST_ABI_SUFFIX
89#endif
90
20effc67 91#endif // !defined(BOOST_SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED)