1 // Copyright (c) 2001-2011 Hartmut Kaiser 2 // 3 // Distributed under the Boost Software License, Version 1.0. (See accompanying 4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 6 #if !defined(BOOST_SPIRIT_REPOSITORY_QI_FLUSH_MULTI_PASS_JUL_10_2009_0535PM) 7 #define BOOST_SPIRIT_REPOSITORY_QI_FLUSH_MULTI_PASS_JUL_10_2009_0535PM 8 9 #if defined(_MSC_VER) 10 #pragma once 11 #endif 12 13 #include <boost/spirit/home/qi/domain.hpp> 14 #include <boost/spirit/home/qi/meta_compiler.hpp> 15 #include <boost/spirit/home/support/common_terminals.hpp> 16 #include <boost/spirit/home/support/info.hpp> 17 #include <boost/spirit/home/support/unused.hpp> 18 #include <boost/spirit/home/support/attributes.hpp> 19 #include <boost/spirit/home/support/multi_pass.hpp> 20 21 #include <boost/spirit/repository/home/support/flush_multi_pass.hpp> 22 23 /////////////////////////////////////////////////////////////////////////////// 24 namespace boost { namespace spirit 25 { 26 /////////////////////////////////////////////////////////////////////////// 27 // Enablers 28 /////////////////////////////////////////////////////////////////////////// 29 30 // enables flush_multi_pass 31 template <> 32 struct use_terminal<qi::domain, repository::tag::flush_multi_pass> 33 : mpl::true_ {}; 34 35 }} 36 37 /////////////////////////////////////////////////////////////////////////////// 38 namespace boost { namespace spirit { namespace repository { namespace qi 39 { 40 #ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS 41 using repository::flush_multi_pass; 42 #endif 43 using repository::flush_multi_pass_type; 44 45 /////////////////////////////////////////////////////////////////////////// 46 // for a flush_multi_pass_parser generated parser 47 struct flush_multi_pass_parser 48 : spirit::qi::primitive_parser<flush_multi_pass_parser> 49 { 50 template <typename Context, typename Unused> 51 struct attribute 52 { 53 typedef unused_type type; 54 }; 55 56 template <typename Iterator, typename Context 57 , typename Skipper, typename Attribute> parseboost::spirit::repository::qi::flush_multi_pass_parser58 bool parse(Iterator& first, Iterator const& last 59 , Context& context, Skipper const& skipper 60 , Attribute& attr) const 61 { 62 spirit::traits::clear_queue(first, traits::clear_mode::clear_always); 63 return true; 64 } 65 66 template <typename Context> whatboost::spirit::repository::qi::flush_multi_pass_parser67 info what(Context const& ctx) const 68 { 69 return info("flush_multi_pass"); 70 } 71 }; 72 73 }}}} 74 75 /////////////////////////////////////////////////////////////////////////////// 76 namespace boost { namespace spirit { namespace qi 77 { 78 /////////////////////////////////////////////////////////////////////////// 79 // Parser generators: make_xxx function (objects) 80 /////////////////////////////////////////////////////////////////////////// 81 template <typename Modifiers> 82 struct make_primitive<repository::tag::flush_multi_pass, Modifiers> 83 { 84 typedef repository::qi::flush_multi_pass_parser result_type; operator ()boost::spirit::qi::make_primitive85 result_type operator()(unused_type, unused_type) const 86 { 87 return result_type(); 88 } 89 }; 90 91 }}} 92 93 #endif 94 95