1 /*=============================================================================
2 Copyright (c) 2001-2011 Hartmut Kaiser
3 Copyright (c) 2001-2011 Joel de Guzman
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(BOOST_SPIRIT_EOI_APRIL_18_2008_0751PM)
9 #define BOOST_SPIRIT_EOI_APRIL_18_2008_0751PM
15 #include <boost/mpl/bool.hpp>
16 #include <boost/spirit/home/qi/domain.hpp>
17 #include <boost/spirit/home/qi/parser.hpp>
18 #include <boost/spirit/home/qi/meta_compiler.hpp>
19 #include <boost/spirit/home/qi/skip_over.hpp>
20 #include <boost/spirit/home/support/common_terminals.hpp>
22 namespace boost { namespace spirit
24 ///////////////////////////////////////////////////////////////////////////
26 ///////////////////////////////////////////////////////////////////////////
28 struct use_terminal<qi::domain, tag::eoi> // enables eoi
32 namespace boost { namespace spirit { namespace qi
34 #ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
37 using spirit::eoi_type;
39 struct eoi_parser : primitive_parser<eoi_parser>
41 template <typename Context, typename Iterator>
44 typedef unused_type type;
47 template <typename Iterator, typename Context
48 , typename Skipper, typename Attribute>
49 bool parse(Iterator& first, Iterator const& last
50 , Context& /*context*/, Skipper const& skipper
51 , Attribute& /*attr*/) const
53 qi::skip_over(first, last, skipper);
57 template <typename Context>
58 info what(Context& /*context*/) const
64 ///////////////////////////////////////////////////////////////////////////
65 // Parser generators: make_xxx function (objects)
66 ///////////////////////////////////////////////////////////////////////////
67 template <typename Modifiers>
68 struct make_primitive<tag::eoi, Modifiers>
70 typedef eoi_parser result_type;
71 result_type operator()(unused_type, unused_type) const