]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/wave/src/cpplexer/re2clex/cpp_re.cpp
1 /*=============================================================================
2 Boost.Wave: A Standard compliant C++ preprocessor library
4 Copyright (c) 2001 Daniel C. Nuffer
5 Copyright (c) 2001-2012 Hartmut Kaiser.
6 Distributed under the Boost Software License, Version 1.0. (See accompanying
7 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
10 It also may be necessary to add $ to identifiers, for asm.
12 have some easier way to parse strings instead of files (done)
13 =============================================================================*/
15 #define BOOST_WAVE_SOURCE 1
17 // disable stupid compiler warnings
18 #include <boost/config/warning_disable.hpp>
24 #include <sys/types.h>
28 #include <boost/wave/wave_config.hpp> // configuration data
30 #if defined(BOOST_HAS_UNISTD_H)
36 #include <boost/detail/workaround.hpp>
38 #include <boost/wave/token_ids.hpp>
39 #include <boost/wave/cpplexer/re2clex/aq.hpp>
40 #include <boost/wave/cpplexer/re2clex/scanner.hpp>
41 #include <boost/wave/cpplexer/re2clex/cpp_re.hpp>
43 // this must occur after all of the includes and before any code appears
44 #ifdef BOOST_HAS_ABI_HEADERS
45 #include BOOST_ABI_PREFIX
48 ///////////////////////////////////////////////////////////////////////////////
49 #if defined(BOOST_MSVC)
50 #pragma warning (disable: 4101) // 'foo' : unreferenced local variable
51 #pragma warning (disable: 4102) // 'foo' : unreferenced label
54 ///////////////////////////////////////////////////////////////////////////////
60 bool is_backslash(uchar
*p
, uchar
*end
, int &len
)
66 else if (*p
== '?' && *(p
+1) == '?' && (p
+2 < end
&& *(p
+2) == '/')) {
73 ///////////////////////////////////////////////////////////////////////////////
74 // Special wrapper class holding the current cursor position
75 uchar_wrapper::uchar_wrapper (uchar
*base_cursor
, std::size_t column
)
76 : base_cursor(base_cursor
), column(column
)
79 uchar_wrapper
& uchar_wrapper::operator++()
86 uchar_wrapper
& uchar_wrapper::operator--()
93 uchar
uchar_wrapper::operator* () const
98 uchar_wrapper::operator uchar
*() const
104 operator- (uchar_wrapper
const& lhs
, uchar_wrapper
const& rhs
)
106 return lhs
.base_cursor
- rhs
.base_cursor
;
109 } // namespace re2clex
110 } // namespace cpplexer
114 // the suffix header occurs after all of the code
115 #ifdef BOOST_HAS_ABI_HEADERS
116 #include BOOST_ABI_SUFFIX