instantiate_re2c_lexer.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. // This instantiates the correct 'new_lexer' function, which generates the
  23. // C++ lexer used in this sample. You will have to instantiate the
  24. // new_lexer_gen<> template with the same iterator type, as you have used for
  25. // instantiating the boost::wave::context<> object.
  26. //
  27. // This is moved into a separate compilation unit to decouple the compilation
  28. // of the C++ lexer from the compilation of the other modules, which helps to
  29. // reduce compilation time.
  30. //
  31. // The template parameter(s) supplied should be identical to the first
  32. // parameter supplied while instantiating the boost::wave::context<> template
  33. // (see the file cpp.cpp).
  34. //
  35. ///////////////////////////////////////////////////////////////////////////////
  36. template struct boost::wave::idllexer::new_lexer_gen<
  37. BOOST_WAVE_STRINGTYPE::iterator>;
  38. #endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0