1 /*============================================================================= 2 Boost.Wave: A Standard compliant C++ preprocessor library 3 4 Sample: IDL oriented preprocessor 5 Explicit instantiation of the lex_functor generation function 6 7 http://www.boost.org/ 8 9 Copyright (c) 2001-2010 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 "idl.hpp" 15 16 #if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 17 18 #include <string> 19 20 #include <boost/wave/token_ids.hpp> 21 #include <boost/wave/cpplexer/cpp_lex_token.hpp> 22 23 #include "idllexer/idl_lex_iterator.hpp" 24 25 /////////////////////////////////////////////////////////////////////////////// 26 // The following file needs to be included only once throughout the whole 27 // program. 28 #include "idllexer/idl_re2c_lexer.hpp" 29 30 /////////////////////////////////////////////////////////////////////////////// 31 // 32 // This instantiates the correct 'new_lexer' function, which generates the 33 // C++ lexer used in this sample. You will have to instantiate the 34 // new_lexer_gen<> template with the same iterator type, as you have used for 35 // instantiating the boost::wave::context<> object. 36 // 37 // This is moved into a separate compilation unit to decouple the compilation 38 // of the C++ lexer from the compilation of the other modules, which helps to 39 // reduce compilation time. 40 // 41 // The template parameter(s) supplied should be identical to the first 42 // parameter supplied while instantiating the boost::wave::context<> template 43 // (see the file cpp.cpp). 44 // 45 /////////////////////////////////////////////////////////////////////////////// 46 47 template struct boost::wave::idllexer::new_lexer_gen< 48 BOOST_WAVE_STRINGTYPE::iterator>; 49 50 #endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 51