comparison DEPENDENCIES/generic/include/boost/spirit/home/x3/directive/omit.hpp @ 102:f46d142149f5

Whoops, finish that update
author Chris Cannam
date Mon, 07 Sep 2015 11:13:41 +0100
parents
children
comparison
equal deleted inserted replaced
101:c530137014c0 102:f46d142149f5
1 /*=============================================================================
2 Copyright (c) 2001-2014 Joel de Guzman
3
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 =============================================================================*/
7 #if !defined(SPIRIT_OMIT_MARCH_24_2007_0802AM)
8 #define SPIRIT_OMIT_MARCH_24_2007_0802AM
9
10 #if defined(_MSC_VER)
11 #pragma once
12 #endif
13
14 #include <boost/spirit/home/x3/support/unused.hpp>
15 #include <boost/spirit/home/x3/core/parser.hpp>
16
17 namespace boost { namespace spirit { namespace x3
18 {
19 ///////////////////////////////////////////////////////////////////////////
20 // omit_directive forces the attribute of subject parser
21 // to be unused_type
22 ///////////////////////////////////////////////////////////////////////////
23 template <typename Subject>
24 struct omit_directive : unary_parser<Subject, omit_directive<Subject>>
25 {
26 typedef unary_parser<Subject, omit_directive<Subject> > base_type;
27 typedef unused_type attribute_type;
28 static bool const has_attribute = false;
29
30 typedef Subject subject_type;
31 omit_directive(Subject const& subject)
32 : base_type(subject) {}
33
34 template <typename Iterator, typename Context, typename RContext>
35 bool parse(Iterator& first, Iterator const& last
36 , Context const& context, RContext& rcontext, unused_type) const
37 {
38 return this->subject.parse(first, last, context, rcontext, unused);
39 }
40 };
41
42 struct omit_gen
43 {
44 template <typename Subject>
45 omit_directive<typename extension::as_parser<Subject>::value_type>
46 operator[](Subject const& subject) const
47 {
48 return {as_parser(subject)};
49 }
50 };
51
52 omit_gen const omit = omit_gen();
53 }}}
54
55 #endif