instantiate_cpp_literalgrs.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. Sample: prints out the preprocessed tokens returned by the pp iterator
  4. http://www.boost.org/
  5. Copyright (c) 2001-2012 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 "cpp_tokens.hpp" // config data
  10. #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0
  11. #include <string>
  12. #include <boost/wave/token_ids.hpp>
  13. #include "slex_token.hpp"
  14. #include "slex_iterator.hpp"
  15. #include <boost/wave/grammars/cpp_literal_grammar_gen.hpp>
  16. #include <boost/wave/grammars/cpp_intlit_grammar.hpp>
  17. #include <boost/wave/grammars/cpp_chlit_grammar.hpp>
  18. ///////////////////////////////////////////////////////////////////////////////
  19. //
  20. // Explicit instantiation of the intlit_grammar_gen, chlit_grammar_gen and
  21. // floatlit_grammar_gen templates with the correct token type. This
  22. // instantiates the corresponding parse function, which in turn instantiates
  23. // the corresponding parser object.
  24. //
  25. ///////////////////////////////////////////////////////////////////////////////
  26. typedef boost::wave::cpplexer::slex_token<> token_type;
  27. template struct boost::wave::grammars::intlit_grammar_gen<token_type>;
  28. #if BOOST_WAVE_WCHAR_T_SIGNEDNESS == BOOST_WAVE_WCHAR_T_AUTOSELECT || \
  29. BOOST_WAVE_WCHAR_T_SIGNEDNESS == BOOST_WAVE_WCHAR_T_FORCE_SIGNED
  30. template struct boost::wave::grammars::chlit_grammar_gen<int, token_type>;
  31. #endif
  32. template struct boost::wave::grammars::chlit_grammar_gen<unsigned int, token_type>;
  33. #endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0