rule_separate_tu_grammar.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*=============================================================================
  2. Copyright (c) 2019 Nikita Kniazev
  3. Use, modification and distribution is subject to the Boost Software
  4. License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt)
  6. =============================================================================*/
  7. #include "rule_separate_tu_grammar.hpp"
  8. #include <boost/spirit/home/x3.hpp>
  9. namespace unused_attr {
  10. const auto skipper_def = x3::lit('*');
  11. BOOST_SPIRIT_DEFINE(skipper)
  12. BOOST_SPIRIT_INSTANTIATE(skipper_type, char const*, x3::unused_type)
  13. const auto skipper2_def = x3::lit('#');
  14. BOOST_SPIRIT_DEFINE(skipper2)
  15. BOOST_SPIRIT_INSTANTIATE(skipper2_type, char const*, x3::unused_type)
  16. const auto grammar_def = *x3::lit('=');
  17. BOOST_SPIRIT_DEFINE(grammar)
  18. BOOST_SPIRIT_INSTANTIATE(grammar_type, char const*, x3::unused_type)
  19. BOOST_SPIRIT_INSTANTIATE(grammar_type, char const*, x3::phrase_parse_context<skipper_type>::type)
  20. BOOST_SPIRIT_INSTANTIATE(grammar_type, char const*, x3::phrase_parse_context<skipper2_type>::type)
  21. }
  22. namespace used_attr {
  23. const auto skipper_def = x3::space;
  24. BOOST_SPIRIT_DEFINE(skipper)
  25. BOOST_SPIRIT_INSTANTIATE(skipper_type, char const*, x3::unused_type)
  26. const auto grammar_def = x3::int_;
  27. BOOST_SPIRIT_DEFINE(grammar)
  28. BOOST_SPIRIT_INSTANTIATE(grammar_type, char const*, x3::unused_type)
  29. BOOST_SPIRIT_INSTANTIATE(grammar_type, char const*, x3::phrase_parse_context<skipper_type>::type)
  30. }