instantiate_slex_lexer.cpp 1.7 KB

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