instantiate_re2c_lexer_str.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. Sample: IDL oriented preprocessor
  4. Explicit instantiation of the lex_functor generation function
  5. http://www.boost.org/
  6. Copyright (c) 2001-2010 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 "idl.hpp"
  11. #if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0
  12. #include <string>
  13. #include <boost/wave/token_ids.hpp>
  14. #include <boost/wave/cpplexer/cpp_lex_token.hpp>
  15. #include "idllexer/idl_lex_iterator.hpp"
  16. ///////////////////////////////////////////////////////////////////////////////
  17. // The following file needs to be included only once throughout the whole
  18. // program.
  19. #include "idllexer/idl_re2c_lexer.hpp"
  20. ///////////////////////////////////////////////////////////////////////////////
  21. //
  22. // If you've used another iterator type as std::string::iterator, you have to
  23. // instantiate the new_lexer_gen<> template for this iterator type too.
  24. // The reason is, that the library internally uses the new_lexer_gen<>
  25. // template with a std::string::iterator. (You just have to undefine the
  26. // following line.)
  27. //
  28. // This is moved into a separate compilation unit to decouple the compilation
  29. // of the C++ lexer from the compilation of the other modules, which helps to
  30. // reduce compilation time.
  31. //
  32. // The template parameter(s) supplied should be identical to the first
  33. // parameter supplied while instantiating the boost::wave::context<> template
  34. // (see the file cpp.cpp).
  35. //
  36. ///////////////////////////////////////////////////////////////////////////////
  37. template struct boost::wave::idllexer::new_lexer_gen<std::string::iterator>;
  38. #endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0