instantiate_xlex_lexer.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. Sample: Explicit instantiation of the xlex_functor generation function
  4. http://www.boost.org/
  5. Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost
  6. Software License, Version 1.0. (See accompanying file
  7. LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  8. =============================================================================*/
  9. #include <boost/wave.hpp>
  10. #if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0
  11. #include <string>
  12. #include <boost/wave/token_ids.hpp>
  13. #include <boost/wave/cpplexer/cpp_lex_token.hpp>
  14. #include "xlex_iterator.hpp"
  15. ///////////////////////////////////////////////////////////////////////////////
  16. // The following file needs to be included only once throughout the whole
  17. // program.
  18. #include "xlex/xlex_lexer.hpp"
  19. ///////////////////////////////////////////////////////////////////////////////
  20. //
  21. // This instantiates the correct 'new_lexer' function, which generates the
  22. // C++ lexer used in this sample.
  23. //
  24. // This is moved into a separate compilation unit to decouple the compilation
  25. // of the C++ lexer from the compilation of the other modules, which helps to
  26. // reduce compilation time.
  27. //
  28. // The template parameter(s) supplied should be identical to the parameters
  29. // supplied while instantiating the context<> template.
  30. //
  31. ///////////////////////////////////////////////////////////////////////////////
  32. template struct boost::wave::cpplexer::xlex::new_lexer_gen<std::string::iterator>;
  33. #endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0