]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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 | using repository::flush_multi_pass_type; | |
41 | using repository::flush_multi_pass; | |
42 | ||
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> | |
47 | { | |
48 | template <typename Context, typename Unused> | |
49 | struct attribute | |
50 | { | |
51 | typedef unused_type type; | |
52 | }; | |
53 | ||
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 | |
59 | { | |
60 | spirit::traits::clear_queue(first, traits::clear_mode::clear_always); | |
61 | return true; | |
62 | } | |
63 | ||
64 | template <typename Context> | |
65 | info what(Context const& ctx) const | |
66 | { | |
67 | return info("flush_multi_pass"); | |
68 | } | |
69 | }; | |
70 | ||
71 | }}}} | |
72 | ||
73 | /////////////////////////////////////////////////////////////////////////////// | |
74 | namespace boost { namespace spirit { namespace qi | |
75 | { | |
76 | /////////////////////////////////////////////////////////////////////////// | |
77 | // Parser generators: make_xxx function (objects) | |
78 | /////////////////////////////////////////////////////////////////////////// | |
79 | template <typename Modifiers> | |
80 | struct make_primitive<repository::tag::flush_multi_pass, Modifiers> | |
81 | { | |
82 | typedef repository::qi::flush_multi_pass_parser result_type; | |
83 | result_type operator()(unused_type, unused_type) const | |
84 | { | |
85 | return result_type(); | |
86 | } | |
87 | }; | |
88 | ||
89 | }}} | |
90 | ||
91 | #endif | |
92 |