Chris@102
|
1 /*=============================================================================
|
Chris@102
|
2 Copyright (c) 2001-2014 Joel de Guzman
|
Chris@102
|
3 Copyright (c) 2001-2011 Hartmut Kaiser
|
Chris@102
|
4
|
Chris@102
|
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@102
|
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@102
|
7 ==============================================================================*/
|
Chris@102
|
8 #if !defined(BOOST_SPIRIT_X3_EOI_MARCH_23_2007_0454PM)
|
Chris@102
|
9 #define BOOST_SPIRIT_X3_EOI_MARCH_23_2007_0454PM
|
Chris@102
|
10
|
Chris@102
|
11 #if defined(_MSC_VER)
|
Chris@102
|
12 #pragma once
|
Chris@102
|
13 #endif
|
Chris@102
|
14
|
Chris@102
|
15 #include <boost/spirit/home/x3/core/skip_over.hpp>
|
Chris@102
|
16 #include <boost/spirit/home/x3/core/parser.hpp>
|
Chris@102
|
17 #include <boost/spirit/home/x3/support/unused.hpp>
|
Chris@102
|
18
|
Chris@102
|
19 namespace boost { namespace spirit { namespace x3
|
Chris@102
|
20 {
|
Chris@102
|
21 struct eoi_parser : parser<eoi_parser>
|
Chris@102
|
22 {
|
Chris@102
|
23 typedef unused_type attribute_type;
|
Chris@102
|
24 static bool const has_attribute = false;
|
Chris@102
|
25
|
Chris@102
|
26 template <typename Iterator, typename Context, typename Attribute>
|
Chris@102
|
27 bool parse(Iterator& first, Iterator const& last
|
Chris@102
|
28 , Context const& context, unused_type, Attribute&) const
|
Chris@102
|
29 {
|
Chris@102
|
30 x3::skip_over(first, last, context);
|
Chris@102
|
31 return first == last;
|
Chris@102
|
32 }
|
Chris@102
|
33 };
|
Chris@102
|
34
|
Chris@102
|
35 template<>
|
Chris@102
|
36 struct get_info<eoi_parser>
|
Chris@102
|
37 {
|
Chris@102
|
38 typedef std::string result_type;
|
Chris@102
|
39 result_type operator()(eoi_parser const &) const { return "eoi"; }
|
Chris@102
|
40 };
|
Chris@102
|
41
|
Chris@102
|
42 eoi_parser const eoi = eoi_parser();
|
Chris@102
|
43 }}}
|
Chris@102
|
44
|
Chris@102
|
45 #endif
|