• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Boost.Wave: A Standard compliant C++ preprocessor library
3 
4     Sample: Print out the preprocessed tokens returned by the Wave iterator
5             Explicit instantiation of the lex_functor generation function
6 
7     http://www.boost.org/
8 
9     Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
10     Software License, Version 1.0. (See accompanying file
11     LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
12 =============================================================================*/
13 
14 #include "cpp_tokens.hpp"          // config data
15 
16 #if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0
17 
18 #include <string>
19 
20 #include <boost/wave/token_ids.hpp>
21 
22 #include "slex_token.hpp"
23 #include "slex_iterator.hpp"
24 
25 ///////////////////////////////////////////////////////////////////////////////
26 //  The following file needs to be included only once throughout the whole
27 //  program.
28 #include "slex/cpp_slex_lexer.hpp"
29 
30 ///////////////////////////////////////////////////////////////////////////////
31 //
32 //  This instantiates the correct 'new_lexer' function, which generates the
33 //  C++ lexer used in this sample.
34 //
35 //  This is moved into a separate compilation unit to decouple the compilation
36 //  of the C++ lexer from the compilation of the other modules, which helps to
37 //  reduce compilation time.
38 //
39 //  The template parameter(s) supplied should be identical to the parameters
40 //  supplied while instantiating the context<> template.
41 //
42 ///////////////////////////////////////////////////////////////////////////////
43 
44 template struct boost::wave::cpplexer::slex::new_lexer_gen<
45     std::string::iterator>;
46 
47 #endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0
48