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-2010 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 #include <boost/wave/wave_config.hpp> // configuration data 13 14 #if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 15 16 #include <string> 17 18 #include <boost/wave/token_ids.hpp> 19 20 #include "real_position_token.hpp" // token class 21 #include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer type 22 23 /////////////////////////////////////////////////////////////////////////////// 24 // The following file needs to be included only once throughout the whole 25 // program. 26 #include <boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp> 27 28 // this must occur after all of the includes and before any code appears 29 #ifdef BOOST_HAS_ABI_HEADERS 30 #include BOOST_ABI_PREFIX 31 #endif 32 33 /////////////////////////////////////////////////////////////////////////////// 34 // 35 // This instantiates the correct 'new_lexer' function, which generates the 36 // C++ lexer used in this sample. You will have to instantiate the 37 // new_lexer_gen<> template with the same iterator type, as you have used for 38 // instantiating the boost::wave::context<> object. 39 // 40 // This is moved into a separate compilation unit to decouple the compilation 41 // of the C++ lexer from the compilation of the other modules, which helps to 42 // reduce compilation time. 43 // 44 // The template parameter(s) supplied should be identical to the first 45 // parameter supplied while instantiating the boost::wave::context<> template 46 // (see the file cpp.cpp). 47 // 48 /////////////////////////////////////////////////////////////////////////////// 49 50 template struct boost::wave::cpplexer::new_lexer_gen< 51 std::string::iterator, boost::wave::util::file_position_type, 52 lex_token<boost::wave::util::file_position_type> >; 53 template struct boost::wave::cpplexer::new_lexer_gen< 54 std::string::const_iterator, boost::wave::util::file_position_type, 55 lex_token<boost::wave::util::file_position_type> >; 56 57 // the suffix header occurs after all of the code 58 #ifdef BOOST_HAS_ABI_HEADERS 59 #include BOOST_ABI_SUFFIX 60 #endif 61 62 #endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 63