1/*=============================================================================
2 Boost.Wave: A Standard compliant C++ preprocessor library
3 Explicit instantiation of the lex_functor generation function
4
5 http://www.boost.org/
6
7 Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
8 Software License, Version 1.0. (See accompanying file
9 LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
10=============================================================================*/
11
12#define BOOST_WAVE_SOURCE 1
13
14// disable stupid compiler warnings
15#include <boost/config/warning_disable.hpp>
16#include <boost/wave/wave_config.hpp> // configuration data
17
18#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0
19
20#include <string>
21
22#include <boost/wave/token_ids.hpp>
23#include <boost/wave/cpplexer/cpp_lex_token.hpp>
24#include <boost/wave/cpplexer/cpp_lex_iterator.hpp>
25
26///////////////////////////////////////////////////////////////////////////////
27// The following file needs to be included only once throughout the whole
28// program.
29#include <boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp>
30
31// this must occur after all of the includes and before any code appears
32#ifdef BOOST_HAS_ABI_HEADERS
33#include BOOST_ABI_PREFIX
34#endif
35
36///////////////////////////////////////////////////////////////////////////////
37//
38// This instantiates the correct 'new_lexer' function, which generates the
39// C++ lexer used in this sample. You will have to instantiate the
40// new_lexer_gen<> template with the same iterator type, as you have used for
41// instantiating the boost::wave::context<> object.
42//
43// This is moved into a separate compilation unit to decouple the compilation
44// of the C++ lexer from the compilation of the other modules, which helps to
45// reduce compilation time.
46//
47// The template parameter(s) supplied should be identical to the first
48// parameter supplied while instantiating the boost::wave::context<> template
49// (see the file cpp.cpp).
50//
51///////////////////////////////////////////////////////////////////////////////
52
53// if you want to use another iterator type for the underlying input stream
54// a corresponding explicit template instantiation needs to be added below
55template struct BOOST_SYMBOL_VISIBLE boost::wave::cpplexer::new_lexer_gen<
56 BOOST_WAVE_STRINGTYPE::iterator>;
57template struct BOOST_SYMBOL_VISIBLE boost::wave::cpplexer::new_lexer_gen<
58 BOOST_WAVE_STRINGTYPE::const_iterator>;
59
60// the suffix header occurs after all of the code
61#ifdef BOOST_HAS_ABI_HEADERS
62#include BOOST_ABI_SUFFIX
63#endif
64
65#endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0
66

source code of boost/libs/wave/src/instantiate_re2c_lexer.cpp