1 // Copyright (c) 2001-2011 Hartmut Kaiser
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)
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
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>
21 #include <boost/spirit/repository/home/support/flush_multi_pass.hpp>
23 ///////////////////////////////////////////////////////////////////////////////
24 namespace boost { namespace spirit
26 ///////////////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////////////
30 // enables flush_multi_pass
32 struct use_terminal<qi::domain, repository::tag::flush_multi_pass>
37 ///////////////////////////////////////////////////////////////////////////////
38 namespace boost { namespace spirit { namespace repository { namespace qi
40 using repository::flush_multi_pass_type;
41 using repository::flush_multi_pass;
43 ///////////////////////////////////////////////////////////////////////////
44 // for a flush_multi_pass_parser generated parser
45 struct flush_multi_pass_parser
46 : spirit::qi::primitive_parser<flush_multi_pass_parser>
48 template <typename Context, typename Unused>
51 typedef unused_type type;
54 template <typename Iterator, typename Context
55 , typename Skipper, typename Attribute>
56 bool parse(Iterator& first, Iterator const& last
57 , Context& context, Skipper const& skipper
58 , Attribute& attr) const
60 spirit::traits::clear_queue(first, traits::clear_mode::clear_always);
64 template <typename Context>
65 info what(Context const& ctx) const
67 return info("flush_multi_pass");
73 ///////////////////////////////////////////////////////////////////////////////
74 namespace boost { namespace spirit { namespace qi
76 ///////////////////////////////////////////////////////////////////////////
77 // Parser generators: make_xxx function (objects)
78 ///////////////////////////////////////////////////////////////////////////
79 template <typename Modifiers>
80 struct make_primitive<repository::tag::flush_multi_pass, Modifiers>
82 typedef repository::qi::flush_multi_pass_parser result_type;
83 result_type operator()(unused_type, unused_type) const