instantiate_re2c_lexer_str.cpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. Explicit instantiation of the lex_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. #define BOOST_WAVE_SOURCE 1
  10. #include <boost/wave/wave_config.hpp> // configuration data
  11. #if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0
  12. #include <string>
  13. #include <boost/wave/token_ids.hpp>
  14. #include "real_position_token.hpp" // token class
  15. #include <boost/wave/cpplexer/cpp_lex_iterator.hpp>
  16. ///////////////////////////////////////////////////////////////////////////////
  17. // The following file needs to be included only once throughout the whole
  18. // program.
  19. #include <boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp>
  20. // this must occur after all of the includes and before any code appears
  21. #ifdef BOOST_HAS_ABI_HEADERS
  22. #include BOOST_ABI_PREFIX
  23. #endif
  24. ///////////////////////////////////////////////////////////////////////////////
  25. //
  26. // If you've used another iterator type than std::string::iterator, you have to
  27. // instantiate the new_lexer_gen<> template for this iterator type too.
  28. // The reason is, that the library internally uses the new_lexer_gen<>
  29. // template with a std::string::iterator.
  30. //
  31. // This is moved into a separate compilation unit to decouple the compilation
  32. // of the C++ lexer from the compilation of the other modules, which helps to
  33. // reduce compilation time.
  34. //
  35. // The template parameter(s) supplied should be identical to the first
  36. // parameter supplied while instantiating the boost::wave::context<> template
  37. // (see the file cpp.cpp).
  38. //
  39. ///////////////////////////////////////////////////////////////////////////////
  40. #if !defined(BOOST_WAVE_STRINGTYPE_USE_STDSTRING)
  41. template struct boost::wave::cpplexer::new_lexer_gen<std::string::iterator>;
  42. template struct boost::wave::cpplexer::new_lexer_gen<std::string::const_iterator>;
  43. #endif
  44. // the suffix header occurs after all of the code
  45. #ifdef BOOST_HAS_ABI_HEADERS
  46. #include BOOST_ABI_SUFFIX
  47. #endif
  48. #endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0